setting dialogs parent

This commit is contained in:
Josip 2015-06-10 02:22:21 +02:00
parent 891b9d2e34
commit fedfabc87e
34 changed files with 115 additions and 77 deletions

View File

@ -147,7 +147,7 @@ class AddMediaObject(ManagedWindow):
if self.file_text.get_filename() is None:
msgstr = _("Import failed")
msgstr2 = _("The filename supplied could not be found.")
ErrorDialog(msgstr, msgstr2)
ErrorDialog(msgstr, msgstr2, parent=self.window)
return
filename = conv_to_unicode(self.file_text.get_filename())
@ -158,7 +158,7 @@ class AddMediaObject(ManagedWindow):
if not os.path.exists(pname):
msgstr = _("Cannot import %s")
msgstr2 = _("Directory specified in preferences: Base path for relative media paths: %s does not exist. Change preferences or do not use relative path when importing")
ErrorDialog(msgstr % filename, msgstr2 % pname)
ErrorDialog(msgstr % filename, msgstr2 % pname, parent=self.window)
return
filename = relative_path(filename, pname)

View File

@ -137,7 +137,8 @@ class EditAttributeRoot(EditSecondary):
from ..dialog import ErrorDialog
ErrorDialog(
_("Cannot save attribute"),
_("The attribute type cannot be empty"))
_("The attribute type cannot be empty"),
parent=self.window)
return
if self.callback:
self.callback(self.obj)

View File

@ -280,7 +280,8 @@ class EditCitation(EditPrimary):
"derived. To create a citation, first select the "
"required source, and then record the location of "
"the information referenced within the source in the "
"'Volume/Page' field."))
"'Volume/Page' field."),
parent=self.window)
self.ok_button.set_sensitive(True)
return
@ -294,7 +295,7 @@ class EditCitation(EditPrimary):
"%(prim_object)s'. Please enter a different ID or leave "
"blank to get the next available ID value.") % {
'id' : gramps_id, 'prim_object' : name }
ErrorDialog(msg1, msg2)
ErrorDialog(msg1, msg2, parent=self.window)
self.ok_button.set_sensitive(True)
return

View File

@ -236,7 +236,8 @@ class EditEvent(EditPrimary):
if self.object_is_empty():
ErrorDialog(_("Cannot save event"),
_("No data exists for this event. Please "
"enter data or cancel the edit."))
"enter data or cancel the edit."),
parent=self.window)
self.ok_button.set_sensitive(True)
return
@ -250,7 +251,7 @@ class EditEvent(EditPrimary):
"%(prim_object)s'. Please enter a different ID or leave "
"blank to get the next available ID value.") % {
'id' : id, 'prim_object' : name }
ErrorDialog(msg1, msg2)
ErrorDialog(msg1, msg2, parent=self.window)
self.ok_button.set_sensitive(True)
return
@ -258,7 +259,7 @@ class EditEvent(EditPrimary):
if t.is_custom() and str(t) == '':
ErrorDialog(
_("Cannot save event"),
_("The event type cannot be empty"))
_("The event type cannot be empty"), parent=self.window)
self.ok_button.set_sensitive(True)
return

View File

@ -362,7 +362,8 @@ class EditFamily(EditPrimary):
"are available when you create a new family. The "
"remaining fields will become available after you "
"attempt to select a parent."),
'preferences.family-warn')
'preferences.family-warn',
parent=self.window)
else:
self.add_parent = False
@ -1049,8 +1050,9 @@ class EditFamily(EditPrimary):
name = "%s [%s]" % (name_displayer.display(father),
father.gramps_id)
ErrorDialog(_("A father cannot be his own child"),
_("%s is listed as both the father and child "
"of the family.") % name)
_("%s is listed as both the father and child "
"of the family.") % name,
parent=self.window)
self.ok_button.set_sensitive(True)
return
elif self.obj.get_mother_handle() in child_list:
@ -1059,8 +1061,9 @@ class EditFamily(EditPrimary):
name = "%s [%s]" % (name_displayer.display(mother),
mother.gramps_id)
ErrorDialog(_("A mother cannot be her own child"),
_("%s is listed as both the mother and child "
"of the family.") % name)
_("%s is listed as both the mother and child "
"of the family.") % name,
parent=self.window)
self.ok_button.set_sensitive(True)
return
@ -1068,7 +1071,8 @@ class EditFamily(EditPrimary):
ErrorDialog(
_("Cannot save family"),
_("No data exists for this family. "
"Please enter data or cancel the edit."))
"Please enter data or cancel the edit."),
parent=self.window)
self.ok_button.set_sensitive(True)
return
@ -1080,7 +1084,7 @@ class EditFamily(EditPrimary):
"enter a different ID or leave "
"blank to get the next available ID value.") % {
'id' : id}
ErrorDialog(msg1, msg2)
ErrorDialog(msg1, msg2, parent=self.window)
self.ok_button.set_sensitive(True)
return

