2006-09-25 Don Allingham <don@gramps-project.org>

* src/GrampsDb/_GrampsDBCallback.py: catch db transaction problem
	* src/GrampsCfg.py: reset PORT_WARN when TRANSACTION re-enabled
	* src/QuestionDialog.py: sync changes to config value
	* src/GrampsLogger/_ErrorReportAssistant.py: fix typo
	


svn: r7330
This commit is contained in:
Don Allingham 2006-09-26 02:07:03 +00:00
parent 64b29cee3a
commit 17431a9f82
5 changed files with 31 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2006-09-25 Don Allingham <don@gramps-project.org>
* src/GrampsDb/_GrampsDBCallback.py: catch db transaction problem
* src/GrampsCfg.py: reset PORT_WARN when TRANSACTION re-enabled
* src/QuestionDialog.py: sync changes to config value
* src/GrampsLogger/_ErrorReportAssistant.py: fix typo
2006-09-24 Don Allingham <don@gramps-project.org>
* src/ViewManager.py: fix call to warning dialog
* src/QuestionDialog.py: Don't do internal check on value

View File

@ -106,6 +106,9 @@ class GrampsPreferences(ManagedWindow.ManagedWindow):
tlabel, _('Preferences'), None)
panel = gtk.Notebook()
self.original = Config.get(Config.TRANSACTIONS)
self.window.vbox.pack_start(tlabel, padding=12)
self.window.vbox.add(panel)
self.window.connect('response',self.done)
@ -128,6 +131,8 @@ class GrampsPreferences(ManagedWindow.ManagedWindow):
self.show()
def done(self, obj, value):
if not self.original and Config.get(Config.TRANSACTIONS):
Config.set(Config.PORT_WARN, True)
self.close()
def add_researcher_panel(self):

View File

@ -41,6 +41,8 @@ import types
import traceback
import inspect
from bsddb import db
log = sys.stderr.write
#-------------------------------------------------------------------------
@ -409,7 +411,10 @@ class GrampsDBCallback(object):
cb[0](fn[1],*args)
elif type(fn) == types.FunctionType or \
type(fn) == types.MethodType: # call func
fn(*args)
try:
fn(*args)
except db.DBRunRecoveryError:
display_error()
else:
self._warn("Badly formed entry in callback map.\n")
except:
@ -456,6 +461,17 @@ class GrampsDBCallback(object):
GrampsDBCallback.__BLOCK_ALL_SIGNALS = False
enable_all_signals = classmethod(__enable_all_signals)
def display_error():
from QuestionDialog import ErrorDialog
ErrorDialog(
_('Database error'),
_('A problem as been detected in your database. '
'This is probably caused by opening a database that was '
'created with one transaction setting when the database was '
'created with another, or by moving a non-portable database '
'to a different machine.'))
#-------------------------------------------------------------------------
#
@ -756,3 +772,4 @@ if __name__ == "__main__":
unittest.main()

View File

@ -79,7 +79,7 @@ class ErrorReportAssistant:
GrampsDisplay.url('mailto:gramps-bugs@lists.sourceforge.net?subject="bug report"&body="%s"' \
% self._final_report_text_buffer.get_text(
self._final_report_text_buffer.get_start_iter(),
self._final_report_text_buffer.get_end_iter()))
self._final_report_text_buffer.get_end_iter())))
def _get_sys_information(self):
if hasattr(os, "uname"):

View File

@ -275,3 +275,4 @@ class MessageHideDialog:
def update_checkbox(self, obj, constant):
Config.set(constant, obj.get_active())
Config.sync()