From 10b30bf57e727e6a0aebedb4f704c759544084be Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Sat, 21 Aug 2004 04:05:51 +0000 Subject: [PATCH] * src/data/gramps.schemas: Add /apps/gramps/interface/size-checked key. * src/GrampsCfg.py (get_screen_size_checked, save_screen_size_checked): Add functions. * src/gramps_main.py: Enable sidebar depending on the screen if the screen size has not been checked yet. svn: r3458 --- src/GrampsCfg.py | 6 ++++++ src/data/gramps.schemas | 15 +++++++++++++++ src/gramps_main.py | 5 +++++ 3 files changed, 26 insertions(+) diff --git a/src/GrampsCfg.py b/src/GrampsCfg.py index 960565ca4..61fbac5ad 100644 --- a/src/GrampsCfg.py +++ b/src/GrampsCfg.py @@ -208,6 +208,12 @@ def get_startup(): def save_startup(val): set_int("/apps/gramps/behavior/startup",val,(0,1)) +def get_screen_size_checked(): + return get_bool("/apps/gramps/interface/size-checked") + +def save_screen_size_checked(val): + set_bool("/apps/gramps/interface/size-checked",val) + def get_autoload(): return get_bool("/apps/gramps/behavior/autoload") diff --git a/src/data/gramps.schemas b/src/data/gramps.schemas index 0d885895f..a54c3bcb1 100644 --- a/src/data/gramps.schemas +++ b/src/data/gramps.schemas @@ -434,6 +434,21 @@ + + /schemas/apps/gramps/interface/size-checked + /apps/gramps/interface/size-checked + gramps + bool + 0 + + Screen size has been checked + If set to 1, this key indicates that the screen size + has already been checked and the initial interface decision + made. No action will be taken if the screen is too smal, + since the user may have overridden our settings. + + + /schemas/apps/gramps/interface/statusbar /apps/gramps/interface/statusbar diff --git a/src/gramps_main.py b/src/gramps_main.py index 4163006b8..7d3721f1f 100755 --- a/src/gramps_main.py +++ b/src/gramps_main.py @@ -387,6 +387,11 @@ class Gramps: self.enable_filter(GrampsCfg.get_filter()) self.toolbar_btn.set_active(GrampsCfg.get_toolbar_on()) self.enable_toolbar(GrampsCfg.get_toolbar_on()) + + if not GrampsCfg.get_screen_size_checked(): + GrampsCfg.save_screen_size_checked(1) + if gtk.gdk.screen_width() <= 900: + GrampsCfg.save_view(0) self.sidebar_btn.set_active(GrampsCfg.get_view()) self.enable_sidebar(GrampsCfg.get_view())