remove temporary debugging flags
This commit is contained in:
parent
579485c6a5
commit
2ffe1d141f
@ -222,7 +222,7 @@ class User(user.User):
|
||||
) % {'gramps_bugtracker_url' : URL_BUGHOME}
|
||||
+ error + '\n\n')
|
||||
|
||||
def info(self, msg1, infotext, parent=None, monospaced=False): # parent-OK
|
||||
def info(self, msg1, infotext, parent=None, monospaced=False):
|
||||
"""
|
||||
Displays information to the CLI
|
||||
"""
|
||||
|
@ -183,7 +183,7 @@ class User(metaclass=ABCMeta):
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
def info(self, msg1, infotext, parent=None, monospaced=False): # parent-OK
|
||||
def info(self, msg1, infotext, parent=None, monospaced=False):
|
||||
"""
|
||||
Displays information to the user
|
||||
"""
|
||||
|
@ -82,7 +82,7 @@ except:
|
||||
# GrampsAboutDialog
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
class GrampsAboutDialog(Gtk.AboutDialog): # parent-OK
|
||||
class GrampsAboutDialog(Gtk.AboutDialog):
|
||||
"""Create an About dialog with all fields set."""
|
||||
def __init__(self, parent):
|
||||
"""Setup all the fields shown in the About dialog."""
|
||||
|
@ -227,13 +227,13 @@ class ConfigureDialog(ManagedWindow):
|
||||
obj.get_text() % 'test_markup'
|
||||
except TypeError:
|
||||
print("WARNING: ignoring invalid value for '%s'" % constant)
|
||||
ErrorDialog( # parent-OK
|
||||
ErrorDialog(
|
||||
_("Invalid or incomplete format definition."),
|
||||
obj.get_text(), parent=self.window)
|
||||
obj.set_text('<b>%s</b>')
|
||||
except ValueError:
|
||||
print("WARNING: ignoring invalid value for '%s'" % constant)
|
||||
ErrorDialog( # parent-OK
|
||||
ErrorDialog(
|
||||
_("Invalid or incomplete format definition."),
|
||||
obj.get_text(), parent=self.window)
|
||||
obj.set_text('<b>%s</b>')
|
||||
@ -777,7 +777,7 @@ class GrampsPreferences(ConfigureDialog):
|
||||
oldname = self.fmt_model.get_value(node, COL_NAME)
|
||||
# check to see if this pattern already exists
|
||||
if self.__check_for_name(translation, node):
|
||||
ErrorDialog(_("This format exists already."), # parent-OK
|
||||
ErrorDialog(_("This format exists already."),
|
||||
translation, parent=self.window)
|
||||
self.edit_button.emit('clicked')
|
||||
return
|
||||
@ -1230,7 +1230,7 @@ class GrampsPreferences(ConfigureDialog):
|
||||
|
||||
def date_format_changed(self, obj):
|
||||
config.set('preferences.date-format', obj.get_active())
|
||||
OkDialog(_('Change is not immediate'), # parent-OK
|
||||
OkDialog(_('Change is not immediate'),
|
||||
_('Changing the date format will not take '
|
||||
'effect until the next time Gramps is started.'),
|
||||
parent=self.window)
|
||||
@ -1405,7 +1405,7 @@ class GrampsPreferences(ConfigureDialog):
|
||||
try:
|
||||
addon_update_list = available_updates()
|
||||
except:
|
||||
OkDialog(_("Checking Addons Failed"), # parent-OK
|
||||
OkDialog(_("Checking Addons Failed"),
|
||||
_("The addon repository appears to be unavailable. "
|
||||
"Please try again later."),
|
||||
parent=self.window)
|
||||
@ -1415,7 +1415,7 @@ class GrampsPreferences(ConfigureDialog):
|
||||
PluginWindows.UpdateAddons(addon_update_list, self.window)
|
||||
else:
|
||||
check_types = config.get('behavior.check-for-update-types')
|
||||
OkDialog( # parent-OK
|
||||
OkDialog(
|
||||
_("There are no available addons of this type"),
|
||||
_("Checked for '%s'") %
|
||||
_("' and '").join([_(t) for t in check_types]),
|
||||
|
@ -83,7 +83,7 @@ class DbLoader(CLIDbLoader):
|
||||
self.import_info = None
|
||||
|
||||
def _warn(self, title, warnmessage):
|
||||
WarningDialog(title, warnmessage, # parent-OK
|
||||
WarningDialog(title, warnmessage,
|
||||
parent=self.uistate.window)
|
||||
|
||||
def _errordialog(self, title, errormessage):
|
||||
@ -91,7 +91,7 @@ class DbLoader(CLIDbLoader):
|
||||
Show the error.
|
||||
In the GUI, the error is shown, and a return happens
|
||||
"""
|
||||
ErrorDialog(title, errormessage, # parent-OK
|
||||
ErrorDialog(title, errormessage,
|
||||
parent=self.uistate.window)
|
||||
return 1
|
||||
|
||||
@ -99,11 +99,11 @@ class DbLoader(CLIDbLoader):
|
||||
import traceback
|
||||
exc = traceback.format_exc()
|
||||
try:
|
||||
DBErrorDialog(str(msg.value), # parent-OK
|
||||
DBErrorDialog(str(msg.value),
|
||||
parent=self.uistate.window)
|
||||
_LOG.error(str(msg.value))
|
||||
except:
|
||||
DBErrorDialog(str(msg), # parent-OK
|
||||
DBErrorDialog(str(msg),
|
||||
parent=self.uistate.window)
|
||||
_LOG.error(str(msg) +"\n" + exc)
|
||||
|
||||
@ -125,7 +125,7 @@ class DbLoader(CLIDbLoader):
|
||||
# so we will lose the undo history. Warn the user.
|
||||
|
||||
if self.dbstate.db.get_number_of_people() > 0:
|
||||
warn_dialog = QuestionDialog2( # parent-OK
|
||||
warn_dialog = QuestionDialog2(
|
||||
_('Undo history warning'),
|
||||
_('Proceeding with import will erase the undo history '
|
||||
'for this session. In particular, you will not be able '
|
||||
@ -198,7 +198,7 @@ class DbLoader(CLIDbLoader):
|
||||
return True
|
||||
|
||||
# Finally, we give up and declare this an unknown format
|
||||
ErrorDialog( # parent-OK
|
||||
ErrorDialog(
|
||||
_("Could not open file: %s") % filename,
|
||||
_('File type "%s" is unknown to Gramps.\n\n'
|
||||
'Valid types are: Gramps database, Gramps XML, '
|
||||
@ -223,14 +223,14 @@ class DbLoader(CLIDbLoader):
|
||||
if len(filename) == 0:
|
||||
return True
|
||||
elif os.path.isdir(filename):
|
||||
ErrorDialog( # parent-OK
|
||||
ErrorDialog(
|
||||
_('Cannot open file'),
|
||||
_('The selected file is a directory, not a file.\n'),
|
||||
parent=self.uistate.window)
|
||||
return True
|
||||
elif os.path.exists(filename):
|
||||
if not os.access(filename, os.R_OK):
|
||||
ErrorDialog( # parent-OK
|
||||
ErrorDialog(
|
||||
_('Cannot open file'),
|
||||
_('You do not have read access to the selected file.'),
|
||||
parent=self.uistate.window)
|
||||
@ -241,7 +241,7 @@ class DbLoader(CLIDbLoader):
|
||||
f.close()
|
||||
os.remove(filename)
|
||||
except IOError:
|
||||
ErrorDialog( # parent-OK
|
||||
ErrorDialog(
|
||||
_('Cannot create file'),
|
||||
_('You do not have write access to the selected file.'),
|
||||
parent=self.uistate.window)
|
||||
@ -264,7 +264,7 @@ class DbLoader(CLIDbLoader):
|
||||
dirname = os.path.dirname(filename) + os.path.sep
|
||||
config.set('paths.recent-import-dir', dirname)
|
||||
except UnicodeError as msg:
|
||||
ErrorDialog( # parent-OK
|
||||
ErrorDialog(
|
||||
_("Could not import file: %s") % filename,
|
||||
_("This file incorrectly identifies its character "
|
||||
"set, so it cannot be accurately imported. Please fix the "
|
||||
@ -344,7 +344,7 @@ class DbLoader(CLIDbLoader):
|
||||
self.dbstate.change_database(db)
|
||||
break
|
||||
except DbUpgradeRequiredError as msg:
|
||||
if QuestionDialog2(_("Are you sure you want " # parent-OK
|
||||
if QuestionDialog2(_("Are you sure you want "
|
||||
"to upgrade this Family Tree?"),
|
||||
str(msg),
|
||||
_("I have made a backup,\n"
|
||||
@ -359,7 +359,7 @@ class DbLoader(CLIDbLoader):
|
||||
self.dbstate.no_database()
|
||||
break
|
||||
except BsddbUpgradeRequiredError as msg:
|
||||
if QuestionDialog2(_("Are you sure you want " # parent-OK
|
||||
if QuestionDialog2(_("Are you sure you want "
|
||||
"to upgrade this Family Tree?"),
|
||||
str(msg),
|
||||
_("I have made a backup,\n"
|
||||
@ -374,7 +374,7 @@ class DbLoader(CLIDbLoader):
|
||||
self.dbstate.no_database()
|
||||
break
|
||||
except BsddbDowngradeRequiredError as msg:
|
||||
if QuestionDialog2(_("Are you sure you want " # parent-OK
|
||||
if QuestionDialog2(_("Are you sure you want "
|
||||
"to downgrade this Family Tree?"),
|
||||
str(msg),
|
||||
_("I have made a backup,\n"
|
||||
@ -389,7 +389,7 @@ class DbLoader(CLIDbLoader):
|
||||
self.dbstate.no_database()
|
||||
break
|
||||
except PythonUpgradeRequiredError as msg:
|
||||
if QuestionDialog2(_("Are you sure you want " # parent-OK
|
||||
if QuestionDialog2(_("Are you sure you want "
|
||||
"to upgrade this Family Tree?"),
|
||||
str(msg),
|
||||
_("I have made a backup,\n"
|
||||
|
@ -488,7 +488,7 @@ class DbManager(CLIDbManager):
|
||||
path = store.get_path(node)
|
||||
self.lock_file = store[path][PATH_COL]
|
||||
|
||||
QuestionDialog( # parent-OK
|
||||
QuestionDialog(
|
||||
_("Break the lock on the '%s' database?") % store[path][0],
|
||||
_("Gramps believes that someone else is actively editing "
|
||||
"this database. You cannot edit this database while it "
|
||||
@ -586,7 +586,7 @@ class DbManager(CLIDbManager):
|
||||
del proc
|
||||
|
||||
if status != 0:
|
||||
ErrorDialog(_("Rename failed"), # parent-OK
|
||||
ErrorDialog(_("Rename failed"),
|
||||
_("An attempt to rename a version failed "
|
||||
"with the following message:\n\n%s") % message,
|
||||
parent=self.top)
|
||||
@ -605,7 +605,7 @@ class DbManager(CLIDbManager):
|
||||
node = self.model.get_iter(path)
|
||||
filename = self.model.get_value(node, FILE_COL)
|
||||
if self.existing_name(new_text, skippath=path):
|
||||
ErrorDialog(_("Could not rename the Family Tree."), # parent-OK
|
||||
ErrorDialog(_("Could not rename the Family Tree."),
|
||||
_("Family Tree already exists, choose a unique name."),
|
||||
parent=self.top)
|
||||
return
|
||||
@ -670,7 +670,7 @@ class DbManager(CLIDbManager):
|
||||
self.data_to_delete = store[path]
|
||||
|
||||
if len(path.get_indices()) == 1:
|
||||
QuestionDialog( # parent-OK
|
||||
QuestionDialog(
|
||||
_("Remove the '%s' Family Tree?") % self.data_to_delete[0],
|
||||
_("Removing this Family Tree will permanently destroy "
|
||||
"the data."),
|
||||
@ -679,7 +679,7 @@ class DbManager(CLIDbManager):
|
||||
else:
|
||||
rev = self.data_to_delete[0]
|
||||
parent = store[(path[0],)][0]
|
||||
QuestionDialog(_("Remove the '%(revision)s' version " # parent-OK
|
||||
QuestionDialog(_("Remove the '%(revision)s' version "
|
||||
"of '%(database)s'"
|
||||
) % {'revision' : rev,
|
||||
'database' : parent},
|
||||
@ -714,7 +714,7 @@ class DbManager(CLIDbManager):
|
||||
os.unlink(os.path.join(top, filename))
|
||||
os.rmdir(directory)
|
||||
except (IOError, OSError) as msg:
|
||||
ErrorDialog(_("Could not delete Family Tree"), # parent-OK
|
||||
ErrorDialog(_("Could not delete Family Tree"),
|
||||
str(msg),
|
||||
parent=self.top)
|
||||
# rebuild the display
|
||||
@ -740,7 +740,7 @@ class DbManager(CLIDbManager):
|
||||
del proc
|
||||
|
||||
if status != 0:
|
||||
ErrorDialog(_("Deletion failed"), # parent-OK
|
||||
ErrorDialog(_("Deletion failed"),
|
||||
_("An attempt to delete a version failed "
|
||||
"with the following message:\n\n%s") % message,
|
||||
parent=self.top)
|
||||
@ -757,7 +757,7 @@ class DbManager(CLIDbManager):
|
||||
store, node = self.selection.get_selected()
|
||||
name = store[node][0]
|
||||
dirname = store[node][1]
|
||||
QuestionDialog( # parent-OK
|
||||
QuestionDialog(
|
||||
_("Convert the '%s' database?") % name,
|
||||
_("You wish to convert this database into the new DB-API format?"),
|
||||
_("Convert"),
|
||||
@ -770,7 +770,7 @@ class DbManager(CLIDbManager):
|
||||
try:
|
||||
db = self.dbstate.open_database(name)
|
||||
except:
|
||||
ErrorDialog(_("Opening the '%s' database") % name, # parent-OK
|
||||
ErrorDialog(_("Opening the '%s' database") % name,
|
||||
_("An attempt to convert the database failed. "
|
||||
"Perhaps it needs updating."), parent=self.top)
|
||||
return
|
||||
@ -782,7 +782,7 @@ class DbManager(CLIDbManager):
|
||||
break
|
||||
## Next, get an XML dump:
|
||||
if export_function is None:
|
||||
ErrorDialog(_("Converting the '%s' database") % name, # parent-OK
|
||||
ErrorDialog(_("Converting the '%s' database") % name,
|
||||
_("An attempt to export the database failed."),
|
||||
parent=self.top)
|
||||
db.close(user=self.user)
|
||||
@ -807,7 +807,7 @@ class DbManager(CLIDbManager):
|
||||
if plugin.get_extension() == "gramps":
|
||||
import_function = plugin.get_import_function()
|
||||
if import_function is None:
|
||||
ErrorDialog(_("Converting the '%s' database") % name, # parent-OK
|
||||
ErrorDialog(_("Converting the '%s' database") % name,
|
||||
_("An attempt to import into the database failed."),
|
||||
parent=self.top)
|
||||
else:
|
||||
@ -864,7 +864,7 @@ class DbManager(CLIDbManager):
|
||||
dirname = store[node][1]
|
||||
|
||||
#First ask user if he is really sure :-)
|
||||
yes_no = QuestionDialog2( # parent-OK
|
||||
yes_no = QuestionDialog2(
|
||||
_("Repair Family Tree?"),
|
||||
_("If you click %(bold_start)sProceed%(bold_end)s, Gramps will "
|
||||
"attempt to recover your Family Tree from the last good "
|
||||
@ -926,7 +926,7 @@ class DbManager(CLIDbManager):
|
||||
try:
|
||||
dbase.restore()
|
||||
except DbException as msg:
|
||||
ErrorDialog(_("Error restoring backup data"), msg, # parent-OK
|
||||
ErrorDialog(_("Error restoring backup data"), msg,
|
||||
parent=self.top)
|
||||
|
||||
self.__end_cursor()
|
||||
@ -965,7 +965,7 @@ class DbManager(CLIDbManager):
|
||||
try:
|
||||
self._create_new_db(dbid=dbid)
|
||||
except (OSError, IOError) as msg:
|
||||
ErrorDialog(_("Could not create Family Tree"), # parent-OK
|
||||
ErrorDialog(_("Could not create Family Tree"),
|
||||
str(msg),
|
||||
parent=self.top)
|
||||
self.new.set_sensitive(True)
|
||||
@ -1132,7 +1132,7 @@ def check_in(dbase, filename, user, cursor_func=None):
|
||||
del proc
|
||||
|
||||
if status != 0:
|
||||
ErrorDialog(_("Archiving failed"), # parent-OK
|
||||
ErrorDialog(_("Archiving failed"),
|
||||
_("An attempt to create the archive failed "
|
||||
"with the following message:\n\n%s") % message,
|
||||
parent=self.top)
|
||||
@ -1158,7 +1158,7 @@ def check_in(dbase, filename, user, cursor_func=None):
|
||||
del proc
|
||||
|
||||
if status != 0:
|
||||
ErrorDialog(_("Archiving failed"), # parent-OK
|
||||
ErrorDialog(_("Archiving failed"),
|
||||
_("An attempt to archive the data failed "
|
||||
"with the following message:\n\n%s") % message,
|
||||
parent=self.top)
|
||||
|
@ -52,7 +52,7 @@ try:
|
||||
except:
|
||||
ICON = None
|
||||
|
||||
class SaveDialog: # parent-OK
|
||||
class SaveDialog:
|
||||
def __init__(self, msg1, msg2, task1, task2, parent=None):
|
||||
self.xml = Glade(toplevel='savedialog')
|
||||
|
||||
@ -83,7 +83,7 @@ class SaveDialog: # parent-OK
|
||||
config.set('interface.dont-ask', self.dontask.get_active())
|
||||
self.top.destroy()
|
||||
|
||||
class QuestionDialog: # parent-OK
|
||||
class QuestionDialog:
|
||||
def __init__(self, msg1, msg2, label, task, parent=None):
|
||||
self.xml = Glade(toplevel='questiondialog')
|
||||
|
||||
@ -115,7 +115,7 @@ def on_activate_link(label, uri):
|
||||
display_url(uri)
|
||||
return True
|
||||
|
||||
class QuestionDialog2: # parent-OK
|
||||
class QuestionDialog2:
|
||||
def __init__(self, msg1, msg2, label_msg1, label_msg2, parent=None):
|
||||
self.xml = Glade(toplevel='questiondialog')
|
||||
|
||||
@ -147,7 +147,7 @@ class QuestionDialog2: # parent-OK
|
||||
self.top.destroy()
|
||||
return (response == Gtk.ResponseType.ACCEPT)
|
||||
|
||||
class OptionDialog: # parent-OK
|
||||
class OptionDialog:
|
||||
def __init__(self, msg1, msg2, btnmsg1, task1, btnmsg2, task2, parent=None):
|
||||
self.xml = Glade(toplevel='optiondialog')
|
||||
|
||||
@ -180,7 +180,7 @@ class OptionDialog: # parent-OK
|
||||
def get_response(self):
|
||||
return self.response
|
||||
|
||||
class ErrorDialog(Gtk.MessageDialog): # parent-OK
|
||||
class ErrorDialog(Gtk.MessageDialog):
|
||||
def __init__(self, msg1, msg2="", parent=None):
|
||||
|
||||
Gtk.MessageDialog.__init__(self, parent,
|
||||
@ -195,7 +195,7 @@ class ErrorDialog(Gtk.MessageDialog): # parent-OK
|
||||
self.run()
|
||||
self.destroy()
|
||||
|
||||
class RunDatabaseRepair(ErrorDialog): # parent-OK
|
||||
class RunDatabaseRepair(ErrorDialog):
|
||||
def __init__(self, msg, parent=None):
|
||||
ErrorDialog.__init__(
|
||||
# These exact strings are also in cli/user.py -- keep them in sync
|
||||
@ -209,7 +209,7 @@ class RunDatabaseRepair(ErrorDialog): # parent-OK
|
||||
) % {'gramps_bugtracker_url' : URL_BUGHOME}
|
||||
+ msg, parent)
|
||||
|
||||
class DBErrorDialog(ErrorDialog): # parent-OK
|
||||
class DBErrorDialog(ErrorDialog):
|
||||
def __init__(self, msg, parent=None):
|
||||
ErrorDialog.__init__(
|
||||
# These exact strings are also in cli/user.py -- keep them in sync
|
||||
@ -220,7 +220,7 @@ class DBErrorDialog(ErrorDialog): # parent-OK
|
||||
"the Family Tree Manager. Select the database and "
|
||||
'click on the Repair button') + '\n\n' + msg, parent)
|
||||
|
||||
class WarningDialog(Gtk.MessageDialog): # parent-OK
|
||||
class WarningDialog(Gtk.MessageDialog):
|
||||
def __init__(self, msg1, msg2="", parent=None):
|
||||
|
||||
Gtk.MessageDialog.__init__(self, parent,
|
||||
@ -240,7 +240,7 @@ class WarningDialog(Gtk.MessageDialog): # parent-OK
|
||||
self.run()
|
||||
self.destroy()
|
||||
|
||||
class OkDialog(Gtk.MessageDialog): # parent-OK
|
||||
class OkDialog(Gtk.MessageDialog):
|
||||
def __init__(self, msg1, msg2="", parent=None):
|
||||
|
||||
Gtk.MessageDialog.__init__(self, parent,
|
||||
@ -255,7 +255,7 @@ class OkDialog(Gtk.MessageDialog): # parent-OK
|
||||
self.run()
|
||||
self.destroy()
|
||||
|
||||
class InfoDialog: # parent-OK
|
||||
class InfoDialog:
|
||||
"""
|
||||
Non modal dialog to show selectable info in a scrolled window
|
||||
"""
|
||||
@ -288,7 +288,7 @@ class InfoDialog: # parent-OK
|
||||
#no matter how it finishes, destroy dialog
|
||||
dialog.destroy()
|
||||
|
||||
class MissingMediaDialog: # parent-OK
|
||||
class MissingMediaDialog:
|
||||
def __init__(self, msg1, msg2, task1, task2, task3, parent=None):
|
||||
self.xml = Glade(toplevel='missmediadialog')
|
||||
|
||||
@ -335,14 +335,14 @@ class MissingMediaDialog: # parent-OK
|
||||
self.top.destroy()
|
||||
|
||||
def warn(self, obj, obj2):
|
||||
WarningDialog( # parent-OK
|
||||
WarningDialog(
|
||||
_("Attempt to force closing the dialog"),
|
||||
_("Please do not force closing this important dialog.\n"
|
||||
"Instead select one of the available options"),
|
||||
parent=self.top)
|
||||
return True
|
||||
|
||||
class MultiSelectDialog: # parent-OK
|
||||
class MultiSelectDialog:
|
||||
def __init__(self, msg1_func, msg2_func, items, lookup,
|
||||
cancel_func=None, no_func=None, yes_func=None,
|
||||
parent=None):
|
||||
@ -408,14 +408,14 @@ class MultiSelectDialog: # parent-OK
|
||||
self.top.destroy()
|
||||
|
||||
def warn(self, obj, obj2):
|
||||
WarningDialog( # parent-OK
|
||||
WarningDialog(
|
||||
_("Attempt to force closing the dialog"),
|
||||
_("Please do not force closing this important dialog.\n"
|
||||
"Instead select one of the available options"),
|
||||
parent=self.top)
|
||||
return True
|
||||
|
||||
class MessageHideDialog: # parent-OK
|
||||
class MessageHideDialog:
|
||||
|
||||
def __init__(self, title, message, key, parent=None):
|
||||
self.xml = Glade(toplevel='hidedialog')
|
||||
@ -455,7 +455,7 @@ def main(args):
|
||||
|
||||
|
||||
def test_info(obj):
|
||||
InfoDialog('The title', # parent-OK
|
||||
InfoDialog('The title',
|
||||
'This is a lot of info\n to show to all!',
|
||||
parent=win)
|
||||
|
||||
|
@ -157,7 +157,7 @@ class AddMedia(ManagedWindow):
|
||||
if self.file_text.get_filename() is None:
|
||||
msgstr = _("Import failed")
|
||||
msgstr2 = _("The filename supplied could not be found.")
|
||||
ErrorDialog(msgstr, msgstr2, parent=self.window) # parent-OK
|
||||
ErrorDialog(msgstr, msgstr2, parent=self.window)
|
||||
return
|
||||
|
||||
filename = self.file_text.get_filename()
|
||||
@ -171,7 +171,7 @@ class AddMedia(ManagedWindow):
|
||||
"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, # parent-OK
|
||||
ErrorDialog(msgstr % filename, msgstr2 % pname,
|
||||
parent=self.window)
|
||||
return
|
||||
filename = relative_path(filename, pname)
|
||||
@ -247,5 +247,5 @@ class AddMedia(ManagedWindow):
|
||||
GdkPixbuf.InterpType.BILINEAR)
|
||||
except:
|
||||
WarningDialog(title_msg, detail_msg,
|
||||
parent=self.window) # parent-OK
|
||||
parent=self.window)
|
||||
return GdkPixbuf.Pixbuf.new_from_file(ICON)
|
||||
|
@ -168,7 +168,7 @@ class CitationEmbedList(EmbeddedList, DbGUIElement):
|
||||
callertitle=self.callertitle)
|
||||
except WindowActiveError:
|
||||
from ...dialog import WarningDialog
|
||||
WarningDialog(_("Cannot share this reference"), # parent-OK
|
||||
WarningDialog(_("Cannot share this reference"),
|
||||
self.__blocked_text(),
|
||||
parent=self.uistate.window)
|
||||
elif isinstance(object, Citation):
|
||||
@ -179,7 +179,7 @@ class CitationEmbedList(EmbeddedList, DbGUIElement):
|
||||
callertitle=self.callertitle)
|
||||
except WindowActiveError:
|
||||
from ...dialog import WarningDialog
|
||||
WarningDialog(_("Cannot share this reference"), # parent-OK
|
||||
WarningDialog(_("Cannot share this reference"),
|
||||
self.__blocked_text(),
|
||||
parent=self.uistate.window)
|
||||
else:
|
||||
@ -253,7 +253,7 @@ class CitationEmbedList(EmbeddedList, DbGUIElement):
|
||||
callertitle=self.callertitle)
|
||||
except WindowActiveError:
|
||||
from ...dialog import WarningDialog
|
||||
WarningDialog(_("Cannot share this reference"), # parent-OK
|
||||
WarningDialog(_("Cannot share this reference"),
|
||||
self.__blocked_text(),
|
||||
parent=self.uistate.window)
|
||||
else:
|
||||
@ -274,7 +274,7 @@ class CitationEmbedList(EmbeddedList, DbGUIElement):
|
||||
callertitle=self.callertitle)
|
||||
except WindowActiveError:
|
||||
from ...dialog import WarningDialog
|
||||
WarningDialog(_("Cannot share this reference"), # parent-OK
|
||||
WarningDialog(_("Cannot share this reference"),
|
||||
self.__blocked_text(),
|
||||
parent=self.uistate.window)
|
||||
else:
|
||||
|
@ -576,7 +576,7 @@ class EmbeddedList(ButtonTab):
|
||||
from ...dialog import RunDatabaseRepair
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
RunDatabaseRepair(str(msg), parent=self.uistate.window) # parent-OK
|
||||
RunDatabaseRepair(str(msg), parent=self.uistate.window)
|
||||
return
|
||||
|
||||
self.tree.set_model(self.model)
|
||||
|
@ -264,7 +264,7 @@ class EventEmbedList(DbGUIElement, GroupEmbeddedList):
|
||||
event, ref, self.object_added)
|
||||
except WindowActiveError:
|
||||
from ...dialog import WarningDialog
|
||||
WarningDialog(_("Cannot share this reference"), # parent-OK
|
||||
WarningDialog(_("Cannot share this reference"),
|
||||
self.__blocked_text(),
|
||||
parent=self.uistate.window)
|
||||
|
||||
@ -278,7 +278,7 @@ class EventEmbedList(DbGUIElement, GroupEmbeddedList):
|
||||
event, ref[1], self.object_edited)
|
||||
except WindowActiveError:
|
||||
from ...dialog import WarningDialog
|
||||
WarningDialog(_("Cannot edit this reference"), # parent-OK
|
||||
WarningDialog(_("Cannot edit this reference"),
|
||||
self.__blocked_text(),
|
||||
parent=self.uistate.window)
|
||||
elif ref and ref[0] != self._WORKGROUP:
|
||||
@ -320,7 +320,7 @@ class EventEmbedList(DbGUIElement, GroupEmbeddedList):
|
||||
handle change request of non native data
|
||||
"""
|
||||
from ...dialog import WarningDialog
|
||||
WarningDialog( # parent-OK
|
||||
WarningDialog(
|
||||
_("Cannot change Person"),
|
||||
_("You cannot change Person events in the Family Editor"),
|
||||
parent=self.uistate.window)
|
||||
@ -343,7 +343,7 @@ class EventEmbedList(DbGUIElement, GroupEmbeddedList):
|
||||
event, obj, self.object_edited)
|
||||
except WindowActiveError:
|
||||
from ...dialog import WarningDialog
|
||||
WarningDialog( # parent-OK
|
||||
WarningDialog(
|
||||
_("Cannot edit this reference"),
|
||||
_("This event reference cannot be edited at this time. "
|
||||
"Either the associated event is already being edited "
|
||||
|
@ -260,7 +260,7 @@ class GalleryTab(ButtonTab, DbGUIElement):
|
||||
if obj is None :
|
||||
#notify user of error
|
||||
from ...dialog import RunDatabaseRepair
|
||||
RunDatabaseRepair( # parent-OK
|
||||
RunDatabaseRepair(
|
||||
_('Non existing media found in the Gallery'),
|
||||
parent=self.uistate.window)
|
||||
else :
|
||||
@ -336,7 +336,7 @@ class GalleryTab(ButtonTab, DbGUIElement):
|
||||
src, sref, self.add_callback)
|
||||
except WindowActiveError:
|
||||
from ...dialog import WarningDialog
|
||||
WarningDialog(_("Cannot share this reference"), # parent-OK
|
||||
WarningDialog(_("Cannot share this reference"),
|
||||
self.__blocked_text(),
|
||||
parent=self.uistate.window)
|
||||
|
||||
@ -357,7 +357,7 @@ class GalleryTab(ButtonTab, DbGUIElement):
|
||||
obj, ref, self.edit_callback)
|
||||
except WindowActiveError:
|
||||
from ...dialog import WarningDialog
|
||||
WarningDialog(_("Cannot edit this reference"), # parent-OK
|
||||
WarningDialog(_("Cannot edit this reference"),
|
||||
self.__blocked_text(),
|
||||
parent=self.uistate.window)
|
||||
|
||||
|
@ -126,7 +126,7 @@ class PersonEventEmbedList(EventEmbedList):
|
||||
handle change request of non native data
|
||||
"""
|
||||
from ...dialog import WarningDialog
|
||||
WarningDialog( # parent-OK
|
||||
WarningDialog(
|
||||
_("Cannot change Family"),
|
||||
_("You cannot change Family events in the Person Editor"),
|
||||
parent=self.uistate.window)
|
||||
|
@ -138,7 +138,7 @@ class PlaceRefEmbedList(EmbeddedList):
|
||||
|
||||
def handle_extra_type(self, objtype, obj):
|
||||
if obj in self.get_skip_list(self.handle):
|
||||
ErrorDialog(_("Place cycle detected"), # parent-OK
|
||||
ErrorDialog(_("Place cycle detected"),
|
||||
_("The place you are adding is already enclosed by "
|
||||
"this place"),
|
||||
parent=self.uistate.window)
|
||||
|
@ -164,7 +164,7 @@ class RepoEmbedList(EmbeddedList, DbGUIElement):
|
||||
ref, self.edit_callback)
|
||||
except WindowActiveError:
|
||||
from ...dialog import WarningDialog
|
||||
WarningDialog( # parent-OK
|
||||
WarningDialog(
|
||||
_("Cannot edit this reference"),
|
||||
_("This repository reference cannot be edited at this "
|
||||
"time. Either the associated repository is already "
|
||||
|
@ -145,7 +145,7 @@ class EditAttributeRoot(EditSecondary):
|
||||
|
||||
if t.is_custom() and str(t) == '':
|
||||
from ..dialog import ErrorDialog
|
||||
ErrorDialog( # parent-OK
|
||||
ErrorDialog(
|
||||
_("Cannot save attribute"),
|
||||
_("The attribute type cannot be empty"),
|
||||
parent=self.window)
|
||||
|
@ -284,7 +284,7 @@ class EditCitation(EditPrimary):
|
||||
"""
|
||||
self.ok_button.set_sensitive(False)
|
||||
if not self.obj.get_reference_handle():
|
||||
ErrorDialog(_("No source selected"), # parent-OK
|
||||
ErrorDialog(_("No source selected"),
|
||||
_("A source is anything (personal testimony, "
|
||||
"video recording, photograph, newspaper column, "
|
||||
"gravestone...) from which information can be "
|
||||
@ -305,7 +305,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, parent=self.window) # parent-OK
|
||||
ErrorDialog(msg1, msg2, parent=self.window)
|
||||
self.ok_button.set_sensitive(True)
|
||||
return
|
||||
|
||||
|
@ -236,7 +236,7 @@ class EditEvent(EditPrimary):
|
||||
def save(self, *obj):
|
||||
self.ok_button.set_sensitive(False)
|
||||
if self.object_is_empty():
|
||||
ErrorDialog(_("Cannot save event"), # parent-OK
|
||||
ErrorDialog(_("Cannot save event"),
|
||||
_("No data exists for this event. Please "
|
||||
"enter data or cancel the edit."),
|
||||
parent=self.window)
|
||||
@ -253,13 +253,13 @@ 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, parent=self.window) # parent-OK
|
||||
ErrorDialog(msg1, msg2, parent=self.window)
|
||||
self.ok_button.set_sensitive(True)
|
||||
return
|
||||
|
||||
t = self.obj.get_type()
|
||||
if t.is_custom() and str(t) == '':
|
||||
ErrorDialog( # parent-OK
|
||||
ErrorDialog(
|
||||
_("Cannot save event"),
|
||||
_("The event type cannot be empty"),
|
||||
parent=self.window)
|
||||
|
@ -363,7 +363,7 @@ class EditFamily(EditPrimary):
|
||||
for i in self.hidden:
|
||||
i.set_sensitive(False)
|
||||
|
||||
MessageHideDialog( # parent-OK
|
||||
MessageHideDialog(
|
||||
_("Adding parents to a person"),
|
||||
_("It is possible to accidentally create multiple "
|
||||
"families with the same parents. To help avoid "
|
||||
@ -459,7 +459,7 @@ class EditFamily(EditPrimary):
|
||||
|
||||
# No matter why the family changed (eg delete of a source), we notify
|
||||
# the user
|
||||
WarningDialog( # parent-OK
|
||||
WarningDialog(
|
||||
_("Family has changed"),
|
||||
_("The %(object)s you are editing has changed outside this editor."
|
||||
" This can be due to a change in one of the main views, for "
|
||||
@ -903,7 +903,7 @@ class EditFamily(EditPrimary):
|
||||
common = list(mfam.intersection(ffam))
|
||||
if len(common) > 0:
|
||||
if self.add_parent or self.obj.handle not in common:
|
||||
WarningDialog( # parent-OK
|
||||
WarningDialog(
|
||||
_('Duplicate Family'),
|
||||
_('A family with these parents already exists '
|
||||
'in the database. If you save, you will create '
|
||||
@ -1043,7 +1043,7 @@ class EditFamily(EditPrimary):
|
||||
#try:
|
||||
self.__do_save()
|
||||
#except bsddb_db.DBRunRecoveryError as msg:
|
||||
# RunDatabaseRepair(msg[1], parent=self.window) # parent-OK
|
||||
# RunDatabaseRepair(msg[1], parent=self.window)
|
||||
|
||||
def __do_save(self):
|
||||
self.ok_button.set_sensitive(False)
|
||||
@ -1062,7 +1062,7 @@ class EditFamily(EditPrimary):
|
||||
father = self.db.get_person_from_handle(self.obj.get_father_handle())
|
||||
name = "%s [%s]" % (name_displayer.display(father),
|
||||
father.gramps_id)
|
||||
ErrorDialog(_("A father cannot be his own child"), # parent-OK
|
||||
ErrorDialog(_("A father cannot be his own child"),
|
||||
_("%s is listed as both the father and child "
|
||||
"of the family.") % name,
|
||||
parent=self.window)
|
||||
@ -1073,7 +1073,7 @@ class EditFamily(EditPrimary):
|
||||
mother = self.db.get_person_from_handle(self.obj.get_mother_handle())
|
||||
name = "%s [%s]" % (name_displayer.display(mother),
|
||||
mother.gramps_id)
|
||||
ErrorDialog(_("A mother cannot be her own child"), # parent-OK
|
||||
ErrorDialog(_("A mother cannot be her own child"),
|
||||
_("%s is listed as both the mother and child "
|
||||
"of the family.") % name,
|
||||
parent=self.window)
|
||||
@ -1081,7 +1081,7 @@ class EditFamily(EditPrimary):
|
||||
return
|
||||
|
||||
if not original and self.object_is_empty():
|
||||
ErrorDialog( # parent-OK
|
||||
ErrorDialog(
|
||||
_("Cannot save family"),
|
||||
_("No data exists for this family. "
|
||||
"Please enter data or cancel the edit."),
|
||||
@ -1097,7 +1097,7 @@ class EditFamily(EditPrimary):
|
||||
"enter a different ID or leave "
|
||||
"blank to get the next available ID value.") % {
|
||||
'id' : id}
|
||||
ErrorDialog(msg1, msg2, parent=self.window) # parent-OK
|
||||
ErrorDialog(msg1, msg2, parent=self.window)
|
||||
self.ok_button.set_sensitive(True)
|
||||
return
|
||||
|
||||
|
@ -285,7 +285,7 @@ class EditMedia(EditPrimary):
|
||||
self.ok_button.set_sensitive(False)
|
||||
|
||||
if self.object_is_empty():
|
||||
ErrorDialog(_("Cannot save media object"), # parent-OK
|
||||
ErrorDialog(_("Cannot save media object"),
|
||||
_("No data exists for this media object. Please "
|
||||
"enter data or cancel the edit."),
|
||||
parent=self.window)
|
||||
@ -302,7 +302,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, parent=self.window) # parent-OK
|
||||
ErrorDialog(msg1, msg2, parent=self.window)
|
||||
self.ok_button.set_sensitive(True)
|
||||
return
|
||||
|
||||
@ -316,7 +316,7 @@ class EditMedia(EditPrimary):
|
||||
"value '%(path)s'. This path does not exist!"
|
||||
" Please enter a different path") % {
|
||||
'path' : path }
|
||||
ErrorDialog(msg1, msg2, parent=self.window) # parent-OK
|
||||
ErrorDialog(msg1, msg2, parent=self.window)
|
||||
self.ok_button.set_sensitive(True)
|
||||
return
|
||||
|
||||
|
@ -376,7 +376,7 @@ class EditName(EditSecondary):
|
||||
if self.global_group_set and not self.original_group_set :
|
||||
#warn that group will revert to surname
|
||||
from ..dialog import QuestionDialog2
|
||||
q = QuestionDialog2( # parent-OK
|
||||
q = QuestionDialog2(
|
||||
_("Break global name grouping?"),
|
||||
_("All people with the name of %(surname)s will no longer "
|
||||
"be grouped with the name of %(group_name)s."
|
||||
@ -408,7 +408,7 @@ class EditName(EditSecondary):
|
||||
if self.global_group_as != group_as:
|
||||
from ..dialog import QuestionDialog2
|
||||
|
||||
q = QuestionDialog2( # parent-OK
|
||||
q = QuestionDialog2(
|
||||
_("Group all people with the same name?"),
|
||||
_("You have the choice of grouping all people with the "
|
||||
"name of %(surname)s with the name of %(group_name)s, or "
|
||||
|
@ -310,7 +310,7 @@ class EditNote(EditPrimary):
|
||||
self.update_note()
|
||||
|
||||
if self.object_is_empty():
|
||||
ErrorDialog(_("Cannot save note"), # parent-OK
|
||||
ErrorDialog(_("Cannot save note"),
|
||||
_("No data exists for this note. Please "
|
||||
"enter data or cancel the edit."),
|
||||
parent=self.window)
|
||||
@ -325,7 +325,7 @@ class EditNote(EditPrimary):
|
||||
"enter a different ID or leave "
|
||||
"blank to get the next available ID value.") % {
|
||||
'id' : id }
|
||||
ErrorDialog(msg1, msg2, parent=self.window) # parent-OK
|
||||
ErrorDialog(msg1, msg2, parent=self.window)
|
||||
self.ok_button.set_sensitive(True)
|
||||
return
|
||||
|
||||
|
@ -747,7 +747,7 @@ class EditPerson(EditPrimary):
|
||||
|
||||
def _check_for_unknown_gender(self):
|
||||
if self.obj.get_gender() == Person.UNKNOWN:
|
||||
d = GenderDialog(parent=self.window) # parent-OK
|
||||
d = GenderDialog(parent=self.window)
|
||||
gender = d.run()
|
||||
d.destroy()
|
||||
if gender >= 0:
|
||||
@ -810,7 +810,7 @@ class EditPerson(EditPrimary):
|
||||
msg = _("Changing the gender caused problems "
|
||||
"with marriage information.\nPlease check "
|
||||
"the person's marriages.")
|
||||
ErrorDialog(msg2, msg, parent=self.window) # parent-OK
|
||||
ErrorDialog(msg2, msg, parent=self.window)
|
||||
|
||||
def save(self, *obj):
|
||||
"""
|
||||
@ -818,7 +818,7 @@ class EditPerson(EditPrimary):
|
||||
"""
|
||||
self.ok_button.set_sensitive(False)
|
||||
if self.object_is_empty():
|
||||
ErrorDialog(_("Cannot save person"), # parent-OK
|
||||
ErrorDialog(_("Cannot save person"),
|
||||
_("No data exists for this person. Please "
|
||||
"enter data or cancel the edit."),
|
||||
parent=self.window)
|
||||
@ -849,7 +849,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, parent=self.window) # parent-OK
|
||||
ErrorDialog(msg1, msg2, parent=self.window)
|
||||
self.ok_button.set_sensitive(True)
|
||||
return
|
||||
|
||||
@ -957,7 +957,7 @@ class EditPerson(EditPrimary):
|
||||
if obj is None :
|
||||
#notify user of error
|
||||
from ..dialog import RunDatabaseRepair
|
||||
RunDatabaseRepair( # parent-OK
|
||||
RunDatabaseRepair(
|
||||
_('Non existing media found in the Gallery'),
|
||||
parent=self.window)
|
||||
else :
|
||||
@ -1084,7 +1084,7 @@ class EditPerson(EditPrimary):
|
||||
#config.save()
|
||||
|
||||
|
||||
class GenderDialog(Gtk.MessageDialog): # parent-OK
|
||||
class GenderDialog(Gtk.MessageDialog):
|
||||
def __init__(self, parent=None):
|
||||
Gtk.MessageDialog.__init__(self,
|
||||
parent,
|
||||
|
@ -237,7 +237,7 @@ class EditPersonRef(EditSecondary):
|
||||
else:
|
||||
from ..dialog import ErrorDialog
|
||||
|
||||
ErrorDialog( # parent-OK
|
||||
ErrorDialog(
|
||||
_('No person selected'),
|
||||
_('You must either select a person or Cancel the edit'),
|
||||
parent=self.uistate.window)
|
||||
|
@ -285,7 +285,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, parent=self.window) # parent-OK
|
||||
ErrorDialog(msg1, msg2, parent=self.window)
|
||||
self.ok_button.set_sensitive(True)
|
||||
return
|
||||
|
||||
@ -299,7 +299,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, parent=self.window) # parent-OK
|
||||
ErrorDialog(msg1, msg2, parent=self.window)
|
||||
self.ok_button.set_sensitive(True)
|
||||
return
|
||||
|
||||
|
@ -135,7 +135,7 @@ class EditPlaceName(EditSecondary):
|
||||
|
||||
def save(self, *obj):
|
||||
if not self.obj.get_value():
|
||||
ErrorDialog(_("Cannot save place name"), # parent-OK
|
||||
ErrorDialog(_("Cannot save place name"),
|
||||
_("The place name cannot be empty"),
|
||||
parent=self.window)
|
||||
return
|
||||
|
@ -276,7 +276,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, parent=self.window) # parent-OK
|
||||
ErrorDialog(msg1, msg2, parent=self.window)
|
||||
self.ok_button.set_sensitive(True)
|
||||
return
|
||||
|
||||
|
@ -234,7 +234,7 @@ class EditPrimary(ManagedWindow, DbGUIElement, metaclass=abc.ABCMeta):
|
||||
"""If the data has changed, give the user a chance to cancel
|
||||
the close window"""
|
||||
if not config.get('interface.dont-ask') and self.data_has_changed():
|
||||
SaveDialog( # parent-OK
|
||||
SaveDialog(
|
||||
_('Save Changes?'),
|
||||
_('If you close without saving, the changes you '
|
||||
'have made will be lost'),
|
||||
|
@ -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, parent=self.window) # parent-OK
|
||||
ErrorDialog(msg1, msg2, parent=self.window)
|
||||
return True
|
||||
return False
|
||||
|
@ -176,7 +176,7 @@ class EditRepository(EditPrimary):
|
||||
def save(self, *obj):
|
||||
self.ok_button.set_sensitive(False)
|
||||
if self.object_is_empty():
|
||||
ErrorDialog(_("Cannot save repository"), # parent-OK
|
||||
ErrorDialog(_("Cannot save repository"),
|
||||
_("No data exists for this repository. Please "
|
||||
"enter data or cancel the edit."),
|
||||
parent=self.window)
|
||||
@ -193,7 +193,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, parent=self.window) # parent-OK
|
||||
ErrorDialog(msg1, msg2, parent=self.window)
|
||||
self.ok_button.set_sensitive(True)
|
||||
return
|
||||
|
||||
|
@ -196,7 +196,7 @@ class EditSource(EditPrimary):
|
||||
def save(self, *obj):
|
||||
self.ok_button.set_sensitive(False)
|
||||
if self.object_is_empty():
|
||||
ErrorDialog(_("Cannot save source"), # parent-OK
|
||||
ErrorDialog(_("Cannot save source"),
|
||||
_("No data exists for this source. Please "
|
||||
"enter data or cancel the edit."),
|
||||
parent=self.window)
|
||||
@ -213,7 +213,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, parent=self.window) # parent-OK
|
||||
ErrorDialog(msg1, msg2, parent=self.window)
|
||||
self.ok_button.set_sensitive(True)
|
||||
return
|
||||
|
||||
|
@ -1177,7 +1177,7 @@ class FilterEditor(ManagedWindow):
|
||||
gfilter = self.clist.get_object(node)
|
||||
name = gfilter.get_name()
|
||||
if self.check_recursive_filters(self.namespace, name):
|
||||
QuestionDialog( _('Delete Filter?'), # parent-OK
|
||||
QuestionDialog( _('Delete Filter?'),
|
||||
_('This filter is currently being used '
|
||||
'as the base for other filters. Deleting'
|
||||
'this filter will result in removing all '
|
||||
|
@ -141,7 +141,7 @@ def _display_generic_message(warning_type, config_key, parent=None):
|
||||
"""
|
||||
if not config.get(config_key):
|
||||
from .dialog import WarningDialog
|
||||
WarningDialog( # parent-OK
|
||||
WarningDialog(
|
||||
_('Danger: This is unstable code!'),
|
||||
_("This Gramps ('%s') is a development release.\n"
|
||||
) % warning_type +
|
||||
@ -175,7 +175,7 @@ def _display_gtk_gettext_message(parent=None):
|
||||
LOG.warning("GTK translations missing, GUI will be broken, "
|
||||
"especially for RTL languages!")
|
||||
from .dialog import WarningDialog
|
||||
WarningDialog(_("Gramps detected " # parent-OK
|
||||
WarningDialog(_("Gramps detected "
|
||||
"an incomplete GTK installation"),
|
||||
_("GTK translations for the current language (%(language)s) "
|
||||
"are missing.\n"
|
||||
@ -224,9 +224,9 @@ class Gramps:
|
||||
if (lin()
|
||||
and glocale.lang != 'C'
|
||||
and not gettext.find(GTK_GETTEXT_DOMAIN)):
|
||||
_display_gtk_gettext_message(parent=self._vm.window) # parent-OK
|
||||
_display_gtk_gettext_message(parent=self._vm.window)
|
||||
|
||||
_display_welcome_message(parent=self._vm.window) # parent-OK
|
||||
_display_welcome_message(parent=self._vm.window)
|
||||
|
||||
self._vm.init_interface()
|
||||
|
||||
@ -262,7 +262,7 @@ class Gramps:
|
||||
if hasattr(self, '_vm'):
|
||||
if hasattr(self._vm, 'window'):
|
||||
parent = self._vm.window
|
||||
ErrorDialog(_("Error parsing arguments"), string, # parent-OK
|
||||
ErrorDialog(_("Error parsing arguments"), string,
|
||||
parent=parent)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
|
@ -219,7 +219,7 @@ class MergeFamily(ManagedWindow):
|
||||
phoenix_fh, phoenix_mh)
|
||||
query.execute()
|
||||
except MergeError as err:
|
||||
ErrorDialog(_("Cannot merge people"), str(err), # parent-OK
|
||||
ErrorDialog(_("Cannot merge people"), str(err),
|
||||
parent=self.uistate.window)
|
||||
self.uistate.set_busy_cursor(False)
|
||||
self.close()
|
||||
|
@ -325,7 +325,7 @@ class MergePerson(ManagedWindow):
|
||||
query = MergePersonQuery(self.database, phoenix, titanic)
|
||||
query.execute()
|
||||
except MergeError as err:
|
||||
ErrorDialog(_("Cannot merge people"), str(err), # parent-OK
|
||||
ErrorDialog(_("Cannot merge people"), str(err),
|
||||
parent=self.uistate.window)
|
||||
self.uistate.set_busy_cursor(False)
|
||||
self.close()
|
||||
|
@ -114,7 +114,7 @@ class LastNameDialog(ManagedWindow):
|
||||
# build up the list of surnames, keeping track of the count for each
|
||||
# name (this can be a lengthy process, so by passing in the
|
||||
# dictionary we can be certain we only do this once)
|
||||
progress = ProgressMeter( # parent-OK
|
||||
progress = ProgressMeter(
|
||||
_('Finding Surnames'), parent=uistate.window)
|
||||
progress.set_pass(_('Finding surnames'),
|
||||
database.get_number_of_people())
|
||||
@ -1241,7 +1241,7 @@ class GuiPersonListOption(Gtk.Box):
|
||||
spouse_name = _nd.display(spouse)
|
||||
text = _('Also include %s?') % spouse_name
|
||||
|
||||
prompt = OptionDialog(_('Select Person'), # parent-OK
|
||||
prompt = OptionDialog(_('Select Person'),
|
||||
text,
|
||||
_('No'), None,
|
||||
_('Yes'), None,
|
||||
|
@ -305,7 +305,7 @@ class PluginStatus(ManagedWindow):
|
||||
except:
|
||||
print("Error: cannot open %s" % URL)
|
||||
return
|
||||
pm = ProgressMeter(_("Refreshing Addon List"), # parent-OK
|
||||
pm = ProgressMeter(_("Refreshing Addon List"),
|
||||
parent=self.uistate.window)
|
||||
pm.set_pass(header=_("Reading gramps-project.org..."))
|
||||
state = "read"
|
||||
@ -384,7 +384,7 @@ class PluginStatus(ManagedWindow):
|
||||
Get all addons from the wiki and install them.
|
||||
"""
|
||||
from ..utils import ProgressMeter
|
||||
pm = ProgressMeter( # parent-OK
|
||||
pm = ProgressMeter(
|
||||
_("Install all Addons"), _("Installing..."), message_area=True,
|
||||
parent=self.uistate.window)
|
||||
pm.set_pass(total=len(self.addon_model))
|
||||
@ -404,7 +404,7 @@ class PluginStatus(ManagedWindow):
|
||||
Toplevel method to get an addon.
|
||||
"""
|
||||
from ..utils import ProgressMeter
|
||||
pm = ProgressMeter( # parent-OK
|
||||
pm = ProgressMeter(
|
||||
_("Installing Addon"), message_area=True,
|
||||
parent=self.uistate.window)
|
||||
pm.set_pass(total=2, header=_("Reading gramps-project.org..."))
|
||||
@ -616,7 +616,7 @@ class PluginStatus(ManagedWindow):
|
||||
'plugfil': _("Filename"),
|
||||
'plugpat': _("Location"),
|
||||
}
|
||||
InfoDialog(_('Detailed Info'), infotxt, # parent-OK
|
||||
InfoDialog(_('Detailed Info'), infotxt,
|
||||
parent=self.window)
|
||||
|
||||
def __hide(self, obj, list_obj, id_col, hide_col):
|
||||
@ -882,7 +882,7 @@ class ToolManagedWindowBase(ManagedWindow):
|
||||
|
||||
def pre_run(self):
|
||||
from ..utils import ProgressMeter
|
||||
self.progress = ProgressMeter(self.get_title(), # parent-OK
|
||||
self.progress = ProgressMeter(self.get_title(),
|
||||
parent=self.uistate.window)
|
||||
|
||||
def run(self):
|
||||
@ -1198,12 +1198,12 @@ class UpdateAddons:
|
||||
if not longop.was_cancelled():
|
||||
longop.end()
|
||||
if errors:
|
||||
OkDialog(_("Installation Errors"), # parent-OK
|
||||
OkDialog(_("Installation Errors"),
|
||||
_("The following addons had errors: ") +
|
||||
", ".join(errors),
|
||||
parent=self.window)
|
||||
if count:
|
||||
OkDialog(_("Done downloading and installing addons"), # parent-OK
|
||||
OkDialog(_("Done downloading and installing addons"),
|
||||
# translators: leave all/any {...} untranslated
|
||||
"%s %s" % (ngettext("{number_of} addon was installed.",
|
||||
"{number_of} addons were installed.",
|
||||
@ -1211,7 +1211,7 @@ class UpdateAddons:
|
||||
_("You need to restart Gramps to see new views.")),
|
||||
parent=self.window)
|
||||
else:
|
||||
OkDialog(_("Done downloading and installing addons"), # parent-OK
|
||||
OkDialog(_("Done downloading and installing addons"),
|
||||
_("No addons were installed."),
|
||||
parent=self.window)
|
||||
self.window.destroy()
|
||||
|
@ -64,7 +64,7 @@ class Progress:
|
||||
"""
|
||||
def __init__(self, uistate):
|
||||
from gi.repository import Gtk
|
||||
self.pm = ProgressMeter(_("Selecting Preview Data"), # parent-OK
|
||||
self.pm = ProgressMeter(_("Selecting Preview Data"),
|
||||
_('Selecting...'),
|
||||
parent=uistate.window)
|
||||
self.progress_cnt = 0
|
||||
@ -663,7 +663,7 @@ class WriterOptionBox:
|
||||
lambda : self.edit_filter_save(filterdb, namespace))
|
||||
else: # can't edit this filter
|
||||
from ...dialog import ErrorDialog
|
||||
ErrorDialog(_("Cannot edit a system filter"), # parent-OK
|
||||
ErrorDialog(_("Cannot edit a system filter"),
|
||||
_("Please select a different filter to edit"),
|
||||
parent=self.uistate.window)
|
||||
|
||||
|
@ -237,7 +237,7 @@ class BookListDisplay:
|
||||
def on_booklist_cancel_clicked(self, obj):
|
||||
""" cancel the booklist dialog """
|
||||
if self.unsaved_changes:
|
||||
qqq = QuestionDialog2( # parent-OK
|
||||
qqq = QuestionDialog2(
|
||||
_('Discard Unsaved Changes'),
|
||||
_('You have made changes which have not been saved.'),
|
||||
_('Proceed'),
|
||||
@ -440,7 +440,7 @@ class BookSelector(ManagedWindow):
|
||||
if book.get_output():
|
||||
self.book.set_output(book.get_output())
|
||||
if book.get_dbname() != self._db.get_save_path():
|
||||
WarningDialog( # parent-OK
|
||||
WarningDialog(
|
||||
_('Different database'),
|
||||
_('This book was created with the references to database '
|
||||
'%s.\n\n This makes references to the central person '
|
||||
@ -547,7 +547,7 @@ class BookSelector(ManagedWindow):
|
||||
"""
|
||||
store, the_iter = self.book_model.get_selected()
|
||||
if not the_iter:
|
||||
WarningDialog(_('No selected book item'), # parent-OK
|
||||
WarningDialog(_('No selected book item'),
|
||||
_('Please select a book item to configure.'),
|
||||
parent=self.window)
|
||||
return
|
||||
@ -711,7 +711,7 @@ class BookSelector(ManagedWindow):
|
||||
if self.book_list.get_needs_saving():
|
||||
self.book_list.save()
|
||||
else:
|
||||
WarningDialog(_('No items'), # parent-OK
|
||||
WarningDialog(_('No items'),
|
||||
_('This book has no items.'),
|
||||
parent=self.window)
|
||||
return
|
||||
@ -723,14 +723,14 @@ class BookSelector(ManagedWindow):
|
||||
"""
|
||||
name = str(self.name_entry.get_text())
|
||||
if not name:
|
||||
WarningDialog( # parent-OK
|
||||
WarningDialog(
|
||||
_('No book name'),
|
||||
_('You are about to save away a book with no name.\n\n'
|
||||
'Please give it a name before saving it away.'),
|
||||
parent=self.window)
|
||||
return
|
||||
if name in self.book_list.get_book_names():
|
||||
qqq = QuestionDialog2( # parent-OK
|
||||
qqq = QuestionDialog2(
|
||||
_('Book name already exists'),
|
||||
_('You are about to save away a '
|
||||
'book with a name which already exists.'),
|
||||
@ -950,7 +950,7 @@ class BookDialog(DocReportDialog):
|
||||
try:
|
||||
self.make_book()
|
||||
except (IOError, OSError) as msg:
|
||||
ErrorDialog(str(msg), parent=self.window) # parent-OK
|
||||
ErrorDialog(str(msg), parent=self.window)
|
||||
self.close()
|
||||
|
||||
def setup_style_frame(self):
|
||||
@ -1016,10 +1016,10 @@ class BookDialog(DocReportDialog):
|
||||
except ReportError as msg:
|
||||
(msg1, msg2) = msg.messages()
|
||||
msg2 += ' (%s)' % name # which report has the error?
|
||||
ErrorDialog(msg1, msg2, parent=self.uistate.window) # parent-OK
|
||||
ErrorDialog(msg1, msg2, parent=self.uistate.window)
|
||||
except FilterError as msg:
|
||||
(msg1, msg2) = msg.messages()
|
||||
ErrorDialog(msg1, msg2, parent=self.uistate.window) # parent-OK
|
||||
ErrorDialog(msg1, msg2, parent=self.uistate.window)
|
||||
finally:
|
||||
return
|
||||
|
||||
@ -1064,10 +1064,10 @@ def write_book_item(database, report_class, options, user):
|
||||
return report_class(database, options, user)
|
||||
except ReportError as msg:
|
||||
(msg1, msg2) = msg.messages()
|
||||
ErrorDialog(msg1, msg2, parent=user.uistate.window) # parent-OK
|
||||
ErrorDialog(msg1, msg2, parent=user.uistate.window)
|
||||
except FilterError as msg:
|
||||
(msg1, msg2) = msg.messages()
|
||||
ErrorDialog(msg1, msg2, parent=user.uistate.window) # parent-OK
|
||||
ErrorDialog(msg1, msg2, parent=user.uistate.window)
|
||||
except:
|
||||
LOG.error("Failed to write book item.", exc_info=True)
|
||||
return None
|
||||
|
@ -28,7 +28,7 @@ from gramps.gen.constfunc import get_curr_dir
|
||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.translation.gettext
|
||||
|
||||
class FileEntry(Gtk.Box): # parent-OK
|
||||
class FileEntry(Gtk.Box):
|
||||
""" A widget that allows the user to select a file from the file system """
|
||||
def __init__(self, defname, title, parent=None):
|
||||
Gtk.Box.__init__(self)
|
||||
|
@ -447,7 +447,7 @@ class ReportDialog(ManagedWindow):
|
||||
hid = self.style_name
|
||||
if hid[-4:] == ".xml":
|
||||
hid = hid[0:-4]
|
||||
self.target_fileentry = FileEntry(hid, _("Save As"), # parent-OK
|
||||
self.target_fileentry = FileEntry(hid, _("Save As"),
|
||||
parent=self.window)
|
||||
spath = self.get_default_directory()
|
||||
self.target_fileentry.set_filename(spath)
|
||||
@ -498,7 +498,7 @@ class ReportDialog(ManagedWindow):
|
||||
|
||||
# check whether the dir has rwx permissions
|
||||
if not os.access(self.target_path, os.R_OK|os.W_OK|os.X_OK):
|
||||
ErrorDialog(_('Permission problem'), # parent-OK
|
||||
ErrorDialog(_('Permission problem'),
|
||||
_("You do not have permission to write "
|
||||
"under the directory %s\n\n"
|
||||
"Please select another directory or correct "
|
||||
@ -508,7 +508,7 @@ class ReportDialog(ManagedWindow):
|
||||
|
||||
# selected path is an existing file and we need a file
|
||||
if os.path.isfile(self.target_path):
|
||||
aaa = OptionDialog(_('File already exists'), # parent-OK
|
||||
aaa = OptionDialog(_('File already exists'),
|
||||
_('You can choose to either overwrite the '
|
||||
'file, or change the selected filename.'),
|
||||
_('_Overwrite'), None,
|
||||
@ -525,7 +525,7 @@ class ReportDialog(ManagedWindow):
|
||||
parent_dir = os.path.dirname(os.path.normpath(self.target_path))
|
||||
if os.path.isdir(parent_dir):
|
||||
if not os.access(parent_dir, os.W_OK):
|
||||
ErrorDialog(_('Permission problem'), # parent-OK
|
||||
ErrorDialog(_('Permission problem'),
|
||||
_("You do not have permission to create "
|
||||
"%s\n\n"
|
||||
"Please select another path or correct "
|
||||
@ -533,7 +533,7 @@ class ReportDialog(ManagedWindow):
|
||||
parent=self.window)
|
||||
return None
|
||||
else:
|
||||
ErrorDialog(_('No directory'), # parent-OK
|
||||
ErrorDialog(_('No directory'),
|
||||
_('There is no directory %s.\n\n'
|
||||
'Please select another directory '
|
||||
'or create it.') % parent_dir,
|
||||
@ -659,7 +659,7 @@ def report(dbstate, uistate, person, report_class, options_class,
|
||||
its arguments.
|
||||
"""
|
||||
if require_active and not person:
|
||||
ErrorDialog( # parent-OK
|
||||
ErrorDialog(
|
||||
_('Active person has not been set'),
|
||||
_('You must select an active person for this report to work '
|
||||
'properly.'),
|
||||
@ -711,16 +711,16 @@ def report(dbstate, uistate, person, report_class, options_class,
|
||||
|
||||
except FilterError as msg:
|
||||
(msg1, msg2) = msg.messages()
|
||||
ErrorDialog(msg1, msg2, parent=uistate.window) # parent-OK
|
||||
ErrorDialog(msg1, msg2, parent=uistate.window)
|
||||
except IOError as msg:
|
||||
ErrorDialog(_("Report could not be created"), # parent-OK
|
||||
ErrorDialog(_("Report could not be created"),
|
||||
str(msg),
|
||||
parent=uistate.window)
|
||||
except ReportError as msg:
|
||||
(msg1, msg2) = msg.messages()
|
||||
ErrorDialog(msg1, msg2, parent=uistate.window) # parent-OK
|
||||
ErrorDialog(msg1, msg2, parent=uistate.window)
|
||||
except DatabaseError as msg:
|
||||
ErrorDialog(_("Report could not be created"), # parent-OK
|
||||
ErrorDialog(_("Report could not be created"),
|
||||
str(msg),
|
||||
parent=uistate.window)
|
||||
# The following except statement will catch all "NoneType" exceptions.
|
||||
@ -732,7 +732,7 @@ def report(dbstate, uistate, person, report_class, options_class,
|
||||
# # "'NoneType' object has no attribute ..." usually means
|
||||
# # database corruption
|
||||
# RunDatabaseRepair(str(msg),
|
||||
# parent=self.window) # parent-OK
|
||||
# parent=self.window)
|
||||
# else:
|
||||
# raise
|
||||
raise
|
||||
|
@ -138,7 +138,7 @@ class StyleListDisplay:
|
||||
self.sheetlist.save()
|
||||
except IOError as msg:
|
||||
from ...dialog import ErrorDialog
|
||||
ErrorDialog(_("Error saving stylesheet"), str(msg), # parent-OK
|
||||
ErrorDialog(_("Error saving stylesheet"), str(msg),
|
||||
parent=self.parent_window)
|
||||
except:
|
||||
log.error("Failed to save stylesheet", exc_info=True)
|
||||
|
@ -132,7 +132,7 @@ class ActivePersonTool(Tool):
|
||||
if not uistate.get_active('Person'):
|
||||
# TODO: should we replace this with a callback?
|
||||
from ..dialog import ErrorDialog
|
||||
ErrorDialog(_('Active person has not been set'), # parent-OK
|
||||
ErrorDialog(_('Active person has not been set'),
|
||||
_('You must select an active person for this '
|
||||
'tool to work properly.'),
|
||||
parent=uistate.window)
|
||||
|
@ -43,7 +43,7 @@ class TestUser_prompt(unittest.TestCase):
|
||||
self.user = user.User()
|
||||
|
||||
@unittest.skipUnless(MOCKING, "Requires unittest.mock to run")
|
||||
def test_prompt_runs_QuestionDialog2(self): # parent-OK
|
||||
def test_prompt_runs_QuestionDialog2(self):
|
||||
with patch('gramps.gui.user.QuestionDialog2') as MockQD:
|
||||
self.user.prompt(TestUser.TITLE, TestUser.MSG,
|
||||
TestUser.ACCEPT, TestUser.REJECT, None)
|
||||
|
@ -82,7 +82,7 @@ class TipOfDay(ManagedWindow):
|
||||
tparser = TipParser()
|
||||
except (IOError,ExpatError) as e:
|
||||
self.close()
|
||||
ErrorDialog( # parent-OK
|
||||
ErrorDialog(
|
||||
_("Failed to display tip of the day"),
|
||||
_("Unable to read the tips from external file.\n\n%s") % e,
|
||||
parent=uistate.window)
|
||||
|
@ -194,7 +194,7 @@ class UndoHistory(ManagedWindow):
|
||||
return (self.title, None)
|
||||
|
||||
def _clear_clicked(self, obj=None):
|
||||
QuestionDialog(_("Delete confirmation"), # parent-OK
|
||||
QuestionDialog(_("Delete confirmation"),
|
||||
_("Are you sure you want to clear the Undo history?"),
|
||||
_("Clear"),
|
||||
self.clear,
|
||||
|
@ -68,10 +68,10 @@ class User(user.User):
|
||||
:returns: none
|
||||
"""
|
||||
if self.uistate:
|
||||
self._progress = ProgressMeter(title, # parent-OK
|
||||
self._progress = ProgressMeter(title,
|
||||
parent=self.uistate.window)
|
||||
else:
|
||||
self._progress = ProgressMeter(title) # parent-OK
|
||||
self._progress = ProgressMeter(title)
|
||||
if steps > 0:
|
||||
self._progress.set_pass(message, steps, ProgressMeter.MODE_FRACTION)
|
||||
else:
|
||||
@ -113,7 +113,7 @@ class User(user.User):
|
||||
:returns: the user's answer to the question
|
||||
:rtype: bool
|
||||
"""
|
||||
dialog = QuestionDialog2(title, message, # parent-OK
|
||||
dialog = QuestionDialog2(title, message,
|
||||
accept_label, reject_label,
|
||||
parent=parent)
|
||||
return dialog.run()
|
||||
@ -129,10 +129,10 @@ class User(user.User):
|
||||
:returns: none
|
||||
"""
|
||||
if self.uistate:
|
||||
WarningDialog(title, warning, # parent-OK
|
||||
WarningDialog(title, warning,
|
||||
parent=self.uistate.window)
|
||||
else:
|
||||
WarningDialog(title, warning, parent=None) # parent-OK
|
||||
WarningDialog(title, warning, parent=None)
|
||||
|
||||
def notify_error(self, title, error=""):
|
||||
"""
|
||||
@ -147,9 +147,9 @@ class User(user.User):
|
||||
if self.error_function:
|
||||
self.error_function(title, error)
|
||||
elif self.uistate:
|
||||
ErrorDialog(title, error, parent=self.uistate.window) # parent-OK
|
||||
ErrorDialog(title, error, parent=self.uistate.window)
|
||||
else:
|
||||
ErrorDialog(title, error, parent=None) # parent-OK
|
||||
ErrorDialog(title, error, parent=None)
|
||||
|
||||
def notify_db_error(self, error):
|
||||
"""
|
||||
@ -160,9 +160,9 @@ class User(user.User):
|
||||
:returns: none
|
||||
"""
|
||||
if self.uistate:
|
||||
DBErrorDialog(error, parent=self.uistate.window) # parent-OK
|
||||
DBErrorDialog(error, parent=self.uistate.window)
|
||||
else:
|
||||
DBErrorDialog(error, parent=None) # parent-OK
|
||||
DBErrorDialog(error, parent=None)
|
||||
|
||||
def notify_db_repair(self, error):
|
||||
"""
|
||||
@ -173,12 +173,12 @@ class User(user.User):
|
||||
:returns: none
|
||||
"""
|
||||
if self.uistate:
|
||||
RunDatabaseRepair(error, parent=self.uistate.window) # parent-OK
|
||||
RunDatabaseRepair(error, parent=self.uistate.window)
|
||||
else:
|
||||
RunDatabaseRepair(error, parent=None) # parent-OK
|
||||
RunDatabaseRepair(error, parent=None)
|
||||
|
||||
def info(self, msg1, infotext, parent=None, monospaced=False): # parent-OK
|
||||
def info(self, msg1, infotext, parent=None, monospaced=False):
|
||||
"""
|
||||
Calls the GUI InfoDialog
|
||||
"""
|
||||
InfoDialog(msg1, infotext, parent, monospaced) # parent-OK
|
||||
InfoDialog(msg1, infotext, parent, monospaced)
|
||||
|
@ -103,7 +103,7 @@ class CLIDialog:
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
class ProgressMeter: # parent-OK
|
||||
class ProgressMeter:
|
||||
"""
|
||||
Progress meter class for Gramps.
|
||||
|
||||
@ -297,7 +297,7 @@ class ProgressMeter: # parent-OK
|
||||
Don't let the user close the progress dialog.
|
||||
"""
|
||||
from .dialog import WarningDialog
|
||||
WarningDialog( # parent-OK
|
||||
WarningDialog(
|
||||
_("Attempt to force closing the dialog"),
|
||||
_("Please do not force closing this important dialog."),
|
||||
parent=self.__dialog)
|
||||
@ -372,7 +372,7 @@ def display_error_dialog (index, errorstrings, uistate=None):
|
||||
else:
|
||||
error = errorstrings
|
||||
|
||||
ErrorDialog(_("Error from external program"), # parent-OK
|
||||
ErrorDialog(_("Error from external program"),
|
||||
error, parent=uistate.window)
|
||||
|
||||
def poll_external (args):
|
||||
@ -589,7 +589,7 @@ def edit_object(dbstate, uistate, reftype, ref):
|
||||
"alone")
|
||||
|
||||
from .dialog import WarningDialog
|
||||
WarningDialog(_("Cannot open new citation editor"), # parent-OK
|
||||
WarningDialog(_("Cannot open new citation editor"),
|
||||
blocked_text,
|
||||
parent=uistate.window)
|
||||
elif reftype == 'Place':
|
||||
|
@ -346,7 +346,7 @@ class ViewManager(CLIManager):
|
||||
Show the error.
|
||||
In the GUI, the error is shown, and a return happens
|
||||
"""
|
||||
ErrorDialog(title, errormessage, # parent-OK
|
||||
ErrorDialog(title, errormessage,
|
||||
parent=self.uistate.window)
|
||||
return 1
|
||||
|
||||
@ -767,7 +767,7 @@ class ViewManager(CLIManager):
|
||||
"""
|
||||
if self.dbstate.db.abort_possible:
|
||||
|
||||
dialog = QuestionDialog2( # parent-OK
|
||||
dialog = QuestionDialog2(
|
||||
_("Abort changes?"),
|
||||
_("Aborting changes will return the database to the state "
|
||||
"it was before you started this editing session."),
|
||||
@ -781,7 +781,7 @@ class ViewManager(CLIManager):
|
||||
pass
|
||||
self.quit()
|
||||
else:
|
||||
WarningDialog( # parent-OK
|
||||
WarningDialog(
|
||||
_("Cannot abandon session's changes"),
|
||||
_('Changes cannot be completely abandoned because the '
|
||||
'number of changes made in the session exceeded the '
|
||||
@ -1096,7 +1096,7 @@ class ViewManager(CLIManager):
|
||||
self.db_loader.import_file()
|
||||
infotxt = self.db_loader.import_info_text()
|
||||
if infotxt:
|
||||
InfoDialog(_('Import Statistics'), infotxt, # parent-OK
|
||||
InfoDialog(_('Import Statistics'), infotxt,
|
||||
parent=self.window)
|
||||
self.__post_load()
|
||||
|
||||
@ -1357,7 +1357,7 @@ class ViewManager(CLIManager):
|
||||
basefile = basefile.replace("/", r"-")
|
||||
filename = os.path.join(path_entry.get_text(), basefile)
|
||||
if os.path.exists(filename):
|
||||
question = QuestionDialog2( # parent-OK
|
||||
question = QuestionDialog2(
|
||||
_("Backup file already exists! Overwrite?"),
|
||||
_("The file '%s' exists.") % filename,
|
||||
_("Proceed and overwrite"),
|
||||
@ -1595,7 +1595,7 @@ class ViewManager(CLIManager):
|
||||
|
||||
def display_about_box(self, obj):
|
||||
"""Display the About box."""
|
||||
about = GrampsAboutDialog(self.uistate.window) # parent-OK
|
||||
about = GrampsAboutDialog(self.uistate.window)
|
||||
about.run()
|
||||
about.destroy()
|
||||
|
||||
@ -1617,7 +1617,7 @@ class ViewManager(CLIManager):
|
||||
except:
|
||||
lasterror = '*** No error found, '
|
||||
lasterror += 'probably error in gpr.py file ***'
|
||||
ErrorDialog( # parent-OK
|
||||
ErrorDialog(
|
||||
_('Failed Loading View'),
|
||||
_('The view %(name)s did not load and reported an error.'
|
||||
'\n\n%(error_msg)s\n\n'
|
||||
@ -1710,7 +1710,7 @@ def run_plugin(pdata, dbstate, uistate):
|
||||
error_msg = failed[-1][1][1]
|
||||
else:
|
||||
error_msg = "(no error message)"
|
||||
ErrorDialog( # parent-OK
|
||||
ErrorDialog(
|
||||
_('Failed Loading Plugin'),
|
||||
_('The plugin %(name)s did not load and reported an error.\n\n'
|
||||
'%(error_msg)s\n\n'
|
||||
|
@ -429,7 +429,7 @@ class CitationBookmarks(ListBookmarks):
|
||||
# more comprehensive solution is needed in the long term. See also
|
||||
# change_active in CitatinTreeView
|
||||
from gramps.gui.dialog import WarningDialog
|
||||
WarningDialog( # parent-OK
|
||||
WarningDialog(
|
||||
_("Cannot bookmark this reference"),
|
||||
# FIXME should this next string be translated?
|
||||
"Only Citations can be bookmarked in this view. "
|
||||
|
@ -332,7 +332,7 @@ class ListView(NavigationView):
|
||||
self.model.rebuild_data()
|
||||
except FilterError as msg:
|
||||
(msg1, msg2) = msg.messages()
|
||||
ErrorDialog(msg1, msg2, # parent-OK
|
||||
ErrorDialog(msg1, msg2,
|
||||
parent=self.uistate.window)
|
||||
|
||||
cput1 = time.clock()
|
||||
@ -450,7 +450,7 @@ class ListView(NavigationView):
|
||||
self.bookmarks.add(mlist[0])
|
||||
else:
|
||||
from ..dialog import WarningDialog
|
||||
WarningDialog(_("Could Not Set a Bookmark"), # parent-OK
|
||||
WarningDialog(_("Could Not Set a Bookmark"),
|
||||
_("A bookmark could not be set because "
|
||||
"nothing was selected."),
|
||||
parent=self.uistate.window)
|
||||
@ -542,7 +542,7 @@ class ListView(NavigationView):
|
||||
"""
|
||||
prompt = True
|
||||
if len(self.selected_handles()) > 1:
|
||||
q = QuestionDialog2( # parent-OK
|
||||
q = QuestionDialog2(
|
||||
_("Multiple Selection Delete"),
|
||||
_("More than one item has been selected for deletion. "
|
||||
"Select the option indicating how to delete the items:"),
|
||||
@ -569,7 +569,7 @@ class ListView(NavigationView):
|
||||
#if descr == "":
|
||||
descr = object.get_gramps_id()
|
||||
self.uistate.set_busy_cursor(True)
|
||||
QuestionDialog(_('Delete %s?') % descr, msg, # parent-OK
|
||||
QuestionDialog(_('Delete %s?') % descr, msg,
|
||||
_('_Delete Item'), query.query_response,
|
||||
parent=self.uistate.window)
|
||||
self.uistate.set_busy_cursor(False)
|
||||
|
@ -252,7 +252,7 @@ class NavigationView(PageView):
|
||||
_("%s has been bookmarked") % name)
|
||||
else:
|
||||
from ..dialog import WarningDialog
|
||||
WarningDialog( # parent-OK
|
||||
WarningDialog(
|
||||
_("Could Not Set a Bookmark"),
|
||||
_("A bookmark could not be set because "
|
||||
"no one was selected."),
|
||||
@ -334,7 +334,7 @@ class NavigationView(PageView):
|
||||
self.change_active(defperson.get_handle())
|
||||
else:
|
||||
from ..dialog import WarningDialog
|
||||
WarningDialog(_("No Home Person"), # parent-OK
|
||||
WarningDialog(_("No Home Person"),
|
||||
_("You need to set a 'default person' to go to. "
|
||||
"Select the People View, select the person you want as "
|
||||
"'Home Person', then confirm your choice "
|
||||
|
@ -245,7 +245,7 @@ class Tags(DbGUIElement):
|
||||
"""
|
||||
Display the Organize Tags dialog.
|
||||
"""
|
||||
organize_dialog = OrganizeTagsDialog(self.db, # parent-OK
|
||||
organize_dialog = OrganizeTagsDialog(self.db,
|
||||
self.uistate.window)
|
||||
organize_dialog.run()
|
||||
|
||||
@ -486,7 +486,7 @@ class OrganizeTagsDialog:
|
||||
tag_handle = store.get_value(iter_, 1)
|
||||
tag_name = store.get_value(iter_, 2)
|
||||
|
||||
yes_no = QuestionDialog2( # parent-OK
|
||||
yes_no = QuestionDialog2(
|
||||
_("Remove tag '%s'?") % tag_name,
|
||||
_("The tag definition will be removed. The tag will be also "
|
||||
"removed from all objects in the database."),
|
||||
@ -583,7 +583,7 @@ class EditTag:
|
||||
self.tag.set_color(hexval)
|
||||
|
||||
if not self.tag.get_name():
|
||||
ErrorDialog(_("Cannot save tag"), # parent-OK
|
||||
ErrorDialog(_("Cannot save tag"),
|
||||
_("The tag name cannot be empty"),
|
||||
parent=self.parent_window)
|
||||
return
|
||||
|
@ -541,7 +541,7 @@ class GrampletBar(Gtk.Notebook):
|
||||
"""
|
||||
Called when restore defaults is clicked from the context menu.
|
||||
"""
|
||||
QuestionDialog( # parent-OK
|
||||
QuestionDialog(
|
||||
_("Restore to defaults?"),
|
||||
_("The gramplet bar will be restored to contain its default "
|
||||
"gramplets. This action cannot be undone."),
|
||||
|
@ -422,7 +422,7 @@ else:
|
||||
message = _("Image metadata functionality will not be available.\n"
|
||||
"To build it for Gramps see "
|
||||
"%(gramps_wiki_build_gexiv2_url)s" % gexiv2_dict )
|
||||
MessageHideDialog(title, message, # parent-OK
|
||||
MessageHideDialog(title, message,
|
||||
'interface.ignore-gexiv2',
|
||||
parent=uistate.window)
|
||||
|
||||
|
@ -130,7 +130,7 @@ class Leak(Gramplet):
|
||||
text += str(referrer) + '\n'
|
||||
except ReferenceError:
|
||||
pass
|
||||
InfoDialog(_('Referrers of %d') % count, text, # parent-OK
|
||||
InfoDialog(_('Referrers of %d') % count, text,
|
||||
parent=self.uistate.window)
|
||||
|
||||
def refers_to(self):
|
||||
@ -144,7 +144,7 @@ class Leak(Gramplet):
|
||||
text += str(referent) + '\n'
|
||||
except ReferenceError:
|
||||
pass
|
||||
InfoDialog(_('%d refers to') % count, text, # parent-OK
|
||||
InfoDialog(_('%d refers to') % count, text,
|
||||
parent=self.uistate.window)
|
||||
|
||||
def display(self):
|
||||
|
@ -2626,7 +2626,7 @@ class GedcomParser(UpdateCallback):
|
||||
parent_window = self.user.uistate.window
|
||||
else:
|
||||
parent_window = None
|
||||
self.user.info(message, "".join(self.errors), # parent-OK
|
||||
self.user.info(message, "".join(self.errors),
|
||||
parent=parent_window, monospaced=True)
|
||||
|
||||
def __clean_up(self):
|
||||
|
@ -293,7 +293,7 @@ class BasePersonView(ListView):
|
||||
msg2 = self._message2_format(person)
|
||||
msg2 = "%s %s" % (msg2, data_recover_msg)
|
||||
# This gets person to delete self.active_person:
|
||||
QuestionDialog(msg1, # parent-OK
|
||||
QuestionDialog(msg1,
|
||||
msg2,
|
||||
_('_Delete Person'),
|
||||
self.delete_person_response,
|
||||
@ -301,7 +301,7 @@ class BasePersonView(ListView):
|
||||
else:
|
||||
# Ask to delete; option to cancel, delete rest
|
||||
# This gets person to delete from parameter
|
||||
MultiSelectDialog(self._message1_format, # parent-OK
|
||||
MultiSelectDialog(self._message1_format,
|
||||
self._message2_format,
|
||||
handles,
|
||||
self._lookup_person,
|
||||
@ -421,7 +421,7 @@ class BasePersonView(ListView):
|
||||
mlist = self.selected_handles()
|
||||
|
||||
if len(mlist) != 2:
|
||||
ErrorDialog(_("Cannot merge people"), # parent-OK
|
||||
ErrorDialog(_("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 "
|
||||
|
@ -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, parent=self.uistate.window) # parent-OK
|
||||
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, parent=self.uistate.window) # parent-OK
|
||||
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, parent=self.uistate.window) # parent-OK
|
||||
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, parent=self.uistate.window) # parent-OK
|
||||
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, parent=self.uistate.window) # parent-OK
|
||||
ErrorDialog(msg, msg2, parent=self.uistate.window)
|
||||
else:
|
||||
MergePlace(self.dbstate, self.uistate, mlist[0], mlist[1],
|
||||
self.merged)
|
||||
|
@ -199,7 +199,7 @@ class GeoGraphyView(OsmGps, NavigationView):
|
||||
self.bookmarks.add(mlist[0])
|
||||
else:
|
||||
from gramps.gui.dialog import WarningDialog
|
||||
WarningDialog( # parent-OK
|
||||
WarningDialog(
|
||||
_("Could Not Set a Bookmark"),
|
||||
_("A bookmark could not be set because "
|
||||
"no one was selected."),
|
||||
@ -215,7 +215,7 @@ class GeoGraphyView(OsmGps, NavigationView):
|
||||
self.bookmarks.redraw()
|
||||
else:
|
||||
from gramps.gui.dialog import WarningDialog
|
||||
WarningDialog( # parent-OK
|
||||
WarningDialog(
|
||||
_("Could Not Set a Bookmark"),
|
||||
_("A bookmark could not be set because "
|
||||
"no one was selected."),
|
||||
@ -857,7 +857,7 @@ class GeoGraphyView(OsmGps, NavigationView):
|
||||
"""
|
||||
if Gtk.MAJOR_VERSION == 3 and Gtk.MINOR_VERSION < 11:
|
||||
from gramps.gui.dialog import WarningDialog
|
||||
WarningDialog( # parent-OK
|
||||
WarningDialog(
|
||||
_("You can't use the print functionality"),
|
||||
_("Your Gtk version is too old."),
|
||||
parent=self.uistate.window)
|
||||
@ -1043,7 +1043,7 @@ class GeoGraphyView(OsmGps, NavigationView):
|
||||
gids = gids + ", " + plce.gramps_id
|
||||
if nb_places > 1:
|
||||
from gramps.gui.dialog import WarningDialog
|
||||
WarningDialog( # parent-OK
|
||||
WarningDialog(
|
||||
_('You have at least two places with the same title.'),
|
||||
_("The title of the places is:\n%(title)s\n"
|
||||
"The following places are similar: %(gid)s\n"
|
||||
|
@ -117,7 +117,7 @@ class OsmGps:
|
||||
try:
|
||||
os.makedirs(cache_path, 0o755) # create dir like mkdir -p
|
||||
except:
|
||||
ErrorDialog(_("Can't create " # parent-OK
|
||||
ErrorDialog(_("Can't create "
|
||||
"tiles cache directory %s") % cache_path,
|
||||
parent=self.uistate.window)
|
||||
return self.vbox
|
||||
@ -140,7 +140,7 @@ class OsmGps:
|
||||
try:
|
||||
os.makedirs(tiles_path, 0o755) # create dir like mkdir -p
|
||||
except:
|
||||
ErrorDialog(_("Can't create " # parent-OK
|
||||
ErrorDialog(_("Can't create "
|
||||
"tiles cache directory for '%s'.") %
|
||||
constants.MAP_TITLE[map_type],
|
||||
parent=self.uistate.window)
|
||||
|
@ -144,7 +144,7 @@ class EniroSVMapService(MapService):
|
||||
else:
|
||||
msg2 = _("Latitude not within '54.55' to '69.05'\n") + \
|
||||
_("Longitude not within '8.05' to '24.15'")
|
||||
WarningDialog(_("Eniro map not available"), msg2, # parent-OK
|
||||
WarningDialog(_("Eniro map not available"), msg2,
|
||||
parent=self.uistate.window)
|
||||
return
|
||||
|
||||
@ -172,13 +172,13 @@ class EniroSVMapService(MapService):
|
||||
self.url = path.replace(" ","%20")
|
||||
return
|
||||
else:
|
||||
WarningDialog(_("Eniro map not available"), # parent-OK
|
||||
WarningDialog(_("Eniro map not available"),
|
||||
_("Coordinates needed in Denmark"),
|
||||
parent=self.uistate.window)
|
||||
self.url = ""
|
||||
return
|
||||
|
||||
WarningDialog(_("Eniro map not available"), # parent-OK
|
||||
WarningDialog(_("Eniro map not available"),
|
||||
_("Latitude and longitude,\n"
|
||||
"or street and city needed"),
|
||||
parent=self.uistate.window)
|
||||
|
@ -82,7 +82,7 @@ class ChangeNames(tool.BatchTool, ManagedWindow):
|
||||
if self.fail:
|
||||
return
|
||||
|
||||
self.progress = ProgressMeter( # parent-OK
|
||||
self.progress = ProgressMeter(
|
||||
_('Checking Family Names'), '', parent=uistate.window)
|
||||
self.progress.set_pass(_('Searching family names'),
|
||||
len(self.db.get_surname_list()))
|
||||
@ -141,7 +141,7 @@ class ChangeNames(tool.BatchTool, ManagedWindow):
|
||||
else:
|
||||
self.progress.close()
|
||||
self.close()
|
||||
OkDialog(_('No modifications made'), # parent-OK
|
||||
OkDialog(_('No modifications made'),
|
||||
_("No capitalization changes were detected."),
|
||||
parent=uistate.window)
|
||||
|
||||
|
@ -103,7 +103,7 @@ def cross_table_duplicates(db, uistate):
|
||||
parent = uistate.window
|
||||
else:
|
||||
parent = None
|
||||
progress = ProgressMeter(_('Checking Database'), '', parent) # parent-OK
|
||||
progress = ProgressMeter(_('Checking Database'), '', parent)
|
||||
progress.set_pass(_('Looking for cross table duplicates'), 9)
|
||||
logging.info('Looking for cross table duplicates')
|
||||
total_nr_handles = 0
|
||||
@ -246,7 +246,7 @@ class CheckIntegrity:
|
||||
self.empty_objects = defaultdict(list)
|
||||
self.replaced_sourceref = []
|
||||
self.last_img_dir = config.get('behavior.addmedia-image-dir')
|
||||
self.progress = ProgressMeter(_('Checking Database'), '', # parent-OK
|
||||
self.progress = ProgressMeter(_('Checking Database'), '',
|
||||
parent=self.parent_window)
|
||||
self.explanation = Note(_('Objects referenced by this note '
|
||||
'were referenced but missing so that is why they have been created '
|
||||
@ -722,7 +722,7 @@ class CheckIntegrity:
|
||||
'found' %
|
||||
{'desc' : photo_desc,
|
||||
'name' : photo_name})
|
||||
mmd = MissingMediaDialog( # parent-OK
|
||||
mmd = MissingMediaDialog(
|
||||
_("Media object could not be found"),
|
||||
_("The file:\n%(file_name)s\nis referenced in "
|
||||
"the database, but no longer exists.\n"
|
||||
@ -2107,7 +2107,7 @@ class CheckIntegrity:
|
||||
|
||||
if errors == 0:
|
||||
if uistate:
|
||||
OkDialog(_("No errors were found"), # parent-OK
|
||||
OkDialog(_("No errors were found"),
|
||||
_('The database has passed internal checks'),
|
||||
parent=uistate.window)
|
||||
else:
|
||||
|
@ -64,7 +64,7 @@ class DateParserDisplayTest(tool.Tool):
|
||||
if uistate:
|
||||
# Running with gui -> Show message
|
||||
self.parent_window = uistate.window
|
||||
QuestionDialog(_("Start date test?"), # parent-OK
|
||||
QuestionDialog(_("Start date test?"),
|
||||
_("This test will create many persons and events " \
|
||||
"in the current database. Do you really want to " \
|
||||
"run this test?"),
|
||||
@ -77,7 +77,7 @@ class DateParserDisplayTest(tool.Tool):
|
||||
|
||||
|
||||
def run_tool(self):
|
||||
self.progress = ProgressMeter(_('Running Date Test'), '', # parent-OK
|
||||
self.progress = ProgressMeter(_('Running Date Test'), '',
|
||||
parent=self.parent_window)
|
||||
self.progress.set_pass(_('Generating dates'),
|
||||
4)
|
||||
|
@ -176,7 +176,7 @@ class EventComparison(tool.Tool,ManagedWindow):
|
||||
def on_apply_clicked(self, obj):
|
||||
cfilter = self.filter_model[self.filters.get_active()][1]
|
||||
|
||||
progress_bar = ProgressMeter(_('Comparing events'), '', # parent-OK
|
||||
progress_bar = ProgressMeter(_('Comparing events'), '',
|
||||
parent=self.window)
|
||||
progress_bar.set_pass(_('Selecting people'),1)
|
||||
|
||||
@ -190,7 +190,7 @@ class EventComparison(tool.Tool,ManagedWindow):
|
||||
self.options.handler.save_options()
|
||||
|
||||
if len(plist) == 0:
|
||||
WarningDialog(_("No matches were found"), # parent-OK
|
||||
WarningDialog(_("No matches were found"),
|
||||
parent=self.window)
|
||||
else:
|
||||
DisplayChart(self.dbstate,self.uistate,plist,self.track)
|
||||
@ -306,7 +306,7 @@ class DisplayChart(ManagedWindow):
|
||||
self.progress_bar.close()
|
||||
|
||||
def build_row_data(self):
|
||||
self.progress_bar = ProgressMeter( # parent-OK
|
||||
self.progress_bar = ProgressMeter(
|
||||
_('Comparing Events'), '', parent=self.window)
|
||||
self.progress_bar.set_pass(_('Building data'),len(self.my_list))
|
||||
for individual_id in self.my_list:
|
||||
|
@ -163,7 +163,7 @@ class Merge(tool.Tool,ManagedWindow):
|
||||
try:
|
||||
self.find_potentials(threshold)
|
||||
except AttributeError as msg:
|
||||
RunDatabaseRepair(str(msg), parent=self.window) # parent-OK
|
||||
RunDatabaseRepair(str(msg), parent=self.window)
|
||||
return
|
||||
|
||||
self.options.handler.options_dict['threshold'] = threshold
|
||||
@ -172,7 +172,7 @@ class Merge(tool.Tool,ManagedWindow):
|
||||
self.options.handler.save_options()
|
||||
|
||||
if len(self.map) == 0:
|
||||
OkDialog( # parent-OK
|
||||
OkDialog(
|
||||
_("No matches found"),
|
||||
_("No potential duplicate people were found"),
|
||||
parent=self.window)
|
||||
@ -184,7 +184,7 @@ class Merge(tool.Tool,ManagedWindow):
|
||||
pass
|
||||
|
||||
def find_potentials(self, thresh):
|
||||
self.progress = ProgressMeter(_('Find Duplicates'), # parent-OK
|
||||
self.progress = ProgressMeter(_('Find Duplicates'),
|
||||
_('Looking for duplicate people'),
|
||||
parent=self.window)
|
||||
|
||||
|
@ -86,7 +86,7 @@ class FindLoop(ManagedWindow):
|
||||
self.set_window(window, title, self.title)
|
||||
|
||||
# start the progress indicator
|
||||
self.progress = ProgressMeter(self.title, _('Starting'), # parent-OK
|
||||
self.progress = ProgressMeter(self.title, _('Starting'),
|
||||
parent=self.window)
|
||||
self.progress.set_pass(_('Looking for possible loop for each person'),
|
||||
self.db.get_number_of_people())
|
||||
|
@ -181,7 +181,7 @@ class MergeCitations(tool.BatchTool,ManagedWindow):
|
||||
# Save options
|
||||
self.options.handler.save_options()
|
||||
|
||||
self.progress = ProgressMeter(_('Checking Sources'), '', # parent-OK
|
||||
self.progress = ProgressMeter(_('Checking Sources'), '',
|
||||
parent=self.user.uistate.window)
|
||||
self.progress.set_pass(_('Looking for citation fields'),
|
||||
self.db.get_number_of_citations())
|
||||
@ -229,7 +229,7 @@ class MergeCitations(tool.BatchTool,ManagedWindow):
|
||||
db.enable_signals()
|
||||
db.request_rebuild()
|
||||
self.progress.close()
|
||||
OkDialog(_("Number of merges done"), # parent-OK
|
||||
OkDialog(_("Number of merges done"),
|
||||
# translators: leave all/any {...} untranslated
|
||||
ngettext("{number_of} citation merged",
|
||||
"{number_of} citations merged", num_merges
|
||||
|
@ -107,7 +107,7 @@ class NotRelated(tool.ActivePersonTool, ManagedWindow) :
|
||||
self.tagapply.connect('clicked', self.applyTagClicked)
|
||||
|
||||
# start the progress indicator
|
||||
self.progress = ProgressMeter(self.title, _('Starting'), # parent-OK
|
||||
self.progress = ProgressMeter(self.title, _('Starting'),
|
||||
parent=self.window)
|
||||
|
||||
# setup the columns
|
||||
@ -252,7 +252,7 @@ class NotRelated(tool.ActivePersonTool, ManagedWindow) :
|
||||
|
||||
# if more than 1 person is selected, use a progress indicator
|
||||
if rows > 1:
|
||||
progress = ProgressMeter(self.title, _('Starting'), # parent-OK
|
||||
progress = ProgressMeter(self.title, _('Starting'),
|
||||
parent=self.window)
|
||||
progress.set_pass(
|
||||
# translators: leave all/any {...} untranslated
|
||||
|
@ -167,7 +167,7 @@ class PatchNames(tool.BatchTool, ManagedWindow):
|
||||
self.cb = callback
|
||||
self.handle_to_action = {}
|
||||
|
||||
self.progress = ProgressMeter( # parent-OK
|
||||
self.progress = ProgressMeter(
|
||||
_('Extracting Information from Names'), '',
|
||||
parent=self.uistate.window)
|
||||
self.progress.set_pass(_('Analyzing names'),
|
||||
@ -361,7 +361,7 @@ class PatchNames(tool.BatchTool, ManagedWindow):
|
||||
else:
|
||||
self.progress.close()
|
||||
self.close()
|
||||
OkDialog(_('No modifications made'), # parent-OK
|
||||
OkDialog(_('No modifications made'),
|
||||
_("No titles, nicknames or prefixes were found"),
|
||||
parent=self.uistate.window)
|
||||
|
||||
|
@ -67,7 +67,7 @@ class PopulateSources(tool.Tool, ManagedWindow):
|
||||
|
||||
if response == Gtk.ResponseType.ACCEPT:
|
||||
self.on_ok_clicked()
|
||||
OkDialog('Data generated', # parent-OK
|
||||
OkDialog('Data generated',
|
||||
"The requested sources and citations were generated",
|
||||
parent=uistate.window)
|
||||
|
||||
@ -134,7 +134,7 @@ class PopulateSources(tool.Tool, ManagedWindow):
|
||||
num_citations_text = self.citations_entry.get_text()
|
||||
num_citations = int(num_citations_text)
|
||||
|
||||
self.progress = ProgressMeter( # parent-OK
|
||||
self.progress = ProgressMeter(
|
||||
'Generating data', '', parent=self.uistate.window)
|
||||
self.progress.set_pass('Generating data',
|
||||
num_sources*num_citations)
|
||||
|
@ -83,7 +83,7 @@ class Rebuild(tool.Tool, UpdateCallback):
|
||||
|
||||
uistate.set_busy_cursor(False)
|
||||
uistate.progress.hide()
|
||||
OkDialog(_("Secondary indexes rebuilt"), # parent-OK
|
||||
OkDialog(_("Secondary indexes rebuilt"),
|
||||
_('All secondary indexes have been rebuilt.'),
|
||||
parent=uistate.window)
|
||||
else:
|
||||
|
@ -92,7 +92,7 @@ class RebuildGenderStat(tool.Tool, UpdateCallback):
|
||||
if uistate:
|
||||
uistate.set_busy_cursor(False)
|
||||
uistate.progress.hide()
|
||||
OkDialog(_("Gender statistics rebuilt"), # parent-OK
|
||||
OkDialog(_("Gender statistics rebuilt"),
|
||||
_('Gender statistics for name gender guessing have been rebuilt.'),
|
||||
parent=uistate.window)
|
||||
else:
|
||||
|
@ -88,7 +88,7 @@ class RebuildRefMap(tool.Tool, UpdateCallback):
|
||||
if uistate:
|
||||
uistate.set_busy_cursor(False)
|
||||
uistate.progress.hide()
|
||||
OkDialog(_("Reference maps rebuilt"), # parent-OK
|
||||
OkDialog(_("Reference maps rebuilt"),
|
||||
_('All reference maps have been rebuilt.'),
|
||||
parent=uistate.window)
|
||||
else:
|
||||
|
@ -146,7 +146,7 @@ class RelCalc(tool.Tool, ManagedWindow):
|
||||
|
||||
if not self.person:
|
||||
self.window.hide()
|
||||
ErrorDialog(_('Active person has not been set'), # parent-OK
|
||||
ErrorDialog(_('Active person has not been set'),
|
||||
_('You must select an active person for this '
|
||||
'tool to work properly.'),
|
||||
parent=uistate.window)
|
||||
|
@ -65,7 +65,7 @@ class ReorderIds(tool.BatchTool):
|
||||
db = dbstate.db
|
||||
self.uistate = uistate
|
||||
if uistate:
|
||||
self.progress = ProgressMeter( # parent-OK
|
||||
self.progress = ProgressMeter(
|
||||
_('Reordering Gramps IDs'), '', parent=uistate.window)
|
||||
else:
|
||||
print(_("Reordering Gramps IDs..."))
|
||||
|
@ -338,7 +338,7 @@ class TestcaseGenerator(tool.BatchTool):
|
||||
else:
|
||||
self.window = None
|
||||
|
||||
self.progress = ProgressMeter( # parent-OK
|
||||
self.progress = ProgressMeter(
|
||||
_('Generating testcases'), '', parent=self.window)
|
||||
self.transaction_count = 0;
|
||||
|
||||
|
@ -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, parent=self.uistate.window) # parent-OK
|
||||
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, parent=self.uistate.window) # parent-OK
|
||||
ErrorDialog(msg, msg2, parent=self.uistate.window)
|
||||
else:
|
||||
MergeCitation(self.dbstate, self.uistate, mlist[0], mlist[1])
|
||||
|
||||
|
@ -427,7 +427,7 @@ class CitationTreeView(ListView):
|
||||
Citation(), source)
|
||||
except WindowActiveError:
|
||||
from gramps.gui.dialog import WarningDialog
|
||||
WarningDialog(_("Cannot share this reference"), # parent-OK
|
||||
WarningDialog(_("Cannot share this reference"),
|
||||
self.__blocked_text(),
|
||||
parent=self.uistate.window)
|
||||
#
|
||||
@ -478,7 +478,7 @@ class CitationTreeView(ListView):
|
||||
EditSource(self.dbstate, self.uistate, [], source)
|
||||
except WindowActiveError:
|
||||
from gramps.gui.dialog import WarningDialog
|
||||
WarningDialog(_("Cannot share this reference"), # parent-OK
|
||||
WarningDialog(_("Cannot share this reference"),
|
||||
self.__blocked_text2(),
|
||||
parent=self.uistate.window)
|
||||
|
||||
@ -514,7 +514,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, parent=self.uistate.window) # parent-OK
|
||||
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])
|
||||
@ -534,7 +534,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, # parent-OK
|
||||
ErrorDialog(msg, msg2,
|
||||
parent=self.uistate.window)
|
||||
else:
|
||||
MergeCitation(self.dbstate, self.uistate, mlist[0],
|
||||
@ -546,7 +546,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, parent=self.uistate.window) # parent-OK
|
||||
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)
|
||||
|
@ -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, parent=self.uistate.window) # parent-OK
|
||||
ErrorDialog(msg, msg2, parent=self.uistate.window)
|
||||
else:
|
||||
MergeEvent(self.dbstate, self.uistate, mlist[0], mlist[1])
|
||||
|
||||
|
@ -216,7 +216,7 @@ class FamilyView(ListView):
|
||||
self.bookmarks.add(mlist[0])
|
||||
else:
|
||||
from gramps.gui.dialog import WarningDialog
|
||||
WarningDialog( # parent-OK
|
||||
WarningDialog(
|
||||
_("Could Not Set a Bookmark"),
|
||||
_("A bookmark could not be set because "
|
||||
"no one was selected."), parent=self.uistate.window)
|
||||
@ -240,13 +240,13 @@ class FamilyView(ListView):
|
||||
msg1 = self._message1_format(family)
|
||||
msg2 = self._message2_format(family)
|
||||
msg2 = "%s %s" % (msg2, data_recover_msg)
|
||||
QuestionDialog(msg1, # parent-OK
|
||||
QuestionDialog(msg1,
|
||||
msg2,
|
||||
_('_Delete Family'),
|
||||
lambda: self.delete_family_response(family),
|
||||
parent=self.uistate.window)
|
||||
else:
|
||||
MultiSelectDialog(self._message1_format, # parent-OK
|
||||
MultiSelectDialog(self._message1_format,
|
||||
self._message2_format,
|
||||
handles,
|
||||
self.dbstate.db.get_family_from_handle,
|
||||
@ -306,7 +306,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, parent=self.uistate.window) # parent-OK
|
||||
ErrorDialog(msg, msg2, parent=self.uistate.window)
|
||||
else:
|
||||
MergeFamily(self.dbstate, self.uistate, mlist[0], mlist[1])
|
||||
|
||||
|
@ -288,7 +288,7 @@ class GeoEvents(GeoGraphyView):
|
||||
if self.show_all:
|
||||
self.show_all = False
|
||||
events_handle = dbstate.db.get_event_handles()
|
||||
progress = ProgressMeter(self.window_name, # parent-OK
|
||||
progress = ProgressMeter(self.window_name,
|
||||
can_cancel=False,
|
||||
parent=self.uistate.window)
|
||||
length = len(events_handle)
|
||||
@ -300,7 +300,7 @@ class GeoEvents(GeoGraphyView):
|
||||
progress.close()
|
||||
elif self.generic_filter:
|
||||
events_list = self.generic_filter.apply(dbstate.db)
|
||||
progress = ProgressMeter(self.window_name, # parent-OK
|
||||
progress = ProgressMeter(self.window_name,
|
||||
can_cancel=False,
|
||||
parent=self.uistate.window)
|
||||
length = len(events_list)
|
||||
|
@ -72,7 +72,7 @@ if not OSMGPSMAP:
|
||||
MESSAGE = _("Geography functionality will not be available.\n"
|
||||
"To build it for Gramps see "
|
||||
"%(gramps_wiki_build_osmgps_url)s") % OSMGPS_DICT
|
||||
MessageHideDialog(TITLE, MESSAGE, # parent-OK
|
||||
MessageHideDialog(TITLE, MESSAGE,
|
||||
'interface.ignore-osmgpsmap',
|
||||
parent=uistate.window)
|
||||
else:
|
||||
|
@ -268,7 +268,7 @@ class GeoPlaces(GeoGraphyView):
|
||||
places_handle = dbstate.db.get_place_handles()
|
||||
except:
|
||||
return
|
||||
progress = ProgressMeter(self.window_name, # parent-OK
|
||||
progress = ProgressMeter(self.window_name,
|
||||
can_cancel=False,
|
||||
parent=self.uistate.window)
|
||||
length = len(places_handle)
|
||||
@ -280,7 +280,7 @@ class GeoPlaces(GeoGraphyView):
|
||||
progress.close()
|
||||
elif self.generic_filter:
|
||||
place_list = self.generic_filter.apply(dbstate.db)
|
||||
progress = ProgressMeter(self.window_name, # parent-OK
|
||||
progress = ProgressMeter(self.window_name,
|
||||
can_cancel=False,
|
||||
parent=self.uistate.window)
|
||||
length = len(place_list)
|
||||
|
@ -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, parent=self.uistate.window) # parent-OK
|
||||
ErrorDialog(msg, msg2, parent=self.uistate.window)
|
||||
else:
|
||||
MergeMedia(self.dbstate, self.uistate, mlist[0], mlist[1])
|
||||
|
||||
|
@ -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, parent=self.uistate.window) # parent-OK
|
||||
ErrorDialog(msg, msg2, parent=self.uistate.window)
|
||||
else:
|
||||
MergeNote(self.dbstate, self.uistate, mlist[0], mlist[1])
|
||||
|
||||
|
@ -699,7 +699,7 @@ class PedigreeView(NavigationView):
|
||||
else:
|
||||
self.rebuild_trees(None)
|
||||
except AttributeError as msg:
|
||||
RunDatabaseRepair(str(msg), # parent-OK
|
||||
RunDatabaseRepair(str(msg),
|
||||
parent=self.uistate.window)
|
||||
|
||||
def _connect_db_signals(self):
|
||||
@ -1509,7 +1509,7 @@ class PedigreeView(NavigationView):
|
||||
try:
|
||||
alive = probably_alive(person, self.dbstate.db)
|
||||
except RuntimeError:
|
||||
ErrorDialog(_('Relationship loop detected'), # parent-OK
|
||||
ErrorDialog(_('Relationship loop detected'),
|
||||
_('A person was found to be his/her own ancestor.'),
|
||||
parent=self.uistate.window)
|
||||
alive = False
|
||||
|
@ -473,7 +473,7 @@ class RelationshipView(NavigationView):
|
||||
exc = traceback.format_exc()
|
||||
_LOG.error(str(msg) +"\n" + exc)
|
||||
from gramps.gui.dialog import RunDatabaseRepair
|
||||
RunDatabaseRepair(str(msg), # parent-OK
|
||||
RunDatabaseRepair(str(msg),
|
||||
parent=self.uistate.window)
|
||||
self.redrawing = False
|
||||
return True
|
||||
@ -1351,7 +1351,7 @@ class RelationshipView(NavigationView):
|
||||
family = self.dbstate.db.get_family_from_handle(family_handle)
|
||||
if family is None:
|
||||
from gramps.gui.dialog import WarningDialog
|
||||
WarningDialog( # parent-OK
|
||||
WarningDialog(
|
||||
_('Broken family detected'),
|
||||
_('Please run the Check and Repair Database tool'),
|
||||
parent=self.uistate.window)
|
||||
|
@ -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, parent=self.uistate.window) # parent-OK
|
||||
ErrorDialog(msg, msg2, parent=self.uistate.window)
|
||||
else:
|
||||
MergeRepository(self.dbstate, self.uistate, mlist[0], mlist[1])
|
||||
|
||||
|
@ -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, parent=self.uistate.window) # parent-OK
|
||||
ErrorDialog(msg, msg2, parent=self.uistate.window)
|
||||
else:
|
||||
MergeSource(self.dbstate, self.uistate, mlist[0], mlist[1])
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user