Fixed unintialized event in EventEditor, and fixe thumbnails for drag and drop
svn: r498
This commit is contained in:
parent
e3a3a6a654
commit
3928629410
@ -113,7 +113,6 @@ class EventEditor:
|
||||
Sources.SourceSelector(self.srcreflist,self.parent,src_changed)
|
||||
|
||||
def on_event_edit_ok_clicked(self,obj):
|
||||
event = self.event
|
||||
|
||||
ename = self.name_field.get_text()
|
||||
edate = self.date_field.get_text()
|
||||
@ -124,10 +123,10 @@ class EventEditor:
|
||||
edesc = self.descr_field.get_text()
|
||||
epriv = self.priv.get_active()
|
||||
|
||||
if event == None:
|
||||
event = Event()
|
||||
event.setSourceRefList(self.srcreflist)
|
||||
self.parent.elist.append(event)
|
||||
if self.event == None:
|
||||
self.event = Event()
|
||||
self.event.setSourceRefList(self.srcreflist)
|
||||
self.parent.elist.append(self.event)
|
||||
|
||||
if eplace_obj == None and eplace != "":
|
||||
eplace_obj = Place()
|
||||
|
@ -134,6 +134,7 @@ class ImageSelect:
|
||||
else:
|
||||
if self.external.get_active() == 1:
|
||||
name = filename
|
||||
RelImage.mk_thumb(filename,self.path,mobj.getId())
|
||||
else:
|
||||
name = RelImage.import_media_object(filename,self.path,mobj.getId())
|
||||
|
||||
@ -200,6 +201,8 @@ class Gallery(ImageSelect):
|
||||
oref = ObjectRef()
|
||||
oref.setReference(photo)
|
||||
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)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
@ -237,7 +240,6 @@ class Gallery(ImageSelect):
|
||||
|
||||
def on_photolist_drag_data_received(self,w, context, x, y, data, info, time):
|
||||
import urlparse
|
||||
|
||||
if data and data.format == 8:
|
||||
icon_index = w.get_icon_at(x,y)
|
||||
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]))
|
||||
return
|
||||
mime = utils.get_mime_type(tfile)
|
||||
print mime
|
||||
photo = Photo()
|
||||
photo.setMimeType(mime)
|
||||
photo.setDescription(d)
|
||||
|
@ -63,7 +63,7 @@ def import_media_object(filename,path,base):
|
||||
|
||||
try:
|
||||
path = "%s/%s" % (thumb,base)
|
||||
|
||||
|
||||
mk_thumb(filename,path,const.thumbScale)
|
||||
|
||||
if type == "image/jpeg":
|
||||
|
Loading…
Reference in New Issue
Block a user