From a323f924826d099f32141882acc71e68020f3b2f Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Tue, 15 Jan 2013 22:30:18 +0000 Subject: [PATCH] Tidy up bookmark code svn: r21139 --- gramps/gui/views/bookmarks.py | 94 ++++++++++++++++--------- gramps/gui/views/listview.py | 5 +- gramps/gui/views/navigationview.py | 5 +- gramps/plugins/lib/libpersonview.py | 8 +-- gramps/plugins/lib/libplaceview.py | 4 -- gramps/plugins/lib/maps/geography.py | 3 +- gramps/plugins/view/citationlistview.py | 4 -- gramps/plugins/view/citationtreeview.py | 4 -- gramps/plugins/view/eventview.py | 8 +-- gramps/plugins/view/familyview.py | 5 +- gramps/plugins/view/fanchartdescview.py | 2 - gramps/plugins/view/fanchartview.py | 2 - gramps/plugins/view/geoclose.py | 7 -- gramps/plugins/view/geoevents.py | 7 -- gramps/plugins/view/geofamclose.py | 7 -- gramps/plugins/view/geofamily.py | 7 -- gramps/plugins/view/geomoves.py | 7 -- gramps/plugins/view/geoperson.py | 7 -- gramps/plugins/view/geoplaces.py | 7 -- gramps/plugins/view/mediaview.py | 8 +-- gramps/plugins/view/noteview.py | 7 -- gramps/plugins/view/pedigreeview.py | 5 +- gramps/plugins/view/relview.py | 2 - gramps/plugins/view/repoview.py | 4 -- gramps/plugins/view/sourceview.py | 4 -- 25 files changed, 71 insertions(+), 152 deletions(-) diff --git a/gramps/gui/views/bookmarks.py b/gramps/gui/views/bookmarks.py index 898042711..09be7c0b0 100644 --- a/gramps/gui/views/bookmarks.py +++ b/gramps/gui/views/bookmarks.py @@ -82,7 +82,7 @@ DISABLED = -1 class Bookmarks : "Handle the bookmarks interface for Gramps." - def __init__(self, dbstate, uistate, bookmarks, callback=None): + def __init__(self, dbstate, uistate, callback=None): """ Create the bookmark editor. @@ -92,7 +92,8 @@ class Bookmarks : """ self.dbstate = dbstate self.uistate = uistate - self.bookmarks = bookmarks + self.bookmarks = None + self.update_bookmarks() self.active = DISABLED self.action_group = Gtk.ActionGroup('Bookmarks') self.connect_signals() @@ -103,6 +104,7 @@ class Bookmarks : Reconnect the signals on a database changed. """ self.connect_signals() + self.update_bookmarks() def connect_signals(self): """ @@ -110,11 +112,17 @@ class Bookmarks : """ raise NotImplementedError - def update_bookmarks(self, bookmarks): + def get_bookmarks(self): + """ + Retrieve bookmarks from the database. + """ + raise NotImplementedError + + def update_bookmarks(self): """ Assign bookmarks """ - self.bookmarks = bookmarks + self.bookmarks = self.get_bookmarks() def display(self): """ @@ -306,9 +314,9 @@ class Bookmarks : class ListBookmarks(Bookmarks): - def __init__(self, dbstate, uistate, bookmarks, goto_handle): + def __init__(self, dbstate, uistate, goto_handle): self.goto_handle = goto_handle - Bookmarks.__init__(self, dbstate, uistate, bookmarks) + Bookmarks.__init__(self, dbstate, uistate) def callback(self, handle): return make_callback(handle, self.do_callback) @@ -319,9 +327,8 @@ class ListBookmarks(Bookmarks): class PersonBookmarks(ListBookmarks) : "Handle the bookmarks interface for Gramps." - def __init__(self, dbstate, uistate, bookmarks, goto_handle): - ListBookmarks.__init__(self, dbstate, uistate, bookmarks, - goto_handle) + def __init__(self, dbstate, uistate, goto_handle): + ListBookmarks.__init__(self, dbstate, uistate, goto_handle) def make_label(self, handle): return navigation_label(self.dbstate.db, 'Person', handle) @@ -329,12 +336,14 @@ class PersonBookmarks(ListBookmarks) : def connect_signals(self): self.dbstate.db.connect('person-delete', self.remove_handles) + def get_bookmarks(self): + return self.dbstate.db.get_bookmarks() + class FamilyBookmarks(ListBookmarks) : "Handle the bookmarks interface for Gramps." - def __init__(self, dbstate, uistate, bookmarks, goto_handle): - ListBookmarks.__init__(self, dbstate, uistate, bookmarks, - goto_handle) + def __init__(self, dbstate, uistate, goto_handle): + ListBookmarks.__init__(self, dbstate, uistate, goto_handle) def make_label(self, handle): return navigation_label(self.dbstate.db, 'Family', handle) @@ -342,12 +351,14 @@ class FamilyBookmarks(ListBookmarks) : def connect_signals(self): self.dbstate.db.connect('family-delete', self.remove_handles) + def get_bookmarks(self): + return self.dbstate.db.get_family_bookmarks() + class EventBookmarks(ListBookmarks) : "Handle the bookmarks interface for Gramps." - def __init__(self, dbstate, uistate, bookmarks, goto_handle): - ListBookmarks.__init__(self, dbstate, uistate, bookmarks, - goto_handle) + def __init__(self, dbstate, uistate, goto_handle): + ListBookmarks.__init__(self, dbstate, uistate, goto_handle) def make_label(self, handle): return navigation_label(self.dbstate.db, 'Event', handle) @@ -355,11 +366,14 @@ class EventBookmarks(ListBookmarks) : def connect_signals(self): self.dbstate.db.connect('event-delete', self.remove_handles) + def get_bookmarks(self): + return self.dbstate.db.get_event_bookmarks() + class SourceBookmarks(ListBookmarks) : "Handle the bookmarks interface for Gramps." - def __init__(self, dbstate, uistate, bookmarks, goto_handle): - ListBookmarks.__init__(self, dbstate, uistate, bookmarks, - goto_handle) + + def __init__(self, dbstate, uistate, goto_handle): + ListBookmarks.__init__(self, dbstate, uistate, goto_handle) def make_label(self, handle): return navigation_label(self.dbstate.db, 'Source', handle) @@ -367,11 +381,14 @@ class SourceBookmarks(ListBookmarks) : def connect_signals(self): self.dbstate.db.connect('source-delete', self.remove_handles) + def get_bookmarks(self): + return self.dbstate.db.get_source_bookmarks() + class CitationBookmarks(ListBookmarks) : "Handle the bookmarks interface for Gramps." - def __init__(self, dbstate, uistate, bookmarks, goto_handle): - ListBookmarks.__init__(self, dbstate, uistate, bookmarks, - goto_handle) + + def __init__(self, dbstate, uistate, goto_handle): + ListBookmarks.__init__(self, dbstate, uistate, goto_handle) def make_label(self, handle): return navigation_label(self.dbstate.db, 'Citation', handle) @@ -379,12 +396,14 @@ class CitationBookmarks(ListBookmarks) : def connect_signals(self): self.dbstate.db.connect('citation-delete', self.remove_handles) + def get_bookmarks(self): + return self.dbstate.db.get_citation_bookmarks() + class MediaBookmarks(ListBookmarks) : "Handle the bookmarks interface for Gramps." - def __init__(self, dbstate, uistate, bookmarks, goto_handle): - ListBookmarks.__init__(self, dbstate, uistate, bookmarks, - goto_handle) + def __init__(self, dbstate, uistate, goto_handle): + ListBookmarks.__init__(self, dbstate, uistate, goto_handle) def make_label(self, handle): return navigation_label(self.dbstate.db, 'Media', handle) @@ -392,12 +411,14 @@ class MediaBookmarks(ListBookmarks) : def connect_signals(self): self.dbstate.db.connect('media-delete', self.remove_handles) + def get_bookmarks(self): + return self.dbstate.db.get_media_bookmarks() + class RepoBookmarks(ListBookmarks) : "Handle the bookmarks interface for Gramps." - def __init__(self, dbstate, uistate, bookmarks, goto_handle): - ListBookmarks.__init__(self, dbstate, uistate, bookmarks, - goto_handle) + def __init__(self, dbstate, uistate, goto_handle): + ListBookmarks.__init__(self, dbstate, uistate, goto_handle) def make_label(self, handle): return navigation_label(self.dbstate.db, 'Repository', handle) @@ -405,12 +426,14 @@ class RepoBookmarks(ListBookmarks) : def connect_signals(self): self.dbstate.db.connect('repository-delete', self.remove_handles) + def get_bookmarks(self): + return self.dbstate.db.get_repo_bookmarks() + class PlaceBookmarks(ListBookmarks) : "Handle the bookmarks interface for Gramps." - def __init__(self, dbstate, uistate, bookmarks, goto_handle): - ListBookmarks.__init__(self, dbstate, uistate, bookmarks, - goto_handle) + def __init__(self, dbstate, uistate, goto_handle): + ListBookmarks.__init__(self, dbstate, uistate, goto_handle) def make_label(self, handle): return navigation_label(self.dbstate.db, 'Place', handle) @@ -418,12 +441,14 @@ class PlaceBookmarks(ListBookmarks) : def connect_signals(self): self.dbstate.db.connect('place-delete', self.remove_handles) + def get_bookmarks(self): + return self.dbstate.db.get_place_bookmarks() + class NoteBookmarks(ListBookmarks) : "Handle the bookmarks interface for Gramps." - def __init__(self, dbstate, uistate, bookmarks, goto_handle): - ListBookmarks.__init__(self, dbstate, uistate, bookmarks, - goto_handle) + def __init__(self, dbstate, uistate, goto_handle): + ListBookmarks.__init__(self, dbstate, uistate, goto_handle) def make_label(self, handle): return navigation_label(self.dbstate.db, 'Note', handle) @@ -431,6 +456,9 @@ class NoteBookmarks(ListBookmarks) : def connect_signals(self): self.dbstate.db.connect('note-delete', self.remove_handles) + def get_bookmarks(self): + return self.dbstate.db.get_note_bookmarks() + def make_callback(handle, function): """ Build a unique call to the function with the associated handle. diff --git a/gramps/gui/views/listview.py b/gramps/gui/views/listview.py index b8d192845..520901419 100644 --- a/gramps/gui/views/listview.py +++ b/gramps/gui/views/listview.py @@ -104,10 +104,10 @@ class ListView(NavigationView): QR_CATEGORY = -1 def __init__(self, title, pdata, dbstate, uistate, handle_col, - make_model, signal_map, get_bookmarks, bm_type, nav_group, + make_model, signal_map, bm_type, nav_group, multiple=False, filter_class=None): NavigationView.__init__(self, title, pdata, dbstate, uistate, - get_bookmarks, bm_type, nav_group) + bm_type, nav_group) #default is listviews keep themself in sync with database self._dirty_on_change_inactive = False @@ -681,7 +681,6 @@ class ListView(NavigationView): self._change_db(db) self.connect_signals() - self.bookmarks.update_bookmarks(self.get_bookmarks()) if self.active: #force rebuild of the model on build of tree self.dirty = True diff --git a/gramps/gui/views/navigationview.py b/gramps/gui/views/navigationview.py index e058c7f25..578f075e4 100644 --- a/gramps/gui/views/navigationview.py +++ b/gramps/gui/views/navigationview.py @@ -80,10 +80,9 @@ class NavigationView(PageView): should derive from this class. """ - def __init__(self, title, pdata, state, uistate, bookmarks, bm_type, nav_group): + def __init__(self, title, pdata, state, uistate, bm_type, nav_group): PageView.__init__(self, title, pdata, state, uistate) - self.bookmarks = bm_type(self.dbstate, self.uistate, bookmarks, - self.goto_handle) + self.bookmarks = bm_type(self.dbstate, self.uistate, self.goto_handle) self.fwd_action = None self.back_action = None diff --git a/gramps/plugins/lib/libpersonview.py b/gramps/plugins/lib/libpersonview.py index dd2df465b..1b6b479e5 100644 --- a/gramps/plugins/lib/libpersonview.py +++ b/gramps/plugins/lib/libpersonview.py @@ -135,7 +135,7 @@ class BasePersonView(ListView): ListView.__init__( self, title, pdata, dbstate, uistate, len(BasePersonView.COLUMNS), - model, signal_map, dbstate.db.get_bookmarks(), + model, signal_map, PersonBookmarks, nav_group, multiple=True, filter_class=PersonSidebarFilter) @@ -155,12 +155,6 @@ class BasePersonView(ListView): """ return 'Person' - def get_bookmarks(self): - """ - Return the bookmark object - """ - return self.dbstate.db.get_bookmarks() - def drag_info(self): """ Specify the drag type for a single selection diff --git a/gramps/plugins/lib/libplaceview.py b/gramps/plugins/lib/libplaceview.py index 4a6b29ba5..b65276dc1 100644 --- a/gramps/plugins/lib/libplaceview.py +++ b/gramps/plugins/lib/libplaceview.py @@ -140,7 +140,6 @@ class PlaceBaseView(ListView): self, title, pdata, dbstate, uistate, 15, model, signal_map, - dbstate.db.get_place_bookmarks(), PlaceBookmarks, nav_group, multiple=True, filter_class=PlaceSidebarFilter) @@ -155,9 +154,6 @@ class PlaceBaseView(ListView): def navigation_type(self): return 'Place' - def get_bookmarks(self): - return self.dbstate.db.get_place_bookmarks() - def define_actions(self): ListView.define_actions(self) self._add_toolmenu_action('MapsList', _('Loading...'), diff --git a/gramps/plugins/lib/maps/geography.py b/gramps/plugins/lib/maps/geography.py index 6b866cd2d..385b2ee7f 100644 --- a/gramps/plugins/lib/maps/geography.py +++ b/gramps/plugins/lib/maps/geography.py @@ -126,7 +126,7 @@ class GeoGraphyView(OsmGps, NavigationView): def __init__(self, title, pdata, dbstate, uistate, get_bookmarks, bm_type, nav_group): NavigationView.__init__(self, title, pdata, dbstate, uistate, - get_bookmarks, bm_type, nav_group) + bm_type, nav_group) self.dbstate = dbstate self.dbstate.connect('database-changed', self.change_db) @@ -224,7 +224,6 @@ class GeoGraphyView(OsmGps, NavigationView): is no need to store the database, since we will get the value from self.state.db """ - self.bookmarks.update_bookmarks(self.dbstate.db.get_bookmarks()) if self.active: self.bookmarks.redraw() diff --git a/gramps/plugins/view/citationlistview.py b/gramps/plugins/view/citationlistview.py index b638b0084..315808d20 100644 --- a/gramps/plugins/view/citationlistview.py +++ b/gramps/plugins/view/citationlistview.py @@ -142,7 +142,6 @@ class CitationListView(ListView): self, _('Citation View'), pdata, dbstate, uistate, len(self.COLUMNS), CitationListModel, signal_map, - dbstate.db.get_citation_bookmarks(), CitationBookmarks, nav_group, multiple=True, filter_class=CitationSidebarFilter) @@ -157,9 +156,6 @@ class CitationListView(ListView): def navigation_type(self): return 'Citation' - def get_bookmarks(self): - return self.dbstate.db.get_citation_bookmarks() - def drag_info(self): return DdTargets.CITATION_LINK diff --git a/gramps/plugins/view/citationtreeview.py b/gramps/plugins/view/citationtreeview.py index 5dc357944..aa538be9c 100644 --- a/gramps/plugins/view/citationtreeview.py +++ b/gramps/plugins/view/citationtreeview.py @@ -143,7 +143,6 @@ class CitationTreeView(ListView): self, _('Citation Tree View'), pdata, dbstate, uistate, len(self.COLUMNS), CitationTreeModel, signal_map, - dbstate.db.get_citation_bookmarks(), CitationBookmarks, nav_group, multiple=True, filter_class=SourceSidebarFilter) @@ -221,9 +220,6 @@ class CitationTreeView(ListView): def navigation_type(self): return 'Citation' - def get_bookmarks(self): - return self.dbstate.db.get_citation_bookmarks() - def drag_info(self): # Since drag only needs to work when just one row is selected, ideally, # this should just return SOURCE_LINK if one source is selected and diff --git a/gramps/plugins/view/eventview.py b/gramps/plugins/view/eventview.py index 3f1f4653f..c7b902364 100644 --- a/gramps/plugins/view/eventview.py +++ b/gramps/plugins/view/eventview.py @@ -117,7 +117,7 @@ class EventView(ListView): self, _('Events'), pdata, dbstate, uistate, len(EventView.COLUMNS), EventModel, - signal_map, dbstate.db.get_event_bookmarks(), + signal_map, EventBookmarks, nav_group, multiple=True, filter_class=EventSidebarFilter) @@ -134,12 +134,6 @@ class EventView(ListView): def navigation_type(self): return 'Event' - def get_bookmarks(self): - """ - Return the bookmark object - """ - return self.dbstate.db.get_event_bookmarks() - def drag_info(self): """ Indicate that the drag type is an EVENT diff --git a/gramps/plugins/view/familyview.py b/gramps/plugins/view/familyview.py index 123a3037c..051beabf9 100644 --- a/gramps/plugins/view/familyview.py +++ b/gramps/plugins/view/familyview.py @@ -116,7 +116,7 @@ class FamilyView(ListView): self, _('Families'), pdata, dbstate, uistate, len(FamilyView.COLUMNS), FamilyModel, - signal_map, dbstate.db.get_family_bookmarks(), + signal_map, FamilyBookmarks, nav_group, multiple=True, filter_class=FamilySidebarFilter) @@ -227,9 +227,6 @@ class FamilyView(ListView): ListView.set_inactive(self) self.uistate.viewmanager.tags.tag_disable() - def get_bookmarks(self): - return self.dbstate.db.get_family_bookmarks() - def add_bookmark(self, obj): mlist = self.selected_handles() if mlist: diff --git a/gramps/plugins/view/fanchartdescview.py b/gramps/plugins/view/fanchartdescview.py index 27a813bf7..0b13912c7 100644 --- a/gramps/plugins/view/fanchartdescview.py +++ b/gramps/plugins/view/fanchartdescview.py @@ -72,7 +72,6 @@ class FanChartDescView(fanchartdesc.FanChartDescGrampsGUI, NavigationView): NavigationView.__init__(self, _('Descendant Fan Chart'), pdata, dbstate, uistate, - dbstate.db.get_bookmarks(), PersonBookmarks, nav_group) fanchartdesc.FanChartDescGrampsGUI.__init__(self, self.on_childmenu_changed) @@ -200,7 +199,6 @@ class FanChartDescView(fanchartdesc.FanChartDescGrampsGUI, NavigationView): def change_db(self, db): self._change_db(db) - self.bookmarks.update_bookmarks(self.dbstate.db.get_bookmarks()) if self.active: self.bookmarks.redraw() self.update() diff --git a/gramps/plugins/view/fanchartview.py b/gramps/plugins/view/fanchartview.py index 373330de6..b6f51c637 100644 --- a/gramps/plugins/view/fanchartview.py +++ b/gramps/plugins/view/fanchartview.py @@ -71,7 +71,6 @@ class FanChartView(fanchart.FanChartGrampsGUI, NavigationView): NavigationView.__init__(self, _('Fan Chart'), pdata, dbstate, uistate, - dbstate.db.get_bookmarks(), PersonBookmarks, nav_group) fanchart.FanChartGrampsGUI.__init__(self, self.on_childmenu_changed) @@ -198,7 +197,6 @@ class FanChartView(fanchart.FanChartGrampsGUI, NavigationView): def change_db(self, db): self._change_db(db) - self.bookmarks.update_bookmarks(self.dbstate.db.get_bookmarks()) if self.active: self.bookmarks.redraw() self.update() diff --git a/gramps/plugins/view/geoclose.py b/gramps/plugins/view/geoclose.py index d5b18bfa1..331423717 100644 --- a/gramps/plugins/view/geoclose.py +++ b/gramps/plugins/view/geoclose.py @@ -130,7 +130,6 @@ class GeoClose(GeoGraphyView): def __init__(self, pdata, dbstate, uistate, nav_group=0): GeoGraphyView.__init__(self, _("Have they been able to meet?"), pdata, dbstate, uistate, - dbstate.db.get_bookmarks(), PersonBookmarks, nav_group) self.dbstate = dbstate @@ -188,12 +187,6 @@ class GeoClose(GeoGraphyView): """ return 'Person' - def get_bookmarks(self): - """ - Return the bookmark object - """ - return self.dbstate.db.get_bookmarks() - def goto_handle(self, handle=None): """ Rebuild the tree with the given person handle as the root. diff --git a/gramps/plugins/view/geoevents.py b/gramps/plugins/view/geoevents.py index d474419f0..76b69c9cd 100644 --- a/gramps/plugins/view/geoevents.py +++ b/gramps/plugins/view/geoevents.py @@ -111,7 +111,6 @@ class GeoEvents(GeoGraphyView): def __init__(self, pdata, dbstate, uistate, nav_group=0): GeoGraphyView.__init__(self, _('Events places map'), pdata, dbstate, uistate, - dbstate.db.get_event_bookmarks(), EventBookmarks, nav_group) self.dbstate = dbstate @@ -161,12 +160,6 @@ class GeoEvents(GeoGraphyView): """ return 'Event' - def get_bookmarks(self): - """ - Return the bookmark object - """ - return self.dbstate.db.get_event_bookmarks() - def goto_handle(self, handle=None): """ Rebuild the tree with the given events handle as the root. diff --git a/gramps/plugins/view/geofamclose.py b/gramps/plugins/view/geofamclose.py index e62db184e..05a619ab1 100644 --- a/gramps/plugins/view/geofamclose.py +++ b/gramps/plugins/view/geofamclose.py @@ -128,7 +128,6 @@ class GeoFamClose(GeoGraphyView): def __init__(self, pdata, dbstate, uistate, nav_group=0): GeoGraphyView.__init__(self, _("Have these two families been able to meet?"), pdata, dbstate, uistate, - dbstate.db.get_bookmarks(), FamilyBookmarks, nav_group) self.dbstate = dbstate @@ -186,12 +185,6 @@ class GeoFamClose(GeoGraphyView): """ return 'Family' - def get_bookmarks(self): - """ - Return the bookmark object - """ - return self.dbstate.db.get_bookmarks() - def family_label(self,family): if family is None: return "Unknown" diff --git a/gramps/plugins/view/geofamily.py b/gramps/plugins/view/geofamily.py index d63d82c99..c2d7cb0ef 100644 --- a/gramps/plugins/view/geofamily.py +++ b/gramps/plugins/view/geofamily.py @@ -111,7 +111,6 @@ class GeoFamily(GeoGraphyView): def __init__(self, pdata, dbstate, uistate, nav_group=0): GeoGraphyView.__init__(self, _('Family places map'), pdata, dbstate, uistate, - dbstate.db.get_family_bookmarks(), FamilyBookmarks, nav_group) self.dbstate = dbstate @@ -160,12 +159,6 @@ class GeoFamily(GeoGraphyView): """ return 'Family' - def get_bookmarks(self): - """ - Return the bookmark object - """ - return self.dbstate.db.get_family_bookmarks() - def goto_handle(self, handle=None): """ Rebuild the tree with the given person handle as the root. diff --git a/gramps/plugins/view/geomoves.py b/gramps/plugins/view/geomoves.py index 2dc432a54..de79e1f1f 100644 --- a/gramps/plugins/view/geomoves.py +++ b/gramps/plugins/view/geomoves.py @@ -131,7 +131,6 @@ class GeoMoves(GeoGraphyView): def __init__(self, pdata, dbstate, uistate, nav_group=0): GeoGraphyView.__init__(self, _("Descendance of the active person."), pdata, dbstate, uistate, - dbstate.db.get_bookmarks(), PersonBookmarks, nav_group) self.dbstate = dbstate @@ -189,12 +188,6 @@ class GeoMoves(GeoGraphyView): """ return 'Person' - def get_bookmarks(self): - """ - Return the bookmark object - """ - return self.dbstate.db.get_bookmarks() - def goto_handle(self, handle=None): """ Rebuild the tree with the given family handle as reference. diff --git a/gramps/plugins/view/geoperson.py b/gramps/plugins/view/geoperson.py index 60d9fbb9f..ad0dfc572 100644 --- a/gramps/plugins/view/geoperson.py +++ b/gramps/plugins/view/geoperson.py @@ -140,7 +140,6 @@ class GeoPerson(GeoGraphyView): def __init__(self, pdata, dbstate, uistate, nav_group=0): GeoGraphyView.__init__(self, _("Person places map"), pdata, dbstate, uistate, - dbstate.db.get_bookmarks(), PersonBookmarks, nav_group) self.dbstate = dbstate @@ -189,12 +188,6 @@ class GeoPerson(GeoGraphyView): """ return 'Person' - def get_bookmarks(self): - """ - Return the bookmark object - """ - return self.dbstate.db.get_bookmarks() - def goto_handle(self, handle=None): """ Rebuild the tree with the given person handle as the root. diff --git a/gramps/plugins/view/geoplaces.py b/gramps/plugins/view/geoplaces.py index 74497655d..7fd3cf3ca 100644 --- a/gramps/plugins/view/geoplaces.py +++ b/gramps/plugins/view/geoplaces.py @@ -111,7 +111,6 @@ class GeoPlaces(GeoGraphyView): def __init__(self, pdata, dbstate, uistate, nav_group=0): GeoGraphyView.__init__(self, _('Places places map'), pdata, dbstate, uistate, - dbstate.db.get_place_bookmarks(), PlaceBookmarks, nav_group) self.dbstate = dbstate @@ -161,12 +160,6 @@ class GeoPlaces(GeoGraphyView): """ return 'Place' - def get_bookmarks(self): - """ - Return the bookmark object - """ - return self.dbstate.db.get_place_bookmarks() - def goto_handle(self, handle=None): """ Rebuild the tree with the given places handle as the root. diff --git a/gramps/plugins/view/mediaview.py b/gramps/plugins/view/mediaview.py index 7874c0beb..b8eb36a1e 100644 --- a/gramps/plugins/view/mediaview.py +++ b/gramps/plugins/view/mediaview.py @@ -139,7 +139,7 @@ class MediaView(ListView): self, _('Media'), pdata, dbstate, uistate, len(MediaView.COLUMNS), MediaModel, - signal_map, dbstate.db.get_media_bookmarks(), + signal_map, MediaBookmarks, nav_group, filter_class=MediaSidebarFilter, multiple=True) @@ -212,12 +212,6 @@ class MediaView(ListView): self.dbstate.db.add_object(photo, trans) widget.emit_stop_by_name('drag_data_received') - def get_bookmarks(self): - """ - Return the bookmarks associated with this view - """ - return self.dbstate.db.get_media_bookmarks() - def define_actions(self): """ Defines the UIManager actions specific to Media View. We need to make diff --git a/gramps/plugins/view/noteview.py b/gramps/plugins/view/noteview.py index 62f171af3..7c3fab126 100644 --- a/gramps/plugins/view/noteview.py +++ b/gramps/plugins/view/noteview.py @@ -111,7 +111,6 @@ class NoteView(ListView): ListView.__init__( self, _('Notes'), pdata, dbstate, uistate, len(NoteView.COLUMNS), NoteModel, signal_map, - dbstate.db.get_note_bookmarks(), NoteBookmarks, nav_group, filter_class=NoteSidebarFilter, multiple=True) @@ -126,12 +125,6 @@ class NoteView(ListView): def navigation_type(self): return 'Note' - def get_bookmarks(self): - """ - Return the bookmark object - """ - return self.dbstate.db.get_note_bookmarks() - def drag_info(self): """ Indicate that the drag type is an EVENT diff --git a/gramps/plugins/view/pedigreeview.py b/gramps/plugins/view/pedigreeview.py index 32475083c..26b7a4f26 100644 --- a/gramps/plugins/view/pedigreeview.py +++ b/gramps/plugins/view/pedigreeview.py @@ -520,9 +520,7 @@ class PedigreeView(NavigationView): def __init__(self, pdata, dbstate, uistate, nav_group=0): NavigationView.__init__(self, _('Pedigree'), pdata, dbstate, uistate, - dbstate.db.get_bookmarks(), - PersonBookmarks, - nav_group) + PersonBookmarks, nav_group) self.func_list.update({ 'F2' : self.kb_goto_home, @@ -715,7 +713,6 @@ class PedigreeView(NavigationView): from self.state.db """ self._change_db(db) - self.bookmarks.update_bookmarks(self.dbstate.db.get_bookmarks()) if self.active: self.bookmarks.redraw() self.build_tree() diff --git a/gramps/plugins/view/relview.py b/gramps/plugins/view/relview.py index c8774465e..a5e7dd6de 100644 --- a/gramps/plugins/view/relview.py +++ b/gramps/plugins/view/relview.py @@ -148,7 +148,6 @@ class RelationshipView(NavigationView): def __init__(self, pdata, dbstate, uistate, nav_group=0): NavigationView.__init__(self, _('Relationships'), pdata, dbstate, uistate, - dbstate.db.get_bookmarks(), PersonBookmarks, nav_group) @@ -454,7 +453,6 @@ class RelationshipView(NavigationView): list(map(self.vbox.remove, self.vbox.get_children())) list(map(self.header.remove, self.header.get_children())) self.child = None - self.bookmarks.update_bookmarks(db.get_bookmarks()) if self.active: self.bookmarks.redraw() self.redraw() diff --git a/gramps/plugins/view/repoview.py b/gramps/plugins/view/repoview.py index 86f4ef206..0ebda2cc2 100644 --- a/gramps/plugins/view/repoview.py +++ b/gramps/plugins/view/repoview.py @@ -127,7 +127,6 @@ class RepositoryView(ListView): self, _('Repositories'), pdata, dbstate, uistate, len(RepositoryView.COLUMNS), RepositoryModel, signal_map, - dbstate.db.get_repo_bookmarks(), RepoBookmarks, nav_group, multiple=True, filter_class=RepoSidebarFilter) @@ -142,9 +141,6 @@ class RepositoryView(ListView): def navigation_type(self): return 'Repository' - def get_bookmarks(self): - return self.dbstate.db.get_repo_bookmarks() - def drag_info(self): return DdTargets.REPO_LINK diff --git a/gramps/plugins/view/sourceview.py b/gramps/plugins/view/sourceview.py index 0d1b8bfd4..444c71cf7 100644 --- a/gramps/plugins/view/sourceview.py +++ b/gramps/plugins/view/sourceview.py @@ -114,7 +114,6 @@ class SourceView(ListView): self, _('Sources'), pdata, dbstate, uistate, len(SourceView.COLUMNS), SourceModel, signal_map, - dbstate.db.get_source_bookmarks(), SourceBookmarks, nav_group, multiple=True, filter_class=SourceSidebarFilter) @@ -129,9 +128,6 @@ class SourceView(ListView): def navigation_type(self): return 'Source' - def get_bookmarks(self): - return self.dbstate.db.get_source_bookmarks() - def drag_info(self): return DdTargets.SOURCE_LINK