diff --git a/gramps/cli/user.py b/gramps/cli/user.py
index 12698a1dd..1aa8818cc 100644
--- a/gramps/cli/user.py
+++ b/gramps/cli/user.py
@@ -117,7 +117,7 @@ class User(user.User):
"""
self._fileout.write("\r100%\n")
- 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.
diff --git a/gramps/gui/configure.py b/gramps/gui/configure.py
index 912081455..a453f8693 100644
--- a/gramps/gui/configure.py
+++ b/gramps/gui/configure.py
@@ -97,7 +97,7 @@ class DisplayNameEditor(ManagedWindow):
def __init__(self, uistate, dbstate, track, dialog):
# Assumes that there are two methods: dialog.name_changed_check(),
# and dialog._build_custom_name_ui()
- ManagedWindow.__init__(self, uistate, [], DisplayNameEditor)
+ ManagedWindow.__init__(self, uistate, track, DisplayNameEditor)
self.dialog = dialog
self.dbstate = dbstate
self.set_window(
@@ -136,7 +136,8 @@ UPPERCASE keyword forces uppercase. Extra parentheses, commas are removed. Other
ManagedWindow.close(self, *obj)
def build_menu_names(self, obj):
- return (_(" Name Editor"), _("Preferences"))
+ # NameEditor is leaf of parent branch
+ return (_(" Name Editor"), None)
#-------------------------------------------------------------------------
@@ -188,7 +189,6 @@ class ConfigureDialog(ManagedWindow):
self.__setup_pages(configure_page_funcs)
- self.window.show_all()
self.show()
def __setup_pages(self, configure_page_funcs):
@@ -231,12 +231,12 @@ class ConfigureDialog(ManagedWindow):
except TypeError:
print("WARNING: ignoring invalid value for '%s'" % constant)
ErrorDialog(_("Invalid or incomplete format definition."),
- obj.get_text())
+ obj.get_text(), parent=self.window)
obj.set_text('%s')
except ValueError:
print("WARNING: ignoring invalid value for '%s'" % constant)
ErrorDialog(_("Invalid or incomplete format definition."),
- obj.get_text())
+ obj.get_text(), parent=self.window)
obj.set_text('%s')
self.__config.set(constant, unicode(obj.get_text()))
@@ -770,7 +770,7 @@ class GrampsPreferences(ConfigureDialog):
# check to see if this pattern already exists
if self.__check_for_name(translation, node):
ErrorDialog(_("This format exists already."),
- translation)
+ translation, parent=self.window)
self.edit_button.emit('clicked')
return
# else, change the name
@@ -1170,13 +1170,15 @@ class GrampsPreferences(ConfigureDialog):
config.set('preferences.date-format', obj.get_active())
OkDialog(_('Change is not immediate'),
_('Changing the date format will not take '
- 'effect until the next time Gramps is started.'))
+ 'effect until the next time Gramps is started.'),
+ parent=self.window)
def place_format_changed(self, obj):
config.set('preferences.place-format', obj.get_active())
OkDialog(_('Change is not immediate'),
_('Changing the place format will not take '
- 'effect until the next time Gramps is started.'))
+ 'effect until the next time Gramps is started.'),
+ parent=self.window)
def date_calendar_changed(self, obj):
config.set('preferences.calendar-format-report', obj.get_active())
@@ -1388,12 +1390,13 @@ class GrampsPreferences(ConfigureDialog):
def select_mediapath(self, *obj):
f = Gtk.FileChooserDialog(
- _("Select media directory"),
- action=Gtk.FileChooserAction.SELECT_FOLDER,
- buttons=(Gtk.STOCK_CANCEL,
- Gtk.ResponseType.CANCEL,
- Gtk.STOCK_APPLY,
- Gtk.ResponseType.OK))
+ title=_("Select media directory"),
+ parent=self.window,
+ action=Gtk.FileChooserAction.SELECT_FOLDER,
+ buttons=(Gtk.STOCK_CANCEL,
+ Gtk.ResponseType.CANCEL,
+ Gtk.STOCK_APPLY,
+ Gtk.ResponseType.OK))
mpath = self.dbstate.db.get_mediapath()
if not mpath:
mpath = HOME_DIR
@@ -1412,12 +1415,13 @@ class GrampsPreferences(ConfigureDialog):
def select_dbpath(self, *obj):
f = Gtk.FileChooserDialog(
- _("Select database directory"),
- action=Gtk.FileChooserAction.SELECT_FOLDER,
- buttons=(Gtk.STOCK_CANCEL,
- Gtk.ResponseType.CANCEL,
- Gtk.STOCK_APPLY,
- Gtk.ResponseType.OK))
+ title=_("Select database directory"),
+ parent=self.window,
+ action=Gtk.FileChooserAction.SELECT_FOLDER,
+ buttons=(Gtk.STOCK_CANCEL,
+ Gtk.ResponseType.CANCEL,
+ Gtk.STOCK_APPLY,
+ Gtk.ResponseType.OK))
dbpath = config.get('behavior.database-path')
if not dbpath:
dbpath = os.path.join(HOME_DIR,'grampsdb')
@@ -1470,7 +1474,9 @@ class GrampsPreferences(ConfigureDialog):
obj.set_text(str(intval))
def build_menu_names(self, obj):
- return (_('Preferences'), None)
+ # Preferences editor my open other dialog so let main dialog
+ # be leaf in branch
+ return (_('Preferences'), _('Preferences'))
# FIXME: is this needed?
def _set_button(self, stock):
diff --git a/gramps/gui/plug/export/_exportoptions.py b/gramps/gui/plug/export/_exportoptions.py
index 864b3e4f5..3d49cb43d 100644
--- a/gramps/gui/plug/export/_exportoptions.py
+++ b/gramps/gui/plug/export/_exportoptions.py
@@ -50,9 +50,10 @@ class Progress(object):
Mirros the same interface that the ExportAssistant uses in the
selection, but this is for the preview selection.
"""
- def __init__(self):
+ def __init__(self, uistate):
from gi.repository import Gtk
- self.pm = ProgressMeter(_("Selecting Preview Data"), _('Selecting...'))
+ self.pm = ProgressMeter(_("Selecting Preview Data"), _('Selecting...'),
+ parent=uistate.window)
self.progress_cnt = 0
self.title = _("Selecting...")
while Gtk.events_pending():
@@ -239,7 +240,7 @@ class WriterOptionBox(object):
Calculate previews to see the selected data.
"""
self.parse_options()
- pm = Progress()
+ pm = Progress(self.uistate)
self.preview_dbase = self.get_filtered_database(self.dbstate.db, pm, preview=True)
pm.close()
self.preview_button.set_sensitive(0)
diff --git a/gramps/gui/plug/tool.py b/gramps/gui/plug/tool.py
index f543dec73..8da35fe6b 100644
--- a/gramps/gui/plug/tool.py
+++ b/gramps/gui/plug/tool.py
@@ -103,7 +103,9 @@ class BatchTool(Tool):
Should be used for tools using batch transactions.
"""
- def __init__(self, dbstate, user, options_class, name):
+ def __init__(self, dbstate, user, options_class, name, parent=None):
+ if user.uistate:
+ parent = user.uistate.window
if not user.prompt(
_('Undo history warning'),
_('Proceeding with this tool will erase the undo history '
@@ -112,7 +114,7 @@ class BatchTool(Tool):
'made prior to it.\n\n'
'If you think you may want to revert running this tool, '
'please stop here and backup your database.'),
- _('_Proceed with the tool'), _('_Stop')):
+ _('_Proceed with the tool'), _('_Stop'), parent):
self.fail = True
return
diff --git a/gramps/gui/user.py b/gramps/gui/user.py
index 6723d0e42..55ddbaab4 100644
--- a/gramps/gui/user.py
+++ b/gramps/gui/user.py
@@ -88,7 +88,7 @@ class User(user.User):
self._progress.close()
self._progress = None
- 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.
@@ -106,7 +106,7 @@ class User(user.User):
:returns: the user's answer to the question
:rtype: bool
"""
- dialog = QuestionDialog2(title, message, accept_label, reject_label)
+ dialog = QuestionDialog2(title, message, accept_label, reject_label, parent)
return dialog.run()
def warn(self, title, warning=""):
diff --git a/gramps/gui/viewmanager.py b/gramps/gui/viewmanager.py
index 8ffdf9149..a5b054476 100644
--- a/gramps/gui/viewmanager.py
+++ b/gramps/gui/viewmanager.py
@@ -1308,7 +1308,8 @@ class ViewManager(CLIManager):
_("Backup file already exists! Overwrite?"),
_("The file '%s' exists.") % filename,
_("Proceed and overwrite"),
- _("Cancel the backup"))
+ _("Cancel the backup"),
+ parent=self.window)
yes_no = question.run()
if not yes_no:
return
@@ -1339,12 +1340,13 @@ class ViewManager(CLIManager):
right pane, otherwise FileChooserDialog will hang.
"""
f = Gtk.FileChooserDialog(
- _("Select backup directory"),
- action=Gtk.FileChooserAction.SELECT_FOLDER,
- buttons=(Gtk.STOCK_CANCEL,
- Gtk.ResponseType.CANCEL,
- Gtk.STOCK_APPLY,
- Gtk.ResponseType.OK))
+ title=_("Select backup directory"),
+ parent=self.window,
+ action=Gtk.FileChooserAction.SELECT_FOLDER,
+ buttons=(Gtk.STOCK_CANCEL,
+ Gtk.ResponseType.CANCEL,
+ Gtk.STOCK_APPLY,
+ Gtk.ResponseType.OK))
mpath = path_entry.get_text()
if not mpath:
mpath = HOME_DIR
diff --git a/gramps/plugins/tool/check.glade b/gramps/plugins/tool/check.glade
index b50bab770..aa8bbd2c8 100644
--- a/gramps/plugins/tool/check.glade
+++ b/gramps/plugins/tool/check.glade
@@ -3,7 +3,9 @@