Merge lp:~indicator-applet-developers/indicator-applet/messages-packaging into lp:~ubuntu-core-dev/indicator-applet/messages-ubuntu
- messages-packaging
- Merge into messages-ubuntu
Proposed by
Ted Gould
Status: | Merged | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Merged at revision: | not available | ||||||||||||||||
Proposed branch: | lp:~indicator-applet-developers/indicator-applet/messages-packaging | ||||||||||||||||
Merge into: | lp:~ubuntu-core-dev/indicator-applet/messages-ubuntu | ||||||||||||||||
Diff against target: | None lines | ||||||||||||||||
To merge this branch: | bzr merge lp:~indicator-applet-developers/indicator-applet/messages-packaging | ||||||||||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Indicator Applet Developers | Pending | ||
Review via email: mp+9670@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Ted Gould (ted) wrote : | # |
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file '.bzrignore' | |||
2 | --- .bzrignore 2009-02-06 15:26:20 +0000 | |||
3 | +++ .bzrignore 2009-05-28 15:29:41 +0000 | |||
4 | @@ -16,3 +16,6 @@ | |||
5 | 16 | debian/stamp-makefile-build | 16 | debian/stamp-makefile-build |
6 | 17 | libmessaging_la-im-menu-item.lo | 17 | libmessaging_la-im-menu-item.lo |
7 | 18 | src/libmessaging_la-app-menu-item.lo | 18 | src/libmessaging_la-app-menu-item.lo |
8 | 19 | data/indicator-messages.service | ||
9 | 20 | indicator-messages-service | ||
10 | 21 | indicator-messages-service-activate | ||
11 | 19 | 22 | ||
12 | === modified file 'autogen.sh' | |||
13 | --- autogen.sh 2008-12-05 00:34:45 +0000 | |||
14 | +++ autogen.sh 2009-04-05 11:03:12 +0000 | |||
15 | @@ -1,6 +1,6 @@ | |||
16 | 1 | #!/bin/sh | 1 | #!/bin/sh |
17 | 2 | 2 | ||
19 | 3 | PKG_NAME="indicator-applet" | 3 | PKG_NAME="indicator-messages" |
20 | 4 | 4 | ||
21 | 5 | which gnome-autogen.sh || { | 5 | which gnome-autogen.sh || { |
22 | 6 | echo "You need gnome-common from GNOME SVN" | 6 | echo "You need gnome-common from GNOME SVN" |
23 | 7 | 7 | ||
24 | === modified file 'configure.ac' | |||
25 | --- configure.ac 2009-04-13 15:57:24 +0000 | |||
26 | +++ configure.ac 2009-08-04 16:44:11 +0000 | |||
27 | @@ -4,7 +4,7 @@ | |||
28 | 4 | AC_PREREQ(2.53) | 4 | AC_PREREQ(2.53) |
29 | 5 | 5 | ||
30 | 6 | AM_CONFIG_HEADER(config.h) | 6 | AM_CONFIG_HEADER(config.h) |
32 | 7 | AM_INIT_AUTOMAKE(indicator-messages, 0.1.6) | 7 | AM_INIT_AUTOMAKE(indicator-messages, 0.2.0dev) |
33 | 8 | 8 | ||
34 | 9 | AM_MAINTAINER_MODE | 9 | AM_MAINTAINER_MODE |
35 | 10 | 10 | ||
36 | @@ -24,15 +24,34 @@ | |||
37 | 24 | GTK_REQUIRED_VERSION=2.12 | 24 | GTK_REQUIRED_VERSION=2.12 |
38 | 25 | GIO_UNIX_REQUIRED_VERSION=2.18 | 25 | GIO_UNIX_REQUIRED_VERSION=2.18 |
39 | 26 | PANEL_REQUIRED_VERSION=2.0.0 | 26 | PANEL_REQUIRED_VERSION=2.0.0 |
41 | 27 | INDICATE_REQUIRED_VERSION=0.1.5 | 27 | INDICATE_REQUIRED_VERSION=0.2.0 |
42 | 28 | INDICATOR_REQUIRED_VERSION=0.2.0 | ||
43 | 29 | DBUSMENUGTK_REQUIRED_VERSION=0.0.0 | ||
44 | 28 | 30 | ||
45 | 29 | PKG_CHECK_MODULES(APPLET, gtk+-2.0 >= $GTK_REQUIRED_VERSION | 31 | PKG_CHECK_MODULES(APPLET, gtk+-2.0 >= $GTK_REQUIRED_VERSION |
46 | 30 | gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION | 32 | gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION |
48 | 31 | indicate >= $INDICATE_REQUIRED_VERSION) | 33 | indicator >= $INDICATOR_REQUIRED_VERSION |
49 | 34 | indicate >= $INDICATE_REQUIRED_VERSION | ||
50 | 35 | indicate-gtk >= $INDICATE_REQUIRED_VERSION | ||
51 | 36 | dbusmenu-gtk >= $DBUSMENUGTK_REQUIRED_VERSION) | ||
52 | 32 | AC_SUBST(APPLET_CFLAGS) | 37 | AC_SUBST(APPLET_CFLAGS) |
53 | 33 | AC_SUBST(APPLET_LIBS) | 38 | AC_SUBST(APPLET_LIBS) |
54 | 34 | 39 | ||
55 | 35 | ########################### | 40 | ########################### |
56 | 41 | # Indicator Info | ||
57 | 42 | ########################### | ||
58 | 43 | |||
59 | 44 | INDICATORDIR=`$PKG_CONFIG --variable=indicatordir indicator` | ||
60 | 45 | AC_SUBST(INDICATORDIR) | ||
61 | 46 | |||
62 | 47 | ########################### | ||
63 | 48 | # DBus Service Info | ||
64 | 49 | ########################### | ||
65 | 50 | |||
66 | 51 | DBUSSERVICEDIR=`$PKG_CONFIG --variable=session_bus_services_dir dbus-1` | ||
67 | 52 | AC_SUBST(DBUSSERVICEDIR) | ||
68 | 53 | |||
69 | 54 | ########################### | ||
70 | 36 | # Files | 55 | # Files |
71 | 37 | ########################### | 56 | ########################### |
72 | 38 | 57 | ||
73 | @@ -40,6 +59,7 @@ | |||
74 | 40 | Makefile | 59 | Makefile |
75 | 41 | src/Makefile | 60 | src/Makefile |
76 | 42 | data/Makefile | 61 | data/Makefile |
77 | 62 | data/indicator-messages.service | ||
78 | 43 | data/icons/Makefile | 63 | data/icons/Makefile |
79 | 44 | data/icons/16x16/Makefile | 64 | data/icons/16x16/Makefile |
80 | 45 | data/icons/16x16/status/Makefile | 65 | data/icons/16x16/status/Makefile |
81 | @@ -64,4 +84,5 @@ | |||
82 | 64 | Messaging Indicator Configuration: | 84 | Messaging Indicator Configuration: |
83 | 65 | 85 | ||
84 | 66 | Prefix: $prefix | 86 | Prefix: $prefix |
85 | 87 | Indicator Dir: $INDICATORDIR | ||
86 | 67 | ]) | 88 | ]) |
87 | 68 | 89 | ||
88 | === modified file 'data/Makefile.am' | |||
89 | --- data/Makefile.am 2009-02-04 16:01:51 +0000 | |||
90 | +++ data/Makefile.am 2009-05-27 10:51:24 +0000 | |||
91 | @@ -1,1 +1,4 @@ | |||
92 | 1 | SUBDIRS = icons | 1 | SUBDIRS = icons |
93 | 2 | |||
94 | 3 | dbus_servicesdir = $(DBUSSERVICEDIR) | ||
95 | 4 | dbus_services_DATA = indicator-messages.service | ||
96 | 2 | 5 | ||
97 | === added file 'data/indicator-messages.service.in' | |||
98 | --- data/indicator-messages.service.in 1970-01-01 00:00:00 +0000 | |||
99 | +++ data/indicator-messages.service.in 2009-05-28 15:33:26 +0000 | |||
100 | @@ -0,0 +1,3 @@ | |||
101 | 1 | [D-BUS Service] | ||
102 | 2 | Name=com.ubuntu.indicator.messages | ||
103 | 3 | Exec=@prefix@/bin/indicator-messages-service | ||
104 | 0 | 4 | ||
105 | === modified file 'debian/changelog' | |||
106 | --- debian/changelog 2009-04-14 09:32:06 +0000 | |||
107 | +++ debian/changelog 2009-08-04 16:54:53 +0000 | |||
108 | @@ -1,3 +1,62 @@ | |||
109 | 1 | indicator-messages (0.2.0~bzr121-0ubuntu1~ppa4) karmic; urgency=low | ||
110 | 2 | |||
111 | 3 | * debian/control: Adding in a build dep on libindicate-gtk-dev | ||
112 | 4 | |||
113 | 5 | -- Ted Gould <ted@ubuntu.com> Tue, 04 Aug 2009 17:54:44 +0100 | ||
114 | 6 | |||
115 | 7 | indicator-messages (0.2.0~bzr121-0ubuntu1~ppa3) karmic; urgency=low | ||
116 | 8 | |||
117 | 9 | * Changes for the changing libindicate stuff. | ||
118 | 10 | |||
119 | 11 | -- Ted Gould <ted@ubuntu.com> Tue, 04 Aug 2009 17:46:17 +0100 | ||
120 | 12 | |||
121 | 13 | indicator-messages (0.2.0~bzr121-0ubuntu1~ppa2) karmic; urgency=low | ||
122 | 14 | |||
123 | 15 | * Forgot to run ./autogen.sh | ||
124 | 16 | |||
125 | 17 | -- Ted Gould <ted@ubuntu.com> Tue, 04 Aug 2009 17:38:41 +0100 | ||
126 | 18 | |||
127 | 19 | indicator-messages (0.2.0~bzr121-0ubuntu1~ppa1) karmic; urgency=low | ||
128 | 20 | |||
129 | 21 | * Merge in the dbusmenu changes from the dbusmenu branch | ||
130 | 22 | * debian/control: Adding in a build dependency on libdbusmenu-glib and | ||
131 | 23 | libdbusmenu-gtk to catch up with the merge. | ||
132 | 24 | |||
133 | 25 | -- Ted Gould <ted@ubuntu.com> Tue, 04 Aug 2009 12:50:10 +0100 | ||
134 | 26 | |||
135 | 27 | indicator-messages (0.2.0~bzr120-0ubuntu1) jaunty; urgency=low | ||
136 | 28 | |||
137 | 29 | * Fix to track the timer. (LP: #365187) | ||
138 | 30 | |||
139 | 31 | -- Ted Gould <ted@ubuntu.com> Wed, 13 May 2009 09:56:20 -0500 | ||
140 | 32 | |||
141 | 33 | indicator-messages (0.2.0~bzr119-0ubuntu1) jaunty; urgency=low | ||
142 | 34 | |||
143 | 35 | * Upstream update | ||
144 | 36 | |||
145 | 37 | -- Ted Gould <ted@ubuntu.com> Wed, 22 Apr 2009 23:34:21 -0500 | ||
146 | 38 | |||
147 | 39 | indicator-messages (0.2.0~bzr116-0ubuntu3) jaunty; urgency=low | ||
148 | 40 | |||
149 | 41 | * debian/rules: Adding a rule to remove the .la/.a clutter | ||
150 | 42 | |||
151 | 43 | -- Ted Gould <ted@ubuntu.com> Wed, 22 Apr 2009 16:46:59 -0500 | ||
152 | 44 | |||
153 | 45 | indicator-messages (0.2.0~bzr116-0ubuntu2) jaunty; urgency=low | ||
154 | 46 | |||
155 | 47 | * debian/control: libindicator-dev to ~bzr301 | ||
156 | 48 | |||
157 | 49 | -- Ted Gould <ted@ubuntu.com> Wed, 22 Apr 2009 15:58:45 -0500 | ||
158 | 50 | |||
159 | 51 | indicator-messages (0.2.0~bzr116-0ubuntu1) jaunty; urgency=low | ||
160 | 52 | |||
161 | 53 | * Upstream release | ||
162 | 54 | * Bug fixes | ||
163 | 55 | * Update API to new libindicator | ||
164 | 56 | * debian/control: Adding new dependency on libindicator-dev | ||
165 | 57 | |||
166 | 58 | -- Ted Gould <ted@ubuntu.com> Wed, 22 Apr 2009 15:45:21 -0500 | ||
167 | 59 | |||
168 | 1 | indicator-messages (0.1.6-0ubuntu1) jaunty; urgency=low | 60 | indicator-messages (0.1.6-0ubuntu1) jaunty; urgency=low |
169 | 2 | 61 | ||
170 | 3 | * New upstream version | 62 | * New upstream version |
171 | 4 | 63 | ||
172 | === modified file 'debian/control' | |||
173 | --- debian/control 2009-04-08 03:00:24 +0000 | |||
174 | +++ debian/control 2009-08-04 16:54:42 +0000 | |||
175 | @@ -9,7 +9,11 @@ | |||
176 | 9 | gnome-doc-utils, | 9 | gnome-doc-utils, |
177 | 10 | scrollkeeper, | 10 | scrollkeeper, |
178 | 11 | intltool, | 11 | intltool, |
180 | 12 | libindicate-dev (>= 0.1.5) | 12 | libindicate-dev (>= 0.2.0~bzr298), |
181 | 13 | libindicate-gtk-dev (>= 0.2.0~bzr298), | ||
182 | 14 | libindicator-dev (>= 0.2.0~bzr301), | ||
183 | 15 | libdbusmenu-gtk-dev, | ||
184 | 16 | libdbusmenu-glib-dev | ||
185 | 13 | Standards-Version: 3.8.0 | 17 | Standards-Version: 3.8.0 |
186 | 14 | Homepage: https://launchpad.net/indicator-applet | 18 | Homepage: https://launchpad.net/indicator-applet |
187 | 15 | Vcs-Bzr: http://bazaar.launchpad.net/~ubuntu-core-dev/indicator-applet/messages-ubuntu | 19 | Vcs-Bzr: http://bazaar.launchpad.net/~ubuntu-core-dev/indicator-applet/messages-ubuntu |
188 | 16 | 20 | ||
189 | === modified file 'debian/rules' | |||
190 | --- debian/rules 2008-12-05 04:36:11 +0000 | |||
191 | +++ debian/rules 2009-04-22 21:46:57 +0000 | |||
192 | @@ -6,3 +6,7 @@ | |||
193 | 6 | DEB_CONFIGURE_EXTRA_FLAGS += --disable-scrollkeeper | 6 | DEB_CONFIGURE_EXTRA_FLAGS += --disable-scrollkeeper |
194 | 7 | LDFLAGS += -Wl,-z,defs -Wl,--as-needed | 7 | LDFLAGS += -Wl,-z,defs -Wl,--as-needed |
195 | 8 | 8 | ||
196 | 9 | binary-install/indicator-messages:: | ||
197 | 10 | # remove .a/.la clutter | ||
198 | 11 | rm -f debian/$(cdbs_curpkg)/usr/lib/indicators/*/*.a | ||
199 | 12 | rm -f debian/$(cdbs_curpkg)/usr/lib/indicators/*/*.la | ||
200 | 9 | 13 | ||
201 | === modified file 'src/Makefile.am' | |||
202 | --- src/Makefile.am 2009-03-15 15:32:27 +0000 | |||
203 | +++ src/Makefile.am 2009-05-28 15:19:48 +0000 | |||
204 | @@ -1,7 +1,13 @@ | |||
205 | 1 | 1 | ||
207 | 2 | messaginglibdir = $(libdir)/indicators/1 | 2 | bin_PROGRAMS = indicator-messages-service |
208 | 3 | |||
209 | 4 | messaginglibdir = $(INDICATORDIR) | ||
210 | 3 | messaginglib_LTLIBRARIES = libmessaging.la | 5 | messaginglib_LTLIBRARIES = libmessaging.la |
211 | 4 | libmessaging_la_SOURCES = indicator-messages.c im-menu-item.c im-menu-item.h app-menu-item.c app-menu-item.h | 6 | libmessaging_la_SOURCES = indicator-messages.c im-menu-item.c im-menu-item.h app-menu-item.c app-menu-item.h |
213 | 5 | libmessaging_la_CFLAGS = $(APPLET_CFLAGS) -Wall -Wl,-Bsymbolic-functions -Wl,-z,defs -Wl,--as-needed | 7 | libmessaging_la_CFLAGS = $(APPLET_CFLAGS) -Wall -Wl,-Bsymbolic-functions -Wl,-z,defs -Wl,--as-needed -Werror |
214 | 6 | libmessaging_la_LIBADD = $(APPLET_LIBS) | 8 | libmessaging_la_LIBADD = $(APPLET_LIBS) |
215 | 7 | libmessaging_la_LDFLAGS = -module -avoid-version | 9 | libmessaging_la_LDFLAGS = -module -avoid-version |
216 | 10 | |||
217 | 11 | indicator_messages_service_SOURCES = indicator-service.c im-menu-item.c im-menu-item.h app-menu-item.c app-menu-item.h | ||
218 | 12 | indicator_messages_service_CFLAGS = $(APPLET_CFLAGS) -Wall -Wl,-Bsymbolic-functions -Wl,-z,defs -Wl,--as-needed -Werror | ||
219 | 13 | indicator_messages_service_LDADD = $(APPLET_LIBS) | ||
220 | 8 | 14 | ||
221 | === modified file 'src/app-menu-item.c' | |||
222 | --- src/app-menu-item.c 2009-04-13 15:02:06 +0000 | |||
223 | +++ src/app-menu-item.c 2009-05-26 14:30:31 +0000 | |||
224 | @@ -25,7 +25,6 @@ | |||
225 | 25 | #endif | 25 | #endif |
226 | 26 | 26 | ||
227 | 27 | #include <glib/gi18n.h> | 27 | #include <glib/gi18n.h> |
228 | 28 | #include <gtk/gtk.h> | ||
229 | 29 | #include <gio/gdesktopappinfo.h> | 28 | #include <gio/gdesktopappinfo.h> |
230 | 30 | #include "app-menu-item.h" | 29 | #include "app-menu-item.h" |
231 | 31 | 30 | ||
232 | @@ -48,8 +47,6 @@ | |||
233 | 48 | GAppInfo * appinfo; | 47 | GAppInfo * appinfo; |
234 | 49 | guint unreadcount; | 48 | guint unreadcount; |
235 | 50 | gboolean count_on_label; | 49 | gboolean count_on_label; |
236 | 51 | |||
237 | 52 | GtkWidget * name; | ||
238 | 53 | }; | 50 | }; |
239 | 54 | 51 | ||
240 | 55 | #define APP_MENU_ITEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), APP_MENU_ITEM_TYPE, AppMenuItemPrivate)) | 52 | #define APP_MENU_ITEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), APP_MENU_ITEM_TYPE, AppMenuItemPrivate)) |
241 | @@ -68,7 +65,7 @@ | |||
242 | 68 | 65 | ||
243 | 69 | 66 | ||
244 | 70 | 67 | ||
246 | 71 | G_DEFINE_TYPE (AppMenuItem, app_menu_item, GTK_TYPE_MENU_ITEM); | 68 | G_DEFINE_TYPE (AppMenuItem, app_menu_item, DBUSMENU_TYPE_MENUITEM); |
247 | 72 | 69 | ||
248 | 73 | static void | 70 | static void |
249 | 74 | app_menu_item_class_init (AppMenuItemClass *klass) | 71 | app_menu_item_class_init (AppMenuItemClass *klass) |
250 | @@ -106,7 +103,6 @@ | |||
251 | 106 | 103 | ||
252 | 107 | priv->listener = NULL; | 104 | priv->listener = NULL; |
253 | 108 | priv->server = NULL; | 105 | priv->server = NULL; |
254 | 109 | priv->name = NULL; | ||
255 | 110 | priv->type = NULL; | 106 | priv->type = NULL; |
256 | 111 | priv->appinfo = NULL; | 107 | priv->appinfo = NULL; |
257 | 112 | priv->unreadcount = 0; | 108 | priv->unreadcount = 0; |
258 | @@ -119,6 +115,14 @@ | |||
259 | 119 | static void | 115 | static void |
260 | 120 | app_menu_item_dispose (GObject *object) | 116 | app_menu_item_dispose (GObject *object) |
261 | 121 | { | 117 | { |
262 | 118 | AppMenuItem * self = APP_MENU_ITEM(object); | ||
263 | 119 | AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self); | ||
264 | 120 | |||
265 | 121 | g_signal_handlers_disconnect_by_func(G_OBJECT(priv->listener), G_CALLBACK(indicator_added_cb), self); | ||
266 | 122 | g_signal_handlers_disconnect_by_func(G_OBJECT(priv->listener), G_CALLBACK(indicator_removed_cb), self); | ||
267 | 123 | |||
268 | 124 | g_object_unref(priv->listener); | ||
269 | 125 | |||
270 | 122 | G_OBJECT_CLASS (app_menu_item_parent_class)->dispose (object); | 126 | G_OBJECT_CLASS (app_menu_item_parent_class)->dispose (object); |
271 | 123 | } | 127 | } |
272 | 124 | 128 | ||
273 | @@ -128,8 +132,13 @@ | |||
274 | 128 | AppMenuItem * self = APP_MENU_ITEM(object); | 132 | AppMenuItem * self = APP_MENU_ITEM(object); |
275 | 129 | AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self); | 133 | AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self); |
276 | 130 | 134 | ||
279 | 131 | g_signal_handlers_disconnect_by_func(G_OBJECT(priv->listener), G_CALLBACK(indicator_added_cb), self); | 135 | if (priv->type != NULL) { |
280 | 132 | g_signal_handlers_disconnect_by_func(G_OBJECT(priv->listener), G_CALLBACK(indicator_removed_cb), self); | 136 | g_free(priv->type); |
281 | 137 | } | ||
282 | 138 | |||
283 | 139 | if (priv->appinfo != NULL) { | ||
284 | 140 | g_object_unref(priv->appinfo); | ||
285 | 141 | } | ||
286 | 133 | 142 | ||
287 | 134 | G_OBJECT_CLASS (app_menu_item_parent_class)->finalize (object); | 143 | G_OBJECT_CLASS (app_menu_item_parent_class)->finalize (object); |
288 | 135 | 144 | ||
289 | @@ -144,21 +153,17 @@ | |||
290 | 144 | AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self); | 153 | AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self); |
291 | 145 | 154 | ||
292 | 146 | priv->listener = listener; | 155 | priv->listener = listener; |
293 | 156 | g_object_ref(G_OBJECT(listener)); | ||
294 | 147 | priv->server = server; | 157 | priv->server = server; |
295 | 158 | /* Can not ref as not real GObject */ | ||
296 | 148 | 159 | ||
297 | 149 | g_signal_connect(G_OBJECT(listener), INDICATE_LISTENER_SIGNAL_INDICATOR_ADDED, G_CALLBACK(indicator_added_cb), self); | 160 | g_signal_connect(G_OBJECT(listener), INDICATE_LISTENER_SIGNAL_INDICATOR_ADDED, G_CALLBACK(indicator_added_cb), self); |
298 | 150 | g_signal_connect(G_OBJECT(listener), INDICATE_LISTENER_SIGNAL_INDICATOR_REMOVED, G_CALLBACK(indicator_removed_cb), self); | 161 | g_signal_connect(G_OBJECT(listener), INDICATE_LISTENER_SIGNAL_INDICATOR_REMOVED, G_CALLBACK(indicator_removed_cb), self); |
299 | 151 | 162 | ||
300 | 152 | priv->name = gtk_label_new(INDICATE_LISTENER_SERVER_DBUS_NAME(server)); | ||
301 | 153 | gtk_misc_set_alignment(GTK_MISC(priv->name), 0.0, 0.5); | ||
302 | 154 | gtk_widget_show(GTK_WIDGET(priv->name)); | ||
303 | 155 | |||
304 | 156 | gtk_container_add(GTK_CONTAINER(self), GTK_WIDGET(priv->name)); | ||
305 | 157 | |||
306 | 158 | indicate_listener_server_get_type(listener, server, type_cb, self); | 163 | indicate_listener_server_get_type(listener, server, type_cb, self); |
307 | 159 | indicate_listener_server_get_desktop(listener, server, desktop_cb, self); | 164 | indicate_listener_server_get_desktop(listener, server, desktop_cb, self); |
308 | 160 | 165 | ||
310 | 161 | g_signal_connect(G_OBJECT(self), "activate", G_CALLBACK(activate_cb), NULL); | 166 | g_signal_connect(G_OBJECT(self), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(activate_cb), NULL); |
311 | 162 | 167 | ||
312 | 163 | indicate_listener_server_show_interest(listener, server, INDICATE_INTEREST_SERVER_DISPLAY); | 168 | indicate_listener_server_show_interest(listener, server, INDICATE_INTEREST_SERVER_DISPLAY); |
313 | 164 | indicate_listener_server_show_interest(listener, server, INDICATE_INTEREST_SERVER_SIGNAL); | 169 | indicate_listener_server_show_interest(listener, server, INDICATE_INTEREST_SERVER_SIGNAL); |
314 | @@ -174,8 +179,14 @@ | |||
315 | 174 | 179 | ||
316 | 175 | if (priv->type != NULL) { | 180 | if (priv->type != NULL) { |
317 | 176 | g_free(priv->type); | 181 | g_free(priv->type); |
318 | 182 | priv->type = NULL; | ||
319 | 177 | } | 183 | } |
320 | 178 | 184 | ||
321 | 185 | if (value == NULL) { | ||
322 | 186 | g_warning("Type value is NULL, that shouldn't really happen"); | ||
323 | 187 | return; | ||
324 | 188 | } | ||
325 | 189 | |||
326 | 179 | priv->type = g_strdup(value); | 190 | priv->type = g_strdup(value); |
327 | 180 | 191 | ||
328 | 181 | if (!(!g_strcmp0(priv->type, "message.instant") || !g_strcmp0(priv->type, "message.micro") || !g_strcmp0(priv->type, "message.im"))) { | 192 | if (!(!g_strcmp0(priv->type, "message.instant") || !g_strcmp0(priv->type, "message.micro") || !g_strcmp0(priv->type, "message.im"))) { |
329 | @@ -200,11 +211,11 @@ | |||
330 | 200 | if (priv->count_on_label && !priv->unreadcount < 1) { | 211 | if (priv->count_on_label && !priv->unreadcount < 1) { |
331 | 201 | /* TRANSLATORS: This is the name of the program and the number of indicators. So it | 212 | /* TRANSLATORS: This is the name of the program and the number of indicators. So it |
332 | 202 | would read something like "Mail Client (5)" */ | 213 | would read something like "Mail Client (5)" */ |
335 | 203 | gchar * label = g_strdup_printf(_("%s (%d)"), g_app_info_get_name(priv->appinfo), priv->unreadcount); | 214 | gchar * label = g_strdup_printf(_("%s (%d)"), app_menu_item_get_name(self), priv->unreadcount); |
336 | 204 | gtk_label_set_text(GTK_LABEL(priv->name), label); | 215 | dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), "label", label); |
337 | 205 | g_free(label); | 216 | g_free(label); |
338 | 206 | } else { | 217 | } else { |
340 | 207 | gtk_label_set_text(GTK_LABEL(priv->name), g_app_info_get_name(priv->appinfo)); | 218 | dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), "label", app_menu_item_get_name(self)); |
341 | 208 | } | 219 | } |
342 | 209 | 220 | ||
343 | 210 | return; | 221 | return; |
344 | @@ -228,7 +239,7 @@ | |||
345 | 228 | g_return_if_fail(priv->appinfo != NULL); | 239 | g_return_if_fail(priv->appinfo != NULL); |
346 | 229 | 240 | ||
347 | 230 | update_label(self); | 241 | update_label(self); |
349 | 231 | g_signal_emit(G_OBJECT(self), signals[NAME_CHANGED], 0, g_app_info_get_name(priv->appinfo), TRUE); | 242 | g_signal_emit(G_OBJECT(self), signals[NAME_CHANGED], 0, app_menu_item_get_name(self), TRUE); |
350 | 232 | 243 | ||
351 | 233 | return; | 244 | return; |
352 | 234 | } | 245 | } |
353 | 235 | 246 | ||
354 | === modified file 'src/app-menu-item.h' | |||
355 | --- src/app-menu-item.h 2009-03-15 17:19:02 +0000 | |||
356 | +++ src/app-menu-item.h 2009-05-26 14:30:31 +0000 | |||
357 | @@ -25,6 +25,7 @@ | |||
358 | 25 | #include <glib.h> | 25 | #include <glib.h> |
359 | 26 | #include <glib-object.h> | 26 | #include <glib-object.h> |
360 | 27 | 27 | ||
361 | 28 | #include <libdbusmenu-glib/menuitem.h> | ||
362 | 28 | #include <libindicate/listener.h> | 29 | #include <libindicate/listener.h> |
363 | 29 | 30 | ||
364 | 30 | G_BEGIN_DECLS | 31 | G_BEGIN_DECLS |
365 | @@ -43,14 +44,14 @@ | |||
366 | 43 | typedef struct _AppMenuItemClass AppMenuItemClass; | 44 | typedef struct _AppMenuItemClass AppMenuItemClass; |
367 | 44 | 45 | ||
368 | 45 | struct _AppMenuItemClass { | 46 | struct _AppMenuItemClass { |
370 | 46 | GtkMenuItemClass parent_class; | 47 | DbusmenuMenuitemClass parent_class; |
371 | 47 | 48 | ||
372 | 48 | void (* count_changed) (guint count); | 49 | void (* count_changed) (guint count); |
373 | 49 | void (* name_changed) (gchar * name); | 50 | void (* name_changed) (gchar * name); |
374 | 50 | }; | 51 | }; |
375 | 51 | 52 | ||
376 | 52 | struct _AppMenuItem { | 53 | struct _AppMenuItem { |
378 | 53 | GtkMenuItem parent; | 54 | DbusmenuMenuitem parent; |
379 | 54 | }; | 55 | }; |
380 | 55 | 56 | ||
381 | 56 | GType app_menu_item_get_type (void); | 57 | GType app_menu_item_get_type (void); |
382 | 57 | 58 | ||
383 | === added file 'src/dbus-data.h' | |||
384 | --- src/dbus-data.h 1970-01-01 00:00:00 +0000 | |||
385 | +++ src/dbus-data.h 2009-05-25 22:28:08 +0000 | |||
386 | @@ -0,0 +1,8 @@ | |||
387 | 1 | |||
388 | 2 | #ifndef __DBUS_DATA_H__ | ||
389 | 3 | #define __DBUS_DATA_H__ 1 | ||
390 | 4 | |||
391 | 5 | #define INDICATOR_MESSAGES_DBUS_NAME "com.ubuntu.indicator.messages" | ||
392 | 6 | #define INDICATOR_MESSAGES_DBUS_OBJECT "/com/ubuntu/indicator/messages" | ||
393 | 7 | |||
394 | 8 | #endif /* __DBUS_DATA_H__ */ | ||
395 | 0 | 9 | ||
396 | === modified file 'src/im-menu-item.c' | |||
397 | --- src/im-menu-item.c 2009-04-07 22:00:29 +0000 | |||
398 | +++ src/im-menu-item.c 2009-08-04 16:44:11 +0000 | |||
399 | @@ -24,7 +24,8 @@ | |||
400 | 24 | #endif | 24 | #endif |
401 | 25 | 25 | ||
402 | 26 | #include <glib/gi18n.h> | 26 | #include <glib/gi18n.h> |
404 | 27 | #include <gtk/gtk.h> | 27 | #include <libindicate-gtk/indicator.h> |
405 | 28 | #include <libindicate-gtk/listener.h> | ||
406 | 28 | #include "im-menu-item.h" | 29 | #include "im-menu-item.h" |
407 | 29 | 30 | ||
408 | 30 | enum { | 31 | enum { |
409 | @@ -47,11 +48,6 @@ | |||
410 | 47 | gulong indicator_changed; | 48 | gulong indicator_changed; |
411 | 48 | 49 | ||
412 | 49 | guint time_update_min; | 50 | guint time_update_min; |
413 | 50 | |||
414 | 51 | GtkHBox * hbox; | ||
415 | 52 | GtkLabel * user; | ||
416 | 53 | GtkLabel * time; | ||
417 | 54 | GtkImage * icon; | ||
418 | 55 | }; | 51 | }; |
419 | 56 | 52 | ||
420 | 57 | #define IM_MENU_ITEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), IM_MENU_ITEM_TYPE, ImMenuItemPrivate)) | 53 | #define IM_MENU_ITEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), IM_MENU_ITEM_TYPE, ImMenuItemPrivate)) |
421 | @@ -88,13 +84,7 @@ | |||
422 | 88 | gchar * property, | 84 | gchar * property, |
423 | 89 | ImMenuItem * self); | 85 | ImMenuItem * self); |
424 | 90 | 86 | ||
432 | 91 | 87 | G_DEFINE_TYPE (ImMenuItem, im_menu_item, DBUSMENU_TYPE_MENUITEM); | |
426 | 92 | static GtkSizeGroup * icon_group = NULL; | ||
427 | 93 | static GtkSizeGroup * user_group = NULL; | ||
428 | 94 | static GtkSizeGroup * time_group = NULL; | ||
429 | 95 | |||
430 | 96 | |||
431 | 97 | G_DEFINE_TYPE (ImMenuItem, im_menu_item, GTK_TYPE_MENU_ITEM); | ||
433 | 98 | 88 | ||
434 | 99 | static void | 89 | static void |
435 | 100 | im_menu_item_class_init (ImMenuItemClass *klass) | 90 | im_menu_item_class_init (ImMenuItemClass *klass) |
436 | @@ -129,35 +119,6 @@ | |||
437 | 129 | 119 | ||
438 | 130 | priv->seconds = 0; | 120 | priv->seconds = 0; |
439 | 131 | 121 | ||
440 | 132 | /* build widgets first */ | ||
441 | 133 | priv->icon = GTK_IMAGE(gtk_image_new()); | ||
442 | 134 | priv->user = GTK_LABEL(gtk_label_new("")); | ||
443 | 135 | priv->time = GTK_LABEL(gtk_label_new("")); | ||
444 | 136 | |||
445 | 137 | gtk_misc_set_alignment(GTK_MISC(priv->user), 0.0, 0.5); | ||
446 | 138 | gtk_misc_set_alignment(GTK_MISC(priv->time), 0.0, 0.5); | ||
447 | 139 | |||
448 | 140 | if (icon_group == NULL) { | ||
449 | 141 | icon_group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | ||
450 | 142 | } | ||
451 | 143 | if (user_group == NULL) { | ||
452 | 144 | user_group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | ||
453 | 145 | } | ||
454 | 146 | if (time_group == NULL) { | ||
455 | 147 | time_group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | ||
456 | 148 | } | ||
457 | 149 | gtk_size_group_add_widget(icon_group, GTK_WIDGET(priv->icon)); | ||
458 | 150 | gtk_size_group_add_widget(user_group, GTK_WIDGET(priv->user)); | ||
459 | 151 | gtk_size_group_add_widget(time_group, GTK_WIDGET(priv->time)); | ||
460 | 152 | |||
461 | 153 | priv->hbox = GTK_HBOX(gtk_hbox_new(FALSE, 3)); | ||
462 | 154 | gtk_box_pack_start(GTK_BOX(priv->hbox), GTK_WIDGET(priv->icon), FALSE, TRUE, 3); | ||
463 | 155 | gtk_box_pack_start(GTK_BOX(priv->hbox), GTK_WIDGET(priv->user), TRUE, TRUE, 3); | ||
464 | 156 | gtk_box_pack_start(GTK_BOX(priv->hbox), GTK_WIDGET(priv->time), FALSE, TRUE, 3); | ||
465 | 157 | gtk_widget_show(GTK_WIDGET(priv->hbox)); | ||
466 | 158 | |||
467 | 159 | gtk_container_add(GTK_CONTAINER(self), GTK_WIDGET(priv->hbox)); | ||
468 | 160 | |||
469 | 161 | return; | 122 | return; |
470 | 162 | } | 123 | } |
471 | 163 | 124 | ||
472 | @@ -188,19 +149,7 @@ | |||
473 | 188 | static void | 149 | static void |
474 | 189 | icon_cb (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * property, GdkPixbuf * propertydata, gpointer data) | 150 | icon_cb (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * property, GdkPixbuf * propertydata, gpointer data) |
475 | 190 | { | 151 | { |
489 | 191 | ImMenuItem * self = IM_MENU_ITEM(data); | 152 | /* dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), "icon", propertydata); */ |
477 | 192 | ImMenuItemPrivate * priv = IM_MENU_ITEM_GET_PRIVATE(self); | ||
478 | 193 | |||
479 | 194 | gint height, width; | ||
480 | 195 | gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &width, &height); | ||
481 | 196 | |||
482 | 197 | GdkPixbuf * scaled = gdk_pixbuf_scale_simple(propertydata, width, height, GDK_INTERP_BILINEAR); | ||
483 | 198 | g_object_unref(propertydata); | ||
484 | 199 | |||
485 | 200 | gtk_image_set_from_pixbuf(priv->icon, scaled); | ||
486 | 201 | g_object_unref(scaled); | ||
487 | 202 | |||
488 | 203 | gtk_widget_show(GTK_WIDGET(priv->icon)); | ||
490 | 204 | 153 | ||
491 | 205 | return; | 154 | return; |
492 | 206 | } | 155 | } |
493 | @@ -211,7 +160,7 @@ | |||
494 | 211 | ImMenuItemPrivate * priv = IM_MENU_ITEM_GET_PRIVATE(self); | 160 | ImMenuItemPrivate * priv = IM_MENU_ITEM_GET_PRIVATE(self); |
495 | 212 | 161 | ||
496 | 213 | if (!priv->show_time) { | 162 | if (!priv->show_time) { |
498 | 214 | gtk_label_set_label(priv->time, ""); | 163 | dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), "right-column", ""); |
499 | 215 | return; | 164 | return; |
500 | 216 | } | 165 | } |
501 | 217 | 166 | ||
502 | @@ -242,9 +191,7 @@ | |||
503 | 242 | } | 191 | } |
504 | 243 | 192 | ||
505 | 244 | if (timestring != NULL) { | 193 | if (timestring != NULL) { |
509 | 245 | gtk_label_set_label(priv->time, timestring); | 194 | dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), "right-column", ""); |
507 | 246 | gtk_widget_show(GTK_WIDGET(priv->time)); | ||
508 | 247 | |||
510 | 248 | g_free(timestring); | 195 | g_free(timestring); |
511 | 249 | } | 196 | } |
512 | 250 | 197 | ||
513 | @@ -283,7 +230,7 @@ | |||
514 | 283 | update_time(self); | 230 | update_time(self); |
515 | 284 | 231 | ||
516 | 285 | if (priv->time_update_min == 0) { | 232 | if (priv->time_update_min == 0) { |
518 | 286 | g_timeout_add_seconds(60, time_update_cb, self); | 233 | priv->time_update_min = g_timeout_add_seconds(60, time_update_cb, self); |
519 | 287 | } | 234 | } |
520 | 288 | 235 | ||
521 | 289 | g_signal_emit(G_OBJECT(self), signals[TIME_CHANGED], 0, priv->seconds, TRUE); | 236 | g_signal_emit(G_OBJECT(self), signals[TIME_CHANGED], 0, priv->seconds, TRUE); |
522 | @@ -306,13 +253,7 @@ | |||
523 | 306 | return; | 253 | return; |
524 | 307 | } | 254 | } |
525 | 308 | 255 | ||
533 | 309 | ImMenuItemPrivate * priv = IM_MENU_ITEM_GET_PRIVATE(self); | 256 | dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), "label", propertydata); |
527 | 310 | |||
528 | 311 | gtk_label_set_label(priv->user, propertydata); | ||
529 | 312 | gtk_widget_show(GTK_WIDGET(priv->user)); | ||
530 | 313 | |||
531 | 314 | /* Once we have the user we'll show the menu item */ | ||
532 | 315 | gtk_widget_show(GTK_WIDGET(self)); | ||
534 | 316 | 257 | ||
535 | 317 | return; | 258 | return; |
536 | 318 | } | 259 | } |
537 | @@ -348,7 +289,6 @@ | |||
538 | 348 | ImMenuItem * | 289 | ImMenuItem * |
539 | 349 | im_menu_item_new (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator, gboolean show_time) | 290 | im_menu_item_new (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator, gboolean show_time) |
540 | 350 | { | 291 | { |
541 | 351 | g_debug("Building a new IM Menu Item"); | ||
542 | 352 | ImMenuItem * self = g_object_new(IM_MENU_ITEM_TYPE, NULL); | 292 | ImMenuItem * self = g_object_new(IM_MENU_ITEM_TYPE, NULL); |
543 | 353 | 293 | ||
544 | 354 | ImMenuItemPrivate * priv = IM_MENU_ITEM_GET_PRIVATE(self); | 294 | ImMenuItemPrivate * priv = IM_MENU_ITEM_GET_PRIVATE(self); |
545 | @@ -363,7 +303,7 @@ | |||
546 | 363 | indicate_listener_get_property_time(listener, server, indicator, "time", time_cb, self); | 303 | indicate_listener_get_property_time(listener, server, indicator, "time", time_cb, self); |
547 | 364 | indicate_listener_get_property_icon(listener, server, indicator, "icon", icon_cb, self); | 304 | indicate_listener_get_property_icon(listener, server, indicator, "icon", icon_cb, self); |
548 | 365 | 305 | ||
550 | 366 | g_signal_connect(G_OBJECT(self), "activate", G_CALLBACK(activate_cb), NULL); | 306 | g_signal_connect(G_OBJECT(self), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(activate_cb), NULL); |
551 | 367 | priv->indicator_changed = g_signal_connect(G_OBJECT(listener), INDICATE_LISTENER_SIGNAL_INDICATOR_MODIFIED, G_CALLBACK(indicator_modified_cb), self); | 307 | priv->indicator_changed = g_signal_connect(G_OBJECT(listener), INDICATE_LISTENER_SIGNAL_INDICATOR_MODIFIED, G_CALLBACK(indicator_modified_cb), self); |
552 | 368 | 308 | ||
553 | 369 | return self; | 309 | return self; |
554 | 370 | 310 | ||
555 | === modified file 'src/im-menu-item.h' | |||
556 | --- src/im-menu-item.h 2009-03-24 21:57:06 +0000 | |||
557 | +++ src/im-menu-item.h 2009-05-26 14:30:37 +0000 | |||
558 | @@ -25,6 +25,7 @@ | |||
559 | 25 | #include <glib.h> | 25 | #include <glib.h> |
560 | 26 | #include <glib-object.h> | 26 | #include <glib-object.h> |
561 | 27 | 27 | ||
562 | 28 | #include <libdbusmenu-glib/menuitem.h> | ||
563 | 28 | #include <libindicate/listener.h> | 29 | #include <libindicate/listener.h> |
564 | 29 | 30 | ||
565 | 30 | G_BEGIN_DECLS | 31 | G_BEGIN_DECLS |
566 | @@ -42,13 +43,13 @@ | |||
567 | 42 | typedef struct _ImMenuItemClass ImMenuItemClass; | 43 | typedef struct _ImMenuItemClass ImMenuItemClass; |
568 | 43 | 44 | ||
569 | 44 | struct _ImMenuItemClass { | 45 | struct _ImMenuItemClass { |
571 | 45 | GtkMenuItemClass parent_class; | 46 | DbusmenuMenuitemClass parent_class; |
572 | 46 | 47 | ||
573 | 47 | void (*time_changed) (glong seconds); | 48 | void (*time_changed) (glong seconds); |
574 | 48 | }; | 49 | }; |
575 | 49 | 50 | ||
576 | 50 | struct _ImMenuItem { | 51 | struct _ImMenuItem { |
578 | 51 | GtkMenuItem parent; | 52 | DbusmenuMenuitem parent; |
579 | 52 | }; | 53 | }; |
580 | 53 | 54 | ||
581 | 54 | GType im_menu_item_get_type (void); | 55 | GType im_menu_item_get_type (void); |
582 | 55 | 56 | ||
583 | === added file 'src/indicator-messages.c' | |||
584 | --- src/indicator-messages.c 1970-01-01 00:00:00 +0000 | |||
585 | +++ src/indicator-messages.c 2009-05-28 15:20:23 +0000 | |||
586 | @@ -0,0 +1,81 @@ | |||
587 | 1 | /* | ||
588 | 2 | An indicator to show information that is in messaging applications | ||
589 | 3 | that the user is using. | ||
590 | 4 | |||
591 | 5 | Copyright 2009 Canonical Ltd. | ||
592 | 6 | |||
593 | 7 | Authors: | ||
594 | 8 | Ted Gould <ted@canonical.com> | ||
595 | 9 | |||
596 | 10 | This program is free software: you can redistribute it and/or modify it | ||
597 | 11 | under the terms of the GNU General Public License version 3, as published | ||
598 | 12 | by the Free Software Foundation. | ||
599 | 13 | |||
600 | 14 | This program is distributed in the hope that it will be useful, but | ||
601 | 15 | WITHOUT ANY WARRANTY; without even the implied warranties of | ||
602 | 16 | MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
603 | 17 | PURPOSE. See the GNU General Public License for more details. | ||
604 | 18 | |||
605 | 19 | You should have received a copy of the GNU General Public License along | ||
606 | 20 | with this program. If not, see <http://www.gnu.org/licenses/>. | ||
607 | 21 | */ | ||
608 | 22 | |||
609 | 23 | #include <string.h> | ||
610 | 24 | #include <gtk/gtk.h> | ||
611 | 25 | #include <libdbusmenu-gtk/menu.h> | ||
612 | 26 | #include <dbus/dbus-glib.h> | ||
613 | 27 | #include <dbus/dbus-glib-bindings.h> | ||
614 | 28 | |||
615 | 29 | #include <libindicator/indicator.h> | ||
616 | 30 | INDICATOR_SET_VERSION | ||
617 | 31 | INDICATOR_SET_NAME("messages") | ||
618 | 32 | |||
619 | 33 | #include "dbus-data.h" | ||
620 | 34 | |||
621 | 35 | static GtkWidget * main_image; | ||
622 | 36 | |||
623 | 37 | #define DESIGN_TEAM_SIZE design_team_size | ||
624 | 38 | static GtkIconSize design_team_size; | ||
625 | 39 | |||
626 | 40 | GtkLabel * | ||
627 | 41 | get_label (void) | ||
628 | 42 | { | ||
629 | 43 | return NULL; | ||
630 | 44 | } | ||
631 | 45 | |||
632 | 46 | GtkImage * | ||
633 | 47 | get_icon (void) | ||
634 | 48 | { | ||
635 | 49 | design_team_size = gtk_icon_size_register("design-team-size", 22, 22); | ||
636 | 50 | |||
637 | 51 | main_image = gtk_image_new_from_icon_name("indicator-messages", DESIGN_TEAM_SIZE); | ||
638 | 52 | gtk_widget_show(main_image); | ||
639 | 53 | |||
640 | 54 | /* Need a proxy here to figure out when the icon changes */ | ||
641 | 55 | |||
642 | 56 | return GTK_IMAGE(main_image); | ||
643 | 57 | } | ||
644 | 58 | |||
645 | 59 | GtkMenu * | ||
646 | 60 | get_menu (void) | ||
647 | 61 | { | ||
648 | 62 | guint returnval = 0; | ||
649 | 63 | GError * error = NULL; | ||
650 | 64 | |||
651 | 65 | DBusGConnection * connection = dbus_g_bus_get(DBUS_BUS_SESSION, NULL); | ||
652 | 66 | DBusGProxy * proxy = dbus_g_proxy_new_for_name(connection, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS); | ||
653 | 67 | |||
654 | 68 | if (!org_freedesktop_DBus_start_service_by_name (proxy, INDICATOR_MESSAGES_DBUS_NAME, 0, &returnval, &error)) { | ||
655 | 69 | g_error("Unable to send message to DBus to start service: %s", error != NULL ? error->message : "(NULL error)" ); | ||
656 | 70 | g_error_free(error); | ||
657 | 71 | return NULL; | ||
658 | 72 | } | ||
659 | 73 | |||
660 | 74 | if (returnval != DBUS_START_REPLY_SUCCESS && returnval != DBUS_START_REPLY_ALREADY_RUNNING) { | ||
661 | 75 | g_error("Return value isn't indicative of success: %d", returnval); | ||
662 | 76 | return NULL; | ||
663 | 77 | } | ||
664 | 78 | |||
665 | 79 | return GTK_MENU(dbusmenu_gtkmenu_new(INDICATOR_MESSAGES_DBUS_NAME, INDICATOR_MESSAGES_DBUS_OBJECT)); | ||
666 | 80 | } | ||
667 | 81 | |||
668 | 0 | 82 | ||
669 | === renamed file 'src/indicator-messages.c' => 'src/indicator-service.c' | |||
670 | --- src/indicator-messages.c 2009-04-08 02:50:41 +0000 | |||
671 | +++ src/indicator-service.c 2009-05-27 08:44:37 +0000 | |||
672 | @@ -21,26 +21,28 @@ | |||
673 | 21 | */ | 21 | */ |
674 | 22 | 22 | ||
675 | 23 | #include <string.h> | 23 | #include <string.h> |
677 | 24 | #include <gtk/gtk.h> | 24 | #include <dbus/dbus-glib-bindings.h> |
678 | 25 | #include <libindicate/listener.h> | 25 | #include <libindicate/listener.h> |
679 | 26 | 26 | ||
680 | 27 | #include <libdbusmenu-glib/server.h> | ||
681 | 28 | |||
682 | 27 | #include "im-menu-item.h" | 29 | #include "im-menu-item.h" |
683 | 28 | #include "app-menu-item.h" | 30 | #include "app-menu-item.h" |
684 | 31 | #include "dbus-data.h" | ||
685 | 29 | 32 | ||
686 | 30 | static IndicateListener * listener; | 33 | static IndicateListener * listener; |
687 | 31 | static GList * serverList; | 34 | static GList * serverList; |
690 | 32 | static GtkWidget * main_image; | 35 | |
691 | 33 | static GtkWidget * main_menu; | 36 | static DbusmenuMenuitem * root_menuitem = NULL; |
692 | 37 | static GMainLoop * mainloop = NULL; | ||
693 | 38 | |||
694 | 34 | 39 | ||
695 | 35 | static void server_count_changed (AppMenuItem * appitem, guint count, gpointer data); | 40 | static void server_count_changed (AppMenuItem * appitem, guint count, gpointer data); |
696 | 36 | static void server_name_changed (AppMenuItem * appitem, gchar * name, gpointer data); | 41 | static void server_name_changed (AppMenuItem * appitem, gchar * name, gpointer data); |
697 | 37 | static void im_time_changed (ImMenuItem * imitem, glong seconds, gpointer data); | 42 | static void im_time_changed (ImMenuItem * imitem, glong seconds, gpointer data); |
699 | 38 | static void reconsile_list_and_menu (GList * serverlist, GtkMenuShell * menushell); | 43 | static void reconsile_list_and_menu (GList * serverlist, DbusmenuMenuitem * menushell); |
700 | 39 | static void indicator_removed (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * type, gpointer data); | 44 | static void indicator_removed (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * type, gpointer data); |
701 | 40 | 45 | ||
702 | 41 | #define DESIGN_TEAM_SIZE design_team_size | ||
703 | 42 | static GtkIconSize design_team_size; | ||
704 | 43 | |||
705 | 44 | typedef struct _serverList_t serverList_t; | 46 | typedef struct _serverList_t serverList_t; |
706 | 45 | struct _serverList_t { | 47 | struct _serverList_t { |
707 | 46 | IndicateListenerServer * server; | 48 | IndicateListenerServer * server; |
708 | @@ -80,7 +82,7 @@ | |||
709 | 80 | struct _imList_t { | 82 | struct _imList_t { |
710 | 81 | IndicateListenerServer * server; | 83 | IndicateListenerServer * server; |
711 | 82 | IndicateListenerIndicator * indicator; | 84 | IndicateListenerIndicator * indicator; |
713 | 83 | GtkWidget * menuitem; | 85 | DbusmenuMenuitem * menuitem; |
714 | 84 | gulong timechange_cb; | 86 | gulong timechange_cb; |
715 | 85 | }; | 87 | }; |
716 | 86 | 88 | ||
717 | @@ -131,7 +133,7 @@ | |||
718 | 131 | return; | 133 | return; |
719 | 132 | } | 134 | } |
720 | 133 | 135 | ||
722 | 134 | GtkMenuShell * menushell = GTK_MENU_SHELL(data); | 136 | DbusmenuMenuitem * menushell = DBUSMENU_MENUITEM(data); |
723 | 135 | if (menushell == NULL) { | 137 | if (menushell == NULL) { |
724 | 136 | g_error("\tData in callback is not a menushell"); | 138 | g_error("\tData in callback is not a menushell"); |
725 | 137 | return; | 139 | return; |
726 | @@ -157,9 +159,8 @@ | |||
727 | 157 | serverList = g_list_insert_sorted(serverList, sl_item, serverList_sort); | 159 | serverList = g_list_insert_sorted(serverList, sl_item, serverList_sort); |
728 | 158 | } | 160 | } |
729 | 159 | 161 | ||
733 | 160 | gtk_menu_shell_prepend(menushell, GTK_WIDGET(menuitem)); | 162 | dbusmenu_menuitem_child_append(menushell, DBUSMENU_MENUITEM(menuitem)); |
734 | 161 | gtk_widget_show(GTK_WIDGET(menuitem)); | 163 | /* Should be prepend ^ */ |
732 | 162 | gtk_widget_show(GTK_WIDGET(main_menu)); | ||
735 | 163 | 164 | ||
736 | 164 | reconsile_list_and_menu(serverList, menushell); | 165 | reconsile_list_and_menu(serverList, menushell); |
737 | 165 | 166 | ||
738 | @@ -170,7 +171,7 @@ | |||
739 | 170 | server_name_changed (AppMenuItem * appitem, gchar * name, gpointer data) | 171 | server_name_changed (AppMenuItem * appitem, gchar * name, gpointer data) |
740 | 171 | { | 172 | { |
741 | 172 | serverList = g_list_sort(serverList, serverList_sort); | 173 | serverList = g_list_sort(serverList, serverList_sort); |
743 | 173 | reconsile_list_and_menu(serverList, GTK_MENU_SHELL(data)); | 174 | reconsile_list_and_menu(serverList, DBUSMENU_MENUITEM(data)); |
744 | 174 | return; | 175 | return; |
745 | 175 | } | 176 | } |
746 | 176 | 177 | ||
747 | @@ -193,7 +194,7 @@ | |||
748 | 193 | if (count != 0) { | 194 | if (count != 0) { |
749 | 194 | g_debug("Setting image to 'new'"); | 195 | g_debug("Setting image to 'new'"); |
750 | 195 | showing_new_icon = TRUE; | 196 | showing_new_icon = TRUE; |
752 | 196 | gtk_image_set_from_icon_name(GTK_IMAGE(main_image), "indicator-messages-new", DESIGN_TEAM_SIZE); | 197 | /* gtk_image_set_from_icon_name(GTK_IMAGE(main_image), "indicator-messages-new", DESIGN_TEAM_SIZE); */ |
753 | 197 | return; | 198 | return; |
754 | 198 | } | 199 | } |
755 | 199 | 200 | ||
756 | @@ -214,7 +215,7 @@ | |||
757 | 214 | if (!we_have_indicators) { | 215 | if (!we_have_indicators) { |
758 | 215 | g_debug("Setting image to boring"); | 216 | g_debug("Setting image to boring"); |
759 | 216 | showing_new_icon = FALSE; | 217 | showing_new_icon = FALSE; |
761 | 217 | gtk_image_set_from_icon_name(GTK_IMAGE(main_image), "indicator-messages", DESIGN_TEAM_SIZE); | 218 | /* gtk_image_set_from_icon_name(GTK_IMAGE(main_image), "indicator-messages", DESIGN_TEAM_SIZE); */ |
762 | 218 | } | 219 | } |
763 | 219 | 220 | ||
764 | 220 | return; | 221 | return; |
765 | @@ -225,7 +226,7 @@ | |||
766 | 225 | { | 226 | { |
767 | 226 | serverList_t * sl = (serverList_t *)data; | 227 | serverList_t * sl = (serverList_t *)data; |
768 | 227 | sl->imList = g_list_sort(sl->imList, imList_sort); | 228 | sl->imList = g_list_sort(sl->imList, imList_sort); |
770 | 228 | reconsile_list_and_menu(serverList, GTK_MENU_SHELL(gtk_widget_get_parent(GTK_WIDGET(imitem)))); | 229 | reconsile_list_and_menu(serverList, root_menuitem); |
771 | 229 | return; | 230 | return; |
772 | 230 | } | 231 | } |
773 | 231 | 232 | ||
774 | @@ -252,18 +253,14 @@ | |||
775 | 252 | serverList = g_list_remove(serverList, sltp); | 253 | serverList = g_list_remove(serverList, sltp); |
776 | 253 | 254 | ||
777 | 254 | if (sltp->menuitem != NULL) { | 255 | if (sltp->menuitem != NULL) { |
780 | 255 | gtk_widget_hide(GTK_WIDGET(sltp->menuitem)); | 256 | dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(sltp->menuitem), "visibile", "false"); |
781 | 256 | gtk_container_remove(GTK_CONTAINER(data), GTK_WIDGET(sltp->menuitem)); | 257 | dbusmenu_menuitem_child_delete(DBUSMENU_MENUITEM(data), DBUSMENU_MENUITEM(sltp->menuitem)); |
782 | 257 | } | 258 | } |
783 | 258 | 259 | ||
784 | 259 | g_free(sltp); | 260 | g_free(sltp); |
785 | 260 | 261 | ||
792 | 261 | if (g_list_length(serverList) == 0) { | 262 | /* Simulate a server saying zero to recalculate icon */ |
793 | 262 | gtk_widget_hide(main_menu); | 263 | server_count_changed(NULL, 0, NULL); |
788 | 263 | } else { | ||
789 | 264 | /* Simulate a server saying zero to recalculate icon */ | ||
790 | 265 | server_count_changed(NULL, 0, NULL); | ||
791 | 266 | } | ||
794 | 267 | 264 | ||
795 | 268 | return; | 265 | return; |
796 | 269 | } | 266 | } |
797 | @@ -276,7 +273,7 @@ | |||
798 | 276 | }; | 273 | }; |
799 | 277 | 274 | ||
800 | 278 | static void | 275 | static void |
802 | 279 | menushell_foreach_cb (GtkWidget * data_mi, gpointer data_ms) { | 276 | menushell_foreach_cb (DbusmenuMenuitem * data_mi, gpointer data_ms) { |
803 | 280 | menushell_location_t * msl = (menushell_location_t *)data_ms; | 277 | menushell_location_t * msl = (menushell_location_t *)data_ms; |
804 | 281 | 278 | ||
805 | 282 | if (msl->found) return; | 279 | if (msl->found) return; |
806 | @@ -296,7 +293,7 @@ | |||
807 | 296 | } | 293 | } |
808 | 297 | 294 | ||
809 | 298 | static void | 295 | static void |
811 | 299 | reconsile_list_and_menu (GList * serverlist, GtkMenuShell * menushell) | 296 | reconsile_list_and_menu (GList * serverlist, DbusmenuMenuitem * menushell) |
812 | 300 | { | 297 | { |
813 | 301 | guint position = 0; | 298 | guint position = 0; |
814 | 302 | GList * serverentry; | 299 | GList * serverentry; |
815 | @@ -307,7 +304,7 @@ | |||
816 | 307 | serverList_t * si = (serverList_t *)serverentry->data; | 304 | serverList_t * si = (serverList_t *)serverentry->data; |
817 | 308 | if (si->menuitem != NULL) { | 305 | if (si->menuitem != NULL) { |
818 | 309 | g_debug("\tMoving app %s to position %d", INDICATE_LISTENER_SERVER_DBUS_NAME(si->server), position); | 306 | g_debug("\tMoving app %s to position %d", INDICATE_LISTENER_SERVER_DBUS_NAME(si->server), position); |
820 | 310 | gtk_menu_reorder_child(GTK_MENU(menushell), GTK_WIDGET(si->menuitem), position); | 307 | dbusmenu_menuitem_child_reorder(DBUSMENU_MENUITEM(menushell), DBUSMENU_MENUITEM(si->menuitem), position); |
821 | 311 | position++; | 308 | position++; |
822 | 312 | } | 309 | } |
823 | 313 | 310 | ||
824 | @@ -317,7 +314,7 @@ | |||
825 | 317 | 314 | ||
826 | 318 | if (imi->menuitem != NULL) { | 315 | if (imi->menuitem != NULL) { |
827 | 319 | g_debug("\tMoving indicator on %s id %d to position %d", INDICATE_LISTENER_SERVER_DBUS_NAME(imi->server), INDICATE_LISTENER_INDICATOR_ID(imi->indicator), position); | 316 | g_debug("\tMoving indicator on %s id %d to position %d", INDICATE_LISTENER_SERVER_DBUS_NAME(imi->server), INDICATE_LISTENER_INDICATOR_ID(imi->indicator), position); |
829 | 320 | gtk_menu_reorder_child(GTK_MENU(menushell), imi->menuitem, position); | 317 | dbusmenu_menuitem_child_reorder(DBUSMENU_MENUITEM(menushell), DBUSMENU_MENUITEM(imi->menuitem), position); |
830 | 321 | position++; | 318 | position++; |
831 | 322 | } | 319 | } |
832 | 323 | } | 320 | } |
833 | @@ -329,7 +326,7 @@ | |||
834 | 329 | static void | 326 | static void |
835 | 330 | subtype_cb (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * property, gchar * propertydata, gpointer data) | 327 | subtype_cb (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * property, gchar * propertydata, gpointer data) |
836 | 331 | { | 328 | { |
838 | 332 | GtkMenuShell * menushell = GTK_MENU_SHELL(data); | 329 | DbusmenuMenuitem * menushell = DBUSMENU_MENUITEM(data); |
839 | 333 | if (menushell == NULL) { | 330 | if (menushell == NULL) { |
840 | 334 | g_error("Data in callback is not a menushell"); | 331 | g_error("Data in callback is not a menushell"); |
841 | 335 | return; | 332 | return; |
842 | @@ -358,7 +355,7 @@ | |||
843 | 358 | g_debug("Building IM Item"); | 355 | g_debug("Building IM Item"); |
844 | 359 | ImMenuItem * menuitem = im_menu_item_new(listener, server, indicator, !g_strcmp0(propertydata, "im")); | 356 | ImMenuItem * menuitem = im_menu_item_new(listener, server, indicator, !g_strcmp0(propertydata, "im")); |
845 | 360 | g_object_ref(G_OBJECT(menuitem)); | 357 | g_object_ref(G_OBJECT(menuitem)); |
847 | 361 | listItem->menuitem = GTK_WIDGET(menuitem); | 358 | listItem->menuitem = DBUSMENU_MENUITEM(menuitem); |
848 | 362 | 359 | ||
849 | 363 | g_debug("Finding the server entry"); | 360 | g_debug("Finding the server entry"); |
850 | 364 | serverList_t sl_item_local; | 361 | serverList_t sl_item_local; |
851 | @@ -389,12 +386,12 @@ | |||
852 | 389 | msl.position = 0; | 386 | msl.position = 0; |
853 | 390 | msl.server = server; | 387 | msl.server = server; |
854 | 391 | 388 | ||
856 | 392 | gtk_container_foreach(GTK_CONTAINER(menushell), menushell_foreach_cb, &msl); | 389 | dbusmenu_menuitem_foreach(DBUSMENU_MENUITEM(menushell), menushell_foreach_cb, &msl); |
857 | 393 | if (msl.found) { | 390 | if (msl.found) { |
859 | 394 | gtk_menu_shell_insert(menushell, GTK_WIDGET(menuitem), msl.position); | 391 | dbusmenu_menuitem_child_add_position(menushell, DBUSMENU_MENUITEM(menuitem), msl.position); |
860 | 395 | } else { | 392 | } else { |
861 | 396 | g_warning("Unable to find server menu item"); | 393 | g_warning("Unable to find server menu item"); |
863 | 397 | gtk_menu_shell_append(menushell, GTK_WIDGET(menuitem)); | 394 | dbusmenu_menuitem_child_append(menushell, DBUSMENU_MENUITEM(menuitem)); |
864 | 398 | } | 395 | } |
865 | 399 | } | 396 | } |
866 | 400 | 397 | ||
867 | @@ -444,7 +441,7 @@ | |||
868 | 444 | listData.indicator = indicator; | 441 | listData.indicator = indicator; |
869 | 445 | 442 | ||
870 | 446 | GList * listItem = g_list_find_custom(sl_item->imList, &listData, imList_equal); | 443 | GList * listItem = g_list_find_custom(sl_item->imList, &listData, imList_equal); |
872 | 447 | GtkWidget * menuitem = NULL; | 444 | DbusmenuMenuitem * menuitem = NULL; |
873 | 448 | imList_t * ilt = NULL; | 445 | imList_t * ilt = NULL; |
874 | 449 | if (listItem != NULL) { | 446 | if (listItem != NULL) { |
875 | 450 | ilt = (imList_t *)listItem->data; | 447 | ilt = (imList_t *)listItem->data; |
876 | @@ -456,8 +453,8 @@ | |||
877 | 456 | g_signal_handler_disconnect(menuitem, ilt->timechange_cb); | 453 | g_signal_handler_disconnect(menuitem, ilt->timechange_cb); |
878 | 457 | g_free(ilt); | 454 | g_free(ilt); |
879 | 458 | 455 | ||
882 | 459 | gtk_widget_hide(menuitem); | 456 | dbusmenu_menuitem_property_set(menuitem, "visibile", "false"); |
883 | 460 | gtk_container_remove(GTK_CONTAINER(data), menuitem); | 457 | dbusmenu_menuitem_child_delete(DBUSMENU_MENUITEM(data), menuitem); |
884 | 461 | removed = TRUE; | 458 | removed = TRUE; |
885 | 462 | } | 459 | } |
886 | 463 | 460 | ||
887 | @@ -468,30 +465,40 @@ | |||
888 | 468 | return; | 465 | return; |
889 | 469 | } | 466 | } |
890 | 470 | 467 | ||
893 | 471 | GtkWidget * | 468 | int |
894 | 472 | get_menu_item (void) | 469 | main (int argc, char ** argv) |
895 | 473 | { | 470 | { |
899 | 474 | design_team_size = gtk_icon_size_register("design-team-size", 22, 22); | 471 | g_type_init(); |
900 | 475 | 472 | ||
901 | 476 | listener = indicate_listener_new(); | 473 | DBusGConnection * connection = dbus_g_bus_get(DBUS_BUS_SESSION, NULL); |
902 | 474 | DBusGProxy * bus_proxy = dbus_g_proxy_new_for_name(connection, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS); | ||
903 | 475 | GError * error = NULL; | ||
904 | 476 | guint nameret = 0; | ||
905 | 477 | |||
906 | 478 | if (!org_freedesktop_DBus_request_name(bus_proxy, INDICATOR_MESSAGES_DBUS_NAME, 0, &nameret, &error)) { | ||
907 | 479 | g_error("Unable to call to request name"); | ||
908 | 480 | return 1; | ||
909 | 481 | } | ||
910 | 482 | |||
911 | 483 | if (nameret != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) { | ||
912 | 484 | g_error("Unable to get name"); | ||
913 | 485 | return 1; | ||
914 | 486 | } | ||
915 | 487 | |||
916 | 488 | listener = indicate_listener_ref_default(); | ||
917 | 477 | serverList = NULL; | 489 | serverList = NULL; |
918 | 478 | 490 | ||
936 | 479 | main_menu = gtk_menu_item_new(); | 491 | root_menuitem = dbusmenu_menuitem_new(); |
937 | 480 | gtk_widget_set_name(main_menu, "fast-user-switch-menuitem"); | 492 | DbusmenuServer * server = dbusmenu_server_new(INDICATOR_MESSAGES_DBUS_OBJECT); |
938 | 481 | 493 | dbusmenu_server_set_root(server, root_menuitem); | |
939 | 482 | main_image = gtk_image_new_from_icon_name("indicator-messages", DESIGN_TEAM_SIZE); | 494 | |
940 | 483 | gtk_widget_show(main_image); | 495 | g_signal_connect(listener, INDICATE_LISTENER_SIGNAL_INDICATOR_ADDED, G_CALLBACK(indicator_added), root_menuitem); |
941 | 484 | gtk_container_add(GTK_CONTAINER(main_menu), main_image); | 496 | g_signal_connect(listener, INDICATE_LISTENER_SIGNAL_INDICATOR_REMOVED, G_CALLBACK(indicator_removed), root_menuitem); |
942 | 485 | 497 | g_signal_connect(listener, INDICATE_LISTENER_SIGNAL_SERVER_ADDED, G_CALLBACK(server_added), root_menuitem); | |
943 | 486 | GtkWidget * submenu = gtk_menu_new(); | 498 | g_signal_connect(listener, INDICATE_LISTENER_SIGNAL_SERVER_REMOVED, G_CALLBACK(server_removed), root_menuitem); |
944 | 487 | gtk_menu_item_set_submenu(GTK_MENU_ITEM(main_menu), submenu); | 499 | |
945 | 488 | gtk_widget_show(submenu); | 500 | mainloop = g_main_loop_new(NULL, FALSE); |
946 | 489 | 501 | g_main_loop_run(mainloop); | |
947 | 490 | g_signal_connect(listener, INDICATE_LISTENER_SIGNAL_INDICATOR_ADDED, G_CALLBACK(indicator_added), submenu); | 502 | |
948 | 491 | g_signal_connect(listener, INDICATE_LISTENER_SIGNAL_INDICATOR_REMOVED, G_CALLBACK(indicator_removed), submenu); | 503 | return 0; |
932 | 492 | g_signal_connect(listener, INDICATE_LISTENER_SIGNAL_SERVER_ADDED, G_CALLBACK(server_added), submenu); | ||
933 | 493 | g_signal_connect(listener, INDICATE_LISTENER_SIGNAL_SERVER_REMOVED, G_CALLBACK(server_removed), submenu); | ||
934 | 494 | |||
935 | 495 | return main_menu; | ||
949 | 496 | } | 504 | } |
950 | 497 | |||
951 | 498 | 505 | ||
952 | === added directory 'test' | |||
953 | === added file 'test/indicator-messages-service-activate.build.sh' | |||
954 | --- test/indicator-messages-service-activate.build.sh 1970-01-01 00:00:00 +0000 | |||
955 | +++ test/indicator-messages-service-activate.build.sh 2009-05-28 15:29:41 +0000 | |||
956 | @@ -0,0 +1,3 @@ | |||
957 | 1 | #!/bin/sh | ||
958 | 2 | |||
959 | 3 | gcc -o indicator-messages-service-activate indicator-messages-service-activate.c `pkg-config --cflags --libs dbus-1 dbus-glib-1` | ||
960 | 0 | 4 | ||
961 | === added file 'test/indicator-messages-service-activate.c' | |||
962 | --- test/indicator-messages-service-activate.c 1970-01-01 00:00:00 +0000 | |||
963 | +++ test/indicator-messages-service-activate.c 2009-05-28 15:29:41 +0000 | |||
964 | @@ -0,0 +1,53 @@ | |||
965 | 1 | /* | ||
966 | 2 | An indicator to show information that is in messaging applications | ||
967 | 3 | that the user is using. | ||
968 | 4 | |||
969 | 5 | Copyright 2009 Canonical Ltd. | ||
970 | 6 | |||
971 | 7 | Authors: | ||
972 | 8 | Ted Gould <ted@canonical.com> | ||
973 | 9 | |||
974 | 10 | This program is free software: you can redistribute it and/or modify it | ||
975 | 11 | under the terms of the GNU General Public License version 3, as published | ||
976 | 12 | by the Free Software Foundation. | ||
977 | 13 | |||
978 | 14 | This program is distributed in the hope that it will be useful, but | ||
979 | 15 | WITHOUT ANY WARRANTY; without even the implied warranties of | ||
980 | 16 | MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
981 | 17 | PURPOSE. See the GNU General Public License for more details. | ||
982 | 18 | |||
983 | 19 | You should have received a copy of the GNU General Public License along | ||
984 | 20 | with this program. If not, see <http://www.gnu.org/licenses/>. | ||
985 | 21 | */ | ||
986 | 22 | |||
987 | 23 | #include <string.h> | ||
988 | 24 | #include <dbus/dbus-glib.h> | ||
989 | 25 | #include <dbus/dbus-glib-bindings.h> | ||
990 | 26 | #include "../src/dbus-data.h" | ||
991 | 27 | |||
992 | 28 | int | ||
993 | 29 | main (int argc, char ** argv) | ||
994 | 30 | { | ||
995 | 31 | g_type_init(); | ||
996 | 32 | |||
997 | 33 | guint returnval = 0; | ||
998 | 34 | GError * error = NULL; | ||
999 | 35 | |||
1000 | 36 | DBusGConnection * connection = dbus_g_bus_get(DBUS_BUS_SESSION, NULL); | ||
1001 | 37 | DBusGProxy * proxy = dbus_g_proxy_new_for_name(connection, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS); | ||
1002 | 38 | |||
1003 | 39 | g_debug("Activating service: %s", INDICATOR_MESSAGES_DBUS_NAME); | ||
1004 | 40 | if (!org_freedesktop_DBus_start_service_by_name (proxy, INDICATOR_MESSAGES_DBUS_NAME, 0, &returnval, &error)) { | ||
1005 | 41 | g_error("Unable to send message to DBus to start service: %s", error != NULL ? error->message : "(NULL error)" ); | ||
1006 | 42 | g_error_free(error); | ||
1007 | 43 | return 1; | ||
1008 | 44 | } | ||
1009 | 45 | |||
1010 | 46 | if (returnval != DBUS_START_REPLY_SUCCESS && returnval != DBUS_START_REPLY_ALREADY_RUNNING) { | ||
1011 | 47 | g_error("Return value isn't indicative of success: %d", returnval); | ||
1012 | 48 | return 1; | ||
1013 | 49 | } | ||
1014 | 50 | |||
1015 | 51 | return 0; | ||
1016 | 52 | } | ||
1017 | 53 |
Update to use libindicator, libindicate-gtk and libdbusmenu.