Allow column sorting

svn: r6944
This commit is contained in:
Alex Roitman 2006-06-22 00:09:20 +00:00
parent a5a4eed7fc
commit 0b6f8f5e45
3 changed files with 10 additions and 3 deletions

View File

@ -7,6 +7,8 @@
Properly add icon list. Properly add icon list.
* src/Selectors/_BaseSelector.py (BaseSelector.add_columns): Allow * src/Selectors/_BaseSelector.py (BaseSelector.add_columns): Allow
resize-able columns. resize-able columns.
* src/plugins/DumpGenderStats.py: Allow column sorting.
* src/ListModel.py: Allow column sorting.
2006-06-21 Don Allingham <don@gramps-project.org> 2006-06-21 Don Allingham <don@gramps-project.org>
* src/DataViews/_PersonView.py: import QuestionDialog * src/DataViews/_PersonView.py: import QuestionDialog

View File

@ -28,6 +28,7 @@ TEXT = 0
TOGGLE = 1 TOGGLE = 1
COMBO = 2 COMBO = 2
IMAGE = 3 IMAGE = 3
INTEGER = 4
NOSORT = -1 NOSORT = -1
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
@ -49,6 +50,8 @@ class ListModel:
self.mylist.append(bool) self.mylist.append(bool)
elif l[3] == IMAGE: elif l[3] == IMAGE:
self.mylist.append(gtk.gdk.Pixbuf) self.mylist.append(gtk.gdk.Pixbuf)
elif l[3] == INTEGER:
self.mylist.append(int)
else: else:
self.mylist.append(str) self.mylist.append(str)
self.data_index += 1 self.data_index += 1

View File

@ -52,9 +52,11 @@ class DumpGenderStats(Tool.Tool, ManagedWindow.ManagedWindow):
if uistate: if uistate:
titles = [ titles = [
(_('Name'),1,100), (_('Male'),2,70), (_('Name'),0,100),
(_('Female'),3,70), (_('Unknown'),4,70), (_('Male'),1,70,ListModel.INTEGER),
(_('Guess'),5,70) (_('Female'),2,70,ListModel.INTEGER),
(_('Unknown'),3,70,ListModel.INTEGER),
(_('Guess'),4,70)
] ]
treeview = gtk.TreeView() treeview = gtk.TreeView()