View File

@ -290,7 +290,7 @@ class EditMedia(EditPrimary):
"%(prim_object)s'. Please enter a different ID or leave "
"blank to get the next available ID value.") % {
'id' : id, 'prim_object' : name }
ErrorDialog(msg1, msg2)
ErrorDialog(msg1, msg2, parent=self.window)
self.ok_button.set_sensitive(True)
return
@ -304,7 +304,7 @@ class EditMedia(EditPrimary):
"value '%(path)s'. This path does not exist!"
" Please enter a different path") % {
'path' : path }
ErrorDialog(msg1, msg2)
ErrorDialog(msg1, msg2, parent=self.window)
self.ok_button.set_sensitive(True)
return

View File

@ -382,7 +382,8 @@ class EditName(EditSecondary):
) % { 'surname' : surname,
'group_name':group_as},
_("Continue"),
_("Return to Name Editor"))
_("Return to Name Editor"),
parent=self.window)
val = q.run()
if val:
#delete the grouping link on database
@ -414,7 +415,8 @@ class EditName(EditSecondary):
) % { 'surname' : surname,
'group_name':group_as},
_("Group all"),
_("Group this name only"))
_("Group this name only"),
parent=self.window)
val = q.run()
if val:
if group_as == surname :

View File

@ -301,7 +301,8 @@ class EditNote(EditPrimary):
if self.object_is_empty():
ErrorDialog(_("Cannot save note"),
_("No data exists for this note. Please "
"enter data or cancel the edit."))
"enter data or cancel the edit."),
parent=self.window)
self.ok_button.set_sensitive(True)
return
@ -313,7 +314,7 @@ class EditNote(EditPrimary):
"enter a different ID or leave "
"blank to get the next available ID value.") % {
'id' : id }
ErrorDialog(msg1, msg2)
ErrorDialog(msg1, msg2, parent=self.window)
self.ok_button.set_sensitive(True)
return

View File

