diff --git a/gramps/gen/filters/rules/_changedsincebase.py b/gramps/gen/filters/rules/_changedsincebase.py index 119b25097..3562bb021 100644 --- a/gramps/gen/filters/rules/_changedsincebase.py +++ b/gramps/gen/filters/rules/_changedsincebase.py @@ -78,7 +78,7 @@ class ChangedSinceBase(Rule): time_sec = time.mktime(time_tup) except ValueError: from gramps.gui.dialog import WarningDialog - WarningDialog(_("Wrong format of date-time"), + WarningDialog(_("Wrong format of date-time"), # no-parent _("Only date-times in the iso format of yyyy-mm-dd " "hh:mm:ss, where the time part is optional, are " "accepted. %s does not satisfy.") % iso_date_time) diff --git a/gramps/gui/aboutdialog.py b/gramps/gui/aboutdialog.py index 246d34bb7..360626c87 100644 --- a/gramps/gui/aboutdialog.py +++ b/gramps/gui/aboutdialog.py @@ -82,7 +82,7 @@ except: # GrampsAboutDialog # #------------------------------------------------------------------------- -class GrampsAboutDialog(Gtk.AboutDialog): +class GrampsAboutDialog(Gtk.AboutDialog): # parent-OK """Create an About dialog with all fields set.""" def __init__(self, parent): """Setup all the fields shown in the About dialog.""" diff --git a/gramps/gui/configure.py b/gramps/gui/configure.py index 7b3deeed5..337f39df7 100644 --- a/gramps/gui/configure.py +++ b/gramps/gui/configure.py @@ -226,13 +226,15 @@ class ConfigureDialog(ManagedWindow): obj.get_text() % 'test_markup' except TypeError: print("WARNING: ignoring invalid value for '%s'" % constant) - ErrorDialog(_("Invalid or incomplete format definition."), - obj.get_text(), parent=self.window) + ErrorDialog( # parent-OK + _("Invalid or incomplete format definition."), + obj.get_text(), parent=self.window) obj.set_text('<b>%s</b>') except ValueError: print("WARNING: ignoring invalid value for '%s'" % constant) - ErrorDialog(_("Invalid or incomplete format definition."), - obj.get_text(), parent=self.window) + ErrorDialog( # parent-OK + _("Invalid or incomplete format definition."), + obj.get_text(), parent=self.window) obj.set_text('<b>%s</b>') self.__config.set(constant, obj.get_text()) @@ -774,7 +776,7 @@ class GrampsPreferences(ConfigureDialog): oldname = self.fmt_model.get_value(node, COL_NAME) # check to see if this pattern already exists if self.__check_for_name(translation, node): - ErrorDialog(_("This format exists already."), + ErrorDialog(_("This format exists already."), # parent-OK translation, parent=self.window) self.edit_button.emit('clicked') return @@ -1227,7 +1229,7 @@ class GrampsPreferences(ConfigureDialog): def date_format_changed(self, obj): config.set('preferences.date-format', obj.get_active()) - OkDialog(_('Change is not immediate'), + OkDialog(_('Change is not immediate'), # parent-OK _('Changing the date format will not take ' 'effect until the next time Gramps is started.'), parent=self.window) @@ -1395,20 +1397,21 @@ class GrampsPreferences(ConfigureDialog): try: addon_update_list = available_updates() except: - OkDialog(_("Checking Addons Failed"), + OkDialog(_("Checking Addons Failed"), # parent-OK _("The addon repository appears to be unavailable. " "Please try again later."), - self.window) + parent=self.window) return if len(addon_update_list) > 0: PluginWindows.UpdateAddons(addon_update_list, self.window) else: check_types = config.get('behavior.check-for-update-types') - OkDialog(_("There are no available addons of this type"), - _("Checked for '%s'") % - _("' and '").join([_(t) for t in check_types]), - self.window) + OkDialog( # parent-OK + _("There are no available addons of this type"), + _("Checked for '%s'") % + _("' and '").join([_(t) for t in check_types]), + parent=self.window) # List of translated strings used here # Dead code for l10n diff --git a/gramps/gui/dbloader.py b/gramps/gui/dbloader.py index a496a585a..6919b0397 100644 --- a/gramps/gui/dbloader.py +++ b/gramps/gui/dbloader.py @@ -83,24 +83,28 @@ class DbLoader(CLIDbLoader): self.import_info = None def _warn(self, title, warnmessage): - WarningDialog(title, warnmessage, parent=self.uistate.window) + WarningDialog(title, warnmessage, # parent-OK + parent=self.uistate.window) def _errordialog(self, title, errormessage): """ Show the error. In the GUI, the error is shown, and a return happens """ - ErrorDialog(title, errormessage, parent=self.uistate.window) + ErrorDialog(title, errormessage, # parent-OK + parent=self.uistate.window) return 1 def _dberrordialog(self, msg): import traceback exc = traceback.format_exc() try: - DBErrorDialog(str(msg.value), parent=self.uistate.window) + DBErrorDialog(str(msg.value), # parent-OK + parent=self.uistate.window) _LOG.error(str(msg.value)) except: - DBErrorDialog(str(msg), parent=self.uistate.window) + DBErrorDialog(str(msg), # parent-OK + parent=self.uistate.window) _LOG.error(str(msg) +"\n" + exc) def _begin_progress(self): @@ -121,7 +125,7 @@ class DbLoader(CLIDbLoader): # so we will lose the undo history. Warn the user. if self.dbstate.db.get_number_of_people() > 0: - warn_dialog = QuestionDialog2( + warn_dialog = QuestionDialog2( # parent-OK _('Undo history warning'), _('Proceeding with import will erase the undo history ' 'for this session. In particular, you will not be able ' @@ -129,7 +133,7 @@ class DbLoader(CLIDbLoader): 'If you think you may want to revert the import, ' 'please stop here and backup your database.'), _('_Proceed with import'), _('_Stop'), - self.uistate.window) + parent=self.uistate.window) if not warn_dialog.run(): return False @@ -194,7 +198,7 @@ class DbLoader(CLIDbLoader): return True # Finally, we give up and declare this an unknown format - ErrorDialog( + ErrorDialog( # parent-OK _("Could not open file: %s") % filename, _('File type "%s" is unknown to Gramps.\n\n' 'Valid types are: Gramps database, Gramps XML, ' @@ -219,14 +223,14 @@ class DbLoader(CLIDbLoader): if len(filename) == 0: return True elif os.path.isdir(filename): - ErrorDialog( + ErrorDialog( # parent-OK _('Cannot open file'), _('The selected file is a directory, not a file.\n'), parent=self.uistate.window) return True elif os.path.exists(filename): if not os.access(filename, os.R_OK): - ErrorDialog( + ErrorDialog( # parent-OK _('Cannot open file'), _('You do not have read access to the selected file.'), parent=self.uistate.window) @@ -237,7 +241,7 @@ class DbLoader(CLIDbLoader): f.close() os.remove(filename) except IOError: - ErrorDialog( + ErrorDialog( # parent-OK _('Cannot create file'), _('You do not have write access to the selected file.'), parent=self.uistate.window) @@ -260,7 +264,7 @@ class DbLoader(CLIDbLoader): dirname = os.path.dirname(filename) + os.path.sep config.set('paths.recent-import-dir', dirname) except UnicodeError as msg: - ErrorDialog( + ErrorDialog( # parent-OK _("Could not import file: %s") % filename, _("This file incorrectly identifies its character " "set, so it cannot be accurately imported. Please fix the " @@ -340,12 +344,13 @@ class DbLoader(CLIDbLoader): self.dbstate.change_database(db) break except DbUpgradeRequiredError as msg: - if QuestionDialog2(_("Are you sure you want to upgrade " - "this Family Tree?"), + if QuestionDialog2(_("Are you sure you want " # parent-OK + "to upgrade this Family Tree?"), str(msg), _("I have made a backup,\n" "please upgrade my Family Tree"), - _("Cancel"), self.uistate.window).run(): + _("Cancel"), + parent=self.uistate.window).run(): force_schema_upgrade = True force_bsddb_upgrade = False force_bsddb_downgrade = False @@ -354,12 +359,13 @@ class DbLoader(CLIDbLoader): self.dbstate.no_database() break except BsddbUpgradeRequiredError as msg: - if QuestionDialog2(_("Are you sure you want to upgrade " - "this Family Tree?"), + if QuestionDialog2(_("Are you sure you want " # parent-OK + "to upgrade this Family Tree?"), str(msg), _("I have made a backup,\n" "please upgrade my Family Tree"), - _("Cancel"), self.uistate.window).run(): + _("Cancel"), + parent=self.uistate.window).run(): force_schema_upgrade = False force_bsddb_upgrade = True force_bsddb_downgrade = False @@ -368,12 +374,13 @@ class DbLoader(CLIDbLoader): self.dbstate.no_database() break except BsddbDowngradeRequiredError as msg: - if QuestionDialog2(_("Are you sure you want to downgrade " - "this Family Tree?"), + if QuestionDialog2(_("Are you sure you want " # parent-OK + "to downgrade this Family Tree?"), str(msg), _("I have made a backup,\n" "please downgrade my Family Tree"), - _("Cancel"), self.uistate.window).run(): + _("Cancel"), + parent=self.uistate.window).run(): force_schema_upgrade = False force_bsddb_upgrade = False force_bsddb_downgrade = True @@ -382,12 +389,13 @@ class DbLoader(CLIDbLoader): self.dbstate.no_database() break except PythonUpgradeRequiredError as msg: - if QuestionDialog2(_("Are you sure you want to upgrade " - "this Family Tree?"), + if QuestionDialog2(_("Are you sure you want " # parent-OK + "to upgrade this Family Tree?"), str(msg), _("I have made a backup,\n" "please upgrade my Family Tree"), - _("Cancel"), self.uistate.window).run(): + _("Cancel"), + parent=self.uistate.window).run(): force_schema_upgrade = False force_bsddb_upgrade = False force_bsddb_downgrade = False diff --git a/gramps/gui/dialog.py b/gramps/gui/dialog.py index 817909425..f6e182df3 100644 --- a/gramps/gui/dialog.py +++ b/gramps/gui/dialog.py @@ -52,7 +52,7 @@ try: except: ICON = None -class SaveDialog: +class SaveDialog: # parent-OK def __init__(self, msg1, msg2, task1, task2, parent=None): self.xml = Glade(toplevel='savedialog') @@ -83,7 +83,7 @@ class SaveDialog: config.set('interface.dont-ask', self.dontask.get_active()) self.top.destroy() -class QuestionDialog: +class QuestionDialog: # parent-OK def __init__(self, msg1, msg2, label, task, parent=None): self.xml = Glade(toplevel='questiondialog') @@ -115,7 +115,7 @@ def on_activate_link(label, uri): display_url(uri) return True -class QuestionDialog2: +class QuestionDialog2: # parent-OK def __init__(self, msg1, msg2, label_msg1, label_msg2, parent=None): self.xml = Glade(toplevel='questiondialog') @@ -147,7 +147,7 @@ class QuestionDialog2: self.top.destroy() return (response == Gtk.ResponseType.ACCEPT) -class OptionDialog: +class OptionDialog: # parent-OK def __init__(self, msg1, msg2, btnmsg1, task1, btnmsg2, task2, parent=None): self.xml = Glade(toplevel='optiondialog') @@ -180,7 +180,7 @@ class OptionDialog: def get_response(self): return self.response -class ErrorDialog(Gtk.MessageDialog): +class ErrorDialog(Gtk.MessageDialog): # parent-OK def __init__(self, msg1, msg2="", parent=None): Gtk.MessageDialog.__init__(self, parent, @@ -195,7 +195,7 @@ class ErrorDialog(Gtk.MessageDialog): self.run() self.destroy() -class RunDatabaseRepair(ErrorDialog): +class RunDatabaseRepair(ErrorDialog): # parent-OK def __init__(self, msg, parent=None): ErrorDialog.__init__( self, @@ -207,7 +207,7 @@ class RunDatabaseRepair(ErrorDialog): '%(gramps_bugtracker_url)s\n\n') % {'gramps_bugtracker_url' : URL_BUGHOME} + msg, parent) -class DBErrorDialog(ErrorDialog): +class DBErrorDialog(ErrorDialog): # parent-OK def __init__(self, msg, parent=None): ErrorDialog.__init__( self, @@ -217,7 +217,7 @@ class DBErrorDialog(ErrorDialog): "the Family Tree Manager. Select the database and " 'click on the Repair button') + '\n\n' + msg, parent) -class WarningDialog(Gtk.MessageDialog): +class WarningDialog(Gtk.MessageDialog): # parent-OK def __init__(self, msg1, msg2="", parent=None): Gtk.MessageDialog.__init__(self, parent, @@ -237,7 +237,7 @@ class WarningDialog(Gtk.MessageDialog): self.run() self.destroy() -class OkDialog(Gtk.MessageDialog): +class OkDialog(Gtk.MessageDialog): # parent-OK def __init__(self, msg1, msg2="", parent=None): Gtk.MessageDialog.__init__(self, parent, @@ -252,7 +252,7 @@ class OkDialog(Gtk.MessageDialog): self.run() self.destroy() -class InfoDialog: +class InfoDialog: # parent-OK """ Non modal dialog to show selectable info in a scrolled window """ @@ -285,7 +285,7 @@ class InfoDialog: #no matter how it finishes, destroy dialog dialog.destroy() -class MissingMediaDialog: +class MissingMediaDialog: # parent-OK def __init__(self, msg1, msg2, task1, task2, task3, parent=None): self.xml = Glade(toplevel='missmediadialog') @@ -332,14 +332,14 @@ class MissingMediaDialog: self.top.destroy() def warn(self, obj, obj2): - WarningDialog( + WarningDialog( # parent-OK _("Attempt to force closing the dialog"), _("Please do not force closing this important dialog.\n" "Instead select one of the available options"), parent=self.top) return True -class MultiSelectDialog: +class MultiSelectDialog: # parent-OK def __init__(self, msg1_func, msg2_func, items, lookup, cancel_func=None, no_func=None, yes_func=None, parent=None): @@ -405,14 +405,14 @@ class MultiSelectDialog: self.top.destroy() def warn(self, obj, obj2): - WarningDialog( + WarningDialog( # parent-OK _("Attempt to force closing the dialog"), _("Please do not force closing this important dialog.\n" "Instead select one of the available options"), parent=self.top) return True -class MessageHideDialog: +class MessageHideDialog: # parent-OK def __init__(self, title, message, key, parent=None): self.xml = Glade(toplevel='hidedialog') @@ -452,7 +452,7 @@ def main(args): def test_info(obj): - InfoDialog('The title', + InfoDialog('The title', # parent-OK 'This is a lot of info\n to show to all!', parent=win) diff --git a/gramps/gui/editors/addmedia.py b/gramps/gui/editors/addmedia.py index a713554ed..e701114c8 100644 --- a/gramps/gui/editors/addmedia.py +++ b/gramps/gui/editors/addmedia.py @@ -157,7 +157,7 @@ class AddMedia(ManagedWindow): if self.file_text.get_filename() is None: msgstr = _("Import failed") msgstr2 = _("The filename supplied could not be found.") - ErrorDialog(msgstr, msgstr2, parent=self.window) + ErrorDialog(msgstr, msgstr2, parent=self.window) # parent-OK return filename = self.file_text.get_filename() @@ -168,7 +168,7 @@ class AddMedia(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-OK parent=self.window) return filename = relative_path(filename, pname) @@ -244,5 +244,5 @@ def scale_image(path, size): return image1.scale_simple(int(scale*width), int(scale*height), GdkPixbuf.InterpType.BILINEAR) except: - WarningDialog(title_msg, detail_msg) + WarningDialog(title_msg, detail_msg) # no-parent return GdkPixbuf.Pixbuf.new_from_file(ICON) diff --git a/gramps/gui/editors/displaytabs/citationembedlist.py b/gramps/gui/editors/displaytabs/citationembedlist.py index dd117f090..aa3eb5124 100644 --- a/gramps/gui/editors/displaytabs/citationembedlist.py +++ b/gramps/gui/editors/displaytabs/citationembedlist.py @@ -168,7 +168,7 @@ class CitationEmbedList(EmbeddedList, DbGUIElement): callertitle=self.callertitle) except WindowActiveError: from ...dialog import WarningDialog - WarningDialog(_("Cannot share this reference"), + WarningDialog(_("Cannot share this reference"), # no-parent self.__blocked_text()) elif isinstance(object, Citation): try: @@ -178,7 +178,7 @@ class CitationEmbedList(EmbeddedList, DbGUIElement): callertitle=self.callertitle) except WindowActiveError: from ...dialog import WarningDialog - WarningDialog(_("Cannot share this reference"), + WarningDialog(_("Cannot share this reference"), # no-parent self.__blocked_text()) else: raise ValueError("selection must be either source or citation") @@ -251,7 +251,7 @@ class CitationEmbedList(EmbeddedList, DbGUIElement): callertitle=self.callertitle) except WindowActiveError: from ...dialog import WarningDialog - WarningDialog(_("Cannot share this reference"), + WarningDialog(_("Cannot share this reference"), # no-parent self.__blocked_text()) else: raise ValueError("selection must be either source or citation") @@ -271,7 +271,7 @@ class CitationEmbedList(EmbeddedList, DbGUIElement): callertitle=self.callertitle) except WindowActiveError: from ...dialog import WarningDialog - WarningDialog(_("Cannot share this reference"), + WarningDialog(_("Cannot share this reference"), # no-parent self.__blocked_text()) else: raise ValueError("selection must be either source or citation") diff --git a/gramps/gui/editors/displaytabs/embeddedlist.py b/gramps/gui/editors/displaytabs/embeddedlist.py index 86d0ead2c..99c7bbd23 100644 --- a/gramps/gui/editors/displaytabs/embeddedlist.py +++ b/gramps/gui/editors/displaytabs/embeddedlist.py @@ -576,7 +576,7 @@ class EmbeddedList(ButtonTab): from ...dialog import RunDatabaseRepair import traceback traceback.print_exc() - RunDatabaseRepair(str(msg)) + RunDatabaseRepair(str(msg)) # no-parent return self.tree.set_model(self.model) diff --git a/gramps/gui/editors/displaytabs/eventembedlist.py b/gramps/gui/editors/displaytabs/eventembedlist.py index fb6c6c828..3b19f4f11 100644 --- a/gramps/gui/editors/displaytabs/eventembedlist.py +++ b/gramps/gui/editors/displaytabs/eventembedlist.py @@ -264,7 +264,7 @@ class EventEmbedList(DbGUIElement, GroupEmbeddedList): event, ref, self.object_added) except WindowActiveError: from ...dialog import WarningDialog - WarningDialog(_("Cannot share this reference"), + WarningDialog(_("Cannot share this reference"), # no-parent self.__blocked_text()) def edit_button_clicked(self, obj): @@ -277,7 +277,7 @@ class EventEmbedList(DbGUIElement, GroupEmbeddedList): event, ref[1], self.object_edited) except WindowActiveError: from ...dialog import WarningDialog - WarningDialog(_("Cannot edit this reference"), + WarningDialog(_("Cannot edit this reference"), # no-parent self.__blocked_text()) elif ref and ref[0] != self._WORKGROUP: #bring up family editor @@ -318,10 +318,9 @@ class EventEmbedList(DbGUIElement, GroupEmbeddedList): handle change request of non native data """ from ...dialog import WarningDialog - WarningDialog( - _("Cannot change Person"), - _("You cannot change Person events in the Family Editor") - ) + WarningDialog(_("Cannot change Person"), # no-parent + _("You cannot change Person events in the Family Editor") + ) def _handle_drag(self, row, obj): """ @@ -341,7 +340,7 @@ class EventEmbedList(DbGUIElement, GroupEmbeddedList): event, obj, self.object_edited) except WindowActiveError: from ...dialog import WarningDialog - WarningDialog( + WarningDialog( # no-parent _("Cannot edit this reference"), _("This event reference cannot be edited at this time. " "Either the associated event is already being edited " diff --git a/gramps/gui/editors/displaytabs/gallerytab.py b/gramps/gui/editors/displaytabs/gallerytab.py index 46fc556d5..79c8efac9 100644 --- a/gramps/gui/editors/displaytabs/gallerytab.py +++ b/gramps/gui/editors/displaytabs/gallerytab.py @@ -259,7 +259,7 @@ class GalleryTab(ButtonTab, DbGUIElement): if obj is None : #notify user of error from ...dialog import RunDatabaseRepair - RunDatabaseRepair( + RunDatabaseRepair( # no-parent _('Non existing media found in the Gallery')) else : pixbuf = get_thumbnail_image( @@ -334,7 +334,7 @@ class GalleryTab(ButtonTab, DbGUIElement): src, sref, self.add_callback) except WindowActiveError: from ...dialog import WarningDialog - WarningDialog(_("Cannot share this reference"), + WarningDialog(_("Cannot share this reference"), # no-parent self.__blocked_text()) def del_button_clicked(self, obj): @@ -354,7 +354,7 @@ class GalleryTab(ButtonTab, DbGUIElement): obj, ref, self.edit_callback) except WindowActiveError: from ...dialog import WarningDialog - WarningDialog(_("Cannot edit this reference"), + WarningDialog(_("Cannot edit this reference"), # no-parent self.__blocked_text()) def edit_callback(self, media_ref, media): diff --git a/gramps/gui/editors/displaytabs/personeventembedlist.py b/gramps/gui/editors/displaytabs/personeventembedlist.py index 69c9b3a20..f8eccb2e4 100644 --- a/gramps/gui/editors/displaytabs/personeventembedlist.py +++ b/gramps/gui/editors/displaytabs/personeventembedlist.py @@ -126,7 +126,7 @@ class PersonEventEmbedList(EventEmbedList): handle change request of non native data """ from ...dialog import WarningDialog - WarningDialog( + WarningDialog( # no-parent _("Cannot change Family"), _("You cannot change Family events in the Person Editor") ) diff --git a/gramps/gui/editors/displaytabs/placerefembedlist.py b/gramps/gui/editors/displaytabs/placerefembedlist.py index b105e48f8..86afc7c02 100644 --- a/gramps/gui/editors/displaytabs/placerefembedlist.py +++ b/gramps/gui/editors/displaytabs/placerefembedlist.py @@ -138,7 +138,7 @@ class PlaceRefEmbedList(EmbeddedList): def handle_extra_type(self, objtype, obj): if obj in self.get_skip_list(self.handle): - ErrorDialog(_("Place cycle detected"), + ErrorDialog(_("Place cycle detected"), # no-parent _("The place you are adding is already enclosed by " "this place")) return diff --git a/gramps/gui/editors/displaytabs/repoembedlist.py b/gramps/gui/editors/displaytabs/repoembedlist.py index 6528112fc..ba176e192 100644 --- a/gramps/gui/editors/displaytabs/repoembedlist.py +++ b/gramps/gui/editors/displaytabs/repoembedlist.py @@ -164,7 +164,7 @@ class RepoEmbedList(EmbeddedList, DbGUIElement): ref, self.edit_callback) except WindowActiveError: from ...dialog import WarningDialog - WarningDialog( + WarningDialog( # no-parent _("Cannot edit this reference"), _("This repository reference cannot be edited at this " "time. Either the associated repository is already " diff --git a/gramps/gui/editors/editattribute.py b/gramps/gui/editors/editattribute.py index 4a36d9240..965e4c45c 100644 --- a/gramps/gui/editors/editattribute.py +++ b/gramps/gui/editors/editattribute.py @@ -145,7 +145,7 @@ class EditAttributeRoot(EditSecondary): if t.is_custom() and str(t) == '': from ..dialog import ErrorDialog - ErrorDialog( + ErrorDialog( # parent-OK _("Cannot save attribute"), _("The attribute type cannot be empty"), parent=self.window) diff --git a/gramps/gui/editors/editcitation.py b/gramps/gui/editors/editcitation.py index d0bc1a7aa..825cc74e7 100644 --- a/gramps/gui/editors/editcitation.py +++ b/gramps/gui/editors/editcitation.py @@ -284,7 +284,7 @@ class EditCitation(EditPrimary): """ self.ok_button.set_sensitive(False) if not self.obj.get_reference_handle(): - ErrorDialog(_("No source selected"), + ErrorDialog(_("No source selected"), # parent-OK _("A source is anything (personal testimony, " "video recording, photograph, newspaper column, " "gravestone...) from which information can be " @@ -305,7 +305,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, parent=self.window) + ErrorDialog(msg1, msg2, parent=self.window) # parent-OK self.ok_button.set_sensitive(True) return diff --git a/gramps/gui/editors/editevent.py b/gramps/gui/editors/editevent.py index a26959ea9..479a11540 100644 --- a/gramps/gui/editors/editevent.py +++ b/gramps/gui/editors/editevent.py @@ -236,7 +236,7 @@ class EditEvent(EditPrimary): def save(self, *obj): self.ok_button.set_sensitive(False) if self.object_is_empty(): - ErrorDialog(_("Cannot save event"), + ErrorDialog(_("Cannot save event"), # parent-OK _("No data exists for this event. Please " "enter data or cancel the edit."), parent=self.window) @@ -253,13 +253,13 @@ 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, parent=self.window) + ErrorDialog(msg1, msg2, parent=self.window) # parent-OK self.ok_button.set_sensitive(True) return t = self.obj.get_type() if t.is_custom() and str(t) == '': - ErrorDialog( + ErrorDialog( # parent-OK _("Cannot save event"), _("The event type cannot be empty"), parent=self.window) diff --git a/gramps/gui/editors/editfamily.py b/gramps/gui/editors/editfamily.py index 78ed117ff..08a060ca1 100644 --- a/gramps/gui/editors/editfamily.py +++ b/gramps/gui/editors/editfamily.py @@ -363,7 +363,7 @@ class EditFamily(EditPrimary): for i in self.hidden: i.set_sensitive(False) - MessageHideDialog( + MessageHideDialog( # parent-OK _("Adding parents to a person"), _("It is possible to accidentally create multiple " "families with the same parents. To help avoid " @@ -459,14 +459,15 @@ class EditFamily(EditPrimary): # No matter why the family changed (eg delete of a source), we notify # the user - WarningDialog( + WarningDialog( # parent-OK _("Family has changed"), _("The %(object)s you are editing has changed outside this editor." " This can be due to a change in one of the main views, for " "example a source used here is deleted in the source view.\n" "To make sure the information shown is still correct, the " "data shown has been updated. Some edits you have made may have" - " been lost.") % {'object': _('family')}, parent=self.window) + " been lost.") % {'object': _('family')}, + parent=self.window) def topdata_updated(self, *obj): """ @@ -902,7 +903,7 @@ class EditFamily(EditPrimary): common = list(mfam.intersection(ffam)) if len(common) > 0: if self.add_parent or self.obj.handle not in common: - WarningDialog( + WarningDialog( # parent-OK _('Duplicate Family'), _('A family with these parents already exists ' 'in the database. If you save, you will create ' @@ -1042,7 +1043,7 @@ class EditFamily(EditPrimary): #try: self.__do_save() #except bsddb_db.DBRunRecoveryError as msg: - # RunDatabaseRepair(msg[1]) + # RunDatabaseRepair(msg[1]) # no-parent def __do_save(self): self.ok_button.set_sensitive(False) @@ -1061,9 +1062,9 @@ class EditFamily(EditPrimary): father = self.db.get_person_from_handle(self.obj.get_father_handle()) 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, + ErrorDialog(_("A father cannot be his own child"), # parent-OK + _("%s is listed as both the father and child " + "of the family.") % name, parent=self.window) self.ok_button.set_sensitive(True) return @@ -1072,15 +1073,15 @@ class EditFamily(EditPrimary): mother = self.db.get_person_from_handle(self.obj.get_mother_handle()) 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, + ErrorDialog(_("A mother cannot be her own child"), # parent-OK + _("%s is listed as both the mother and child " + "of the family.") % name, parent=self.window) self.ok_button.set_sensitive(True) return if not original and self.object_is_empty(): - ErrorDialog( + ErrorDialog( # parent-OK _("Cannot save family"), _("No data exists for this family. " "Please enter data or cancel the edit."), @@ -1096,7 +1097,7 @@ class EditFamily(EditPrimary): "enter a different ID or leave " "blank to get the next available ID value.") % { 'id' : id} - ErrorDialog(msg1, msg2, parent=self.window) + ErrorDialog(msg1, msg2, parent=self.window) # parent-OK self.ok_button.set_sensitive(True) return diff --git a/gramps/gui/editors/editmedia.py b/gramps/gui/editors/editmedia.py index b027dccbb..e76b3b6cb 100644 --- a/gramps/gui/editors/editmedia.py +++ b/gramps/gui/editors/editmedia.py @@ -285,7 +285,7 @@ class EditMedia(EditPrimary): self.ok_button.set_sensitive(False) if self.object_is_empty(): - ErrorDialog(_("Cannot save media object"), + ErrorDialog(_("Cannot save media object"), # parent-OK _("No data exists for this media object. Please " "enter data or cancel the edit."), parent=self.window) @@ -302,7 +302,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, parent=self.window) + ErrorDialog(msg1, msg2, parent=self.window) # parent-OK self.ok_button.set_sensitive(True) return @@ -316,7 +316,7 @@ class EditMedia(EditPrimary): "value '%(path)s'. This path does not exist!" " Please enter a different path") % { 'path' : path } - ErrorDialog(msg1, msg2, parent=self.window) + ErrorDialog(msg1, msg2, parent=self.window) # parent-OK self.ok_button.set_sensitive(True) return diff --git a/gramps/gui/editors/editname.py b/gramps/gui/editors/editname.py index 0ec2763d3..3951bb68f 100644 --- a/gramps/gui/editors/editname.py +++ b/gramps/gui/editors/editname.py @@ -376,7 +376,7 @@ class EditName(EditSecondary): if self.global_group_set and not self.original_group_set : #warn that group will revert to surname from ..dialog import QuestionDialog2 - q = QuestionDialog2( + q = QuestionDialog2( # parent-OK _("Break global name grouping?"), _("All people with the name of %(surname)s will no longer " "be grouped with the name of %(group_name)s." @@ -408,7 +408,7 @@ class EditName(EditSecondary): if self.global_group_as != group_as: from ..dialog import QuestionDialog2 - q = QuestionDialog2( + q = QuestionDialog2( # parent-OK _("Group all people with the same name?"), _("You have the choice of grouping all people with the " "name of %(surname)s with the name of %(group_name)s, or " diff --git a/gramps/gui/editors/editnote.py b/gramps/gui/editors/editnote.py index ffb536574..7aa4c18b0 100644 --- a/gramps/gui/editors/editnote.py +++ b/gramps/gui/editors/editnote.py @@ -310,7 +310,7 @@ class EditNote(EditPrimary): self.update_note() if self.object_is_empty(): - ErrorDialog(_("Cannot save note"), + ErrorDialog(_("Cannot save note"), # parent-OK _("No data exists for this note. Please " "enter data or cancel the edit."), parent=self.window) @@ -325,7 +325,7 @@ class EditNote(EditPrimary): "enter a different ID or leave " "blank to get the next available ID value.") % { 'id' : id } - ErrorDialog(msg1, msg2, parent=self.window) + ErrorDialog(msg1, msg2, parent=self.window) # parent-OK self.ok_button.set_sensitive(True) return diff --git a/gramps/gui/editors/editperson.py b/gramps/gui/editors/editperson.py index 579cbf750..e068931d3 100644 --- a/gramps/gui/editors/editperson.py +++ b/gramps/gui/editors/editperson.py @@ -747,7 +747,7 @@ class EditPerson(EditPrimary): def _check_for_unknown_gender(self): if self.obj.get_gender() == Person.UNKNOWN: - d = GenderDialog(self.window) + d = GenderDialog(parent=self.window) # parent-OK gender = d.run() d.destroy() if gender >= 0: @@ -810,7 +810,7 @@ class EditPerson(EditPrimary): msg = _("Changing the gender caused problems " "with marriage information.\nPlease check " "the person's marriages.") - ErrorDialog(msg2, msg, parent=self.window) + ErrorDialog(msg2, msg, parent=self.window) # parent-OK def save(self, *obj): """ @@ -818,7 +818,7 @@ class EditPerson(EditPrimary): """ self.ok_button.set_sensitive(False) if self.object_is_empty(): - ErrorDialog(_("Cannot save person"), + ErrorDialog(_("Cannot save person"), # parent-OK _("No data exists for this person. Please " "enter data or cancel the edit."), parent=self.window) @@ -849,7 +849,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, parent=self.window) + ErrorDialog(msg1, msg2, parent=self.window) # parent-OK self.ok_button.set_sensitive(True) return @@ -957,7 +957,7 @@ class EditPerson(EditPrimary): if obj is None : #notify user of error from ..dialog import RunDatabaseRepair - RunDatabaseRepair( + RunDatabaseRepair( # no-parent _('Non existing media found in the Gallery')) else : self.load_photo(ref, obj) diff --git a/gramps/gui/editors/editpersonref.py b/gramps/gui/editors/editpersonref.py index 11acf9dfe..57020f551 100644 --- a/gramps/gui/editors/editpersonref.py +++ b/gramps/gui/editors/editpersonref.py @@ -237,7 +237,7 @@ class EditPersonRef(EditSecondary): else: from ..dialog import ErrorDialog - ErrorDialog( + ErrorDialog( # no-parent _('No person selected'), _('You must either select a person or Cancel ' 'the edit')) diff --git a/gramps/gui/editors/editplace.py b/gramps/gui/editors/editplace.py index 12a5247a5..25ab60bc6 100644 --- a/gramps/gui/editors/editplace.py +++ b/gramps/gui/editors/editplace.py @@ -285,7 +285,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, parent=self.window) + ErrorDialog(msg1, msg2, parent=self.window) # parent-OK self.ok_button.set_sensitive(True) return @@ -299,7 +299,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, parent=self.window) + ErrorDialog(msg1, msg2, parent=self.window) # parent-OK self.ok_button.set_sensitive(True) return diff --git a/gramps/gui/editors/editplacename.py b/gramps/gui/editors/editplacename.py index e627d51a1..a2af9635e 100644 --- a/gramps/gui/editors/editplacename.py +++ b/gramps/gui/editors/editplacename.py @@ -135,7 +135,7 @@ class EditPlaceName(EditSecondary): def save(self, *obj): if not self.obj.get_value(): - ErrorDialog(_("Cannot save place name"), + ErrorDialog(_("Cannot save place name"), # parent-OK _("The place name cannot be empty"), parent=self.window) return diff --git a/gramps/gui/editors/editplaceref.py b/gramps/gui/editors/editplaceref.py index 9592f648a..fb3b8a886 100644 --- a/gramps/gui/editors/editplaceref.py +++ b/gramps/gui/editors/editplaceref.py @@ -276,7 +276,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, parent=self.window) + ErrorDialog(msg1, msg2, parent=self.window) # parent-OK self.ok_button.set_sensitive(True) return diff --git a/gramps/gui/editors/editprimary.py b/gramps/gui/editors/editprimary.py index 29df45f68..b2f74fbf6 100644 --- a/gramps/gui/editors/editprimary.py +++ b/gramps/gui/editors/editprimary.py @@ -234,7 +234,7 @@ class EditPrimary(ManagedWindow, DbGUIElement, metaclass=abc.ABCMeta): """If the data has changed, give the user a chance to cancel the close window""" if not config.get('interface.dont-ask') and self.data_has_changed(): - SaveDialog( + SaveDialog( # parent-OK _('Save Changes?'), _('If you close without saving, the changes you ' 'have made will be lost'), diff --git a/gramps/gui/editors/editreference.py b/gramps/gui/editors/editreference.py index 5282d1f8c..08179d94a 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, parent=self.window) + ErrorDialog(msg1, msg2, parent=self.window) # parent-OK return True return False diff --git a/gramps/gui/editors/editrepository.py b/gramps/gui/editors/editrepository.py index 1f1291b06..500bd3f11 100644 --- a/gramps/gui/editors/editrepository.py +++ b/gramps/gui/editors/editrepository.py @@ -176,7 +176,7 @@ class EditRepository(EditPrimary): def save(self, *obj): self.ok_button.set_sensitive(False) if self.object_is_empty(): - ErrorDialog(_("Cannot save repository"), + ErrorDialog(_("Cannot save repository"), # parent-OK _("No data exists for this repository. Please " "enter data or cancel the edit."), parent=self.window) @@ -193,7 +193,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, parent=self.window) + ErrorDialog(msg1, msg2, parent=self.window) # parent-OK self.ok_button.set_sensitive(True) return diff --git a/gramps/gui/editors/editsource.py b/gramps/gui/editors/editsource.py index bb8a98aed..6e0247b48 100644 --- a/gramps/gui/editors/editsource.py +++ b/gramps/gui/editors/editsource.py @@ -196,7 +196,7 @@ class EditSource(EditPrimary): def save(self, *obj): self.ok_button.set_sensitive(False) if self.object_is_empty(): - ErrorDialog(_("Cannot save source"), + ErrorDialog(_("Cannot save source"), # parent-OK _("No data exists for this source. Please " "enter data or cancel the edit."), parent=self.window) @@ -213,7 +213,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, parent=self.window) + ErrorDialog(msg1, msg2, parent=self.window) # parent-OK self.ok_button.set_sensitive(True) return diff --git a/gramps/gui/editors/filtereditor.py b/gramps/gui/editors/filtereditor.py index 2ab8b29e9..b15ac095c 100644 --- a/gramps/gui/editors/filtereditor.py +++ b/gramps/gui/editors/filtereditor.py @@ -1177,7 +1177,7 @@ class FilterEditor(ManagedWindow): gfilter = self.clist.get_object(node) name = gfilter.get_name() if self.check_recursive_filters(self.namespace, name): - QuestionDialog( _('Delete Filter?'), + QuestionDialog( _('Delete Filter?'), # parent-OK _('This filter is currently being used ' 'as the base for other filters. Deleting' 'this filter will result in removing all ' diff --git a/gramps/gui/grampsgui.py b/gramps/gui/grampsgui.py index a338afd77..4f24aa307 100644 --- a/gramps/gui/grampsgui.py +++ b/gramps/gui/grampsgui.py @@ -141,7 +141,7 @@ def _display_generic_message(warning_type, config_key, parent=None): """ if not config.get(config_key): from .dialog import WarningDialog - WarningDialog( + WarningDialog( # parent-OK _('Danger: This is unstable code!'), _("This Gramps ('%s') is a development release.\n" ) % warning_type + @@ -175,7 +175,8 @@ def _display_gtk_gettext_message(parent=None): LOG.warning("GTK translations missing, GUI will be broken, " "especially for RTL languages!") from .dialog import WarningDialog - WarningDialog(_("Gramps detected an incomplete GTK installation"), + WarningDialog(_("Gramps detected " # parent-OK + "an incomplete GTK installation"), _("GTK translations for the current language (%(language)s) " "are missing.\n" "%(bold_start)sGramps%(bold_end)s will " @@ -261,7 +262,8 @@ class Gramps: if hasattr(self, '_vm'): if hasattr(self._vm, 'window'): parent = self._vm.window - ErrorDialog(_("Error parsing arguments"), string, parent=parent) + ErrorDialog(_("Error parsing arguments"), string, # parent-OK + parent=parent) #------------------------------------------------------------------------- # @@ -279,13 +281,13 @@ def __startgramps(errors, argparser): #handle first existing errors in GUI fashion if errors: for error in errors: - ErrorDialog(error[0], error[1]) + ErrorDialog(error[0], error[1]) # no-parent Gtk.main_quit() sys.exit(1) if argparser.errors: for error in argparser.errors: - ErrorDialog(error[0], error[1]) + ErrorDialog(error[0], error[1]) # no-parent Gtk.main_quit() sys.exit(1) diff --git a/gramps/gui/merge/mergefamily.py b/gramps/gui/merge/mergefamily.py index 6ba11cbc3..273c76990 100644 --- a/gramps/gui/merge/mergefamily.py +++ b/gramps/gui/merge/mergefamily.py @@ -219,7 +219,7 @@ class MergeFamily(ManagedWindow): phoenix_fh, phoenix_mh) query.execute() except MergeError as err: - ErrorDialog(_("Cannot merge people"), str(err), + ErrorDialog(_("Cannot merge people"), str(err), # parent-OK parent=self.uistate.window) self.uistate.set_busy_cursor(False) self.close() diff --git a/gramps/gui/merge/mergeperson.py b/gramps/gui/merge/mergeperson.py index 05a5d74d0..19f3257c9 100644 --- a/gramps/gui/merge/mergeperson.py +++ b/gramps/gui/merge/mergeperson.py @@ -325,7 +325,7 @@ class MergePerson(ManagedWindow): query = MergePersonQuery(self.database, phoenix, titanic) query.execute() except MergeError as err: - ErrorDialog(_("Cannot merge people"), str(err), + ErrorDialog(_("Cannot merge people"), str(err), # parent-OK parent=self.uistate.window) self.uistate.set_busy_cursor(False) self.close() diff --git a/gramps/gui/plug/_guioptions.py b/gramps/gui/plug/_guioptions.py index b8b6a8cfd..8381b2e30 100644 --- a/gramps/gui/plug/_guioptions.py +++ b/gramps/gui/plug/_guioptions.py @@ -1240,7 +1240,7 @@ class GuiPersonListOption(Gtk.Box): spouse_name = _nd.display(spouse) text = _('Also include %s?') % spouse_name - prompt = OptionDialog(_('Select Person'), + prompt = OptionDialog(_('Select Person'), # parent-OK text, _('No'), None, _('Yes'), None, diff --git a/gramps/gui/plug/_windows.py b/gramps/gui/plug/_windows.py index e717e4d6e..e3f658d5f 100644 --- a/gramps/gui/plug/_windows.py +++ b/gramps/gui/plug/_windows.py @@ -611,7 +611,8 @@ class PluginStatus(ManagedWindow): 'plugfil': _("Filename"), 'plugpat': _("Location"), } - InfoDialog(_('Detailed Info'), infotxt, parent=self.window) + InfoDialog(_('Detailed Info'), infotxt, # parent-OK + parent=self.window) def __hide(self, obj, list_obj, id_col, hide_col): """ Callback function from the "Hide" button @@ -1191,22 +1192,22 @@ class UpdateAddons: if not longop.was_cancelled(): longop.end() if errors: - OkDialog(_("Installation Errors"), + OkDialog(_("Installation Errors"), # parent-OK _("The following addons had errors: ") + ", ".join(errors), - self.window) + parent=self.window) if count: - OkDialog(_("Done downloading and installing addons"), + OkDialog(_("Done downloading and installing addons"), # parent-OK # translators: leave all/any {...} untranslated "%s %s" % (ngettext("{number_of} addon was installed.", "{number_of} addons were installed.", count).format(number_of=count), _("You need to restart Gramps to see new views.")), - self.window) + parent=self.window) else: - OkDialog(_("Done downloading and installing addons"), + OkDialog(_("Done downloading and installing addons"), # parent-OK _("No addons were installed."), - self.window) + parent=self.window) self.window.destroy() #------------------------------------------------------------------------- diff --git a/gramps/gui/plug/export/_exportoptions.py b/gramps/gui/plug/export/_exportoptions.py index a5cacbd5c..d99d63427 100644 --- a/gramps/gui/plug/export/_exportoptions.py +++ b/gramps/gui/plug/export/_exportoptions.py @@ -662,7 +662,7 @@ class WriterOptionBox: lambda : self.edit_filter_save(filterdb, namespace)) else: # can't edit this filter from ...dialog import ErrorDialog - ErrorDialog(_("Cannot edit a system filter"), + ErrorDialog(_("Cannot edit a system filter"), # no-parent _("Please select a different filter to edit")) def edit_filter_save(self, filterdb, namespace): diff --git a/gramps/gui/plug/report/_bookdialog.py b/gramps/gui/plug/report/_bookdialog.py index 0820472c0..f39755015 100644 --- a/gramps/gui/plug/report/_bookdialog.py +++ b/gramps/gui/plug/report/_bookdialog.py @@ -237,7 +237,7 @@ class BookListDisplay: def on_booklist_cancel_clicked(self, obj): """ cancel the booklist dialog """ if self.unsaved_changes: - qqq = QuestionDialog2( + qqq = QuestionDialog2( # parent-OK _('Discard Unsaved Changes'), _('You have made changes which have not been saved.'), _('Proceed'), @@ -440,7 +440,7 @@ class BookSelector(ManagedWindow): if book.get_output(): self.book.set_output(book.get_output()) if book.get_dbname() != self._db.get_save_path(): - WarningDialog( + WarningDialog( # parent-OK _('Different database'), _('This book was created with the references to database ' '%s.\n\n This makes references to the central person ' @@ -547,7 +547,7 @@ class BookSelector(ManagedWindow): """ store, the_iter = self.book_model.get_selected() if not the_iter: - WarningDialog(_('No selected book item'), + WarningDialog(_('No selected book item'), # parent-OK _('Please select a book item to configure.'), parent=self.window) return @@ -711,7 +711,8 @@ class BookSelector(ManagedWindow): if self.book_list.get_needs_saving(): self.book_list.save() else: - WarningDialog(_('No items'), _('This book has no items.'), + WarningDialog(_('No items'), # parent-OK + _('This book has no items.'), parent=self.window) return self.close() @@ -722,14 +723,14 @@ class BookSelector(ManagedWindow): """ name = str(self.name_entry.get_text()) if not name: - WarningDialog( + WarningDialog( # parent-OK _('No book name'), _('You are about to save away a book with no name.\n\n' 'Please give it a name before saving it away.'), parent=self.window) return if name in self.book_list.get_book_names(): - qqq = QuestionDialog2( + qqq = QuestionDialog2( # parent-OK _('Book name already exists'), _('You are about to save away a ' 'book with a name which already exists.'), @@ -949,7 +950,7 @@ class BookDialog(DocReportDialog): try: self.make_book() except (IOError, OSError) as msg: - ErrorDialog(str(msg), parent=self.window) + ErrorDialog(str(msg), parent=self.window) # parent-OK self.close() def setup_style_frame(self): @@ -1015,10 +1016,10 @@ class BookDialog(DocReportDialog): except ReportError as msg: (msg1, msg2) = msg.messages() msg2 += ' (%s)' % name # which report has the error? - ErrorDialog(msg1, msg2, parent=self.uistate.window) + ErrorDialog(msg1, msg2, parent=self.uistate.window) # parent-OK except FilterError as msg: (msg1, msg2) = msg.messages() - ErrorDialog(msg1, msg2, parent=self.uistate.window) + ErrorDialog(msg1, msg2, parent=self.uistate.window) # parent-OK finally: return @@ -1063,10 +1064,10 @@ def write_book_item(database, report_class, options, user): return report_class(database, options, user) except ReportError as msg: (msg1, msg2) = msg.messages() - ErrorDialog(msg1, msg2, parent=user.uistate.window) + ErrorDialog(msg1, msg2, parent=user.uistate.window) # parent-OK except FilterError as msg: (msg1, msg2) = msg.messages() - ErrorDialog(msg1, msg2, parent=user.uistate.window) + ErrorDialog(msg1, msg2, parent=user.uistate.window) # parent-OK except: LOG.error("Failed to write book item.", exc_info=True) return None diff --git a/gramps/gui/plug/report/_reportdialog.py b/gramps/gui/plug/report/_reportdialog.py index af6d3ccca..144e18c0b 100644 --- a/gramps/gui/plug/report/_reportdialog.py +++ b/gramps/gui/plug/report/_reportdialog.py @@ -496,7 +496,7 @@ class ReportDialog(ManagedWindow): # check whether the dir has rwx permissions if not os.access(self.target_path, os.R_OK|os.W_OK|os.X_OK): - ErrorDialog(_('Permission problem'), + ErrorDialog(_('Permission problem'), # parent-OK _("You do not have permission to write " "under the directory %s\n\n" "Please select another directory or correct " @@ -506,7 +506,7 @@ class ReportDialog(ManagedWindow): # selected path is an existing file and we need a file if os.path.isfile(self.target_path): - aaa = OptionDialog(_('File already exists'), + aaa = OptionDialog(_('File already exists'), # parent-OK _('You can choose to either overwrite the ' 'file, or change the selected filename.'), _('_Overwrite'), None, @@ -523,7 +523,7 @@ class ReportDialog(ManagedWindow): parent_dir = os.path.dirname(os.path.normpath(self.target_path)) if os.path.isdir(parent_dir): if not os.access(parent_dir, os.W_OK): - ErrorDialog(_('Permission problem'), + ErrorDialog(_('Permission problem'), # parent-OK _("You do not have permission to create " "%s\n\n" "Please select another path or correct " @@ -531,7 +531,7 @@ class ReportDialog(ManagedWindow): parent=self.window) return None else: - ErrorDialog(_('No directory'), + ErrorDialog(_('No directory'), # parent-OK _('There is no directory %s.\n\n' 'Please select another directory ' 'or create it.') % parent_dir, @@ -657,7 +657,7 @@ def report(dbstate, uistate, person, report_class, options_class, its arguments. """ if require_active and not person: - ErrorDialog( + ErrorDialog( # parent-OK _('Active person has not been set'), _('You must select an active person for this report to work ' 'properly.'), @@ -709,15 +709,17 @@ def report(dbstate, uistate, person, report_class, options_class, except FilterError as msg: (msg1, msg2) = msg.messages() - ErrorDialog(msg1, msg2, parent=uistate.window) + ErrorDialog(msg1, msg2, parent=uistate.window) # parent-OK except IOError as msg: - ErrorDialog(_("Report could not be created"), str(msg), + ErrorDialog(_("Report could not be created"), # parent-OK + str(msg), parent=uistate.window) except ReportError as msg: (msg1, msg2) = msg.messages() - ErrorDialog(msg1, msg2, parent=uistate.window) + ErrorDialog(msg1, msg2, parent=uistate.window) # parent-OK except DatabaseError as msg: - ErrorDialog(_("Report could not be created"), str(msg), + ErrorDialog(_("Report could not be created"), # parent-OK + str(msg), parent=uistate.window) # The following except statement will catch all "NoneType" exceptions. # This is useful for released code where the exception is most likely @@ -727,7 +729,7 @@ def report(dbstate, uistate, person, report_class, options_class, # if str(msg).startswith("'NoneType' object has no attribute"): # # "'NoneType' object has no attribute ..." usually means # # database corruption -# RunDatabaseRepair(str(msg)) +# RunDatabaseRepair(str(msg)) # no-parent # else: # raise raise diff --git a/gramps/gui/plug/report/_styleeditor.py b/gramps/gui/plug/report/_styleeditor.py index 324c44555..561f4cf81 100644 --- a/gramps/gui/plug/report/_styleeditor.py +++ b/gramps/gui/plug/report/_styleeditor.py @@ -136,7 +136,7 @@ class StyleListDisplay: self.sheetlist.save() except IOError as msg: from ...dialog import ErrorDialog - ErrorDialog(_("Error saving stylesheet"), str(msg)) + ErrorDialog(_("Error saving stylesheet"), str(msg)) # no-parent except: log.error("Failed to save stylesheet", exc_info=True) diff --git a/gramps/gui/plug/tool.py b/gramps/gui/plug/tool.py index bfa787a4b..911ca59dd 100644 --- a/gramps/gui/plug/tool.py +++ b/gramps/gui/plug/tool.py @@ -133,7 +133,7 @@ class ActivePersonTool(Tool): # TODO: should we replace this with a callback? from ..dialog import ErrorDialog - ErrorDialog(_('Active person has not been set'), + ErrorDialog(_('Active person has not been set'), # no-parent _('You must select an active person for this ' 'tool to work properly.')) self.fail = True diff --git a/gramps/gui/test/user_test.py b/gramps/gui/test/user_test.py index 6d6794612..6f9963dcc 100644 --- a/gramps/gui/test/user_test.py +++ b/gramps/gui/test/user_test.py @@ -43,7 +43,7 @@ class TestUser_prompt(unittest.TestCase): self.user = user.User() @unittest.skipUnless(MOCKING, "Requires unittest.mock to run") - def test_prompt_runs_QuestionDialog2(self): + def test_prompt_runs_QuestionDialog2(self): # parent-OK with patch('gramps.gui.user.QuestionDialog2') as MockQD: self.user.prompt(TestUser.TITLE, TestUser.MSG, TestUser.ACCEPT, TestUser.REJECT, None) diff --git a/gramps/gui/tipofday.py b/gramps/gui/tipofday.py index 3d4bbce4b..1941eb37f 100644 --- a/gramps/gui/tipofday.py +++ b/gramps/gui/tipofday.py @@ -82,7 +82,7 @@ class TipOfDay(ManagedWindow): tparser = TipParser() except (IOError,ExpatError) as e: self.close() - ErrorDialog( + ErrorDialog( # no-parent _("Failed to display tip of the day"), _("Unable to read the tips from external file.\n\n%s")%e) return diff --git a/gramps/gui/undohistory.py b/gramps/gui/undohistory.py index 19615d5c4..27ad7d265 100644 --- a/gramps/gui/undohistory.py +++ b/gramps/gui/undohistory.py @@ -194,11 +194,11 @@ class UndoHistory(ManagedWindow): return (self.title, None) def _clear_clicked(self, obj=None): - QuestionDialog(_("Delete confirmation"), + QuestionDialog(_("Delete confirmation"), # parent-OK _("Are you sure you want to clear the Undo history?"), _("Clear"), self.clear, - self.window) + parent=self.window) def clear(self): self.undodb.clear() diff --git a/gramps/gui/user.py b/gramps/gui/user.py index 3ec447072..2e86505f5 100644 --- a/gramps/gui/user.py +++ b/gramps/gui/user.py @@ -111,8 +111,9 @@ class User(user.User): :returns: the user's answer to the question :rtype: bool """ - dialog = QuestionDialog2(title, message, accept_label, reject_label, - parent) + dialog = QuestionDialog2(title, message, # parent-OK + accept_label, reject_label, + parent=parent) return dialog.run() def warn(self, title, warning=""): @@ -126,9 +127,10 @@ class User(user.User): :returns: none """ if self.uistate: - WarningDialog(title, warning, parent=self.uistate.window) + WarningDialog(title, warning, # parent-OK + parent=self.uistate.window) else: - WarningDialog(title, warning) + WarningDialog(title, warning, parent=None) # parent-OK def notify_error(self, title, error=""): """ @@ -143,9 +145,9 @@ class User(user.User): if self.error_function: self.error_function(title, error) elif self.uistate: - ErrorDialog(title, error, parent=self.uistate.window) + ErrorDialog(title, error, parent=self.uistate.window) # parent-OK else: - ErrorDialog(title, error) + ErrorDialog(title, error, parent=None) # parent-OK def notify_db_error(self, error): """ @@ -156,12 +158,12 @@ class User(user.User): :returns: none """ if self.uistate: - DBErrorDialog(error, parent=self.uistate.window) + DBErrorDialog(error, parent=self.uistate.window) # parent-OK else: - DBErrorDialog(error) + DBErrorDialog(error, parent=None) # parent-OK def info(self, msg1, infotext, parent=None, monospaced=False): """ Calls the GUI InfoDialog """ - InfoDialog(msg1, infotext, parent, monospaced) + InfoDialog(msg1, infotext, parent, monospaced) # parent-OK diff --git a/gramps/gui/utils.py b/gramps/gui/utils.py index baf572f01..53e0f4c99 100644 --- a/gramps/gui/utils.py +++ b/gramps/gui/utils.py @@ -297,10 +297,10 @@ class ProgressMeter: Don't let the user close the progress dialog. """ from .dialog import WarningDialog - WarningDialog( + WarningDialog( # parent-OK _("Attempt to force closing the dialog"), _("Please do not force closing this important dialog."), - self.__dialog) + parent=self.__dialog) return True def close(self, widget=None): @@ -372,7 +372,7 @@ def display_error_dialog (index, errorstrings): else: error = errorstrings - ErrorDialog(_("Error from external program"), error) + ErrorDialog(_("Error from external program"), error) # no-parent def poll_external (args): """ @@ -586,7 +586,7 @@ def edit_object(dbstate, uistate, reftype, ref): "alone") from .dialog import WarningDialog - WarningDialog(_("Cannot open new citation editor"), + WarningDialog(_("Cannot open new citation editor"), # no-parent blocked_text) elif reftype == 'Place': try: diff --git a/gramps/gui/viewmanager.py b/gramps/gui/viewmanager.py index 44f433b0b..0efcbf21c 100644 --- a/gramps/gui/viewmanager.py +++ b/gramps/gui/viewmanager.py @@ -347,7 +347,8 @@ class ViewManager(CLIManager): Show the error. In the GUI, the error is shown, and a return happens """ - ErrorDialog(title, errormessage, parent=self.uistate.window) + ErrorDialog(title, errormessage, # parent-OK + parent=self.uistate.window) return 1 def __build_main_window(self): @@ -772,7 +773,7 @@ class ViewManager(CLIManager): """ if self.dbstate.db.abort_possible: - dialog = QuestionDialog2( + dialog = QuestionDialog2( # parent-OK _("Abort changes?"), _("Aborting changes will return the database to the state " "it was before you started this editing session."), @@ -786,7 +787,7 @@ class ViewManager(CLIManager): pass self.quit() else: - WarningDialog( + WarningDialog( # parent-OK _("Cannot abandon session's changes"), _('Changes cannot be completely abandoned because the ' 'number of changes made in the session exceeded the ' @@ -1096,7 +1097,7 @@ class ViewManager(CLIManager): self.db_loader.import_file() infotxt = self.db_loader.import_info_text() if infotxt: - InfoDialog(_('Import Statistics'), infotxt, + InfoDialog(_('Import Statistics'), infotxt, # parent-OK parent=self.window) self.__post_load() @@ -1353,7 +1354,7 @@ class ViewManager(CLIManager): basefile = basefile.replace("/", r"-") filename = os.path.join(path_entry.get_text(), basefile) if os.path.exists(filename): - question = QuestionDialog2( + question = QuestionDialog2( # parent-OK _("Backup file already exists! Overwrite?"), _("The file '%s' exists.") % filename, _("Proceed and overwrite"), @@ -1591,7 +1592,7 @@ class ViewManager(CLIManager): def display_about_box(self, obj): """Display the About box.""" - about = GrampsAboutDialog(self.uistate.window) + about = GrampsAboutDialog(self.uistate.window) # parent-OK about.run() about.destroy() @@ -1652,7 +1653,7 @@ def run_plugin(pdata, dbstate, uistate): error_msg = failed[-1][1][1] else: error_msg = "(no error message)" - ErrorDialog( + ErrorDialog( # parent-OK _('Failed Loading Plugin'), _('The plugin %(name)s did not load and reported an error.\n\n' '%(error_msg)s\n\n' diff --git a/gramps/gui/views/bookmarks.py b/gramps/gui/views/bookmarks.py index c93181fea..422c789eb 100644 --- a/gramps/gui/views/bookmarks.py +++ b/gramps/gui/views/bookmarks.py @@ -429,7 +429,7 @@ class CitationBookmarks(ListBookmarks): # more comprehensive solution is needed in the long term. See also # change_active in CitatinTreeView from gramps.gui.dialog import WarningDialog - WarningDialog(_("Cannot bookmark this reference"), + WarningDialog(_("Cannot bookmark this reference"), # no-parent "Only Citations can be bookmarked in this view. " "You are probably trying to bookmark a Source in the " "Citation Tree View. In this view, only Citations " diff --git a/gramps/gui/views/listview.py b/gramps/gui/views/listview.py index e5280aad8..731153400 100644 --- a/gramps/gui/views/listview.py +++ b/gramps/gui/views/listview.py @@ -445,7 +445,7 @@ class ListView(NavigationView): self.bookmarks.add(mlist[0]) else: from ..dialog import WarningDialog - WarningDialog( + WarningDialog( # no-parent _("Could Not Set a Bookmark"), _("A bookmark could not be set because " "nothing was selected.")) @@ -537,7 +537,7 @@ class ListView(NavigationView): """ prompt = True if len(self.selected_handles()) > 1: - q = QuestionDialog2( + q = QuestionDialog2( # no-parent _("Multiple Selection Delete"), _("More than one item has been selected for deletion. " "Select the option indicating how to delete the items:"), @@ -563,7 +563,7 @@ class ListView(NavigationView): #if descr == "": descr = object.get_gramps_id() self.uistate.set_busy_cursor(True) - QuestionDialog(_('Delete %s?') % descr, msg, + QuestionDialog(_('Delete %s?') % descr, msg, # no-parent _('_Delete Item'), query.query_response) self.uistate.set_busy_cursor(False) else: diff --git a/gramps/gui/views/navigationview.py b/gramps/gui/views/navigationview.py index 38b54e637..b774c31b7 100644 --- a/gramps/gui/views/navigationview.py +++ b/gramps/gui/views/navigationview.py @@ -252,7 +252,7 @@ class NavigationView(PageView): _("%s has been bookmarked") % name) else: from ..dialog import WarningDialog - WarningDialog( + WarningDialog( # no-parent _("Could Not Set a Bookmark"), _("A bookmark could not be set because " "no one was selected.")) @@ -333,7 +333,7 @@ class NavigationView(PageView): self.change_active(defperson.get_handle()) else: from ..dialog import WarningDialog - WarningDialog(_("No Home Person"), + WarningDialog(_("No Home Person"), # parent-OK _("You need to set a 'default person' to go to. " "Select the People View, select the person you want as " "'Home Person', then confirm your choice " diff --git a/gramps/gui/views/tags.py b/gramps/gui/views/tags.py index 0aef84feb..ac5a4ccf1 100644 --- a/gramps/gui/views/tags.py +++ b/gramps/gui/views/tags.py @@ -245,7 +245,8 @@ class Tags(DbGUIElement): """ Display the Organize Tags dialog. """ - organize_dialog = OrganizeTagsDialog(self.db, self.uistate.window) + organize_dialog = OrganizeTagsDialog(self.db, # parent-OK + self.uistate.window) organize_dialog.run() def cb_new_tag(self, action): @@ -485,7 +486,7 @@ class OrganizeTagsDialog: tag_handle = store.get_value(iter_, 1) tag_name = store.get_value(iter_, 2) - yes_no = QuestionDialog2( + yes_no = QuestionDialog2( # no-parent _("Remove tag '%s'?") % tag_name, _("The tag definition will be removed. " "The tag will be also removed from all objects in the database."), @@ -581,7 +582,7 @@ class EditTag: self.tag.set_color(hexval) if not self.tag.get_name(): - ErrorDialog( + ErrorDialog( # no-parent _("Cannot save tag"), _("The tag name cannot be empty")) return diff --git a/gramps/gui/widgets/grampletbar.py b/gramps/gui/widgets/grampletbar.py index fc57ca272..7bc3ca8d7 100644 --- a/gramps/gui/widgets/grampletbar.py +++ b/gramps/gui/widgets/grampletbar.py @@ -541,7 +541,7 @@ class GrampletBar(Gtk.Notebook): """ Called when restore defaults is clicked from the context menu. """ - QuestionDialog(_("Restore to defaults?"), + QuestionDialog(_("Restore to defaults?"), # no-parent _("The gramplet bar will be restored to contain its default " "gramplets. This action cannot be undone."), _("OK"), diff --git a/gramps/plugins/db/bsddb/upgrade.py b/gramps/plugins/db/bsddb/upgrade.py index 097e75090..a6b76bb20 100644 --- a/gramps/plugins/db/bsddb/upgrade.py +++ b/gramps/plugins/db/bsddb/upgrade.py @@ -799,7 +799,7 @@ def gramps_upgrade_16(self): "Tools -> Family Tree Processing -> Merge\n" "in order to merge citations that contain similar\n" "information") - InfoDialog(_('Upgrade Statistics'), txt, monospaced=True) + InfoDialog(_('Upgrade Statistics'), txt, monospaced=True) # no-parent def upgrade_media_list_16(self, media_list): new_media_list = [] diff --git a/gramps/plugins/docgen/htmldoc.py b/gramps/plugins/docgen/htmldoc.py index 635467b9e..659073022 100644 --- a/gramps/plugins/docgen/htmldoc.py +++ b/gramps/plugins/docgen/htmldoc.py @@ -269,7 +269,7 @@ class HtmlDoc(BaseDoc, TextDoc): shutil.copyfile(from_fname, dest) elif self.warn_dir: from gramps.gui.dialog import WarningDialog - WarningDialog( + WarningDialog( # no-parent _("Possible destination error") + "\n" + _("You appear to have set your target directory " "to a directory used for data storage. This " diff --git a/gramps/plugins/docgen/latexdoc.py b/gramps/plugins/docgen/latexdoc.py index 9a56b23bd..22d1d95b2 100644 --- a/gramps/plugins/docgen/latexdoc.py +++ b/gramps/plugins/docgen/latexdoc.py @@ -1243,7 +1243,8 @@ class LaTeXDoc(BaseDoc, TextDoc): "Use your package manager to install " "python-imaging or python-pillow or " "python3-pillow") - MessageHideDialog(title, message, 'interface.ignore-pil') + MessageHideDialog(title, message, # no-parent + 'interface.ignore-pil') self.emit(''.join(('%\n *** Error: cannot convert ', infile, '\n *** to ', outfile, '\n *** PIL not installed %\n'))) diff --git a/gramps/plugins/export/exportpkg.py b/gramps/plugins/export/exportpkg.py index 0d90b3c81..00242992b 100644 --- a/gramps/plugins/export/exportpkg.py +++ b/gramps/plugins/export/exportpkg.py @@ -190,7 +190,7 @@ class PackageWriter: # else: # # File is lost => ask what to do # if missmedia_action == 0: -# mmd = MissingMediaDialog( +# mmd = MissingMediaDialog( # no-parent # _("Media object could not be found"), # _("%(file_name)s is referenced in the database, " # "but no longer exists. The file may have been " diff --git a/gramps/plugins/gramplet/gramplet.gpr.py b/gramps/plugins/gramplet/gramplet.gpr.py index 1f46a3946..6c54e4d84 100644 --- a/gramps/plugins/gramplet/gramplet.gpr.py +++ b/gramps/plugins/gramplet/gramplet.gpr.py @@ -422,7 +422,8 @@ else: message = _("Image metadata functionality will not be available.\n" "To build it for Gramps see " "%(gramps_wiki_build_gexiv2_url)s" % gexiv2_dict ) - MessageHideDialog(title, message, 'interface.ignore-gexiv2') + MessageHideDialog(title, message, # no-parent + 'interface.ignore-gexiv2') register(GRAMPLET, id="Person Residence", diff --git a/gramps/plugins/gramplet/leak.py b/gramps/plugins/gramplet/leak.py index 93a80bd49..59cb86383 100644 --- a/gramps/plugins/gramplet/leak.py +++ b/gramps/plugins/gramplet/leak.py @@ -130,7 +130,7 @@ class Leak(Gramplet): text += str(referrer) + '\n' except ReferenceError: pass - InfoDialog(_('Referrers of %d') % count, text, + InfoDialog(_('Referrers of %d') % count, text, # parent-OK parent=self.uistate.window) def refers_to(self): @@ -144,7 +144,7 @@ class Leak(Gramplet): text += str(referent) + '\n' except ReferenceError: pass - InfoDialog(_('%d refers to') % count, text, + InfoDialog(_('%d refers to') % count, text, # parent-OK parent=self.uistate.window) def display(self): diff --git a/gramps/plugins/lib/libgedcom.py b/gramps/plugins/lib/libgedcom.py index 019b5ed56..e8b724ffd 100644 --- a/gramps/plugins/lib/libgedcom.py +++ b/gramps/plugins/lib/libgedcom.py @@ -7301,7 +7301,7 @@ class GedcomParser(UpdateCallback): # coding is now wrong. if self.genby.upper() == "LEGACY": fname = os.path.basename(self.filename) - WarningDialog( + WarningDialog( # no-parent _("Import of GEDCOM file %(filename)s with DEST=%(by)s, " "could cause errors in the resulting database!") % {'filename': fname, 'by': self.genby}, diff --git a/gramps/plugins/lib/libpersonview.py b/gramps/plugins/lib/libpersonview.py index ad6fbc174..e4e220046 100644 --- a/gramps/plugins/lib/libpersonview.py +++ b/gramps/plugins/lib/libpersonview.py @@ -293,7 +293,7 @@ class BasePersonView(ListView): msg2 = self._message2_format(person) msg2 = "%s %s" % (msg2, data_recover_msg) # This gets person to delete self.active_person: - QuestionDialog(msg1, + QuestionDialog(msg1, # parent-OK msg2, _('_Delete Person'), self.delete_person_response, @@ -301,7 +301,7 @@ class BasePersonView(ListView): else: # Ask to delete; option to cancel, delete rest # This gets person to delete from parameter - MultiSelectDialog(self._message1_format, + MultiSelectDialog(self._message1_format, # parent-OK self._message2_format, handles, self._lookup_person, @@ -421,7 +421,7 @@ class BasePersonView(ListView): mlist = self.selected_handles() if len(mlist) != 2: - ErrorDialog(_("Cannot merge people"), + ErrorDialog(_("Cannot merge people"), # parent-OK _("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 " diff --git a/gramps/plugins/lib/libplaceview.py b/gramps/plugins/lib/libplaceview.py index aa2c30506..53d7c7501 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, parent=self.uistate.window) + ErrorDialog(msg, msg2, parent=self.uistate.window) # parent-OK 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, parent=self.uistate.window) + ErrorDialog(msg, msg2, parent=self.uistate.window) # parent-OK 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, parent=self.uistate.window) + ErrorDialog(msg, msg2, parent=self.uistate.window) # parent-OK 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, parent=self.uistate.window) + ErrorDialog(msg, msg2, parent=self.uistate.window) # parent-OK 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, parent=self.uistate.window) + ErrorDialog(msg, msg2, parent=self.uistate.window) # parent-OK else: MergePlace(self.dbstate, self.uistate, mlist[0], mlist[1], self.merged) diff --git a/gramps/plugins/lib/maps/geography.py b/gramps/plugins/lib/maps/geography.py index a7f08c604..0219d6f1b 100644 --- a/gramps/plugins/lib/maps/geography.py +++ b/gramps/plugins/lib/maps/geography.py @@ -198,7 +198,7 @@ class GeoGraphyView(OsmGps, NavigationView): self.bookmarks.add(mlist[0]) else: from gramps.gui.dialog import WarningDialog - WarningDialog( + WarningDialog( # parent-OK _("Could Not Set a Bookmark"), _("A bookmark could not be set because " "no one was selected."), @@ -214,7 +214,7 @@ class GeoGraphyView(OsmGps, NavigationView): self.bookmarks.redraw() else: from gramps.gui.dialog import WarningDialog - WarningDialog( + WarningDialog( # parent-OK _("Could Not Set a Bookmark"), _("A bookmark could not be set because " "no one was selected."), @@ -845,7 +845,7 @@ class GeoGraphyView(OsmGps, NavigationView): """ if Gtk.MAJOR_VERSION == 3 and Gtk.MINOR_VERSION < 11: from gramps.gui.dialog import WarningDialog - WarningDialog( + WarningDialog( # parent-OK _("You can't use the print functionality"), _("Your Gtk version is too old."), parent=self.uistate.window) @@ -1031,7 +1031,7 @@ class GeoGraphyView(OsmGps, NavigationView): gids = gids + ", " + plce.gramps_id if nb_places > 1: from gramps.gui.dialog import WarningDialog - WarningDialog( + WarningDialog( # parent-OK _('You have at least two places with the same title.'), _("The title of the places is:\n%(title)s\n" "The following places are similar: %(gid)s\n" diff --git a/gramps/plugins/lib/maps/osmgps.py b/gramps/plugins/lib/maps/osmgps.py index f62979ca6..a5afc0074 100644 --- a/gramps/plugins/lib/maps/osmgps.py +++ b/gramps/plugins/lib/maps/osmgps.py @@ -116,8 +116,8 @@ class OsmGps: try: os.makedirs(cache_path, 0o755) # create dir like mkdir -p except: - ErrorDialog(_("Can't create tiles cache directory %s") % - cache_path) + ErrorDialog(_("Can't create " # no-parent + "tiles cache directory %s") % cache_path) return self.vbox self.change_map(None, config.get("geography.map_service")) @@ -138,7 +138,8 @@ class OsmGps: try: os.makedirs(tiles_path, 0o755) # create dir like mkdir -p except: - ErrorDialog(_("Can't create tiles cache directory for '%s'.") % + ErrorDialog(_("Can't create " # no-parent + "tiles cache directory for '%s'.") % constants.MAP_TITLE[map_type]) config.set("geography.map_service", map_type) self.current_map = map_type diff --git a/gramps/plugins/mapservices/eniroswedenmap.py b/gramps/plugins/mapservices/eniroswedenmap.py index badfd48bd..2163f2c8f 100644 --- a/gramps/plugins/mapservices/eniroswedenmap.py +++ b/gramps/plugins/mapservices/eniroswedenmap.py @@ -144,7 +144,7 @@ class EniroSVMapService(MapService): else: msg2 = _("Latitude not within '54.55' to '69.05'\n") + \ _("Longitude not within '8.05' to '24.15'") - WarningDialog(_("Eniro map not available"), msg2 ) + WarningDialog(_("Eniro map not available"), msg2) # no-parent return if coord_ok: @@ -171,13 +171,13 @@ class EniroSVMapService(MapService): self.url = path.replace(" ","%20") return else: - WarningDialog(_("Eniro map not available"), \ - _("Coordinates needed in Denmark") ) + WarningDialog(_("Eniro map not available"), # no-parent + _("Coordinates needed in Denmark")) self.url = "" return - WarningDialog(_("Eniro map not available"), - _("Latitude and longitude,\n" \ - "or street and city needed") ) + WarningDialog(_("Eniro map not available"), # no-parent + _("Latitude and longitude,\n" + "or street and city needed")) return diff --git a/gramps/plugins/textreport/indivcomplete.py b/gramps/plugins/textreport/indivcomplete.py index a42d145f4..c00d69d7a 100644 --- a/gramps/plugins/textreport/indivcomplete.py +++ b/gramps/plugins/textreport/indivcomplete.py @@ -549,7 +549,8 @@ class IndivCompleteReport(Report): media = self._db.get_media_from_handle(media_handle) if media is None: from gramps.gui.dialog import RunDatabaseRepair - RunDatabaseRepair(_('Non existing media found in the Gallery')) + RunDatabaseRepair( # no-parent + _('Non existing media found in the Gallery')) return mime_type = media.get_mime_type() if not mime_type or not mime_type.startswith("image"): diff --git a/gramps/plugins/tool/changenames.py b/gramps/plugins/tool/changenames.py index 95056268d..334b8b6ad 100644 --- a/gramps/plugins/tool/changenames.py +++ b/gramps/plugins/tool/changenames.py @@ -141,7 +141,7 @@ class ChangeNames(tool.BatchTool, ManagedWindow): else: self.progress.close() self.close() - OkDialog(_('No modifications made'), + OkDialog(_('No modifications made'), # parent-OK _("No capitalization changes were detected."), parent=uistate.window) diff --git a/gramps/plugins/tool/check.py b/gramps/plugins/tool/check.py index ece3952ea..7505cce2f 100644 --- a/gramps/plugins/tool/check.py +++ b/gramps/plugins/tool/check.py @@ -722,7 +722,7 @@ class CheckIntegrity: 'found' % {'desc' : photo_desc, 'name' : photo_name}) - mmd = MissingMediaDialog( + mmd = MissingMediaDialog( # parent-OK _("Media object could not be found"), _("The file:\n%(file_name)s\nis referenced in " "the database, but no longer exists.\n" @@ -2107,7 +2107,7 @@ class CheckIntegrity: if errors == 0: if uistate: - OkDialog(_("No errors were found"), + OkDialog(_("No errors were found"), # parent-OK _('The database has passed internal checks'), parent=uistate.window) else: diff --git a/gramps/plugins/tool/dateparserdisplaytest.py b/gramps/plugins/tool/dateparserdisplaytest.py index 0fdb6961a..8ec8a1cdc 100644 --- a/gramps/plugins/tool/dateparserdisplaytest.py +++ b/gramps/plugins/tool/dateparserdisplaytest.py @@ -64,7 +64,7 @@ class DateParserDisplayTest(tool.Tool): if uistate: # Running with gui -> Show message self.parent_window = uistate.window - QuestionDialog(_("Start date test?"), + QuestionDialog(_("Start date test?"), # parent-OK _("This test will create many persons and events " \ "in the current database. Do you really want to " \ "run this test?"), diff --git a/gramps/plugins/tool/eventcmp.py b/gramps/plugins/tool/eventcmp.py index 4a1b955b0..42686a147 100644 --- a/gramps/plugins/tool/eventcmp.py +++ b/gramps/plugins/tool/eventcmp.py @@ -191,7 +191,8 @@ class EventComparison(tool.Tool,ManagedWindow): self.options.handler.save_options() if len(plist) == 0: - WarningDialog(_("No matches were found"), parent=self.window) + WarningDialog(_("No matches were found"), # parent-OK + parent=self.window) else: DisplayChart(self.dbstate,self.uistate,plist,self.track) diff --git a/gramps/plugins/tool/finddupes.py b/gramps/plugins/tool/finddupes.py index 8f8e6dfae..5de682501 100644 --- a/gramps/plugins/tool/finddupes.py +++ b/gramps/plugins/tool/finddupes.py @@ -163,7 +163,7 @@ class Merge(tool.Tool,ManagedWindow): try: self.find_potentials(threshold) except AttributeError as msg: - RunDatabaseRepair(str(msg), parent=self.window) + RunDatabaseRepair(str(msg), parent=self.window) # parent-OK return self.options.handler.options_dict['threshold'] = threshold @@ -172,7 +172,7 @@ class Merge(tool.Tool,ManagedWindow): self.options.handler.save_options() if len(self.map) == 0: - OkDialog( + OkDialog( # parent-OK _("No matches found"), _("No potential duplicate people were found"), parent=self.window) diff --git a/gramps/plugins/tool/mergecitations.py b/gramps/plugins/tool/mergecitations.py index e30ca094b..9aea74110 100644 --- a/gramps/plugins/tool/mergecitations.py +++ b/gramps/plugins/tool/mergecitations.py @@ -229,7 +229,7 @@ class MergeCitations(tool.BatchTool,ManagedWindow): db.enable_signals() db.request_rebuild() self.progress.close() - OkDialog(_("Number of merges done"), + OkDialog(_("Number of merges done"), # parent-OK # translators: leave all/any {...} untranslated ngettext("{number_of} citation merged", "{number_of} citations merged", num_merges diff --git a/gramps/plugins/tool/patchnames.py b/gramps/plugins/tool/patchnames.py index 9fce61b85..96d8b4fc3 100644 --- a/gramps/plugins/tool/patchnames.py +++ b/gramps/plugins/tool/patchnames.py @@ -360,7 +360,7 @@ class PatchNames(tool.BatchTool, ManagedWindow): else: self.progress.close() self.close() - OkDialog(_('No modifications made'), + OkDialog(_('No modifications made'), # parent-OK _("No titles, nicknames or prefixes were found"), parent=self.uistate.window) diff --git a/gramps/plugins/tool/populatesources.py b/gramps/plugins/tool/populatesources.py index c7a0a87f1..58331f1ce 100644 --- a/gramps/plugins/tool/populatesources.py +++ b/gramps/plugins/tool/populatesources.py @@ -67,7 +67,7 @@ class PopulateSources(tool.Tool, ManagedWindow): if response == Gtk.ResponseType.ACCEPT: self.on_ok_clicked() - OkDialog('Data generated', + OkDialog('Data generated', # no-parent "The requested sources and citations were generated") self.close() diff --git a/gramps/plugins/tool/rebuild.py b/gramps/plugins/tool/rebuild.py index 6d26eee1f..715ffdd48 100644 --- a/gramps/plugins/tool/rebuild.py +++ b/gramps/plugins/tool/rebuild.py @@ -83,7 +83,7 @@ class Rebuild(tool.Tool, UpdateCallback): uistate.set_busy_cursor(False) uistate.progress.hide() - OkDialog(_("Secondary indexes rebuilt"), + OkDialog(_("Secondary indexes rebuilt"), # parent-OK _('All secondary indexes have been rebuilt.'), parent=uistate.window) else: diff --git a/gramps/plugins/tool/rebuildgenderstat.py b/gramps/plugins/tool/rebuildgenderstat.py index 8125965cd..e9c9e43df 100644 --- a/gramps/plugins/tool/rebuildgenderstat.py +++ b/gramps/plugins/tool/rebuildgenderstat.py @@ -92,7 +92,7 @@ class RebuildGenderStat(tool.Tool, UpdateCallback): if uistate: uistate.set_busy_cursor(False) uistate.progress.hide() - OkDialog(_("Gender statistics rebuilt"), + OkDialog(_("Gender statistics rebuilt"), # parent-OK _('Gender statistics for name gender guessing have been rebuilt.'), parent=uistate.window) else: diff --git a/gramps/plugins/tool/rebuildrefmap.py b/gramps/plugins/tool/rebuildrefmap.py index f62c13d9f..cc53037ce 100644 --- a/gramps/plugins/tool/rebuildrefmap.py +++ b/gramps/plugins/tool/rebuildrefmap.py @@ -88,7 +88,7 @@ class RebuildRefMap(tool.Tool, UpdateCallback): if uistate: uistate.set_busy_cursor(False) uistate.progress.hide() - OkDialog(_("Reference maps rebuilt"), + OkDialog(_("Reference maps rebuilt"), # parent-OK _('All reference maps have been rebuilt.'), parent=uistate.window) else: diff --git a/gramps/plugins/tool/relcalc.py b/gramps/plugins/tool/relcalc.py index 263c5bf04..44ed85379 100644 --- a/gramps/plugins/tool/relcalc.py +++ b/gramps/plugins/tool/relcalc.py @@ -146,7 +146,7 @@ class RelCalc(tool.Tool, ManagedWindow): if not self.person: self.window.hide() - ErrorDialog(_('Active person has not been set'), + ErrorDialog(_('Active person has not been set'), # no-parent _('You must select an active person for this ' 'tool to work properly.')) self.close() diff --git a/gramps/plugins/view/citationlistview.py b/gramps/plugins/view/citationlistview.py index 76944876e..581999397 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, parent=self.uistate.window) + ErrorDialog(msg, msg2, parent=self.uistate.window) # parent-OK 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, parent=self.uistate.window) + ErrorDialog(msg, msg2, parent=self.uistate.window) # parent-OK 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 a2a9d82fc..02cba54ef 100644 --- a/gramps/plugins/view/citationtreeview.py +++ b/gramps/plugins/view/citationtreeview.py @@ -427,7 +427,7 @@ class CitationTreeView(ListView): Citation(), source) except WindowActiveError: from gramps.gui.dialog import WarningDialog - WarningDialog(_("Cannot share this reference"), + WarningDialog(_("Cannot share this reference"), # parent-OK self.__blocked_text(), parent=self.uistate.window) # @@ -478,7 +478,7 @@ class CitationTreeView(ListView): EditSource(self.dbstate, self.uistate, [], source) except WindowActiveError: from gramps.gui.dialog import WarningDialog - WarningDialog(_("Cannot share this reference"), + WarningDialog(_("Cannot share this reference"), # parent-OK self.__blocked_text2(), parent=self.uistate.window) @@ -514,7 +514,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, parent=self.uistate.window) + ErrorDialog(msg, msg2, parent=self.uistate.window) # parent-OK else: source1 = self.dbstate.db.get_source_from_handle(mlist[0]) citation1 = self.dbstate.db.get_citation_from_handle(mlist[0]) @@ -534,7 +534,8 @@ 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, parent=self.uistate.window) + ErrorDialog(msg, msg2, # parent-OK + parent=self.uistate.window) else: MergeCitation(self.dbstate, self.uistate, mlist[0], mlist[1]) @@ -545,7 +546,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, parent=self.uistate.window) + ErrorDialog(msg, msg2, parent=self.uistate.window) # parent-OK 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 1b807db1d..a1eebcd2b 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, parent=self.uistate.window) + ErrorDialog(msg, msg2, parent=self.uistate.window) # parent-OK 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 ebc5ccf75..bb5bcdc50 100644 --- a/gramps/plugins/view/familyview.py +++ b/gramps/plugins/view/familyview.py @@ -216,7 +216,7 @@ class FamilyView(ListView): self.bookmarks.add(mlist[0]) else: from gramps.gui.dialog import WarningDialog - WarningDialog( + WarningDialog( # parent-OK _("Could Not Set a Bookmark"), _("A bookmark could not be set because " "no one was selected."), parent=self.uistate.window) @@ -240,13 +240,13 @@ class FamilyView(ListView): msg1 = self._message1_format(family) msg2 = self._message2_format(family) msg2 = "%s %s" % (msg2, data_recover_msg) - QuestionDialog(msg1, + QuestionDialog(msg1, # parent-OK msg2, _('_Delete Family'), lambda: self.delete_family_response(family), parent=self.uistate.window) else: - MultiSelectDialog(self._message1_format, + MultiSelectDialog(self._message1_format, # parent-OK self._message2_format, handles, self.dbstate.db.get_family_from_handle, @@ -306,7 +306,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, parent=self.uistate.window) + ErrorDialog(msg, msg2, parent=self.uistate.window) # parent-OK else: MergeFamily(self.dbstate, self.uistate, mlist[0], mlist[1]) diff --git a/gramps/plugins/view/geography.gpr.py b/gramps/plugins/view/geography.gpr.py index 00beacb6e..86b2399f6 100644 --- a/gramps/plugins/view/geography.gpr.py +++ b/gramps/plugins/view/geography.gpr.py @@ -72,7 +72,8 @@ if not OSMGPSMAP: MESSAGE = _("Geography functionality will not be available.\n" "To build it for Gramps see " "%(gramps_wiki_build_osmgps_url)s") % OSMGPS_DICT - MessageHideDialog(TITLE, MESSAGE, 'interface.ignore-osmgpsmap') + MessageHideDialog(TITLE, MESSAGE, # no-parent + 'interface.ignore-osmgpsmap') else: # Load the view only if osmgpsmap library is present. register(VIEW, diff --git a/gramps/plugins/view/mediaview.py b/gramps/plugins/view/mediaview.py index 1dea53d65..59a8deb76 100644 --- a/gramps/plugins/view/mediaview.py +++ b/gramps/plugins/view/mediaview.py @@ -350,7 +350,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, parent=self.uistate.window) + ErrorDialog(msg, msg2, parent=self.uistate.window) # parent-OK 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 6468300d1..5cf78936e 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, parent=self.uistate.window) + ErrorDialog(msg, msg2, parent=self.uistate.window) # parent-OK 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 140f47cf7..75cded7dc 100644 --- a/gramps/plugins/view/pedigreeview.py +++ b/gramps/plugins/view/pedigreeview.py @@ -689,7 +689,7 @@ class PedigreeView(NavigationView): else: self.rebuild_trees(None) except AttributeError as msg: - RunDatabaseRepair(str(msg)) + RunDatabaseRepair(str(msg)) # no-parent def _connect_db_signals(self): """ @@ -1496,7 +1496,7 @@ class PedigreeView(NavigationView): try: alive = probably_alive(person, self.dbstate.db) except RuntimeError: - ErrorDialog(_('Relationship loop detected'), + ErrorDialog(_('Relationship loop detected'), # no-parent _('A person was found to be his/her own ancestor.')) alive = False lst[index] = [person, val, None, alive, None] diff --git a/gramps/plugins/view/relview.py b/gramps/plugins/view/relview.py index d22f806bc..9852ea659 100644 --- a/gramps/plugins/view/relview.py +++ b/gramps/plugins/view/relview.py @@ -473,7 +473,7 @@ class RelationshipView(NavigationView): exc = traceback.format_exc() _LOG.error(str(msg) +"\n" + exc) from gramps.gui.dialog import RunDatabaseRepair - RunDatabaseRepair(str(msg)) + RunDatabaseRepair(str(msg)) # no-parent self.redrawing = False return True @@ -1350,7 +1350,7 @@ class RelationshipView(NavigationView): family = self.dbstate.db.get_family_from_handle(family_handle) if family is None: from gramps.gui.dialog import WarningDialog - WarningDialog( + WarningDialog( # no-parent _('Broken family detected'), _('Please run the Check and Repair Database tool')) return diff --git a/gramps/plugins/view/repoview.py b/gramps/plugins/view/repoview.py index 35854a81e..2664bd7cb 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, parent=self.uistate.window) + ErrorDialog(msg, msg2, parent=self.uistate.window) # parent-OK 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 6d349a7ef..429196977 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, parent=self.uistate.window) + ErrorDialog(msg, msg2, parent=self.uistate.window) # parent-OK else: MergeSource(self.dbstate, self.uistate, mlist[0], mlist[1])