aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-06-19 15:32:49 -0500
committerTed Gould <ted@canonical.com>2009-06-19 15:32:49 -0500
commit2cb6204a90437626211aa4337942d3f072985756 (patch)
treefd32422fd8b9956d203bb861ebf8beab338311df
parent901278c9c269c5052cf5ebc54ef859c63f0b94f2 (diff)
downloadayatana-indicator-session-2cb6204a90437626211aa4337942d3f072985756.tar.gz
ayatana-indicator-session-2cb6204a90437626211aa4337942d3f072985756.tar.bz2
ayatana-indicator-session-2cb6204a90437626211aa4337942d3f072985756.zip
Showing the added menu and adding in a loading item.
-rw-r--r--src/indicator-sus.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/indicator-sus.c b/src/indicator-sus.c
index d8b808a..84eb929 100644
--- a/src/indicator-sus.c
+++ b/src/indicator-sus.c
@@ -20,6 +20,7 @@ static GtkMenu * main_menu = NULL;
static GtkWidget * status_separator = NULL;
static GtkWidget * users_separator = NULL;
#define SEPARATOR_SHOWN(sep) (sep != NULL && GTK_WIDGET_VISIBLE(sep))
+static GtkWidget * loading_item = NULL;
static DBusGConnection * connection = NULL;
static DBusGProxy * proxy = NULL;
@@ -44,8 +45,13 @@ menu_add (GtkContainer * source, GtkWidget * addee, GtkMenu * addto, guint posit
guint position = g_list_position(GTK_MENU_SHELL(source)->children, location);
position += positionoffset;
+ g_debug("Adding a widget: %d", position);
gtk_menu_insert(addto, addee, position);
+ gtk_widget_show(addee);
+
+ gtk_widget_hide(loading_item);
+
return;
}
@@ -81,7 +87,6 @@ session_menu_add (GtkContainer * container, GtkWidget * widget, gpointer userdat
}
menu_add(container, widget, GTK_MENU(userdata), position);
- gtk_widget_show(status_separator);
return;
}
@@ -112,6 +117,7 @@ build_status_menu (gpointer userdata)
g_signal_connect(G_OBJECT(status_menu), "add", G_CALLBACK(status_menu_add), main_menu);
status_separator = gtk_separator_menu_item_new();
+ gtk_menu_shell_append(GTK_MENU_SHELL(main_menu), status_separator);
gtk_widget_hide(status_separator); /* Should be default, I'm just being explicit. $(%*#$ hide already! */
return FALSE;
@@ -143,6 +149,7 @@ build_users_menu (gpointer userdata)
g_signal_connect(G_OBJECT(users_menu), "add", G_CALLBACK(users_menu_add), main_menu);
users_separator = gtk_separator_menu_item_new();
+ gtk_menu_shell_append(GTK_MENU_SHELL(main_menu), users_separator);
gtk_widget_hide(users_separator); /* Should be default, I'm just being explicit. $(%*#$ hide already! */
return FALSE;
@@ -187,6 +194,8 @@ get_menu (void)
g_idle_add(build_session_menu, NULL);
main_menu = GTK_MENU(gtk_menu_new());
+ loading_item = gtk_menu_item_new_with_label("Loading...");
+ gtk_menu_shell_append(GTK_MENU_SHELL(main_menu), loading_item);
return main_menu;
}