diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 0e8cc9887..6a744def2 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,4 +1,6 @@ 2005-05-16 Don Allingham + * src/PlaceView.py: select correct column for sorting + * src/SourceView.py: select correct column for sorting * src/WriteGedcom.py: used 'replace' mode on iso-8859-1 string encoding conversion diff --git a/gramps2/src/PlaceView.py b/gramps2/src/PlaceView.py index 8943566af..5b36b68fa 100644 --- a/gramps2/src/PlaceView.py +++ b/gramps2/src/PlaceView.py @@ -101,13 +101,16 @@ class PlaceView: self.model = DisplayModels.PlaceModel(self.parent.db, self.sort_col,order) self.list.set_model(self.model) + + colmap = self.parent.db.get_place_column_order() + if handle: path = self.model.on_get_path(handle) self.selection.select_path(path) self.list.scroll_to_cell(path,None,1,0.5,0) for i in range(0,len(self.columns)): - self.columns[i].set_sort_indicator(i==data) - self.columns[data].set_sort_order(order) + self.columns[i].set_sort_indicator(i==colmap[data][1]-1) + self.columns[self.sort_col].set_sort_order(order) def build_columns(self): for column in self.columns: @@ -121,6 +124,7 @@ class PlaceView: self.list.append_column(column) self.columns = [column] + index = 1 for pair in self.parent.db.get_place_column_order(): if not pair[0]: continue @@ -129,7 +133,8 @@ class PlaceView: column.set_resizable(True) column.set_min_width(75) column.set_clickable(True) - column.connect('clicked',self.column_clicked,pair[1]) + column.connect('clicked',self.column_clicked,index) + index += 1 self.columns.append(column) self.list.append_column(column) diff --git a/gramps2/src/SourceView.py b/gramps2/src/SourceView.py index 6590656e7..03c32af65 100644 --- a/gramps2/src/SourceView.py +++ b/gramps2/src/SourceView.py @@ -99,13 +99,15 @@ class SourceView: self.model = DisplayModels.SourceModel(self.parent.db, self.sort_col,order) self.list.set_model(self.model) + colmap = self.parent.db.get_place_column_order() + if handle: path = self.model.on_get_path(handle) self.selection.select_path(path) self.list.scroll_to_cell(path,None,1,0.5,0) for i in range(0,len(self.columns)): - self.columns[i].set_sort_indicator(i==data) - self.columns[data].set_sort_order(order) + self.columns[i].set_sort_indicator(i==colmap[data][1]-1) + self.columns[self.sort_col].set_sort_order(order) def build_columns(self): for column in self.columns: @@ -125,7 +127,7 @@ class SourceView: continue name = column_names[pair[1]] column = gtk.TreeViewColumn(name, self.renderer, text=pair[1]) - column.connect('clicked',self.column_clicked,pair[1]) + column.connect('clicked',self.column_clicked,index) column.set_resizable(True) column.set_min_width(75) column.set_clickable(True)