From d0d384925026b222dd0374ad8ef74649c4958b22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Rapinat?= Date: Thu, 19 Feb 2009 12:52:41 +0000 Subject: [PATCH] #2726 #2641 To improve informations on dialog svn: r12032 --- src/plugins/tool/EventNames.py | 15 +++++++++++++++ src/plugins/tool/FindDupes.py | 3 ++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/plugins/tool/EventNames.py b/src/plugins/tool/EventNames.py index e1aea5e92..10838cca7 100644 --- a/src/plugins/tool/EventNames.py +++ b/src/plugins/tool/EventNames.py @@ -29,6 +29,7 @@ # #------------------------------------------------------------------------- from gettext import gettext as _ +from gettext import ngettext #------------------------------------------------------------------------- # @@ -48,6 +49,7 @@ import Utils from PluginUtils import Tool from gen.plug import PluginManager from BasicUtils import name_displayer +from QuestionDialog import OkDialog #------------------------------------------------------------------------- # @@ -78,6 +80,8 @@ class EventNames(Tool.BatchTool, ManagedWindow.ManagedWindow): """ trans = self.db.transaction_begin("", batch=True) self.db.disable_signals() + self.change = False + counter = 0 for handle in self.db.get_person_handles(): person = self.db.get_person_from_handle(handle) @@ -89,6 +93,7 @@ class EventNames(Tool.BatchTool, ManagedWindow.ManagedWindow): person_event_name(event, person) self.db.commit_event(event, trans) self.change = True + counter += 1 for handle in self.db.get_family_handles(): family = self.db.get_family_from_handle(handle) @@ -99,11 +104,21 @@ class EventNames(Tool.BatchTool, ManagedWindow.ManagedWindow): if event.get_description() == "": family_event_name(event, family, self.db) self.db.commit_event(event, trans) + self.change = True + counter += 1 self.db.transaction_commit(trans, _("Event name changes")) self.db.enable_signals() self.db.request_rebuild() + if self.change == True: + OkDialog(_('Modifications made'), + ngettext("%s event description has been added", + "%s event descriptions have been added", counter) % counter) + else: + OkDialog(_('No modifications made'), + _("No event description has been added.")) + #------------------------------------------------------------------------- # # Support functions diff --git a/src/plugins/tool/FindDupes.py b/src/plugins/tool/FindDupes.py index 9634c213d..531b9fe91 100644 --- a/src/plugins/tool/FindDupes.py +++ b/src/plugins/tool/FindDupes.py @@ -47,6 +47,7 @@ import gen.lib import Utils import soundex from BasicUtils import name_displayer +from QuestionDialog import OkDialog import ListModel import Errors from Merge import PersonCompare @@ -178,7 +179,7 @@ class Merge(Tool.Tool,ManagedWindow.ManagedWindow): self.options.handler.save_options() if len(self.map) == 0: - ErrorDialog( + OkDialog( _("No matches found"), _("No potential duplicate people were found")) else: