Detection of need to rerun startup

svn: r739
This commit is contained in:
Don Allingham 2002-01-31 05:53:19 +00:00
parent bcc4f65f61
commit a9798041c5
3 changed files with 17 additions and 5 deletions

View File

@ -23,6 +23,14 @@ import libglade
import gnome.config import gnome.config
import utils import utils
def need_to_run():
if gnome.config.get_string("/gramps/config/startup") == None:
return 1
if gnome.config.get_int("/gramps/config/startup") < const.startup:
return 1
return 0
class StartupDialog: class StartupDialog:
def __init__(self,task,arg): def __init__(self,task,arg):
@ -65,9 +73,10 @@ class StartupDialog:
lds = self.druid.get_widget("enable_lds").get_active() lds = self.druid.get_widget("enable_lds").get_active()
gnome.config.set_int("/gramps/config/UseLDS",lds) gnome.config.set_int("/gramps/config/UseLDS",lds)
gnome.config.sync()
utils.destroy_passed_object(obj) utils.destroy_passed_object(obj)
self.task(self.arg)
def on_cancel_clicked(self,obj): def on_cancel_clicked(self,obj):
gnome.config.set_int("/gramps/config/startup",const.startup)
gnome.config.sync()
utils.destroy_passed_object(obj) utils.destroy_passed_object(obj)

View File

@ -79,6 +79,8 @@ filtersDir = "%s/filters" % rootDir
dataDir = "%s/data" % rootDir dataDir = "%s/data" % rootDir
gtkrcFile = "%s/gtkrc" % rootDir gtkrcFile = "%s/gtkrc" % rootDir
startup = 1
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# About box information # About box information

View File

@ -28,9 +28,10 @@ else:
arg = None arg = None
try: try:
if gnome.config.get_string("/gramps/researcher/name") == None: import StartupDialog
from StartupDialog import StartupDialog
StartupDialog(gramps_main.main,arg) if StartupDialog.need_to_run():
StartupDialog.StartupDialog(gramps_main.main,arg)
else: else:
gramps_main.main(arg) gramps_main.main(arg)
except: except: