Add extra GrampsBar functionality.

svn: r16502
This commit is contained in:
Nick Hall
2011-01-30 03:02:38 +00:00
parent 9b24451db1
commit 116d26e69f
19 changed files with 881 additions and 554 deletions

View File

@@ -284,3 +284,9 @@ class EventView(ListView):
"""
pass
def get_default_gramplets(self):
"""
Define the default gramplets for the sidebar and bottombar.
"""
return (("Event Filter Gramplet",),
())

View File

@@ -338,3 +338,10 @@ class FamilyView(ListView):
family = self.dbstate.db.get_family_from_handle(family_handle)
family.add_tag(tag_handle)
self.dbstate.db.commit_family(family, transaction)
def get_default_gramplets(self):
"""
Define the default gramplets for the sidebar and bottombar.
"""
return (("Family Filter Gramplet",),
())

View File

@@ -77,7 +77,6 @@ from PlaceUtils import conv_lat_lon
from gui.views.navigationview import NavigationView
from gui.editors import EditPlace
from gui.selectors.selectplace import SelectPlace
from Filters.SideBar import PlaceSidebarFilter, EventSidebarFilter
import Bookmarks
from Utils import navigation_label
@@ -424,7 +423,8 @@ class GeoView(HtmlView):
)
self.side = None
self.bottom = None
self.add_filter(PlaceSidebarFilter)
self.sidebar.remove_gramplet('Event Filter Gramplet')
self.sidebar.add_gramplet('Place Filter Gramplet')
return HtmlView.build_widget(self)
def can_configure(self):
@@ -889,7 +889,7 @@ class GeoView(HtmlView):
self.width = (widget.parent.parent.get_allocation().width -
widget.parent.parent.get_child2().get_allocation().width - 30)
if not self.sidebar.is_visible():
if not self.sidebar.get_property('visible'):
if self.side is not None:
self.width = widget.parent.parent.get_allocation().width - 24
else:
@@ -899,7 +899,7 @@ class GeoView(HtmlView):
else:
_LOG.debug("Sidebar : map width=%d" % self.width)
if not self.bottombar.is_visible():
if not self.bottombar.get_property('visible'):
if self.bottom is not None:
self.height = (widget.parent.get_allocation().height
- self.header_size - 24)
@@ -1223,9 +1223,9 @@ class GeoView(HtmlView):
Specifies the place for the home person to display with mapstraction.
"""
self.displaytype = "places"
self.remove_filter()
self.add_filter(PlaceSidebarFilter)
self.widget.parent.parent.get_child2().show()
self.sidebar.remove_gramplet('Event Filter Gramplet')
self.sidebar.add_gramplet('Place Filter Gramplet')
#self.widget.parent.parent.get_child2().show()
self._geo_places()
def _person_places(self, handle=None): # pylint: disable-msg=W0613
@@ -1235,7 +1235,7 @@ class GeoView(HtmlView):
self.displaytype = "person"
if not self.uistate.get_active('Person'):
return
self.widget.parent.parent.get_child2().hide()
#self.widget.parent.parent.get_child2().hide()
self._geo_places()
def _family_places(self, hanle=None): # pylint: disable-msg=W0613
@@ -1245,7 +1245,7 @@ class GeoView(HtmlView):
self.displaytype = "family"
if not self.uistate.get_active('Person'):
return
self.widget.parent.parent.get_child2().hide()
#self.widget.parent.parent.get_child2().hide()
self._geo_places()
def _event_places(self, hanle=None): # pylint: disable-msg=W0613
@@ -1253,9 +1253,9 @@ class GeoView(HtmlView):
Specifies all event places to display with mapstraction.
"""
self.displaytype = "event"
self.remove_filter()
self.add_filter(EventSidebarFilter)
self.widget.parent.parent.get_child2().show()
self.sidebar.remove_gramplet('Place Filter Gramplet')
self.sidebar.add_gramplet('Event Filter Gramplet')
#self.widget.parent.parent.get_child2().show()
self._geo_places()
def _new_database(self, database):

View File

@@ -488,3 +488,10 @@ class MediaView(ListView):
media = self.dbstate.db.get_object_from_handle(media_handle)
media.add_tag(tag_handle)
self.dbstate.db.commit_media_object(media, transaction)
def get_default_gramplets(self):
"""
Define the default gramplets for the sidebar and bottombar.
"""
return (("Media Filter Gramplet",),
())

View File

@@ -293,3 +293,10 @@ class NoteView(ListView):
note = self.dbstate.db.get_note_from_handle(note_handle)
note.add_tag(tag_handle)
self.dbstate.db.commit_note(note, transaction)
def get_default_gramplets(self):
"""
Define the default gramplets for the sidebar and bottombar.
"""
return (("Note Filter Gramplet",),
())

View File

@@ -268,3 +268,10 @@ class RepositoryView(ListView):
As this submenu will be dynamically built, we offer a dummy action
"""
pass
def get_default_gramplets(self):
"""
Define the default gramplets for the sidebar and bottombar.
"""
return (("Repository Filter Gramplet",),
())

View File

@@ -245,3 +245,10 @@ class SourceView(ListView):
return obj.get_handle()
else:
return None
def get_default_gramplets(self):
"""
Define the default gramplets for the sidebar and bottombar.
"""
return (("Source Filter Gramplet",),
())