From 05d3a42d6233d443dc0cf5310c1758c934b83f7d Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Tue, 22 Apr 2003 15:40:24 +0000 Subject: [PATCH] Fixed redundant entries in report/tool dialogs after a reload of plugins svn: r1473 --- gramps2/src/Plugins.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/gramps2/src/Plugins.py b/gramps2/src/Plugins.py index d671a1675..fe69534fa 100644 --- a/gramps2/src/Plugins.py +++ b/gramps2/src/Plugins.py @@ -194,7 +194,7 @@ class PluginDialog: task_to_call is bound to the 'select' callback of the menu entry.""" ilist = [] - + # build the tree items and group together based on the category name item_hash = {} for report in list: @@ -425,6 +425,14 @@ def register_report(task, name, if xpm == None: xpm = no_image() + + del_index = -1 + for i in range(0,len(_reports)): + val = _reports[i] + if val[2] == name: + del_index = i + if del_index != -1: + del _reports[del_index] _reports.append((task, category, name, description, xpm, status, author_name, author_email)) def register_tool(task, name, @@ -438,6 +446,13 @@ def register_tool(task, name, """Register a tool with the plugin system""" if xpm == None: xpm = no_image() + del_index = -1 + for i in range(0,len(_tools)): + val = _tools[i] + if val[2] == name: + del_index = i + if del_index != -1: + del _tools[del_index] _tools.append((task, category, name, description, xpm, status, author_name, author_name))