* src/GrampsGconfKeys.py (get_bool,get_int,get_string): Raise exception when default value could not be get from gconf schema

* src/const.py.in: Add custom exception "ErrorSchemaInvalid"
* src/GrampsMime.py (mime_type_is_defined): New method that returns True/False
* src/gramps_main.py (__init__) Catch "ErrorSchemaInvalid" exception and check for installed MIME-type. Show error because installation is incomplete.


svn: r4200
This commit is contained in:
Martin Hawlisch
2005-03-17 19:28:00 +00:00
parent d105ef6be0
commit 3dfcf51269
5 changed files with 74 additions and 19 deletions

View File

@ -77,6 +77,8 @@ import RelImage
import RecentFiles
import NameDisplay
from GrampsMime import mime_type_is_defined
from QuestionDialog import *
from bsddb import db
@ -131,21 +133,39 @@ class Gramps:
self.db = GrampsBSDDB.GrampsBSDDB()
GrampsCfg.loadConfig()
if GrampsKeys.get_betawarn() == 0:
WarningDialog(_("Use at your own risk"),
_("This is an unstable development version of GRAMPS. "
"It is intended as a technology preview. Do not trust your "
"family database to this development version. This version may "
"contain bugs which could corrupt your database."))
GrampsKeys.save_betawarn(1)
GrampsKeys.sync()
self.RelClass = PluginMgr.relationship_class
self.relationship = self.RelClass(self.db)
self.gtop = gtk.glade.XML(const.gladeFile, "gramps", "gramps")
self.init_interface()
try:
GrampsCfg.loadConfig()
if GrampsKeys.get_betawarn() == 0:
WarningDialog(_("Use at your own risk"),
_("This is an unstable development version of GRAMPS. "
"It is intended as a technology preview. Do not trust your "
"family database to this development version. This version may "
"contain bugs which could corrupt your database."))
GrampsKeys.save_betawarn(1)
GrampsKeys.sync()
self.RelClass = PluginMgr.relationship_class
self.relationship = self.RelClass(self.db)
self.gtop = gtk.glade.XML(const.gladeFile, "gramps", "gramps")
self.init_interface()
except const.ErrorSchemaInvalid, val:
ErrorDialog(_("Configuration error"),
val + _("\n\nPossibly the installation of GRAMPS was incomplete."
" Make sure the GConf schema of GRAMPS is properly installed."))
gtk.main_quit()
return
if not mime_type_is_defined(const.app_gramps):
ErrorDialog(_("Configuration error"),
_("A definition for the MIME-type %s could not be found"
"\n\nPossibly the installation of GRAMPS was incomplete."
" Make sure the MIME-types of GRAMPS are properly installed.") % const.app_gramps)
gtk.main_quit()
return
ArgHandler.ArgHandler(self,args)