8128: GtkDialog mapped without a transient parent
This commit is contained in:
parent
bedf94056b
commit
ea82fc981d
@ -431,6 +431,8 @@ class MessageHideDialog:
|
|||||||
self.xml.get_object('message').set_text(message)
|
self.xml.get_object('message').set_text(message)
|
||||||
|
|
||||||
dont_show.connect('toggled', self.update_checkbox, key)
|
dont_show.connect('toggled', self.update_checkbox, key)
|
||||||
|
if parent:
|
||||||
|
self.top.set_transient_for(parent)
|
||||||
self.top.run()
|
self.top.run()
|
||||||
self.top.destroy()
|
self.top.destroy()
|
||||||
|
|
||||||
|
@ -157,7 +157,7 @@ class AddMedia(ManagedWindow):
|
|||||||
if self.file_text.get_filename() is None:
|
if self.file_text.get_filename() is None:
|
||||||
msgstr = _("Import failed")
|
msgstr = _("Import failed")
|
||||||
msgstr2 = _("The filename supplied could not be found.")
|
msgstr2 = _("The filename supplied could not be found.")
|
||||||
ErrorDialog(msgstr, msgstr2)
|
ErrorDialog(msgstr, msgstr2, parent=self.window)
|
||||||
return
|
return
|
||||||
|
|
||||||
filename = self.file_text.get_filename()
|
filename = self.file_text.get_filename()
|
||||||
@ -168,7 +168,8 @@ class AddMedia(ManagedWindow):
|
|||||||
if not os.path.exists(pname):
|
if not os.path.exists(pname):
|
||||||
msgstr = _("Cannot import %s")
|
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")
|
msgstr2 = _("Directory specified in preferences: Base path for relative media paths: %s does not exist. Change preferences or do not use relative path when importing")
|
||||||
ErrorDialog(msgstr % filename, msgstr2 % pname)
|
ErrorDialog(msgstr % filename, msgstr2 % pname,
|
||||||
|
parent=self.window)
|
||||||
return
|
return
|
||||||
filename = relative_path(filename, pname)
|
filename = relative_path(filename, pname)
|
||||||
|
|
||||||
|
@ -147,7 +147,8 @@ class EditAttributeRoot(EditSecondary):
|
|||||||
from ..dialog import ErrorDialog
|
from ..dialog import ErrorDialog
|
||||||
ErrorDialog(
|
ErrorDialog(
|
||||||
_("Cannot save attribute"),
|
_("Cannot save attribute"),
|
||||||
_("The attribute type cannot be empty"))
|
_("The attribute type cannot be empty"),
|
||||||
|
parent=self.window)
|
||||||
return
|
return
|
||||||
if self.callback:
|
if self.callback:
|
||||||
self.callback(self.obj)
|
self.callback(self.obj)
|
||||||
|
@ -291,7 +291,7 @@ class EditCitation(EditPrimary):
|
|||||||
"derived. To create a citation, first select the "
|
"derived. To create a citation, first select the "
|
||||||
"required source, and then record the location of "
|
"required source, and then record the location of "
|
||||||
"the information referenced within the source in the "
|
"the information referenced within the source in the "
|
||||||
"'Volume/Page' field."))
|
"'Volume/Page' field."), parent=self.window)
|
||||||
self.ok_button.set_sensitive(True)
|
self.ok_button.set_sensitive(True)
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -305,7 +305,7 @@ class EditCitation(EditPrimary):
|
|||||||
"%(prim_object)s'. Please enter a different ID or leave "
|
"%(prim_object)s'. Please enter a different ID or leave "
|
||||||
"blank to get the next available ID value.") % {
|
"blank to get the next available ID value.") % {
|
||||||
'id' : gramps_id, 'prim_object' : name }
|
'id' : gramps_id, 'prim_object' : name }
|
||||||
ErrorDialog(msg1, msg2)
|
ErrorDialog(msg1, msg2, parent=self.window)
|
||||||
self.ok_button.set_sensitive(True)
|
self.ok_button.set_sensitive(True)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -238,7 +238,8 @@ class EditEvent(EditPrimary):
|
|||||||
if self.object_is_empty():
|
if self.object_is_empty():
|
||||||
ErrorDialog(_("Cannot save event"),
|
ErrorDialog(_("Cannot save event"),
|
||||||
_("No data exists for this event. Please "
|
_("No data exists for this event. Please "
|
||||||
"enter data or cancel the edit."))
|
"enter data or cancel the edit."),
|
||||||
|
parent=self.window)
|
||||||
self.ok_button.set_sensitive(True)
|
self.ok_button.set_sensitive(True)
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -252,7 +253,7 @@ class EditEvent(EditPrimary):
|
|||||||
"%(prim_object)s'. Please enter a different ID or leave "
|
"%(prim_object)s'. Please enter a different ID or leave "
|
||||||
"blank to get the next available ID value.") % {
|
"blank to get the next available ID value.") % {
|
||||||
'id' : id, 'prim_object' : name }
|
'id' : id, 'prim_object' : name }
|
||||||
ErrorDialog(msg1, msg2)
|
ErrorDialog(msg1, msg2, parent=self.window)
|
||||||
self.ok_button.set_sensitive(True)
|
self.ok_button.set_sensitive(True)
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -260,7 +261,8 @@ class EditEvent(EditPrimary):
|
|||||||
if t.is_custom() and str(t) == '':
|
if t.is_custom() and str(t) == '':
|
||||||
ErrorDialog(
|
ErrorDialog(
|
||||||
_("Cannot save event"),
|
_("Cannot save event"),
|
||||||
_("The event type cannot be empty"))
|
_("The event type cannot be empty"),
|
||||||
|
parent=self.window)
|
||||||
self.ok_button.set_sensitive(True)
|
self.ok_button.set_sensitive(True)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -371,7 +371,8 @@ class EditFamily(EditPrimary):
|
|||||||
"are available when you create a new family. The "
|
"are available when you create a new family. The "
|
||||||
"remaining fields will become available after you "
|
"remaining fields will become available after you "
|
||||||
"attempt to select a parent."),
|
"attempt to select a parent."),
|
||||||
'preferences.family-warn')
|
'preferences.family-warn',
|
||||||
|
parent=self.window)
|
||||||
else:
|
else:
|
||||||
self.add_parent = False
|
self.add_parent = False
|
||||||
|
|
||||||
@ -1062,7 +1063,8 @@ class EditFamily(EditPrimary):
|
|||||||
father.gramps_id)
|
father.gramps_id)
|
||||||
ErrorDialog(_("A father cannot be his own child"),
|
ErrorDialog(_("A father cannot be his own child"),
|
||||||
_("%s is listed as both the father and child "
|
_("%s is listed as both the father and child "
|
||||||
"of the family.") % name)
|
"of the family.") % name,
|
||||||
|
parent=self.window)
|
||||||
self.ok_button.set_sensitive(True)
|
self.ok_button.set_sensitive(True)
|
||||||
return
|
return
|
||||||
elif self.obj.get_mother_handle() in child_list:
|
elif self.obj.get_mother_handle() in child_list:
|
||||||
@ -1072,7 +1074,8 @@ class EditFamily(EditPrimary):
|
|||||||
mother.gramps_id)
|
mother.gramps_id)
|
||||||
ErrorDialog(_("A mother cannot be her own child"),
|
ErrorDialog(_("A mother cannot be her own child"),
|
||||||
_("%s is listed as both the mother and child "
|
_("%s is listed as both the mother and child "
|
||||||
"of the family.") % name)
|
"of the family.") % name,
|
||||||
|
parent=self.window)
|
||||||
self.ok_button.set_sensitive(True)
|
self.ok_button.set_sensitive(True)
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -1080,7 +1083,8 @@ class EditFamily(EditPrimary):
|
|||||||
ErrorDialog(
|
ErrorDialog(
|
||||||
_("Cannot save family"),
|
_("Cannot save family"),
|
||||||
_("No data exists for this family. "
|
_("No data exists for this family. "
|
||||||
"Please enter data or cancel the edit."))
|
"Please enter data or cancel the edit."),
|
||||||
|
parent=self.window)
|
||||||
self.ok_button.set_sensitive(True)
|
self.ok_button.set_sensitive(True)
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -1092,7 +1096,7 @@ class EditFamily(EditPrimary):
|
|||||||
"enter a different ID or leave "
|
"enter a different ID or leave "
|
||||||
"blank to get the next available ID value.") % {
|
"blank to get the next available ID value.") % {
|
||||||
'id' : id}
|
'id' : id}
|
||||||
ErrorDialog(msg1, msg2)
|
ErrorDialog(msg1, msg2, parent=self.window)
|
||||||
self.ok_button.set_sensitive(True)
|
self.ok_button.set_sensitive(True)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -287,7 +287,8 @@ class EditMedia(EditPrimary):
|
|||||||
if self.object_is_empty():
|
if self.object_is_empty():
|
||||||
ErrorDialog(_("Cannot save media object"),
|
ErrorDialog(_("Cannot save media object"),
|
||||||
_("No data exists for this media object. Please "
|
_("No data exists for this media object. Please "
|
||||||
"enter data or cancel the edit."))
|
"enter data or cancel the edit."),
|
||||||
|
parent=self.window)
|
||||||
self.ok_button.set_sensitive(True)
|
self.ok_button.set_sensitive(True)
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -301,7 +302,7 @@ class EditMedia(EditPrimary):
|
|||||||
"%(prim_object)s'. Please enter a different ID or leave "
|
"%(prim_object)s'. Please enter a different ID or leave "
|
||||||
"blank to get the next available ID value.") % {
|
"blank to get the next available ID value.") % {
|
||||||
'id' : id, 'prim_object' : name }
|
'id' : id, 'prim_object' : name }
|
||||||
ErrorDialog(msg1, msg2)
|
ErrorDialog(msg1, msg2, parent=self.window)
|
||||||
self.ok_button.set_sensitive(True)
|
self.ok_button.set_sensitive(True)
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -315,7 +316,7 @@ class EditMedia(EditPrimary):
|
|||||||
"value '%(path)s'. This path does not exist!"
|
"value '%(path)s'. This path does not exist!"
|
||||||
" Please enter a different path") % {
|
" Please enter a different path") % {
|
||||||
'path' : path }
|
'path' : path }
|
||||||
ErrorDialog(msg1, msg2)
|
ErrorDialog(msg1, msg2, parent=self.window)
|
||||||
self.ok_button.set_sensitive(True)
|
self.ok_button.set_sensitive(True)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -383,7 +383,8 @@ class EditName(EditSecondary):
|
|||||||
) % { 'surname' : surname,
|
) % { 'surname' : surname,
|
||||||
'group_name':group_as},
|
'group_name':group_as},
|
||||||
_("Continue"),
|
_("Continue"),
|
||||||
_("Return to Name Editor"))
|
_("Return to Name Editor"),
|
||||||
|
parent=self.window)
|
||||||
val = q.run()
|
val = q.run()
|
||||||
if val:
|
if val:
|
||||||
#delete the grouping link on database
|
#delete the grouping link on database
|
||||||
@ -415,7 +416,8 @@ class EditName(EditSecondary):
|
|||||||
) % { 'surname' : surname,
|
) % { 'surname' : surname,
|
||||||
'group_name':group_as},
|
'group_name':group_as},
|
||||||
_("Group all"),
|
_("Group all"),
|
||||||
_("Group this name only"))
|
_("Group this name only"),
|
||||||
|
parent=self.window)
|
||||||
val = q.run()
|
val = q.run()
|
||||||
if val:
|
if val:
|
||||||
if group_as == surname :
|
if group_as == surname :
|
||||||
|
@ -312,7 +312,8 @@ class EditNote(EditPrimary):
|
|||||||
if self.object_is_empty():
|
if self.object_is_empty():
|
||||||
ErrorDialog(_("Cannot save note"),
|
ErrorDialog(_("Cannot save note"),
|
||||||
_("No data exists for this note. Please "
|
_("No data exists for this note. Please "
|
||||||
"enter data or cancel the edit."))
|
"enter data or cancel the edit."),
|
||||||
|
parent=self.window)
|
||||||
self.ok_button.set_sensitive(True)
|
self.ok_button.set_sensitive(True)
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -324,7 +325,7 @@ class EditNote(EditPrimary):
|
|||||||
"enter a different ID or leave "
|
"enter a different ID or leave "
|
||||||
"blank to get the next available ID value.") % {
|
"blank to get the next available ID value.") % {
|
||||||
'id' : id }
|
'id' : id }
|
||||||
ErrorDialog(msg1, msg2)
|
ErrorDialog(msg1, msg2, parent=self.window)
|
||||||
self.ok_button.set_sensitive(True)
|
self.ok_button.set_sensitive(True)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -810,7 +810,7 @@ class EditPerson(EditPrimary):
|
|||||||
msg = _("Changing the gender caused problems "
|
msg = _("Changing the gender caused problems "
|
||||||
"with marriage information.\nPlease check "
|
"with marriage information.\nPlease check "
|
||||||
"the person's marriages.")
|
"the person's marriages.")
|
||||||
ErrorDialog(msg2, msg)
|
ErrorDialog(msg2, msg, parent=self.window)
|
||||||
|
|
||||||
def save(self, *obj):
|
def save(self, *obj):
|
||||||
"""
|
"""
|
||||||
@ -820,7 +820,8 @@ class EditPerson(EditPrimary):
|
|||||||
if self.object_is_empty():
|
if self.object_is_empty():
|
||||||
ErrorDialog(_("Cannot save person"),
|
ErrorDialog(_("Cannot save person"),
|
||||||
_("No data exists for this person. Please "
|
_("No data exists for this person. Please "
|
||||||
"enter data or cancel the edit."))
|
"enter data or cancel the edit."),
|
||||||
|
parent=self.window)
|
||||||
self.ok_button.set_sensitive(True)
|
self.ok_button.set_sensitive(True)
|
||||||
return
|
return
|
||||||
# fix surname problems
|
# fix surname problems
|
||||||
@ -848,7 +849,7 @@ class EditPerson(EditPrimary):
|
|||||||
"%(prim_object)s'. Please enter a different ID or leave "
|
"%(prim_object)s'. Please enter a different ID or leave "
|
||||||
"blank to get the next available ID value.") % {
|
"blank to get the next available ID value.") % {
|
||||||
'id' : id, 'prim_object' : name }
|
'id' : id, 'prim_object' : name }
|
||||||
ErrorDialog(msg1, msg2)
|
ErrorDialog(msg1, msg2, parent=self.window)
|
||||||
self.ok_button.set_sensitive(True)
|
self.ok_button.set_sensitive(True)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -285,7 +285,7 @@ class EditPlace(EditPrimary):
|
|||||||
if self.obj.get_name().get_value().strip() == '':
|
if self.obj.get_name().get_value().strip() == '':
|
||||||
msg1 = _("Cannot save place. Name not entered.")
|
msg1 = _("Cannot save place. Name not entered.")
|
||||||
msg2 = _("You must enter a name before saving.")
|
msg2 = _("You must enter a name before saving.")
|
||||||
ErrorDialog(msg1, msg2)
|
ErrorDialog(msg1, msg2, parent=self.window)
|
||||||
self.ok_button.set_sensitive(True)
|
self.ok_button.set_sensitive(True)
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -299,7 +299,7 @@ class EditPlace(EditPrimary):
|
|||||||
"%(prim_object)s'. Please enter a different ID or leave "
|
"%(prim_object)s'. Please enter a different ID or leave "
|
||||||
"blank to get the next available ID value.") % {
|
"blank to get the next available ID value.") % {
|
||||||
'id' : id, 'prim_object' : name }
|
'id' : id, 'prim_object' : name }
|
||||||
ErrorDialog(msg1, msg2)
|
ErrorDialog(msg1, msg2, parent=self.window)
|
||||||
self.ok_button.set_sensitive(True)
|
self.ok_button.set_sensitive(True)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -136,7 +136,8 @@ class EditPlaceName(EditSecondary):
|
|||||||
def save(self, *obj):
|
def save(self, *obj):
|
||||||
if not self.obj.get_value():
|
if not self.obj.get_value():
|
||||||
ErrorDialog(_("Cannot save place name"),
|
ErrorDialog(_("Cannot save place name"),
|
||||||
_("The place name cannot be empty"))
|
_("The place name cannot be empty"),
|
||||||
|
parent=self.window)
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.callback:
|
if self.callback:
|
||||||
|
@ -276,7 +276,7 @@ class EditPlaceRef(EditReference):
|
|||||||
if self.source.get_name().get_value().strip() == '':
|
if self.source.get_name().get_value().strip() == '':
|
||||||
msg1 = _("Cannot save place. Name not entered.")
|
msg1 = _("Cannot save place. Name not entered.")
|
||||||
msg2 = _("You must enter a name before saving.")
|
msg2 = _("You must enter a name before saving.")
|
||||||
ErrorDialog(msg1, msg2)
|
ErrorDialog(msg1, msg2, parent=self.window)
|
||||||
self.ok_button.set_sensitive(True)
|
self.ok_button.set_sensitive(True)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -240,7 +240,7 @@ class EditPrimary(ManagedWindow, DbGUIElement, metaclass=abc.ABCMeta):
|
|||||||
'have made will be lost'),
|
'have made will be lost'),
|
||||||
self._do_close,
|
self._do_close,
|
||||||
self.save,
|
self.save,
|
||||||
self.window)
|
parent=self.window)
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
self._do_close()
|
self._do_close()
|
||||||
|
@ -297,6 +297,6 @@ class EditReference(ManagedWindow, DbGUIElement):
|
|||||||
"different ID or leave blank to get the next "
|
"different ID or leave blank to get the next "
|
||||||
"available ID value.") % {
|
"available ID value.") % {
|
||||||
'id' : new_id}
|
'id' : new_id}
|
||||||
ErrorDialog(msg1, msg2)
|
ErrorDialog(msg1, msg2, parent=self.window)
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
@ -178,7 +178,8 @@ class EditRepository(EditPrimary):
|
|||||||
if self.object_is_empty():
|
if self.object_is_empty():
|
||||||
ErrorDialog(_("Cannot save repository"),
|
ErrorDialog(_("Cannot save repository"),
|
||||||
_("No data exists for this repository. Please "
|
_("No data exists for this repository. Please "
|
||||||
"enter data or cancel the edit."))
|
"enter data or cancel the edit."),
|
||||||
|
parent=self.window)
|
||||||
self.ok_button.set_sensitive(True)
|
self.ok_button.set_sensitive(True)
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -192,7 +193,7 @@ class EditRepository(EditPrimary):
|
|||||||
"%(prim_object)s'. Please enter a different ID or leave "
|
"%(prim_object)s'. Please enter a different ID or leave "
|
||||||
"blank to get the next available ID value.") % {
|
"blank to get the next available ID value.") % {
|
||||||
'id' : id, 'prim_object' : name }
|
'id' : id, 'prim_object' : name }
|
||||||
ErrorDialog(msg1, msg2)
|
ErrorDialog(msg1, msg2, parent=self.window)
|
||||||
self.ok_button.set_sensitive(True)
|
self.ok_button.set_sensitive(True)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -198,7 +198,8 @@ class EditSource(EditPrimary):
|
|||||||
if self.object_is_empty():
|
if self.object_is_empty():
|
||||||
ErrorDialog(_("Cannot save source"),
|
ErrorDialog(_("Cannot save source"),
|
||||||
_("No data exists for this source. Please "
|
_("No data exists for this source. Please "
|
||||||
"enter data or cancel the edit."))
|
"enter data or cancel the edit."),
|
||||||
|
parent=self.window)
|
||||||
self.ok_button.set_sensitive(True)
|
self.ok_button.set_sensitive(True)
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -212,7 +213,7 @@ class EditSource(EditPrimary):
|
|||||||
"%(prim_object)s'. Please enter a different ID or leave "
|
"%(prim_object)s'. Please enter a different ID or leave "
|
||||||
"blank to get the next available ID value.") % {
|
"blank to get the next available ID value.") % {
|
||||||
'id' : id, 'prim_object' : name }
|
'id' : id, 'prim_object' : name }
|
||||||
ErrorDialog(msg1, msg2)
|
ErrorDialog(msg1, msg2, parent=self.window)
|
||||||
self.ok_button.set_sensitive(True)
|
self.ok_button.set_sensitive(True)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -1184,7 +1184,7 @@ class FilterEditor(ManagedWindow):
|
|||||||
'other filters that depend on it.'),
|
'other filters that depend on it.'),
|
||||||
_('Delete Filter'),
|
_('Delete Filter'),
|
||||||
self._do_delete_selected_filter,
|
self._do_delete_selected_filter,
|
||||||
self.window)
|
parent=self.window)
|
||||||
else:
|
else:
|
||||||
self._do_delete_selected_filter()
|
self._do_delete_selected_filter()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user