From a9798041c53722dca14d6e519690e60817ff6a57 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Thu, 31 Jan 2002 05:53:19 +0000 Subject: [PATCH] Detection of need to rerun startup svn: r739 --- src/StartupDialog.py | 13 +++++++++++-- src/const.py | 2 ++ src/gramps.py | 7 ++++--- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/StartupDialog.py b/src/StartupDialog.py index 1c56b1fe6..4bd927feb 100644 --- a/src/StartupDialog.py +++ b/src/StartupDialog.py @@ -23,6 +23,14 @@ import libglade import gnome.config 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: def __init__(self,task,arg): @@ -65,9 +73,10 @@ class StartupDialog: lds = self.druid.get_widget("enable_lds").get_active() gnome.config.set_int("/gramps/config/UseLDS",lds) - + gnome.config.sync() utils.destroy_passed_object(obj) - self.task(self.arg) def on_cancel_clicked(self,obj): + gnome.config.set_int("/gramps/config/startup",const.startup) + gnome.config.sync() utils.destroy_passed_object(obj) diff --git a/src/const.py b/src/const.py index fed557c6b..f86abed12 100644 --- a/src/const.py +++ b/src/const.py @@ -79,6 +79,8 @@ filtersDir = "%s/filters" % rootDir dataDir = "%s/data" % rootDir gtkrcFile = "%s/gtkrc" % rootDir +startup = 1 + #------------------------------------------------------------------------- # # About box information diff --git a/src/gramps.py b/src/gramps.py index 454814b32..7446bc758 100755 --- a/src/gramps.py +++ b/src/gramps.py @@ -28,9 +28,10 @@ else: arg = None try: - if gnome.config.get_string("/gramps/researcher/name") == None: - from StartupDialog import StartupDialog - StartupDialog(gramps_main.main,arg) + import StartupDialog + + if StartupDialog.need_to_run(): + StartupDialog.StartupDialog(gramps_main.main,arg) else: gramps_main.main(arg) except: