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 179106c39e
commit fa8085031b
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>
* src/DisplayModels/_PeopleModel.py: Fix birth date fallback

View File

@ -372,6 +372,13 @@ class RelationshipView(PageView.PersonNavView):
self.change_person(None)
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:
return False
self.redrawing = True

View File

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

View File

@ -178,6 +178,17 @@ class ErrorDialog(gtk.MessageDialog):
self.run()
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):
def __init__(self,msg1,msg2="",parent=None):