* src/PluginUtils/_Tool.py (BatchTool): Add class taking care of

tools with batch transactions.
	(ActivePersonTool.pass): Remove method.
	* src/plugins/Check.py (Check): Derive from BatchTool.
	* src/plugins/ReorderIds.py (ReorderIds): Use batch transactions;
	derive from BatchTool.
	* src/plugins/ChangeTypes.py (ChangeTypes): Use batch
	transactions; derive from BatchTool. 
	* src/plugins/ChangeNames.py (ChangeNames): Derive from BatchTool.
	* src/plugins/PatchNames.py (PatchNames): Use batch transactions;
	derive from BatchTool.
	* src/glade/gramps.glade: Make both buttons' lables in
	questiondialog use underline property.
	(ViewManager.import_data): Add undo warning for imports.


svn: r6540
This commit is contained in:
Alex Roitman
2006-05-04 02:05:50 +00:00
parent 23b7ec08d6
commit 4ea2ca6a28
9 changed files with 90 additions and 24 deletions

View File

@ -1009,13 +1009,27 @@ class ViewManager:
Exporter.Exporter(self.state, self.uistate)
def import_data(self, obj):
# First thing first: import is a batch transaction
# so we will lose the undo history. Warn the user.
warn_dialog = QuestionDialog.QuestionDialog2(
_('Undo history warning'),
_('Proceeding with import will erase the undo history '
'for this session. In particular, you will not be able '
'to revert the import or any changes made prior to it.\n\n'
'If you think you may want to revert the import, '
'please stop here and backup your database.'),
_('_Proceed with import'), _('_Stop'),
self.window)
if not warn_dialog.run():
return False
choose = gtk.FileChooserDialog(_('GRAMPS: Import database'),
self.uistate.window,
gtk.FILE_CHOOSER_ACTION_OPEN,
(gtk.STOCK_CANCEL,
gtk.RESPONSE_CANCEL,
gtk.STOCK_OPEN,
gtk.RESPONSE_OK))
self.uistate.window,
gtk.FILE_CHOOSER_ACTION_OPEN,
(gtk.STOCK_CANCEL,
gtk.RESPONSE_CANCEL,
gtk.STOCK_OPEN,
gtk.RESPONSE_OK))
choose.set_local_only(False)
# Always add automatic (macth all files) filter
add_all_files_filter(choose)