8128: GtkDialog mapped without a transient parent

This commit is contained in:
Paul Franklin 2016-08-01 12:16:58 -07:00
parent b40c92465a
commit d9ec7d5e2a
87 changed files with 283 additions and 255 deletions

View File

@ -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)

View File

@ -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."""

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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)

View File

@ -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")

View File

@ -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)

View File

@ -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 "

View File

@ -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):

View File

@ -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")
)

View File

@ -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

View File

@ -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 "

View File

@ -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)

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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 "

View File

@ -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

View File

@ -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)

View File

@ -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'))

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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'),

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 '

View File

@ -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)

View File

@ -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()

View File

@ -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()

View File

@ -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,

View File

@ -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()
#-------------------------------------------------------------------------

View File

@ -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):

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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()

View File

@ -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

View File

@ -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:

View File

@ -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'

View File

@ -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 "

View File

@ -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:

View File

@ -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 "

View File

@ -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

View File

@ -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"),

View File

@ -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 = []

View File

@ -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 "

View File

@ -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')))

View File

@ -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 "

View File

@ -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",

View File

@ -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):

View File

@ -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},

View File

@ -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 "

View File

@ -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)

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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"):

View File

@ -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)

View File

@ -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:

View File

@ -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?"),

View File

@ -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)

View File

@ -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)

View File

@ -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

View File

@ -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)

View File

@ -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()

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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()

View File

@ -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])

View File

@ -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)

View File

@ -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])

View File

@ -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])

View File

@ -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,

View File

@ -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])

View File

@ -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])

View File

@ -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]

View File

@ -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

View File

@ -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])

View File

@ -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])