sidebar-text option

svn: r6534
This commit is contained in:
Don Allingham 2006-05-03 22:21:59 +00:00
parent 15c3aee386
commit cfcd1e4b62
8 changed files with 38 additions and 9 deletions

View File

@ -1,4 +1,10 @@
2006-05-03 Don Allingham <don@gramps-project.org>
* 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

View File

@ -570,6 +570,18 @@
</locale>
</schema>
<schema>
<key>/schemas/apps/gramps/interface/sidebar-text</key>
<applyto>/apps/gramps/interface/sidebar-text</applyto>
<owner>gramps</owner>
<type>bool</type>
<default>1</default>
<locale name="C">
<short>Include text on sidebar buttons</short>
<long>If set to True, the Sidebar buttons will contain a text description of the view, otherwise it will only display the button.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gramps/paths/website-directory</key>
<applyto>/apps/gramps/paths/website-directory</applyto>

View File

@ -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 : './',
}

View File

@ -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

View File

@ -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('/')

View File

@ -56,8 +56,6 @@ pkgdata_PYTHON = \
_PersonWithIncompleteEvent.py \
_ProbablyAlive.py \
_RelationshipPathBetween.py \
_Rule.py \
_RuleUtils.py \
_SearchName.py \
__init__.py

View File

@ -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

View File

@ -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: