From 9744f3ebb64719d6bdd8e6896329addb0b16144f Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Tue, 5 Jan 2010 12:49:57 +0000 Subject: [PATCH] Add keyword arguments to Window.__init__() for command line options --- terminator | 3 ++- terminatorlib/window.py | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/terminator b/terminator index 26fc3502..f79b5577 100755 --- a/terminator +++ b/terminator @@ -51,7 +51,8 @@ if __name__ == '__main__': MAKER = Factory() TERMINATOR = Terminator() - WINDOW = MAKER.make('Window') + WINDOW = MAKER.make('Window', geometry=OPTIONS.geometry, + forcedtitle=OPTIONS.forcedtitle, role=OPTIONS.role) TERMINAL = MAKER.make('Terminal') WINDOW.add(TERMINAL) diff --git a/terminatorlib/window.py b/terminatorlib/window.py index 7e54f0bf..de9d6091 100755 --- a/terminatorlib/window.py +++ b/terminatorlib/window.py @@ -35,7 +35,7 @@ class Window(Container, gtk.Window): zoom_data = None term_zoomed = gobject.property(type=bool, default=False) - def __init__(self): + def __init__(self, geometry=None, forcedtitle=None, role=None): """Class initialiser""" self.terminator = Terminator() self.terminator.register_window(self) @@ -53,6 +53,8 @@ class Window(Container, gtk.Window): self.title = WindowTitle(self) self.title.update() + if forcedtitle is not None: + self.title.force_title(forcedtitle) def register_callbacks(self): """Connect the GTK+ signals we care about""" @@ -125,7 +127,7 @@ class Window(Container, gtk.Window): """Make a new tab""" maker = Factory() if not maker.isinstance(self.get_child(), 'Notebook'): - notebook = maker.make('Notebook', self) + notebook = maker.make('Notebook', window=self) self.get_child().newtab() def on_delete_event(self, window, event, data=None): @@ -310,7 +312,7 @@ class WindowTitle(object): def force_title(self, newtext): """Force a specific title""" if newtext: - self.set_title(newtext) + self.set_title(None, newtext) self.forced = True else: self.forced = False