diff --git a/gramps/gen/user.py b/gramps/gen/user.py index 3219fc9b6..f4160bf34 100644 --- a/gramps/gen/user.py +++ b/gramps/gen/user.py @@ -114,7 +114,7 @@ class User(): finally: self.end_progress() - def prompt(self, title, message, accept_label, reject_label): + def prompt(self, title, message, accept_label, reject_label, parent=None): """ Prompt the user with a message to select an alternative. diff --git a/gramps/gui/plug/_guioptions.py b/gramps/gui/plug/_guioptions.py index 89159ee16..97444c971 100644 --- a/gramps/gui/plug/_guioptions.py +++ b/gramps/gui/plug/_guioptions.py @@ -1222,7 +1222,8 @@ class GuiPersonListOption(Gtk.Box): prompt = OptionDialog(_('Select Person'), text, _('No'), None, - _('Yes'), None) + _('Yes'), None, + parent=self.__uistate.window) if prompt.get_response() == Gtk.ResponseType.YES: gid = spouse.get_gramps_id() self.__model.append([spouse_name, gid]) diff --git a/gramps/plugins/tool/changetypes.py b/gramps/plugins/tool/changetypes.py index fcc97fbb5..95bf22888 100644 --- a/gramps/plugins/tool/changetypes.py +++ b/gramps/plugins/tool/changetypes.py @@ -127,7 +127,7 @@ class ChangeTypes(tool.BatchTool, ManagedWindow): "{number_of} event records were modified.", modified ).format(number_of=modified) - self.user.info(_('Change types'), msg, parent_window) + self.user.info(_('Change types'), msg, parent=parent_window) return (bool(modified),msg) def on_apply_clicked(self, obj): diff --git a/gramps/plugins/tool/eventnames.py b/gramps/plugins/tool/eventnames.py index 4f7746e1f..0f474ea9d 100644 --- a/gramps/plugins/tool/eventnames.py +++ b/gramps/plugins/tool/eventnames.py @@ -111,15 +111,21 @@ class EventNames(tool.BatchTool): self.db.enable_signals() self.db.request_rebuild() + if hasattr(self.user.uistate, 'window'): + parent_window = self.user.uistate.window + else: + parent_window = None if self.change == True: # translators: leave all/any {...} untranslated message = ngettext("{quantity} event description has been added", "{quantity} event descriptions have been added", counter).format(quantity=counter) - self.user.info(_('Modifications made'), message) + self.user.info(_('Modifications made'), message, + parent=parent_window) else: self.user.info(_('No modifications made'), - _("No event description has been added.")) + _("No event description has been added."), + parent=parent_window) #------------------------------------------------------------------------- # diff --git a/gramps/plugins/tool/extractcity.py b/gramps/plugins/tool/extractcity.py index d8a3191de..e17fda82c 100644 --- a/gramps/plugins/tool/extractcity.py +++ b/gramps/plugins/tool/extractcity.py @@ -415,18 +415,18 @@ class ExtractCity(tool.BatchTool, ManagedWindow): """ def __init__(self, dbstate, user, options_class, name, callback=None): - uistate = user.uistate + self.uistate = user.uistate self.label = _('Extract Place data') - ManagedWindow.__init__(self, uistate, [], self.__class__) + ManagedWindow.__init__(self, self.uistate, [], self.__class__) self.set_window(Gtk.Window(), Gtk.Label(), '') tool.BatchTool.__init__(self, dbstate, user, options_class, name) if not self.fail: - uistate.set_busy_cursor(True) + self.uistate.set_busy_cursor(True) self.run(dbstate.db) - uistate.set_busy_cursor(False) + self.uistate.set_busy_cursor(False) def run(self, db): """ @@ -521,7 +521,8 @@ class ExtractCity(tool.BatchTool, ManagedWindow): self.close() from gramps.gui.dialog import OkDialog OkDialog(_('No modifications made'), - _("No place information could be extracted.")) + _("No place information could be extracted."), + parent=self.uistate.window) def display(self): diff --git a/gramps/plugins/tool/mergecitations.py b/gramps/plugins/tool/mergecitations.py index 27ef6ec0a..e30ca094b 100644 --- a/gramps/plugins/tool/mergecitations.py +++ b/gramps/plugins/tool/mergecitations.py @@ -91,6 +91,7 @@ class MergeCitations(tool.BatchTool,ManagedWindow): def __init__(self, dbstate, user, options_class, name, callback=None): uistate = user.uistate + self.user = user ManagedWindow.__init__(self, uistate, [], self.__class__) self.dbstate = dbstate @@ -124,6 +125,7 @@ class MergeCitations(tool.BatchTool,ManagedWindow): self.menu.set_active(fields) window = top.toplevel + window.set_transient_for(self.user.uistate.window) window.show() # self.set_window(window, top.get_object('title'), # _('Merge citations')) @@ -179,7 +181,8 @@ class MergeCitations(tool.BatchTool,ManagedWindow): # Save options self.options.handler.save_options() - self.progress = ProgressMeter(_('Checking Sources'), '') + self.progress = ProgressMeter(_('Checking Sources'), '', + parent=self.user.uistate.window) self.progress.set_pass(_('Looking for citation fields'), self.db.get_number_of_citations()) @@ -230,7 +233,8 @@ class MergeCitations(tool.BatchTool,ManagedWindow): # translators: leave all/any {...} untranslated ngettext("{number_of} citation merged", "{number_of} citations merged", num_merges - ).format(number_of=num_merges) ) + ).format(number_of=num_merges), + parent=self.user.uistate.window) self.close(obj) #------------------------------------------------------------------------ diff --git a/gramps/plugins/tool/patchnames.py b/gramps/plugins/tool/patchnames.py index 18b172627..9fce61b85 100644 --- a/gramps/plugins/tool/patchnames.py +++ b/gramps/plugins/tool/patchnames.py @@ -361,7 +361,8 @@ class PatchNames(tool.BatchTool, ManagedWindow): self.progress.close() self.close() OkDialog(_('No modifications made'), - _("No titles, nicknames or prefixes were found")) + _("No titles, nicknames or prefixes were found"), + parent=self.uistate.window) def build_menu_names(self, obj): return (self.label, None)