From b7e6d2f149b00127e230b5ee172b7672f80b2970 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 --- ChangeLog | 6 ++++++ data/gramps.schemas.in | 12 ++++++++++++ src/Config/_GrampsConfigKeys.py | 2 ++ src/Config/_GrampsGconfKeys.py | 2 +- src/Config/gen_schema_keys.py | 2 +- src/Filters/Rules/Person/Makefile.am | 2 -- src/GrampsCfg.py | 4 ++++ src/ViewManager.py | 17 ++++++++++++----- 8 files changed, 38 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3fa430f55..bbbfcae3c 100644 --- a/ChangeLog +++ b/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/data/gramps.schemas.in b/data/gramps.schemas.in index fac559c75..4723af470 100644 --- a/data/gramps.schemas.in +++ b/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/src/Config/_GrampsConfigKeys.py b/src/Config/_GrampsConfigKeys.py index 637225f8a..607dbaa97 100644 --- a/src/Config/_GrampsConfigKeys.py +++ b/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/src/Config/_GrampsGconfKeys.py b/src/Config/_GrampsGconfKeys.py index 091374d01..fe91d1c08 100644 --- a/src/Config/_GrampsGconfKeys.py +++ b/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/src/Config/gen_schema_keys.py b/src/Config/gen_schema_keys.py index d1edb5826..ac07fa8a3 100644 --- a/src/Config/gen_schema_keys.py +++ b/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/src/Filters/Rules/Person/Makefile.am b/src/Filters/Rules/Person/Makefile.am index 70c5c6ed3..fb75cf8a0 100644 --- a/src/Filters/Rules/Person/Makefile.am +++ b/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/src/GrampsCfg.py b/src/GrampsCfg.py index f2a19224c..1d645868f 100644 --- a/src/GrampsCfg.py +++ b/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/src/ViewManager.py b/src/ViewManager.py index e9c0fb59d..0386ba14b 100644 --- a/src/ViewManager.py +++ b/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: