6934: add a support for embeded custom attributes list on media object
This commit is contained in:
parent
5e61827693
commit
ceeab158b4
@ -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
|
||||
|
43
gramps/gui/editors/displaytabs/mediaattrembedlist.py
Normal file
43
gramps/gui/editors/displaytabs/mediaattrembedlist.py
Normal file
@ -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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Gramps classes
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from .attrembedlist import AttrEmbedList
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# EventAttrEmbedList
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
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()
|
@ -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())
|
||||
|
@ -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")
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user