From 929d2e85781fb8bcb942d42e666d36277ea88bf6 Mon Sep 17 00:00:00 2001 From: Ken VanDine Date: Thu, 17 Dec 2009 16:54:56 -0500 Subject: include ChangeLog in EXTRA_DIST --- Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3 From 8d4ca51e188f83fac7c4c6c941b15e217ae8c336 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Sun, 20 Dec 2009 16:56:09 -0600 Subject: Adding of a new property, icon path, to store the path to the icons. --- src/notification-item.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/notification-item.xml b/src/notification-item.xml index c28cc54..b671e38 100644 --- a/src/notification-item.xml +++ b/src/notification-item.xml @@ -8,6 +8,7 @@ + -- cgit v1.2.3 From 2f82dde7ca1c76ffd665120ea5576c46c353b6f1 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Sun, 20 Dec 2009 17:04:29 -0600 Subject: Adding the icon_path property to the code. --- src/libappindicator/app-indicator.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/libappindicator/app-indicator.c b/src/libappindicator/app-indicator.c index bb68cb2..536de59 100644 --- a/src/libappindicator/app-indicator.c +++ b/src/libappindicator/app-indicator.c @@ -63,6 +63,7 @@ struct _AppIndicatorPrivate { AppIndicatorStatus status; gchar *icon_name; gchar *attention_icon_name; + gchar * icon_path; DbusmenuServer *menuservice; GtkWidget *menu; @@ -91,6 +92,7 @@ enum { PROP_STATUS, PROP_ICON_NAME, PROP_ATTENTION_ICON_NAME, + PROP_ICON_PATH, PROP_MENU, PROP_CONNECTED }; @@ -101,6 +103,7 @@ enum { #define PROP_STATUS_S "status" #define PROP_ICON_NAME_S "icon-name" #define PROP_ATTENTION_ICON_NAME_S "attention-icon-name" +#define PROP_ICON_PATH_S "icon-path" #define PROP_MENU_S "menu" #define PROP_CONNECTED_S "connected" @@ -179,6 +182,14 @@ app_indicator_class_init (AppIndicatorClass *klass) NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_object_class_install_property(object_class, + PROP_ICON_PATH, + g_param_spec_string (PROP_ICON_PATH_S, + "An additional path for custom icons.", + "An additional place to look for icon names that may be installed by the application.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_object_class_install_property(object_class, PROP_MENU, g_param_spec_string (PROP_MENU_S, @@ -277,6 +288,7 @@ app_indicator_init (AppIndicator *self) priv->status = APP_INDICATOR_STATUS_PASSIVE; priv->icon_name = NULL; priv->attention_icon_name = NULL; + priv->icon_path = NULL; priv->menu = NULL; priv->menuservice = NULL; @@ -355,6 +367,11 @@ app_indicator_finalize (GObject *object) priv->attention_icon_name = NULL; } + if (priv->icon_path != NULL) { + g_free(priv->icon_path); + priv->icon_path = NULL; + } + G_OBJECT_CLASS (app_indicator_parent_class)->finalize (object); return; } @@ -423,6 +440,13 @@ app_indicator_set_property (GObject * object, guint prop_id, const GValue * valu g_value_get_string (value)); break; + case PROP_ICON_PATH: + if (icon_path != NULL) { + g_free(icon_path); + } + priv->icon_path = g_value_dup_string(value); + break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -462,6 +486,10 @@ app_indicator_get_property (GObject * object, guint prop_id, GValue * value, GPa g_value_set_string (value, priv->attention_icon_name); break; + case PROP_ICON_PATH: + g_value_set_string (value, priv->icon_path); + break; + case PROP_MENU: if (G_VALUE_HOLDS_STRING(value)) { if (priv->menuservice != NULL) { -- cgit v1.2.3 From c44c00bdd91e0e5bf3010b0a7ac511b60c443370 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Sun, 20 Dec 2009 17:11:23 -0600 Subject: Making the icon-path property construct only and making a constructor to set it. --- src/libappindicator/app-indicator.c | 34 ++++++++++++++++++++++++++++++++-- src/libappindicator/app-indicator.h | 4 ++++ 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/src/libappindicator/app-indicator.c b/src/libappindicator/app-indicator.c index 536de59..1756687 100644 --- a/src/libappindicator/app-indicator.c +++ b/src/libappindicator/app-indicator.c @@ -183,12 +183,12 @@ app_indicator_class_init (AppIndicatorClass *klass) G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property(object_class, - PROP_ICON_PATH, + PROP_ICON_PATH, g_param_spec_string (PROP_ICON_PATH_S, "An additional path for custom icons.", "An additional place to look for icon names that may be installed by the application.", NULL, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property(object_class, PROP_MENU, @@ -600,6 +600,36 @@ app_indicator_new (const gchar *id, return indicator; } +/** + app_indicator_new_with_path: + @id: The unique id of the indicator to create. + @icon_name: The icon name for this indicator + @category: The category of indicator. + @icon_path: A custom path for finding icons. + + Creates a new #AppIndicator setting the properties: + #AppIndicator::id with @id, #AppIndicator::category + with @category, #AppIndicator::icon-name with + @icon_name and #AppIndicator::icon-path with @icon_path. + + Return value: A pointer to a new #AppIndicator object. + */ +AppIndicator * +app_indicator_new_with_path (const gchar *id, + const gchar *icon_name, + AppIndicatorCategory category, + const gchar *icon_path) +{ + AppIndicator *indicator = g_object_new (APP_INDICATOR_TYPE, + "id", id, + "category", category_from_enum (category), + "icon-name", icon_name, + "icon-path", icon_path, + NULL); + + return indicator; +} + /** app_indicator_get_type: diff --git a/src/libappindicator/app-indicator.h b/src/libappindicator/app-indicator.h index e966a49..52438f6 100644 --- a/src/libappindicator/app-indicator.h +++ b/src/libappindicator/app-indicator.h @@ -202,6 +202,10 @@ GType app_indicator_get_type (void) G_GNUC_C AppIndicator *app_indicator_new (const gchar *id, const gchar *icon_name, AppIndicatorCategory category); +AppIndicator *app_indicator_new_with_path (const gchar *id, + const gchar *icon_name, + AppIndicatorCategory category, + const gchar *icon_path); /* Set properties */ void app_indicator_set_status (AppIndicator *self, -- cgit v1.2.3 From b3542e0f35267b102155566710c4da5a025db975 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Sun, 20 Dec 2009 17:13:23 -0600 Subject: Forgot to get these from the private struct. --- src/libappindicator/app-indicator.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libappindicator/app-indicator.c b/src/libappindicator/app-indicator.c index 1756687..d22161c 100644 --- a/src/libappindicator/app-indicator.c +++ b/src/libappindicator/app-indicator.c @@ -441,8 +441,8 @@ app_indicator_set_property (GObject * object, guint prop_id, const GValue * valu break; case PROP_ICON_PATH: - if (icon_path != NULL) { - g_free(icon_path); + if (priv->icon_path != NULL) { + g_free(priv->icon_path); } priv->icon_path = g_value_dup_string(value); break; -- cgit v1.2.3 From a9c6b6e346c1c850284f8766171a371da8c7b595 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Sun, 20 Dec 2009 17:15:08 -0600 Subject: Adding new constructor to docs. --- docs/reference/libappindicator-sections.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/reference/libappindicator-sections.txt b/docs/reference/libappindicator-sections.txt index b994297..68b120a 100644 --- a/docs/reference/libappindicator-sections.txt +++ b/docs/reference/libappindicator-sections.txt @@ -18,6 +18,7 @@ AppIndicator AppIndicatorClass app_indicator_get_type app_indicator_new +app_indicator_new_with_path app_indicator_set_status app_indicator_set_attention_icon app_indicator_set_menu -- cgit v1.2.3 From 9185eeee48ad6fc91b023127e9f92f7348a0c6aa Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Sun, 20 Dec 2009 17:24:13 -0600 Subject: Adding in the icon path to the list of parameters that are passed when we have a new application. --- src/application-service-appstore.c | 6 ++++-- src/application-service-marshal.list | 2 +- src/application-service.xml | 1 + src/indicator-application.c | 8 +++++--- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index 1391d33..92e5668 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -40,6 +40,7 @@ static gboolean _application_service_server_get_applications (ApplicationService #define NOTIFICATION_ITEM_PROP_STATUS "Status" #define NOTIFICATION_ITEM_PROP_ICON_NAME "IconName" #define NOTIFICATION_ITEM_PROP_AICON_NAME "AttentionIconName" +#define NOTIFICATION_ITEM_PROP_ICON_PATH "IconPath" #define NOTIFICATION_ITEM_PROP_MENU "Menu" /* Private Stuff */ @@ -93,8 +94,8 @@ application_service_appstore_class_init (ApplicationServiceAppstoreClass *klass) G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ApplicationServiceAppstore, application_added), NULL, NULL, - _application_service_marshal_VOID__STRING_INT_STRING_STRING, - G_TYPE_NONE, 4, G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_NONE); + _application_service_marshal_VOID__STRING_INT_STRING_STRING_STRING, + G_TYPE_NONE, 4, G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_NONE); signals[APPLICATION_REMOVED] = g_signal_new ("application-removed", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST, @@ -185,6 +186,7 @@ get_all_properties_cb (DBusGProxy * proxy, GHashTable * properties, GError * err 0, /* Position */ app->dbus_name, g_value_get_string(g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_MENU)), + g_value_get_string(g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_ICON_PATH)), TRUE); return; diff --git a/src/application-service-marshal.list b/src/application-service-marshal.list index a122bf8..6cfbada 100644 --- a/src/application-service-marshal.list +++ b/src/application-service-marshal.list @@ -16,4 +16,4 @@ # # You should have received a copy of the GNU General Public License along # with this program. If not, see . -VOID: STRING, INT, STRING, STRING +VOID: STRING, INT, STRING, STRING, STRING diff --git a/src/application-service.xml b/src/application-service.xml index fdd25bb..d354943 100644 --- a/src/application-service.xml +++ b/src/application-service.xml @@ -35,6 +35,7 @@ with this program. If not, see . + diff --git a/src/indicator-application.c b/src/indicator-application.c index f3566e4..436a743 100644 --- a/src/indicator-application.c +++ b/src/indicator-application.c @@ -91,7 +91,7 @@ static void indicator_application_dispose (GObject *object); static void indicator_application_finalize (GObject *object); static GList * get_entries (IndicatorObject * io); static void connected (IndicatorServiceManager * sm, gboolean connected, IndicatorApplication * application); -static void application_added (DBusGProxy * proxy, const gchar * iconname, gint position, const gchar * dbusaddress, const gchar * dbusobject, IndicatorApplication * application); +static void application_added (DBusGProxy * proxy, const gchar * iconname, gint position, const gchar * dbusaddress, const gchar * dbusobject, const gchar * icon_path, IndicatorApplication * application); static void application_removed (DBusGProxy * proxy, gint position , IndicatorApplication * application); static void get_applications (DBusGProxy *proxy, GPtrArray *OUT_applications, GError *error, gpointer userdata); @@ -111,12 +111,13 @@ indicator_application_class_init (IndicatorApplicationClass *klass) io_class->get_entries = get_entries; - dbus_g_object_register_marshaller(_application_service_marshal_VOID__STRING_INT_STRING_STRING, + dbus_g_object_register_marshaller(_application_service_marshal_VOID__STRING_INT_STRING_STRING_STRING, G_TYPE_NONE, G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, + G_TYPE_STRING, G_TYPE_INVALID); return; @@ -211,6 +212,7 @@ connected (IndicatorServiceManager * sm, gboolean connected, IndicatorApplicatio G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, + G_TYPE_STRING, G_TYPE_INVALID); dbus_g_proxy_add_signal(priv->service_proxy, "ApplicationRemoved", @@ -267,7 +269,7 @@ get_entries (IndicatorObject * io) ApplicationEntry and signaling the indicator host that we've got a new indicator. */ static void -application_added (DBusGProxy * proxy, const gchar * iconname, gint position, const gchar * dbusaddress, const gchar * dbusobject, IndicatorApplication * application) +application_added (DBusGProxy * proxy, const gchar * iconname, gint position, const gchar * dbusaddress, const gchar * dbusobject, const gchar * icon_path, IndicatorApplication * application) { g_debug("Building new application entry: %s with icon: %s", dbusaddress, iconname); IndicatorApplicationPrivate * priv = INDICATOR_APPLICATION_GET_PRIVATE(application); -- cgit v1.2.3 From 3915de95c9d64765cae653d02d124ca82127235e Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Sun, 20 Dec 2009 17:28:02 -0600 Subject: Adding the icon path to the app entry struct --- src/indicator-application.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/indicator-application.c b/src/indicator-application.c index 436a743..02c13c8 100644 --- a/src/indicator-application.c +++ b/src/indicator-application.c @@ -80,6 +80,7 @@ struct _IndicatorApplicationPrivate { typedef struct _ApplicationEntry ApplicationEntry; struct _ApplicationEntry { IndicatorObjectEntry entry; + gchar * icon_path; }; #define INDICATOR_APPLICATION_GET_PRIVATE(o) \ @@ -275,6 +276,7 @@ application_added (DBusGProxy * proxy, const gchar * iconname, gint position, co IndicatorApplicationPrivate * priv = INDICATOR_APPLICATION_GET_PRIVATE(application); ApplicationEntry * app = g_new(ApplicationEntry, 1); + app->icon_path = g_strdup(icon_path); app->entry.image = GTK_IMAGE(gtk_image_new_from_icon_name(iconname, GTK_ICON_SIZE_MENU)); app->entry.label = NULL; app->entry.menu = GTK_MENU(dbusmenu_gtkmenu_new((gchar *)dbusaddress, (gchar *)dbusobject)); @@ -304,6 +306,9 @@ application_removed (DBusGProxy * proxy, gint position, IndicatorApplication * a priv->applications = g_list_remove(priv->applications, app); g_signal_emit(G_OBJECT(application), INDICATOR_OBJECT_SIGNAL_ENTRY_REMOVED_ID, 0, &(app->entry), TRUE); + if (app->icon_path != NULL) { + g_free(app->icon_path); + } if (app->entry.image != NULL) { g_object_unref(G_OBJECT(app->entry.image)); } -- cgit v1.2.3 From cd57997811b56c369eb3891ff0d92bc0cf503133 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Sun, 20 Dec 2009 22:16:01 -0600 Subject: Appending the new icon path to the theme search. --- src/indicator-application.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/indicator-application.c b/src/indicator-application.c index 02c13c8..e07386a 100644 --- a/src/indicator-application.c +++ b/src/indicator-application.c @@ -276,7 +276,12 @@ application_added (DBusGProxy * proxy, const gchar * iconname, gint position, co IndicatorApplicationPrivate * priv = INDICATOR_APPLICATION_GET_PRIVATE(application); ApplicationEntry * app = g_new(ApplicationEntry, 1); - app->icon_path = g_strdup(icon_path); + app->icon_path = NULL; + if (icon_path != NULL && icon_path[0] != '\0') { + app->icon_path = g_strdup(icon_path); + gtk_icon_theme_append_search_path(gtk_icon_theme_get_default(), app->icon_path); + } + app->entry.image = GTK_IMAGE(gtk_image_new_from_icon_name(iconname, GTK_ICON_SIZE_MENU)); app->entry.label = NULL; app->entry.menu = GTK_MENU(dbusmenu_gtkmenu_new((gchar *)dbusaddress, (gchar *)dbusobject)); -- cgit v1.2.3 From 06b735fd5bd4212ec126831ca041615e9d433418 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Sun, 20 Dec 2009 22:20:52 -0600 Subject: releasing version 0.0.6-0ubuntu1~ppa2~icon1 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index cf6028c..5a6b5c5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,8 @@ -indicator-application (0.0.6-0ubuntu1~ppa2~icon1) UNRELEASED; urgency=low +indicator-application (0.0.6-0ubuntu1~ppa2~icon1) karmic; urgency=low * Adding in icon path support. - -- Ted Gould Sun, 20 Dec 2009 22:18:06 -0600 + -- Ted Gould Sun, 20 Dec 2009 22:20:35 -0600 indicator-application (0.0.6-0ubuntu1~ppa1) karmic; urgency=low -- cgit v1.2.3 From 95b5ea90de66f465398fbdf9779e342395ea327a Mon Sep 17 00:00:00 2001 From: Aurelien Gateau Date: Wed, 23 Dec 2009 16:48:54 +0100 Subject: Make it work on KDE --- src/application-service-watcher.c | 8 ++++---- src/dbus-shared.h | 8 ++++---- src/libappindicator/app-indicator.c | 6 ++++-- src/notification-item.xml | 4 ++-- src/notification-watcher.xml | 8 ++++---- 5 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/application-service-watcher.c b/src/application-service-watcher.c index 984b9d4..81fae36 100644 --- a/src/application-service-watcher.c +++ b/src/application-service-watcher.c @@ -29,8 +29,8 @@ with this program. If not, see . #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,7 +165,7 @@ 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); @@ -176,7 +176,7 @@ _notification_watcher_server_register_service (ApplicationServiceWatcher * appwa } 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..cac88d8 100644 --- a/src/dbus-shared.h +++ b/src/dbus-shared.h @@ -20,12 +20,12 @@ with this program. If not, see . */ -#define INDICATOR_APPLICATION_DBUS_ADDR "org.ayatana.indicator.application" +#define INDICATOR_APPLICATION_DBUS_ADDR "org.kde.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.kde.StatusNotifierWatcher" -#define NOTIFICATION_ITEM_DBUS_IFACE "org.ayatana.indicator.application.NotificationItem" +#define NOTIFICATION_ITEM_DBUS_IFACE "org.kde.StatusNotifierItem" diff --git a/src/libappindicator/app-indicator.c b/src/libappindicator/app-indicator.c index bb68cb2..4baf4ef 100644 --- a/src/libappindicator/app-indicator.c +++ b/src/libappindicator/app-indicator.c @@ -32,6 +32,7 @@ License version 3 and version 2.1 along with this program. If not, see #endif #include +#include #include #include @@ -293,7 +294,7 @@ app_indicator_init (AppIndicator *self) } dbus_g_connection_register_g_object(priv->connection, - "/need/a/path", + "/StatusNotifierItem", G_OBJECT(self)); self->priv = priv; @@ -513,7 +514,8 @@ check_connect (AppIndicator *self) return; } - org_ayatana_indicator_application_NotificationWatcher_register_service_async(priv->watcher_proxy, "/need/a/path", register_service_cb, self); + const char * name = dbus_bus_get_unique_name(dbus_g_connection_get_connection(priv->connection)); + org_kde_StatusNotifierWatcher_register_status_notifier_item_async(priv->watcher_proxy, name, register_service_cb, self); return; } diff --git a/src/notification-item.xml b/src/notification-item.xml index c28cc54..8515519 100644 --- a/src/notification-item.xml +++ b/src/notification-item.xml @@ -1,6 +1,6 @@ - - + + diff --git a/src/notification-watcher.xml b/src/notification-watcher.xml index 2ef54a0..c2324f1 100644 --- a/src/notification-watcher.xml +++ b/src/notification-watcher.xml @@ -1,16 +1,16 @@ - - + + - + - + -- cgit v1.2.3 From dd2ed951b8aeb16671bebd2ea104953252ab54a5 Mon Sep 17 00:00:00 2001 From: Aurelien Gateau Date: Wed, 23 Dec 2009 17:00:30 +0100 Subject: Previous commit was not meant to be pushed to trunk Revert my mess --- src/application-service-watcher.c | 8 ++++---- src/dbus-shared.h | 8 ++++---- src/libappindicator/app-indicator.c | 6 ++---- src/notification-item.xml | 4 ++-- src/notification-watcher.xml | 8 ++++---- 5 files changed, 16 insertions(+), 18 deletions(-) diff --git a/src/application-service-watcher.c b/src/application-service-watcher.c index 81fae36..984b9d4 100644 --- a/src/application-service-watcher.c +++ b/src/application-service-watcher.c @@ -29,8 +29,8 @@ with this program. If not, see . #include "application-service-watcher.h" #include "dbus-shared.h" -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_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_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,7 +165,7 @@ application_service_watcher_new (ApplicationServiceAppstore * appstore) } static gboolean -_notification_watcher_server_register_status_notifier_item (ApplicationServiceWatcher * appwatcher, const gchar * service, DBusGMethodInvocation * method) +_notification_watcher_server_register_service (ApplicationServiceWatcher * appwatcher, const gchar * service, DBusGMethodInvocation * method) { ApplicationServiceWatcherPrivate * priv = APPLICATION_SERVICE_WATCHER_GET_PRIVATE(appwatcher); @@ -176,7 +176,7 @@ _notification_watcher_server_register_status_notifier_item (ApplicationServiceWa } static gboolean -_notification_watcher_server_registered_status_notifier_items (ApplicationServiceWatcher * appwatcher, GArray ** apps) +_notification_watcher_server_registered_services (ApplicationServiceWatcher * appwatcher, GArray ** apps) { return FALSE; diff --git a/src/dbus-shared.h b/src/dbus-shared.h index cac88d8..f888e02 100644 --- a/src/dbus-shared.h +++ b/src/dbus-shared.h @@ -20,12 +20,12 @@ with this program. If not, see . */ -#define INDICATOR_APPLICATION_DBUS_ADDR "org.kde.StatusNotifierWatcher" +#define INDICATOR_APPLICATION_DBUS_ADDR "org.ayatana.indicator.application" #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 "/StatusNotifierWatcher" -#define NOTIFICATION_WATCHER_DBUS_IFACE "org.kde.StatusNotifierWatcher" +#define NOTIFICATION_WATCHER_DBUS_OBJ "/org/ayatana/indicator/application/NotificationWatcher" +#define NOTIFICATION_WATCHER_DBUS_IFACE "org.ayatana.indicator.application.NotificationWatcher" -#define NOTIFICATION_ITEM_DBUS_IFACE "org.kde.StatusNotifierItem" +#define NOTIFICATION_ITEM_DBUS_IFACE "org.ayatana.indicator.application.NotificationItem" diff --git a/src/libappindicator/app-indicator.c b/src/libappindicator/app-indicator.c index 4baf4ef..bb68cb2 100644 --- a/src/libappindicator/app-indicator.c +++ b/src/libappindicator/app-indicator.c @@ -32,7 +32,6 @@ License version 3 and version 2.1 along with this program. If not, see #endif #include -#include #include #include @@ -294,7 +293,7 @@ app_indicator_init (AppIndicator *self) } dbus_g_connection_register_g_object(priv->connection, - "/StatusNotifierItem", + "/need/a/path", G_OBJECT(self)); self->priv = priv; @@ -514,8 +513,7 @@ check_connect (AppIndicator *self) return; } - const char * name = dbus_bus_get_unique_name(dbus_g_connection_get_connection(priv->connection)); - org_kde_StatusNotifierWatcher_register_status_notifier_item_async(priv->watcher_proxy, name, register_service_cb, self); + org_ayatana_indicator_application_NotificationWatcher_register_service_async(priv->watcher_proxy, "/need/a/path", register_service_cb, self); return; } diff --git a/src/notification-item.xml b/src/notification-item.xml index 8515519..c28cc54 100644 --- a/src/notification-item.xml +++ b/src/notification-item.xml @@ -1,6 +1,6 @@ - - + + diff --git a/src/notification-watcher.xml b/src/notification-watcher.xml index c2324f1..2ef54a0 100644 --- a/src/notification-watcher.xml +++ b/src/notification-watcher.xml @@ -1,16 +1,16 @@ - - + + - + - + -- cgit v1.2.3 From 150a0d7bf767736905bed4d9e4d10e2f235f1be5 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 6 Jan 2010 14:18:49 -0600 Subject: Ignoring some of the generated files --- .bzrignore | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/.bzrignore b/.bzrignore index 4856033..977611c 100644 --- a/.bzrignore +++ b/.bzrignore @@ -44,3 +44,46 @@ src/libapplication_la-application-service-marshal.lo src/libapplication_la-indicator-application.lo src/libappindicator/app-indicator-enum-types.c src/libappindicator/app-indicator-enum-types.h +gtk-doc.make +py-compile +bindings/mono/appindicator-sharp-0.1.pc +bindings/mono/appindicator-sharp.dll +bindings/mono/appindicator-sharp.dll.config +bindings/mono/generated +bindings/mono/generated-stamp +bindings/mono/libappindicator-api.raw +bindings/mono/libappindicator-api.xml +bindings/mono/examples/indicator-example +bindings/python/.deps +bindings/python/.libs +bindings/python/_appindicator.la +bindings/python/appindicator.c +bindings/python/appindicator.lo +bindings/python/appindicatormodule.lo +docs/reference/.libs +docs/reference/gtkdoc-in-srcdir +docs/reference/html +docs/reference/html-build.stamp +docs/reference/html.stamp +docs/reference/libappindicator-decl-list.txt +docs/reference/libappindicator-decl.txt +docs/reference/libappindicator-docs.sgml +docs/reference/libappindicator-overrides.txt +docs/reference/libappindicator-undeclared.txt +docs/reference/libappindicator-undocumented.txt +docs/reference/libappindicator-unused.txt +docs/reference/libappindicator.args +docs/reference/libappindicator.hierarchy +docs/reference/libappindicator.interfaces +docs/reference/libappindicator.prerequisites +docs/reference/libappindicator.signals +docs/reference/scan-build.stamp +docs/reference/sgml-build.stamp +docs/reference/sgml.stamp +docs/reference/tmpl-build.stamp +docs/reference/tmpl.stamp +docs/reference/version.xml +docs/reference/xml +docs/reference/tmpl/app-indicator.sgml +docs/reference/tmpl/app-indicator.sgml.bak +src/libappindicator/appindicator-0.1.pc -- cgit v1.2.3 From eec24665dda2d3968984141f2d1e07289d10bf79 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 6 Jan 2010 14:27:33 -0600 Subject: Handle the case of no icon path more gracefully, by just passing along the null string. --- src/application-service-appstore.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index 92e5668..c9da491 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -180,13 +180,21 @@ get_all_properties_cb (DBusGProxy * proxy, GHashTable * properties, GError * err would involve looking at the name and category and sorting it with the other entries. */ + const gchar * icon_path = NULL; + gpointer icon_path_data = g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_ICON_PATH); + if (icon_path_data != NULL) { + icon_path = g_value_get_string((GValue *)icon_path_data); + } else { + icon_path = ""; + } + g_signal_emit(G_OBJECT(app->appstore), signals[APPLICATION_ADDED], 0, g_value_get_string(g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_ICON_NAME)), 0, /* Position */ app->dbus_name, g_value_get_string(g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_MENU)), - g_value_get_string(g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_ICON_PATH)), + icon_path, TRUE); return; -- cgit v1.2.3 From e16d383c5a0fb85742dde81f1f7191fceefa8667 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 7 Jan 2010 00:55:38 -0600 Subject: Forgot to adjust the parameter count. --- src/application-service-appstore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index c9da491..1ac309a 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -95,7 +95,7 @@ application_service_appstore_class_init (ApplicationServiceAppstoreClass *klass) G_STRUCT_OFFSET (ApplicationServiceAppstore, application_added), NULL, NULL, _application_service_marshal_VOID__STRING_INT_STRING_STRING_STRING, - G_TYPE_NONE, 4, G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_NONE); + G_TYPE_NONE, 5, G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_NONE); signals[APPLICATION_REMOVED] = g_signal_new ("application-removed", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST, -- cgit v1.2.3 From 6223c530a7bf0fdc3ec689b6f302d3cf07d62763 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 7 Jan 2010 00:59:14 -0600 Subject: releasing version 0.0.6-0ubuntu1~ppa2~icon2 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 6b5944c..1178fe5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,8 @@ -indicator-application (0.0.6-0ubuntu1~ppa2~icon2) UNRELEASED; urgency=low +indicator-application (0.0.6-0ubuntu1~ppa2~icon2) karmic; urgency=low * Fixing the signals. - -- Ted Gould Thu, 07 Jan 2010 00:56:01 -0600 + -- Ted Gould Thu, 07 Jan 2010 00:59:12 -0600 indicator-application (0.0.6-0ubuntu1~ppa2~icon1) karmic; urgency=low -- cgit v1.2.3 From ad8ca0d507d627da2221d39cd45c78e760623598 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 7 Jan 2010 01:06:45 -0600 Subject: Adding a path based debug message --- src/indicator-application.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/indicator-application.c b/src/indicator-application.c index e07386a..fbfbd40 100644 --- a/src/indicator-application.c +++ b/src/indicator-application.c @@ -279,6 +279,7 @@ application_added (DBusGProxy * proxy, const gchar * iconname, gint position, co app->icon_path = NULL; if (icon_path != NULL && icon_path[0] != '\0') { app->icon_path = g_strdup(icon_path); + g_debug("\tAppending search path: %s", app->icon_path); gtk_icon_theme_append_search_path(gtk_icon_theme_get_default(), app->icon_path); } -- cgit v1.2.3 From 13de14e2a1944a8bee33bdd574924e0d9c8c66ed Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 7 Jan 2010 01:10:20 -0600 Subject: releasing version 0.0.6-0ubuntu1~ppa2~icon2ubuntu1 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index f5a5823..b6ebc19 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,8 @@ -indicator-application (0.0.6-0ubuntu1~ppa2~icon2ubuntu1) UNRELEASED; urgency=low +indicator-application (0.0.6-0ubuntu1~ppa2~icon2ubuntu1) karmic; urgency=low * Debug message - -- Ted Gould Thu, 07 Jan 2010 01:07:07 -0600 + -- Ted Gould Thu, 07 Jan 2010 01:10:18 -0600 indicator-application (0.0.6-0ubuntu1~ppa2~icon2) karmic; urgency=low -- cgit v1.2.3 From 0aaa6a25ab78a044e1b004a6943d2b6f07598c17 Mon Sep 17 00:00:00 2001 From: Aurelien Gateau Date: Thu, 7 Jan 2010 13:29:50 +0100 Subject: Use org.freedesktop namespace --- src/application-service-watcher.c | 8 ++++---- src/dbus-shared.h | 8 ++++---- src/libappindicator/app-indicator.c | 6 ++++-- src/notification-item.xml | 4 ++-- src/notification-watcher.xml | 8 ++++---- 5 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/application-service-watcher.c b/src/application-service-watcher.c index 984b9d4..81fae36 100644 --- a/src/application-service-watcher.c +++ b/src/application-service-watcher.c @@ -29,8 +29,8 @@ with this program. If not, see . #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,7 +165,7 @@ 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); @@ -176,7 +176,7 @@ _notification_watcher_server_register_service (ApplicationServiceWatcher * appwa } 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..da9dfef 100644 --- a/src/dbus-shared.h +++ b/src/dbus-shared.h @@ -20,12 +20,12 @@ with this program. If not, see . */ -#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" diff --git a/src/libappindicator/app-indicator.c b/src/libappindicator/app-indicator.c index bb68cb2..b4a4ed6 100644 --- a/src/libappindicator/app-indicator.c +++ b/src/libappindicator/app-indicator.c @@ -32,6 +32,7 @@ License version 3 and version 2.1 along with this program. If not, see #endif #include +#include #include #include @@ -293,7 +294,7 @@ app_indicator_init (AppIndicator *self) } dbus_g_connection_register_g_object(priv->connection, - "/need/a/path", + "/StatusNotifierItem", G_OBJECT(self)); self->priv = priv; @@ -513,7 +514,8 @@ check_connect (AppIndicator *self) return; } - org_ayatana_indicator_application_NotificationWatcher_register_service_async(priv->watcher_proxy, "/need/a/path", register_service_cb, self); + const char * name = dbus_bus_get_unique_name(dbus_g_connection_get_connection(priv->connection)); + org_freedesktop_StatusNotifierWatcher_register_status_notifier_item_async(priv->watcher_proxy, name, register_service_cb, self); return; } diff --git a/src/notification-item.xml b/src/notification-item.xml index c28cc54..93ff903 100644 --- a/src/notification-item.xml +++ b/src/notification-item.xml @@ -1,6 +1,6 @@ - - + + 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 @@ - - + + - + - + -- cgit v1.2.3 From bf0be373898c44e6e9898aeac5813704fca7889e Mon Sep 17 00:00:00 2001 From: Cody Russell Date: Thu, 7 Jan 2010 09:27:01 -0600 Subject: Checkmark support --- example/simple-client.c | 2 +- src/libappindicator/app-indicator.c | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/example/simple-client.c b/example/simple-client.c index ea4da9d..850ef18 100644 --- a/example/simple-client.c +++ b/example/simple-client.c @@ -58,7 +58,7 @@ main (int argc, char ** argv) 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_check_menu_item_new_with_label ("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..8e03e07 100644 --- a/src/libappindicator/app-indicator.c +++ b/src/libappindicator/app-indicator.c @@ -686,15 +686,29 @@ container_iterate (GtkWidget *widget, if (GTK_IS_SEPARATOR_MENU_ITEM (widget)) { + label = gtk_menu_item_get_label (GTK_MENU_ITEM (widget)); + dbusmenu_menuitem_property_set (child, "type", DBUSMENU_CLIENT_TYPES_SEPARATOR); } else { - label = gtk_menu_item_get_label (GTK_MENU_ITEM (widget)); + if (GTK_IS_CHECK_MENU_ITEM (widget)) + { + label = gtk_menu_item_get_label (GTK_MENU_ITEM (widget)); + + dbusmenu_menuitem_property_set (child, + "type", + DBUSMENU_MENUITEM_TOGGLE_CHECK); - if (GTK_IS_IMAGE_MENU_ITEM (widget)) + dbusmenu_menuitem_property_set (child, + DBUSMENU_MENUITEM_PROP_LABEL, + label); + + label_set = TRUE; + } + else if (GTK_IS_IMAGE_MENU_ITEM (widget)) { GtkWidget *image = gtk_image_menu_item_get_image (GTK_IMAGE_MENU_ITEM (widget)); -- cgit v1.2.3 From 6bde6a4be29ba003b483b9db76226a95419ce115 Mon Sep 17 00:00:00 2001 From: Cody Russell Date: Thu, 7 Jan 2010 10:26:42 -0600 Subject: More checkbox related updates. --- src/libappindicator/app-indicator.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libappindicator/app-indicator.c b/src/libappindicator/app-indicator.c index 8e03e07..ee3fd7c 100644 --- a/src/libappindicator/app-indicator.c +++ b/src/libappindicator/app-indicator.c @@ -686,8 +686,6 @@ container_iterate (GtkWidget *widget, if (GTK_IS_SEPARATOR_MENU_ITEM (widget)) { - label = gtk_menu_item_get_label (GTK_MENU_ITEM (widget)); - dbusmenu_menuitem_property_set (child, "type", DBUSMENU_CLIENT_TYPES_SEPARATOR); @@ -699,13 +697,17 @@ container_iterate (GtkWidget *widget, label = gtk_menu_item_get_label (GTK_MENU_ITEM (widget)); dbusmenu_menuitem_property_set (child, - "type", + DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE, DBUSMENU_MENUITEM_TOGGLE_CHECK); dbusmenu_menuitem_property_set (child, DBUSMENU_MENUITEM_PROP_LABEL, label); + dbusmenu_menuitem_property_set (child, + DBUSMENU_MENUITEM_PROP_TOGGLE_CHECKED, + "checked"); + label_set = TRUE; } else if (GTK_IS_IMAGE_MENU_ITEM (widget)) -- cgit v1.2.3 From 17476bdd4ceaf0b3ecc279a555ac82838e2d8016 Mon Sep 17 00:00:00 2001 From: Aurelien Gateau Date: Thu, 7 Jan 2010 18:10:44 +0100 Subject: Revert part of previous revision: pass the path, not the service name to register_status_item --- src/libappindicator/app-indicator.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/libappindicator/app-indicator.c b/src/libappindicator/app-indicator.c index b4a4ed6..52c5f46 100644 --- a/src/libappindicator/app-indicator.c +++ b/src/libappindicator/app-indicator.c @@ -32,7 +32,6 @@ License version 3 and version 2.1 along with this program. If not, see #endif #include -#include #include #include @@ -294,7 +293,7 @@ app_indicator_init (AppIndicator *self) } dbus_g_connection_register_g_object(priv->connection, - "/StatusNotifierItem", + "/need/a/path", G_OBJECT(self)); self->priv = priv; @@ -514,8 +513,7 @@ check_connect (AppIndicator *self) return; } - const char * name = dbus_bus_get_unique_name(dbus_g_connection_get_connection(priv->connection)); - org_freedesktop_StatusNotifierWatcher_register_status_notifier_item_async(priv->watcher_proxy, name, register_service_cb, self); + org_freedesktop_StatusNotifierWatcher_register_status_notifier_item_async(priv->watcher_proxy, "/need/a/path", register_service_cb, self); return; } -- cgit v1.2.3 From 199f3d22a194b89241a2d29519aae587f5c4b5a8 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 7 Jan 2010 12:29:33 -0600 Subject: Allowing for the default path if one is not given. --- src/application-service-watcher.c | 8 +++++++- src/dbus-shared.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/application-service-watcher.c b/src/application-service-watcher.c index 81fae36..f2823dd 100644 --- a/src/application-service-watcher.c +++ b/src/application-service-watcher.c @@ -169,7 +169,13 @@ _notification_watcher_server_register_status_notifier_item (ApplicationServiceWa { ApplicationServiceWatcherPrivate * priv = APPLICATION_SERVICE_WATCHER_GET_PRIVATE(appwatcher); - application_service_appstore_application_add(priv->appstore, dbus_g_method_get_sender(method), service); + const gchar * finalservice = NOTIFICATION_ITEM_DEFAULT_OBJ; + + if (service[0] == '/') { + finalservice = service; + } + + application_service_appstore_application_add(priv->appstore, dbus_g_method_get_sender(method), finalservice); dbus_g_method_return(method, G_TYPE_NONE); return TRUE; diff --git a/src/dbus-shared.h b/src/dbus-shared.h index da9dfef..efc57a4 100644 --- a/src/dbus-shared.h +++ b/src/dbus-shared.h @@ -28,4 +28,5 @@ with this program. If not, see . #define NOTIFICATION_WATCHER_DBUS_IFACE "org.freedesktop.StatusNotifierWatcher" #define NOTIFICATION_ITEM_DBUS_IFACE "org.freedesktop.StatusNotifierItem" +#define NOTIFICATION_ITEM_DEFAULT_OBJ "/StatusNotifierItem" -- cgit v1.2.3 From a60f25e5ca657a7c781bed90fd67020c7caa2320 Mon Sep 17 00:00:00 2001 From: Cody Russell Date: Thu, 7 Jan 2010 13:01:01 -0600 Subject: Toggle events --- example/simple-client.c | 4 ++-- src/libappindicator/app-indicator.c | 22 +++++++++++++++++++--- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/example/simple-client.c b/example/simple-client.c index 850ef18..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_check_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 ee3fd7c..ec598db 100644 --- a/src/libappindicator/app-indicator.c +++ b/src/libappindicator/app-indicator.c @@ -659,6 +659,14 @@ activate_menuitem (DbusmenuMenuitem *mi, gpointer user_data) gtk_menu_item_activate (GTK_MENU_ITEM (widget)); } +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) @@ -694,21 +702,29 @@ container_iterate (GtkWidget *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, - DBUSMENU_MENUITEM_TOGGLE_CHECK); + GTK_IS_RADIO_MENU_ITEM (widget) ? DBUSMENU_MENUITEM_TOGGLE_RADIO : DBUSMENU_MENUITEM_TOGGLE_CHECK); dbusmenu_menuitem_property_set (child, DBUSMENU_MENUITEM_PROP_LABEL, label); + label_set = TRUE; + dbusmenu_menuitem_property_set (child, DBUSMENU_MENUITEM_PROP_TOGGLE_CHECKED, - "checked"); + gtk_check_menu_item_get_active (check) ? DBUSMENU_MENUITEM_TOGGLE_STATE_CHECKED : DBUSMENU_MENUITEM_TOGGLE_STATE_UNCHECKED); - label_set = TRUE; + g_signal_connect (widget, + "toggled", + G_CALLBACK (widget_toggled), + child); } else if (GTK_IS_IMAGE_MENU_ITEM (widget)) { -- cgit v1.2.3 From 6d922ea1dee5f63ca852950938c04be68124c30f Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 7 Jan 2010 13:08:40 -0600 Subject: Setting up and connecting to the item signals --- src/application-service-appstore.c | 45 +++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index 1391d33..e832a71 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -42,6 +42,10 @@ static gboolean _application_service_server_get_applications (ApplicationService #define NOTIFICATION_ITEM_PROP_AICON_NAME "AttentionIconName" #define NOTIFICATION_ITEM_PROP_MENU "Menu" +#define NOTIFICATION_ITEM_SIG_NEW_ICON "NewIcon" +#define NOTIFICATION_ITEM_SIG_NEW_AICON "NewAttentionIcon" +#define NOTIFICATION_ITEM_SIG_NEW_STATUS "NewStatus" + /* Private Stuff */ typedef struct _ApplicationServiceAppstorePrivate ApplicationServiceAppstorePrivate; struct _ApplicationServiceAppstorePrivate { @@ -56,6 +60,7 @@ struct _Application { ApplicationServiceAppstore * appstore; /* not ref'd */ DBusGProxy * dbus_proxy; DBusGProxy * prop_proxy; + gboolean validated; /* Whether we've gotten all the parameters and they look good. */ }; #define APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(o) \ @@ -155,6 +160,9 @@ application_service_appstore_finalize (GObject *object) return; } +/* Return from getting the properties from the item. We're looking at those + and making sure we have everythign that we need. If we do, then we'll + move on up to sending this onto the indicator. */ static void get_all_properties_cb (DBusGProxy * proxy, GHashTable * properties, GError * error, gpointer data) { @@ -172,6 +180,8 @@ get_all_properties_cb (DBusGProxy * proxy, GHashTable * properties, GError * err return; } + app->validated = TRUE; + ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(app->appstore); priv->applications = g_list_prepend(priv->applications, app); @@ -235,6 +245,10 @@ application_removed_cb (DBusGProxy * proxy, gpointer userdata) return; } +void new_icon (void) { } +void new_aicon (void) { } +void new_status (void) { } + /* Adding a new NotificationItem object from DBus in to the appstore. First, we need to get the information on it though. */ @@ -251,8 +265,9 @@ application_service_appstore_application_add (ApplicationServiceAppstore * appst /* Build the application entry. This will be carried along until we're sure we've got everything. */ - Application * app = g_new(Application, 1); + Application * app = g_new0(Application, 1); + app->validated = FALSE; app->dbus_name = g_strdup(dbus_name); app->dbus_object = g_strdup(dbus_object); app->appstore = appstore; @@ -290,6 +305,34 @@ application_service_appstore_application_add (ApplicationServiceAppstore * appst return; } + /* Connect to signals */ + dbus_g_proxy_add_signal(app->dbus_proxy, + NOTIFICATION_ITEM_SIG_NEW_ICON, + G_TYPE_INVALID); + dbus_g_proxy_add_signal(app->dbus_proxy, + NOTIFICATION_ITEM_SIG_NEW_AICON, + G_TYPE_INVALID); + dbus_g_proxy_add_signal(app->dbus_proxy, + NOTIFICATION_ITEM_SIG_NEW_STATUS, + G_TYPE_STRING, + G_TYPE_INVALID); + + dbus_g_proxy_connect_signal(app->dbus_proxy, + NOTIFICATION_ITEM_SIG_NEW_ICON, + G_CALLBACK(new_icon), + app, + NULL); + dbus_g_proxy_connect_signal(app->dbus_proxy, + NOTIFICATION_ITEM_SIG_NEW_AICON, + G_CALLBACK(new_aicon), + app, + NULL); + dbus_g_proxy_connect_signal(app->dbus_proxy, + NOTIFICATION_ITEM_SIG_NEW_STATUS, + G_CALLBACK(new_status), + app, + NULL); + /* Get all the propertiees */ org_freedesktop_DBus_Properties_get_all_async(app->prop_proxy, NOTIFICATION_ITEM_DBUS_IFACE, -- cgit v1.2.3 From f7e660f7f5a1133cc2a3bf341a2301f38160995a Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 7 Jan 2010 13:37:56 -0600 Subject: Cleaning up signal handlers. --- src/application-service-appstore.c | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index e832a71..dfd932e 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -245,9 +245,38 @@ application_removed_cb (DBusGProxy * proxy, gpointer userdata) return; } -void new_icon (void) { } -void new_aicon (void) { } -void new_status (void) { } +/* Called when the Notification Item signals that it + has a new icon. */ +static void +new_icon (DBusGProxy * proxy, gpointer data) +{ + Application * app = (Application *)data; + if (!app->validated) return; + + return; +} + +/* Called when the Notification Item signals that it + has a new attention icon. */ +static void +new_aicon (DBusGProxy * proxy, gpointer data) +{ + Application * app = (Application *)data; + if (!app->validated) return; + + return; +} + +/* Called when the Notification Item signals that it + has a new status. */ +static void +new_status (DBusGProxy * proxy, const gchar * status, gpointer data) +{ + Application * app = (Application *)data; + if (!app->validated) return; + + return; +} /* Adding a new NotificationItem object from DBus in to the appstore. First, we need to get the information on it -- cgit v1.2.3 From 2c767da806cf8919a9ef1a827235f746f9693292 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 7 Jan 2010 13:53:42 -0600 Subject: Adding an icon_changed signal to the application store --- src/application-service-appstore.c | 8 ++++++++ src/application-service-appstore.h | 1 + src/application-service-marshal.list | 1 + src/application-service.xml | 4 ++++ 4 files changed, 14 insertions(+) diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index dfd932e..f24b36f 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -70,6 +70,7 @@ struct _Application { enum { APPLICATION_ADDED, APPLICATION_REMOVED, + APPLICATION_ICON_CHANGED, LAST_SIGNAL }; @@ -107,6 +108,13 @@ application_service_appstore_class_init (ApplicationServiceAppstoreClass *klass) NULL, NULL, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT, G_TYPE_NONE); + signals[APPLICATION_ICON_CHANGED] = g_signal_new ("application-icon-changed", + G_TYPE_FROM_CLASS(klass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ApplicationServiceAppstore, application_icon_changed), + NULL, NULL, + _application_service_marshal_VOID__INT_STRING, + G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_STRING, G_TYPE_NONE); dbus_g_object_type_install_info(APPLICATION_SERVICE_APPSTORE_TYPE, diff --git a/src/application-service-appstore.h b/src/application-service-appstore.h index edf1a37..7ab20c5 100644 --- a/src/application-service-appstore.h +++ b/src/application-service-appstore.h @@ -47,6 +47,7 @@ struct _ApplicationServiceAppstore { void (*application_added) (ApplicationServiceAppstore * appstore, gchar *, gint, gchar *, gchar *, gpointer); void (*application_removed) (ApplicationServiceAppstore * appstore, gint, gpointer); + void (*application_icon_changed)(ApplicationServiceAppstore * appstore, gint, const gchar *, gpointer); }; GType application_service_appstore_get_type (void); diff --git a/src/application-service-marshal.list b/src/application-service-marshal.list index a122bf8..99d13c0 100644 --- a/src/application-service-marshal.list +++ b/src/application-service-marshal.list @@ -17,3 +17,4 @@ # You should have received a copy of the GNU General Public License along # with this program. If not, see . VOID: STRING, INT, STRING, STRING +VOID: INT, STRING diff --git a/src/application-service.xml b/src/application-service.xml index fdd25bb..57d429b 100644 --- a/src/application-service.xml +++ b/src/application-service.xml @@ -39,6 +39,10 @@ with this program. If not, see . + + + + -- cgit v1.2.3 From 7f27006181dc968e48017a88ddd4467c61c1a778 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 7 Jan 2010 13:58:35 -0600 Subject: releasing version 0.0.6-0ubuntu1~ppa2 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 82413e6..4847c04 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,10 @@ -indicator-application (0.0.6-0ubuntu1~ppa2) UNRELEASED; urgency=low +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 Thu, 07 Jan 2010 13:35:18 -0600 + -- Ted Gould Thu, 07 Jan 2010 13:58:33 -0600 indicator-application (0.0.6-0ubuntu1~ppa1) karmic; urgency=low -- cgit v1.2.3 From 655f6d113305163d87643f9282f09b96fe5ccbe5 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 7 Jan 2010 14:07:16 -0600 Subject: Responding to the icon changed signal in the indicator. --- src/indicator-application.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/indicator-application.c b/src/indicator-application.c index f3566e4..221be04 100644 --- a/src/indicator-application.c +++ b/src/indicator-application.c @@ -93,6 +93,7 @@ static GList * get_entries (IndicatorObject * io); static void connected (IndicatorServiceManager * sm, gboolean connected, IndicatorApplication * application); static void application_added (DBusGProxy * proxy, const gchar * iconname, gint position, const gchar * dbusaddress, const gchar * dbusobject, IndicatorApplication * application); static void application_removed (DBusGProxy * proxy, gint position , IndicatorApplication * application); +static void application_icon_changed (DBusGProxy * proxy, gint position, const gchar * iconname, IndicatorApplication * application); static void get_applications (DBusGProxy *proxy, GPtrArray *OUT_applications, GError *error, gpointer userdata); G_DEFINE_TYPE (IndicatorApplication, indicator_application, INDICATOR_OBJECT_TYPE); @@ -118,6 +119,11 @@ indicator_application_class_init (IndicatorApplicationClass *klass) G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); + dbus_g_object_register_marshaller(_application_service_marshal_VOID__INT_STRING, + G_TYPE_NONE, + G_TYPE_INT, + G_TYPE_STRING, + G_TYPE_INVALID); return; } @@ -216,6 +222,11 @@ connected (IndicatorServiceManager * sm, gboolean connected, IndicatorApplicatio "ApplicationRemoved", G_TYPE_INT, G_TYPE_INVALID); + dbus_g_proxy_add_signal(priv->service_proxy, + "ApplicationIconChanged", + G_TYPE_INT, + G_TYPE_STRING, + G_TYPE_INVALID); /* Connect to them */ g_debug("Connect to them."); @@ -229,6 +240,11 @@ connected (IndicatorServiceManager * sm, gboolean connected, IndicatorApplicatio G_CALLBACK(application_removed), application, NULL /* Disconnection Signal */); + dbus_g_proxy_connect_signal(priv->service_proxy, + "ApplicationIconChanged", + G_CALLBACK(application_icon_changed), + application, + NULL /* Disconnection Signal */); /* Query it for existing applications */ g_debug("Request current apps"); @@ -317,6 +333,23 @@ application_removed (DBusGProxy * proxy, gint position, IndicatorApplication * a return; } +/* The callback for the signal that the icon for an application + has changed. */ +static void +application_icon_changed (DBusGProxy * proxy, gint position, const gchar * iconname, IndicatorApplication * application) +{ + IndicatorApplicationPrivate * priv = INDICATOR_APPLICATION_GET_PRIVATE(application); + ApplicationEntry * app = (ApplicationEntry *)g_list_nth_data(priv->applications, position); + + if (app == NULL) { + g_warning("Unable to find application at position: %d", position); + return; + } + + gtk_image_set_from_icon_name(app->entry.image, iconname, GTK_ICON_SIZE_MENU); + return; +} + /* This repsonds to the list of applications that the service has and calls application_added on each one of them. */ static void -- cgit v1.2.3 From 16fb78b663704da483de14c54fbcc4088a754c0e Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 7 Jan 2010 14:18:31 -0600 Subject: Adding in a status variable --- src/application-service-appstore.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index f24b36f..128139b 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -53,6 +53,13 @@ struct _ApplicationServiceAppstorePrivate { GList * applications; }; +typedef enum _ApplicationStatus ApplicationStatus; +enum _ApplicationStatus { + APP_STATUS_PASSIVE, + APP_STATUS_ACTIVE, + APP_STATUS_ATTENTION +}; + typedef struct _Application Application; struct _Application { gchar * dbus_name; @@ -61,6 +68,7 @@ struct _Application { DBusGProxy * dbus_proxy; DBusGProxy * prop_proxy; gboolean validated; /* Whether we've gotten all the parameters and they look good. */ + ApplicationStatus status; }; #define APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(o) \ @@ -308,6 +316,7 @@ application_service_appstore_application_add (ApplicationServiceAppstore * appst app->dbus_name = g_strdup(dbus_name); app->dbus_object = g_strdup(dbus_object); app->appstore = appstore; + app->status = APP_STATUS_PASSIVE; /* Get the DBus proxy for the NotificationItem interface */ GError * error = NULL; -- cgit v1.2.3 From 45e742eba4c7cae1c732c83acae43033f5c39e90 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 7 Jan 2010 16:27:18 -0600 Subject: Moving the list of applications management into the state change function. This makes it so that we can handle it appearing and disappearing all in one special place. --- src/application-service-appstore.c | 136 ++++++++++++++++++++++++++++++------- 1 file changed, 111 insertions(+), 25 deletions(-) diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index 128139b..385bd16 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -53,6 +53,10 @@ struct _ApplicationServiceAppstorePrivate { GList * applications; }; +#define APP_STATUS_PASSIVE_STR "passive" +#define APP_STATUS_ACTIVE_STR "active" +#define APP_STATUS_ATTENTION_STR "attention" + typedef enum _ApplicationStatus ApplicationStatus; enum _ApplicationStatus { APP_STATUS_PASSIVE, @@ -69,6 +73,9 @@ struct _Application { DBusGProxy * prop_proxy; gboolean validated; /* Whether we've gotten all the parameters and they look good. */ ApplicationStatus status; + gchar * icon; + gchar * aicon; + gchar * menu; }; #define APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(o) \ @@ -89,6 +96,8 @@ static void application_service_appstore_class_init (ApplicationServiceAppstoreC static void application_service_appstore_init (ApplicationServiceAppstore *self); static void application_service_appstore_dispose (GObject *object); static void application_service_appstore_finalize (GObject *object); +static ApplicationStatus string_to_status(const gchar * status_string); +static void apply_status (Application * app, ApplicationStatus status); G_DEFINE_TYPE (ApplicationServiceAppstore, application_service_appstore, G_TYPE_OBJECT); @@ -190,6 +199,7 @@ get_all_properties_cb (DBusGProxy * proxy, GHashTable * properties, GError * err Application * app = (Application *)data; if (g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_MENU) == NULL || + g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_STATUS) == NULL || g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_ICON_NAME) == NULL) { g_warning("Notification Item on object %s of %s doesn't have enough properties.", app->dbus_object, app->dbus_name); g_free(app); // Need to do more than this, but it gives the idea of the flow we're going for. @@ -198,24 +208,28 @@ get_all_properties_cb (DBusGProxy * proxy, GHashTable * properties, GError * err app->validated = TRUE; - ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(app->appstore); - priv->applications = g_list_prepend(priv->applications, app); - - /* TODO: We need to have the position determined better. This - would involve looking at the name and category and sorting - it with the other entries. */ - - g_signal_emit(G_OBJECT(app->appstore), - signals[APPLICATION_ADDED], 0, - g_value_get_string(g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_ICON_NAME)), - 0, /* Position */ - app->dbus_name, - g_value_get_string(g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_MENU)), - TRUE); + app->icon = g_value_dup_string(g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_ICON_NAME)); + app->menu = g_value_dup_string(g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_MENU)); + if (g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_AICON_NAME) != NULL) { + app->aicon = g_value_dup_string(g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_ICON_NAME)); + } + + apply_status(app, string_to_status(g_value_get_string(g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_STATUS)))); return; } +/* Simple translation function -- could be optimized */ +static ApplicationStatus +string_to_status(const gchar * status_string) +{ + if (!g_strcmp0(status_string, APP_STATUS_ACTIVE_STR)) + return APP_STATUS_ACTIVE; + if (!g_strcmp0(status_string, APP_STATUS_ATTENTION_STR)) + return APP_STATUS_ATTENTION; + return APP_STATUS_PASSIVE; +} + /* A simple global function for dealing with freeing the information in an Application structure */ static void @@ -229,6 +243,15 @@ application_free (Application * app) if (app->dbus_object != NULL) { g_free(app->dbus_object); } + if (app->icon != NULL) { + g_free(app->icon); + } + if (app->aicon != NULL) { + g_free(app->aicon); + } + if (app->menu != NULL) { + g_free(app->menu); + } g_free(app); return; @@ -240,24 +263,84 @@ static void application_removed_cb (DBusGProxy * proxy, gpointer userdata) { Application * app = (Application *)userdata; - ApplicationServiceAppstore * appstore = app->appstore; - ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(appstore); - GList * applistitem = g_list_find(priv->applications, app); - if (applistitem == NULL) { - g_warning("Removing an application that isn't in the application list?"); + /* Remove from the panel */ + apply_status(app, APP_STATUS_PASSIVE); + + /* Destroy the data */ + application_free(app); + return; +} + +/* Change the status of the application. If we're going passive + it removes it from the panel. If we're coming online, then + it add it to the panel. Otherwise it changes the icon. */ +static void +apply_status (Application * app, ApplicationStatus status) +{ + if (app->status == status) { return; } - gint position = g_list_position(priv->applications, applistitem); + ApplicationServiceAppstore * appstore = app->appstore; + ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(appstore); - g_signal_emit(G_OBJECT(appstore), - signals[APPLICATION_REMOVED], 0, - position, TRUE); + /* This means we're going off line */ + if (status == APP_STATUS_PASSIVE) { + GList * applistitem = g_list_find(priv->applications, app); + if (applistitem == NULL) { + g_warning("Removing an application that isn't in the application list?"); + return; + } + + gint position = g_list_position(priv->applications, applistitem); + + g_signal_emit(G_OBJECT(appstore), + signals[APPLICATION_REMOVED], 0, + position, TRUE); + + priv->applications = g_list_remove(priv->applications, app); + } else { + /* Figure out which icon we should be using */ + gchar * newicon = app->icon; + if (status == APP_STATUS_ATTENTION && app->aicon != NULL) { + newicon = app->aicon; + } + + /* Determine whether we're already shown or not */ + if (app->status == APP_STATUS_PASSIVE) { + /* Put on panel */ + priv->applications = g_list_prepend(priv->applications, app); + + /* TODO: We need to have the position determined better. This + would involve looking at the name and category and sorting + it with the other entries. */ + + g_signal_emit(G_OBJECT(app->appstore), + signals[APPLICATION_ADDED], 0, + newicon, + 0, /* Position */ + app->dbus_name, + app->menu, + TRUE); + } else { + /* Icon update */ + GList * applistitem = g_list_find(priv->applications, app); + if (applistitem == NULL) { + g_warning("Change the icon of an application that isn't in the application list?"); + return; + } + + gint position = g_list_position(priv->applications, applistitem); + + g_signal_emit(G_OBJECT(appstore), + signals[APPLICATION_ICON_CHANGED], 0, + position, newicon, TRUE); + } + } - priv->applications = g_list_remove(priv->applications, app); + app->status = status; - application_free(app); return; } @@ -317,6 +400,9 @@ application_service_appstore_application_add (ApplicationServiceAppstore * appst app->dbus_object = g_strdup(dbus_object); app->appstore = appstore; app->status = APP_STATUS_PASSIVE; + app->icon = NULL; + app->aicon = NULL; + app->menu = NULL; /* Get the DBus proxy for the NotificationItem interface */ GError * error = NULL; -- cgit v1.2.3 From 4abe47b6935cb7c3e38f0e5c75f167eb0d3a9597 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 7 Jan 2010 16:48:12 -0600 Subject: Fleshing out the signal functions for updates. Some do more callbacks. --- src/application-service-appstore.c | 105 +++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index 385bd16..51bbca9 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -344,6 +344,98 @@ apply_status (Application * app, ApplicationStatus status) return; } +/* Gets the data back on an updated icon signal. Hopefully + a new fun icon. */ +static void +new_icon_cb (DBusGProxy * proxy, GValue value, GError * error, gpointer userdata) +{ + /* Check for errors */ + if (error != NULL) { + g_warning("Unable to get updated icon name: %s", error->message); + return; + } + + /* Grab the icon and make sure we have one */ + const gchar * newicon = g_value_get_string(&value); + if (newicon == NULL) { + g_warning("Bad new icon :("); + return; + } + + Application * app = (Application *) userdata; + + if (g_strcmp0(newicon, app->icon)) { + /* If the new icon is actually a new icon */ + if (app->icon != NULL) g_free(app->icon); + app->icon = g_strdup(newicon); + + if (app->status == APP_STATUS_ACTIVE) { + ApplicationServiceAppstore * appstore = app->appstore; + ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(appstore); + + GList * applistitem = g_list_find(priv->applications, app); + if (applistitem == NULL) { + g_warning("Change the icon of an application that isn't in the application list?"); + return; + } + + gint position = g_list_position(priv->applications, applistitem); + + g_signal_emit(G_OBJECT(appstore), + signals[APPLICATION_ICON_CHANGED], 0, + position, newicon, TRUE); + } + } + + return; +} + +/* Gets the data back on an updated aicon signal. Hopefully + a new fun icon. */ +static void +new_aicon_cb (DBusGProxy * proxy, GValue value, GError * error, gpointer userdata) +{ + /* Check for errors */ + if (error != NULL) { + g_warning("Unable to get updated icon name: %s", error->message); + return; + } + + /* Grab the icon and make sure we have one */ + const gchar * newicon = g_value_get_string(&value); + if (newicon == NULL) { + g_warning("Bad new icon :("); + return; + } + + Application * app = (Application *) userdata; + + if (g_strcmp0(newicon, app->aicon)) { + /* If the new icon is actually a new icon */ + if (app->aicon != NULL) g_free(app->aicon); + app->aicon = g_strdup(newicon); + + if (app->status == APP_STATUS_ATTENTION) { + ApplicationServiceAppstore * appstore = app->appstore; + ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(appstore); + + GList * applistitem = g_list_find(priv->applications, app); + if (applistitem == NULL) { + g_warning("Change the icon of an application that isn't in the application list?"); + return; + } + + gint position = g_list_position(priv->applications, applistitem); + + g_signal_emit(G_OBJECT(appstore), + signals[APPLICATION_ICON_CHANGED], 0, + position, newicon, TRUE); + } + } + + return; +} + /* Called when the Notification Item signals that it has a new icon. */ static void @@ -352,6 +444,11 @@ new_icon (DBusGProxy * proxy, gpointer data) Application * app = (Application *)data; if (!app->validated) return; + org_freedesktop_DBus_Properties_get_async(app->prop_proxy, + NOTIFICATION_ITEM_DBUS_IFACE, + NOTIFICATION_ITEM_PROP_ICON_NAME, + new_icon_cb, + app); return; } @@ -363,6 +460,12 @@ new_aicon (DBusGProxy * proxy, gpointer data) Application * app = (Application *)data; if (!app->validated) return; + org_freedesktop_DBus_Properties_get_async(app->prop_proxy, + NOTIFICATION_ITEM_DBUS_IFACE, + NOTIFICATION_ITEM_PROP_AICON_NAME, + new_aicon_cb, + app); + return; } @@ -374,6 +477,8 @@ new_status (DBusGProxy * proxy, const gchar * status, gpointer data) Application * app = (Application *)data; if (!app->validated) return; + apply_status(app, string_to_status(status)); + return; } -- cgit v1.2.3 From 2cc15ba2a7ce9f141068ee8e348906bfd867f9f5 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 7 Jan 2010 16:55:31 -0600 Subject: A small refactoring of the code to get the position of an application. --- src/application-service-appstore.c | 62 ++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 36 deletions(-) diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index 51bbca9..02b8faf 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -230,6 +230,22 @@ string_to_status(const gchar * status_string) return APP_STATUS_PASSIVE; } +/* A small helper function to get the position of an application + in the app list. */ +static gint +get_position (Application * app) { + ApplicationServiceAppstore * appstore = app->appstore; + ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(appstore); + + GList * applistitem = g_list_find(priv->applications, app); + if (applistitem == NULL) { + g_warning("Change the icon of an application that isn't in the application list?"); + return -1; + } + + return g_list_position(priv->applications, applistitem); +} + /* A simple global function for dealing with freeing the information in an Application structure */ static void @@ -287,13 +303,8 @@ apply_status (Application * app, ApplicationStatus status) /* This means we're going off line */ if (status == APP_STATUS_PASSIVE) { - GList * applistitem = g_list_find(priv->applications, app); - if (applistitem == NULL) { - g_warning("Removing an application that isn't in the application list?"); - return; - } - - gint position = g_list_position(priv->applications, applistitem); + gint position = get_position(app); + if (position == -1) return; g_signal_emit(G_OBJECT(appstore), signals[APPLICATION_REMOVED], 0, @@ -325,13 +336,8 @@ apply_status (Application * app, ApplicationStatus status) TRUE); } else { /* Icon update */ - GList * applistitem = g_list_find(priv->applications, app); - if (applistitem == NULL) { - g_warning("Change the icon of an application that isn't in the application list?"); - return; - } - - gint position = g_list_position(priv->applications, applistitem); + gint position = get_position(app); + if (position == -1) return; g_signal_emit(G_OBJECT(appstore), signals[APPLICATION_ICON_CHANGED], 0, @@ -370,18 +376,10 @@ new_icon_cb (DBusGProxy * proxy, GValue value, GError * error, gpointer userdata app->icon = g_strdup(newicon); if (app->status == APP_STATUS_ACTIVE) { - ApplicationServiceAppstore * appstore = app->appstore; - ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(appstore); - - GList * applistitem = g_list_find(priv->applications, app); - if (applistitem == NULL) { - g_warning("Change the icon of an application that isn't in the application list?"); - return; - } - - gint position = g_list_position(priv->applications, applistitem); + gint position = get_position(app); + if (position == -1) return; - g_signal_emit(G_OBJECT(appstore), + g_signal_emit(G_OBJECT(app->appstore), signals[APPLICATION_ICON_CHANGED], 0, position, newicon, TRUE); } @@ -416,18 +414,10 @@ new_aicon_cb (DBusGProxy * proxy, GValue value, GError * error, gpointer userdat app->aicon = g_strdup(newicon); if (app->status == APP_STATUS_ATTENTION) { - ApplicationServiceAppstore * appstore = app->appstore; - ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(appstore); + gint position = get_position(app); + if (position == -1) return; - GList * applistitem = g_list_find(priv->applications, app); - if (applistitem == NULL) { - g_warning("Change the icon of an application that isn't in the application list?"); - return; - } - - gint position = g_list_position(priv->applications, applistitem); - - g_signal_emit(G_OBJECT(appstore), + g_signal_emit(G_OBJECT(app->appstore), signals[APPLICATION_ICON_CHANGED], 0, position, newicon, TRUE); } -- cgit v1.2.3 From 8ddab95bf185cbfc63a9644816d9c66c766f6770 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 7 Jan 2010 17:10:31 -0600 Subject: releasing version 0.0.6-0ubuntu1~ppa2~icon3 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index e06fdc4..267ad2f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,10 @@ -indicator-application (0.0.6-0ubuntu1~ppa2~icon3) UNRELEASED; urgency=low +indicator-application (0.0.6-0ubuntu1~ppa2~icon3) karmic; urgency=low * Upstream merge: * Adding support for icons changing through the service and in the indicator. - -- Ted Gould Thu, 07 Jan 2010 17:08:10 -0600 + -- Ted Gould Thu, 07 Jan 2010 17:10:29 -0600 indicator-application (0.0.6-0ubuntu1~ppa2~icon2ubuntu1) karmic; urgency=low -- cgit v1.2.3 From d1fbe4a73eb979b25bb0a063c621442a1ec06f3e Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 7 Jan 2010 20:53:46 -0600 Subject: Changing dbus-properties header to be static and not built from the XML as it needs a fix. --- src/Makefile.am | 1 - src/dbus-properties-client.h | 139 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 139 insertions(+), 1 deletion(-) create mode 100644 src/dbus-properties-client.h diff --git a/src/Makefile.am b/src/Makefile.am index f101d12..d9b7963 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -101,7 +101,6 @@ libappindicator_la_LIBADD = \ DBUS_SPECS = \ application-service.xml \ - dbus-properties.xml \ notification-item.xml \ notification-watcher.xml diff --git a/src/dbus-properties-client.h b/src/dbus-properties-client.h new file mode 100644 index 0000000..dc9f299 --- /dev/null +++ b/src/dbus-properties-client.h @@ -0,0 +1,139 @@ +/* Generated by dbus-binding-tool; do not edit! */ + +#include +#include + +G_BEGIN_DECLS + +#ifndef _DBUS_GLIB_ASYNC_DATA_FREE +#define _DBUS_GLIB_ASYNC_DATA_FREE +static +#ifdef G_HAVE_INLINE +inline +#endif +void +_dbus_glib_async_data_free (gpointer stuff) +{ + g_slice_free (DBusGAsyncData, stuff); +} +#endif + +#ifndef DBUS_GLIB_CLIENT_WRAPPERS_org_freedesktop_DBus_Properties +#define DBUS_GLIB_CLIENT_WRAPPERS_org_freedesktop_DBus_Properties + +static +#ifdef G_HAVE_INLINE +inline +#endif +gboolean +org_freedesktop_DBus_Properties_get (DBusGProxy *proxy, const char * IN_Interface_Name, const char * IN_Property_Name, GValue* OUT_Value, GError **error) + +{ + return dbus_g_proxy_call (proxy, "Get", error, G_TYPE_STRING, IN_Interface_Name, G_TYPE_STRING, IN_Property_Name, G_TYPE_INVALID, G_TYPE_VALUE, OUT_Value, G_TYPE_INVALID); +} + +typedef void (*org_freedesktop_DBus_Properties_get_reply) (DBusGProxy *proxy, GValue OUT_Value, GError *error, gpointer userdata); + +static void +org_freedesktop_DBus_Properties_get_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +{ + DBusGAsyncData *data = (DBusGAsyncData*) user_data; + GError *error = NULL; + GValue OUT_Value = {0}; + dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_VALUE, &OUT_Value, G_TYPE_INVALID); + (*(org_freedesktop_DBus_Properties_get_reply)data->cb) (proxy, OUT_Value, error, data->userdata); + return; +} + +static +#ifdef G_HAVE_INLINE +inline +#endif +DBusGProxyCall* +org_freedesktop_DBus_Properties_get_async (DBusGProxy *proxy, const char * IN_Interface_Name, const char * IN_Property_Name, org_freedesktop_DBus_Properties_get_reply callback, gpointer userdata) + +{ + DBusGAsyncData *stuff; + stuff = g_slice_new (DBusGAsyncData); + stuff->cb = G_CALLBACK (callback); + stuff->userdata = userdata; + return dbus_g_proxy_begin_call (proxy, "Get", org_freedesktop_DBus_Properties_get_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRING, IN_Interface_Name, G_TYPE_STRING, IN_Property_Name, G_TYPE_INVALID); +} +static +#ifdef G_HAVE_INLINE +inline +#endif +gboolean +org_freedesktop_DBus_Properties_set (DBusGProxy *proxy, const char * IN_Interface_Name, const char * IN_Property_Name, const GValue* IN_Value, GError **error) + +{ + return dbus_g_proxy_call (proxy, "Set", error, G_TYPE_STRING, IN_Interface_Name, G_TYPE_STRING, IN_Property_Name, G_TYPE_VALUE, IN_Value, G_TYPE_INVALID, G_TYPE_INVALID); +} + +typedef void (*org_freedesktop_DBus_Properties_set_reply) (DBusGProxy *proxy, GError *error, gpointer userdata); + +static void +org_freedesktop_DBus_Properties_set_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +{ + DBusGAsyncData *data = (DBusGAsyncData*) user_data; + GError *error = NULL; + dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); + (*(org_freedesktop_DBus_Properties_set_reply)data->cb) (proxy, error, data->userdata); + return; +} + +static +#ifdef G_HAVE_INLINE +inline +#endif +DBusGProxyCall* +org_freedesktop_DBus_Properties_set_async (DBusGProxy *proxy, const char * IN_Interface_Name, const char * IN_Property_Name, const GValue* IN_Value, org_freedesktop_DBus_Properties_set_reply callback, gpointer userdata) + +{ + DBusGAsyncData *stuff; + stuff = g_slice_new (DBusGAsyncData); + stuff->cb = G_CALLBACK (callback); + stuff->userdata = userdata; + return dbus_g_proxy_begin_call (proxy, "Set", org_freedesktop_DBus_Properties_set_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRING, IN_Interface_Name, G_TYPE_STRING, IN_Property_Name, G_TYPE_VALUE, IN_Value, G_TYPE_INVALID); +} +static +#ifdef G_HAVE_INLINE +inline +#endif +gboolean +org_freedesktop_DBus_Properties_get_all (DBusGProxy *proxy, const char * IN_Interface_Name, GHashTable** OUT_Properties, GError **error) + +{ + return dbus_g_proxy_call (proxy, "GetAll", error, G_TYPE_STRING, IN_Interface_Name, G_TYPE_INVALID, dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE), OUT_Properties, G_TYPE_INVALID); +} + +typedef void (*org_freedesktop_DBus_Properties_get_all_reply) (DBusGProxy *proxy, GHashTable *OUT_Properties, GError *error, gpointer userdata); + +static void +org_freedesktop_DBus_Properties_get_all_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +{ + DBusGAsyncData *data = (DBusGAsyncData*) user_data; + GError *error = NULL; + GHashTable* OUT_Properties; + dbus_g_proxy_end_call (proxy, call, &error, dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE), &OUT_Properties, G_TYPE_INVALID); + (*(org_freedesktop_DBus_Properties_get_all_reply)data->cb) (proxy, OUT_Properties, error, data->userdata); + return; +} + +static +#ifdef G_HAVE_INLINE +inline +#endif +DBusGProxyCall* +org_freedesktop_DBus_Properties_get_all_async (DBusGProxy *proxy, const char * IN_Interface_Name, org_freedesktop_DBus_Properties_get_all_reply callback, gpointer userdata) + +{ + DBusGAsyncData *stuff; + stuff = g_slice_new (DBusGAsyncData); + stuff->cb = G_CALLBACK (callback); + stuff->userdata = userdata; + return dbus_g_proxy_begin_call (proxy, "GetAll", org_freedesktop_DBus_Properties_get_all_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRING, IN_Interface_Name, G_TYPE_INVALID); +} +#endif /* defined DBUS_GLIB_CLIENT_WRAPPERS_org_freedesktop_DBus_Properties */ + +G_END_DECLS -- cgit v1.2.3 From cb14ba38535788494734b0a775148ec873231f07 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 7 Jan 2010 21:00:10 -0600 Subject: Pretty major cut and paste error. Wrong icon. --- src/libappindicator/app-indicator.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libappindicator/app-indicator.c b/src/libappindicator/app-indicator.c index d22161c..a17a46c 100644 --- a/src/libappindicator/app-indicator.c +++ b/src/libappindicator/app-indicator.c @@ -698,14 +698,14 @@ app_indicator_set_icon (AppIndicator *self, const gchar *icon_name) g_return_if_fail (IS_APP_INDICATOR (self)); g_return_if_fail (icon_name != NULL); - if (g_strcmp0 (self->priv->attention_icon_name, icon_name) != 0) + if (g_strcmp0 (self->priv->icon_name, icon_name) != 0) { - if (self->priv->attention_icon_name) - g_free (self->priv->attention_icon_name); + if (self->priv->icon_name) + g_free (self->priv->icon_name); - self->priv->attention_icon_name = g_strdup (icon_name); + self->priv->icon_name = g_strdup (icon_name); - g_signal_emit (self, signals[NEW_ATTENTION_ICON], 0, TRUE); + g_signal_emit (self, signals[NEW_ICON], 0, TRUE); } } -- cgit v1.2.3 From 8fdbf3856f150f47a0da42bcdc11fa5263042874 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 7 Jan 2010 21:04:27 -0600 Subject: releasing version 0.0.6-0ubuntu1~ppa2~icon4 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index c4e8d12..f53fe95 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,10 @@ -indicator-application (0.0.6-0ubuntu1~ppa2~icon4) UNRELEASED; urgency=low +indicator-application (0.0.6-0ubuntu1~ppa2~icon4) karmic; urgency=low * Upstream merge: * Fixing the generated headers for DBus Properties calls * Fixing libappindicator set_icon to set the right icon. - -- Ted Gould Thu, 07 Jan 2010 21:00:55 -0600 + -- Ted Gould Thu, 07 Jan 2010 21:04:24 -0600 indicator-application (0.0.6-0ubuntu1~ppa2~icon3) karmic; urgency=low -- cgit v1.2.3 From 69f4b95cf0a66d6fc58090b7e2f007c3b00ef651 Mon Sep 17 00:00:00 2001 From: Sebastien Bacher Date: Fri, 8 Jan 2010 12:08:51 +0100 Subject: Use correct status syntax in the api description (lp: #504700) --- src/libappindicator/app-indicator.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libappindicator/app-indicator.h b/src/libappindicator/app-indicator.h index e966a49..fa3e301 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, -- cgit v1.2.3 From 83b4f68c5a188d3826beefbe2adddecc0f0a4668 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 8 Jan 2010 08:04:07 -0600 Subject: Changing the property to 'IconThemePath' to make it more clear about what it adjusts. --- docs/reference/tmpl/libappindicator-unused.sgml | 6 ++++++ src/application-service-appstore.c | 2 +- src/libappindicator/app-indicator.c | 16 ++++++++-------- src/notification-item.xml | 4 +++- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/docs/reference/tmpl/libappindicator-unused.sgml b/docs/reference/tmpl/libappindicator-unused.sgml index e69de29..1428b51 100644 --- a/docs/reference/tmpl/libappindicator-unused.sgml +++ b/docs/reference/tmpl/libappindicator-unused.sgml @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index 1ac309a..f76bbe2 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -40,7 +40,7 @@ static gboolean _application_service_server_get_applications (ApplicationService #define NOTIFICATION_ITEM_PROP_STATUS "Status" #define NOTIFICATION_ITEM_PROP_ICON_NAME "IconName" #define NOTIFICATION_ITEM_PROP_AICON_NAME "AttentionIconName" -#define NOTIFICATION_ITEM_PROP_ICON_PATH "IconPath" +#define NOTIFICATION_ITEM_PROP_ICON_PATH "IconThemePath" #define NOTIFICATION_ITEM_PROP_MENU "Menu" /* Private Stuff */ diff --git a/src/libappindicator/app-indicator.c b/src/libappindicator/app-indicator.c index d22161c..f9a7c88 100644 --- a/src/libappindicator/app-indicator.c +++ b/src/libappindicator/app-indicator.c @@ -92,7 +92,7 @@ enum { PROP_STATUS, PROP_ICON_NAME, PROP_ATTENTION_ICON_NAME, - PROP_ICON_PATH, + PROP_ICON_THEME_PATH, PROP_MENU, PROP_CONNECTED }; @@ -103,7 +103,7 @@ enum { #define PROP_STATUS_S "status" #define PROP_ICON_NAME_S "icon-name" #define PROP_ATTENTION_ICON_NAME_S "attention-icon-name" -#define PROP_ICON_PATH_S "icon-path" +#define PROP_ICON_THEME_PATH_S "icon-theme-path" #define PROP_MENU_S "menu" #define PROP_CONNECTED_S "connected" @@ -183,8 +183,8 @@ app_indicator_class_init (AppIndicatorClass *klass) G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property(object_class, - PROP_ICON_PATH, - g_param_spec_string (PROP_ICON_PATH_S, + PROP_ICON_THEME_PATH, + g_param_spec_string (PROP_ICON_THEME_PATH_S, "An additional path for custom icons.", "An additional place to look for icon names that may be installed by the application.", NULL, @@ -440,7 +440,7 @@ app_indicator_set_property (GObject * object, guint prop_id, const GValue * valu g_value_get_string (value)); break; - case PROP_ICON_PATH: + case PROP_ICON_THEME_PATH: if (priv->icon_path != NULL) { g_free(priv->icon_path); } @@ -486,7 +486,7 @@ app_indicator_get_property (GObject * object, guint prop_id, GValue * value, GPa g_value_set_string (value, priv->attention_icon_name); break; - case PROP_ICON_PATH: + case PROP_ICON_THEME_PATH: g_value_set_string (value, priv->icon_path); break; @@ -610,7 +610,7 @@ app_indicator_new (const gchar *id, Creates a new #AppIndicator setting the properties: #AppIndicator::id with @id, #AppIndicator::category with @category, #AppIndicator::icon-name with - @icon_name and #AppIndicator::icon-path with @icon_path. + @icon_name and #AppIndicator::icon-theme-path with @icon_path. Return value: A pointer to a new #AppIndicator object. */ @@ -624,7 +624,7 @@ app_indicator_new_with_path (const gchar *id, "id", id, "category", category_from_enum (category), "icon-name", icon_name, - "icon-path", icon_path, + "icon-theme-path", icon_path, NULL); return indicator; diff --git a/src/notification-item.xml b/src/notification-item.xml index b671e38..f95db31 100644 --- a/src/notification-item.xml +++ b/src/notification-item.xml @@ -8,7 +8,9 @@ - + + -- cgit v1.2.3 From 8226d6c8f8870be9d2902fcd2137b242f2559da8 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 8 Jan 2010 08:07:24 -0600 Subject: Using the #defines for the property names instead of strings. Define them once. --- src/libappindicator/app-indicator.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/libappindicator/app-indicator.c b/src/libappindicator/app-indicator.c index f9a7c88..739a7e6 100644 --- a/src/libappindicator/app-indicator.c +++ b/src/libappindicator/app-indicator.c @@ -592,9 +592,9 @@ app_indicator_new (const gchar *id, AppIndicatorCategory category) { AppIndicator *indicator = g_object_new (APP_INDICATOR_TYPE, - "id", id, - "category", category_from_enum (category), - "icon-name", icon_name, + PROP_ID_S, id, + PROP_CATEGORY_S, category_from_enum (category), + PROP_ICON_NAME_S, icon_name, NULL); return indicator; @@ -621,10 +621,10 @@ app_indicator_new_with_path (const gchar *id, const gchar *icon_path) { AppIndicator *indicator = g_object_new (APP_INDICATOR_TYPE, - "id", id, - "category", category_from_enum (category), - "icon-name", icon_name, - "icon-theme-path", icon_path, + PROP_ID_S, id, + PROP_CATEGORY_S, category_from_enum (category), + PROP_ICON_NAME_S, icon_name, + PROP_ICON_THEME_PATH_S, icon_path, NULL); return indicator; -- cgit v1.2.3 From 0c8cf85f9e6aa2120a7616f0aacb8f3993894687 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 8 Jan 2010 09:25:17 -0600 Subject: Adjusting so that we use the parameter if it's not an object but a path. --- src/application-service-watcher.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/application-service-watcher.c b/src/application-service-watcher.c index f2823dd..1ad59d4 100644 --- a/src/application-service-watcher.c +++ b/src/application-service-watcher.c @@ -169,14 +169,16 @@ _notification_watcher_server_register_status_notifier_item (ApplicationServiceWa { ApplicationServiceWatcherPrivate * priv = APPLICATION_SERVICE_WATCHER_GET_PRIVATE(appwatcher); - const gchar * finalservice = NOTIFICATION_ITEM_DEFAULT_OBJ; - if (service[0] == '/') { - finalservice = service; + 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); } - application_service_appstore_application_add(priv->appstore, dbus_g_method_get_sender(method), finalservice); - dbus_g_method_return(method, G_TYPE_NONE); return TRUE; } -- cgit v1.2.3 From ab7949f8ed0d70686453a2e5c124e9095e8c19f7 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 8 Jan 2010 11:02:12 -0600 Subject: releasing version 0.0.6-0ubuntu1~ppa3 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 7664c97..d5baa7c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,10 @@ -indicator-application (0.0.6-0ubuntu1~ppa3) UNRELEASED; urgency=low +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 Fri, 08 Jan 2010 10:59:38 -0600 + -- Ted Gould Fri, 08 Jan 2010 11:02:09 -0600 indicator-application (0.0.6-0ubuntu1~ppa2) karmic; urgency=low -- cgit v1.2.3 From aaa7438bff492c735bffa378ef5d38d3452b4e6f Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 8 Jan 2010 11:08:46 -0600 Subject: releasing version 0.0.6-0ubuntu1~ppa4 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index d80aabb..52c5003 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,9 @@ -indicator-application (0.0.6-0ubuntu1~ppa4) UNRELEASED; urgency=low +indicator-application (0.0.6-0ubuntu1~ppa4) karmic; urgency=low * Upstream update * Adding in icon path support. - -- Ted Gould Fri, 08 Jan 2010 11:04:56 -0600 + -- Ted Gould Fri, 08 Jan 2010 11:08:40 -0600 indicator-application (0.0.6-0ubuntu1~ppa3) karmic; urgency=low -- cgit v1.2.3 From ae5ff4b699c260dd30ecd59e6c6d58fc5252794d Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 8 Jan 2010 11:27:35 -0600 Subject: releasing version 0.0.6-0ubuntu1~ppa4~icon1 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 7a2a92b..aa3b3a4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,8 @@ -indicator-application (0.0.6-0ubuntu1~ppa4~icon1) UNRELEASED; urgency=low +indicator-application (0.0.6-0ubuntu1~ppa4~icon1) karmic; urgency=low * Syncing with all the other branches. - -- Ted Gould Fri, 08 Jan 2010 11:24:15 -0600 + -- Ted Gould Fri, 08 Jan 2010 11:27:32 -0600 indicator-application (0.0.6-0ubuntu1~ppa2~icon4) karmic; urgency=low -- cgit v1.2.3 From ad42e1044d1bc653a3df8ce76e6e74d79ea890cc Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 8 Jan 2010 11:53:21 -0600 Subject: Fleshing out some of the remove function. For some reason the appstore is getting disposed, but that's the next thing to look at. --- src/application-service-appstore.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index ae9876e..3215b49 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -585,6 +585,8 @@ application_service_appstore_application_add (ApplicationServiceAppstore * appst return; } +/* Removes an application. Currently only works for the apps + that are shown. /TODO Need to fix that. */ void application_service_appstore_application_remove (ApplicationServiceAppstore * appstore, const gchar * dbus_name, const gchar * dbus_object) { @@ -592,6 +594,17 @@ application_service_appstore_application_remove (ApplicationServiceAppstore * ap g_return_if_fail(dbus_name != NULL && dbus_name[0] != '\0'); g_return_if_fail(dbus_object != NULL && dbus_object[0] != '\0'); + ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(appstore); + GList * listpntr; + + for (listpntr = priv->applications; listpntr != NULL; listpntr = g_list_next(listpntr)) { + Application * app = (Application *)listpntr->data; + + if (!g_strcmp0(app->dbus_name, dbus_name) && !g_strcmp0(app->dbus_object, dbus_object)) { + application_removed_cb(NULL, app); + break; /* NOTE: Must break as the list will become inconsistent */ + } + } return; } -- cgit v1.2.3 From 12aab9617cef451183373e16b70a7a168aa82114 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 8 Jan 2010 12:34:43 -0600 Subject: When destroying the application free all the proxies. --- src/application-service-appstore.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index 3215b49..de8d914 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -78,6 +78,7 @@ struct _Application { gchar * aicon; gchar * menu; gchar * icon_path; + gboolean currently_free; }; #define APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(o) \ @@ -261,6 +262,18 @@ static void application_free (Application * app) { if (app == NULL) return; + + /* Handle the case where this could be called by unref'ing one of + the proxy objects. */ + if (app->currently_free) return; + app->currently_free = TRUE; + + if (app->dbus_proxy) { + g_object_unref(app->dbus_proxy); + } + if (app->prop_proxy) { + g_object_unref(app->prop_proxy); + } if (app->dbus_name != NULL) { g_free(app->dbus_name); @@ -512,6 +525,7 @@ application_service_appstore_application_add (ApplicationServiceAppstore * appst app->aicon = NULL; app->menu = NULL; app->icon_path = NULL; + app->currently_free = FALSE; /* Get the DBus proxy for the NotificationItem interface */ GError * error = NULL; -- cgit v1.2.3 From 7970210755bb4523c02b122c8a5eaa0d4e83bde7 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 8 Jan 2010 13:19:52 -0600 Subject: Fixing shutdown signal, but disabling for now --- src/application-service.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/application-service.c b/src/application-service.c index 45295a1..d21154f 100644 --- a/src/application-service.c +++ b/src/application-service.c @@ -43,7 +43,7 @@ service_disconnected (IndicatorService * service, gpointer data) { g_debug("Service disconnected"); if (mainloop != NULL) { - g_main_loop_quit(mainloop); + //g_main_loop_quit(mainloop); } return; } @@ -57,7 +57,7 @@ main (int argc, char ** argv) /* Bring us up as a basic indicator service */ service = indicator_service_new(INDICATOR_APPLICATION_DBUS_ADDR); - g_signal_connect(G_OBJECT(service), "disconnected", G_CALLBACK(service_disconnected), NULL); + g_signal_connect(G_OBJECT(service), INDICATOR_SERVICE_SIGNAL_SHUTDOWN, G_CALLBACK(service_disconnected), NULL); /* Building our app store */ appstore = APPLICATION_SERVICE_APPSTORE(g_object_new(APPLICATION_SERVICE_APPSTORE_TYPE, NULL)); -- cgit v1.2.3 From f8e9a51b9aeeadc89c7e60abca531ab076cacca5 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 8 Jan 2010 13:20:06 -0600 Subject: Debug message cleanup. --- src/application-service-appstore.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index de8d914..4772e49 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -136,7 +136,6 @@ application_service_appstore_class_init (ApplicationServiceAppstoreClass *klass) _application_service_marshal_VOID__INT_STRING, G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_STRING, G_TYPE_NONE); - dbus_g_object_type_install_info(APPLICATION_SERVICE_APPSTORE_TYPE, &dbus_glib__application_service_server_object_info); @@ -249,7 +248,6 @@ get_position (Application * app) { GList * applistitem = g_list_find(priv->applications, app); if (applistitem == NULL) { - g_warning("Change the icon of an application that isn't in the application list?"); return -1; } @@ -322,6 +320,7 @@ apply_status (Application * app, ApplicationStatus status) if (app->status == status) { return; } + g_debug("Changing app status to: %d", status); ApplicationServiceAppstore * appstore = app->appstore; ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(appstore); -- cgit v1.2.3 From 5f797d71ef38ddb421e9b26757df8d3e87b84bce Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 8 Jan 2010 14:10:45 -0600 Subject: Putting the signal on the Class instead of the Instance. --- src/application-service-appstore.c | 6 +++--- src/application-service-appstore.h | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index 4772e49..fa1b9d2 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -117,21 +117,21 @@ application_service_appstore_class_init (ApplicationServiceAppstoreClass *klass) signals[APPLICATION_ADDED] = g_signal_new ("application-added", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ApplicationServiceAppstore, application_added), + G_STRUCT_OFFSET (ApplicationServiceAppstoreClass, application_added), NULL, NULL, _application_service_marshal_VOID__STRING_INT_STRING_STRING_STRING, G_TYPE_NONE, 5, G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_NONE); signals[APPLICATION_REMOVED] = g_signal_new ("application-removed", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ApplicationServiceAppstore, application_removed), + G_STRUCT_OFFSET (ApplicationServiceAppstoreClass, application_removed), NULL, NULL, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT, G_TYPE_NONE); signals[APPLICATION_ICON_CHANGED] = g_signal_new ("application-icon-changed", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ApplicationServiceAppstore, application_icon_changed), + G_STRUCT_OFFSET (ApplicationServiceAppstoreClass, application_icon_changed), NULL, NULL, _application_service_marshal_VOID__INT_STRING, G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_STRING, G_TYPE_NONE); diff --git a/src/application-service-appstore.h b/src/application-service-appstore.h index 7ab20c5..6bd7a01 100644 --- a/src/application-service-appstore.h +++ b/src/application-service-appstore.h @@ -40,16 +40,16 @@ typedef struct _ApplicationServiceAppstoreClass ApplicationServiceAppstoreClass; struct _ApplicationServiceAppstoreClass { GObjectClass parent_class; -}; - -struct _ApplicationServiceAppstore { - GObject parent; void (*application_added) (ApplicationServiceAppstore * appstore, gchar *, gint, gchar *, gchar *, gpointer); void (*application_removed) (ApplicationServiceAppstore * appstore, gint, gpointer); void (*application_icon_changed)(ApplicationServiceAppstore * appstore, gint, const gchar *, gpointer); }; +struct _ApplicationServiceAppstore { + GObject parent; +}; + GType application_service_appstore_get_type (void); void application_service_appstore_application_add (ApplicationServiceAppstore * appstore, const gchar * dbus_name, -- cgit v1.2.3 From 8e8fc1676d79cdd8381bfe9db130e39e6a7eed58 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 8 Jan 2010 14:13:53 -0600 Subject: releasing version 0.0.6-0ubuntu1~ppa4~icon2 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 6b08bec..c9bb1a0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,8 @@ -indicator-application (0.0.6-0ubuntu1~ppa4~icon2) UNRELEASED; urgency=low +indicator-application (0.0.6-0ubuntu1~ppa4~icon2) karmic; urgency=low * Fixing everything by putting the slots on correctly. - -- Ted Gould Fri, 08 Jan 2010 14:11:31 -0600 + -- Ted Gould Fri, 08 Jan 2010 14:13:50 -0600 indicator-application (0.0.6-0ubuntu1~ppa4~icon1) karmic; urgency=low -- cgit v1.2.3 From 087c7f0b7546ac5fc47a301540484053a7c80592 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 8 Jan 2010 14:41:31 -0600 Subject: Making the service have a name different than the watcher interface. --- src/dbus-shared.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dbus-shared.h b/src/dbus-shared.h index efc57a4..b8dc016 100644 --- a/src/dbus-shared.h +++ b/src/dbus-shared.h @@ -20,10 +20,11 @@ with this program. If not, see . */ -#define INDICATOR_APPLICATION_DBUS_ADDR "org.freedesktop.StatusNotifierWatcher" +#define INDICATOR_APPLICATION_DBUS_ADDR "org.ayatana.indicator.application" #define INDICATOR_APPLICATION_DBUS_OBJ "/org/ayatana/indicator/application/service" #define INDICATOR_APPLICATION_DBUS_IFACE "org.ayatana.indicator.application.service" +#define NOTIFICATION_WATCHER_DBUS_ADDR "org.freedesktop.StatusNotifierWatcher" #define NOTIFICATION_WATCHER_DBUS_OBJ "/StatusNotifierWatcher" #define NOTIFICATION_WATCHER_DBUS_IFACE "org.freedesktop.StatusNotifierWatcher" -- cgit v1.2.3 From 34bb6cbec79679821520ac13d2f1cf935d845151 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 8 Jan 2010 14:57:22 -0600 Subject: Make the watcher register it's own name --- src/application-service-watcher.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/src/application-service-watcher.c b/src/application-service-watcher.c index 1ad59d4..eff249d 100644 --- a/src/application-service-watcher.c +++ b/src/application-service-watcher.c @@ -26,6 +26,7 @@ with this program. If not, see . #include #include +#include #include "application-service-watcher.h" #include "dbus-shared.h" @@ -34,6 +35,7 @@ static gboolean _notification_watcher_server_registered_status_notifier_items (A 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); +static void get_name_cb (DBusGProxy * proxy, guint status, GError * error, gpointer data); #include "notification-watcher-server.h" @@ -41,6 +43,7 @@ static gboolean _notification_watcher_server_is_notification_host_registered (Ap typedef struct _ApplicationServiceWatcherPrivate ApplicationServiceWatcherPrivate; struct _ApplicationServiceWatcherPrivate { ApplicationServiceAppstore * appstore; + DBusGProxy * dbus_proxy; }; #define APPLICATION_SERVICE_WATCHER_GET_PRIVATE(o) \ @@ -129,6 +132,23 @@ application_service_watcher_init (ApplicationServiceWatcher *self) NOTIFICATION_WATCHER_DBUS_OBJ, G_OBJECT(self)); + priv->dbus_proxy = dbus_g_proxy_new_for_name_owner(session_bus, + DBUS_SERVICE_DBUS, + DBUS_PATH_DBUS, + DBUS_INTERFACE_DBUS, + &error); + if (error != NULL) { + g_error("Ah, can't get proxy to dbus: %s", error->message); + g_error_free(error); + return; + } + + org_freedesktop_DBus_request_name_async(priv->dbus_proxy, + NOTIFICATION_WATCHER_DBUS_ADDR, + DBUS_NAME_FLAG_DO_NOT_QUEUE, + get_name_cb, + self); + return; } @@ -211,3 +231,21 @@ _notification_watcher_server_is_notification_host_registered (ApplicationService return TRUE; } +/* Function to handle the return of the get name. There isn't a whole + lot that can be done, but we're atleast going to tell people. */ +static void +get_name_cb (DBusGProxy * proxy, guint status, GError * error, gpointer data) +{ + if (error != NULL) { + g_warning("Unable to get watcher name '%s' because: %s", NOTIFICATION_WATCHER_DBUS_ADDR, error->message); + return; + } + + if (status != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER && + status != DBUS_REQUEST_NAME_REPLY_ALREADY_OWNER) { + g_warning("Unable to get watcher name '%s'", NOTIFICATION_WATCHER_DBUS_ADDR); + return; + } + + return; +} -- cgit v1.2.3 From 8d0d0e408b316862980ee722e00a9aa122a1a368 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 8 Jan 2010 14:59:13 -0600 Subject: Making applications register to the watcher address so they work on KDE --- src/libappindicator/app-indicator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libappindicator/app-indicator.c b/src/libappindicator/app-indicator.c index 5868a4d..7560a97 100644 --- a/src/libappindicator/app-indicator.c +++ b/src/libappindicator/app-indicator.c @@ -530,7 +530,7 @@ check_connect (AppIndicator *self) GError * error = NULL; priv->watcher_proxy = dbus_g_proxy_new_for_name_owner(priv->connection, - INDICATOR_APPLICATION_DBUS_ADDR, + NOTIFICATION_WATCHER_DBUS_ADDR, NOTIFICATION_WATCHER_DBUS_OBJ, NOTIFICATION_WATCHER_DBUS_IFACE, &error); -- cgit v1.2.3 From bb71fc2d4c0b555f23940b8c9d4f6973307cbd20 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 8 Jan 2010 15:02:29 -0600 Subject: Reactivate kill switch --- src/application-service.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/application-service.c b/src/application-service.c index d21154f..351e9aa 100644 --- a/src/application-service.c +++ b/src/application-service.c @@ -43,7 +43,7 @@ service_disconnected (IndicatorService * service, gpointer data) { g_debug("Service disconnected"); if (mainloop != NULL) { - //g_main_loop_quit(mainloop); + g_main_loop_quit(mainloop); } return; } -- cgit v1.2.3 From 7f93d0d46164ef3c3be5b6fbb20377528b95425f Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 8 Jan 2010 15:39:52 -0600 Subject: releasing version 0.0.6-0ubuntu1~ppa5 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 9da7988..9de63c4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -indicator-application (0.0.6-0ubuntu1~ppa5) UNRELEASED; urgency=low +indicator-application (0.0.6-0ubuntu1~ppa5) karmic; urgency=low * Upstream merge: * Adding support for icons changing through the service and @@ -6,7 +6,7 @@ indicator-application (0.0.6-0ubuntu1~ppa5) UNRELEASED; urgency=low * Fixing the generated headers for DBus Properties calls * Fixing libappindicator set_icon to set the right icon. - -- Ted Gould Fri, 08 Jan 2010 15:37:04 -0600 + -- Ted Gould Fri, 08 Jan 2010 15:39:49 -0600 indicator-application (0.0.6-0ubuntu1~ppa4) karmic; urgency=low -- cgit v1.2.3 From 21f677f00decc48e2e635844d16d5b6ae0ee486c Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 8 Jan 2010 15:44:49 -0600 Subject: releasing version 0.0.6-0ubuntu1~ppa6 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 90d493e..e103081 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,10 @@ -indicator-application (0.0.6-0ubuntu1~ppa6) UNRELEASED; urgency=low +indicator-application (0.0.6-0ubuntu1~ppa6) karmic; urgency=low * Upstream merge: * Making the Notification Watcher register for it's own DBus name to keep the service one unique. - -- Ted Gould Fri, 08 Jan 2010 15:42:20 -0600 + -- Ted Gould Fri, 08 Jan 2010 15:44:47 -0600 indicator-application (0.0.6-0ubuntu1~ppa5) karmic; urgency=low -- cgit v1.2.3 From 5787ec0042f8df197479e4294308b385eb7d9c91 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 8 Jan 2010 15:57:53 -0600 Subject: 0.0.7 --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 559c2b4..4bc18b2 100644 --- a/configure.ac +++ b/configure.ac @@ -1,11 +1,11 @@ -AC_INIT(indicator-application, 0.0.6, ted@canonical.com) +AC_INIT(indicator-application, 0.0.7, ted@canonical.com) AC_COPYRIGHT([Copyright 2009 Canonical]) AC_PREREQ(2.53) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(indicator-application, 0.0.6) +AM_INIT_AUTOMAKE(indicator-application, 0.0.7) AM_MAINTAINER_MODE -- cgit v1.2.3 From c1010b61c9097212c9631b6cbc4e85fd62539364 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 8 Jan 2010 16:05:45 -0600 Subject: releasing version 0.0.7-0ubuntu1~ppa1 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 965013e..ab6faac 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,8 @@ -indicator-application (0.0.7-0ubuntu1~ppa1) UNRELEASED; urgency=low +indicator-application (0.0.7-0ubuntu1~ppa1) karmic; urgency=low * Upstream Release 0.0.7 - -- Ted Gould Fri, 08 Jan 2010 16:03:26 -0600 + -- Ted Gould Fri, 08 Jan 2010 16:05:39 -0600 indicator-application (0.0.6-0ubuntu2~ppa6) karmic; urgency=low -- cgit v1.2.3