Merge lp:~xapantu/pantheon-terminal/fix-1157350tab-crash into lp:~elementary-apps/pantheon-terminal/trunk

Proposed by xapantu
Status: Merged
Approved by: Mario Guerriero
Approved revision: 488
Merged at revision: 486
Proposed branch: lp:~xapantu/pantheon-terminal/fix-1157350tab-crash
Merge into: lp:~elementary-apps/pantheon-terminal/trunk
Diff against target: 68 lines (+10/-12)
2 files modified
src/PantheonTerminal.vala (+2/-1)
src/PantheonTerminalWindow.vala (+8/-11)
To merge this branch: bzr merge lp:~xapantu/pantheon-terminal/fix-1157350tab-crash
Reviewer Review Type Date Requested Status
elementary Apps team Pending
Review via email: mp+169689@code.launchpad.net
To post a comment you must log in.
487. By xapantu

Change to use the new granite API
Avoid a warning while getting the current_terminal window title

488. By xapantu

Internal API simplification and code cleanup

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/PantheonTerminal.vala'
2--- src/PantheonTerminal.vala 2013-06-11 18:50:20 +0000
3+++ src/PantheonTerminal.vala 2013-06-16 16:32:26 +0000
4@@ -138,11 +138,12 @@
5 add_window (window);
6 }
7
8- public void new_window_with_coords (int x, int y, bool should_recreate_tabs=true) {
9+ public PantheonTerminalWindow new_window_with_coords (int x, int y, bool should_recreate_tabs=true) {
10 var window = new PantheonTerminalWindow.with_coords (this, x, y, should_recreate_tabs);
11 window.show ();
12 windows.append (window);
13 add_window (window);
14+ return window;
15 }
16
17 public void new_window_with_programs (string[] programs) {
18
19=== modified file 'src/PantheonTerminalWindow.vala'
20--- src/PantheonTerminalWindow.vala 2013-06-12 02:40:32 +0000
21+++ src/PantheonTerminalWindow.vala 2013-06-16 16:32:26 +0000
22@@ -148,9 +148,10 @@
23 notebook.show_icons = false;
24 notebook.tab_switched.connect (on_switch_page);
25 notebook.tab_moved.connect (on_tab_moved);
26- notebook.allow_new_window = false;
27+ notebook.allow_new_window = true;
28 notebook.allow_duplication = false;
29 notebook.margin_top = 3;
30+ notebook.group_name = "pantheon-terminal";
31
32 notebook.tab_added.connect ((tab) => {
33 new_tab ("", tab);
34@@ -297,21 +298,17 @@
35
36 private void on_tab_moved (Granite.Widgets.Tab tab, int new_pos, bool new_window, int x, int y) {
37 if (new_window) {
38- app.new_window_with_coords (x, y, false);
39- var win = app.windows.last ().data;
40- //win.move (x, y);
41+ var win = app.new_window_with_coords (x, y, false);
42+
43+ notebook.remove_tab (tab, /* force */ true);
44
45 var n = win.notebook;
46- //remove the one automatically created after inserting
47 n.insert_tab (tab, -1);
48- n.remove_tab (n.tabs.nth_data (1));
49-
50- //notebook.remove_tab (tab);
51- if (notebook.n_tabs == 0)
52- destroy ();
53 } else {
54 current_terminal.grab_focus ();
55 }
56+ if (notebook.n_tabs == 0)
57+ destroy ();
58 }
59
60 private void update_context_menu () {
61@@ -361,7 +358,7 @@
62 void on_switch_page (Granite.Widgets.Tab? old, Granite.Widgets.Tab new_tab) {
63 current_tab = new_tab;
64 current_terminal = ((Grid) new_tab.page).get_child_at (0, 0) as TerminalWidget;
65- title = current_terminal.window_title;
66+ title = current_terminal.window_title ?? "";
67 new_tab.page.grab_focus ();
68 }
69

Subscribers

People subscribed via source and target branches