From be224f301667376bd93d7490fd3e1ee1ecb2104a Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Mon, 4 Jan 2010 13:11:16 +0000 Subject: [PATCH] Undo previous change that had Factory registering windows and terminals. Instead make them self-register since they already have a Terminator reference anyway. Remove calls to register_terminla from elsewhere. --- terminatorlib/factory.py | 12 ++---------- terminatorlib/notebook.py | 4 +--- terminatorlib/paned.py | 1 - terminatorlib/terminal.py | 2 ++ terminatorlib/window.py | 1 - 5 files changed, 5 insertions(+), 15 deletions(-) diff --git a/terminatorlib/factory.py b/terminatorlib/factory.py index 19390713..b75832a9 100755 --- a/terminatorlib/factory.py +++ b/terminatorlib/factory.py @@ -49,20 +49,12 @@ class Factory(Borg): def make_window(self, *args): """Make a Window""" import window - from newterminator import Terminator - terminator = Terminator() - product = window.Window() - terminator.register_window(product) - return(product) + return(window.Window()) def make_terminal(self, *args): """Make a Terminal""" import terminal - from newterminator import Terminator - terminator = Terminator() - product = terminal.Terminal() - terminator.register_terminal(product) - return(product) + return(terminal.Terminal()) def make_hpaned(self, *args): """Make an HPaned""" diff --git a/terminatorlib/notebook.py b/terminatorlib/notebook.py index 4eb69e10..85fd0d14 100755 --- a/terminatorlib/notebook.py +++ b/terminatorlib/notebook.py @@ -68,7 +68,6 @@ class Notebook(Container, gtk.Notebook): if not sibling: sibling = maker.make('terminal') - self.terminator.register_terminal(sibling) sibling.spawn_child() self.insert_page(container, None, page_num) @@ -100,8 +99,7 @@ class Notebook(Container, gtk.Notebook): """Add a new tab, optionally supplying a child widget""" if not widget: maker = Factory() - widget = maker.make('terminal') - self.terminator.register_terminal(widget) + widget = maker.make('Terminal') widget.spawn_child() signals = {'close-term': self.wrapcloseterm, diff --git a/terminatorlib/paned.py b/terminatorlib/paned.py index 8a6c9588..47200b7a 100755 --- a/terminatorlib/paned.py +++ b/terminatorlib/paned.py @@ -53,7 +53,6 @@ class Paned(Container): if not sibling: sibling = maker.make('terminal') - self.terminator.register_terminal(sibling) sibling.spawn_child() self.add(container) diff --git a/terminatorlib/terminal.py b/terminatorlib/terminal.py index 45c20371..5c732567 100755 --- a/terminatorlib/terminal.py +++ b/terminatorlib/terminal.py @@ -87,6 +87,8 @@ class Terminal(gtk.VBox): self.__gobject_init__() self.terminator = Terminator() + self.terminator.register_terminal(self) + self.connect('enumerate', self.terminator.do_enumerate) self.connect('group-tab', self.terminator.group_tab) self.connect('ungroup-tab', self.terminator.ungroup_tab) diff --git a/terminatorlib/window.py b/terminatorlib/window.py index 9a536b06..7e54f0bf 100755 --- a/terminatorlib/window.py +++ b/terminatorlib/window.py @@ -237,7 +237,6 @@ class Window(Container, gtk.Window): if not sibling: sibling = maker.make('Terminal') - self.terminator.register_terminal(sibling) self.add(container) container.show_all()