* src/gramps_main.py (read_file): Optimize exception handling of load_database errors.
* src/ArgHandler.py (auto_save_load): Return actual status of read_file instead of always 1. This will now open the select database dialog on autoload errors. svn: r4730
This commit is contained in:
parent
0cb7d90257
commit
01e6dedae9
@ -1,3 +1,10 @@
|
||||
2005-05-28 Martin Hawlisch <Martin.Hawlisch@gmx.de>
|
||||
* src/gramps_main.py (read_file): Optimize exception handling of
|
||||
load_database errors.
|
||||
* src/ArgHandler.py (auto_save_load): Return actual status of
|
||||
read_file instead of always 1. This will now open the select database
|
||||
dialog on autoload errors.
|
||||
|
||||
2005-05-28 Alex Roitman <shura@gramps-project.org>
|
||||
* configure.in: Bump up the version number after 2.0.1.
|
||||
|
||||
|
@ -228,20 +228,17 @@ class ArgHandler:
|
||||
import GrampsBSDDB
|
||||
self.parent.db.close()
|
||||
self.parent.db = GrampsBSDDB.GrampsBSDDB()
|
||||
self.parent.read_file(filename)
|
||||
return 1
|
||||
return self.parent.read_file(filename)
|
||||
elif filetype == const.app_gramps_xml:
|
||||
import GrampsXMLDB
|
||||
self.parent.db.close()
|
||||
self.parent.db = GrampsXMLDB.GrampsXMLDB()
|
||||
self.parent.read_file(filename)
|
||||
return 1
|
||||
return self.parent.read_file(filename)
|
||||
elif filetype == const.app_gedcom:
|
||||
import GrampsGEDDB
|
||||
self.parent.db.close()
|
||||
self.parent.db = GrampsGEDDB.GrampsGEDDB()
|
||||
self.parent.read_file(filename)
|
||||
return 1
|
||||
return self.parent.read_file(filename)
|
||||
else:
|
||||
return 0
|
||||
|
||||
|
@ -1294,13 +1294,13 @@ class Gramps(GrampsDBCallback.GrampsDBCallback):
|
||||
except ( IOError, OSError ), msg:
|
||||
ErrorDialog(_('Cannot open database'),str(msg))
|
||||
return 0
|
||||
except db.DBAccessError, msg:
|
||||
except (db.DBAccessError,db.DBError), msg:
|
||||
ErrorDialog(_('Cannot open database'),
|
||||
_('%s could not be opened.' % filename) + '\n' + msg[1])
|
||||
except (db.DBError), msg:
|
||||
ErrorDialog(_('Cannot open database'),
|
||||
_('%s could not be opened.' % filename) + '\n' + msg[1])
|
||||
gtk.main_quit()
|
||||
return 0
|
||||
except Exception:
|
||||
DisplayTrace.DisplayTrace()
|
||||
return 0
|
||||
|
||||
# Undo/Redo always start with standard labels and insensitive state
|
||||
self.undo_callback(None)
|
||||
|
Loading…
Reference in New Issue
Block a user