From 613125aa70dd49239f82d01caab5c4cdcd06915a Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Sun, 8 Jan 2006 03:06:58 +0000 Subject: [PATCH] * src/ToolTips.py: fix spacing * src/ViewManager.py: remember toolbar/sidebar status. svn: r5692 --- gramps2/ChangeLog | 2 ++ gramps2/src/ToolTips.py | 10 +++++----- gramps2/src/ViewManager.py | 36 ++++++++++++++++++++++++++++++++++-- 3 files changed, 41 insertions(+), 7 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 893409b6a..c996f7514 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,4 +1,6 @@ 2006-01-07 Don Allingham + * src/ToolTips.py: fix spacing + * src/ViewManager.py: remember toolbar/sidebar status. * src/FamilyView.py: fix gtk.Table's bizzare way of handling empty columns that are spanned. * src/GrampsLogger/_ErrorView.py: make dialog more HIG compliant diff --git a/gramps2/src/ToolTips.py b/gramps2/src/ToolTips.py index da0bae1c1..048e44f2b 100644 --- a/gramps2/src/ToolTips.py +++ b/gramps2/src/ToolTips.py @@ -186,9 +186,9 @@ class PersonTip: if date_str != "": birth_str = escape(date_str) - s = "%s\n\n"\ - "\t%s:\t%s\n"\ - "\t%s:\t%s\n" % ( + s = "%s\n"\ + " %s: %s\n"\ + " %s: %s\n" % ( _("Person"), _("Name"),escape(self._obj.get_primary_name().get_name()), _("Birth"),birth_str) @@ -198,8 +198,8 @@ class PersonTip: psrc_id = psrc_ref.get_base_handle() psrc = self._db.get_source_from_handle(psrc_id) - s += "\n%s\n\n"\ - "\t%s:\t%s\n" % ( + s += "\n%s\n"\ + " %s: %s\n" % ( _("Primary source"), _("Name"), escape(short(psrc.get_title()))) diff --git a/gramps2/src/ViewManager.py b/gramps2/src/ViewManager.py index 707384bc7..867ba64b8 100644 --- a/gramps2/src/ViewManager.py +++ b/gramps2/src/ViewManager.py @@ -62,6 +62,7 @@ import NameDisplay import Tool import Report import GrampsMime +import GrampsKeys #------------------------------------------------------------------------- # @@ -102,6 +103,7 @@ uidefault = ''' + @@ -184,6 +186,13 @@ class ViewManager: hbox.pack_start(self.ebox,False) hbox.show_all() + self.show_sidebar = GrampsKeys.get_view() + if self.show_sidebar == None: + self.show_sidebar = True + self.show_toolbar = GrampsKeys.get_toolbar() + if self.show_toolbar == None: + self.show_toolbar = True + self.notebook = gtk.Notebook() self.notebook.set_show_tabs(False) self.notebook.show() @@ -223,8 +232,21 @@ class ViewManager: self.recent_manager = DisplayState.RecentDocsMenu(self.uistate,self.state, self.read_file) self.recent_manager.build() + self.window.show() + if self.show_sidebar: + self.ebox.show() + self.notebook.set_show_tabs(False) + else: + self.ebox.hide() + self.notebook.set_show_tabs(True) + + if self.show_toolbar: + self.toolbar.show() + else: + self.toolbar.hide() + def init_interface(self): self.create_pages() self.change_page(None,None) @@ -319,8 +341,12 @@ class ViewManager: ]) self.fileactions.add_toggle_actions([ - ('Sidebar', None, '_Sidebar', None, None, self.sidebar_toggle), - ('Toolbar', None, '_Toolbar', None, None, self.toolbar_toggle), + ('Sidebar', None, '_Sidebar', None, None, self.sidebar_toggle, + self.show_sidebar + ), + ('Toolbar', None, '_Toolbar', None, None, self.toolbar_toggle, + self.show_toolbar + ), ]) merge_id = self.uimanager.add_ui_from_string(uidefault) @@ -384,15 +410,21 @@ class ViewManager: if obj.get_active(): self.ebox.show() self.notebook.set_show_tabs(False) + GrampsKeys.save_view(True) else: self.ebox.hide() self.notebook.set_show_tabs(True) + GrampsKeys.save_view(False) + GrampsKeys.sync() def toolbar_toggle(self,obj): if obj.get_active(): self.toolbar.show() + GrampsKeys.save_toolbar(True) else: self.toolbar.hide() + GrampsKeys.save_toolbar(False) + GrampsKeys.sync() def register_view(self, view): self.views.append(view)