@ -811,7 +811,7 @@ class EditPerson(EditPrimary):
msg = _("Changing the gender caused problems "
"with marriage information.\nPlease check "
"the person's marriages.")
ErrorDialog(msg2, msg)
ErrorDialog(msg2, msg, parent=self.window)
def save(self, *obj):
"""
@ -821,7 +821,8 @@ class EditPerson(EditPrimary):
if self.object_is_empty():
ErrorDialog(_("Cannot save person"),
_("No data exists for this person. Please "
"enter data or cancel the edit."))
"enter data or cancel the edit."),
parent=self.window)
self.ok_button.set_sensitive(True)
return
# fix surname problems
@ -849,7 +850,7 @@ class EditPerson(EditPrimary):
"%(prim_object)s'. Please enter a different ID or leave "
"blank to get the next available ID value.") % {
'id' : id, 'prim_object' : name }
ErrorDialog(msg1, msg2)
ErrorDialog(msg1, msg2, parent=self.window)
self.ok_button.set_sensitive(True)
return

View File

@ -229,4 +229,5 @@ class EditPersonRef(EditSecondary):
ErrorDialog(
_('No person selected'),
_('You must either select a person or Cancel '
'the edit'))
'the edit'),
parent=self.window)

View File

@ -272,7 +272,7 @@ class EditPlace(EditPrimary):
if self.obj.get_name().get_value().strip() == '':
msg1 = _("Cannot save place. Name not entered.")
msg2 = _("You must enter a name before saving.")
ErrorDialog(msg1, msg2)
ErrorDialog(msg1, msg2, parent=self.window)
self.ok_button.set_sensitive(True)
return
@ -286,7 +286,7 @@ class EditPlace(EditPrimary):
"%(prim_object)s'. Please enter a different ID or leave "
"blank to get the next available ID value.") % {
'id' : id, 'prim_object' : name }
ErrorDialog(msg1, msg2)
ErrorDialog(msg1, msg2, parent=self.window)
self.ok_button.set_sensitive(True)
return

View File

@ -87,7 +87,8 @@ class EditPlaceName(EditSecondary):
def save(self, *obj):
if not self.obj.get_value():
ErrorDialog(_("Cannot save place name"),
_("The place name cannot be empty"))
_("The place name cannot be empty"),
parent=self.window)
return
if self.callback:

View File

@ -274,7 +274,7 @@ class EditPlaceRef(EditReference):
if self.source.get_name().get_value().strip() == '':
msg1 = _("Cannot save place. Name not entered.")
msg2 = _("You must enter a name before saving.")
ErrorDialog(msg1, msg2)
ErrorDialog(msg1, msg2, parent=self.window)
self.ok_button.set_sensitive(True)
return

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)
ErrorDialog(msg1, msg2, parent=self.window)
return True
return False

View File

@ -167,7 +167,8 @@ class EditRepository(EditPrimary):
if self.object_is_empty():
ErrorDialog(_("Cannot save repository"),
_("No data exists for this repository. Please "
"enter data or cancel the edit."))
"enter data or cancel the edit."),
parent=self.window)
self.ok_button.set_sensitive(True)
return
@ -181,7 +182,7 @@ class EditRepository(EditPrimary):
"%(prim_object)s'. Please enter a different ID or leave "
"blank to get the next available ID value.") % {
'id' : id, 'prim_object' : name }
ErrorDialog(msg1, msg2)
ErrorDialog(msg1, msg2, parent=self.window)
self.ok_button.set_sensitive(True)
return

View File

@ -187,7 +187,8 @@ class EditSource(EditPrimary):
if self.object_is_empty():
ErrorDialog(_("Cannot save source"),
_("No data exists for this source. Please "
"enter data or cancel the edit."))
"enter data or cancel the edit."),
parent=self.window)
self.ok_button.set_sensitive(True)
return
@ -201,7 +202,7 @@ class EditSource(EditPrimary):
"%(prim_object)s'. Please enter a different ID or leave "
"blank to get the next available ID value.") % {
'id' : id, 'prim_object' : name }
ErrorDialog(msg1, msg2)
ErrorDialog(msg1, msg2, parent=self.window)
self.ok_button.set_sensitive(True)
return

View File

@ -136,7 +136,8 @@ class StyleListDisplay(object):
self.sheetlist.save()
except IOError as msg:
from ...dialog import ErrorDialog
ErrorDialog(_("Error saving stylesheet"), str(msg))
ErrorDialog(_("Error saving stylesheet"),
str(msg), parent=self.window)
except:
log.error("Failed to save stylesheet", exc_info=True)

View File

@ -663,7 +663,7 @@ class ViewManager(CLIManager):
"""
Initialize the interface.
"""
self.views = get_available_views()
self.views = get_available_views(self.uistate)
defaults = views_to_show(self.views,
config.get('preferences.use-last-view'))
self.current_views = defaults[2]
@ -764,7 +764,7 @@ class ViewManager(CLIManager):
try:
backup(self.dbstate.db)
except DbException as msg:
ErrorDialog(_("Error saving backup data"), msg)
ErrorDialog(_("Error saving backup data"), msg, parent=self.uistate.window)
self.uistate.set_busy_cursor(False)
self.uistate.progress.hide()
@ -779,7 +779,8 @@ class ViewManager(CLIManager):
_("Aborting changes will return the database to the state "
"it was before you started this editing session."),
_("Abort changes"),
_("Cancel"))
_("Cancel"),
parent=self.uistate.window)
if dialog.run():
self.dbstate.db.disable_signals()
@ -791,7 +792,8 @@ class ViewManager(CLIManager):
_("Cannot abandon session's changes"),
_('Changes cannot be completely abandoned because the '
'number of changes made in the session exceeded the '
'limit.'))
'limit.'),
parent=self.uistate.window)
def __init_action_group(self, name, actions, sensitive=True, toggles=None):
"""
@ -1608,7 +1610,8 @@ def run_plugin(pdata, dbstate, uistate):
'gramps_bugtracker_url' : URL_BUGHOME,
'firstauthoremail': pdata.authors_email[0] if
pdata.authors_email else '...',
'error_msg': pmgr.get_fail_list()[-1][1][1]})
'error_msg': pmgr.get_fail_list()[-1][1][1]},
parent=uistate.window)
return
if pdata.ptype == REPORT:
@ -1633,7 +1636,7 @@ def make_plugin_callback(pdata, dbstate, uistate):
"""
return lambda x: run_plugin(pdata, dbstate, uistate)
def get_available_views():
def get_available_views(uistate):
"""
Query the views and determine what views to show and in which order
@ -1664,7 +1667,8 @@ def get_available_views():
'gramps_bugtracker_url' : URL_BUGHOME,
'firstauthoremail': pdata.authors_email[0] if
pdata.authors_email else '...',
'error_msg': lasterror})
'error_msg': lasterror},
parent=uistate.window)
continue
viewclass = getattr(mod, pdata.viewclass)

