Merge lp:~voldyman/pantheon-terminal/opt-remember-tabs into lp:~elementary-apps/pantheon-terminal/trunk

Proposed by Akshay Shekher
Status: Merged
Approved by: Cody Garver
Approved revision: 553
Merged at revision: 557
Proposed branch: lp:~voldyman/pantheon-terminal/opt-remember-tabs
Merge into: lp:~elementary-apps/pantheon-terminal/trunk
Diff against target: 48 lines (+8/-2)
3 files modified
org.pantheon.terminal.gschema.xml (+5/-0)
src/PantheonTerminalWindow.vala (+2/-2)
src/Settings.vala (+1/-0)
To merge this branch: bzr merge lp:~voldyman/pantheon-terminal/opt-remember-tabs
Reviewer Review Type Date Requested Status
David Gomes (community) Approve
Review via email: mp+210593@code.launchpad.net

Commit message

Makes restoring exited (by the shell) tabs optional with a save-exited-tabs dconf key.

Description of the change

made remembering of tabs for restore optional to prevent memory leak and to make ctrl-d usable again

To post a comment you must log in.
Revision history for this message
Cody Garver (codygarver) wrote :

Wouldn't remember-tabs make it an easier to read key name?

Revision history for this message
Akshay Shekher (voldyman) wrote :

Remember-tabs key is already used for restoring tabs from the last session.

553. By Akshay Shekher

changed the dconf key name to avoid confusion

Revision history for this message
David Gomes (davidgomes) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'org.pantheon.terminal.gschema.xml'
2--- org.pantheon.terminal.gschema.xml 2014-01-21 18:12:13 +0000
3+++ org.pantheon.terminal.gschema.xml 2014-04-01 15:04:05 +0000
4@@ -138,5 +138,10 @@
5 <summary>Tab Behavior</summary>
6 <description>Whether to always show tabs, hide tabs when there is only one tab and never show tabs.</description>
7 </key>
8+ <key name="save-exited-tabs" type="b">
9+ <default>true</default>
10+ <summary>Make tabs restorable</summary>
11+ <description>When a tab is closed, keep it in memory to restore it later or not</description>
12+ </key>
13 </schema>
14 </schemalist>
15
16=== modified file 'src/PantheonTerminalWindow.vala'
17--- src/PantheonTerminalWindow.vala 2014-03-01 02:19:09 +0000
18+++ src/PantheonTerminalWindow.vala 2014-04-01 15:04:05 +0000
19@@ -224,7 +224,7 @@
20 case Gdk.Key.@D:
21 case Gdk.Key.@d:
22 if ((e.state & Gdk.ModifierType.CONTROL_MASK) != 0) {
23- if (!current_terminal.has_foreground_process ()) {
24+ if (!current_terminal.has_foreground_process () && settings.save_exited_tabs) {
25 action_close_tab ();
26
27 return true;
28@@ -303,7 +303,7 @@
29 }
30
31 if (!t.child_has_exited) {
32- if (notebook.n_tabs >= 2) {
33+ if (notebook.n_tabs >= 2 && settings.save_exited_tabs) {
34 make_restorable (tab);
35 } else {
36 t.kill_ps ();
37
38=== modified file 'src/Settings.vala'
39--- src/Settings.vala 2014-03-01 02:19:09 +0000
40+++ src/Settings.vala 2014-04-01 15:04:05 +0000
41@@ -63,6 +63,7 @@
42 public string encoding { get; set; }
43 public string font { get; set; }
44 public bool allow_bold { get; set; }
45+ public bool save_exited_tabs { get; set; }
46 public Granite.Widgets.DynamicNotebook.TabBarBehavior tab_bar_behavior { get; set; }
47
48 public Settings () {

Subscribers

People subscribed via source and target branches