aboutsummaryrefslogtreecommitdiff
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
parent13de14e2a1944a8bee33bdd574924e0d9c8c66ed (diff)
parentab7949f8ed0d70686453a2e5c124e9095e8c19f7 (diff)
downloadlibayatana-appindicator-458b67c8caa792c8176d494095c7eddd72600bf1.tar.gz
libayatana-appindicator-458b67c8caa792c8176d494095c7eddd72600bf1.tar.bz2
libayatana-appindicator-458b67c8caa792c8176d494095c7eddd72600bf1.zip
Sync to karmic packaging branch
-rw-r--r--debian/changelog16
-rw-r--r--example/simple-client.c4
-rw-r--r--src/application-service-watcher.c18
-rw-r--r--src/dbus-shared.h9
-rw-r--r--src/libappindicator/app-indicator.c38
-rw-r--r--src/libappindicator/app-indicator.h4
-rw-r--r--src/notification-item.xml4
-rw-r--r--src/notification-watcher.xml8
8 files changed, 79 insertions, 22 deletions
diff --git a/debian/changelog b/debian/changelog
index b6ebc19..f8b3b9a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -16,6 +16,22 @@ indicator-application (0.0.6-0ubuntu1~ppa2~icon1) karmic; urgency=low
-- Ted Gould <ted@ubuntu.com> Sun, 20 Dec 2009 22:20:35 -0600
+indicator-application (0.0.6-0ubuntu1~ppa3) karmic; urgency=low
+
+ * Upstream update
+ * Switching DBus interface to org.freedesktop
+ * Adding check/radio support to menu parsing
+
+ -- Ted Gould <ted@ubuntu.com> Fri, 08 Jan 2010 11:02:09 -0600
+
+indicator-application (0.0.6-0ubuntu1~ppa2) karmic; 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:58:33 -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/application-service-watcher.c b/src/application-service-watcher.c
index 984b9d4..1ad59d4 100644
--- a/src/application-service-watcher.c
+++ b/src/application-service-watcher.c
@@ -29,8 +29,8 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include "application-service-watcher.h"
#include "dbus-shared.h"
-static gboolean _notification_watcher_server_register_service (ApplicationServiceWatcher * appwatcher, const gchar * service, DBusGMethodInvocation * method);
-static gboolean _notification_watcher_server_registered_services (ApplicationServiceWatcher * appwatcher, GArray ** apps);
+static gboolean _notification_watcher_server_register_status_notifier_item (ApplicationServiceWatcher * appwatcher, const gchar * service, DBusGMethodInvocation * method);
+static gboolean _notification_watcher_server_registered_status_notifier_items (ApplicationServiceWatcher * appwatcher, GArray ** apps);
static gboolean _notification_watcher_server_protocol_version (ApplicationServiceWatcher * appwatcher, char ** version);
static gboolean _notification_watcher_server_register_notification_host (ApplicationServiceWatcher * appwatcher, const gchar * host);
static gboolean _notification_watcher_server_is_notification_host_registered (ApplicationServiceWatcher * appwatcher, gboolean * haveHost);
@@ -165,18 +165,26 @@ application_service_watcher_new (ApplicationServiceAppstore * appstore)
}
static gboolean
-_notification_watcher_server_register_service (ApplicationServiceWatcher * appwatcher, const gchar * service, DBusGMethodInvocation * method)
+_notification_watcher_server_register_status_notifier_item (ApplicationServiceWatcher * appwatcher, const gchar * service, DBusGMethodInvocation * method)
{
ApplicationServiceWatcherPrivate * priv = APPLICATION_SERVICE_WATCHER_GET_PRIVATE(appwatcher);
- application_service_appstore_application_add(priv->appstore, dbus_g_method_get_sender(method), service);
+ if (service[0] == '/') {
+ application_service_appstore_application_add(priv->appstore,
+ dbus_g_method_get_sender(method),
+ service);
+ } else {
+ application_service_appstore_application_add(priv->appstore,
+ service,
+ NOTIFICATION_ITEM_DEFAULT_OBJ);
+ }
dbus_g_method_return(method, G_TYPE_NONE);
return TRUE;
}
static gboolean
-_notification_watcher_server_registered_services (ApplicationServiceWatcher * appwatcher, GArray ** apps)
+_notification_watcher_server_registered_status_notifier_items (ApplicationServiceWatcher * appwatcher, GArray ** apps)
{
return FALSE;
diff --git a/src/dbus-shared.h b/src/dbus-shared.h
index f888e02..efc57a4 100644
--- a/src/dbus-shared.h
+++ b/src/dbus-shared.h
@@ -20,12 +20,13 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#define INDICATOR_APPLICATION_DBUS_ADDR "org.ayatana.indicator.application"
+#define INDICATOR_APPLICATION_DBUS_ADDR "org.freedesktop.StatusNotifierWatcher"
#define INDICATOR_APPLICATION_DBUS_OBJ "/org/ayatana/indicator/application/service"
#define INDICATOR_APPLICATION_DBUS_IFACE "org.ayatana.indicator.application.service"
-#define NOTIFICATION_WATCHER_DBUS_OBJ "/org/ayatana/indicator/application/NotificationWatcher"
-#define NOTIFICATION_WATCHER_DBUS_IFACE "org.ayatana.indicator.application.NotificationWatcher"
+#define NOTIFICATION_WATCHER_DBUS_OBJ "/StatusNotifierWatcher"
+#define NOTIFICATION_WATCHER_DBUS_IFACE "org.freedesktop.StatusNotifierWatcher"
-#define NOTIFICATION_ITEM_DBUS_IFACE "org.ayatana.indicator.application.NotificationItem"
+#define NOTIFICATION_ITEM_DBUS_IFACE "org.freedesktop.StatusNotifierItem"
+#define NOTIFICATION_ITEM_DEFAULT_OBJ "/StatusNotifierItem"
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,
diff --git a/src/notification-item.xml b/src/notification-item.xml
index b671e38..6b3eeee 100644
--- a/src/notification-item.xml
+++ b/src/notification-item.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<node name="/">
- <interface name="org.ayatana.indicator.application.NotificationItem">
+<node name="/StatusNotifierItem">
+ <interface name="org.freedesktop.StatusNotifierItem">
<!-- Properties -->
<property name="Id" type="s" access="read" />
diff --git a/src/notification-watcher.xml b/src/notification-watcher.xml
index 2ef54a0..22ada5f 100644
--- a/src/notification-watcher.xml
+++ b/src/notification-watcher.xml
@@ -1,16 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
-<node name="/">
- <interface name="org.ayatana.indicator.application.NotificationWatcher">
+<node name="/StatusNotifierWatcher">
+ <interface name="org.freedesktop.StatusNotifierWatcher">
<!-- Properties -->
<!-- None currently -->
<!-- Methods -->
- <method name="RegisterService">
+ <method name="RegisterStatusNotifierItem">
<annotation name="org.freedesktop.DBus.GLib.Async" value="true" />
<arg type="s" name="service" direction="in" />
</method>
- <method name="RegisteredServices">
+ <method name="RegisteredStatusNotifierItems">
<arg type="as" name="services" direction="out" />
</method>
<method name="ProtocolVersion">