Fixed unintialized event in EventEditor, and fixe thumbnails for drag and drop

svn: r498
This commit is contained in:
Don Allingham 2001-10-20 00:54:46 +00:00
parent e3a3a6a654
commit 3928629410
3 changed files with 8 additions and 8 deletions

View File

@ -113,7 +113,6 @@ class EventEditor:
Sources.SourceSelector(self.srcreflist,self.parent,src_changed) Sources.SourceSelector(self.srcreflist,self.parent,src_changed)
def on_event_edit_ok_clicked(self,obj): def on_event_edit_ok_clicked(self,obj):
event = self.event
ename = self.name_field.get_text() ename = self.name_field.get_text()
edate = self.date_field.get_text() edate = self.date_field.get_text()
@ -124,10 +123,10 @@ class EventEditor:
edesc = self.descr_field.get_text() edesc = self.descr_field.get_text()
epriv = self.priv.get_active() epriv = self.priv.get_active()
if event == None: if self.event == None:
event = Event() self.event = Event()
event.setSourceRefList(self.srcreflist) self.event.setSourceRefList(self.srcreflist)
self.parent.elist.append(event) self.parent.elist.append(self.event)
if eplace_obj == None and eplace != "": if eplace_obj == None and eplace != "":
eplace_obj = Place() eplace_obj = Place()

View File

@ -134,6 +134,7 @@ class ImageSelect:
else: else:
if self.external.get_active() == 1: if self.external.get_active() == 1:
name = filename name = filename
RelImage.mk_thumb(filename,self.path,mobj.getId())
else: else:
name = RelImage.import_media_object(filename,self.path,mobj.getId()) name = RelImage.import_media_object(filename,self.path,mobj.getId())
@ -200,6 +201,8 @@ class Gallery(ImageSelect):
oref = ObjectRef() oref = ObjectRef()
oref.setReference(photo) oref.setReference(photo)
self.dataobj.addPhoto(oref) self.dataobj.addPhoto(oref)
dest = "%s/.thumb/%s.jpg" % (self.db.getSavePath(),photo.getId())
RelImage.mk_thumb(photo.getPath(),dest,const.thumbScale)
self.add_thumbnail(oref) self.add_thumbnail(oref)
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
@ -237,7 +240,6 @@ class Gallery(ImageSelect):
def on_photolist_drag_data_received(self,w, context, x, y, data, info, time): def on_photolist_drag_data_received(self,w, context, x, y, data, info, time):
import urlparse import urlparse
if data and data.format == 8: if data and data.format == 8:
icon_index = w.get_icon_at(x,y) icon_index = w.get_icon_at(x,y)
d = string.strip(string.replace(data.data,'\0',' ')) d = string.strip(string.replace(data.data,'\0',' '))
@ -262,7 +264,6 @@ class Gallery(ImageSelect):
GnomeErrorDialog("%s\n%s %d" % (t,msg[0],msg[1])) GnomeErrorDialog("%s\n%s %d" % (t,msg[0],msg[1]))
return return
mime = utils.get_mime_type(tfile) mime = utils.get_mime_type(tfile)
print mime
photo = Photo() photo = Photo()
photo.setMimeType(mime) photo.setMimeType(mime)
photo.setDescription(d) photo.setDescription(d)

View File

@ -63,7 +63,7 @@ def import_media_object(filename,path,base):
try: try:
path = "%s/%s" % (thumb,base) path = "%s/%s" % (thumb,base)
mk_thumb(filename,path,const.thumbScale) mk_thumb(filename,path,const.thumbScale)
if type == "image/jpeg": if type == "image/jpeg":