* src/Bookmarks.py: Don't use goto submenu

svn: r6446
This commit is contained in:
Don Allingham 2006-04-26 04:24:54 +00:00
parent 839d4f4a6b
commit 50ec018a36
3 changed files with 19 additions and 13 deletions

View File

@ -1,4 +1,5 @@
2006-04-25 Don Allingham <don@gramps-project.org>
* src/Bookmarks.py: Don't use goto submenu
* src/GrampsCfg/py: move and rename tabs, change Prefixes for Formats
* src/ViewManager.py: new config changes, handle exception, enable Edit button
by default

View File

@ -63,8 +63,8 @@ import ListModel
#
#-------------------------------------------------------------------------
_top = '''<ui><menubar name="MenuBar"><menu action="BookMenu"><menu action="GoToBook">'''
_btm = '''</menu></menu></menubar></ui>'''
_top = '''<ui><menubar name="MenuBar"><menu action="BookMenu">'''
_btm = '''</menu></menubar></ui>'''
DISABLED = -1
@ -98,18 +98,23 @@ class Bookmarks :
self.active = DISABLED
actions = []
for item in self.bookmarks:
person = self.dbstate.db.get_person_from_handle(item)
name = NameDisplay.displayer.display(person)
action_id = "BM:%s" % item
f.write('<menuitem action="%s"/>' % action_id)
label = "%s [%s]" % (name,person.gramps_id)
func = make_callback(item,self.dbstate.change_active_handle)
actions.append((action_id,None,label,None,None,func))
count +=1
if len(self.bookmarks) > 0:
f.write('<placeholder name="GoToBook">')
for item in self.bookmarks:
person = self.dbstate.db.get_person_from_handle(item)
name = NameDisplay.displayer.display(person)
action_id = "BM:%s" % item
f.write('<menuitem action="%s"/>' % action_id)
label = "%s [%s]" % (name,person.gramps_id)
func = make_callback(item,self.dbstate.change_active_handle)
actions.append((action_id,None,label,None,None,func))
count +=1
f.write('</placeholder>')
f.write(_btm)
self.action_group.add_actions(actions)
self.uistate.uimanager.insert_action_group(self.action_group,1)
print f.getvalue()
self.active = self.uistate.uimanager.add_ui_from_string(f.getvalue())
f.close()

View File

@ -128,7 +128,8 @@ uidefault = '''<ui>
<menu action="BookMenu">
<menuitem action="AddBook"/>
<menuitem action="EditBook"/>
<menu action="GoToBook"/>
<separator/>
<placeholder name="GoToBook"/>
</menu>
<menu action="ReportsMenu">
</menu>
@ -327,7 +328,6 @@ class ViewManager:
self.add_bookmark),
('EditBook', None, '_Edit bookmarks', '<control>b', None,
self.edit_bookmarks),
('GoToBook', gtk.STOCK_JUMP_TO, '_Go to bookmark'),
('ReportsMenu', None, '_Reports'),
('ToolsMenu', None, '_Tools'),
('WindowsMenu', None, '_Windows'),