8128: GtkDialog mapped without a transient parent -- partial
This commit is contained in:
parent
5628198bb2
commit
269f9e7626
@ -114,7 +114,7 @@ class User():
|
|||||||
finally:
|
finally:
|
||||||
self.end_progress()
|
self.end_progress()
|
||||||
|
|
||||||
def prompt(self, title, message, accept_label, reject_label):
|
def prompt(self, title, message, accept_label, reject_label, parent=None):
|
||||||
"""
|
"""
|
||||||
Prompt the user with a message to select an alternative.
|
Prompt the user with a message to select an alternative.
|
||||||
|
|
||||||
|
@ -1222,7 +1222,8 @@ class GuiPersonListOption(Gtk.Box):
|
|||||||
prompt = OptionDialog(_('Select Person'),
|
prompt = OptionDialog(_('Select Person'),
|
||||||
text,
|
text,
|
||||||
_('No'), None,
|
_('No'), None,
|
||||||
_('Yes'), None)
|
_('Yes'), None,
|
||||||
|
parent=self.__uistate.window)
|
||||||
if prompt.get_response() == Gtk.ResponseType.YES:
|
if prompt.get_response() == Gtk.ResponseType.YES:
|
||||||
gid = spouse.get_gramps_id()
|
gid = spouse.get_gramps_id()
|
||||||
self.__model.append([spouse_name, gid])
|
self.__model.append([spouse_name, gid])
|
||||||
|
@ -127,7 +127,7 @@ class ChangeTypes(tool.BatchTool, ManagedWindow):
|
|||||||
"{number_of} event records were modified.", modified
|
"{number_of} event records were modified.", modified
|
||||||
).format(number_of=modified)
|
).format(number_of=modified)
|
||||||
|
|
||||||
self.user.info(_('Change types'), msg, parent_window)
|
self.user.info(_('Change types'), msg, parent=parent_window)
|
||||||
return (bool(modified),msg)
|
return (bool(modified),msg)
|
||||||
|
|
||||||
def on_apply_clicked(self, obj):
|
def on_apply_clicked(self, obj):
|
||||||
|
@ -111,15 +111,21 @@ class EventNames(tool.BatchTool):
|
|||||||
self.db.enable_signals()
|
self.db.enable_signals()
|
||||||
self.db.request_rebuild()
|
self.db.request_rebuild()
|
||||||
|
|
||||||
|
if hasattr(self.user.uistate, 'window'):
|
||||||
|
parent_window = self.user.uistate.window
|
||||||
|
else:
|
||||||
|
parent_window = None
|
||||||
if self.change == True:
|
if self.change == True:
|
||||||
# translators: leave all/any {...} untranslated
|
# translators: leave all/any {...} untranslated
|
||||||
message = ngettext("{quantity} event description has been added",
|
message = ngettext("{quantity} event description has been added",
|
||||||
"{quantity} event descriptions have been added",
|
"{quantity} event descriptions have been added",
|
||||||
counter).format(quantity=counter)
|
counter).format(quantity=counter)
|
||||||
self.user.info(_('Modifications made'), message)
|
self.user.info(_('Modifications made'), message,
|
||||||
|
parent=parent_window)
|
||||||
else:
|
else:
|
||||||
self.user.info(_('No modifications made'),
|
self.user.info(_('No modifications made'),
|
||||||
_("No event description has been added."))
|
_("No event description has been added."),
|
||||||
|
parent=parent_window)
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
|
@ -415,18 +415,18 @@ class ExtractCity(tool.BatchTool, ManagedWindow):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, dbstate, user, options_class, name, callback=None):
|
def __init__(self, dbstate, user, options_class, name, callback=None):
|
||||||
uistate = user.uistate
|
self.uistate = user.uistate
|
||||||
self.label = _('Extract Place data')
|
self.label = _('Extract Place data')
|
||||||
|
|
||||||
ManagedWindow.__init__(self, uistate, [], self.__class__)
|
ManagedWindow.__init__(self, self.uistate, [], self.__class__)
|
||||||
self.set_window(Gtk.Window(), Gtk.Label(), '')
|
self.set_window(Gtk.Window(), Gtk.Label(), '')
|
||||||
|
|
||||||
tool.BatchTool.__init__(self, dbstate, user, options_class, name)
|
tool.BatchTool.__init__(self, dbstate, user, options_class, name)
|
||||||
|
|
||||||
if not self.fail:
|
if not self.fail:
|
||||||
uistate.set_busy_cursor(True)
|
self.uistate.set_busy_cursor(True)
|
||||||
self.run(dbstate.db)
|
self.run(dbstate.db)
|
||||||
uistate.set_busy_cursor(False)
|
self.uistate.set_busy_cursor(False)
|
||||||
|
|
||||||
def run(self, db):
|
def run(self, db):
|
||||||
"""
|
"""
|
||||||
@ -521,7 +521,8 @@ class ExtractCity(tool.BatchTool, ManagedWindow):
|
|||||||
self.close()
|
self.close()
|
||||||
from gramps.gui.dialog import OkDialog
|
from gramps.gui.dialog import OkDialog
|
||||||
OkDialog(_('No modifications made'),
|
OkDialog(_('No modifications made'),
|
||||||
_("No place information could be extracted."))
|
_("No place information could be extracted."),
|
||||||
|
parent=self.uistate.window)
|
||||||
|
|
||||||
def display(self):
|
def display(self):
|
||||||
|
|
||||||
|
@ -91,6 +91,7 @@ class MergeCitations(tool.BatchTool,ManagedWindow):
|
|||||||
|
|
||||||
def __init__(self, dbstate, user, options_class, name, callback=None):
|
def __init__(self, dbstate, user, options_class, name, callback=None):
|
||||||
uistate = user.uistate
|
uistate = user.uistate
|
||||||
|
self.user = user
|
||||||
|
|
||||||
ManagedWindow.__init__(self, uistate, [], self.__class__)
|
ManagedWindow.__init__(self, uistate, [], self.__class__)
|
||||||
self.dbstate = dbstate
|
self.dbstate = dbstate
|
||||||
@ -124,6 +125,7 @@ class MergeCitations(tool.BatchTool,ManagedWindow):
|
|||||||
self.menu.set_active(fields)
|
self.menu.set_active(fields)
|
||||||
|
|
||||||
window = top.toplevel
|
window = top.toplevel
|
||||||
|
window.set_transient_for(self.user.uistate.window)
|
||||||
window.show()
|
window.show()
|
||||||
# self.set_window(window, top.get_object('title'),
|
# self.set_window(window, top.get_object('title'),
|
||||||
# _('Merge citations'))
|
# _('Merge citations'))
|
||||||
@ -179,7 +181,8 @@ class MergeCitations(tool.BatchTool,ManagedWindow):
|
|||||||
# Save options
|
# Save options
|
||||||
self.options.handler.save_options()
|
self.options.handler.save_options()
|
||||||
|
|
||||||
self.progress = ProgressMeter(_('Checking Sources'), '')
|
self.progress = ProgressMeter(_('Checking Sources'), '',
|
||||||
|
parent=self.user.uistate.window)
|
||||||
self.progress.set_pass(_('Looking for citation fields'),
|
self.progress.set_pass(_('Looking for citation fields'),
|
||||||
self.db.get_number_of_citations())
|
self.db.get_number_of_citations())
|
||||||
|
|
||||||
@ -230,7 +233,8 @@ class MergeCitations(tool.BatchTool,ManagedWindow):
|
|||||||
# translators: leave all/any {...} untranslated
|
# translators: leave all/any {...} untranslated
|
||||||
ngettext("{number_of} citation merged",
|
ngettext("{number_of} citation merged",
|
||||||
"{number_of} citations merged", num_merges
|
"{number_of} citations merged", num_merges
|
||||||
).format(number_of=num_merges) )
|
).format(number_of=num_merges),
|
||||||
|
parent=self.user.uistate.window)
|
||||||
self.close(obj)
|
self.close(obj)
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
|
@ -361,7 +361,8 @@ class PatchNames(tool.BatchTool, ManagedWindow):
|
|||||||
self.progress.close()
|
self.progress.close()
|
||||||
self.close()
|
self.close()
|
||||||
OkDialog(_('No modifications made'),
|
OkDialog(_('No modifications made'),
|
||||||
_("No titles, nicknames or prefixes were found"))
|
_("No titles, nicknames or prefixes were found"),
|
||||||
|
parent=self.uistate.window)
|
||||||
|
|
||||||
def build_menu_names(self, obj):
|
def build_menu_names(self, obj):
|
||||||
return (self.label, None)
|
return (self.label, None)
|
||||||
|
Loading…
Reference in New Issue
Block a user