[Xfce4-commits] [apps/xfce4-terminal] 01/01: Add option to set unlimited scrollback

noreply at xfce.org noreply at xfce.org
Sun Jun 19 05:23:41 CEST 2016


This is an automated email from the git hooks/post-receive script.

f2404 pushed a commit to branch master
in repository apps/xfce4-terminal.

commit 4c294bd2db941e1213b6c303de4f23fc0288d9fb
Author: Stefano Angeleri <weltall2 at gmail.com>
Date:   Sun Jun 19 06:23:16 2016 +0300

    Add option to set unlimited scrollback
    
    Fixes #9875
---
 terminal/terminal-preferences-dialog.c |  6 +++---
 terminal/terminal-preferences.c        | 11 +++++++++++
 terminal/terminal-preferences.glade    | 16 ++++++++++++++++
 terminal/terminal-screen.c             |  9 ++++++---
 4 files changed, 36 insertions(+), 6 deletions(-)

diff --git a/terminal/terminal-preferences-dialog.c b/terminal/terminal-preferences-dialog.c
index ed43c9a..0d1969d 100644
--- a/terminal/terminal-preferences-dialog.c
+++ b/terminal/terminal-preferences-dialog.c
@@ -137,9 +137,9 @@ terminal_preferences_dialog_init (TerminalPreferencesDialog *dialog)
   const gchar      *props_active[] = { "title-mode", "command-login-shell",
                                        "command-update-records", "scrolling-single-line",
                                        "scrolling-on-output", "scrolling-on-keystroke",
-                                       "scrolling-bar", "font-allow-bold",
-                                       "misc-menubar-default", "misc-toolbar-default",
-                                       "misc-borders-default",
+                                       "scrolling-bar", "scrolling-unlimited",
+                                       "font-allow-bold", "misc-menubar-default",
+                                       "misc-toolbar-default", "misc-borders-default",
                                        "shortcuts-no-mnemonics", "shortcuts-no-menukey",
                                        "binding-backspace", "binding-delete",
                                        "background-mode", "background-image-style",
diff --git a/terminal/terminal-preferences.c b/terminal/terminal-preferences.c
index 2dabbe2..8b671ec 100644
--- a/terminal/terminal-preferences.c
+++ b/terminal/terminal-preferences.c
@@ -95,6 +95,7 @@ enum
   PROP_SCROLLING_ON_OUTPUT,
   PROP_SCROLLING_ON_KEYSTROKE,
   PROP_SCROLLING_SINGLE_LINE,
+  PROP_SCROLLING_UNLIMITED,
   PROP_SHORTCUTS_NO_MENUKEY,
   PROP_SHORTCUTS_NO_MNEMONICS,
   PROP_TITLE_INITIAL,
@@ -816,6 +817,16 @@ terminal_preferences_class_init (TerminalPreferencesClass *klass)
                          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
 
   /**
+   * TerminalPreferences:scrolling-unlimited:
+   **/
+  preferences_props[PROP_SCROLLING_UNLIMITED] =
+      g_param_spec_boolean ("scrolling-unlimited",
+                            NULL,
+                            "ScrollingUnlimited",
+                            FALSE,
+                            G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+
+  /**
    * TerminalPreferences:scrolling-on-output:
    **/
   preferences_props[PROP_SCROLLING_ON_OUTPUT] =
diff --git a/terminal/terminal-preferences.glade b/terminal/terminal-preferences.glade
index b571d5f..a95ddbe 100644
--- a/terminal/terminal-preferences.glade
+++ b/terminal/terminal-preferences.glade
@@ -569,6 +569,22 @@
                                     <property name="top_attach">1</property>
                                   </packing>
                                 </child>
+                                <child>
+                                  <object class="GtkCheckButton" id="scrolling-unlimited">
+                                    <property name="label" translatable="yes">Unli_mited scrollback</property>
+                                    <property name="use_action_appearance">False</property>
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="receives_default">False</property>
+                                    <property name="tooltip_text" translatable="yes">This option controls whether the terminal will have no limits on scrollback.</property>
+                                    <property name="use_underline">True</property>
+                                    <property name="draw_indicator">True</property>
+                                  </object>
+                                  <packing>
+                                    <property name="left_attach">2</property>
+                                    <property name="top_attach">1</property>
+                                  </packing>
+                                </child>
                               </object>
                               <packing>
                                 <property name="expand">False</property>
diff --git a/terminal/terminal-screen.c b/terminal/terminal-screen.c
index da47182..5fec6d6 100644
--- a/terminal/terminal-screen.c
+++ b/terminal/terminal-screen.c
@@ -502,7 +502,7 @@ terminal_screen_preferences_changed (TerminalPreferences *preferences,
     terminal_screen_update_misc_mouse_autohide (screen);
   else if (strcmp ("scrolling-bar", name) == 0)
     terminal_screen_update_scrolling_bar (screen);
-  else if (strcmp ("scrolling-lines", name) == 0)
+  else if (strcmp ("scrolling-lines", name) == 0 || strcmp ("scrolling-unlimited", name) == 0)
     terminal_screen_update_scrolling_lines (screen);
   else if (strcmp ("scrolling-on-output", name) == 0)
     terminal_screen_update_scrolling_on_output (screen);
@@ -1123,9 +1123,12 @@ terminal_screen_update_scrolling_bar (TerminalScreen *screen)
 static void
 terminal_screen_update_scrolling_lines (TerminalScreen *screen)
 {
-  guint lines;
+  glong    lines;
+  gboolean unlimited;
   g_object_get (G_OBJECT (screen->preferences), "scrolling-lines", &lines, NULL);
-  vte_terminal_set_scrollback_lines (VTE_TERMINAL (screen->terminal), lines);
+  g_object_get (G_OBJECT (screen->preferences), "scrolling-unlimited", &unlimited, NULL);
+  vte_terminal_set_scrollback_lines (VTE_TERMINAL (screen->terminal),
+                                     unlimited ? -1 : lines);
 }
 
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list