diff options
author | Ted Gould <ted@gould.cx> | 2010-11-11 09:25:43 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-11-11 09:25:43 -0600 |
commit | 69960b2da287fcd59b002fbee6083506df1784f9 (patch) | |
tree | 6690de70620175fe5d4a6b2f89b3b6b2d05abd37 /tools | |
parent | ecc6acd2a576fcc11d51ded532f570fb29ab475e (diff) | |
parent | 022e4bfbcb06a66552007abc8f9f329ce86c9995 (diff) | |
download | libayatana-indicator-69960b2da287fcd59b002fbee6083506df1784f9.tar.gz libayatana-indicator-69960b2da287fcd59b002fbee6083506df1784f9.tar.bz2 libayatana-indicator-69960b2da287fcd59b002fbee6083506df1784f9.zip |
Merging in trunk to solve conflicts
Diffstat (limited to 'tools')
-rw-r--r-- | tools/80indicator-debugging | 14 | ||||
-rw-r--r-- | tools/Makefile.am | 5 | ||||
-rw-r--r-- | tools/indicator-loader.c | 21 |
3 files changed, 40 insertions, 0 deletions
diff --git a/tools/80indicator-debugging b/tools/80indicator-debugging new file mode 100644 index 0000000..f21559c --- /dev/null +++ b/tools/80indicator-debugging @@ -0,0 +1,14 @@ +# These are environment variables that effect the behavior +# of libindicator's service manager and indicator service +# objects. They turn off various robustness features that +# make debugging difficult and are not recommended for +# daily use. Development use only! + +# Timeout after 1 minute +export INDICATOR_SERVICE_SHUTDOWN_TIMEOUT=60000 + +# If no one connects, still stay alive +export INDICATOR_ALLOW_NO_WATCHERS=1 + +# Don't restart the services if they crash +export INDICATOR_SERVICE_RESTART_DISABLE=1 diff --git a/tools/Makefile.am b/tools/Makefile.am index d2964f9..6c67491 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -24,3 +24,8 @@ indicator_loader_LDADD = \ -L$(top_builddir)/libindicator/.libs \ $(INDICATOR_LIB) +xsessiondir = $(sysconfdir)/X11/Xsession.d + +xsession_DATA = 80indicator-debugging + +EXTRA_DIST = $(xsession_DATA) diff --git a/tools/indicator-loader.c b/tools/indicator-loader.c index 0f4a7be..03614aa 100644 --- a/tools/indicator-loader.c +++ b/tools/indicator-loader.c @@ -28,6 +28,17 @@ License along with this library. If not, see #define ENTRY_DATA_NAME "indicator-custom-entry-data" static void +activate_entry (GtkWidget * widget, gpointer user_data) +{ + g_return_if_fail(INDICATOR_IS_OBJECT(user_data)); + gpointer entry = g_object_get_data(G_OBJECT(widget), ENTRY_DATA_NAME); + g_return_if_fail(entry == NULL); + + indicator_object_entry_activate(INDICATOR_OBJECT(user_data), (IndicatorObjectEntry *)entry, gtk_get_current_event_time()); + return; +} + +static void entry_added (IndicatorObject * io, IndicatorObjectEntry * entry, gpointer user_data) { g_debug("Signal: Entry Added"); @@ -48,6 +59,8 @@ entry_added (IndicatorObject * io, IndicatorObjectEntry * entry, gpointer user_d gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), GTK_WIDGET(entry->menu)); } + g_signal_connect(G_OBJECT(menuitem), "activate", G_CALLBACK(activate_entry), io); + gtk_menu_shell_append(GTK_MENU_SHELL(user_data), menuitem); gtk_widget_show(menuitem); @@ -79,6 +92,13 @@ entry_removed (IndicatorObject * io, IndicatorObjectEntry * entry, gpointer user return; } +static void +menu_show (IndicatorObject * io, IndicatorObjectEntry * entry, guint timestamp, gpointer user_data) +{ + g_debug("Show Menu: %s", entry->label != NULL ? gtk_label_get_text(entry->label) : "No Label"); + return; +} + static gboolean load_module (const gchar * name, GtkWidget * menu) { @@ -97,6 +117,7 @@ load_module (const gchar * name, GtkWidget * menu) /* Connect to it's signals */ g_signal_connect(G_OBJECT(io), INDICATOR_OBJECT_SIGNAL_ENTRY_ADDED, G_CALLBACK(entry_added), menu); g_signal_connect(G_OBJECT(io), INDICATOR_OBJECT_SIGNAL_ENTRY_REMOVED, G_CALLBACK(entry_removed), menu); + g_signal_connect(G_OBJECT(io), INDICATOR_OBJECT_SIGNAL_MENU_SHOW, G_CALLBACK(menu_show), NULL); /* Work on the entries */ GList * entries = indicator_object_get_entries(io); |