From 9acab799cbd75f283857a5891fdefa1c4d4a0b14 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Sat, 8 Feb 2003 19:16:12 +0000 Subject: [PATCH] Image handling improvements svn: r1289 --- src/ImageSelect.py | 8 +++----- src/MediaView.py | 4 +--- src/Utils.py | 1 + 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/ImageSelect.py b/src/ImageSelect.py index 5cb49b3e6..d5bf296f0 100644 --- a/src/ImageSelect.py +++ b/src/ImageSelect.py @@ -161,6 +161,7 @@ class ImageSelect: description = os.path.basename(filename) mobj.setDescription(description) mobj.setMimeType(type) + self.savephoto(mobj) if type[0:5] == "image": if self.external.get_active() == 0: @@ -177,7 +178,6 @@ class ImageSelect: mobj.getId()) mobj.setLocal(1) mobj.setPath(name) - self.savephoto(mobj) self.parent.lists_changed = 1 Utils.destroy_passed_object(obj) @@ -316,7 +316,6 @@ class Gallery(ImageSelect): oref = RelLib.ObjectRef() oref.setReference(photo) self.dataobj.addPhoto(oref) - self.add_thumbnail(oref) def add_thumbnail(self, photo): """Scale the image and add it to the IconList.""" @@ -331,6 +330,7 @@ class Gallery(ImageSelect): import gobject name = Utils.thumb_path(self.db.getSavePath(),object) + description = object.getDescription() if len(description) > 20: description = "%s..." % description[0:20] @@ -527,9 +527,7 @@ class Gallery(ImageSelect): menu of the available actions.""" menu = gtk.Menu() - item = gtk.TearoffMenuItem() - item.show() - menu.append(item) + menu.set_title(_("Media Object")) object = photo.getReference() mtype = object.getMimeType() progname = grampslib.default_application_name(mtype) diff --git a/src/MediaView.py b/src/MediaView.py index 50e42f420..b042d8a01 100644 --- a/src/MediaView.py +++ b/src/MediaView.py @@ -163,9 +163,7 @@ class MediaView: ImageSelect.GlobalMediaProperties(self.db,object,self.load_media) elif event.button == 3: menu = gtk.Menu() - item = gtk.TearoffMenuItem() - item.show() - menu.append(item) + menu.set_title(_("Media Object")) self.obj = object Utils.add_menuitem(menu,_("View in the default viewer"),None,self.popup_view_photo) if object.getMimeType()[0:5] == "image": diff --git a/src/Utils.py b/src/Utils.py index 74821d18b..2d91d7b15 100644 --- a/src/Utils.py +++ b/src/Utils.py @@ -399,6 +399,7 @@ def birthday(person): def thumb_path(dir,mobj): type = mobj.getMimeType() + if type[0:5] == "image": thumb = "%s/.thumb/%s.jpg" % (dir,mobj.getId()) try: