* src/gramps_main.py: apply the filter after a load of the database,

allow default view to be set
* src/GrampsCfg.py: handle the defaultview key to allow the user to
choose Family or People view as the default
* src/preferences.glade: defaultview settings


svn: r1993
This commit is contained in:
Don Allingham 2003-08-12 03:01:17 +00:00
parent 526803a8bd
commit 12ff47c896
3 changed files with 97 additions and 7 deletions

View File

@ -145,6 +145,7 @@ mediaref = 1
globalprop = 1
localprop = 1
capitalize = 0
defaultview = 0
#-------------------------------------------------------------------------
#
@ -212,6 +213,7 @@ def loadConfig(call):
global globalprop
global localprop
global capitalize
global defaultview
_callback = call
lastfile = get_string("/apps/gramps/last-file")
@ -229,6 +231,7 @@ def loadConfig(call):
index_visible = get_bool("/apps/gramps/index-visible")
status_bar = get_int("/apps/gramps/statusbar")
toolbar = get_int("/apps/gramps/toolbar",2)
defaultview = get_int("/apps/gramps/defaultview")
autoload = get_bool("/apps/gramps/autoload",0)
autosave_int = get_int("/apps/gramps/auto-save-interval")
@ -599,6 +602,11 @@ class GrampsPreferences:
else:
self.top.get_widget("tool3").set_active(1)
if defaultview == 0:
self.top.get_widget('pvbutton').set_active(1)
else:
self.top.get_widget('fvbutton').set_active(1)
paper_obj = self.top.get_widget("paper_size")
menu = gtk.Menu()
choice = 0
@ -803,6 +811,7 @@ class GrampsPreferences:
global index_visible
global status_bar
global toolbar
global defaultview
global paper_preference
global output_preference
global goutput_preference
@ -846,6 +855,11 @@ class GrampsPreferences:
else:
toolbar = 2
if self.top.get_widget("pvbutton").get_active():
defaultview = 0
else:
defaultview = 1
iprefix = self.top.get_widget("iprefix").get_text()
if iprefix == "":
iprefix = "I"
@ -892,6 +906,7 @@ class GrampsPreferences:
set_bool("/apps/gramps/index-visible",index_visible)
set_int("/apps/gramps/statusbar",status_bar)
set_int("/apps/gramps/toolbar",toolbar+1)
set_int("/apps/gramps/defaultview",defaultview)
set_string("/apps/gramps/paper-preference",paper_preference)
set_string("/apps/gramps/output-preference",output_preference)
set_string("/apps/gramps/goutput-preference",goutput_preference)

View File

@ -438,6 +438,11 @@ class Gramps:
self.find_person = None
self.find_source = None
self.find_media = None
if GrampsCfg.defaultview == 0:
self.views.set_current_page(0)
else:
self.views.set_current_page(1)
self.topWindow.show()
def change_alpha_page(self,obj,junk,page):
@ -959,6 +964,7 @@ class Gramps:
else:
GrampsCfg.save_last_file("")
self.topWindow.set_resizable(gtk.TRUE)
self.apply_filter()
self.goto_active_person(1)
def cl_import(self,filename,format):

View File

@ -967,8 +967,8 @@
<widget class="GtkTable" id="table16">
<property name="border_width">12</property>
<property name="visible">True</property>
<property name="n_rows">3</property>
<property name="n_columns">3</property>
<property name="n_rows">6</property>
<property name="n_columns">2</property>
<property name="homogeneous">False</property>
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
@ -989,8 +989,8 @@
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
@ -1012,8 +1012,8 @@
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="top_attach">5</property>
<property name="bottom_attach">6</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
@ -1035,13 +1035,82 @@
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">3</property>
<property name="right_attach">2</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label138">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Default view&lt;/b&gt;</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">2</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkRadioButton" id="pvbutton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Person view</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_object_toggled" last_modification_time="Tue, 12 Aug 2003 02:50:14 GMT"/>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkRadioButton" id="fvbutton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Family view</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
<property name="group">pvbutton</property>
<signal name="toggled" handler="on_object_toggled" last_modification_time="Tue, 12 Aug 2003 02:50:30 GMT"/>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>