diff --git a/src/gramps.glade b/src/gramps.glade index 48bd41367..cf19784e3 100644 --- a/src/gramps.glade +++ b/src/gramps.glade @@ -276,6 +276,20 @@ + + GtkMenuItem + reports_menu + + False + + + + GtkMenuItem + tools_menu + + False + + GtkMenuItem settings1 diff --git a/src/gramps_main.py b/src/gramps_main.py index 035646f1d..eaca7131b 100755 --- a/src/gramps_main.py +++ b/src/gramps_main.py @@ -2492,6 +2492,106 @@ def bookmark_callback(obj,person): def on_preferences_activate(obj): Config.display_preferences_box() +#------------------------------------------------------------------------- +# +# +# +#------------------------------------------------------------------------- +def build_report_menu(report_item): + + report_menu = GtkMenu() + report_menu.show() + report_item.set_submenu(report_menu) + + hash = {} + for report in Plugins.reports: + if report.__dict__.has_key("get_name"): + doc = report.get_name() + else: + doc = report.__doc__ + info = string.split(doc,"/") + + if hash.has_key(info[0]): + hash[info[0]].append((info[1],report.report)) + else: + hash[info[0]] = [(info[1],report.report)] + + catlist = hash.keys() + catlist.sort() + for key in catlist: + entry = GtkMenuItem(key) + entry.show() + report_menu.append(entry) + submenu = GtkMenu() + submenu.show() + entry.set_submenu(submenu) + list = hash[key] + list.sort() + for name in list: + subentry = GtkMenuItem(name[0]) + subentry.show() + subentry.connect("activate",menu_report,name[1]) + submenu.append(subentry) + +#------------------------------------------------------------------------- +# +# +# +#------------------------------------------------------------------------- +def menu_report(obj,task): + if active_person: + task(database,active_person) + +#------------------------------------------------------------------------- +# +# +# +#------------------------------------------------------------------------- +def build_tools_menu(report_item): + + report_menu = GtkMenu() + report_menu.show() + report_item.set_submenu(report_menu) + + hash = {} + for report in Plugins.tools: + if report.__dict__.has_key("get_name"): + doc = report.get_name() + else: + doc = report.__doc__ + info = string.split(doc,"/") + + if hash.has_key(info[0]): + hash[info[0]].append((info[1],report.runTool)) + else: + hash[info[0]] = [(info[1],report.runTool)] + + catlist = hash.keys() + catlist.sort() + for key in catlist: + entry = GtkMenuItem(key) + entry.show() + report_menu.append(entry) + submenu = GtkMenu() + submenu.show() + entry.set_submenu(submenu) + list = hash[key] + list.sort() + for name in list: + subentry = GtkMenuItem(name[0]) + subentry.show() + subentry.connect("activate",menu_tools,name[1]) + submenu.append(subentry) + +#------------------------------------------------------------------------- +# +# +# +#------------------------------------------------------------------------- +def menu_tools(obj,task): + if active_person: + task(database,active_person,update_display) + #------------------------------------------------------------------------- # # Main program @@ -2517,6 +2617,9 @@ def main(arg): Filter.load_filters(path) gtop = libglade.GladeXML(const.gladeFile, "gramps") + + build_report_menu(gtop.get_widget("reports_menu")) + build_tools_menu(gtop.get_widget("tools_menu")) statusbar = gtop.get_widget("statusbar") topWindow = gtop.get_widget("gramps") diff --git a/src/plugins/Check.py b/src/plugins/Check.py index 09767d4f5..7ebc609f6 100644 --- a/src/plugins/Check.py +++ b/src/plugins/Check.py @@ -18,7 +18,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -"Database Processing/Check database integrity" +"Database Processing/Check and repair database" import RelLib import utils @@ -86,6 +86,7 @@ class CheckIntegrity: break else: family.removeChild(child) + utils.modified() self.broken_links.append((child,family)) #------------------------------------------------------------------------- @@ -233,7 +234,7 @@ class CheckIntegrity: # #------------------------------------------------------------------------- def get_description(): - return _("Checks the database for any relationship errors") + return _("Checks the database for integrity problems, fixing the problems that it can") def get_name(): - return _("Database Processing/Check database integrity") + return _("Database Processing/Check and repair database")