* src/DisplayModels.py: fix place and source lists

* src/PlaceView.py: fix place lists
* src/SourceView.py: fix source lists


svn: r3515
This commit is contained in:
Don Allingham 2004-08-27 03:41:57 +00:00
parent 1dc536fd60
commit 2be6aaa660
5 changed files with 24 additions and 6 deletions

View File

@ -1,4 +1,7 @@
2004-08-26 Don Allingham <dallingham@users.sourceforge.net> 2004-08-26 Don Allingham <dallingham@users.sourceforge.net>
* 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/Sort.py: use locale.strcoll for sorting
* src/RelLib.py: don't use accent for sort name * src/RelLib.py: don't use accent for sort name
* src/EditPerson.py: compare edited ID value properly * src/EditPerson.py: compare edited ID value properly

View File

@ -64,7 +64,7 @@ class BaseModel(gtk.GenericTreeModel):
return gtk.TREE_MODEL_LIST_ONLY | gtk.TREE_MODEL_ITERS_PERSIST return gtk.TREE_MODEL_LIST_ONLY | gtk.TREE_MODEL_ITERS_PERSIST
def on_get_n_columns(self): def on_get_n_columns(self):
return 10 return 1
def on_get_path(self, node): def on_get_path(self, node):
'''returns the tree path (a tuple of indices at the various '''returns the tree path (a tuple of indices at the various
@ -136,12 +136,19 @@ class SourceModel(BaseModel):
self.column_abbrev, self.column_abbrev,
self.column_pubinfo, self.column_pubinfo,
self.column_change, self.column_change,
self.column_handle,
] ]
BaseModel.__init__(self,db) BaseModel.__init__(self,db)
def on_get_n_columns(self):
return len(self.fmap)+1
def column_title(self,data): def column_title(self,data):
return unicode(data[2]) return unicode(data[2])
def column_handle(self,data):
return unicode(data[0])
def column_author(self,data): def column_author(self,data):
return unicode(data[3]) return unicode(data[3])
@ -182,6 +189,9 @@ class PlaceModel(BaseModel):
] ]
BaseModel.__init__(self,db) BaseModel.__init__(self,db)
def on_get_n_columns(self):
return len(self.fmap)+1
def column_handle(self,data): def column_handle(self,data):
return unicode(data[0]) return unicode(data[0])
@ -251,6 +261,9 @@ class MediaModel(BaseModel):
] ]
BaseModel.__init__(self,db) BaseModel.__init__(self,db)
def on_get_n_columns(self):
return len(self.fmap)+1
def column_description(self,data): def column_description(self,data):
return unicode(data[4]) return unicode(data[4])

View File

@ -127,7 +127,9 @@ class PlaceView:
mlist = [] mlist = []
self.selection.selected_foreach(self.blist,mlist) self.selection.selected_foreach(self.blist,mlist)
if 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 return 1
elif event.type == gtk.gdk.BUTTON_PRESS and event.button == 3: elif event.type == gtk.gdk.BUTTON_PRESS and event.button == 3:
self.build_context_menu(event) self.build_context_menu(event)
@ -238,8 +240,7 @@ class PlaceView:
EditPlace.EditPlace(self.parent, place, self.update_display) EditPlace.EditPlace(self.parent, place, self.update_display)
def blist(self,store,path,iter,list): def blist(self,store,path,iter,list):
print iter, _HANDLE_COL handle = store.get_value(iter,_HANDLE_COL)
handle = self.parent.db.get_place_from_handle(store.get_value(iter,_HANDLE_COL))
list.append(handle) list.append(handle)
def merge(self): def merge(self):

View File

@ -42,7 +42,7 @@ import const
from QuestionDialog import QuestionDialog from QuestionDialog import QuestionDialog
_HANDLE_COL = 5 _HANDLE_COL = 7
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@ -241,6 +241,7 @@ class SourceView:
list_store, node = self.selection.get_selected() list_store, node = self.selection.get_selected()
if node: if node:
handle = list_store.get_value(node,_HANDLE_COL) handle = list_store.get_value(node,_HANDLE_COL)
print handle
source = self.parent.db.get_source_from_handle(handle) source = self.parent.db.get_source_from_handle(handle)
EditSource.EditSource(source, self.parent.db, self.parent, EditSource.EditSource(source, self.parent.db, self.parent,
self.topWindow, self.update_display) self.topWindow, self.update_display)