2006-12-10 Don Allingham <don@gramps-project.org>

* src/DataViews/_RelationView.py: RunDatabaseRepair integration
	* src/GrampsDb/_WriteGedcom.py: RunDatabaseRepair integration
	* src/QuestionDialog.py: RunDatabaseRepair dialog to warn users to run
	database checks



svn: r7777
This commit is contained in:
Don Allingham 2006-12-11 04:10:46 +00:00
parent 15afe0739f
commit 6c48caa07f
4 changed files with 28 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2006-12-10 Don Allingham <don@gramps-project.org>
* src/DataViews/_RelationView.py: RunDatabaseRepair integration
* src/GrampsDb/_WriteGedcom.py: RunDatabaseRepair integration
* src/QuestionDialog.py: RunDatabaseRepair dialog to warn users to run
database checks
2006-12-10 Martin Hawlisch <Martin.Hawlisch@gmx.de> 2006-12-10 Martin Hawlisch <Martin.Hawlisch@gmx.de>
* src/DisplayModels/_PeopleModel.py: Fix birth date fallback * src/DisplayModels/_PeopleModel.py: Fix birth date fallback

View File

@ -372,6 +372,13 @@ class RelationshipView(PageView.PersonNavView):
self.change_person(None) self.change_person(None)
def change_person(self, obj): def change_person(self, obj):
try:
self._change_person(obj)
except AttributeError, msg:
from QuestionDialog import RunDatabaseRepair
RunDatabaseRepair(msg)
def _change_person(self, obj):
if self.redrawing: if self.redrawing:
return False return False
self.redrawing = True self.redrawing = True

View File

@ -60,7 +60,7 @@ import Errors
import ansel_utf8 import ansel_utf8
import Utils import Utils
import NameDisplay import NameDisplay
from QuestionDialog import ErrorDialog, WarningDialog, MessageHideDialog from QuestionDialog import *
from BasicUtils import UpdateCallback from BasicUtils import UpdateCallback
#------------------------------------------------------------------------ #------------------------------------------------------------------------
@ -1490,7 +1490,9 @@ def exportData(database,filename,person,option_box,callback=None):
try: try:
gw = GedcomWriter(database,person,0,filename,option_box,callback) gw = GedcomWriter(database,person,0,filename,option_box,callback)
ret = gw.export_data(filename) ret = gw.export_data(filename)
except Errors.DatabaseError,msg: except AttributeError, msg:
RunDatabaseRepair(msg)
except Errors.DatabaseError, msg:
ErrorDialog(_("Export failed"),str(msg)) ErrorDialog(_("Export failed"),str(msg))
return ret return ret

View File

@ -178,6 +178,17 @@ class ErrorDialog(gtk.MessageDialog):
self.run() self.run()
self.destroy() self.destroy()
class RunDatabaseRepair(ErrorDialog):
def __init__(self, msg, parent=None):
ErrorDialog.__init__(
self,
_('Error detected in database'),
_('GRAMPS has detected an error in the database. This can '
'usually be resolved by running the "Check and Repair Database" '
'tool.\n\nIf this problem continues to exist after running this '
'tool, please file a bug report at '
'http://bugs.gramps-project.org\n\n') + str(msg))
class WarningDialog(gtk.MessageDialog): class WarningDialog(gtk.MessageDialog):
def __init__(self,msg1,msg2="",parent=None): def __init__(self,msg1,msg2="",parent=None):