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
=== modified file 'ChangeLog'
--- ChangeLog 2008-10-30 02:30:35 +0000
+++ ChangeLog 2009-12-10 18:30:32 +0000
@@ -0,0 +1,1 @@
1Updating to 2a
02
=== modified file 'configure.ac'
--- configure.ac 2009-09-01 14:25:04 +0000
+++ configure.ac 2009-12-10 18:30:32 +0000
@@ -4,7 +4,7 @@
4AC_PREREQ(2.53)4AC_PREREQ(2.53)
55
6AM_CONFIG_HEADER(config.h)6AM_CONFIG_HEADER(config.h)
7AM_INIT_AUTOMAKE(indicator-applet, 0.2.0)7AM_INIT_AUTOMAKE(indicator-applet, 0.3.0)
88
9AM_MAINTAINER_MODE9AM_MAINTAINER_MODE
10m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES])10m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES])
@@ -28,11 +28,10 @@
28GTK_REQUIRED_VERSION=2.1228GTK_REQUIRED_VERSION=2.12
29PANEL_REQUIRED_VERSION=2.0.029PANEL_REQUIRED_VERSION=2.0.0
30DBUS_REQUIRED_VERSION=0.7630DBUS_REQUIRED_VERSION=0.76
31INDICATOR_REQUIRED_VERSION=0.1.031INDICATOR_REQUIRED_VERSION=0.3.0
3232
33PKG_CHECK_MODULES(APPLET, gtk+-2.0 >= $GTK_REQUIRED_VERSION33PKG_CHECK_MODULES(APPLET, gtk+-2.0 >= $GTK_REQUIRED_VERSION
34 libpanelapplet-2.0 >= $PANEL_REQUIRED_VERSION34 libpanelapplet-2.0 >= $PANEL_REQUIRED_VERSION
35 libgnomeui-2.0
36 indicator >= $INDICATOR_REQUIRED_VERSION)35 indicator >= $INDICATOR_REQUIRED_VERSION)
37AC_SUBST(APPLET_CFLAGS)36AC_SUBST(APPLET_CFLAGS)
38AC_SUBST(APPLET_LIBS)37AC_SUBST(APPLET_LIBS)
3938
=== modified file 'debian/changelog'
--- debian/changelog 2009-10-14 18:38:45 +0000
+++ debian/changelog 2009-12-10 18:30:32 +0000
@@ -1,3 +1,28 @@
1indicator-applet (0.3.0-0ubuntu1~ppa1) karmic; urgency=low
2
3 * Upstream release 0.3.0
4 * Update to libindicator 0.3.0 API
5 * debian/control: Updating libindicator to 0.3.0~dev or greater.
6
7 -- Ted Gould <ted@ubuntu.com> Thu, 10 Dec 2009 11:34:33 -0600
8
9indicator-applet (0.2.0-0ubuntu3~ppa2) karmic; urgency=low
10
11 * Fixing version number in About dialog. (LP: #443196)
12 * Fixing application names in About dialog. (LP: #449036)
13 * Removing libgnomeui dependency. (LP: #458470)
14 * debian/control: Removing dependency on libgnomeui-dev
15
16 -- Ted Gould <ted@ubuntu.com> Mon, 26 Oct 2009 20:58:09 -0500
17
18indicator-applet (0.2.0-0ubuntu3~ppa1) karmic; urgency=low
19
20 * Patch from Martin Pitt to disable session menu on Stracciatella
21 session.
22 * Remove debian/patches/01_stracciatella.patch
23
24 -- Ted Gould <ted@ubuntu.com> Mon, 26 Oct 2009 14:46:02 -0500
25
1indicator-applet (0.2.0-0ubuntu2) karmic; urgency=low26indicator-applet (0.2.0-0ubuntu2) karmic; urgency=low
227
3 * debian/rules: Enable simple-patchsys.28 * debian/rules: Enable simple-patchsys.
429
=== modified file 'debian/control'
--- debian/control 2009-08-25 13:02:19 +0000
+++ debian/control 2009-12-10 18:30:32 +0000
@@ -8,12 +8,11 @@
8 libpanel-applet2-dev (>= 2.0.0),8 libpanel-applet2-dev (>= 2.0.0),
9 libdbus-glib-1-dev,9 libdbus-glib-1-dev,
10 gnome-doc-utils,10 gnome-doc-utils,
11 libgnomeui-dev,
12 libtool,11 libtool,
13 intltool,12 intltool,
14 libxml2-dev,13 libxml2-dev,
15 gtk-doc-tools,14 gtk-doc-tools,
16 libindicator-dev (>= 0.2.0~bzr325)15 libindicator-dev (>= 0.3.0~dev)
17Standards-Version: 3.8.016Standards-Version: 3.8.0
18Homepage: https://launchpad.net/indicator-applet17Homepage: https://launchpad.net/indicator-applet
19Vcs-Bzr: http://bazaar.launchpad.net/~ubuntu-desktop/indicator-applet/ubuntu18Vcs-Bzr: http://bazaar.launchpad.net/~ubuntu-desktop/indicator-applet/ubuntu
2019
=== removed file 'debian/patches/01_stracciatella.patch'
--- debian/patches/01_stracciatella.patch 2009-10-14 18:12:47 +0000
+++ debian/patches/01_stracciatella.patch 1970-01-01 00:00:00 +0000
@@ -1,17 +0,0 @@
1# Description: Do not show up in stracciatella session.
2# Ubuntu: https://launchpad.net/bugs/444149
3--- indicator-applet-0.2.0/src-session/applet-main.c 2009-10-14 20:10:27.000000000 +0200
4+++ indicator-applet-0.2.0.new/src-session/applet-main.c 2009-10-14 20:11:03.300289347 +0200
5@@ -214,6 +214,12 @@
6 gint indicators_loaded = 0;
7 static gboolean first_time = FALSE;
8
9+ /* check if we are running stracciatella session */
10+ if (g_strcmp0(g_getenv("GDMSESSION"), "gnome-stracciatella") == 0) {
11+ g_debug("Running stracciatella GNOME session, disabling myself");
12+ return TRUE;
13+ }
14+
15 if (!first_time)
16 {
17 gint argc = 1;
180
=== modified file 'src-session/applet-main.c'
--- src-session/applet-main.c 2009-08-24 18:23:17 +0000
+++ src-session/applet-main.c 2009-12-10 18:30:32 +0000
@@ -22,9 +22,8 @@
2222
23#include <config.h>23#include <config.h>
24#include <panel-applet.h>24#include <panel-applet.h>
25#include <libgnomeui/gnome-ui-init.h>
2625
27#include "libindicator/indicator.h"26#include "libindicator/indicator-object.h"
2827
29static gboolean applet_fill_cb (PanelApplet * applet, const gchar * iid, gpointer data);28static gboolean applet_fill_cb (PanelApplet * applet, const gchar * iid, gpointer data);
3029
@@ -35,13 +34,6 @@
35 GdkPixmap *pixmap,34 GdkPixmap *pixmap,
36 GtkWidget *menubar);35 GtkWidget *menubar);
3736
38/* ****************** *
39 * Global Variables *
40 * ****************** */
41
42static GnomeProgram *program = NULL;
43
44
45/*************37/*************
46 * main38 * main
47 * ***********/39 * ***********/
@@ -67,57 +59,35 @@
67 g_debug("Loading Module: %s", name);59 g_debug("Loading Module: %s", name);
6860
69 gchar * fullpath = g_build_filename(INDICATOR_DIR, name, NULL);61 gchar * fullpath = g_build_filename(INDICATOR_DIR, name, NULL);
70 GModule * module = g_module_open(fullpath,62 IndicatorObject * io = indicator_object_new_from_file(fullpath);
71 G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);
72 g_free(fullpath);63 g_free(fullpath);
73 g_return_val_if_fail(module != NULL, FALSE);64
7465 GList * entries = indicator_object_get_entries(io);
75 get_version_t lget_version = NULL;66 GList * entry = NULL;
76 g_return_val_if_fail(g_module_symbol(module, INDICATOR_GET_VERSION_S, (gpointer *)(&lget_version)), FALSE);67
77 if (!INDICATOR_VERSION_CHECK(lget_version())) {68 for (entry = entries; entry != NULL; entry = g_list_next(entry)) {
78 g_warning("Indicator using API version '%s' we're expecting '%s'", lget_version(), INDICATOR_VERSION);69 IndicatorObjectEntry * entrydata = (IndicatorObjectEntry *)entry->data;
79 return FALSE;70
80 }71 GtkWidget * menuitem = gtk_menu_item_new();
8172 GtkWidget * hbox = gtk_hbox_new(FALSE, 3);
82 get_label_t lget_label = NULL;73 if (entrydata->image != NULL) {
83 g_return_val_if_fail(g_module_symbol(module, INDICATOR_GET_LABEL_S, (gpointer *)(&lget_label)), FALSE);74 gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(entrydata->image), FALSE, FALSE, 0);
84 g_return_val_if_fail(lget_label != NULL, FALSE);75 }
85 GtkLabel * label = lget_label();76 if (entrydata->label != NULL) {
8677 gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(entrydata->label), FALSE, FALSE, 0);
87 get_icon_t lget_icon = NULL;78 }
88 g_return_val_if_fail(g_module_symbol(module, INDICATOR_GET_ICON_S, (gpointer *)(&lget_icon)), FALSE);79 gtk_container_add(GTK_CONTAINER(menuitem), hbox);
89 g_return_val_if_fail(lget_icon != NULL, FALSE);80 gtk_widget_show(hbox);
90 GtkImage * icon = lget_icon();81
9182 if (entrydata->menu != NULL) {
92 get_menu_t lget_menu = NULL;83 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), GTK_WIDGET(entrydata->menu));
93 g_return_val_if_fail(g_module_symbol(module, INDICATOR_GET_MENU_S, (gpointer *)(&lget_menu)), FALSE);84 }
94 g_return_val_if_fail(lget_menu != NULL, FALSE);85
95 GtkMenu * lmenu = lget_menu();86 gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
9687 gtk_widget_show(menuitem);
97 if (label == NULL && icon == NULL) {88 }
98 /* This is the case where there is nothing to display,89
99 kinda odd that we'd have a module with nothing. */90 g_list_free(entries);
100 g_warning("No label or icon. Odd.");
101 return FALSE;
102 }
103
104 GtkWidget * menuitem = gtk_menu_item_new();
105 GtkWidget * hbox = gtk_hbox_new(FALSE, 3);
106 if (icon != NULL) {
107 gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(icon), FALSE, FALSE, 0);
108 }
109 if (label != NULL) {
110 gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(label), FALSE, FALSE, 0);
111 }
112 gtk_container_add(GTK_CONTAINER(menuitem), hbox);
113 gtk_widget_show(hbox);
114
115 if (lmenu != NULL) {
116 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), GTK_WIDGET(lmenu));
117 }
118
119 gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
120 gtk_widget_show(menuitem);
12191
122 return TRUE;92 return TRUE;
123}93}
@@ -173,9 +143,9 @@
173 license_i18n = g_strconcat (_(license[0]), "\n\n", _(license[1]), "\n\n", _(license[2]), NULL);143 license_i18n = g_strconcat (_(license[0]), "\n\n", _(license[1]), "\n\n", _(license[2]), NULL);
174144
175 gtk_show_about_dialog(NULL,145 gtk_show_about_dialog(NULL,
176 "version", "0.1",146 "version", VERSION,
177 "copyright", "Copyright \xc2\xa9 2009 Canonical, Ltd.",147 "copyright", "Copyright \xc2\xa9 2009 Canonical, Ltd.",
178 "comments", _("An applet to hold all of the system indicators."),148 "comments", _("A place to adjust your status, change users or exit your session."),
179 "authors", authors,149 "authors", authors,
180 "license", license_i18n,150 "license", license_i18n,
181 "wrap-license", TRUE,151 "wrap-license", TRUE,
@@ -214,16 +184,16 @@
214 gint indicators_loaded = 0;184 gint indicators_loaded = 0;
215 static gboolean first_time = FALSE;185 static gboolean first_time = FALSE;
216186
187 /* check if we are running stracciatella session */
188 if (g_strcmp0(g_getenv("GDMSESSION"), "gnome-stracciatella") == 0) {
189 g_debug("Running stracciatella GNOME session, disabling myself");
190 return TRUE;
191 }
192
217 if (!first_time)193 if (!first_time)
218 {194 {
219 gint argc = 1;
220 gchar *argv[2] = { "indicator-applet-session", NULL};
221
222 first_time = TRUE;195 first_time = TRUE;
223 program = gnome_program_init ("indicator-applet-session", "0.1",196 g_set_application_name(_("Indicator Applet Session"));
224 LIBGNOMEUI_MODULE, argc, argv,
225 GNOME_PROGRAM_STANDARD_PROPERTIES,
226 NULL);
227 }197 }
228198
229 /* Set panel options */199 /* Set panel options */
230200
=== modified file 'src/applet-main.c'
--- src/applet-main.c 2009-09-01 14:25:04 +0000
+++ src/applet-main.c 2009-12-10 18:30:32 +0000
@@ -22,9 +22,10 @@
2222
23#include <config.h>23#include <config.h>
24#include <panel-applet.h>24#include <panel-applet.h>
25#include <libgnomeui/gnome-ui-init.h>25
2626#include "libindicator/indicator-object.h"
27#include "libindicator/indicator.h"27
28#define ENTRY_DATA_NAME "indicator-custom-entry-data"
2829
29static gboolean applet_fill_cb (PanelApplet * applet, const gchar * iid, gpointer data);30static gboolean applet_fill_cb (PanelApplet * applet, const gchar * iid, gpointer data);
3031
@@ -35,13 +36,6 @@
35 GdkPixmap *pixmap,36 GdkPixmap *pixmap,
36 GtkWidget *menubar);37 GtkWidget *menubar);
3738
38/* ****************** *
39 * Global Variables *
40 * ****************** */
41
42static GnomeProgram *program = NULL;
43
44
45/*************39/*************
46 * main40 * main
47 * ***********/41 * ***********/
@@ -54,6 +48,58 @@
54/*************48/*************
55 * init function49 * init function
56 * ***********/50 * ***********/
51static void
52entry_added (IndicatorObject * io, IndicatorObjectEntry * entry, GtkWidget * menu)
53{
54 g_debug("Signal: Entry Added");
55
56 GtkWidget * menuitem = gtk_menu_item_new();
57 GtkWidget * hbox = gtk_hbox_new(FALSE, 3);
58
59 if (entry->image != NULL) {
60 gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(entry->image), FALSE, FALSE, 0);
61 }
62 if (entry->label != NULL) {
63 gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(entry->label), FALSE, FALSE, 0);
64 }
65 gtk_container_add(GTK_CONTAINER(menuitem), hbox);
66 gtk_widget_show(hbox);
67
68 if (entry->menu != NULL) {
69 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), GTK_WIDGET(entry->menu));
70 }
71
72 gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
73 gtk_widget_show(menuitem);
74
75 g_object_set_data(G_OBJECT(menuitem), ENTRY_DATA_NAME, entry);
76
77 return;
78}
79
80static void
81entry_removed_cb (GtkWidget * widget, gpointer userdata)
82{
83 gpointer data = g_object_get_data(G_OBJECT(widget), ENTRY_DATA_NAME);
84
85 if (data != userdata) {
86 return;
87 }
88
89 gtk_widget_destroy(widget);
90 return;
91}
92
93static void
94entry_removed (IndicatorObject * io, IndicatorObjectEntry * entry, gpointer user_data)
95{
96 g_debug("Signal: Entry Removed");
97
98 gtk_container_foreach(GTK_CONTAINER(user_data), entry_removed_cb, entry);
99
100 return;
101}
102
57static gboolean103static gboolean
58load_module (const gchar * name, GtkWidget * menu)104load_module (const gchar * name, GtkWidget * menu)
59{105{
@@ -66,58 +112,25 @@
66112
67 g_debug("Loading Module: %s", name);113 g_debug("Loading Module: %s", name);
68114
115 /* Build the object for the module */
69 gchar * fullpath = g_build_filename(INDICATOR_DIR, name, NULL);116 gchar * fullpath = g_build_filename(INDICATOR_DIR, name, NULL);
70 GModule * module = g_module_open(fullpath,117 IndicatorObject * io = indicator_object_new_from_file(fullpath);
71 G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);
72 g_free(fullpath);118 g_free(fullpath);
73 g_return_val_if_fail(module != NULL, FALSE);119
74120 /* Connect to it's signals */
75 get_version_t lget_version = NULL;121 g_signal_connect(G_OBJECT(io), INDICATOR_OBJECT_SIGNAL_ENTRY_ADDED, G_CALLBACK(entry_added), menu);
76 g_return_val_if_fail(g_module_symbol(module, INDICATOR_GET_VERSION_S, (gpointer *)(&lget_version)), FALSE);122 g_signal_connect(G_OBJECT(io), INDICATOR_OBJECT_SIGNAL_ENTRY_REMOVED, G_CALLBACK(entry_removed), menu);
77 if (!INDICATOR_VERSION_CHECK(lget_version())) {123
78 g_warning("Indicator using API version '%s' we're expecting '%s'", lget_version(), INDICATOR_VERSION);124 /* Work on the entries */
79 return FALSE;125 GList * entries = indicator_object_get_entries(io);
80 }126 GList * entry = NULL;
81127
82 get_label_t lget_label = NULL;128 for (entry = entries; entry != NULL; entry = g_list_next(entry)) {
83 g_return_val_if_fail(g_module_symbol(module, INDICATOR_GET_LABEL_S, (gpointer *)(&lget_label)), FALSE);129 IndicatorObjectEntry * entrydata = (IndicatorObjectEntry *)entry->data;
84 g_return_val_if_fail(lget_label != NULL, FALSE);130 entry_added(io, entrydata, menu);
85 GtkLabel * label = lget_label();131 }
86132
87 get_icon_t lget_icon = NULL;133 g_list_free(entries);
88 g_return_val_if_fail(g_module_symbol(module, INDICATOR_GET_ICON_S, (gpointer *)(&lget_icon)), FALSE);
89 g_return_val_if_fail(lget_icon != NULL, FALSE);
90 GtkImage * icon = lget_icon();
91
92 get_menu_t lget_menu = NULL;
93 g_return_val_if_fail(g_module_symbol(module, INDICATOR_GET_MENU_S, (gpointer *)(&lget_menu)), FALSE);
94 g_return_val_if_fail(lget_menu != NULL, FALSE);
95 GtkMenu * lmenu = lget_menu();
96
97 if (label == NULL && icon == NULL) {
98 /* This is the case where there is nothing to display,
99 kinda odd that we'd have a module with nothing. */
100 g_warning("No label or icon. Odd.");
101 return FALSE;
102 }
103
104 GtkWidget * menuitem = gtk_menu_item_new();
105 GtkWidget * hbox = gtk_hbox_new(FALSE, 3);
106 if (icon != NULL) {
107 gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(icon), FALSE, FALSE, 0);
108 }
109 if (label != NULL) {
110 gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(label), FALSE, FALSE, 0);
111 }
112 gtk_container_add(GTK_CONTAINER(menuitem), hbox);
113 gtk_widget_show(hbox);
114
115 if (lmenu != NULL) {
116 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), GTK_WIDGET(lmenu));
117 }
118
119 gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
120 gtk_widget_show(menuitem);
121134
122 return TRUE;135 return TRUE;
123}136}
@@ -173,7 +186,7 @@
173 license_i18n = g_strconcat (_(license[0]), "\n\n", _(license[1]), "\n\n", _(license[2]), NULL);186 license_i18n = g_strconcat (_(license[0]), "\n\n", _(license[1]), "\n\n", _(license[2]), NULL);
174187
175 gtk_show_about_dialog(NULL,188 gtk_show_about_dialog(NULL,
176 "version", "0.1",189 "version", VERSION,
177 "copyright", "Copyright \xc2\xa9 2009 Canonical, Ltd.",190 "copyright", "Copyright \xc2\xa9 2009 Canonical, Ltd.",
178 "comments", _("An applet to hold all of the system indicators."),191 "comments", _("An applet to hold all of the system indicators."),
179 "authors", authors,192 "authors", authors,
@@ -223,14 +236,8 @@
223236
224 if (!first_time)237 if (!first_time)
225 {238 {
226 gint argc = 1;
227 gchar *argv[2] = { "indicator-applet", NULL};
228
229 first_time = TRUE;239 first_time = TRUE;
230 program = gnome_program_init ("indicator-applet", "0.1",240 g_set_application_name(_("Indicator Applet"));
231 LIBGNOMEUI_MODULE, argc, argv,
232 GNOME_PROGRAM_STANDARD_PROPERTIES,
233 NULL);
234 }241 }
235242
236 /* Set panel options */243 /* Set panel options */

Subscribers

People subscribed via source and target branches