Fanchartview: activate the bookmarks menu

svn: r20306
This commit is contained in:
Benny Malengier 2012-09-01 10:46:47 +00:00
parent c233adcd64
commit 455d077c2c

View File

@ -120,6 +120,12 @@ class FanChartView(NavigationView):
<menuitem action="PrintView"/> <menuitem action="PrintView"/>
</placeholder> </placeholder>
</menu> </menu>
<menu action="BookMenu">
<placeholder name="AddEditBook">
<menuitem action="AddBook"/>
<menuitem action="EditBook"/>
</placeholder>
</menu>
</menubar> </menubar>
<toolbar name="ToolBar"> <toolbar name="ToolBar">
<placeholder name="CommonNavigation"> <placeholder name="CommonNavigation">
@ -155,17 +161,31 @@ class FanChartView(NavigationView):
# Reset everything but rotation angle (leave it as is) # Reset everything but rotation angle (leave it as is)
self.update() self.update()
def _connect_db_signals(self):
"""
Connect database signals.
"""
self._add_db_signal('person-add', self.person_rebuild)
self._add_db_signal('person-update', self.person_rebuild)
self._add_db_signal('person-delete', self.person_rebuild)
self._add_db_signal('person-rebuild', self.person_rebuild_bm)
self._add_db_signal('family-update', self.person_rebuild)
self._add_db_signal('family-add', self.person_rebuild)
self._add_db_signal('family-delete', self.person_rebuild)
self._add_db_signal('family-rebuild', self.person_rebuild)
def change_db(self, db): def change_db(self, db):
self._change_db(db) self._change_db(db)
#self.bookmarks.update_bookmarks(self.dbstate.db.get_bookmarks()) self.bookmarks.update_bookmarks(self.dbstate.db.get_bookmarks())
#if self.active: if self.active:
# self.bookmarks.redraw() self.bookmarks.redraw()
self.update() self.update()
def update(self): def update(self):
self.main() self.main()
def goto_handle(self, handle): def goto_handle(self, handle):
self.change_active(handle)
self.main() self.main()
def have_parents(self, person): def have_parents(self, person):
@ -267,16 +287,21 @@ class FanChartView(NavigationView):
person = self.dbstate.db.get_person_from_handle(person_handle) person = self.dbstate.db.get_person_from_handle(person_handle)
if person: if person:
try: try:
EditPerson(self.dbstate, self.uistate, [], person, EditPerson(self.dbstate, self.uistate, [], person)
callback=self.edit_callback)
except WindowActiveError: except WindowActiveError:
pass pass
return True return True
return False return False
def edit_callback(self, *args): def person_rebuild(self, *args):
self.update() self.update()
def person_rebuild_bm(self, *args):
"""Large change to person database"""
self.person_rebuild()
if self.active:
self.bookmarks.redraw()
def copy_person_to_clipboard_cb(self, obj, person_handle): def copy_person_to_clipboard_cb(self, obj, person_handle):
"""Renders the person data into some lines of text and puts that into the clipboard""" """Renders the person data into some lines of text and puts that into the clipboard"""
person = self.dbstate.db.get_person_from_handle(person_handle) person = self.dbstate.db.get_person_from_handle(person_handle)