From b17dd8fe3e1a4c6e349cb667155d1f238308af67 Mon Sep 17 00:00:00 2001 From: "Rob G. Healey" Date: Thu, 9 Jun 2011 06:32:22 +0000 Subject: [PATCH] Code refinement provided by Gerald Britton. svn: r17728 --- src/plugins/gramplet/EditExifMetadata.py | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/src/plugins/gramplet/EditExifMetadata.py b/src/plugins/gramplet/EditExifMetadata.py index 121e26a1b..2e2694e7d 100644 --- a/src/plugins/gramplet/EditExifMetadata.py +++ b/src/plugins/gramplet/EditExifMetadata.py @@ -968,10 +968,14 @@ class EditExifMetadata(Gramplet): entry.connect('content-changed', self.set_datetime, widget) event_box.add(entry) self.exif_widgets[widget] = entry - entry.show() + entry.show() self.dates[widget] = None + # if there is text in the modified Date/ Time field, disable editing... + if self.exif_widgets["Modified"].get_text(): + self.exif_widgets["Modified"].set_editable(False) + # GPS Coordinates... latlong_frame = gtk.Frame(_("Latitude/ Longitude/ Altitude GPS Coordinates")) latlong_frame.set_size_request(490, 210) @@ -1627,19 +1631,10 @@ def _get_exif_keypairs(plugin_image): if not plugin_image: return False - MediaDataTags = False - if LesserVersion: # prior to pyexiv2-0.2.0 - - # get all KeyTags for this image for diplay only... - MediaDataTags = [KeyTag for KeyTag in plugin_image.exifKeys() ] - - else: # pyexiv2-0.2.0 and above - - # get all KeyTags for this image for diplay only... - MediaDataTags = [KeyTag for KeyTag in chain( - plugin_image.exif_keys, plugin_image.xmp_keys, - plugin_image.iptc_keys) ] - + MediaDataTags = [KeyTag for KeyTag in (plugin_image.exifKeys() if LesserVersion + else chain( plugin_image.exif_keys, + plugin_image.xmp_keys, + plugin_image.iptc_keys) ) ] return MediaDataTags def string_to_rational(coordinate):