parent
066583afdb
commit
36c282780b
@ -29,6 +29,7 @@
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from gettext import gettext as _
|
from gettext import gettext as _
|
||||||
|
from gettext import ngettext
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -48,6 +49,7 @@ import Utils
|
|||||||
from PluginUtils import Tool
|
from PluginUtils import Tool
|
||||||
from gen.plug import PluginManager
|
from gen.plug import PluginManager
|
||||||
from BasicUtils import name_displayer
|
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)
|
trans = self.db.transaction_begin("", batch=True)
|
||||||
self.db.disable_signals()
|
self.db.disable_signals()
|
||||||
|
self.change = False
|
||||||
|
counter = 0
|
||||||
|
|
||||||
for handle in self.db.get_person_handles():
|
for handle in self.db.get_person_handles():
|
||||||
person = self.db.get_person_from_handle(handle)
|
person = self.db.get_person_from_handle(handle)
|
||||||
@ -89,6 +93,7 @@ class EventNames(Tool.BatchTool, ManagedWindow.ManagedWindow):
|
|||||||
person_event_name(event, person)
|
person_event_name(event, person)
|
||||||
self.db.commit_event(event, trans)
|
self.db.commit_event(event, trans)
|
||||||
self.change = True
|
self.change = True
|
||||||
|
counter += 1
|
||||||
|
|
||||||
for handle in self.db.get_family_handles():
|
for handle in self.db.get_family_handles():
|
||||||
family = self.db.get_family_from_handle(handle)
|
family = self.db.get_family_from_handle(handle)
|
||||||
@ -99,11 +104,21 @@ class EventNames(Tool.BatchTool, ManagedWindow.ManagedWindow):
|
|||||||
if event.get_description() == "":
|
if event.get_description() == "":
|
||||||
family_event_name(event, family, self.db)
|
family_event_name(event, family, self.db)
|
||||||
self.db.commit_event(event, trans)
|
self.db.commit_event(event, trans)
|
||||||
|
self.change = True
|
||||||
|
counter += 1
|
||||||
|
|
||||||
self.db.transaction_commit(trans, _("Event name changes"))
|
self.db.transaction_commit(trans, _("Event name changes"))
|
||||||
self.db.enable_signals()
|
self.db.enable_signals()
|
||||||
self.db.request_rebuild()
|
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
|
# Support functions
|
||||||
|
@ -47,6 +47,7 @@ import gen.lib
|
|||||||
import Utils
|
import Utils
|
||||||
import soundex
|
import soundex
|
||||||
from BasicUtils import name_displayer
|
from BasicUtils import name_displayer
|
||||||
|
from QuestionDialog import OkDialog
|
||||||
import ListModel
|
import ListModel
|
||||||
import Errors
|
import Errors
|
||||||
from Merge import PersonCompare
|
from Merge import PersonCompare
|
||||||
@ -178,7 +179,7 @@ class Merge(Tool.Tool,ManagedWindow.ManagedWindow):
|
|||||||
self.options.handler.save_options()
|
self.options.handler.save_options()
|
||||||
|
|
||||||
if len(self.map) == 0:
|
if len(self.map) == 0:
|
||||||
ErrorDialog(
|
OkDialog(
|
||||||
_("No matches found"),
|
_("No matches found"),
|
||||||
_("No potential duplicate people were found"))
|
_("No potential duplicate people were found"))
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user