Added alternating colors the child list, like in the person list.

Move the index number in the child list to the first column, and add
an item to the preferences so that the user can make it visible.


svn: r522
This commit is contained in:
David Hampton 2001-10-30 03:58:40 +00:00
parent b52194981a
commit 9c9514b9f9
4 changed files with 78 additions and 28 deletions

View File

@ -114,6 +114,7 @@ web_dir = "./"
db_dir = "./"
id_visible = 0
id_edit = 0
index_visible = 0
#-------------------------------------------------------------------------
#
@ -167,6 +168,7 @@ def loadConfig(call):
global uncompress
global id_visible
global id_edit
global index_visible
global show_detail
global hide_altnames
global lastfile
@ -191,6 +193,7 @@ def loadConfig(call):
uncompress = gnome.config.get_bool("/gramps/config/DontCompressXML")
id_visible = gnome.config.get_bool("/gramps/config/IdVisible")
id_edit = gnome.config.get_bool("/gramps/config/IdEdit")
index_visible = gnome.config.get_bool("/gramps/config/IndexVisible")
show_detail = gnome.config.get_bool("/gramps/config/ShowDetail")
status_bar = gnome.config.get_int("/gramps/config/StatusBar")
display_attr = gnome.config.get_bool("/gramps/config/DisplayAttr")
@ -286,6 +289,8 @@ def loadConfig(call):
id_visible = 0
if id_edit == None:
id_edit = 0
if index_visible == None:
index_visible = 0
if show_detail == None:
show_detail = 0
if status_bar == None:
@ -395,6 +400,7 @@ def on_propertybox_apply(obj,page):
global uncompress
global id_visible
global id_edit
global index_visible
global status_bar
global display_attr
global attr_name
@ -419,6 +425,7 @@ def on_propertybox_apply(obj,page):
uncompress = prefsTop.get_widget("uncompress").get_active()
id_visible = prefsTop.get_widget("gid_visible").get_active()
id_edit = prefsTop.get_widget("gid_edit").get_active()
index_visible = prefsTop.get_widget("show_child_id").get_active()
hide_altnames = prefsTop.get_widget("display_altnames").get_active()
paper_obj = prefsTop.get_widget("paper_size").get_menu().get_active()
output_obj = prefsTop.get_widget("output_format").get_menu().get_active()
@ -467,6 +474,7 @@ def on_propertybox_apply(obj,page):
gnome.config.set_bool("/gramps/config/DontCompressXML",uncompress)
gnome.config.set_bool("/gramps/config/IdVisible",id_visible)
gnome.config.set_bool("/gramps/config/IdEdit",id_edit)
gnome.config.set_bool("/gramps/config/IndexVisible",index_visible)
gnome.config.set_bool("/gramps/config/ShowDetail",show_detail)
gnome.config.set_int("/gramps/config/StatusBar",status_bar)
gnome.config.set_bool("/gramps/config/DisplayAttr",display_attr)
@ -618,6 +626,7 @@ def display_preferences_box(db):
auto = prefsTop.get_widget("autoload")
vis = prefsTop.get_widget("gid_visible")
idedit = prefsTop.get_widget("gid_edit")
index_vis = prefsTop.get_widget("show_child_id")
tabs = prefsTop.get_widget("usetabs")
vc = prefsTop.get_widget("use_vc")
vcom = prefsTop.get_widget("vc_comment")
@ -633,6 +642,7 @@ def display_preferences_box(db):
compress.set_active(uncompress)
vis.set_active(id_visible)
idedit.set_active(id_edit)
index_vis.set_active(index_visible)
prefsTop.get_widget("iprefix").set_text(iprefix)
prefsTop.get_widget("oprefix").set_text(oprefix)

View File

@ -1351,6 +1351,26 @@
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkCheckButton</class>
<name>show_child_id</name>
<can_focus>True</can_focus>
<signal>
<name>toggled</name>
<handler>on_object_toggled</handler>
<object>propertybox</object>
<last_modification_time>Mon, 29 Oct 2001 22:58:03 GMT</last_modification_time>
</signal>
<label>Show index numbers in child list</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
</widget>
</widget>
</widget>

View File