View File

@ -409,7 +409,8 @@ class CitationBookmarks(ListBookmarks) :
"You are probably trying to bookmark a Source in the "
"Citation Tree View. In this view, only Citations "
"can be bookmarked. To bookmark a Source, switch to "
"the Source View")
"the Source View",
parent=self.uistate.window)
def connect_signals(self):
self.dbstate.db.connect('citation-delete', self.remove_handles)

View File

@ -447,7 +447,8 @@ class ListView(NavigationView):
WarningDialog(
_("Could Not Set a Bookmark"),
_("A bookmark could not be set because "
"nothing was selected."))
"nothing was selected."),
parent=self.uistate.window)
####################################################################
#
@ -541,7 +542,8 @@ class ListView(NavigationView):
_("More than one item has been selected for deletion. "
"Select the option indicating how to delete the items:"),
_("Delete All"),
_("Confirm Each Delete"))
_("Confirm Each Delete"),
parent=self.uistate.window)
prompt = not q.run()
if not prompt:
@ -563,7 +565,8 @@ class ListView(NavigationView):
descr = object.get_gramps_id()
self.uistate.set_busy_cursor(True)
QuestionDialog(_('Delete %s?') % descr, msg,
_('_Delete Item'), query.query_response)
_('_Delete Item'), query.query_response,
parent=self.uistate.window)
self.uistate.set_busy_cursor(False)
else:
query.query_response()

View File

