Merge lp:~darkxst/ubuntu/saucy/gnome-panel/lp1184812 into lp:ubuntu/saucy/gnome-panel

Proposed by Tim Lunn
Status: Merged
Merge reported by: Luke Yelavich
Merged at revision: not available
Proposed branch: lp:~darkxst/ubuntu/saucy/gnome-panel/lp1184812
Merge into: lp:ubuntu/saucy/gnome-panel
Diff against target: 565 lines (+540/-0)
4 files modified
debian/changelog (+7/-0)
debian/patches/clock_applet_needs_terminal.patch (+358/-0)
debian/patches/git_panel_run_dialog_resurrect_terminal.patch (+173/-0)
debian/patches/series (+2/-0)
To merge this branch: bzr merge lp:~darkxst/ubuntu/saucy/gnome-panel/lp1184812
Reviewer Review Type Date Requested Status
Jeremy Bicha Approve
Ubuntu branches Pending
Review via email: mp+166003@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Jeremy Bicha (jbicha) wrote :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2012-12-18 13:23:10 +0000
+++ debian/changelog 2013-05-28 10:11:50 +0000
@@ -1,3 +1,10 @@
1gnome-panel (1:3.6.2-0ubuntu4) saucy; urgency=low
2
3 * Rebuild for gnome-desktop 3.8 transition (LP: #1184812)
4 - debian/patches/git_panel_run_dialog_resurrect_terminal.patch
5 clock_applet_needs_terminal.patch
6 -- Tim Lunn <tim@feathertop.org> Tue, 28 May 2013 11:55:23 +1000
7
1gnome-panel (1:3.6.2-0ubuntu3) raring; urgency=low8gnome-panel (1:3.6.2-0ubuntu3) raring; urgency=low
29
3 [ Alberts Muktupāvels ]10 [ Alberts Muktupāvels ]
411
=== added file 'debian/patches/clock_applet_needs_terminal.patch'
--- debian/patches/clock_applet_needs_terminal.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/clock_applet_needs_terminal.patch 2013-05-28 10:11:50 +0000
@@ -0,0 +1,358 @@
1This patches over git_panel_run_dialog_resurrect_terminal.patch and provides a common
2function since this applet also needs the prepend_terminal command.
3
4
5--- a/applets/clock/calendar-window.c
6+++ b/applets/clock/calendar-window.c
7@@ -43,7 +43,8 @@
8 #include <gio/gio.h>
9
10 #define GNOME_DESKTOP_USE_UNSTABLE_API
11-#include <libgnome-desktop/gnome-desktop-utils.h>
12+
13+#include "panel-launch.h"
14
15 #include "calendar-window.h"
16
17@@ -190,7 +191,7 @@
18 error = NULL;
19
20 if (terminal)
21- gnome_desktop_prepend_terminal_to_vector (&argc, &argv);
22+ panel_util_desktop_prepend_terminal_to_vector (&argc, &argv);
23
24 display = gdk_screen_make_display_name (screen);
25
26--- a/gnome-panel/panel-run-dialog.c
27+++ b/gnome-panel/panel-run-dialog.c
28@@ -47,6 +47,7 @@
29 #include <libpanel-util/panel-glib.h>
30 #include <libpanel-util/panel-gtk.h>
31 #include <libpanel-util/panel-keyfile.h>
32+#include <libpanel-util/panel-launch.h>
33 #include <libpanel-util/panel-show.h>
34 #include <libpanel-util/panel-xdg.h>
35
36@@ -335,136 +336,6 @@
37 }
38
39
40-/**
41- * gnome_desktop_prepend_terminal_to_vector:
42- * @argc: a pointer to the vector size
43- * @argv: a pointer to the vector
44- *
45- * Description: Prepends a terminal (either the one configured as default in
46- * the user's GNOME setup, or one of the common xterm emulators) to the passed
47- * in vector, modifying it in the process. The vector should be allocated with
48- * #g_malloc, as this will #g_free the original vector. Also all elements must
49- * have been allocated separately. That is the standard glib/GNOME way of
50- * doing vectors however. If the integer that @argc points to is negative, the
51- * size will first be computed. Also note that passing in pointers to a vector
52- * that is empty, will just create a new vector for you.
53- **/
54-static void
55-gnome_desktop_prepend_terminal_to_vector (int *argc, char ***argv)
56-{
57-#ifndef G_OS_WIN32
58- char **real_argv;
59- int real_argc;
60- int i, j;
61- char **term_argv = NULL;
62- int term_argc = 0;
63- GSettings *settings;
64-
65- gchar *terminal = NULL;
66-
67- char **the_argv;
68-
69- g_return_if_fail (argc != NULL);
70- g_return_if_fail (argv != NULL);
71-
72- // _gnome_desktop_init_i18n ();
73-
74- /* sanity */
75- if(*argv == NULL)
76- *argc = 0;
77-
78- the_argv = *argv;
79-
80- /* compute size if not given */
81- if (*argc < 0) {
82- for (i = 0; the_argv[i] != NULL; i++)
83- ;
84- *argc = i;
85- }
86-
87- settings = g_settings_new ("org.gnome.desktop.default-applications.terminal");
88- terminal = g_settings_get_string (settings, "exec");
89-
90- if (terminal) {
91- gchar *command_line;
92- gchar *exec_flag;
93-
94- exec_flag = g_settings_get_string (settings, "exec-arg");
95-
96- if (exec_flag == NULL)
97- command_line = g_strdup (terminal);
98- else
99- command_line = g_strdup_printf ("%s %s", terminal,
100- exec_flag);
101-
102- g_shell_parse_argv (command_line,
103- &term_argc,
104- &term_argv,
105- NULL /* error */);
106-
107- g_free (command_line);
108- g_free (exec_flag);
109- g_free (terminal);
110- }
111-
112- g_object_unref (settings);
113-
114- if (term_argv == NULL) {
115- char *check;
116-
117- term_argc = 2;
118- term_argv = g_new0 (char *, 3);
119-
120- check = g_find_program_in_path ("gnome-terminal");
121- if (check != NULL) {
122- term_argv[0] = check;
123- /* Note that gnome-terminal takes -x and
124- * as -e in gnome-terminal is broken we use that. */
125- term_argv[1] = g_strdup ("-x");
126- } else {
127- if (check == NULL)
128- check = g_find_program_in_path ("nxterm");
129- if (check == NULL)
130- check = g_find_program_in_path ("color-xterm");
131- if (check == NULL)
132- check = g_find_program_in_path ("rxvt");
133- if (check == NULL)
134- check = g_find_program_in_path ("xterm");
135- if (check == NULL)
136- check = g_find_program_in_path ("dtterm");
137- if (check == NULL) {
138- g_warning (_("Cannot find a terminal, using "
139- "xterm, even if it may not work"));
140- check = g_strdup ("xterm");
141- }
142- term_argv[0] = check;
143- term_argv[1] = g_strdup ("-e");
144- }
145- }
146-
147- real_argc = term_argc + *argc;
148- real_argv = g_new (char *, real_argc + 1);
149-
150- for (i = 0; i < term_argc; i++)
151- real_argv[i] = term_argv[i];
152-
153- for (j = 0; j < *argc; j++, i++)
154- real_argv[i] = (char *)the_argv[j];
155-
156- real_argv[i] = NULL;
157-
158- g_free (*argv);
159- *argv = real_argv;
160- *argc = real_argc;
161-
162- /* we use g_free here as we sucked all the inner strings
163- * out from it into real_argv */
164- g_free (term_argv);
165-#else
166- /* FIXME: Implement when needed */
167- g_warning ("gnome_prepend_terminal_to_vector: Not implemented");
168-#endif
169-}
170
171 static gboolean
172 panel_run_dialog_launch_command (PanelRunDialog *dialog,
173@@ -485,7 +356,7 @@
174 screen = gtk_window_get_screen (GTK_WINDOW (dialog->run_dialog));
175
176 if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->terminal_checkbox)))
177- gnome_desktop_prepend_terminal_to_vector (&argc, &argv);
178+ panel_util_desktop_prepend_terminal_to_vector (&argc, &argv);
179
180 display = gdk_screen_make_display_name (screen);
181
182--- a/gnome-panel/libpanel-util/panel-launch.c
183+++ b/gnome-panel/libpanel-util/panel-launch.c
184@@ -280,3 +280,135 @@
185 return _panel_launch_handle_error (fallback_exec,
186 screen, local_error, error);
187 }
188+
189+/**
190+ * panel_util_desktop_prepend_terminal_to_vector:
191+ * @argc: a pointer to the vector size
192+ * @argv: a pointer to the vector
193+ *
194+ * Description: Prepends a terminal (either the one configured as default in
195+ * the user's GNOME setup, or one of the common xterm emulators) to the passed
196+ * in vector, modifying it in the process. The vector should be allocated with
197+ * #g_malloc, as this will #g_free the original vector. Also all elements must
198+ * have been allocated separately. That is the standard glib/GNOME way of
199+ * doing vectors however. If the integer that @argc points to is negative, the
200+ * size will first be computed. Also note that passing in pointers to a vector
201+ * that is empty, will just create a new vector for you.
202+ **/
203+void
204+panel_util_desktop_prepend_terminal_to_vector (int *argc, char ***argv)
205+{
206+#ifndef G_OS_WIN32
207+ char **real_argv;
208+ int real_argc;
209+ int i, j;
210+ char **term_argv = NULL;
211+ int term_argc = 0;
212+ GSettings *settings;
213+
214+ gchar *terminal = NULL;
215+
216+ char **the_argv;
217+
218+ g_return_if_fail (argc != NULL);
219+ g_return_if_fail (argv != NULL);
220+
221+ // _gnome_desktop_init_i18n ();
222+
223+ /* sanity */
224+ if(*argv == NULL)
225+ *argc = 0;
226+
227+ the_argv = *argv;
228+
229+ /* compute size if not given */
230+ if (*argc < 0) {
231+ for (i = 0; the_argv[i] != NULL; i++)
232+ ;
233+ *argc = i;
234+ }
235+
236+ settings = g_settings_new ("org.gnome.desktop.default-applications.terminal");
237+ terminal = g_settings_get_string (settings, "exec");
238+
239+ if (terminal) {
240+ gchar *command_line;
241+ gchar *exec_flag;
242+
243+ exec_flag = g_settings_get_string (settings, "exec-arg");
244+
245+ if (exec_flag == NULL)
246+ command_line = g_strdup (terminal);
247+ else
248+ command_line = g_strdup_printf ("%s %s", terminal,
249+ exec_flag);
250+
251+ g_shell_parse_argv (command_line,
252+ &term_argc,
253+ &term_argv,
254+ NULL /* error */);
255+
256+ g_free (command_line);
257+ g_free (exec_flag);
258+ g_free (terminal);
259+ }
260+
261+ g_object_unref (settings);
262+
263+ if (term_argv == NULL) {
264+ char *check;
265+
266+ term_argc = 2;
267+ term_argv = g_new0 (char *, 3);
268+
269+ check = g_find_program_in_path ("gnome-terminal");
270+ if (check != NULL) {
271+ term_argv[0] = check;
272+ /* Note that gnome-terminal takes -x and
273+ * as -e in gnome-terminal is broken we use that. */
274+ term_argv[1] = g_strdup ("-x");
275+ } else {
276+ if (check == NULL)
277+ check = g_find_program_in_path ("nxterm");
278+ if (check == NULL)
279+ check = g_find_program_in_path ("color-xterm");
280+ if (check == NULL)
281+ check = g_find_program_in_path ("rxvt");
282+ if (check == NULL)
283+ check = g_find_program_in_path ("xterm");
284+ if (check == NULL)
285+ check = g_find_program_in_path ("dtterm");
286+ if (check == NULL) {
287+ g_warning (_("Cannot find a terminal, using "
288+ "xterm, even if it may not work"));
289+ check = g_strdup ("xterm");
290+ }
291+ term_argv[0] = check;
292+ term_argv[1] = g_strdup ("-e");
293+ }
294+ }
295+
296+ real_argc = term_argc + *argc;
297+ real_argv = g_new (char *, real_argc + 1);
298+
299+ for (i = 0; i < term_argc; i++)
300+ real_argv[i] = term_argv[i];
301+
302+ for (j = 0; j < *argc; j++, i++)
303+ real_argv[i] = (char *)the_argv[j];
304+
305+ real_argv[i] = NULL;
306+
307+ g_free (*argv);
308+ *argv = real_argv;
309+ *argc = real_argc;
310+
311+ /* we use g_free here as we sucked all the inner strings
312+ * out from it into real_argv */
313+ g_free (term_argv);
314+#else
315+ /* FIXME: Implement when needed */
316+ g_warning ("gnome_prepend_terminal_to_vector: Not implemented");
317+#endif
318+}
319+
320--- a/gnome-panel/libpanel-util/panel-launch.h
321+++ b/gnome-panel/libpanel-util/panel-launch.h
322@@ -56,6 +56,8 @@
323 GdkScreen *screen,
324 GError **error);
325
326+void panel_util_desktop_prepend_terminal_to_vector (int *argc, char ***argv);
327+
328 G_END_DECLS
329
330 #endif /* PANEL_LAUNCH_H */
331--- a/applets/clock/Makefile.am
332+++ b/applets/clock/Makefile.am
333@@ -52,12 +52,14 @@
334 $(CLOCK_EDS_CFLAGS) \
335 -I$(srcdir)/../../libpanel-applet \
336 -I$(top_builddir)/libpanel-applet \
337+ -I$(top_builddir)/gnome-panel/libpanel-util \
338 -DGNOMELOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
339 -DCLOCK_EDS_ICONDIR="\"$(CLOCK_EDS_ICONDIR)\"" \
340 -DGWEATHER_I_KNOW_THIS_IS_UNSTABLE
341
342 CLOCK_LDADD = \
343 ../../libpanel-applet/libpanel-applet-4.la \
344+ ../../gnome-panel/libpanel-util/libpanel-util.la \
345 $(CLOCK_LIBS) \
346 $(CLOCK_EDS_LIBS) \
347 $(LIBPANEL_APPLET_LIBS) \
348--- a/configure.ac
349+++ b/configure.ac
350@@ -131,7 +131,7 @@
351 AC_SUBST(TZ_CFLAGS)
352 AC_SUBST(TZ_LIBS)
353
354-PKG_CHECK_MODULES(CLOCK, pango >= $PANGO_REQUIRED gtk+-3.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED gio-2.0 >= $GLIB_REQUIRED librsvg-2.0 gweather-3.0 >= $GWEATHER_REQUIRED gnome-desktop-3.0 >= $LIBGNOME_DESKTOP_REQUIRED)
355+PKG_CHECK_MODULES(CLOCK, pango >= $PANGO_REQUIRED gtk+-3.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED gio-2.0 >= $GLIB_REQUIRED librsvg-2.0 gweather-3.0 >= $GWEATHER_REQUIRED gnome-desktop-3.0 >= $LIBGNOME_DESKTOP_REQUIRED dconf >= $DCONF_REQUIRED)
356 AC_SUBST(CLOCK_CFLAGS)
357 AC_SUBST(CLOCK_LIBS)
358
0359
=== added file 'debian/patches/git_panel_run_dialog_resurrect_terminal.patch'
--- debian/patches/git_panel_run_dialog_resurrect_terminal.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/git_panel_run_dialog_resurrect_terminal.patch 2013-05-28 10:11:50 +0000
@@ -0,0 +1,173 @@
1From bf6af945130299a69a244afaee4eecbd3fb77233 Mon Sep 17 00:00:00 2001
2From: Philipp Kaluza <phk@src.gnome.org>
3Date: Fri, 08 Mar 2013 17:08:32 +0000
4Subject: panel-run-dialog: resurrect function gnome_desktop_prepend_terminal_to_vector
5
6, which was removed from gnome-desktop in commit
79bab2144b7c8ace0c057720be3c48fb24a80a19d , and keep a local
8copy in panel-run-dialog.c (simple helper function, static).
9(Second half of fix for bug #237308 .)
10---
11diff --git a/gnome-panel/panel-run-dialog.c b/gnome-panel/panel-run-dialog.c
12index 801b9bc..faf3d7e 100644
13--- a/gnome-panel/panel-run-dialog.c
14+++ b/gnome-panel/panel-run-dialog.c
15@@ -25,6 +25,7 @@
16 * Havoc Pennington <hp@pobox.com>
17 * George Lebl <jirka@5z.com>
18 * Mark McLoughlin <mark@skynet.ie>
19+ * Tom Tromey (Copyright (C) 1998)
20 */
21
22 #include <config.h>
23@@ -42,8 +43,6 @@
24 #include <gdk/gdkkeysyms.h>
25 #include <gmenu-tree.h>
26
27-#include <libgnome-desktop/gnome-desktop-utils.h>
28-
29 #include <libpanel-util/panel-error.h>
30 #include <libpanel-util/panel-glib.h>
31 #include <libpanel-util/panel-gtk.h>
32@@ -335,6 +334,138 @@ dummy_child_watch (GPid pid,
33 */
34 }
35
36+
37+/**
38+ * gnome_desktop_prepend_terminal_to_vector:
39+ * @argc: a pointer to the vector size
40+ * @argv: a pointer to the vector
41+ *
42+ * Description: Prepends a terminal (either the one configured as default in
43+ * the user's GNOME setup, or one of the common xterm emulators) to the passed
44+ * in vector, modifying it in the process. The vector should be allocated with
45+ * #g_malloc, as this will #g_free the original vector. Also all elements must
46+ * have been allocated separately. That is the standard glib/GNOME way of
47+ * doing vectors however. If the integer that @argc points to is negative, the
48+ * size will first be computed. Also note that passing in pointers to a vector
49+ * that is empty, will just create a new vector for you.
50+ **/
51+static void
52+gnome_desktop_prepend_terminal_to_vector (int *argc, char ***argv)
53+{
54+#ifndef G_OS_WIN32
55+ char **real_argv;
56+ int real_argc;
57+ int i, j;
58+ char **term_argv = NULL;
59+ int term_argc = 0;
60+ GSettings *settings;
61+
62+ gchar *terminal = NULL;
63+
64+ char **the_argv;
65+
66+ g_return_if_fail (argc != NULL);
67+ g_return_if_fail (argv != NULL);
68+
69+ // _gnome_desktop_init_i18n ();
70+
71+ /* sanity */
72+ if(*argv == NULL)
73+ *argc = 0;
74+
75+ the_argv = *argv;
76+
77+ /* compute size if not given */
78+ if (*argc < 0) {
79+ for (i = 0; the_argv[i] != NULL; i++)
80+ ;
81+ *argc = i;
82+ }
83+
84+ settings = g_settings_new ("org.gnome.desktop.default-applications.terminal");
85+ terminal = g_settings_get_string (settings, "exec");
86+
87+ if (terminal) {
88+ gchar *command_line;
89+ gchar *exec_flag;
90+
91+ exec_flag = g_settings_get_string (settings, "exec-arg");
92+
93+ if (exec_flag == NULL)
94+ command_line = g_strdup (terminal);
95+ else
96+ command_line = g_strdup_printf ("%s %s", terminal,
97+ exec_flag);
98+
99+ g_shell_parse_argv (command_line,
100+ &term_argc,
101+ &term_argv,
102+ NULL /* error */);
103+
104+ g_free (command_line);
105+ g_free (exec_flag);
106+ g_free (terminal);
107+ }
108+
109+ g_object_unref (settings);
110+
111+ if (term_argv == NULL) {
112+ char *check;
113+
114+ term_argc = 2;
115+ term_argv = g_new0 (char *, 3);
116+
117+ check = g_find_program_in_path ("gnome-terminal");
118+ if (check != NULL) {
119+ term_argv[0] = check;
120+ /* Note that gnome-terminal takes -x and
121+ * as -e in gnome-terminal is broken we use that. */
122+ term_argv[1] = g_strdup ("-x");
123+ } else {
124+ if (check == NULL)
125+ check = g_find_program_in_path ("nxterm");
126+ if (check == NULL)
127+ check = g_find_program_in_path ("color-xterm");
128+ if (check == NULL)
129+ check = g_find_program_in_path ("rxvt");
130+ if (check == NULL)
131+ check = g_find_program_in_path ("xterm");
132+ if (check == NULL)
133+ check = g_find_program_in_path ("dtterm");
134+ if (check == NULL) {
135+ g_warning (_("Cannot find a terminal, using "
136+ "xterm, even if it may not work"));
137+ check = g_strdup ("xterm");
138+ }
139+ term_argv[0] = check;
140+ term_argv[1] = g_strdup ("-e");
141+ }
142+ }
143+
144+ real_argc = term_argc + *argc;
145+ real_argv = g_new (char *, real_argc + 1);
146+
147+ for (i = 0; i < term_argc; i++)
148+ real_argv[i] = term_argv[i];
149+
150+ for (j = 0; j < *argc; j++, i++)
151+ real_argv[i] = (char *)the_argv[j];
152+
153+ real_argv[i] = NULL;
154+
155+ g_free (*argv);
156+ *argv = real_argv;
157+ *argc = real_argc;
158+
159+ /* we use g_free here as we sucked all the inner strings
160+ * out from it into real_argv */
161+ g_free (term_argv);
162+#else
163+ /* FIXME: Implement when needed */
164+ g_warning ("gnome_prepend_terminal_to_vector: Not implemented");
165+#endif
166+}
167+
168 static gboolean
169 panel_run_dialog_launch_command (PanelRunDialog *dialog,
170 const char *command,
171--
172cgit v0.9.1
173
0174
=== modified file 'debian/patches/series'
--- debian/patches/series 2012-12-03 22:12:43 +0000
+++ debian/patches/series 2013-05-28 10:11:50 +0000
@@ -8,3 +8,5 @@
885_disable_shutdown_on_ltsp.patch885_disable_shutdown_on_ltsp.patch
990-remove_artifact_on_icon_animation.patch990-remove_artifact_on_icon_animation.patch
10fix-for-1083811.patch10fix-for-1083811.patch
11git_panel_run_dialog_resurrect_terminal.patch
12clock_applet_needs_terminal.patch

Subscribers

People subscribed via source and target branches

to all changes: