diff options
-rw-r--r-- | Makefile.am | 3 | ||||
-rw-r--r-- | debian/changelog | 8 | ||||
-rw-r--r-- | example/simple-client.c | 4 | ||||
-rw-r--r-- | src/libappindicator/app-indicator.c | 36 |
4 files changed, 46 insertions, 5 deletions
diff --git a/Makefile.am b/Makefile.am index a9b445c..4d38ef8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -11,7 +11,8 @@ EXTRA_DIST = \ xmldocs.make \ autogen.sh \ COPYING.LGPL.2.1 \ - COPYING.LGPL.3 + COPYING.LGPL.3 \ + ChangeLog DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-localinstall diff --git a/debian/changelog b/debian/changelog index 18a515a..82413e6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +indicator-application (0.0.6-0ubuntu1~ppa2) UNRELEASED; urgency=low + + * Upstream update + * Adding ChangeLog to dist + * Adding check item support to menu parsing + + -- Ted Gould <ted@ubuntu.com> Thu, 07 Jan 2010 13:35:18 -0600 + indicator-application (0.0.6-0ubuntu1~ppa1) karmic; urgency=low * Upstream release 0.0.6 diff --git a/example/simple-client.c b/example/simple-client.c index ea4da9d..8ce9fba 100644 --- a/example/simple-client.c +++ b/example/simple-client.c @@ -53,12 +53,12 @@ main (int argc, char ** argv) app_indicator_set_attention_icon(ci, "indicator-messages-new"); menu = gtk_menu_new (); - GtkWidget *item = gtk_menu_item_new_with_label ("1"); + GtkWidget *item = gtk_check_menu_item_new_with_label ("1"); g_signal_connect (item, "activate", G_CALLBACK (item_clicked_cb), "1"); gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); - item = gtk_menu_item_new_with_label ("2"); + item = gtk_radio_menu_item_new_with_label (NULL, "2"); g_signal_connect (item, "activate", G_CALLBACK (item_clicked_cb), "2"); gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); diff --git a/src/libappindicator/app-indicator.c b/src/libappindicator/app-indicator.c index bb68cb2..ec598db 100644 --- a/src/libappindicator/app-indicator.c +++ b/src/libappindicator/app-indicator.c @@ -660,6 +660,14 @@ activate_menuitem (DbusmenuMenuitem *mi, gpointer user_data) } static void +widget_toggled (GtkWidget *widget, DbusmenuMenuitem *mi) +{ + dbusmenu_menuitem_property_set (mi, + DBUSMENU_MENUITEM_PROP_TOGGLE_CHECKED, + gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (widget)) ? DBUSMENU_MENUITEM_TOGGLE_STATE_CHECKED : DBUSMENU_MENUITEM_TOGGLE_STATE_UNCHECKED); +} + +static void menuitem_iterate (GtkWidget *widget, gpointer data) { @@ -692,9 +700,33 @@ container_iterate (GtkWidget *widget, } else { - label = gtk_menu_item_get_label (GTK_MENU_ITEM (widget)); + if (GTK_IS_CHECK_MENU_ITEM (widget)) + { + GtkCheckMenuItem *check; + + check = GTK_CHECK_MENU_ITEM (widget); + label = gtk_menu_item_get_label (GTK_MENU_ITEM (widget)); + + dbusmenu_menuitem_property_set (child, + DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE, + GTK_IS_RADIO_MENU_ITEM (widget) ? DBUSMENU_MENUITEM_TOGGLE_RADIO : DBUSMENU_MENUITEM_TOGGLE_CHECK); - if (GTK_IS_IMAGE_MENU_ITEM (widget)) + dbusmenu_menuitem_property_set (child, + DBUSMENU_MENUITEM_PROP_LABEL, + label); + + label_set = TRUE; + + dbusmenu_menuitem_property_set (child, + DBUSMENU_MENUITEM_PROP_TOGGLE_CHECKED, + gtk_check_menu_item_get_active (check) ? DBUSMENU_MENUITEM_TOGGLE_STATE_CHECKED : DBUSMENU_MENUITEM_TOGGLE_STATE_UNCHECKED); + + g_signal_connect (widget, + "toggled", + G_CALLBACK (widget_toggled), + child); + } + else if (GTK_IS_IMAGE_MENU_ITEM (widget)) { GtkWidget *image = gtk_image_menu_item_get_image (GTK_IMAGE_MENU_ITEM (widget)); |