Merge lp:~radumstoica/ubuntu/quantal/xfce4-terminal/scroll-alternate-src-patch into lp:ubuntu/quantal/xfce4-terminal

Proposed by RaduStoica
Status: Merged
Merged at revision: 57
Proposed branch: lp:~radumstoica/ubuntu/quantal/xfce4-terminal/scroll-alternate-src-patch
Merge into: lp:ubuntu/quantal/xfce4-terminal
Diff against target: 456 lines (+93/-322)
6 files modified
.pc/applied-patches (+0/-1)
.pc/xubuntu_fix-invalid-anchor.patch/terminal/terminal-dialogs.c (+0/-313)
debian/changelog (+14/-0)
debian/patches/scroll-alternate-src-togglable.patch (+77/-0)
debian/patches/series (+1/-0)
terminal/terminal-dialogs.c (+1/-8)
To merge this branch: bzr merge lp:~radumstoica/ubuntu/quantal/xfce4-terminal/scroll-alternate-src-patch
Reviewer Review Type Date Requested Status
Iain Lane Approve
David Henningsson (community) Needs Fixing
Ubuntu branches Pending
Review via email: mp+124570@code.launchpad.net

Description of the change

Enabled scrolling in ncurses apps using mouse wheel. (lp: #947892)

To post a comment you must log in.
57. By RaduStoica

* debian/patches:
    - scroll-alternate-src-togglable.patch: enable scrolling in ncurses
      apps with mouse wheel. lp: #947892

Revision history for this message
David Henningsson (diwic) wrote :

Hi RaduStoica, and thanks for trying to help out!

I gave your merge proposal a quick review as part of the patch pilot program. And I noticed something strange while doing so - your commit does not only add the patch but also applies it, which means changes to files outside the debian directory.

Looking a bit back in history, it seems you're not the only one who has done this. As such I think it would make the most sense to do two commits: the first would just unapply all patches (to correct the previous stuff), the second one would add your patch without applying it (i e, only changes to debian/changelog, debian/patches/series and debian/patches/scroll-alternate-src-togglable.patch).

The actual patch content looks okay to me so hopefully it can be merged (by somebody with the appropriate upload rights, which I don't have) after that.

review: Needs Fixing
58. By RaduStoica

Unapplied all quilt patches.

Revision history for this message
RaduStoica (radumstoica) wrote :

> Hi RaduStoica, and thanks for trying to help out!
>
> I gave your merge proposal a quick review as part of the patch pilot program.
> And I noticed something strange while doing so - your commit does not only add
> the patch but also applies it, which means changes to files outside the debian
> directory.
>
> Looking a bit back in history, it seems you're not the only one who has done
> this. As such I think it would make the most sense to do two commits: the
> first would just unapply all patches (to correct the previous stuff), the
> second one would add your patch without applying it (i e, only changes to
> debian/changelog, debian/patches/series and debian/patches/scroll-alternate-
> src-togglable.patch).
>
> The actual patch content looks okay to me so hopefully it can be merged (by
> somebody with the appropriate upload rights, which I don't have) after that.

Thanks for taking the time to look at my branch! I'm still a bit confused about
how the quilt patching works, so that's why I commited the files with the patch
applied.

I've done a new commit now, with all patches unapplied. The patch for scrolling
in ncurses apps is still added in the debian/patches/series file, so I don't
think a second commit is needed. Let me know what's your opinion - I can make
a clean branch and add the patch to that one, if this one seems too messy.

Revision history for this message
Iain Lane (laney) wrote :

Thank you, I've merged it and uploaded to Quantal. There was no need to create a new version for the .pc fiddling - the mantra is one version per upload. Anyway, I'm sure I messed that up again while merging. It's complex :P

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== removed file '.pc/applied-patches'
--- .pc/applied-patches 2012-04-05 20:07:06 +0000
+++ .pc/applied-patches 1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
1xubuntu_fix-invalid-anchor.patch
20
=== removed directory '.pc/xubuntu_fix-invalid-anchor.patch'
=== removed directory '.pc/xubuntu_fix-invalid-anchor.patch/terminal'
=== removed file '.pc/xubuntu_fix-invalid-anchor.patch/terminal/terminal-dialogs.c'
--- .pc/xubuntu_fix-invalid-anchor.patch/terminal/terminal-dialogs.c 2012-04-05 20:07:06 +0000
+++ .pc/xubuntu_fix-invalid-anchor.patch/terminal/terminal-dialogs.c 1970-01-01 00:00:00 +0000
@@ -1,313 +0,0 @@
1/*-
2 * Copyright (c) 2005-2007 Benedikt Meurer <benny@xfce.org>
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the Free
6 * Software Foundation; either version 2 of the License, or (at your option)
7 * any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
16 * Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19#ifdef HAVE_CONFIG_H
20#include <config.h>
21#endif
22
23#ifdef HAVE_STDARG_H
24#include <stdarg.h>
25#endif
26#ifdef HAVE_LOCALE_H
27#include <locale.h>
28#endif
29
30#include <exo/exo.h>
31
32#include <terminal/terminal-dialogs.h>
33#include <terminal/terminal-private.h>
34
35
36
37/**
38 * terminal_dialogs_show_about:
39 * @parent : the parent #GtkWindow or %NULL.
40 * @title : the software title.
41 * @format : the printf()-style format for the main text in the about dialog.
42 * @... : argument list for the @format.
43 *
44 * Displays the Terminal about dialog with @format as main text.
45 **/
46void
47terminal_dialogs_show_about (GtkWindow *parent)
48{
49 static const gchar *authors[] =
50 {
51 "Benedikt Meurer <benny@xfce.org>",
52 "Nick Schermer <nick@xfce.org>",
53 NULL,
54 };
55
56 static const gchar *artists[] =
57 {
58 "Francois Le Clainche <fleclainche@wanadoo.fr>",
59 NULL,
60 };
61
62 static const gchar *documenters[] =
63 {
64 "Benedikt Meurer <benny@xfce.org>",
65 "Andrew Conkling <andrewski@fr.st>",
66 "Nick Schermer <nick@xfce.org>",
67 NULL,
68 };
69
70 GdkPixbuf *logo = NULL;
71 GtkIconTheme *theme;
72
73 /* try to load the about logo */
74 theme = gtk_icon_theme_get_default ();
75 if (gtk_icon_theme_has_icon (theme, "utilities-terminal"))
76 logo = gtk_icon_theme_load_icon (theme, "utilities-terminal", 128, GTK_ICON_LOOKUP_FORCE_SVG, NULL);
77 if (logo == NULL)
78 logo = gdk_pixbuf_new_from_file_at_size (DATADIR "/icons/hicolor/scalable/apps/Terminal.svg", 128, 128, NULL);
79
80 /* set dialog hook on gtk versions older then 2.18 */
81#if !GTK_CHECK_VERSION (2, 18, 0)
82#if EXO_CHECK_VERSION (0, 5, 0)
83 gtk_about_dialog_set_email_hook (exo_gtk_url_about_dialog_hook, NULL, NULL);
84 gtk_about_dialog_set_url_hook (exo_gtk_url_about_dialog_hook, NULL, NULL);
85#else
86 gtk_about_dialog_set_email_hook (exo_url_about_dialog_hook, NULL, NULL);
87 gtk_about_dialog_set_url_hook (exo_url_about_dialog_hook, NULL, NULL);
88#endif
89#endif
90
91 /* open the about dialog */
92 gtk_show_about_dialog (parent,
93 "authors", authors,
94 "artists", artists,
95 "comments", _("Xfce Terminal Emulator"),
96 "documenters", documenters,
97 "copyright", "Copyright \302\251 2003-2008 Benedikt Meurer\n"
98 "Copyright \302\251 2007-2011 Nick Schermer",
99 "license", XFCE_LICENSE_GPL,
100 "logo", logo,
101 "program-name", g_get_application_name (),
102 "translator-credits", _("translator-credits"),
103 "version", PACKAGE_VERSION,
104 "website", "http://goodies.xfce.org/projects/applications/terminal",
105 "website-label", _("Visit Terminal website"),
106 NULL);
107
108 /* release the about logo (if any) */
109 if (G_LIKELY (logo != NULL))
110 g_object_unref (G_OBJECT (logo));
111}
112
113
114
115/**
116 * terminal_dialogs_show_error:
117 * @parent : a #GtkWidget on which the error dialog should be shown, or a #GdkScreen
118 * if no #GtkWidget is known. May also be %NULL, in which case the default
119 * #GdkScreen will be used.
120 * @error : a #GError, which gives a more precise description of the problem or %NULL.
121 * @format : the printf()-style format for the primary problem description.
122 * @... : argument list for the @format.
123 *
124 * Displays an error dialog on @widget using the @format as primary message and optionally
125 * displaying @error as secondary error text.
126 *
127 * If @widget is not %NULL and @widget is part of a #GtkWindow, the function makes sure
128 * that the toplevel window is visible prior to displaying the error dialog.
129 **/
130void
131terminal_dialogs_show_error (gpointer parent,
132 const GError *error,
133 const gchar *format,
134 ...)
135{
136 GtkWidget *dialog;
137 GtkWidget *window = NULL;
138 GdkScreen *screen;
139 va_list args;
140 gchar *primary_text;
141
142 terminal_return_if_fail (parent == NULL || GDK_IS_SCREEN (parent) || GTK_IS_WIDGET (parent));
143
144 /* determine the proper parent */
145 if (parent == NULL)
146 {
147 /* just use the default screen then */
148 screen = gdk_screen_get_default ();
149 }
150 else if (GDK_IS_SCREEN (parent))
151 {
152 /* yep, that's a screen */
153 screen = GDK_SCREEN (parent);
154 }
155 else
156 {
157 /* parent is a widget, so let's determine the toplevel window */
158 window = gtk_widget_get_toplevel (GTK_WIDGET (parent));
159 if (GTK_WIDGET_TOPLEVEL (window))
160 {
161 /* make sure the toplevel window is shown */
162 gtk_widget_show_now (window);
163 }
164 else
165 {
166 /* no toplevel, not usable then */
167 window = NULL;
168 }
169
170 /* determine the screen for the widget */
171 screen = gtk_widget_get_screen (GTK_WIDGET (parent));
172 }
173
174 /* determine the primary error text */
175 va_start (args, format);
176 primary_text = g_strdup_vprintf (format, args);
177 va_end (args);
178
179 /* allocate the error dialog */
180 dialog = gtk_message_dialog_new ((GtkWindow *) window,
181 GTK_DIALOG_DESTROY_WITH_PARENT
182 | GTK_DIALOG_MODAL,
183 GTK_MESSAGE_ERROR,
184 GTK_BUTTONS_CLOSE,
185 "%s.", primary_text);
186
187 /* move the dialog to the appropriate screen */
188 if (window == NULL && screen != NULL)
189 gtk_window_set_screen (GTK_WINDOW (dialog), screen);
190
191 /* set secondary text if an error is provided */
192 if (G_LIKELY (error != NULL))
193 gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), "%s.", error->message);
194
195 /* display the dialog */
196 gtk_dialog_run (GTK_DIALOG (dialog));
197
198 /* cleanup */
199 gtk_widget_destroy (dialog);
200 g_free (primary_text);
201}
202
203
204
205static gboolean
206terminal_dialogs_show_help_ask_online (GtkWindow *parent)
207{
208 GtkWidget *dialog;
209 GtkWidget *button;
210 GtkWidget *image;
211 gint response_id;
212
213 dialog = gtk_message_dialog_new (parent, GTK_DIALOG_DESTROY_WITH_PARENT,
214 GTK_MESSAGE_QUESTION, GTK_BUTTONS_CANCEL,
215 _("The %s user manual is not installed on your computer"),
216 g_get_application_name ());
217 gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
218 _("You can read the user manual online. This manual may however "
219 "not exactly match your %s version."), g_get_application_name ());
220 gtk_window_set_title (GTK_WINDOW (dialog), _("User manual is missing"));
221
222 button = gtk_button_new_with_mnemonic (_("_Read Online"));
223 gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, GTK_RESPONSE_ACCEPT);
224 gtk_widget_show (button);
225
226 image = gtk_image_new_from_icon_name ("web-browser", GTK_ICON_SIZE_BUTTON);
227 gtk_button_set_image (GTK_BUTTON (button), image);
228 gtk_widget_show (image);
229
230 response_id = gtk_dialog_run (GTK_DIALOG (dialog));
231
232 gtk_widget_destroy (dialog);
233
234 return (response_id == GTK_RESPONSE_ACCEPT);
235}
236
237
238
239/**
240 * terminal_dialogs_show_help:
241 * @parent : a #GtkWindow.
242 * #GdkScreen will be used.
243 * @page : the name of the page of the user manual to display or %NULL to display
244 * the overview page.
245 * @offset : the offset of the topic in the @page to display or %NULL to just display
246 * @page.
247 *
248 * Displays the Terminal user manual. If @page is not %NULL it specifies the basename
249 * of the HTML file to display. @offset may refer to a anchor in the @page.
250 **/
251void
252terminal_dialogs_show_help (GtkWindow *parent,
253 const gchar *page,
254 const gchar *offset)
255{
256 GError *error = NULL;
257 gchar *filename;
258 gchar *locale;
259 gboolean exists;
260 gchar *uri = NULL;
261
262 terminal_return_if_fail (GTK_IS_WINDOW (parent));
263
264 /* use index page */
265 if (page == NULL)
266 page = "index.html";
267
268 /* get the locale of the user */
269 locale = g_strdup (setlocale (LC_MESSAGES, NULL));
270 if (G_LIKELY (locale != NULL))
271 locale = g_strdelimit (locale, "._", '\0');
272 else
273 locale = g_strdup ("C");
274
275 /* check if the help page exists on the system */
276 filename = g_build_filename (HELPDIR, locale, page, NULL);
277 exists = g_file_test (filename, G_FILE_TEST_EXISTS);
278 if (!exists && strcmp (locale, "C") != 0)
279 {
280 g_free (filename);
281 filename = g_build_filename (HELPDIR, "C", page, NULL);
282 exists = g_file_test (filename, G_FILE_TEST_EXISTS);
283 }
284
285 /* build the full uri, fallback to online docs if nothing was found */
286 if (G_LIKELY (exists))
287 {
288 uri = g_strconcat ("file://", filename, "#", offset, NULL);
289 }
290 else if (terminal_dialogs_show_help_ask_online (parent))
291 {
292 uri = g_strconcat ("http://docs.xfce.org/help.php?package=terminal&lang=",
293 locale, "&page=", page, "&anchor=", offset, NULL);
294 }
295
296 g_free (filename);
297 g_free (locale);
298
299 /* try to run the documentation browser */
300 if (uri != NULL
301 && !exo_execute_preferred_application_on_screen ("WebBrowser", uri, NULL,
302 NULL, gtk_window_get_screen (parent),
303 &error))
304 {
305 /* display an error message to the user */
306 terminal_dialogs_show_error (parent, error, _("Failed to open the documentation browser"));
307 g_error_free (error);
308 }
309
310 g_free (uri);
311}
312
313
3140
=== modified file 'debian/changelog'
--- debian/changelog 2012-05-19 19:29:26 +0000
+++ debian/changelog 2012-09-20 16:50:23 +0000
@@ -1,3 +1,17 @@
1xfce4-terminal (0.4.8-1ubuntu4) quantal; urgency=low
2
3 * Unapplied all quilt patches.
4
5 -- Radu Stoica <radumstoica@gmail.com> Thu, 20 Sep 2012 19:32:27 +0300
6
7xfce4-terminal (0.4.8-1ubuntu3) quantal; urgency=low
8
9 * debian/patches:
10 - scroll-alternate-src-togglable.patch: enable scrolling in ncurses
11 apps with mouse wheel. lp: #947892
12
13 -- Radu Stoica <radumstoica@gmail.com> Sun, 16 Sep 2012 14:38:25 +0300
14
1xfce4-terminal (0.4.8-1ubuntu2) quantal; urgency=low15xfce4-terminal (0.4.8-1ubuntu2) quantal; urgency=low
216
3 * No change rebuild against libxfce4util6.17 * No change rebuild against libxfce4util6.
418
=== added file 'debian/patches/scroll-alternate-src-togglable.patch'
--- debian/patches/scroll-alternate-src-togglable.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/scroll-alternate-src-togglable.patch 2012-09-20 16:50:23 +0000
@@ -0,0 +1,77 @@
1=== modified file 'terminal/terminal-preferences.c'
2--- a/terminal/terminal-preferences.c 2011-06-22 00:03:08 +0000
3+++ b/terminal/terminal-preferences.c 2012-09-15 06:00:24 +0000
4@@ -121,6 +121,7 @@
5 PROP_MISC_TAB_CLOSE_MIDDLE_CLICK,
6 PROP_MISC_TAB_POSITION,
7 PROP_MISC_HIGHLIGHT_URLS,
8+ PROP_MISC_SCROLL_ALTERNATE_SCREEN,
9 PROP_SCROLLING_BAR,
10 PROP_SCROLLING_LINES,
11 PROP_SCROLLING_ON_OUTPUT,
12@@ -1240,6 +1241,19 @@
13 EXO_PARAM_READWRITE));
14
15 /**
16+ * TerminalPreferences:misc-scroll-alternate-screen:
17+ *
18+ * Whether to scroll the alternate screen with the mouse wheel
19+ **/
20+ g_object_class_install_property (gobject_class,
21+ PROP_MISC_SCROLL_ALTERNATE_SCREEN,
22+ g_param_spec_boolean("misc-scroll-alternate-screen",
23+ "misc-scroll-alternate-screen",
24+ "MiscScrollAlternateScreen",
25+ TRUE,
26+ EXO_PARAM_READWRITE));
27+
28+ /**
29 * TerminalPreferences:shortcuts-no-menukey:
30 *
31 * Disable menu shortcut key (F10 by default).
32
33=== modified file 'terminal/terminal-screen.c'
34--- a/terminal/terminal-screen.c 2011-06-22 00:03:08 +0000
35+++ b/terminal/terminal-screen.c 2012-09-15 06:00:24 +0000
36@@ -99,6 +99,7 @@
37 static void terminal_screen_update_misc_cursor_blinks (TerminalScreen *screen);
38 static void terminal_screen_update_misc_cursor_shape (TerminalScreen *screen);
39 static void terminal_screen_update_misc_mouse_autohide (TerminalScreen *screen);
40+static void terminal_screen_update_scrolling_alternate (TerminalScreen *screen);
41 static void terminal_screen_update_scrolling_bar (TerminalScreen *screen);
42 static void terminal_screen_update_scrolling_lines (TerminalScreen *screen);
43 static void terminal_screen_update_scrolling_on_output (TerminalScreen *screen);
44@@ -291,6 +292,7 @@
45 "swapped-signal::notify::misc-cursor-blinks", G_CALLBACK (terminal_screen_update_misc_cursor_blinks), screen,
46 "swapped-signal::notify::misc-cursor-shape", G_CALLBACK (terminal_screen_update_misc_cursor_shape), screen,
47 "swapped-signal::notify::misc-mouse-autohide", G_CALLBACK (terminal_screen_update_misc_mouse_autohide), screen,
48+ "swapped-signal::notify::misc-scroll-alternate-screen", G_CALLBACK (terminal_screen_update_scrolling_alternate), screen,
49 "swapped-signal::notify::scrolling-bar", G_CALLBACK (terminal_screen_update_scrolling_bar), screen,
50 "swapped-signal::notify::scrolling-lines", G_CALLBACK (terminal_screen_update_scrolling_lines), screen,
51 "swapped-signal::notify::scrolling-on-output", G_CALLBACK (terminal_screen_update_scrolling_on_output), screen,
52@@ -309,6 +311,7 @@
53 terminal_screen_update_misc_cursor_blinks (screen);
54 terminal_screen_update_misc_cursor_shape (screen);
55 terminal_screen_update_misc_mouse_autohide (screen);
56+ terminal_screen_update_scrolling_alternate (screen);
57 terminal_screen_update_scrolling_bar (screen);
58 terminal_screen_update_scrolling_lines (screen);
59 terminal_screen_update_scrolling_on_output (screen);
60@@ -950,6 +953,16 @@
61
62
63 static void
64+terminal_screen_update_scrolling_alternate (TerminalScreen *screen)
65+{
66+ gboolean scroll;
67+ g_object_get (G_OBJECT (screen->preferences), "misc-scroll-alternate-screen", &scroll, NULL);
68+ vte_terminal_set_alternate_screen_scroll (VTE_TERMINAL (screen->terminal), scroll);
69+}
70+
71+
72+
73+static void
74 terminal_screen_update_scrolling_bar (TerminalScreen *screen)
75 {
76 TerminalScrollbar scrollbar;
77
078
=== modified file 'debian/patches/series'
--- debian/patches/series 2012-04-05 20:07:06 +0000
+++ debian/patches/series 2012-09-20 16:50:23 +0000
@@ -1,1 +1,2 @@
1xubuntu_fix-invalid-anchor.patch1xubuntu_fix-invalid-anchor.patch
2scroll-alternate-src-togglable.patch
23
=== modified file 'terminal/terminal-dialogs.c'
--- terminal/terminal-dialogs.c 2012-04-05 20:07:06 +0000
+++ terminal/terminal-dialogs.c 2012-09-20 16:50:23 +0000
@@ -285,14 +285,7 @@
285 /* build the full uri, fallback to online docs if nothing was found */285 /* build the full uri, fallback to online docs if nothing was found */
286 if (G_LIKELY (exists))286 if (G_LIKELY (exists))
287 {287 {
288 if (offset)288 uri = g_strconcat ("file://", filename, "#", offset, NULL);
289 {
290 uri = g_strconcat ("file://", filename, "#", offset, NULL);
291 }
292 else
293 {
294 uri = g_strconcat ("file://", filename, NULL);
295 }
296 }289 }
297 else if (terminal_dialogs_show_help_ask_online (parent))290 else if (terminal_dialogs_show_help_ask_online (parent))
298 {291 {

Subscribers

People subscribed via source and target branches

to all changes: