diff --git a/gramps/gui/editors/displaytabs/__init__.py b/gramps/gui/editors/displaytabs/__init__.py index 370dedf4b..9017d31ad 100644 --- a/gramps/gui/editors/displaytabs/__init__.py +++ b/gramps/gui/editors/displaytabs/__init__.py @@ -46,6 +46,7 @@ from .familyldsembedlist import FamilyLdsEmbedList from .gallerytab import GalleryTab from .ldsembedlist import LdsEmbedList from .locationembedlist import LocationEmbedList +from .mediaattrembedlist import MediaAttrEmbedList from .mediabackreflist import MediaBackRefList from .nameembedlist import NameEmbedList from .notebackreflist import NoteBackRefList diff --git a/gramps/gui/editors/displaytabs/mediaattrembedlist.py b/gramps/gui/editors/displaytabs/mediaattrembedlist.py new file mode 100644 index 000000000..16ae769d6 --- /dev/null +++ b/gramps/gui/editors/displaytabs/mediaattrembedlist.py @@ -0,0 +1,43 @@ +# +# Gramps - a GTK+/GNOME based genealogy program +# +# Copyright (C) 2014 Nick Hall +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# + +#------------------------------------------------------------------------- +# +# Gramps classes +# +#------------------------------------------------------------------------- +from .attrembedlist import AttrEmbedList + +#------------------------------------------------------------------------- +# +# MediaAttrEmbedList +# +#------------------------------------------------------------------------- +class MediaAttrEmbedList(AttrEmbedList): + + def __init__(self, dbstate, uistate, track, data): + AttrEmbedList.__init__(self, dbstate, uistate, track, data) + + def get_editor(self): + from .. import EditAttribute + return EditAttribute + + def get_user_values(self): + return self.dbstate.db.get_media_attribute_types() diff --git a/gramps/gui/editors/editmedia.py b/gramps/gui/editors/editmedia.py index f6f1192f4..1c8bd1a8f 100644 --- a/gramps/gui/editors/editmedia.py +++ b/gramps/gui/editors/editmedia.py @@ -52,7 +52,7 @@ from gramps.gen.utils.file import (media_path_full, find_file, create_checksum) from .editprimary import EditPrimary from ..widgets import (MonitoredDate, MonitoredEntry, PrivacyButton, MonitoredTagList) -from .displaytabs import (CitationEmbedList, AttrEmbedList, NoteTab, +from .displaytabs import (CitationEmbedList, MediaAttrEmbedList, NoteTab, MediaBackRefList) from .addmedia import AddMediaObject from ..dialog import ErrorDialog @@ -201,7 +201,7 @@ class EditMedia(EditPrimary): self._add_tab(notebook, self.citation_tab) self.track_ref_for_deletion("citation_tab") - self.attr_tab = AttrEmbedList(self.dbstate, + self.attr_tab = MediaAttrEmbedList(self.dbstate, self.uistate, self.track, self.obj.get_attribute_list()) diff --git a/gramps/gui/editors/editmediaref.py b/gramps/gui/editors/editmediaref.py index 1725299a1..79bd692a6 100644 --- a/gramps/gui/editors/editmediaref.py +++ b/gramps/gui/editors/editmediaref.py @@ -54,7 +54,7 @@ from gramps.gen.utils.file import (media_path_full, find_file, create_checksum) from gramps.gen.lib import NoteType from gramps.gen.db import DbTxn from ..glade import Glade -from .displaytabs import (CitationEmbedList, AttrEmbedList, MediaBackRefList, +from .displaytabs import (CitationEmbedList, MediaAttrEmbedList, MediaBackRefList, NoteTab) from ..widgets import (MonitoredSpinButton, MonitoredEntry, PrivacyButton, MonitoredDate, MonitoredTagList, SelectionWidget, Region) @@ -459,7 +459,7 @@ class EditMediaRef(EditReference): self._add_tab(notebook_ref, self.srcref_list) self.track_ref_for_deletion("srcref_list") - self.attr_list = AttrEmbedList(self.dbstate,self.uistate,self.track, + self.attr_list = MediaAttrEmbedList(self.dbstate,self.uistate,self.track, self.source_ref.get_attribute_list()) self._add_tab(notebook_ref, self.attr_list) self.track_ref_for_deletion("attr_list") @@ -484,7 +484,7 @@ class EditMediaRef(EditReference): self._add_tab(notebook_src, self.src_srcref_list) self.track_ref_for_deletion("src_srcref_list") - self.src_attr_list = AttrEmbedList(self.dbstate,self.uistate,self.track, + self.src_attr_list = MediaAttrEmbedList(self.dbstate,self.uistate,self.track, self.source.get_attribute_list()) self._add_tab(notebook_src, self.src_attr_list) self.track_ref_for_deletion("src_attr_list") diff --git a/po/POTFILES.skip b/po/POTFILES.skip index 59ec8245d..718f0cdf0 100644 --- a/po/POTFILES.skip +++ b/po/POTFILES.skip @@ -298,6 +298,7 @@ gramps/gui/editors/displaytabs/grampstab.py gramps/gui/editors/displaytabs/groupembeddedlist.py gramps/gui/editors/displaytabs/ldsmodel.py gramps/gui/editors/displaytabs/locationmodel.py +gramps/gui/editors/displaytabs/mediaattrembedlist.py gramps/gui/editors/displaytabs/mediabackreflist.py gramps/gui/editors/displaytabs/notebackreflist.py gramps/gui/editors/displaytabs/notemodel.py