@ -254,7 +254,8 @@ class NavigationView(PageView):
WarningDialog(
_("Could Not Set a Bookmark"),
_("A bookmark could not be set because "
"no one was selected."))
"no one was selected."),
parent=self.uistate.window)
def edit_bookmarks(self, obj):
"""
@ -343,7 +344,7 @@ class NavigationView(PageView):
"""
A dialog to move to a Gramps ID entered by the user.
"""
dialog = Gtk.Dialog(_('Jump to by Gramps ID'))
dialog = Gtk.Dialog(_('Jump to by Gramps ID'), parent=self.uistate.window)
dialog.set_border_width(12)
label = Gtk.Label(label='<span weight="bold" size="larger">%s</span>' %
_('Jump to by Gramps ID'))

View File

@ -485,7 +485,9 @@ class OrganizeTagsDialog(object):
_("The tag definition will be removed. "
"The tag will be also removed from all objects in the database."),
_("Yes"),
_("No"))
_("No"),
parent=top)
prompt = yes_no.run()
if prompt:
@ -571,7 +573,8 @@ class EditTag(object):
if not self.tag.get_name():
ErrorDialog(
_("Cannot save tag"),
_("The tag name cannot be empty"))
_("The tag name cannot be empty"),
parent=self.top)
return
if not self.tag.get_handle():

View File

@ -296,7 +296,8 @@ class BasePersonView(ListView):
QuestionDialog(msg1,
msg2,
_('_Delete Person'),
self.delete_person_response)
self.delete_person_response,
parent=self.uistate.window)
else:
# Ask to delete; option to cancel, delete rest
# This gets person to delete from parameter
@ -304,7 +305,8 @@ class BasePersonView(ListView):
self._message2_format,
handles,
self._lookup_person,
yes_func=self.delete_person_response) # Yes
yes_func=self.delete_person_response,
parent=self.uistate.window) # Yes
def _message1_format(self, person):
return _('Delete %s?') % (name_displayer.display(person) +
@ -417,7 +419,8 @@ class BasePersonView(ListView):
_("Cannot merge people"),
_("Exactly two people must be selected to perform a merge. "
"A second person can be selected by holding down the "
"control key while clicking on the desired person."))
"control key while clicking on the desired person."),
parent=self.uistate.window)
else:
MergePerson(self.dbstate, self.uistate, mlist[0], mlist[1])

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)
ErrorDialog(msg, msg2, parent=self.uistate.window)
return
place_handles = self.selected_handles()
@ -269,7 +269,7 @@ class PlaceBaseView(ListView):
msg2 = _("You need to select a place to be able to view it"
" on a map. Some Map Services might support multiple"
" selections.")
ErrorDialog(msg, msg2)
ErrorDialog(msg, msg2, parent=self.uistate.window)
return
#TODO: support for descriptions in some cases. For now, pass None
@ -363,7 +363,7 @@ class PlaceBaseView(ListView):
msg = _("Cannot delete place.")
msg2 = _("This place is currently referenced by another place. "
"First remove the places it contains.")
ErrorDialog(msg, msg2)
ErrorDialog(msg, msg2, parent=self.uistate.window)
return
self.remove_selected_objects()
@ -406,14 +406,14 @@ class PlaceBaseView(ListView):
msg2 = _("Exactly two places must be selected to perform a merge. "
"A second place can be selected by holding down the "
"control key while clicking on the desired place.")
ErrorDialog(msg, msg2)
ErrorDialog(msg, msg2, parent=self.uistate.window)
else:
if (located_in(self.dbstate.db, mlist[0], mlist[1]) or
located_in(self.dbstate.db, mlist[1], mlist[0])):
msg = _("Cannot merge places.")
msg2 = _("Merging these places would create a cycle in the "
"place hierarchy.")
ErrorDialog(msg, msg2)
ErrorDialog(msg, msg2, parent=self.uistate.window)
else:
MergePlace(self.dbstate, self.uistate, mlist[0], mlist[1],
self.merged)

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)
ErrorDialog(msg, msg2, parent=self.uistate.window)
else:
citation1 = self.dbstate.db.get_citation_from_handle(mlist[0])
citation2 = self.dbstate.db.get_citation_from_handle(mlist[1])
@ -324,7 +324,7 @@ class CitationListView(ListView):
"source to perform a merge. If you want to merge "
"these two citations, then you must merge the "
"sources first.")
ErrorDialog(msg, msg2)
ErrorDialog(msg, msg2, parent=self.uistate.window)
else:
MergeCitation(self.dbstate, self.uistate, mlist[0], mlist[1])

View File

@ -427,12 +427,13 @@ class CitationTreeView(ListView):
except WindowActiveError:
from gramps.gui.dialog import WarningDialog
WarningDialog(_("Cannot share this reference"),
self.__blocked_text())
self.__blocked_text(),
parent=self.uistate.window)
else:
msg = _("Cannot add citation.")
msg2 = _("In order to add a citation to an existing source, "
" you must select a source.")
ErrorDialog(msg, msg2)
ErrorDialog(msg, msg2, parent=self.uistate.window)
#
def remove(self, obj):
self.remove_selected_objects()
@ -482,7 +483,8 @@ class CitationTreeView(ListView):
except WindowActiveError:
from gramps.gui.dialog import WarningDialog
WarningDialog(_("Cannot share this reference"),
self.__blocked_text2())
self.__blocked_text2(),
parent=self.uistate.window)
def __blocked_text(self):
"""
@ -516,7 +518,7 @@ class CitationTreeView(ListView):
"merge. A second citation can be selected by holding "
"down the control key while clicking on the desired "
"citation.")
ErrorDialog(msg, msg2)
ErrorDialog(msg, msg2, parent=self.uistate.window)
else:
source1 = self.dbstate.db.get_source_from_handle(mlist[0])
citation1 = self.dbstate.db.get_citation_from_handle(mlist[0])
@ -536,7 +538,7 @@ class CitationTreeView(ListView):
"source to perform a merge. If you want to merge "
"these two citations, then you must merge the "
"sources first.")
ErrorDialog(msg, msg2)
ErrorDialog(msg, msg2, parent=self.uistate.window)
else:
MergeCitation(self.dbstate, self.uistate, mlist[0],
mlist[1])
@ -547,7 +549,7 @@ class CitationTreeView(ListView):
msg2 = _("Both objects must be of the same type, either "
"both must be sources, or both must be "
"citations.")
ErrorDialog(msg, msg2)
ErrorDialog(msg, msg2, parent=self.uistate.window)
def get_handle_from_gramps_id(self, gid):
obj = self.dbstate.db.get_citation_from_gramps_id(gid)

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)
ErrorDialog(msg, msg2, parent=self.uistate.window)
else:
MergeEvent(self.dbstate, self.uistate, mlist[0], mlist[1])

