* src/GrampsBSDDB.py (remove_object): Use correct key for transaction.
* src/ImageSelect.py (add_thumbnail, on_delete_media_clicked): Identify canvas items by MediaRef instance, not by the handle of the referred MediaObject. svn: r4641
This commit is contained in:
parent
09d5280dcd
commit
56ba9fc788
@ -1,5 +1,9 @@
|
||||
2005-05-20 Alex Roitman <shura@gramps-project.org>
|
||||
* src/SelectObject.py (on_select_row): Properly get mime type.
|
||||
* src/GrampsBSDDB.py (remove_object): Use correct key for transaction.
|
||||
* src/ImageSelect.py (add_thumbnail, on_delete_media_clicked):
|
||||
Identify canvas items by MediaRef instance, not by the handle of the
|
||||
referred MediaObject.
|
||||
|
||||
2005-05-19 Don Allingham <don@gramps-project.org>
|
||||
* src/DisplayModels.py: remove place column
|
||||
|
@ -318,7 +318,7 @@ class GrampsBSDDB(GrampsDbBase):
|
||||
if not self.readonly and handle and str(handle) in self.media_map:
|
||||
if transaction != None:
|
||||
old_data = self.media_map.get(handle)
|
||||
transaction.add(PLACE_KEY,handle,old_data)
|
||||
transaction.add(MEDIA_KEY,handle,old_data)
|
||||
self.emit('media-delete',([handle],))
|
||||
self.media_map.delete(str(handle))
|
||||
|
||||
|
@ -368,18 +368,17 @@ class Gallery(ImageSelect):
|
||||
def add_thumbnail(self, photo):
|
||||
"""Scale the image and add it to the IconList."""
|
||||
oid = photo.get_reference_handle()
|
||||
obj = self.db.get_object_from_handle(oid)
|
||||
if self.canvas_list.has_key(oid):
|
||||
(grp,item,text,x,y) = self.canvas_list[oid]
|
||||
media_obj = self.db.get_object_from_handle(oid)
|
||||
if self.canvas_list.has_key(photo):
|
||||
(grp,item,text,x,y) = self.canvas_list[photo]
|
||||
if x != self.cx or y != self.cy:
|
||||
grp.move(self.cx-x,self.cy-y)
|
||||
else:
|
||||
description = obj.get_description()
|
||||
description = media_obj.get_description()
|
||||
if len(description) > 20:
|
||||
description = "%s..." % description[0:20]
|
||||
|
||||
try:
|
||||
media_obj = self.db.get_object_from_handle(oid)
|
||||
mtype = media_obj.get_mime_type()
|
||||
if mtype and mtype.startswith("image"):
|
||||
image = ImgManip.get_thumbnail_image(media_obj.get_path())
|
||||
@ -424,7 +423,7 @@ class Gallery(ImageSelect):
|
||||
self.p_map[i] = (item,text,box,photo,oid)
|
||||
i.show()
|
||||
|
||||
self.canvas_list[oid] = (grp,item,text,self.cx,self.cy)
|
||||
self.canvas_list[photo] = (grp,item,text,self.cx,self.cy)
|
||||
|
||||
self.cx += _PAD + _IMAGEX
|
||||
|
||||
@ -582,7 +581,7 @@ class Gallery(ImageSelect):
|
||||
|
||||
if self.sel:
|
||||
(i,t,b,photo,oid) = self.p_map[self.sel]
|
||||
val = self.canvas_list[photo.get_reference_handle()]
|
||||
val = self.canvas_list[photo]
|
||||
val[0].hide()
|
||||
val[1].hide()
|
||||
val[2].hide()
|
||||
|
Loading…
Reference in New Issue
Block a user