diff --git a/po/POTFILES.in b/po/POTFILES.in index 4cdc7be1a..fe03c0a63 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -266,11 +266,11 @@ src/plugins/gramplet/CalendarGramplet.py src/plugins/gramplet/Children.py src/plugins/gramplet/DescendGramplet.py src/plugins/gramplet/Events.py -src/plugins/gramplet/Exif.py src/plugins/gramplet/FanChartGramplet.py src/plugins/gramplet/FaqGramplet.py src/plugins/gramplet/GivenNameGramplet.py src/plugins/gramplet/gramplet.gpr.py +src/plugins/gramplet/MetadataViewer.py src/plugins/gramplet/Notes.py src/plugins/gramplet/PedigreeGramplet.py src/plugins/gramplet/PersonDetails.py diff --git a/src/gramps.py b/src/gramps.py index c32b9c1c1..4ee74b9b0 100644 --- a/src/gramps.py +++ b/src/gramps.py @@ -191,6 +191,16 @@ def show_settings(): except ImportError: cairover_str = 'not found' + try: + import pyexiv2 + try: + pyexiv2_str = '%d.%d.%d' % pyexiv2.version_info + except :# any failure to 'get' the version + pyexiv2_str = 'unknown version' + + except ImportError: + pyexiv2_str = 'not found' + import config usebsddb3 = config.get('preferences.use-bsddb3') try: @@ -256,6 +266,7 @@ def show_settings(): print ' bsddb : %s' % bsddb_str print ' bsddb.db : %s' % bsddb_db_str print ' cairo : %s' % cairover_str + print ' pyexiv2 : %s' % pyexiv2_str print ' o.s. : %s' % operating_system if kernel: print ' kernel : %s' % kernel diff --git a/src/gui/grampsbar.py b/src/gui/grampsbar.py index bf1786686..8b2e7bc60 100644 --- a/src/gui/grampsbar.py +++ b/src/gui/grampsbar.py @@ -107,11 +107,12 @@ class GrampsBar(gtk.Notebook): opts_list.sort(key=lambda opt: opt["page"]) for opts in opts_list: - all_opts = get_gramplet_opts(opts["name"], opts) - gramplet = make_requested_gramplet(TabGramplet, self, all_opts, - self.dbstate, self.uistate) - if gramplet: - self.__add_tab(gramplet) + if opts["name"] in AVAILABLE_GRAMPLETS(): + all_opts = get_gramplet_opts(opts["name"], opts) + gramplet = make_requested_gramplet(TabGramplet, self, all_opts, + self.dbstate, self.uistate) + if gramplet: + self.__add_tab(gramplet) if len(opts_list) == 0: self.empty = True @@ -126,7 +127,7 @@ class GrampsBar(gtk.Notebook): Load the gramplets from the configuration file. """ retval = [] - visible = False + visible = True default_page = 0 filename = self.configfile if filename and os.path.exists(filename): diff --git a/src/plugins/gramplet/Makefile.am b/src/plugins/gramplet/Makefile.am index 897676dc4..1a4859a0f 100644 --- a/src/plugins/gramplet/Makefile.am +++ b/src/plugins/gramplet/Makefile.am @@ -16,14 +16,14 @@ pkgdata_PYTHON = \ Children.py \ DescendGramplet.py \ Events.py \ - Exif.py \ FanChartGramplet.py \ FaqGramplet.py \ - Filter.py \ + Filter.py \ Gallery.py \ GivenNameGramplet.py \ gramplet.gpr.py \ MediaPreview.py \ + MetadataViewer.py \ Notes.py \ PedigreeGramplet.py \ PersonDetails.py \ diff --git a/src/plugins/gramplet/Exif.py b/src/plugins/gramplet/MetadataViewer.py similarity index 99% rename from src/plugins/gramplet/Exif.py rename to src/plugins/gramplet/MetadataViewer.py index b67b94f3d..1cdd1ac0a 100644 --- a/src/plugins/gramplet/Exif.py +++ b/src/plugins/gramplet/MetadataViewer.py @@ -63,7 +63,7 @@ if not pyexiv2_req_install: Min_VERSION_str, _DOWNLOAD_LINK, PrefVersion_str) ).encode(sys.getfilesystemencoding()) ) -class Exif(Gramplet): +class MetadataViewer(Gramplet): """ Displays the exif tags of an image. """ diff --git a/src/plugins/gramplet/bottombar.gpr.py b/src/plugins/gramplet/bottombar.gpr.py index d5b8fb861..4f02f3763 100644 --- a/src/plugins/gramplet/bottombar.gpr.py +++ b/src/plugins/gramplet/bottombar.gpr.py @@ -77,20 +77,27 @@ register(GRAMPLET, gramplet_title=_("Preview"), ) -register(GRAMPLET, - id = "Exif Viewer Gramplet", - name = _("Exif Viewer Gramplet"), - description = _("Gramplet showing exif tags for a media object"), - version = "1.0.0", - gramps_target_version = "3.4", - status = STABLE, - fname = "Exif.py", - height = 200, - gramplet = 'Exif', - gramplet_title = _("Exif"), - authors = ["Rob G. Healey"], - authors_email = ["robhealey1@gmail.com"], - ) +try: + import pyexiv2 + available = True +except: + print _("WARNING: pyexiv2 module not loaded. " + "Image metadata functionality will not be available.") + available = False + +if available: + register(GRAMPLET, + id = "Metadata Viewer Gramplet", + name = _("Metadata Viewer Gramplet"), + description = _("Gramplet showing metadata for a media object"), + version = "1.0.0", + gramps_target_version = "3.4", + status = STABLE, + fname = "MetadataViewer.py", + height = 200, + gramplet = 'MetadataViewer', + gramplet_title = _("Image Metadata"), + ) register(GRAMPLET, id="Person Residence Gramplet", diff --git a/src/plugins/view/mediaview.py b/src/plugins/view/mediaview.py index a4ab879e3..148874444 100644 --- a/src/plugins/view/mediaview.py +++ b/src/plugins/view/mediaview.py @@ -425,8 +425,8 @@ class MediaView(ListView): """ return (("Media Filter Gramplet",), ("Media Preview Gramplet", - "Exif Viewer Gramplet", "Media Sources Gramplet", "Media Notes Gramplet", "Media Attributes Gramplet", + "Metadata Viewer Gramplet", "Media Backlinks Gramplet"))