From cfcd1e4b62cabc3863806ba757fd053c4b836a41 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Wed, 3 May 2006 22:21:59 +0000 Subject: [PATCH] sidebar-text option svn: r6534 --- gramps2/ChangeLog | 6 ++++++ gramps2/data/gramps.schemas.in | 12 ++++++++++++ gramps2/src/Config/_GrampsConfigKeys.py | 2 ++ gramps2/src/Config/_GrampsGconfKeys.py | 2 +- gramps2/src/Config/gen_schema_keys.py | 2 +- gramps2/src/Filters/Rules/Person/Makefile.am | 2 -- gramps2/src/GrampsCfg.py | 4 ++++ gramps2/src/ViewManager.py | 17 ++++++++++++----- 8 files changed, 38 insertions(+), 9 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 3fa430f55..bbbfcae3c 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,4 +1,10 @@ 2006-05-03 Don Allingham + * src/ViewManager.py: Optionally exclude text from buttons + * src/GrampsCfg.py: add SIDEBAR_TEXT option + * src/GrampsConfigKeys.py: add SIDEBAR_TEXT option + * data/gramps.schemas.in: add SIDEBAR_TEXT option + * src/GrampsGconfKeys.py: handle None returned by routines properly + * src/Filters/Rules/Person/Makefile.am: remove unused files * src/DataViews/_FamilyView.py: update on db change * src/DataViews/_FamilyList.py: Move ColumnEdit local * src/ViewManager.py: remove ColumnEdit, make local diff --git a/gramps2/data/gramps.schemas.in b/gramps2/data/gramps.schemas.in index fac559c75..4723af470 100644 --- a/gramps2/data/gramps.schemas.in +++ b/gramps2/data/gramps.schemas.in @@ -570,6 +570,18 @@ + + /schemas/apps/gramps/interface/sidebar-text + /apps/gramps/interface/sidebar-text + gramps + bool + 1 + + Include text on sidebar buttons + If set to True, the Sidebar buttons will contain a text description of the view, otherwise it will only display the button. + + + /schemas/apps/gramps/paths/website-directory /apps/gramps/paths/website-directory diff --git a/gramps2/src/Config/_GrampsConfigKeys.py b/gramps2/src/Config/_GrampsConfigKeys.py index 637225f8a..607dbaa97 100644 --- a/gramps2/src/Config/_GrampsConfigKeys.py +++ b/gramps2/src/Config/_GrampsConfigKeys.py @@ -43,6 +43,7 @@ USE_LDS = ('behavior','use-lds', 0) USE_TIPS = ('behavior','use-tips', 0) POP_PLUGIN_STATUS = ('behavior','pop-plugin-status', 0) VIEW = ('interface','view', 0) +SIDEBAR_TEXT = ('interface','sidebar-text', 0) WEBSITE_DIRECTORY = ('paths','website-directory', 2) @@ -92,5 +93,6 @@ default_value = { USE_TIPS : False, POP_PLUGIN_STATUS : False, VIEW : True, + SIDEBAR_TEXT : True, WEBSITE_DIRECTORY : './', } diff --git a/gramps2/src/Config/_GrampsGconfKeys.py b/gramps2/src/Config/_GrampsGconfKeys.py index 091374d01..fe91d1c08 100644 --- a/gramps2/src/Config/_GrampsGconfKeys.py +++ b/gramps2/src/Config/_GrampsGconfKeys.py @@ -92,7 +92,7 @@ def get(key): val = get_int(token) else: val = get_string(token) - if not val: + if val == None: val = default_value[key] return val diff --git a/gramps2/src/Config/gen_schema_keys.py b/gramps2/src/Config/gen_schema_keys.py index d1edb5826..ac07fa8a3 100644 --- a/gramps2/src/Config/gen_schema_keys.py +++ b/gramps2/src/Config/gen_schema_keys.py @@ -83,7 +83,7 @@ if __name__ == "__main__": parser = SchemaHandler() parser.parse(sys.argv[1]) - f = open("_GrampsConfigKeys","w") + f = open("_GrampsConfigKeys.py","w") for (key, key_type, default, long, short, include) in parser.list: data = key.split('/') diff --git a/gramps2/src/Filters/Rules/Person/Makefile.am b/gramps2/src/Filters/Rules/Person/Makefile.am index 70c5c6ed3..fb75cf8a0 100644 --- a/gramps2/src/Filters/Rules/Person/Makefile.am +++ b/gramps2/src/Filters/Rules/Person/Makefile.am @@ -56,8 +56,6 @@ pkgdata_PYTHON = \ _PersonWithIncompleteEvent.py \ _ProbablyAlive.py \ _RelationshipPathBetween.py \ - _Rule.py \ - _RuleUtils.py \ _SearchName.py \ __init__.py diff --git a/gramps2/src/GrampsCfg.py b/gramps2/src/GrampsCfg.py index f2a19224c..1d645868f 100644 --- a/gramps2/src/GrampsCfg.py +++ b/gramps2/src/GrampsCfg.py @@ -205,6 +205,7 @@ class GrampsPreferences(ManagedWindow.ManagedWindow): for item in formats: obox.append_text(item) active = Config.get(Config.STATUSBAR) + if active < 2: obox.set_active(0) else: @@ -215,6 +216,9 @@ class GrampsPreferences(ManagedWindow.ManagedWindow): lwidget = BasicLabel("%s: " % _('Status bar')) table.attach(lwidget, 0, 1, 2, 3, yoptions=0) table.attach(obox, 1, 3, 2, 3, yoptions=0) + + self.add_checkbox(table, _("Show text in sidebar buttons (takes effect on restart)"), + 4, Config.SIDEBAR_TEXT) return table diff --git a/gramps2/src/ViewManager.py b/gramps2/src/ViewManager.py index e9c0fb59d..0386ba14b 100644 --- a/gramps2/src/ViewManager.py +++ b/gramps2/src/ViewManager.py @@ -528,6 +528,8 @@ class ViewManager: def create_pages(self): self.pages = [] self.prev_nav = PageView.NAVIGATION_NONE + + use_text = Config.get(Config.SIDEBAR_TEXT) index = 0 for page_def in self.views: @@ -552,11 +554,17 @@ class ViewManager: # create the button and add it to the sidebar button = gtk.ToggleButton() - if page_stock: - button.set_use_stock(True) - button.set_label(page_stock) + if use_text: + if page_stock: + button.set_use_stock(True) + button.set_label(page_stock) + else: + button.set_label(page_title) else: - button.set_label(page_title) + image = gtk.Image() + image.set_from_stock(page_stock, gtk.ICON_SIZE_LARGE_TOOLBAR) + image.show() + button.add(image) button.set_border_width(4) button.set_relief(gtk.RELIEF_NONE) button.set_alignment(0, 0.5) @@ -602,7 +610,6 @@ class ViewManager: self.active_page.set_active() Config.set(Config.LAST_VIEW,num) Config.sync() - print "Saved as",Config.get(Config.LAST_VIEW) old_nav = self._navigation_type[self.prev_nav] if old_nav[0] != None: