Sort by gender

svn: r544
This commit is contained in:
Don Allingham 2001-11-04 02:59:16 +00:00
parent 24b0a0a4c7
commit 625059bf44
2 changed files with 72 additions and 11 deletions

View File

@ -978,10 +978,40 @@
</widget> </widget>
</widget> </widget>
<widget>
<class>GtkHBox</class>
<child_name>CList:title</child_name>
<name>hbox67</name>
<homogeneous>True</homogeneous>
<spacing>0</spacing>
<widget>
<class>GtkHBox</class>
<child_name>CList:title</child_name>
<name>hbox68</name>
<homogeneous>True</homogeneous>
<spacing>0</spacing>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
<widget>
<class>GtkHBox</class>
<name>hbox69</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<child_name>CList:title</child_name> <child_name>CList:title</child_name>
<name>label5</name> <name>label292</name>
<label>Gender</label> <label>Gender</label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
@ -989,6 +1019,33 @@
<yalign>0.5</yalign> <yalign>0.5</yalign>
<xpad>0</xpad> <xpad>0</xpad>
<ypad>0</ypad> <ypad>0</ypad>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkArrow</class>
<name>genderSort</name>
<width>10</width>
<height>10</height>
<visible>False</visible>
<arrow_type>GTK_ARROW_DOWN</arrow_type>
<shadow_type>GTK_SHADOW_OUT</shadow_type>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<padding>5</padding>
<expand>False</expand>
<fill>True</fill>
</child>
</widget>
</widget>
</widget>
</widget> </widget>
<widget> <widget>

View File

@ -105,6 +105,7 @@ notebook = None
person_list = None person_list = None
database = None database = None
nameArrow = None nameArrow = None
genderArrow = None
idArrow = None idArrow = None
deathArrow = None deathArrow = None
dateArrow = None dateArrow = None
@ -733,6 +734,8 @@ def on_person_list_click_column(obj,column):
change_sort(5,nameArrow) change_sort(5,nameArrow)
elif column == 1: elif column == 1:
change_sort(1,idArrow) change_sort(1,idArrow)
elif column == 2:
change_sort(2,genderArrow)
elif column == 3: elif column == 3:
change_sort(6,dateArrow) change_sort(6,dateArrow)
elif column == 4: elif column == 4:
@ -754,7 +757,7 @@ def change_sort(column,arrow):
global sort_direct global sort_direct
global sort_column global sort_column
for a in [ nameArrow, deathArrow, dateArrow, idArrow ]: for a in [ nameArrow, genderArrow, deathArrow, dateArrow, idArrow ]:
if arrow != a: if arrow != a:
a.hide() a.hide()
arrow.show() arrow.show()
@ -1850,7 +1853,7 @@ def main(arg):
global statusbar,notebook global statusbar,notebook
global person_list global person_list
global topWindow, preview, merge_button global topWindow, preview, merge_button
global nameArrow, dateArrow, deathArrow, idArrow global nameArrow, dateArrow, deathArrow, idArrow, genderArrow
global cNameArrow, cDateArrow global cNameArrow, cDateArrow
rc_parse(const.gtkrcFile) rc_parse(const.gtkrcFile)
@ -1874,6 +1877,7 @@ def main(arg):
filter_list = gtop.get_widget("filter_list") filter_list = gtop.get_widget("filter_list")
notebook = gtop.get_widget(NOTEBOOK) notebook = gtop.get_widget(NOTEBOOK)
nameArrow = gtop.get_widget("nameSort") nameArrow = gtop.get_widget("nameSort")
genderArrow = gtop.get_widget("genderSort")
idArrow = gtop.get_widget("idSort") idArrow = gtop.get_widget("idSort")
dateArrow = gtop.get_widget("dateSort") dateArrow = gtop.get_widget("dateSort")
deathArrow = gtop.get_widget("deathSort") deathArrow = gtop.get_widget("deathSort")