Allow column sorting

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

View File

@ -7,6 +7,8 @@
Properly add icon list.
* src/Selectors/_BaseSelector.py (BaseSelector.add_columns): Allow
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>
* src/DataViews/_PersonView.py: import QuestionDialog

View File

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

View File

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