diff --git a/gramps/gui/editors/addmedia.py b/gramps/gui/editors/addmedia.py index 40cdc449d..f71d90d7a 100644 --- a/gramps/gui/editors/addmedia.py +++ b/gramps/gui/editors/addmedia.py @@ -147,7 +147,7 @@ class AddMediaObject(ManagedWindow): if self.file_text.get_filename() is None: msgstr = _("Import failed") msgstr2 = _("The filename supplied could not be found.") - ErrorDialog(msgstr, msgstr2) + ErrorDialog(msgstr, msgstr2, parent=self.window) return filename = conv_to_unicode(self.file_text.get_filename()) @@ -158,7 +158,7 @@ class AddMediaObject(ManagedWindow): if not os.path.exists(pname): msgstr = _("Cannot import %s") msgstr2 = _("Directory specified in preferences: Base path for relative media paths: %s does not exist. Change preferences or do not use relative path when importing") - ErrorDialog(msgstr % filename, msgstr2 % pname) + ErrorDialog(msgstr % filename, msgstr2 % pname, parent=self.window) return filename = relative_path(filename, pname) diff --git a/gramps/gui/editors/editattribute.py b/gramps/gui/editors/editattribute.py index c5bce36a5..b382f0bbd 100644 --- a/gramps/gui/editors/editattribute.py +++ b/gramps/gui/editors/editattribute.py @@ -137,7 +137,8 @@ class EditAttributeRoot(EditSecondary): from ..dialog import ErrorDialog ErrorDialog( _("Cannot save attribute"), - _("The attribute type cannot be empty")) + _("The attribute type cannot be empty"), + parent=self.window) return if self.callback: self.callback(self.obj) diff --git a/gramps/gui/editors/editcitation.py b/gramps/gui/editors/editcitation.py index 0ca190d82..e99a024ae 100644 --- a/gramps/gui/editors/editcitation.py +++ b/gramps/gui/editors/editcitation.py @@ -280,7 +280,8 @@ class EditCitation(EditPrimary): "derived. To create a citation, first select the " "required source, and then record the location of " "the information referenced within the source in the " - "'Volume/Page' field.")) + "'Volume/Page' field."), + parent=self.window) self.ok_button.set_sensitive(True) return @@ -294,7 +295,7 @@ class EditCitation(EditPrimary): "%(prim_object)s'. Please enter a different ID or leave " "blank to get the next available ID value.") % { 'id' : gramps_id, 'prim_object' : name } - ErrorDialog(msg1, msg2) + ErrorDialog(msg1, msg2, parent=self.window) self.ok_button.set_sensitive(True) return diff --git a/gramps/gui/editors/editevent.py b/gramps/gui/editors/editevent.py index 88b31095f..0552b9e3b 100644 --- a/gramps/gui/editors/editevent.py +++ b/gramps/gui/editors/editevent.py @@ -236,7 +236,8 @@ class EditEvent(EditPrimary): if self.object_is_empty(): ErrorDialog(_("Cannot save event"), _("No data exists for this event. Please " - "enter data or cancel the edit.")) + "enter data or cancel the edit."), + parent=self.window) self.ok_button.set_sensitive(True) return @@ -250,7 +251,7 @@ class EditEvent(EditPrimary): "%(prim_object)s'. Please enter a different ID or leave " "blank to get the next available ID value.") % { 'id' : id, 'prim_object' : name } - ErrorDialog(msg1, msg2) + ErrorDialog(msg1, msg2, parent=self.window) self.ok_button.set_sensitive(True) return @@ -258,7 +259,7 @@ class EditEvent(EditPrimary): if t.is_custom() and str(t) == '': ErrorDialog( _("Cannot save event"), - _("The event type cannot be empty")) + _("The event type cannot be empty"), parent=self.window) self.ok_button.set_sensitive(True) return diff --git a/gramps/gui/editors/editfamily.py b/gramps/gui/editors/editfamily.py index 707bf0853..e75366a65 100644 --- a/gramps/gui/editors/editfamily.py +++ b/gramps/gui/editors/editfamily.py @@ -362,7 +362,8 @@ class EditFamily(EditPrimary): "are available when you create a new family. The " "remaining fields will become available after you " "attempt to select a parent."), - 'preferences.family-warn') + 'preferences.family-warn', + parent=self.window) else: self.add_parent = False @@ -1049,8 +1050,9 @@ class EditFamily(EditPrimary): name = "%s [%s]" % (name_displayer.display(father), father.gramps_id) ErrorDialog(_("A father cannot be his own child"), - _("%s is listed as both the father and child " - "of the family.") % name) + _("%s is listed as both the father and child " + "of the family.") % name, + parent=self.window) self.ok_button.set_sensitive(True) return elif self.obj.get_mother_handle() in child_list: @@ -1059,8 +1061,9 @@ class EditFamily(EditPrimary): name = "%s [%s]" % (name_displayer.display(mother), mother.gramps_id) ErrorDialog(_("A mother cannot be her own child"), - _("%s is listed as both the mother and child " - "of the family.") % name) + _("%s is listed as both the mother and child " + "of the family.") % name, + parent=self.window) self.ok_button.set_sensitive(True) return @@ -1068,7 +1071,8 @@ class EditFamily(EditPrimary): ErrorDialog( _("Cannot save family"), _("No data exists for this family. " - "Please enter data or cancel the edit.")) + "Please enter data or cancel the edit."), + parent=self.window) self.ok_button.set_sensitive(True) return @@ -1080,7 +1084,7 @@ class EditFamily(EditPrimary): "enter a different ID or leave " "blank to get the next available ID value.") % { 'id' : id} - ErrorDialog(msg1, msg2) + ErrorDialog(msg1, msg2, parent=self.window) self.ok_button.set_sensitive(True) return diff --git a/gramps/gui/editors/editmedia.py b/gramps/gui/editors/editmedia.py index 1c8bd1a8f..c2e59f9ba 100644 --- a/gramps/gui/editors/editmedia.py +++ b/gramps/gui/editors/editmedia.py @@ -290,7 +290,7 @@ class EditMedia(EditPrimary): "%(prim_object)s'. Please enter a different ID or leave " "blank to get the next available ID value.") % { 'id' : id, 'prim_object' : name } - ErrorDialog(msg1, msg2) + ErrorDialog(msg1, msg2, parent=self.window) self.ok_button.set_sensitive(True) return @@ -304,7 +304,7 @@ class EditMedia(EditPrimary): "value '%(path)s'. This path does not exist!" " Please enter a different path") % { 'path' : path } - ErrorDialog(msg1, msg2) + ErrorDialog(msg1, msg2, parent=self.window) self.ok_button.set_sensitive(True) return diff --git a/gramps/gui/editors/editname.py b/gramps/gui/editors/editname.py index f4af32eb5..446ac3b0a 100644 --- a/gramps/gui/editors/editname.py +++ b/gramps/gui/editors/editname.py @@ -382,7 +382,8 @@ class EditName(EditSecondary): ) % { 'surname' : surname, 'group_name':group_as}, _("Continue"), - _("Return to Name Editor")) + _("Return to Name Editor"), + parent=self.window) val = q.run() if val: #delete the grouping link on database @@ -414,7 +415,8 @@ class EditName(EditSecondary): ) % { 'surname' : surname, 'group_name':group_as}, _("Group all"), - _("Group this name only")) + _("Group this name only"), + parent=self.window) val = q.run() if val: if group_as == surname : diff --git a/gramps/gui/editors/editnote.py b/gramps/gui/editors/editnote.py index 72f9e7b40..165a2eb43 100644 --- a/gramps/gui/editors/editnote.py +++ b/gramps/gui/editors/editnote.py @@ -301,7 +301,8 @@ class EditNote(EditPrimary): if self.object_is_empty(): ErrorDialog(_("Cannot save note"), _("No data exists for this note. Please " - "enter data or cancel the edit.")) + "enter data or cancel the edit."), + parent=self.window) self.ok_button.set_sensitive(True) return @@ -313,7 +314,7 @@ class EditNote(EditPrimary): "enter a different ID or leave " "blank to get the next available ID value.") % { 'id' : id } - ErrorDialog(msg1, msg2) + ErrorDialog(msg1, msg2, parent=self.window) self.ok_button.set_sensitive(True) return diff --git a/gramps/gui/editors/editperson.py b/gramps/gui/editors/editperson.py index 71177f0e5..aa8d8ffe8 100644 --- a/gramps/gui/editors/editperson.py +++ b/gramps/gui/editors/editperson.py @@ -811,7 +811,7 @@ class EditPerson(EditPrimary): msg = _("Changing the gender caused problems " "with marriage information.\nPlease check " "the person's marriages.") - ErrorDialog(msg2, msg) + ErrorDialog(msg2, msg, parent=self.window) def save(self, *obj): """ @@ -821,7 +821,8 @@ class EditPerson(EditPrimary): if self.object_is_empty(): ErrorDialog(_("Cannot save person"), _("No data exists for this person. Please " - "enter data or cancel the edit.")) + "enter data or cancel the edit."), + parent=self.window) self.ok_button.set_sensitive(True) return # fix surname problems @@ -849,7 +850,7 @@ class EditPerson(EditPrimary): "%(prim_object)s'. Please enter a different ID or leave " "blank to get the next available ID value.") % { 'id' : id, 'prim_object' : name } - ErrorDialog(msg1, msg2) + ErrorDialog(msg1, msg2, parent=self.window) self.ok_button.set_sensitive(True) return diff --git a/gramps/gui/editors/editpersonref.py b/gramps/gui/editors/editpersonref.py index 0bdf57706..b16c92e75 100644 --- a/gramps/gui/editors/editpersonref.py +++ b/gramps/gui/editors/editpersonref.py @@ -229,4 +229,5 @@ class EditPersonRef(EditSecondary): ErrorDialog( _('No person selected'), _('You must either select a person or Cancel ' - 'the edit')) + 'the edit'), + parent=self.window) diff --git a/gramps/gui/editors/editplace.py b/gramps/gui/editors/editplace.py index 9bf84cbc3..ba4e6718a 100644 --- a/gramps/gui/editors/editplace.py +++ b/gramps/gui/editors/editplace.py @@ -272,7 +272,7 @@ class EditPlace(EditPrimary): if self.obj.get_name().get_value().strip() == '': msg1 = _("Cannot save place. Name not entered.") msg2 = _("You must enter a name before saving.") - ErrorDialog(msg1, msg2) + ErrorDialog(msg1, msg2, parent=self.window) self.ok_button.set_sensitive(True) return @@ -286,7 +286,7 @@ class EditPlace(EditPrimary): "%(prim_object)s'. Please enter a different ID or leave " "blank to get the next available ID value.") % { 'id' : id, 'prim_object' : name } - ErrorDialog(msg1, msg2) + ErrorDialog(msg1, msg2, parent=self.window) self.ok_button.set_sensitive(True) return diff --git a/gramps/gui/editors/editplacename.py b/gramps/gui/editors/editplacename.py index d4bdf9111..0c184192c 100644 --- a/gramps/gui/editors/editplacename.py +++ b/gramps/gui/editors/editplacename.py @@ -87,7 +87,8 @@ class EditPlaceName(EditSecondary): def save(self, *obj): if not self.obj.get_value(): ErrorDialog(_("Cannot save place name"), - _("The place name cannot be empty")) + _("The place name cannot be empty"), + parent=self.window) return if self.callback: diff --git a/gramps/gui/editors/editplaceref.py b/gramps/gui/editors/editplaceref.py index 15b031ea3..59057c901 100644 --- a/gramps/gui/editors/editplaceref.py +++ b/gramps/gui/editors/editplaceref.py @@ -274,7 +274,7 @@ class EditPlaceRef(EditReference): if self.source.get_name().get_value().strip() == '': msg1 = _("Cannot save place. Name not entered.") msg2 = _("You must enter a name before saving.") - ErrorDialog(msg1, msg2) + ErrorDialog(msg1, msg2, parent=self.window) self.ok_button.set_sensitive(True) return diff --git a/gramps/gui/editors/editreference.py b/gramps/gui/editors/editreference.py index 8276b46c0..403dda868 100644 --- a/gramps/gui/editors/editreference.py +++ b/gramps/gui/editors/editreference.py @@ -297,6 +297,6 @@ class EditReference(ManagedWindow, DbGUIElement): "different ID or leave blank to get the next " "available ID value.") % { 'id' : new_id} - ErrorDialog(msg1, msg2) + ErrorDialog(msg1, msg2, parent=self.window) return True return False diff --git a/gramps/gui/editors/editrepository.py b/gramps/gui/editors/editrepository.py index 39582a606..09fbc67ec 100644 --- a/gramps/gui/editors/editrepository.py +++ b/gramps/gui/editors/editrepository.py @@ -167,7 +167,8 @@ class EditRepository(EditPrimary): if self.object_is_empty(): ErrorDialog(_("Cannot save repository"), _("No data exists for this repository. Please " - "enter data or cancel the edit.")) + "enter data or cancel the edit."), + parent=self.window) self.ok_button.set_sensitive(True) return @@ -181,7 +182,7 @@ class EditRepository(EditPrimary): "%(prim_object)s'. Please enter a different ID or leave " "blank to get the next available ID value.") % { 'id' : id, 'prim_object' : name } - ErrorDialog(msg1, msg2) + ErrorDialog(msg1, msg2, parent=self.window) self.ok_button.set_sensitive(True) return diff --git a/gramps/gui/editors/editsource.py b/gramps/gui/editors/editsource.py index de850b69c..de084e701 100644 --- a/gramps/gui/editors/editsource.py +++ b/gramps/gui/editors/editsource.py @@ -187,7 +187,8 @@ class EditSource(EditPrimary): if self.object_is_empty(): ErrorDialog(_("Cannot save source"), _("No data exists for this source. Please " - "enter data or cancel the edit.")) + "enter data or cancel the edit."), + parent=self.window) self.ok_button.set_sensitive(True) return @@ -201,7 +202,7 @@ class EditSource(EditPrimary): "%(prim_object)s'. Please enter a different ID or leave " "blank to get the next available ID value.") % { 'id' : id, 'prim_object' : name } - ErrorDialog(msg1, msg2) + ErrorDialog(msg1, msg2, parent=self.window) self.ok_button.set_sensitive(True) return diff --git a/gramps/gui/plug/report/_styleeditor.py b/gramps/gui/plug/report/_styleeditor.py index 71181b88e..cac0193ff 100644 --- a/gramps/gui/plug/report/_styleeditor.py +++ b/gramps/gui/plug/report/_styleeditor.py @@ -136,7 +136,8 @@ class StyleListDisplay(object): self.sheetlist.save() except IOError as msg: from ...dialog import ErrorDialog - ErrorDialog(_("Error saving stylesheet"), str(msg)) + ErrorDialog(_("Error saving stylesheet"), + str(msg), parent=self.window) except: log.error("Failed to save stylesheet", exc_info=True) diff --git a/gramps/gui/viewmanager.py b/gramps/gui/viewmanager.py index 721706faf..b0790c9b1 100644 --- a/gramps/gui/viewmanager.py +++ b/gramps/gui/viewmanager.py @@ -663,7 +663,7 @@ class ViewManager(CLIManager): """ Initialize the interface. """ - self.views = get_available_views() + self.views = get_available_views(self.uistate) defaults = views_to_show(self.views, config.get('preferences.use-last-view')) self.current_views = defaults[2] @@ -764,7 +764,7 @@ class ViewManager(CLIManager): try: backup(self.dbstate.db) except DbException as msg: - ErrorDialog(_("Error saving backup data"), msg) + ErrorDialog(_("Error saving backup data"), msg, parent=self.uistate.window) self.uistate.set_busy_cursor(False) self.uistate.progress.hide() @@ -779,7 +779,8 @@ class ViewManager(CLIManager): _("Aborting changes will return the database to the state " "it was before you started this editing session."), _("Abort changes"), - _("Cancel")) + _("Cancel"), + parent=self.uistate.window) if dialog.run(): self.dbstate.db.disable_signals() @@ -791,7 +792,8 @@ class ViewManager(CLIManager): _("Cannot abandon session's changes"), _('Changes cannot be completely abandoned because the ' 'number of changes made in the session exceeded the ' - 'limit.')) + 'limit.'), + parent=self.uistate.window) def __init_action_group(self, name, actions, sensitive=True, toggles=None): """ @@ -1608,7 +1610,8 @@ def run_plugin(pdata, dbstate, uistate): 'gramps_bugtracker_url' : URL_BUGHOME, 'firstauthoremail': pdata.authors_email[0] if pdata.authors_email else '...', - 'error_msg': pmgr.get_fail_list()[-1][1][1]}) + 'error_msg': pmgr.get_fail_list()[-1][1][1]}, + parent=uistate.window) return if pdata.ptype == REPORT: @@ -1633,7 +1636,7 @@ def make_plugin_callback(pdata, dbstate, uistate): """ return lambda x: run_plugin(pdata, dbstate, uistate) -def get_available_views(): +def get_available_views(uistate): """ Query the views and determine what views to show and in which order @@ -1664,7 +1667,8 @@ def get_available_views(): 'gramps_bugtracker_url' : URL_BUGHOME, 'firstauthoremail': pdata.authors_email[0] if pdata.authors_email else '...', - 'error_msg': lasterror}) + 'error_msg': lasterror}, + parent=uistate.window) continue viewclass = getattr(mod, pdata.viewclass) diff --git a/gramps/gui/views/bookmarks.py b/gramps/gui/views/bookmarks.py index 33c94136e..6ad523f1b 100644 --- a/gramps/gui/views/bookmarks.py +++ b/gramps/gui/views/bookmarks.py @@ -409,7 +409,8 @@ class CitationBookmarks(ListBookmarks) : "You are probably trying to bookmark a Source in the " "Citation Tree View. In this view, only Citations " "can be bookmarked. To bookmark a Source, switch to " - "the Source View") + "the Source View", + parent=self.uistate.window) def connect_signals(self): self.dbstate.db.connect('citation-delete', self.remove_handles) diff --git a/gramps/gui/views/listview.py b/gramps/gui/views/listview.py index 93f94ea88..856692b28 100644 --- a/gramps/gui/views/listview.py +++ b/gramps/gui/views/listview.py @@ -447,7 +447,8 @@ class ListView(NavigationView): WarningDialog( _("Could Not Set a Bookmark"), _("A bookmark could not be set because " - "nothing was selected.")) + "nothing was selected."), + parent=self.uistate.window) #################################################################### # @@ -541,7 +542,8 @@ class ListView(NavigationView): _("More than one item has been selected for deletion. " "Select the option indicating how to delete the items:"), _("Delete All"), - _("Confirm Each Delete")) + _("Confirm Each Delete"), + parent=self.uistate.window) prompt = not q.run() if not prompt: @@ -563,7 +565,8 @@ class ListView(NavigationView): descr = object.get_gramps_id() self.uistate.set_busy_cursor(True) QuestionDialog(_('Delete %s?') % descr, msg, - _('_Delete Item'), query.query_response) + _('_Delete Item'), query.query_response, + parent=self.uistate.window) self.uistate.set_busy_cursor(False) else: query.query_response() diff --git a/gramps/gui/views/navigationview.py b/gramps/gui/views/navigationview.py index 4a5c0eda5..b133d6686 100644 --- a/gramps/gui/views/navigationview.py +++ b/gramps/gui/views/navigationview.py @@ -254,7 +254,8 @@ class NavigationView(PageView): WarningDialog( _("Could Not Set a Bookmark"), _("A bookmark could not be set because " - "no one was selected.")) + "no one was selected."), + parent=self.uistate.window) def edit_bookmarks(self, obj): """ @@ -343,7 +344,7 @@ class NavigationView(PageView): """ A dialog to move to a Gramps ID entered by the user. """ - dialog = Gtk.Dialog(_('Jump to by Gramps ID')) + dialog = Gtk.Dialog(_('Jump to by Gramps ID'), parent=self.uistate.window) dialog.set_border_width(12) label = Gtk.Label(label='%s' % _('Jump to by Gramps ID')) diff --git a/gramps/gui/views/tags.py b/gramps/gui/views/tags.py index 1148ea641..0fcf17580 100644 --- a/gramps/gui/views/tags.py +++ b/gramps/gui/views/tags.py @@ -485,7 +485,9 @@ class OrganizeTagsDialog(object): _("The tag definition will be removed. " "The tag will be also removed from all objects in the database."), _("Yes"), - _("No")) + _("No"), + parent=top) + prompt = yes_no.run() if prompt: @@ -571,7 +573,8 @@ class EditTag(object): if not self.tag.get_name(): ErrorDialog( _("Cannot save tag"), - _("The tag name cannot be empty")) + _("The tag name cannot be empty"), + parent=self.top) return if not self.tag.get_handle(): diff --git a/gramps/plugins/lib/libpersonview.py b/gramps/plugins/lib/libpersonview.py index d64ad6ca1..d10b40469 100644 --- a/gramps/plugins/lib/libpersonview.py +++ b/gramps/plugins/lib/libpersonview.py @@ -296,7 +296,8 @@ class BasePersonView(ListView): QuestionDialog(msg1, msg2, _('_Delete Person'), - self.delete_person_response) + self.delete_person_response, + parent=self.uistate.window) else: # Ask to delete; option to cancel, delete rest # This gets person to delete from parameter @@ -304,7 +305,8 @@ class BasePersonView(ListView): self._message2_format, handles, self._lookup_person, - yes_func=self.delete_person_response) # Yes + yes_func=self.delete_person_response, + parent=self.uistate.window) # Yes def _message1_format(self, person): return _('Delete %s?') % (name_displayer.display(person) + @@ -417,7 +419,8 @@ class BasePersonView(ListView): _("Cannot merge people"), _("Exactly two people must be selected to perform a merge. " "A second person can be selected by holding down the " - "control key while clicking on the desired person.")) + "control key while clicking on the desired person."), + parent=self.uistate.window) else: MergePerson(self.dbstate, self.uistate, mlist[0], mlist[1]) diff --git a/gramps/plugins/lib/libplaceview.py b/gramps/plugins/lib/libplaceview.py index a1f9bfae4..ff09dad77 100644 --- a/gramps/plugins/lib/libplaceview.py +++ b/gramps/plugins/lib/libplaceview.py @@ -258,7 +258,7 @@ class PlaceBaseView(ListView): if not len(self.mapservicedata): msg = _("No map service is available.") msg2 = _("Check your installation.") - ErrorDialog(msg, msg2) + ErrorDialog(msg, msg2, parent=self.uistate.window) return place_handles = self.selected_handles() @@ -269,7 +269,7 @@ class PlaceBaseView(ListView): msg2 = _("You need to select a place to be able to view it" " on a map. Some Map Services might support multiple" " selections.") - ErrorDialog(msg, msg2) + ErrorDialog(msg, msg2, parent=self.uistate.window) return #TODO: support for descriptions in some cases. For now, pass None @@ -363,7 +363,7 @@ class PlaceBaseView(ListView): msg = _("Cannot delete place.") msg2 = _("This place is currently referenced by another place. " "First remove the places it contains.") - ErrorDialog(msg, msg2) + ErrorDialog(msg, msg2, parent=self.uistate.window) return self.remove_selected_objects() @@ -406,14 +406,14 @@ class PlaceBaseView(ListView): msg2 = _("Exactly two places must be selected to perform a merge. " "A second place can be selected by holding down the " "control key while clicking on the desired place.") - ErrorDialog(msg, msg2) + ErrorDialog(msg, msg2, parent=self.uistate.window) else: if (located_in(self.dbstate.db, mlist[0], mlist[1]) or located_in(self.dbstate.db, mlist[1], mlist[0])): msg = _("Cannot merge places.") msg2 = _("Merging these places would create a cycle in the " "place hierarchy.") - ErrorDialog(msg, msg2) + ErrorDialog(msg, msg2, parent=self.uistate.window) else: MergePlace(self.dbstate, self.uistate, mlist[0], mlist[1], self.merged) diff --git a/gramps/plugins/view/citationlistview.py b/gramps/plugins/view/citationlistview.py index f78d66d34..6e72ec90f 100644 --- a/gramps/plugins/view/citationlistview.py +++ b/gramps/plugins/view/citationlistview.py @@ -313,7 +313,7 @@ class CitationListView(ListView): "merge. A second citation can be selected by holding " "down the control key while clicking on the desired " "citation.") - ErrorDialog(msg, msg2) + ErrorDialog(msg, msg2, parent=self.uistate.window) else: citation1 = self.dbstate.db.get_citation_from_handle(mlist[0]) citation2 = self.dbstate.db.get_citation_from_handle(mlist[1]) @@ -324,7 +324,7 @@ class CitationListView(ListView): "source to perform a merge. If you want to merge " "these two citations, then you must merge the " "sources first.") - ErrorDialog(msg, msg2) + ErrorDialog(msg, msg2, parent=self.uistate.window) else: MergeCitation(self.dbstate, self.uistate, mlist[0], mlist[1]) diff --git a/gramps/plugins/view/citationtreeview.py b/gramps/plugins/view/citationtreeview.py index 372ba8591..f83250748 100644 --- a/gramps/plugins/view/citationtreeview.py +++ b/gramps/plugins/view/citationtreeview.py @@ -427,12 +427,13 @@ class CitationTreeView(ListView): except WindowActiveError: from gramps.gui.dialog import WarningDialog WarningDialog(_("Cannot share this reference"), - self.__blocked_text()) + self.__blocked_text(), + parent=self.uistate.window) else: msg = _("Cannot add citation.") msg2 = _("In order to add a citation to an existing source, " " you must select a source.") - ErrorDialog(msg, msg2) + ErrorDialog(msg, msg2, parent=self.uistate.window) # def remove(self, obj): self.remove_selected_objects() @@ -482,7 +483,8 @@ class CitationTreeView(ListView): except WindowActiveError: from gramps.gui.dialog import WarningDialog WarningDialog(_("Cannot share this reference"), - self.__blocked_text2()) + self.__blocked_text2(), + parent=self.uistate.window) def __blocked_text(self): """ @@ -516,7 +518,7 @@ class CitationTreeView(ListView): "merge. A second citation can be selected by holding " "down the control key while clicking on the desired " "citation.") - ErrorDialog(msg, msg2) + ErrorDialog(msg, msg2, parent=self.uistate.window) else: source1 = self.dbstate.db.get_source_from_handle(mlist[0]) citation1 = self.dbstate.db.get_citation_from_handle(mlist[0]) @@ -536,7 +538,7 @@ class CitationTreeView(ListView): "source to perform a merge. If you want to merge " "these two citations, then you must merge the " "sources first.") - ErrorDialog(msg, msg2) + ErrorDialog(msg, msg2, parent=self.uistate.window) else: MergeCitation(self.dbstate, self.uistate, mlist[0], mlist[1]) @@ -547,7 +549,7 @@ class CitationTreeView(ListView): msg2 = _("Both objects must be of the same type, either " "both must be sources, or both must be " "citations.") - ErrorDialog(msg, msg2) + ErrorDialog(msg, msg2, parent=self.uistate.window) def get_handle_from_gramps_id(self, gid): obj = self.dbstate.db.get_citation_from_gramps_id(gid) diff --git a/gramps/plugins/view/eventview.py b/gramps/plugins/view/eventview.py index cecfc6314..7ae7d5070 100644 --- a/gramps/plugins/view/eventview.py +++ b/gramps/plugins/view/eventview.py @@ -264,7 +264,7 @@ class EventView(ListView): msg2 = _("Exactly two events must be selected to perform a merge. " "A second object can be selected by holding down the " "control key while clicking on the desired event.") - ErrorDialog(msg, msg2) + ErrorDialog(msg, msg2, parent=self.uistate.window) else: MergeEvent(self.dbstate, self.uistate, mlist[0], mlist[1]) diff --git a/gramps/plugins/view/familyview.py b/gramps/plugins/view/familyview.py index 7cb929e10..28d46bb52 100644 --- a/gramps/plugins/view/familyview.py +++ b/gramps/plugins/view/familyview.py @@ -219,7 +219,8 @@ class FamilyView(ListView): WarningDialog( _("Could Not Set a Bookmark"), _("A bookmark could not be set because " - "no one was selected.")) + "no one was selected."), + parent=self.uistate.window) def add(self, obj): family = Family() @@ -243,13 +244,15 @@ class FamilyView(ListView): QuestionDialog(msg1, msg2, _('_Delete Family'), - lambda: self.delete_family_response(family)) + lambda: self.delete_family_response(family), + parent=self.uistate.window) else: MultiSelectDialog(self._message1_format, self._message2_format, handles, self.dbstate.db.get_family_from_handle, - yes_func=self.delete_family_response) + yes_func=self.delete_family_response, + parent=self.uistate.window) def _message1_format(self, family): """ @@ -298,7 +301,7 @@ class FamilyView(ListView): msg2 = _("Exactly two families must be selected to perform a merge." " A second family can be selected by holding down the " "control key while clicking on the desired family.") - ErrorDialog(msg, msg2) + ErrorDialog(msg, msg2, parent=self.uistate.window) else: MergeFamily(self.dbstate, self.uistate, mlist[0], mlist[1]) diff --git a/gramps/plugins/view/mediaview.py b/gramps/plugins/view/mediaview.py index 21cdc465e..a996d0852 100644 --- a/gramps/plugins/view/mediaview.py +++ b/gramps/plugins/view/mediaview.py @@ -351,7 +351,7 @@ class MediaView(ListView): msg2 = _("Exactly two media objects must be selected to perform a " "merge. A second object can be selected by holding down the " "control key while clicking on the desired object.") - ErrorDialog(msg, msg2) + ErrorDialog(msg, msg2, parent=self.uistate.window) else: MergeMedia(self.dbstate, self.uistate, mlist[0], mlist[1]) diff --git a/gramps/plugins/view/noteview.py b/gramps/plugins/view/noteview.py index 3f5599384..d2b74aa6c 100644 --- a/gramps/plugins/view/noteview.py +++ b/gramps/plugins/view/noteview.py @@ -242,7 +242,7 @@ class NoteView(ListView): msg2 = _("Exactly two notes must be selected to perform a merge. " "A second note can be selected by holding down the " "control key while clicking on the desired note.") - ErrorDialog(msg, msg2) + ErrorDialog(msg, msg2, parent=self.uistate.window) else: MergeNote(self.dbstate, self.uistate, mlist[0], mlist[1]) diff --git a/gramps/plugins/view/pedigreeview.py b/gramps/plugins/view/pedigreeview.py index a5018c80f..8aa9ec675 100644 --- a/gramps/plugins/view/pedigreeview.py +++ b/gramps/plugins/view/pedigreeview.py @@ -1494,7 +1494,8 @@ class PedigreeView(NavigationView): alive = probably_alive(person, self.dbstate.db) except RuntimeError: ErrorDialog(_('Relationship loop detected'), - _('A person was found to be his/her own ancestor.')) + _('A person was found to be his/her own ancestor.'), + parent=self.uistate.window) alive = False lst[index] = [person, val, None, alive, None] diff --git a/gramps/plugins/view/relview.py b/gramps/plugins/view/relview.py index 28bec2c1c..661faa97a 100644 --- a/gramps/plugins/view/relview.py +++ b/gramps/plugins/view/relview.py @@ -1350,7 +1350,8 @@ class RelationshipView(NavigationView): from gramps.gui.dialog import WarningDialog WarningDialog( _('Broken family detected'), - _('Please run the Check and Repair Database tool')) + _('Please run the Check and Repair Database tool'), + parent=self.uistate.window) return father_handle = family.get_father_handle() diff --git a/gramps/plugins/view/repoview.py b/gramps/plugins/view/repoview.py index 614102a5f..2a8d1603b 100644 --- a/gramps/plugins/view/repoview.py +++ b/gramps/plugins/view/repoview.py @@ -247,7 +247,7 @@ class RepositoryView(ListView): "merge. A second repository can be selected by holding " "down the control key while clicking on the desired " "repository.") - ErrorDialog(msg, msg2) + ErrorDialog(msg, msg2, parent=self.uistate.window) else: MergeRepository(self.dbstate, self.uistate, mlist[0], mlist[1]) diff --git a/gramps/plugins/view/sourceview.py b/gramps/plugins/view/sourceview.py index e5a1cef72..94b21f3bf 100644 --- a/gramps/plugins/view/sourceview.py +++ b/gramps/plugins/view/sourceview.py @@ -230,7 +230,7 @@ class SourceView(ListView): msg2 = _("Exactly two sources must be selected to perform a merge. " "A second source can be selected by holding down the " "control key while clicking on the desired source.") - ErrorDialog(msg, msg2) + ErrorDialog(msg, msg2, parent=self.uistate.window) else: MergeSource(self.dbstate, self.uistate, mlist[0], mlist[1])