From 0817d2651d3d15ee748b433bff11eb92d4abae1e Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Thu, 28 Jan 2010 12:49:38 +0000 Subject: [PATCH] refactor tab creation signals to propagate to the Window of a Terminal, not Terminator --- terminatorlib/notebook.py | 3 ++- terminatorlib/paned.py | 3 ++- terminatorlib/terminator.py | 9 ++------- terminatorlib/window.py | 5 +++-- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/terminatorlib/notebook.py b/terminatorlib/notebook.py index 4527eb38..439dbbf1 100755 --- a/terminatorlib/notebook.py +++ b/terminatorlib/notebook.py @@ -116,7 +116,8 @@ class Notebook(Container, gtk.Notebook): 'ungroup-all': top_window.ungroup_all, 'group-tab': top_window.group_tab, 'ungroup-tab': top_window.ungroup_tab, - 'move-tab': top_window.move_tab} + 'move-tab': top_window.move_tab, + 'tab-new': top_window.tab_new} if maker.isinstance(widget, 'Terminal'): for signal in signals: diff --git a/terminatorlib/paned.py b/terminatorlib/paned.py index da812a6f..da59c65f 100755 --- a/terminatorlib/paned.py +++ b/terminatorlib/paned.py @@ -91,7 +91,8 @@ class Paned(Container): 'group-tab': top_window.group_tab, 'ungroup-tab': top_window.ungroup_tab, 'move-tab': top_window.move_tab, - 'maximise': [top_window.zoom, False]} + 'maximise': [top_window.zoom, False], + 'tab-new': top_window.tab_new} for signal in signals: args = [] diff --git a/terminatorlib/terminator.py b/terminatorlib/terminator.py index da8bb7f8..20f8297b 100755 --- a/terminatorlib/terminator.py +++ b/terminatorlib/terminator.py @@ -71,7 +71,6 @@ class Terminator(Borg): self.terminals.append(terminal) terminal.connect('ungroup-all', self.ungroup_all) terminal.connect('navigate', self.navigate_terminal) - terminal.connect('tab-new', self.tab_new) def deregister_terminal(self, terminal): """De-register a terminal widget""" @@ -100,12 +99,6 @@ class Terminator(Borg): for terminal in self.terminals: terminal.reconfigure() - def tab_new(self, terminal): - """A terminal asked for a new tab. This function is an indirection - to the Window object""" - window = get_top_window(terminal) - window.tab_new() - def navigate_terminal(self, terminal, direction): """Nagivate around the terminals""" current = self.terminals.index(terminal) @@ -250,10 +243,12 @@ class Terminator(Borg): def group_tab(self, widget): """Group all the terminals in a tab""" + # FIXME: Implement or drop pass def ungroup_tab(self, widget): """Ungroup all the terminals in a tab""" + # FIXME: Implement or drop pass def focus_changed(self, widget): diff --git a/terminatorlib/window.py b/terminatorlib/window.py index ef711922..ba153ee7 100755 --- a/terminatorlib/window.py +++ b/terminatorlib/window.py @@ -157,7 +157,7 @@ class Window(Container, gtk.Window): maker = Factory() return(maker.isinstance(self.get_child(), 'Notebook')) - def tab_new(self): + def tab_new(self, widget=None): """Make a new tab""" maker = Factory() if not self.is_child_notebook(): @@ -260,7 +260,8 @@ class Window(Container, gtk.Window): 'ungroup-all': self.ungroup_all, 'group-tab': self.group_tab, 'ungroup-tab': self.ungroup_tab, - 'move-tab': self.move_tab} + 'move-tab': self.move_tab, + 'tab-new': self.tab_new} for signal in signals: self.connect_child(widget, signal, signals[signal])