aboutsummaryrefslogtreecommitdiff
path: root/src/libappindicator
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-01-08 11:03:33 -0600
committerTed Gould <ted@gould.cx>2010-01-08 11:03:33 -0600
commit458b67c8caa792c8176d494095c7eddd72600bf1 (patch)
treeb06f1b8a5828b09f5a6cc1b980a8c1897dce5c59 /src/libappindicator
parent13de14e2a1944a8bee33bdd574924e0d9c8c66ed (diff)
parentab7949f8ed0d70686453a2e5c124e9095e8c19f7 (diff)
downloadlibayatana-appindicator-458b67c8caa792c8176d494095c7eddd72600bf1.tar.gz
libayatana-appindicator-458b67c8caa792c8176d494095c7eddd72600bf1.tar.bz2
libayatana-appindicator-458b67c8caa792c8176d494095c7eddd72600bf1.zip
Sync to karmic packaging branch
Diffstat (limited to 'src/libappindicator')
-rw-r--r--src/libappindicator/app-indicator.c38
-rw-r--r--src/libappindicator/app-indicator.h4
2 files changed, 37 insertions, 5 deletions
diff --git a/src/libappindicator/app-indicator.c b/src/libappindicator/app-indicator.c
index d22161c..f1a363c 100644
--- a/src/libappindicator/app-indicator.c
+++ b/src/libappindicator/app-indicator.c
@@ -541,7 +541,7 @@ check_connect (AppIndicator *self)
return;
}
- org_ayatana_indicator_application_NotificationWatcher_register_service_async(priv->watcher_proxy, "/need/a/path", register_service_cb, self);
+ org_freedesktop_StatusNotifierWatcher_register_status_notifier_item_async(priv->watcher_proxy, "/need/a/path", register_service_cb, self);
return;
}
@@ -718,6 +718,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)
{
@@ -750,9 +758,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));
diff --git a/src/libappindicator/app-indicator.h b/src/libappindicator/app-indicator.h
index 52438f6..a680c33 100644
--- a/src/libappindicator/app-indicator.h
+++ b/src/libappindicator/app-indicator.h
@@ -128,8 +128,8 @@ typedef enum { /*< prefix=APP_INDICATOR_CATEGORY >*/
These are the states that the indicator can be on in
the user's panel. The indicator by default starts
- in the state @APP_INDICATOR_STATUS_OFF and can be
- shown by setting it to @APP_INDICATOR_STATUS_ON.
+ in the state @APP_INDICATOR_STATUS_PASSIVE and can be
+ shown by setting it to @APP_INDICATOR_STATUS_ACTIVE.
*/
typedef enum { /*< prefix=APP_INDICATOR_STATUS >*/
APP_INDICATOR_STATUS_PASSIVE,