Merge lp:~indicator-applet-developers/indicator-application/lucid into lp:~ubuntu-desktop/indicator-application/ubuntu

Proposed by Ted Gould
Status: Merged
Approved by: Ken VanDine
Approved revision: not available
Merged at revision: not available
Proposed branch: lp:~indicator-applet-developers/indicator-application/lucid
Merge into: lp:~ubuntu-desktop/indicator-application/ubuntu
Diff against target: 325 lines (+90/-40)
8 files modified
configure.ac (+2/-2)
debian/changelog (+8/-0)
src/application-service-appstore.c (+10/-1)
src/libappindicator/app-indicator.c (+48/-29)
tests/Makefile.am (+4/-2)
tests/test-libappindicator-dbus-client.c (+1/-1)
tests/test-libappindicator-dbus-server.c (+10/-4)
tests/test-libappindicator-status-server.c (+7/-1)
To merge this branch: bzr merge lp:~indicator-applet-developers/indicator-application/lucid
Reviewer Review Type Date Requested Status
Ken VanDine Pending
Review via email: mp+19113@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Ted Gould (ted) wrote :

0.0.13

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'configure.ac'
--- configure.ac 2010-02-08 15:51:25 +0000
+++ configure.ac 2010-02-11 16:44:12 +0000
@@ -1,11 +1,11 @@
11
2AC_INIT(indicator-application, 0.0.12, ted@canonical.com)2AC_INIT(indicator-application, 0.0.13, ted@canonical.com)
3AC_COPYRIGHT([Copyright 2009, 2010 Canonical])3AC_COPYRIGHT([Copyright 2009, 2010 Canonical])
44
5AC_PREREQ(2.53)5AC_PREREQ(2.53)
66
7AM_CONFIG_HEADER(config.h)7AM_CONFIG_HEADER(config.h)
8AM_INIT_AUTOMAKE(indicator-application, 0.0.12)8AM_INIT_AUTOMAKE(indicator-application, 0.0.13)
99
10AM_MAINTAINER_MODE10AM_MAINTAINER_MODE
1111
1212
=== modified file 'debian/changelog'
--- debian/changelog 2010-02-09 00:25:26 +0000
+++ debian/changelog 2010-02-11 16:44:12 +0000
@@ -1,3 +1,11 @@
1indicator-application (0.0.13-0ubuntu1) lucid; urgency=low
2
3 * Upstream release 0.0.13
4 * Changing the menu property to be a proper DBus object path
5 * Make object paths unique by including application IDs in them
6
7 -- Ted Gould <ted@ubuntu.com> Thu, 11 Feb 2010 10:41:53 -0600
8
1indicator-application (0.0.12-0ubuntu1) lucid; urgency=low9indicator-application (0.0.12-0ubuntu1) lucid; urgency=low
210
3 * Upstream release 0.0.1211 * Upstream release 0.0.12
412
=== modified file 'src/application-service-appstore.c'
--- src/application-service-appstore.c 2010-02-06 18:06:53 +0000
+++ src/application-service-appstore.c 2010-02-11 16:44:12 +0000
@@ -222,7 +222,16 @@
222 app_lru_file_touch(priv->lrufile, app->id, app->category);222 app_lru_file_touch(priv->lrufile, app->id, app->category);
223223
224 app->icon = g_value_dup_string(g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_ICON_NAME));224 app->icon = g_value_dup_string(g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_ICON_NAME));
225 app->menu = g_value_dup_string(g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_MENU));225
226 GValue * menuval = (GValue *)g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_MENU);
227 if (G_VALUE_TYPE(menuval) == G_TYPE_STRING) {
228 /* This is here to support an older version where we
229 were using strings instea of object paths. */
230 app->menu = g_value_dup_string(menuval);
231 } else {
232 app->menu = g_strdup((gchar *)g_value_get_boxed(menuval));
233 }
234
226 if (g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_AICON_NAME) != NULL) {235 if (g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_AICON_NAME) != NULL) {
227 app->aicon = g_value_dup_string(g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_AICON_NAME));236 app->aicon = g_value_dup_string(g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_AICON_NAME));
228 }237 }
229238
=== modified file 'src/libappindicator/app-indicator.c'
--- src/libappindicator/app-indicator.c 2010-02-08 15:33:13 +0000
+++ src/libappindicator/app-indicator.c 2010-02-11 16:44:12 +0000
@@ -59,6 +59,7 @@
59struct _AppIndicatorPrivate {59struct _AppIndicatorPrivate {
60 /* Properties */60 /* Properties */
61 gchar *id;61 gchar *id;
62 gchar *clean_id;
62 AppIndicatorCategory category;63 AppIndicatorCategory category;
63 AppIndicatorStatus status;64 AppIndicatorStatus status;
64 gchar *icon_name;65 gchar *icon_name;
@@ -115,9 +116,8 @@
115#define APP_INDICATOR_GET_PRIVATE(o) \116#define APP_INDICATOR_GET_PRIVATE(o) \
116 (G_TYPE_INSTANCE_GET_PRIVATE ((o), APP_INDICATOR_TYPE, AppIndicatorPrivate))117 (G_TYPE_INSTANCE_GET_PRIVATE ((o), APP_INDICATOR_TYPE, AppIndicatorPrivate))
117118
118/* Default Paths */119/* Default Path */
119#define DEFAULT_ITEM_PATH "/org/ayatana/NotificationItem"120#define DEFAULT_ITEM_PATH "/org/ayatana/NotificationItem"
120#define DEFAULT_MENU_PATH "/org/ayatana/NotificationItem/Menu"
121121
122/* More constants */122/* More constants */
123#define DEFAULT_FALLBACK_TIMER 100 /* in milliseconds */123#define DEFAULT_FALLBACK_TIMER 100 /* in milliseconds */
@@ -215,10 +215,10 @@
215215
216 g_object_class_install_property(object_class,216 g_object_class_install_property(object_class,
217 PROP_MENU,217 PROP_MENU,
218 g_param_spec_string (PROP_MENU_S,218 g_param_spec_boxed (PROP_MENU_S,
219 "The object path of the menu on DBus.",219 "The object path of the menu on DBus.",
220 "A method for getting the menu path as a string for DBus.",220 "A method for getting the menu path as a string for DBus.",
221 NULL,221 DBUS_TYPE_G_OBJECT_PATH,
222 G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));222 G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
223223
224 g_object_class_install_property (object_class,224 g_object_class_install_property (object_class,
@@ -307,6 +307,7 @@
307 AppIndicatorPrivate * priv = APP_INDICATOR_GET_PRIVATE(self);307 AppIndicatorPrivate * priv = APP_INDICATOR_GET_PRIVATE(self);
308308
309 priv->id = NULL;309 priv->id = NULL;
310 priv->clean_id = NULL;
310 priv->category = APP_INDICATOR_CATEGORY_OTHER;311 priv->category = APP_INDICATOR_CATEGORY_OTHER;
311 priv->status = APP_INDICATOR_STATUS_PASSIVE;312 priv->status = APP_INDICATOR_STATUS_PASSIVE;
312 priv->icon_name = NULL;313 priv->icon_name = NULL;
@@ -332,11 +333,7 @@
332 }333 }
333 dbus_g_connection_ref(priv->connection);334 dbus_g_connection_ref(priv->connection);
334335
335 dbus_g_connection_register_g_object(priv->connection,336 self->priv = priv;
336 DEFAULT_ITEM_PATH,
337 G_OBJECT(self));
338
339 self->priv = priv;
340337
341 return;338 return;
342}339}
@@ -413,6 +410,11 @@
413 priv->id = NULL;410 priv->id = NULL;
414 }411 }
415412
413 if (priv->clean_id != NULL) {
414 g_free(priv->clean_id);
415 priv->clean_id = NULL;
416 }
417
416 if (priv->icon_name != NULL) {418 if (priv->icon_name != NULL) {
417 g_free(priv->icon_name);419 g_free(priv->icon_name);
418 priv->icon_name = NULL;420 priv->icon_name = NULL;
@@ -445,16 +447,23 @@
445447
446 switch (prop_id) {448 switch (prop_id) {
447 case PROP_ID:449 case PROP_ID:
448 if (priv->id != NULL) {450 if (priv->id != NULL) {
449 g_warning ("Resetting ID value when I already had a value of: %s", priv->id);451 g_warning ("Resetting ID value when I already had a value of: %s", priv->id);
450 g_free (priv->id);452 break;
451 priv->id = NULL;453 }
452 }454
453455 priv->id = g_strdup (g_value_get_string (value));
454 priv->id = g_strdup (g_value_get_string (value));456
455457 priv->clean_id = g_strdup(priv->id);
456 check_connect (self);458 gchar * cleaner;
457 break;459 for (cleaner = priv->clean_id; *cleaner != '\0'; cleaner++) {
460 if (!g_ascii_isalnum(*cleaner)) {
461 *cleaner = '_';
462 }
463 }
464
465 check_connect (self);
466 break;
458467
459 case PROP_CATEGORY:468 case PROP_CATEGORY:
460 enum_val = g_enum_get_value_by_nick ((GEnumClass *) g_type_class_ref (APP_INDICATOR_TYPE_INDICATOR_CATEGORY),469 enum_val = g_enum_get_value_by_nick ((GEnumClass *) g_type_class_ref (APP_INDICATOR_TYPE_INDICATOR_CATEGORY),
@@ -547,14 +556,14 @@
547 break;556 break;
548557
549 case PROP_MENU:558 case PROP_MENU:
550 if (G_VALUE_HOLDS_STRING(value)) {559 if (priv->menuservice != NULL) {
551 if (priv->menuservice != NULL) {560 GValue strval = {0};
552 g_object_get_property (G_OBJECT (priv->menuservice), DBUSMENU_SERVER_PROP_DBUS_OBJECT, value);561 g_value_init(&strval, G_TYPE_STRING);
553 }562 g_object_get_property (G_OBJECT (priv->menuservice), DBUSMENU_SERVER_PROP_DBUS_OBJECT, &strval);
554 } else {563 g_value_set_boxed(value, g_value_get_string(&strval));
555 WARN_BAD_TYPE(PROP_MENU_S, value);564 g_value_unset(&strval);
556 }565 }
557 break;566 break;
558567
559 case PROP_CONNECTED:568 case PROP_CONNECTED:
560 g_value_set_boolean (value, priv->watcher_proxy != NULL ? TRUE : FALSE);569 g_value_set_boolean (value, priv->watcher_proxy != NULL ? TRUE : FALSE);
@@ -584,6 +593,11 @@
584 if (priv->icon_name == NULL) return;593 if (priv->icon_name == NULL) return;
585 if (priv->id == NULL) return;594 if (priv->id == NULL) return;
586595
596 gchar * path = g_strdup_printf(DEFAULT_ITEM_PATH "/%s", priv->clean_id);
597 dbus_g_connection_register_g_object(priv->connection,
598 path,
599 G_OBJECT(self));
600
587 GError * error = NULL;601 GError * error = NULL;
588 priv->watcher_proxy = dbus_g_proxy_new_for_name_owner(priv->connection,602 priv->watcher_proxy = dbus_g_proxy_new_for_name_owner(priv->connection,
589 NOTIFICATION_WATCHER_DBUS_ADDR,603 NOTIFICATION_WATCHER_DBUS_ADDR,
@@ -595,11 +609,13 @@
595 it's not a warning anymore. */609 it's not a warning anymore. */
596 g_error_free(error);610 g_error_free(error);
597 start_fallback_timer(self, FALSE);611 start_fallback_timer(self, FALSE);
612 g_free(path);
598 return;613 return;
599 }614 }
600615
601 g_signal_connect(G_OBJECT(priv->watcher_proxy), "destroy", G_CALLBACK(watcher_proxy_destroyed), self);616 g_signal_connect(G_OBJECT(priv->watcher_proxy), "destroy", G_CALLBACK(watcher_proxy_destroyed), self);
602 org_freedesktop_StatusNotifierWatcher_register_status_notifier_item_async(priv->watcher_proxy, DEFAULT_ITEM_PATH, register_service_cb, self);617 org_freedesktop_StatusNotifierWatcher_register_status_notifier_item_async(priv->watcher_proxy, path, register_service_cb, self);
618 g_free(path);
603619
604 return;620 return;
605}621}
@@ -1220,7 +1236,9 @@
1220 root);1236 root);
12211237
1222 if (priv->menuservice == NULL) {1238 if (priv->menuservice == NULL) {
1223 priv->menuservice = dbusmenu_server_new (DEFAULT_MENU_PATH);1239 gchar * path = g_strdup_printf(DEFAULT_ITEM_PATH "/%s/Menu", priv->clean_id);
1240 priv->menuservice = dbusmenu_server_new (path);
1241 g_free(path);
1224 }1242 }
12251243
1226 dbusmenu_server_set_root (priv->menuservice, root);1244 dbusmenu_server_set_root (priv->menuservice, root);
@@ -1244,6 +1262,7 @@
12441262
1245 g_return_if_fail (IS_APP_INDICATOR (self));1263 g_return_if_fail (IS_APP_INDICATOR (self));
1246 g_return_if_fail (GTK_IS_MENU (menu));1264 g_return_if_fail (GTK_IS_MENU (menu));
1265 g_return_if_fail (self->priv->clean_id != NULL);
12471266
1248 priv = self->priv;1267 priv = self->priv;
12491268
12501269
=== modified file 'tests/Makefile.am'
--- tests/Makefile.am 2010-02-06 01:30:41 +0000
+++ tests/Makefile.am 2010-02-11 16:44:12 +0000
@@ -158,14 +158,16 @@
158DBUS_RUNNER=dbus-test-runner --dbus-config /usr/share/dbus-test-runner/session.conf158DBUS_RUNNER=dbus-test-runner --dbus-config /usr/share/dbus-test-runner/session.conf
159159
160test-libappindicator-dbus: test-libappindicator-dbus-client test-libappindicator-dbus-server Makefile.am160test-libappindicator-dbus: test-libappindicator-dbus-client test-libappindicator-dbus-server Makefile.am
161 @echo "#!/bin/sh" > test-libappindicator-dbus161 @echo "#!/bin/bash" > test-libappindicator-dbus
162 @echo . $(srcdir)/run-xvfb.sh >> $@
162 @echo $(DBUS_RUNNER) --task ./test-libappindicator-dbus-client --task-name Client --task ./test-libappindicator-dbus-server --task-name Server --ignore-return >> test-libappindicator-dbus163 @echo $(DBUS_RUNNER) --task ./test-libappindicator-dbus-client --task-name Client --task ./test-libappindicator-dbus-server --task-name Server --ignore-return >> test-libappindicator-dbus
163 @chmod +x test-libappindicator-dbus164 @chmod +x test-libappindicator-dbus
164165
165TESTS += test-libappindicator-dbus166TESTS += test-libappindicator-dbus
166167
167test-libappindicator-status: test-libappindicator-status-client test-libappindicator-status-server Makefile.am168test-libappindicator-status: test-libappindicator-status-client test-libappindicator-status-server Makefile.am
168 @echo "#!/bin/sh" > test-libappindicator-status169 @echo "#!/bin/bash" > test-libappindicator-status
170 @echo . $(srcdir)/run-xvfb.sh >> $@
169 @echo $(DBUS_RUNNER) --task ./test-libappindicator-status-client --task-name Client --task ./test-libappindicator-status-server --task-name Server --ignore-return >> test-libappindicator-status171 @echo $(DBUS_RUNNER) --task ./test-libappindicator-status-client --task-name Client --task ./test-libappindicator-status-server --task-name Server --ignore-return >> test-libappindicator-status
170 @chmod +x test-libappindicator-status172 @chmod +x test-libappindicator-status
171173
172174
=== modified file 'tests/test-libappindicator-dbus-client.c'
--- tests/test-libappindicator-dbus-client.c 2010-01-12 06:06:47 +0000
+++ tests/test-libappindicator-dbus-client.c 2010-02-11 16:44:12 +0000
@@ -200,7 +200,7 @@
200200
201 DBusGProxy * props = dbus_g_proxy_new_for_name_owner(session_bus,201 DBusGProxy * props = dbus_g_proxy_new_for_name_owner(session_bus,
202 ":1.0",202 ":1.0",
203 "/org/ayatana/NotificationItem",203 "/org/ayatana/NotificationItem/my_id",
204 DBUS_INTERFACE_PROPERTIES,204 DBUS_INTERFACE_PROPERTIES,
205 &error);205 &error);
206 if (error != NULL) {206 if (error != NULL) {
207207
=== modified file 'tests/test-libappindicator-dbus-server.c'
--- tests/test-libappindicator-dbus-server.c 2009-12-04 17:02:30 +0000
+++ tests/test-libappindicator-dbus-server.c 2010-02-11 16:44:12 +0000
@@ -23,7 +23,7 @@
2323
24#include <dbus/dbus-glib.h>24#include <dbus/dbus-glib.h>
25#include <dbus/dbus-glib-lowlevel.h>25#include <dbus/dbus-glib-lowlevel.h>
26#include <glib.h>26#include <gtk/gtk.h>
27#include <libappindicator/app-indicator.h>27#include <libappindicator/app-indicator.h>
28#include "test-defines.h"28#include "test-defines.h"
2929
@@ -39,13 +39,19 @@
39gint39gint
40main (gint argc, gchar * argv[])40main (gint argc, gchar * argv[])
41{41{
42 g_type_init();42 gtk_init(&argc, &argv);
4343
44 g_debug("DBus ID: %s", dbus_connection_get_server_id(dbus_g_connection_get_connection(dbus_g_bus_get(DBUS_BUS_SESSION, NULL))));44 g_debug("DBus ID: %s", dbus_connection_get_server_id(dbus_g_connection_get_connection(dbus_g_bus_get(DBUS_BUS_SESSION, NULL))));
4545
46 AppIndicator * ci = app_indicator_new (TEST_ID, TEST_ICON_NAME, TEST_CATEGORY);46 AppIndicator * ci = app_indicator_new (TEST_ID, TEST_ICON_NAME, TEST_CATEGORY);
47 app_indicator_set_status (ci, TEST_STATE);47 app_indicator_set_status (ci, TEST_STATE);
48 app_indicator_set_attention_icon (ci, TEST_ATTENTION_ICON_NAME);48 app_indicator_set_attention_icon (ci, TEST_ATTENTION_ICON_NAME);
49
50 GtkMenu * menu = GTK_MENU(gtk_menu_new());
51 GtkMenuItem * item = GTK_MENU_ITEM(gtk_menu_item_new_with_label("Label"));
52 gtk_menu_shell_append(GTK_MENU_SHELL(menu), GTK_WIDGET(item));
53
54 app_indicator_set_menu(ci, menu);
4955
50 g_timeout_add_seconds(2, kill_func, NULL);56 g_timeout_add_seconds(2, kill_func, NULL);
5157
5258
=== modified file 'tests/test-libappindicator-status-server.c'
--- tests/test-libappindicator-status-server.c 2010-02-06 17:44:32 +0000
+++ tests/test-libappindicator-status-server.c 2010-02-11 16:44:12 +0000
@@ -55,7 +55,7 @@
55gint55gint
56main (gint argc, gchar * argv[])56main (gint argc, gchar * argv[])
57{57{
58 g_type_init();58 gtk_init(&argc, &argv);
5959
60 g_usleep(100000);60 g_usleep(100000);
6161
@@ -64,6 +64,12 @@
64 AppIndicator * ci = app_indicator_new ("my-id", "my-icon-name", APP_INDICATOR_CATEGORY_APPLICATION_STATUS);64 AppIndicator * ci = app_indicator_new ("my-id", "my-icon-name", APP_INDICATOR_CATEGORY_APPLICATION_STATUS);
65 app_indicator_set_attention_icon (ci, "my-attention-icon");65 app_indicator_set_attention_icon (ci, "my-attention-icon");
6666
67 GtkMenu * menu = GTK_MENU(gtk_menu_new());
68 GtkMenuItem * item = GTK_MENU_ITEM(gtk_menu_item_new_with_label("Label"));
69 gtk_menu_shell_append(GTK_MENU_SHELL(menu), GTK_WIDGET(item));
70
71 app_indicator_set_menu(ci, menu);
72
67 g_timeout_add(50, toggle, ci);73 g_timeout_add(50, toggle, ci);
6874
69 mainloop = g_main_loop_new(NULL, FALSE);75 mainloop = g_main_loop_new(NULL, FALSE);

Subscribers

People subscribed via source and target branches

to all changes: