quick-lounge-applet r238 - in trunk: . src
- From: paobac svn gnome org
- To: svn-commits-list gnome org
- Subject: quick-lounge-applet r238 - in trunk: . src
- Date: Mon, 2 Feb 2009 11:32:53 +0000 (UTC)
Author: paobac
Date: Mon Feb 2 11:32:53 2009
New Revision: 238
URL: http://svn.gnome.org/viewvc/quick-lounge-applet?rev=238&view=rev
Log:
2009-02-02 Paolo Bacchilega <paobac svn gnome org>
* src/quick-box.c: use $(HOME) as path if not specified in the
desktop entry.
Modified:
trunk/ChangeLog
trunk/src/quick-box.c
Modified: trunk/src/quick-box.c
==============================================================================
--- trunk/src/quick-box.c (original)
+++ trunk/src/quick-box.c Mon Feb 2 11:32:53 2009
@@ -601,8 +601,8 @@
/* center vertically */
initial_y = (allocation->height - (get_child_size (quick_box) + ICON_SPACING) * quick_box->priv->rows) / 2;
-
- } else {
+ }
+ else {
/* center horizontally */
initial_x = (allocation->width - (get_child_size (quick_box) + ICON_SPACING) * quick_box->priv->rows) / 2;
@@ -637,7 +637,8 @@
GtkAllocation child_allocation;
if (ignoring_arrow
- && last_n_child (quick_box, child_widget, under_arrow_children)) {
+ && last_n_child (quick_box, child_widget, under_arrow_children))
+ {
ignoring_arrow = FALSE;
if (orientation == GTK_ORIENTATION_HORIZONTAL)
max_width += arrow_width + spacing;
@@ -670,11 +671,13 @@
do_not_fit = TRUE;
hide_from_here = scan;
}
- } else if (current_height > max_height) { /* new row */
+ }
+ else if (current_height > max_height) { /* new row */
if (second_try) {
do_not_fit = TRUE;
hide_from_here = scan;
- } else {
+ }
+ else {
x += max_line_width + spacing;
y = initial_y;
current_height = border_width;
@@ -683,7 +686,8 @@
continue;
}
}
- } else {
+ }
+ else {
#ifdef DEBUG
g_print ("\n");
@@ -697,11 +701,13 @@
do_not_fit = TRUE;
hide_from_here = scan;
}
- } else if (current_width > max_width) { /* new row */
+ }
+ else if (current_width > max_width) { /* new row */
if (second_try) {
do_not_fit = TRUE;
hide_from_here = scan;
- } else {
+ }
+ else {
x = initial_x;
y += max_line_height + spacing;
current_width = border_width;
@@ -718,7 +724,8 @@
max_line_width = MAX (max_line_width, child_allocation.width);
current_height += spacing;
y += child_allocation.width + spacing;
- } else {
+ }
+ else {
max_line_height = MAX (max_line_height, child_allocation.height);
current_width += spacing;
x += child_allocation.height + spacing;
@@ -736,7 +743,8 @@
child_allocation.y = border_width + 1;
child_allocation.width = arrow_width;
child_allocation.height = height - 1;
- } else {
+ }
+ else {
child_allocation.x = border_width + 1;
child_allocation.y = allocation->height - arrow_height;
child_allocation.width = width - 1;
@@ -750,7 +758,8 @@
quick_box_forall_arrows (quick_box,
(GtkCallback) hide_non_current_arrow_cb,
quick_box);
- } else
+ }
+ else
quick_box_forall_arrows (quick_box,
(GtkCallback) hide_all_arrows_cb,
NULL);
@@ -758,7 +767,8 @@
if (do_not_fit) {
children_to_hide = MAX (g_list_length (hide_from_here), under_arrow_children);
hide_last_n_children (quick_box, children_to_hide);
- } else
+ }
+ else
children_to_hide = 0;
n_children = g_list_length (children);
@@ -771,7 +781,8 @@
widget->allocation.width = allocation->width;
else
widget->allocation.width = x + max_line_width + spacing;
- } else {
+ }
+ else {
if (do_not_fit)
widget->allocation.height = allocation->height;
else
@@ -964,21 +975,30 @@
_g_desktop_entry_launch (GKeyFile *desktop_entry,
GtkWidget *source)
{
+ GKeyFile *key_file;
+ char *path;
GDesktopAppInfo *app_info;
GdkAppLaunchContext *context;
GError *error = NULL;
- app_info = g_desktop_app_info_new_from_keyfile (desktop_entry);
+ key_file = _g_key_file_dup (desktop_entry);
+ path = g_key_file_get_string (key_file, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_PATH, NULL);
+ if (path == NULL)
+ g_key_file_set_string (key_file, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_PATH, g_get_home_dir ());
+ g_free (path);
+
+ app_info = g_desktop_app_info_new_from_keyfile (key_file);
context = gdk_app_launch_context_new ();
- if (! g_app_info_launch (G_APP_INFO (app_info), NULL, G_APP_LAUNCH_CONTEXT (context), &error)) {
- _gtk_error_dialog_from_gerror_run (NULL, &error);
- }
- else if ((source != NULL) && enable_animations ())
+ if ((source != NULL) && enable_animations ())
xstuff_zoom_animate (source, NULL);
-
+
+ if (! g_app_info_launch (G_APP_INFO (app_info), NULL, G_APP_LAUNCH_CONTEXT (context), &error))
+ _gtk_error_dialog_from_gerror_run (NULL, &error);
+
g_object_unref (context);
g_object_unref (app_info);
+ g_key_file_free (key_file);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]