From 89c4ee887c67cdc1a98574e100cf9a1dbe7e4335 Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Mon, 15 Feb 2010 12:45:33 +0000 Subject: [PATCH] fix papercut: OKDialogs which are modal but can hide behind gramps are very annoying: fix 6 of them in often used tools svn: r14387 --- src/plugins/tool/ChangeNames.py | 3 ++- src/plugins/tool/ChangeTypes.py | 2 +- src/plugins/tool/Check.py | 13 +++++++------ src/plugins/tool/FindDupes.py | 3 ++- src/plugins/tool/Rebuild.py | 3 ++- src/plugins/tool/RebuildRefMap.py | 3 ++- 6 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/plugins/tool/ChangeNames.py b/src/plugins/tool/ChangeNames.py index 3c118789b..0df488762 100644 --- a/src/plugins/tool/ChangeNames.py +++ b/src/plugins/tool/ChangeNames.py @@ -142,7 +142,8 @@ class ChangeNames(Tool.BatchTool, ManagedWindow.ManagedWindow): self.progress.close() self.close() OkDialog(_('No modifications made'), - _("No capitalization changes were detected.")) + _("No capitalization changes were detected."), + parent=uistate.window) def name_cap(self, name): name.strip() diff --git a/src/plugins/tool/ChangeTypes.py b/src/plugins/tool/ChangeTypes.py index b9c27c22b..bcb1a731f 100644 --- a/src/plugins/tool/ChangeTypes.py +++ b/src/plugins/tool/ChangeTypes.py @@ -150,7 +150,7 @@ class ChangeTypes(Tool.BatchTool, ManagedWindow.ManagedWindow): self.options.handler.options_dict['totype'] = the_type.xml_str() modified,msg = self.run_tool(cli=False) - OkDialog(_('Change types'),msg,self.window) + OkDialog(_('Change types'), msg, self.window) # Save options self.options.handler.save_options() diff --git a/src/plugins/tool/Check.py b/src/plugins/tool/Check.py index e43d5c8f2..c7ce2f1fc 100644 --- a/src/plugins/tool/Check.py +++ b/src/plugins/tool/Check.py @@ -199,7 +199,7 @@ class Check(Tool.BatchTool): self.db.enable_signals() self.db.request_rebuild() - errs = checker.build_report(cli) + errs = checker.build_report(uistate) if errs: Report(uistate, checker.text.getvalue(), cli) @@ -1406,7 +1406,7 @@ class CheckIntegrity(object): not in self.invalid_note_references] self.invalid_note_references += new_bad_handles - def build_report(self, cl=0): + def build_report(self, uistate=None): self.progress.close() bad_photos = len(self.bad_photo) replaced_photos = len(self.replaced_photo) @@ -1448,11 +1448,12 @@ class CheckIntegrity(object): ) if errors == 0: - if cl: - print "No errors were found: the database has passed internal checks." - else: + if uistate: OkDialog(_("No errors were found"), - _('The database has passed internal checks')) + _('The database has passed internal checks'), + parent=uistate.window) + else: + print "No errors were found: the database has passed internal checks." return 0 self.text = cStringIO.StringIO() diff --git a/src/plugins/tool/FindDupes.py b/src/plugins/tool/FindDupes.py index bef1168c1..52fead1bd 100644 --- a/src/plugins/tool/FindDupes.py +++ b/src/plugins/tool/FindDupes.py @@ -171,7 +171,8 @@ class Merge(Tool.Tool,ManagedWindow.ManagedWindow): if len(self.map) == 0: OkDialog( _("No matches found"), - _("No potential duplicate people were found")) + _("No potential duplicate people were found"), + parent=self.window) else: try: ShowMatches(self.dbstate,self.uistate,self.track, diff --git a/src/plugins/tool/Rebuild.py b/src/plugins/tool/Rebuild.py index 067c14a97..027560dcb 100644 --- a/src/plugins/tool/Rebuild.py +++ b/src/plugins/tool/Rebuild.py @@ -83,7 +83,8 @@ class Rebuild(Tool.Tool, UpdateCallback): uistate.set_busy_cursor(0) uistate.progress.hide() OkDialog(_("Secondary indices rebuilt"), - _('All secondary indices have been rebuilt.')) + _('All secondary indices have been rebuilt.'), + parent=uistate.window) else: print "Rebuilding Secondary Indices..." self.db.rebuild_secondary(self.update_empty) diff --git a/src/plugins/tool/RebuildRefMap.py b/src/plugins/tool/RebuildRefMap.py index b5c093843..501910576 100644 --- a/src/plugins/tool/RebuildRefMap.py +++ b/src/plugins/tool/RebuildRefMap.py @@ -88,7 +88,8 @@ class RebuildRefMap(Tool.Tool, UpdateCallback): uistate.set_busy_cursor(0) uistate.progress.hide() OkDialog(_("Reference maps rebuilt"), - _('All reference maps have been rebuilt.')) + _('All reference maps have been rebuilt.'), + parent=uistate.window) else: print "All reference maps have been rebuilt." self.db.enable_signals()