6934: better GUI support for embeded custom attributes list on media object (backport)
This commit is contained in:
parent
b6f77eb4e3
commit
2119126685
@ -47,6 +47,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., 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()
|
@ -54,7 +54,7 @@ from gramps.gen.utils.file import (media_path_full, find_file)
|
||||
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
|
||||
@ -203,7 +203,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)
|
||||
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)
|
||||
@ -592,7 +592,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")
|
||||
@ -617,7 +617,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