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

Proposed by Ted Gould
Status: Merged
Merge reported by: Ken VanDine
Merged at revision: not available
Proposed branch: lp:~indicator-applet-developers/indicator-applet/ubuntu
Merge into: lp:~ubuntu-desktop/indicator-applet/ubuntu
Diff against target: 447 lines (+142/-158)
7 files modified
ChangeLog (+1/-0)
configure.ac (+2/-3)
debian/changelog (+25/-0)
debian/control (+1/-2)
debian/patches/01_stracciatella.patch (+0/-17)
src-session/applet-main.c (+38/-68)
src/applet-main.c (+75/-68)
To merge this branch: bzr merge lp:~indicator-applet-developers/indicator-applet/ubuntu
Reviewer Review Type Date Requested Status
Ken VanDine Pending
Review via email: mp+15972@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog'
2--- ChangeLog 2008-10-30 02:30:35 +0000
3+++ ChangeLog 2009-12-10 18:30:32 +0000
4@@ -0,0 +1,1 @@
5+Updating to 2a
6
7=== modified file 'configure.ac'
8--- configure.ac 2009-09-01 14:25:04 +0000
9+++ configure.ac 2009-12-10 18:30:32 +0000
10@@ -4,7 +4,7 @@
11 AC_PREREQ(2.53)
12
13 AM_CONFIG_HEADER(config.h)
14-AM_INIT_AUTOMAKE(indicator-applet, 0.2.0)
15+AM_INIT_AUTOMAKE(indicator-applet, 0.3.0)
16
17 AM_MAINTAINER_MODE
18 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES])
19@@ -28,11 +28,10 @@
20 GTK_REQUIRED_VERSION=2.12
21 PANEL_REQUIRED_VERSION=2.0.0
22 DBUS_REQUIRED_VERSION=0.76
23-INDICATOR_REQUIRED_VERSION=0.1.0
24+INDICATOR_REQUIRED_VERSION=0.3.0
25
26 PKG_CHECK_MODULES(APPLET, gtk+-2.0 >= $GTK_REQUIRED_VERSION
27 libpanelapplet-2.0 >= $PANEL_REQUIRED_VERSION
28- libgnomeui-2.0
29 indicator >= $INDICATOR_REQUIRED_VERSION)
30 AC_SUBST(APPLET_CFLAGS)
31 AC_SUBST(APPLET_LIBS)
32
33=== modified file 'debian/changelog'
34--- debian/changelog 2009-10-14 18:38:45 +0000
35+++ debian/changelog 2009-12-10 18:30:32 +0000
36@@ -1,3 +1,28 @@
37+indicator-applet (0.3.0-0ubuntu1~ppa1) karmic; urgency=low
38+
39+ * Upstream release 0.3.0
40+ * Update to libindicator 0.3.0 API
41+ * debian/control: Updating libindicator to 0.3.0~dev or greater.
42+
43+ -- Ted Gould <ted@ubuntu.com> Thu, 10 Dec 2009 11:34:33 -0600
44+
45+indicator-applet (0.2.0-0ubuntu3~ppa2) karmic; urgency=low
46+
47+ * Fixing version number in About dialog. (LP: #443196)
48+ * Fixing application names in About dialog. (LP: #449036)
49+ * Removing libgnomeui dependency. (LP: #458470)
50+ * debian/control: Removing dependency on libgnomeui-dev
51+
52+ -- Ted Gould <ted@ubuntu.com> Mon, 26 Oct 2009 20:58:09 -0500
53+
54+indicator-applet (0.2.0-0ubuntu3~ppa1) karmic; urgency=low
55+
56+ * Patch from Martin Pitt to disable session menu on Stracciatella
57+ session.
58+ * Remove debian/patches/01_stracciatella.patch
59+
60+ -- Ted Gould <ted@ubuntu.com> Mon, 26 Oct 2009 14:46:02 -0500
61+
62 indicator-applet (0.2.0-0ubuntu2) karmic; urgency=low
63
64 * debian/rules: Enable simple-patchsys.
65
66=== modified file 'debian/control'
67--- debian/control 2009-08-25 13:02:19 +0000
68+++ debian/control 2009-12-10 18:30:32 +0000
69@@ -8,12 +8,11 @@
70 libpanel-applet2-dev (>= 2.0.0),
71 libdbus-glib-1-dev,
72 gnome-doc-utils,
73- libgnomeui-dev,
74 libtool,
75 intltool,
76 libxml2-dev,
77 gtk-doc-tools,
78- libindicator-dev (>= 0.2.0~bzr325)
79+ libindicator-dev (>= 0.3.0~dev)
80 Standards-Version: 3.8.0
81 Homepage: https://launchpad.net/indicator-applet
82 Vcs-Bzr: http://bazaar.launchpad.net/~ubuntu-desktop/indicator-applet/ubuntu
83
84=== removed file 'debian/patches/01_stracciatella.patch'
85--- debian/patches/01_stracciatella.patch 2009-10-14 18:12:47 +0000
86+++ debian/patches/01_stracciatella.patch 1970-01-01 00:00:00 +0000
87@@ -1,17 +0,0 @@
88-# Description: Do not show up in stracciatella session.
89-# Ubuntu: https://launchpad.net/bugs/444149
90---- indicator-applet-0.2.0/src-session/applet-main.c 2009-10-14 20:10:27.000000000 +0200
91-+++ indicator-applet-0.2.0.new/src-session/applet-main.c 2009-10-14 20:11:03.300289347 +0200
92-@@ -214,6 +214,12 @@
93- gint indicators_loaded = 0;
94- static gboolean first_time = FALSE;
95-
96-+ /* check if we are running stracciatella session */
97-+ if (g_strcmp0(g_getenv("GDMSESSION"), "gnome-stracciatella") == 0) {
98-+ g_debug("Running stracciatella GNOME session, disabling myself");
99-+ return TRUE;
100-+ }
101-+
102- if (!first_time)
103- {
104- gint argc = 1;
105
106=== modified file 'src-session/applet-main.c'
107--- src-session/applet-main.c 2009-08-24 18:23:17 +0000
108+++ src-session/applet-main.c 2009-12-10 18:30:32 +0000
109@@ -22,9 +22,8 @@
110
111 #include <config.h>
112 #include <panel-applet.h>
113-#include <libgnomeui/gnome-ui-init.h>
114
115-#include "libindicator/indicator.h"
116+#include "libindicator/indicator-object.h"
117
118 static gboolean applet_fill_cb (PanelApplet * applet, const gchar * iid, gpointer data);
119
120@@ -35,13 +34,6 @@
121 GdkPixmap *pixmap,
122 GtkWidget *menubar);
123
124-/* ****************** *
125- * Global Variables *
126- * ****************** */
127-
128-static GnomeProgram *program = NULL;
129-
130-
131 /*************
132 * main
133 * ***********/
134@@ -67,57 +59,35 @@
135 g_debug("Loading Module: %s", name);
136
137 gchar * fullpath = g_build_filename(INDICATOR_DIR, name, NULL);
138- GModule * module = g_module_open(fullpath,
139- G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);
140+ IndicatorObject * io = indicator_object_new_from_file(fullpath);
141 g_free(fullpath);
142- g_return_val_if_fail(module != NULL, FALSE);
143-
144- get_version_t lget_version = NULL;
145- g_return_val_if_fail(g_module_symbol(module, INDICATOR_GET_VERSION_S, (gpointer *)(&lget_version)), FALSE);
146- if (!INDICATOR_VERSION_CHECK(lget_version())) {
147- g_warning("Indicator using API version '%s' we're expecting '%s'", lget_version(), INDICATOR_VERSION);
148- return FALSE;
149- }
150-
151- get_label_t lget_label = NULL;
152- g_return_val_if_fail(g_module_symbol(module, INDICATOR_GET_LABEL_S, (gpointer *)(&lget_label)), FALSE);
153- g_return_val_if_fail(lget_label != NULL, FALSE);
154- GtkLabel * label = lget_label();
155-
156- get_icon_t lget_icon = NULL;
157- g_return_val_if_fail(g_module_symbol(module, INDICATOR_GET_ICON_S, (gpointer *)(&lget_icon)), FALSE);
158- g_return_val_if_fail(lget_icon != NULL, FALSE);
159- GtkImage * icon = lget_icon();
160-
161- get_menu_t lget_menu = NULL;
162- g_return_val_if_fail(g_module_symbol(module, INDICATOR_GET_MENU_S, (gpointer *)(&lget_menu)), FALSE);
163- g_return_val_if_fail(lget_menu != NULL, FALSE);
164- GtkMenu * lmenu = lget_menu();
165-
166- if (label == NULL && icon == NULL) {
167- /* This is the case where there is nothing to display,
168- kinda odd that we'd have a module with nothing. */
169- g_warning("No label or icon. Odd.");
170- return FALSE;
171- }
172-
173- GtkWidget * menuitem = gtk_menu_item_new();
174- GtkWidget * hbox = gtk_hbox_new(FALSE, 3);
175- if (icon != NULL) {
176- gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(icon), FALSE, FALSE, 0);
177- }
178- if (label != NULL) {
179- gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(label), FALSE, FALSE, 0);
180- }
181- gtk_container_add(GTK_CONTAINER(menuitem), hbox);
182- gtk_widget_show(hbox);
183-
184- if (lmenu != NULL) {
185- gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), GTK_WIDGET(lmenu));
186- }
187-
188- gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
189- gtk_widget_show(menuitem);
190+
191+ GList * entries = indicator_object_get_entries(io);
192+ GList * entry = NULL;
193+
194+ for (entry = entries; entry != NULL; entry = g_list_next(entry)) {
195+ IndicatorObjectEntry * entrydata = (IndicatorObjectEntry *)entry->data;
196+
197+ GtkWidget * menuitem = gtk_menu_item_new();
198+ GtkWidget * hbox = gtk_hbox_new(FALSE, 3);
199+ if (entrydata->image != NULL) {
200+ gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(entrydata->image), FALSE, FALSE, 0);
201+ }
202+ if (entrydata->label != NULL) {
203+ gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(entrydata->label), FALSE, FALSE, 0);
204+ }
205+ gtk_container_add(GTK_CONTAINER(menuitem), hbox);
206+ gtk_widget_show(hbox);
207+
208+ if (entrydata->menu != NULL) {
209+ gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), GTK_WIDGET(entrydata->menu));
210+ }
211+
212+ gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
213+ gtk_widget_show(menuitem);
214+ }
215+
216+ g_list_free(entries);
217
218 return TRUE;
219 }
220@@ -173,9 +143,9 @@
221 license_i18n = g_strconcat (_(license[0]), "\n\n", _(license[1]), "\n\n", _(license[2]), NULL);
222
223 gtk_show_about_dialog(NULL,
224- "version", "0.1",
225+ "version", VERSION,
226 "copyright", "Copyright \xc2\xa9 2009 Canonical, Ltd.",
227- "comments", _("An applet to hold all of the system indicators."),
228+ "comments", _("A place to adjust your status, change users or exit your session."),
229 "authors", authors,
230 "license", license_i18n,
231 "wrap-license", TRUE,
232@@ -214,16 +184,16 @@
233 gint indicators_loaded = 0;
234 static gboolean first_time = FALSE;
235
236+ /* check if we are running stracciatella session */
237+ if (g_strcmp0(g_getenv("GDMSESSION"), "gnome-stracciatella") == 0) {
238+ g_debug("Running stracciatella GNOME session, disabling myself");
239+ return TRUE;
240+ }
241+
242 if (!first_time)
243 {
244- gint argc = 1;
245- gchar *argv[2] = { "indicator-applet-session", NULL};
246-
247 first_time = TRUE;
248- program = gnome_program_init ("indicator-applet-session", "0.1",
249- LIBGNOMEUI_MODULE, argc, argv,
250- GNOME_PROGRAM_STANDARD_PROPERTIES,
251- NULL);
252+ g_set_application_name(_("Indicator Applet Session"));
253 }
254
255 /* Set panel options */
256
257=== modified file 'src/applet-main.c'
258--- src/applet-main.c 2009-09-01 14:25:04 +0000
259+++ src/applet-main.c 2009-12-10 18:30:32 +0000
260@@ -22,9 +22,10 @@
261
262 #include <config.h>
263 #include <panel-applet.h>
264-#include <libgnomeui/gnome-ui-init.h>
265-
266-#include "libindicator/indicator.h"
267+
268+#include "libindicator/indicator-object.h"
269+
270+#define ENTRY_DATA_NAME "indicator-custom-entry-data"
271
272 static gboolean applet_fill_cb (PanelApplet * applet, const gchar * iid, gpointer data);
273
274@@ -35,13 +36,6 @@
275 GdkPixmap *pixmap,
276 GtkWidget *menubar);
277
278-/* ****************** *
279- * Global Variables *
280- * ****************** */
281-
282-static GnomeProgram *program = NULL;
283-
284-
285 /*************
286 * main
287 * ***********/
288@@ -54,6 +48,58 @@
289 /*************
290 * init function
291 * ***********/
292+static void
293+entry_added (IndicatorObject * io, IndicatorObjectEntry * entry, GtkWidget * menu)
294+{
295+ g_debug("Signal: Entry Added");
296+
297+ GtkWidget * menuitem = gtk_menu_item_new();
298+ GtkWidget * hbox = gtk_hbox_new(FALSE, 3);
299+
300+ if (entry->image != NULL) {
301+ gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(entry->image), FALSE, FALSE, 0);
302+ }
303+ if (entry->label != NULL) {
304+ gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(entry->label), FALSE, FALSE, 0);
305+ }
306+ gtk_container_add(GTK_CONTAINER(menuitem), hbox);
307+ gtk_widget_show(hbox);
308+
309+ if (entry->menu != NULL) {
310+ gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), GTK_WIDGET(entry->menu));
311+ }
312+
313+ gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
314+ gtk_widget_show(menuitem);
315+
316+ g_object_set_data(G_OBJECT(menuitem), ENTRY_DATA_NAME, entry);
317+
318+ return;
319+}
320+
321+static void
322+entry_removed_cb (GtkWidget * widget, gpointer userdata)
323+{
324+ gpointer data = g_object_get_data(G_OBJECT(widget), ENTRY_DATA_NAME);
325+
326+ if (data != userdata) {
327+ return;
328+ }
329+
330+ gtk_widget_destroy(widget);
331+ return;
332+}
333+
334+static void
335+entry_removed (IndicatorObject * io, IndicatorObjectEntry * entry, gpointer user_data)
336+{
337+ g_debug("Signal: Entry Removed");
338+
339+ gtk_container_foreach(GTK_CONTAINER(user_data), entry_removed_cb, entry);
340+
341+ return;
342+}
343+
344 static gboolean
345 load_module (const gchar * name, GtkWidget * menu)
346 {
347@@ -66,58 +112,25 @@
348
349 g_debug("Loading Module: %s", name);
350
351+ /* Build the object for the module */
352 gchar * fullpath = g_build_filename(INDICATOR_DIR, name, NULL);
353- GModule * module = g_module_open(fullpath,
354- G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);
355+ IndicatorObject * io = indicator_object_new_from_file(fullpath);
356 g_free(fullpath);
357- g_return_val_if_fail(module != NULL, FALSE);
358-
359- get_version_t lget_version = NULL;
360- g_return_val_if_fail(g_module_symbol(module, INDICATOR_GET_VERSION_S, (gpointer *)(&lget_version)), FALSE);
361- if (!INDICATOR_VERSION_CHECK(lget_version())) {
362- g_warning("Indicator using API version '%s' we're expecting '%s'", lget_version(), INDICATOR_VERSION);
363- return FALSE;
364- }
365-
366- get_label_t lget_label = NULL;
367- g_return_val_if_fail(g_module_symbol(module, INDICATOR_GET_LABEL_S, (gpointer *)(&lget_label)), FALSE);
368- g_return_val_if_fail(lget_label != NULL, FALSE);
369- GtkLabel * label = lget_label();
370-
371- get_icon_t lget_icon = NULL;
372- g_return_val_if_fail(g_module_symbol(module, INDICATOR_GET_ICON_S, (gpointer *)(&lget_icon)), FALSE);
373- g_return_val_if_fail(lget_icon != NULL, FALSE);
374- GtkImage * icon = lget_icon();
375-
376- get_menu_t lget_menu = NULL;
377- g_return_val_if_fail(g_module_symbol(module, INDICATOR_GET_MENU_S, (gpointer *)(&lget_menu)), FALSE);
378- g_return_val_if_fail(lget_menu != NULL, FALSE);
379- GtkMenu * lmenu = lget_menu();
380-
381- if (label == NULL && icon == NULL) {
382- /* This is the case where there is nothing to display,
383- kinda odd that we'd have a module with nothing. */
384- g_warning("No label or icon. Odd.");
385- return FALSE;
386- }
387-
388- GtkWidget * menuitem = gtk_menu_item_new();
389- GtkWidget * hbox = gtk_hbox_new(FALSE, 3);
390- if (icon != NULL) {
391- gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(icon), FALSE, FALSE, 0);
392- }
393- if (label != NULL) {
394- gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(label), FALSE, FALSE, 0);
395- }
396- gtk_container_add(GTK_CONTAINER(menuitem), hbox);
397- gtk_widget_show(hbox);
398-
399- if (lmenu != NULL) {
400- gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), GTK_WIDGET(lmenu));
401- }
402-
403- gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
404- gtk_widget_show(menuitem);
405+
406+ /* Connect to it's signals */
407+ g_signal_connect(G_OBJECT(io), INDICATOR_OBJECT_SIGNAL_ENTRY_ADDED, G_CALLBACK(entry_added), menu);
408+ g_signal_connect(G_OBJECT(io), INDICATOR_OBJECT_SIGNAL_ENTRY_REMOVED, G_CALLBACK(entry_removed), menu);
409+
410+ /* Work on the entries */
411+ GList * entries = indicator_object_get_entries(io);
412+ GList * entry = NULL;
413+
414+ for (entry = entries; entry != NULL; entry = g_list_next(entry)) {
415+ IndicatorObjectEntry * entrydata = (IndicatorObjectEntry *)entry->data;
416+ entry_added(io, entrydata, menu);
417+ }
418+
419+ g_list_free(entries);
420
421 return TRUE;
422 }
423@@ -173,7 +186,7 @@
424 license_i18n = g_strconcat (_(license[0]), "\n\n", _(license[1]), "\n\n", _(license[2]), NULL);
425
426 gtk_show_about_dialog(NULL,
427- "version", "0.1",
428+ "version", VERSION,
429 "copyright", "Copyright \xc2\xa9 2009 Canonical, Ltd.",
430 "comments", _("An applet to hold all of the system indicators."),
431 "authors", authors,
432@@ -223,14 +236,8 @@
433
434 if (!first_time)
435 {
436- gint argc = 1;
437- gchar *argv[2] = { "indicator-applet", NULL};
438-
439 first_time = TRUE;
440- program = gnome_program_init ("indicator-applet", "0.1",
441- LIBGNOMEUI_MODULE, argc, argv,
442- GNOME_PROGRAM_STANDARD_PROPERTIES,
443- NULL);
444+ g_set_application_name(_("Indicator Applet"));
445 }
446
447 /* Set panel options */

Subscribers

People subscribed via source and target branches