From 25754d3ab599a17e4b0e92056306d58e4c4b41d0 Mon Sep 17 00:00:00 2001 From: Stephen Boddy Date: Thu, 5 Sep 2013 00:50:12 +0200 Subject: [PATCH] Layouts remember which tab was active now. --- terminatorlib/container.py | 1 + terminatorlib/notebook.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/terminatorlib/container.py b/terminatorlib/container.py index d908dbb1..a581f225 100755 --- a/terminatorlib/container.py +++ b/terminatorlib/container.py @@ -277,6 +277,7 @@ the %s will also close all terminals within it.') % (reqtype, reqtype)) page = self.get_nth_page(tabnum) label = self.get_tab_label(page) labels.append(label.get_custom_label()) + layout['active_page'] = self.get_current_page() if len(labels) > 0: layout['labels'] = labels diff --git a/terminatorlib/notebook.py b/terminatorlib/notebook.py index 7af94c25..4863fa99 100755 --- a/terminatorlib/notebook.py +++ b/terminatorlib/notebook.py @@ -119,6 +119,11 @@ class Notebook(Container, gtk.Notebook): page.create_layout(children[child_key]) num = num + 1 + if layout.has_key('active_page'): + self.set_current_page(int(layout['active_page'])) + else: + self.set_current_page(0) + def split_axis(self, widget, vertical=True, cwd=None, sibling=None, widgetfirst=True): """Split the axis of a terminal inside us""" dbg('called for widget: %s' % widget)