Changed medias actions 'view' argument to IMediaWidget
authorThierry Florac <thierry.florac@onf.fr>
Tue, 06 Feb 2018 14:00:27 +0100
changeset 72 eefd36b2da13
parent 71 b00b67582aa2
child 73 93ad8b37b0c5
Changed medias actions 'view' argument to IMediaWidget
src/pyams_media/zmi/media.py
src/pyams_media/zmi/video.py
--- a/src/pyams_media/zmi/media.py	Fri Jan 26 17:29:49 2018 +0100
+++ b/src/pyams_media/zmi/media.py	Tue Feb 06 14:00:27 2018 +0100
@@ -16,7 +16,7 @@
 # import standard library
 
 # import interfaces
-from pyams_file.interfaces import IVideo, IThumbnail, IAudio, IMediaFile
+from pyams_file.interfaces import IVideo, IThumbnail, IAudio, IMediaFile, IMediaWidget
 from pyams_form.interfaces.form import IWidgetsPrefixViewletsManager, IFormHelp
 from pyams_media.interfaces import IMediaConversionUtility, VIDEO_FRAME_SIZE, IMediaConverter, IMediaConversions
 from pyams_media.zmi.interfaces import IMediaConversionsForm
@@ -68,7 +68,7 @@
 # Video conversions
 #
 
-@viewlet_config(name='video.conversions.action', context=IVideo, layer=IPyAMSLayer, view=Interface,
+@viewlet_config(name='video.conversions.action', context=IVideo, layer=IPyAMSLayer, view=IMediaWidget,
                 manager=IContextActions, permission=MANAGE_PERMISSION, weight=15)
 class VideoConversionsAction(ToolbarActionItem):
     """Video conversions action"""
@@ -165,7 +165,7 @@
 # Audio conversions
 #
 
-@viewlet_config(name='audio.conversions.action', context=IAudio, layer=IPyAMSLayer, view=Interface,
+@viewlet_config(name='audio.conversions.action', context=IAudio, layer=IPyAMSLayer, view=IMediaWidget,
                 manager=IContextActions, permission=MANAGE_PERMISSION, weight=15)
 class AudioConversionsAction(ToolbarActionItem):
     """Audio conversions action"""
--- a/src/pyams_media/zmi/video.py	Fri Jan 26 17:29:49 2018 +0100
+++ b/src/pyams_media/zmi/video.py	Tue Feb 06 14:00:27 2018 +0100
@@ -18,7 +18,7 @@
 from decimal import Decimal
 
 # import interfaces
-from pyams_file.interfaces import IVideo, IThumbnail
+from pyams_file.interfaces import IVideo, IThumbnail, IMediaWidget
 from pyams_form.interfaces.form import IWidgetsPrefixViewletsManager, IFormHelp
 from pyams_skin.interfaces.viewlet import IContextActions
 from pyams_utils.interfaces import MANAGE_PERMISSION, VIEW_PERMISSION
@@ -73,7 +73,7 @@
 # Video thumbnail
 #
 
-@viewlet_config(name='video.thumbnail.action', context=IVideo, layer=IPyAMSLayer, view=Interface,
+@viewlet_config(name='video.thumbnail.action', context=IVideo, layer=IPyAMSLayer, view=IMediaWidget,
                 manager=IContextActions, permission=MANAGE_PERMISSION, weight=20)
 class VideoThumbnailAction(ToolbarActionItem):
     """Video thumbnail selection action"""