Merge lp:~jeremywootten/pantheon-files/stop-close-last-tab into lp:~elementary-apps/pantheon-files/trunk

Proposed by Jeremy Wootten
Status: Merged
Approved by: Cody Garver
Approved revision: 1502
Merged at revision: 1502
Proposed branch: lp:~jeremywootten/pantheon-files/stop-close-last-tab
Merge into: lp:~elementary-apps/pantheon-files/trunk
Diff against target: 27 lines (+8/-2)
1 file modified
src/View/Window.vala (+8/-2)
To merge this branch: bzr merge lp:~jeremywootten/pantheon-files/stop-close-last-tab
Reviewer Review Type Date Requested Status
David Gomes (community) Needs Fixing
Review via email: mp+219959@code.launchpad.net

Commit message

Ensure new tab is created if last tab is closed to fix bug #1320602.

This makes the behaviour of Ctrl-W and the associated menu item the same as clicking on the close button of a tab, i.e. if the tab is the last one open then a new tab is made showing the users home folder.

Description of the change

This branch makes the behaviour of Ctrl-W and the associated menu item the same as clicking on the close button of a tab, i.e. if the tab is the last one open then a new tab is made showing the users home folder.

To post a comment you must log in.
Revision history for this message
David Gomes (davidgomes) wrote :

I'd rename real_remove_tab to actual_remove_tab, it's more symbolic. Other than that, the code is fine I'll just have to test it.

review: Needs Fixing
Revision history for this message
David Gomes (davidgomes) wrote :

I confirm it works.

1502. By Jeremy Wootten

Change real_remove_tab to actual_remove_tab

Revision history for this message
Jeremy Wootten (jeremywootten) wrote :

Function name changed as advised.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/View/Window.vala'
2--- src/View/Window.vala 2014-05-13 21:10:32 +0000
3+++ src/View/Window.vala 2014-05-18 16:10:16 +0000
4@@ -370,7 +370,13 @@
5 }
6
7 public void remove_tab (ViewContainer view_container) {
8- var tab = tabs.get_tab_by_widget (view_container as Gtk.Widget);
9+ actual_remove_tab (tabs.get_tab_by_widget (view_container as Gtk.Widget));
10+ }
11+
12+ private void actual_remove_tab (Granite.Widgets.Tab tab) {
13+ /* signal for restore_data to be set and a new tab to be created if this is last tab */
14+ tabs.close_tab_requested (tab);
15+ /* now close the tab */
16 tab.close ();
17 }
18
19@@ -425,7 +431,7 @@
20 }
21
22 private void action_remove_tab (Gtk.Action action) {
23- tabs.remove_tab (tabs.current);
24+ actual_remove_tab (tabs.current);
25 }
26
27 private void save_geometries () {

Subscribers

People subscribed via source and target branches

to all changes: