svn: r2271
This commit is contained in:
Don Allingham 2003-10-21 03:07:19 +00:00
parent 73fcaec440
commit 329a660098
2 changed files with 14 additions and 3 deletions

View File

@ -65,8 +65,6 @@ class ListModel:
if name[0] != '': if name[0] != '':
self.tree.append_column(column) self.tree.append_column(column)
if self.cids[0] != -1:
self.model.set_sort_column_id(self.cids[0],gtk.SORT_ASCENDING)
self.connect_model() self.connect_model()
if select_func: if select_func:
@ -97,7 +95,12 @@ class ListModel:
self.tree.set_model(self.model) self.tree.set_model(self.model)
if self.sel_iter: if self.sel_iter:
self.selection.select_iter(self.sel_iter) self.selection.select_iter(self.sel_iter)
if self.cid:
# if the sort column has not been defined (val[0] == -2), set
# the sort column to the first column
val = self.model.get_sort_column_id()
if val[0] == -2 and self.cid:
self.model.set_sort_column_id(self.cid[0],self.cid[1]) self.model.set_sort_column_id(self.cid[0],self.cid[1])
self.sort() self.sort()

View File

@ -2728,6 +2728,14 @@ class GrampsDB(Persistent):
self.placeTable[val] = place.getDisplayInfo() self.placeTable[val] = place.getDisplayInfo()
return place return place
def sortbyplace(self,f,s):
return cmp(self.placeTable[f][7],self.placeTable[s][7])
def sortPlaceKeys(self):
keys = self.placeTable.keys()
keys.sort(self.sortbyplace)
return keys
def getPlaceKeys(self): def getPlaceKeys(self):
return self.placeTable.keys() return self.placeTable.keys()