* 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
This commit is contained in:
parent
b14596a0a6
commit
e818e09ac0
@ -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")
|
||||
|
||||
|
@ -434,6 +434,21 @@
|
||||
</locale>
|
||||
</schema>
|
||||
|
||||
<schema>
|
||||
<key>/schemas/apps/gramps/interface/size-checked</key>
|
||||
<applyto>/apps/gramps/interface/size-checked</applyto>
|
||||
<owner>gramps</owner>
|
||||
<type>bool</type>
|
||||
<default>0</default>
|
||||
<locale name="C">
|
||||
<short>Screen size has been checked</short>
|
||||
<long>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.</long>
|
||||
</locale>
|
||||
</schema>
|
||||
|
||||
<schema>
|
||||
<key>/schemas/apps/gramps/interface/statusbar</key>
|
||||
<applyto>/apps/gramps/interface/statusbar</applyto>
|
||||
|
@ -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())
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user