4772: Not all Gramplets make sense on all views (filter gramplet on Gramplets View)

svn: r17199
This commit is contained in:
Doug Blank
2011-04-22 03:00:00 +00:00
parent 4ec351710d
commit bcd4984941
4 changed files with 65 additions and 5 deletions

View File

@@ -414,9 +414,13 @@ class GrampsBar(gtk.Notebook):
uiman = self.uistate.uimanager
ag_menu = uiman.get_widget('/GrampsBarPopup/AddGramplet')
skip = self.all_gramplets()
gramplet_list = [(GET_AVAILABLE_GRAMPLETS(name)["tname"], name)
for name in AVAILABLE_GRAMPLETS()
if name not in skip]
gramplet_list = []
for name in AVAILABLE_GRAMPLETS():
if name not in skip:
if (GET_AVAILABLE_GRAMPLETS(name)["navtypes"] == [] or
self.pageview.category in GET_AVAILABLE_GRAMPLETS(name)["navtypes"]):
gramplet_list.append((GET_AVAILABLE_GRAMPLETS(name)["tname"],
name))
gramplet_list.sort()
self.__create_submenu(ag_menu, gramplet_list, self.__add_clicked)