diff --git a/src/EventEdit.py b/src/EventEdit.py index 98ac92b7d..ab30f4f6f 100644 --- a/src/EventEdit.py +++ b/src/EventEdit.py @@ -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() diff --git a/src/ImageSelect.py b/src/ImageSelect.py index f310dfe6c..ecffb260e 100644 --- a/src/ImageSelect.py +++ b/src/ImageSelect.py @@ -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) diff --git a/src/RelImage.py b/src/RelImage.py index f5aca56ca..0d4abeb65 100644 --- a/src/RelImage.py +++ b/src/RelImage.py @@ -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":