refactor tab creation signals to propagate to the Window of a Terminal, not Terminator

This commit is contained in:
Chris Jones 2010-01-28 12:49:38 +00:00
parent b3435e534f
commit 0817d2651d
4 changed files with 9 additions and 11 deletions

View File

@ -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:

View File

@ -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 = []

View File

@ -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):

View File

@ -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])