From fc9b50850e889b49498feaa9f28ffbdec48f78dc Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Thu, 25 Sep 2008 22:22:05 +0100 Subject: [PATCH] only try to switch pages in a notebook if we actually have one. Not a fix for, but somewhat workaround for the crashing aspect of LP #271850 --- terminatorlib/terminator.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/terminatorlib/terminator.py b/terminatorlib/terminator.py index f8043665..1c2f01af 100755 --- a/terminatorlib/terminator.py +++ b/terminatorlib/terminator.py @@ -856,16 +856,18 @@ class Terminator: def previous_tab(self, term): notebook = self.get_first_parent_notebook(term) - notebook.prev_page() - # This seems to be required in some versions of (py)gtk. - # Without it, the selection changes, but the displayed page doesn't change - # Seen in gtk-2.12.11 and pygtk-2.12.1 at least. - notebook.set_current_page(notebook.get_current_page()) + if notebook: + notebook.prev_page() + # This seems to be required in some versions of (py)gtk. + # Without it, the selection changes, but the displayed page doesn't change + # Seen in gtk-2.12.11 and pygtk-2.12.1 at least. + notebook.set_current_page(notebook.get_current_page()) def next_tab(self, term): notebook = self.get_first_parent_notebook(term) - notebook.next_page() - notebook.set_current_page(notebook.get_current_page()) + if notebook: + notebook.next_page() + notebook.set_current_page(notebook.get_current_page()) def move_tab(self, term, direction): dbg("moving to direction %s" % direction)