From b147e4e72fd3d7c8e0f016593d4ae38d1e793713 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Fri, 27 Aug 2004 03:41:57 +0000 Subject: [PATCH] * src/DisplayModels.py: fix place and source lists * src/PlaceView.py: fix place lists * src/SourceView.py: fix source lists svn: r3515 --- ChangeLog | 3 +++ src/DisplayModels.py | 15 ++++++++++++++- src/ImageSelect.py | 2 +- src/PlaceView.py | 7 ++++--- src/SourceView.py | 3 ++- 5 files changed, 24 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index e385a3443..9a0dd1ee7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,7 @@ 2004-08-26 Don Allingham + * src/DisplayModels.py: fix place and source lists + * src/PlaceView.py: fix place lists + * src/SourceView.py: fix source lists * src/Sort.py: use locale.strcoll for sorting * src/RelLib.py: don't use accent for sort name * src/EditPerson.py: compare edited ID value properly diff --git a/src/DisplayModels.py b/src/DisplayModels.py index a8d626ef1..dc73d5595 100644 --- a/src/DisplayModels.py +++ b/src/DisplayModels.py @@ -64,7 +64,7 @@ class BaseModel(gtk.GenericTreeModel): return gtk.TREE_MODEL_LIST_ONLY | gtk.TREE_MODEL_ITERS_PERSIST def on_get_n_columns(self): - return 10 + return 1 def on_get_path(self, node): '''returns the tree path (a tuple of indices at the various @@ -136,12 +136,19 @@ class SourceModel(BaseModel): self.column_abbrev, self.column_pubinfo, self.column_change, + self.column_handle, ] BaseModel.__init__(self,db) + def on_get_n_columns(self): + return len(self.fmap)+1 + def column_title(self,data): return unicode(data[2]) + def column_handle(self,data): + return unicode(data[0]) + def column_author(self,data): return unicode(data[3]) @@ -182,6 +189,9 @@ class PlaceModel(BaseModel): ] BaseModel.__init__(self,db) + def on_get_n_columns(self): + return len(self.fmap)+1 + def column_handle(self,data): return unicode(data[0]) @@ -251,6 +261,9 @@ class MediaModel(BaseModel): ] BaseModel.__init__(self,db) + def on_get_n_columns(self): + return len(self.fmap)+1 + def column_description(self,data): return unicode(data[4]) diff --git a/src/ImageSelect.py b/src/ImageSelect.py index 218bc06f9..0c0b659b7 100644 --- a/src/ImageSelect.py +++ b/src/ImageSelect.py @@ -240,7 +240,7 @@ class Gallery(ImageSelect): self.iconlist = icon_list; self.root = self.iconlist.root() self.old_media_list = [RelLib.MediaRef(ref) for ref in dataobj.get_media_list()] - + # Local object variables self.y = 0 self.remember_x = -1 diff --git a/src/PlaceView.py b/src/PlaceView.py index b1a3f7450..5af9ab9fe 100644 --- a/src/PlaceView.py +++ b/src/PlaceView.py @@ -127,7 +127,9 @@ class PlaceView: mlist = [] self.selection.selected_foreach(self.blist,mlist) if mlist: - EditPlace.EditPlace(self.parent,mlist[0],self.update_display,self.topWindow) + place = self.parent.db.get_place_from_handle(mlist[0]) + EditPlace.EditPlace(self.parent,place,self.update_display, + self.topWindow) return 1 elif event.type == gtk.gdk.BUTTON_PRESS and event.button == 3: self.build_context_menu(event) @@ -238,8 +240,7 @@ class PlaceView: EditPlace.EditPlace(self.parent, place, self.update_display) def blist(self,store,path,iter,list): - print iter, _HANDLE_COL - handle = self.parent.db.get_place_from_handle(store.get_value(iter,_HANDLE_COL)) + handle = store.get_value(iter,_HANDLE_COL) list.append(handle) def merge(self): diff --git a/src/SourceView.py b/src/SourceView.py index 432be3ba8..fc1340c30 100644 --- a/src/SourceView.py +++ b/src/SourceView.py @@ -42,7 +42,7 @@ import const from QuestionDialog import QuestionDialog -_HANDLE_COL = 5 +_HANDLE_COL = 7 #------------------------------------------------------------------------- # @@ -241,6 +241,7 @@ class SourceView: list_store, node = self.selection.get_selected() if node: handle = list_store.get_value(node,_HANDLE_COL) + print handle source = self.parent.db.get_source_from_handle(handle) EditSource.EditSource(source, self.parent.db, self.parent, self.topWindow, self.update_display)