View File

@ -219,7 +219,8 @@ class FamilyView(ListView):
WarningDialog(
_("Could Not Set a Bookmark"),
_("A bookmark could not be set because "
"no one was selected."))
"no one was selected."),
parent=self.uistate.window)
def add(self, obj):
family = Family()
@ -243,13 +244,15 @@ class FamilyView(ListView):
QuestionDialog(msg1,
msg2,
_('_Delete Family'),
lambda: self.delete_family_response(family))
lambda: self.delete_family_response(family),
parent=self.uistate.window)
else:
MultiSelectDialog(self._message1_format,
self._message2_format,
handles,
self.dbstate.db.get_family_from_handle,
yes_func=self.delete_family_response)
yes_func=self.delete_family_response,
parent=self.uistate.window)
def _message1_format(self, family):
"""
@ -298,7 +301,7 @@ class FamilyView(ListView):
msg2 = _("Exactly two families must be selected to perform a merge."
" A second family can be selected by holding down the "
"control key while clicking on the desired family.")
ErrorDialog(msg, msg2)
ErrorDialog(msg, msg2, parent=self.uistate.window)
else:
MergeFamily(self.dbstate, self.uistate, mlist[0], mlist[1])

View File

@ -351,7 +351,7 @@ class MediaView(ListView):
msg2 = _("Exactly two media objects must be selected to perform a "
"merge. A second object can be selected by holding down the "
"control key while clicking on the desired object.")
ErrorDialog(msg, msg2)
ErrorDialog(msg, msg2, parent=self.uistate.window)
else:
MergeMedia(self.dbstate, self.uistate, mlist[0], mlist[1])

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)
ErrorDialog(msg, msg2, parent=self.uistate.window)
else:
MergeNote(self.dbstate, self.uistate, mlist[0], mlist[1])

View File

@ -1494,7 +1494,8 @@ class PedigreeView(NavigationView):
alive = probably_alive(person, self.dbstate.db)
except RuntimeError:
ErrorDialog(_('Relationship loop detected'),
_('A person was found to be his/her own ancestor.'))
_('A person was found to be his/her own ancestor.'),
parent=self.uistate.window)
alive = False
lst[index] = [person, val, None, alive, None]

View File

@ -1350,7 +1350,8 @@ class RelationshipView(NavigationView):
from gramps.gui.dialog import WarningDialog
WarningDialog(
_('Broken family detected'),
_('Please run the Check and Repair Database tool'))
_('Please run the Check and Repair Database tool'),
parent=self.uistate.window)
return
father_handle = family.get_father_handle()

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)
ErrorDialog(msg, msg2, parent=self.uistate.window)
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)
ErrorDialog(msg, msg2, parent=self.uistate.window)
else:
MergeSource(self.dbstate, self.uistate, mlist[0], mlist[1])