Merge lp:~niclasl/pantheon-terminal/fix-duplication into lp:~elementary-apps/pantheon-terminal/trunk

Proposed by David Gomes
Status: Merged
Approved by: Akshay Shekher
Approved revision: 510
Merged at revision: 515
Proposed branch: lp:~niclasl/pantheon-terminal/fix-duplication
Merge into: lp:~elementary-apps/pantheon-terminal/trunk
Diff against target: 35 lines (+8/-2)
1 file modified
src/PantheonTerminalWindow.vala (+8/-2)
To merge this branch: bzr merge lp:~niclasl/pantheon-terminal/fix-duplication
Reviewer Review Type Date Requested Status
Akshay Shekher (community) Approve
David Gomes (community) Approve
Cody Garver (community) Approve
Review via email: mp+182629@code.launchpad.net

Commit message

DynamicNotebook: Fixed duplication bug #1214143.

Description of the change

Fixed DynamicNotebook's duplication for Terminal.

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

open terminal > cd some-directory > open new tab > cd some-other-directory > right click some-directory tab and duplicate it > observe some-other-directory tab is duplicated instead of some-directory

review: Needs Fixing
Revision history for this message
Cody Garver (codygarver) wrote :

Works as expected now.

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

please fix line 22 of the fix
to
var t = (tab.page as Gtk.Grid).get_child_at (0, 0) as TerminalWidget;

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

IIRC there's a variable called current_terminal, can't you use that instead of "(tab.page as Gtk.Grid).get_child_at (0, 0) as TerminalWidget"?

Revision history for this message
Niclas Lockner (niclasl) wrote :

That is what I did at first, but as Cody Garver pointed out above, the path of the current terminal is not necessarily the path of the clicked tab's terminal.

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

Very interesting! I approve then.

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

Good work.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/PantheonTerminalWindow.vala'
2--- src/PantheonTerminalWindow.vala 2013-08-28 13:53:05 +0000
3+++ src/PantheonTerminalWindow.vala 2013-09-04 16:53:16 +0000
4@@ -158,8 +158,9 @@
5
6 notebook.tab_switched.connect (on_switch_page);
7 notebook.tab_moved.connect (on_tab_moved);
8+ notebook.tab_duplicated.connect (on_tab_duplicated);
9 notebook.allow_new_window = true;
10- notebook.allow_duplication = false;
11+ notebook.allow_duplication = true;
12 notebook.margin_top = 3;
13 notebook.group_name = "pantheon-terminal";
14
15@@ -171,7 +172,7 @@
16 });
17
18 notebook.tab_removed.connect ((tab) => {
19- var t = ((tab.page as Gtk.Grid).get_child_at (0, 0) as TerminalWidget);
20+ var t = (tab.page as Gtk.Grid).get_child_at (0, 0) as TerminalWidget;
21
22 if (t.has_foreground_process ()) {
23 var d = new ForegroundProcessDialog ();
24@@ -355,6 +356,11 @@
25 notebook.show_tabs = false;
26 }
27 }
28+
29+ private void on_tab_duplicated (Granite.Widgets.Tab tab) {
30+ var t = (tab.page as Gtk.Grid).get_child_at (0, 0) as TerminalWidget;
31+ new_tab (t.get_shell_location ());
32+ }
33
34 private void update_context_menu () {
35 clipboard.request_targets (update_context_menu_cb);

Subscribers

People subscribed via source and target branches