From 6280e9f4457d82ead4682d81dc937511a0f927bb Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Fri, 30 May 2003 00:27:59 +0000 Subject: [PATCH] Sort list models correctly, C-Q short cut svn: r1605 --- gramps2/src/ListModel.py | 6 ++++++ gramps2/src/gramps.glade | 37 +++++++++++++++++++------------------ 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/gramps2/src/ListModel.py b/gramps2/src/ListModel.py index 54a359f50..087904a0a 100644 --- a/gramps2/src/ListModel.py +++ b/gramps2/src/ListModel.py @@ -33,12 +33,14 @@ class ListModel: self.mylist = [TYPE_STRING]*l + [TYPE_PYOBJECT] self.tree.set_rules_hint(gtk.TRUE) + self.model = None self.new_model() self.selection = self.tree.get_selection() self.selection.set_mode(mode) self.mode = mode self.data_index = l self.count = 0 + self.cid = None self.cids = [] cnum = 0 @@ -78,11 +80,15 @@ class ListModel: self.tree.set_reorderable(order) def new_model(self): + if self.model: + self.cid = self.model.get_sort_column_id() self.count = 0 self.model = gtk.ListStore(*self.mylist) def connect_model(self): self.tree.set_model(self.model) + if self.cid: + self.model.set_sort_column_id(self.cid[0],self.cid[1]) self.sort() def sort(self): diff --git a/gramps2/src/gramps.glade b/gramps2/src/gramps.glade index 992a2a666..2c665d4dd 100644 --- a/gramps2/src/gramps.glade +++ b/gramps2/src/gramps.glade @@ -51,7 +51,7 @@ - + True gtk-new 1 @@ -73,7 +73,7 @@ - + True gtk-open 1 @@ -95,7 +95,7 @@ - + True gtk-save 1 @@ -116,7 +116,7 @@ - + True gtk-save-as 1 @@ -150,7 +150,7 @@ True - + True gtk-convert 1 @@ -171,7 +171,7 @@ - + True gtk-revert-to-saved 1 @@ -192,7 +192,7 @@ - + True gtk-refresh 1 @@ -217,9 +217,10 @@ _Quit True + - + True gtk-quit 1 @@ -254,7 +255,7 @@ - + True gtk-find 1 @@ -275,7 +276,7 @@ - + True gtk-convert 1 @@ -343,7 +344,7 @@ - + True gtk-index 1 @@ -365,7 +366,7 @@ - + True gnome-stock-book-open 1 @@ -429,7 +430,7 @@ - + True gtk-preferences 1 @@ -450,7 +451,7 @@ - + True gtk-home 1 @@ -484,7 +485,7 @@ - + True gtk-help 1 @@ -511,7 +512,7 @@ - + True gtk-jump-to 1 @@ -532,7 +533,7 @@ - + True gnome-stock-mail 1 @@ -586,7 +587,7 @@ - + True gnome-stock-about 1