@ -1933,11 +1933,25 @@
<last_modification_time>Mon, 08 Oct 2001 20:31:41 GMT</last_modification_time>
</signal>
<columns>7</columns>
<column_widths>210,60,85,150,75,50,25</column_widths>
<column_widths>15,210,60,85,150,75,50</column_widths>
<selection_mode>GTK_SELECTION_SINGLE</selection_mode>
<show_titles>True</show_titles>
<shadow_type>GTK_SHADOW_IN</shadow_type>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>label15</name>
<sensitive>False</sensitive>
<label></label>
<justify>GTK_JUSTIFY_RIGHT</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
<widget>
<class>GtkHBox</class>
<child_name>CList:title</child_name>
@ -2102,19 +2116,6 @@
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>label15</name>
<label>Birth Order</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
</widget>
</widget>
</widget>

View File

@ -116,7 +116,11 @@ merge_button = None
sort_column = 5
sort_direct = SORT_ASCENDING
DataFilter = Filter.Filter("")
c_birth_order = 6
c_birth_order = 0
c_name = 1
c_id = 2
c_birth_date = 4
c_details = 6
c_sort_column = c_birth_order
c_sort_direct = SORT_ASCENDING
@ -433,8 +437,9 @@ def full_update():
person_list.clear()
notebook.set_show_tabs(Config.usetabs)
clist = gtop.get_widget("child_list")
clist.set_column_visibility(4,Config.show_detail)
clist.set_column_visibility(1,Config.id_visible)
clist.set_column_visibility(c_details,Config.show_detail)
clist.set_column_visibility(c_id,Config.id_visible)
clist.set_column_visibility(c_birth_order,Config.index_visible)
apply_filter()
load_family()
load_sources()
@ -1090,10 +1095,10 @@ def on_child_list_select_row(obj,row,b,c):
#
#-------------------------------------------------------------------------
def on_child_list_click_column(clist,column):
if column == 0:
child_change_sort(clist,0,gtop.get_widget("cNameSort"))
elif (column == 3) or (column == 6):
child_change_sort(clist,6,gtop.get_widget("cDateSort"))
if column == c_name:
child_change_sort(clist,c_name,gtop.get_widget("cNameSort"))
elif (column == c_birth_order) or (column == c_birth_date):
child_change_sort(clist,c_birth_order,gtop.get_widget("cDateSort"))
else:
return
@ -1133,6 +1138,21 @@ def child_change_sort(clist,column,arrow):
def sort_child_list(clist):
clist.freeze()
clist.sort()
if ListColors.get_enable():
try:
oddbg = GdkColor(ListColors.oddbg[0],ListColors.oddbg[1],ListColors.oddbg[2])
oddfg = GdkColor(ListColors.oddfg[0],ListColors.oddfg[1],ListColors.oddfg[2])
evenbg = GdkColor(ListColors.evenbg[0],ListColors.evenbg[1],ListColors.evenbg[2])
evenfg = GdkColor(ListColors.evenfg[0],ListColors.evenfg[1],ListColors.evenfg[2])
rows = clist.rows
for i in range(0,rows,2):
clist.set_background(i,oddbg)
clist.set_foreground(i,oddfg)
if i != rows:
clist.set_background(i+1,evenbg)
clist.set_foreground(i+1,evenfg)
except OverflowError:
pass
clist.thaw()
#-------------------------------------------------------------------------
@ -1197,7 +1217,7 @@ def on_child_list_row_move(clist,fm,to):
# Update the clist indices so any change of sorting works
i = 0
for tmp in clist_order:
clist.set_text(i, c_birth_order, "%2d"%new_order[tmp])
clist.set_text(i, c_birth_order, "%2d"%(new_order[tmp]+1))
i = i + 1
# Need to save the changed order
@ -1818,8 +1838,8 @@ def display_marriage(family):
if len(child.getPhotoList()) > 0:
attr = attr + "P"
clist.append([Config.nameof(child),child.getId(),\
gender,utils.birthday(child),status,attr,"%2d"%i])
clist.append(["%2d"%(i+1),Config.nameof(child),child.getId(),\
gender,utils.birthday(child),status,attr])
clist.set_row_data(i,child)
i=i+1
if i != 0:
@ -1828,7 +1848,7 @@ def display_marriage(family):
else:
fv_prev.set_sensitive(0)
clist.set_data("f",family)
clist.sort()
sort_child_list(clist)
else:
fv_prev.set_sensitive(0)
@ -2731,9 +2751,8 @@ def main(arg):
database.set_sprefix(Config.sprefix)
database.set_pprefix(Config.pprefix)
child_list = gtop.get_widget("child_list")
child_list.set_column_visibility(4,Config.show_detail)
child_list.set_column_visibility(6,0)
child_list.set_column_visibility(7,0)
child_list.set_column_visibility(c_details,Config.show_detail)
child_list.set_column_justification(c_birth_order,JUSTIFY_RIGHT)
if arg != None:
read_file(arg)