--- a/src/pyams_media/zmi/__init__.py Tue Sep 08 17:02:16 2015 +0200
+++ b/src/pyams_media/zmi/__init__.py Tue Sep 08 17:02:47 2015 +0200
@@ -16,17 +16,18 @@
# import standard library
# import interfaces
-from pyams_form.interfaces.form import IWidgetsSuffixViewletsManager
+from pyams_form.interfaces.form import IWidgetsSuffixViewletsManager, IInnerTabForm
from pyams_media.interfaces import IMediaConversionUtility
from pyams_skin.interfaces.viewlet import ITableItemColumnActionsMenu
from pyams_skin.layer import IPyAMSLayer
# import packages
-from pyams_form.form import AJAXEditForm, AJAXAddForm
+from pyams_form.form import AJAXEditForm, AJAXAddForm, InnerEditForm
from pyams_form.schema import CloseButton
from pyams_pagelet.pagelet import pagelet_config
from pyams_skin.viewlet.toolbar import ToolbarMenuItem
from pyams_template.template import template_config
+from pyams_utils.adapter import adapter_config
from pyams_utils.text import text_to_html
from pyams_viewlet.viewlet import viewlet_config, Viewlet
from pyams_zmi.control_panel import UtilitiesTable
@@ -49,7 +50,7 @@
legend = _("Update medias converter properties")
- fields = field.Fields(IMediaConversionUtility)
+ fields = field.Fields(IMediaConversionUtility).select('zeo_connection')
label_css_class = 'control-label col-md-4'
input_css_class = 'col-md-8'
@@ -57,6 +58,39 @@
edit_permission = 'system.manage'
+@adapter_config(name='video-properties',
+ context=(IMediaConversionUtility, IAdminLayer, MediaConversionUtilityPropertiesEditForm),
+ provides=IInnerTabForm)
+class MediaVideoConversionPropertiesEditForm(InnerEditForm):
+ """Video conversion utility properties edit form"""
+
+ id = 'video_properties'
+ tab_label = _("Video conversion")
+ legend = None
+ fields = field.Fields(IMediaConversionUtility).select('video_formats', 'video_frame_size', 'video_audio_sampling',
+ 'video_audio_bitrate', 'video_quantisation')
+ label_css_class = 'control-label col-md-4'
+ input_css_class = 'col-md-8'
+
+ weight = 1
+
+
+@adapter_config(name='audio-properties',
+ context=(IMediaConversionUtility, IAdminLayer, MediaConversionUtilityPropertiesEditForm),
+ provides=IInnerTabForm)
+class MediaAudioConversionPropertiesEditForm(InnerEditForm):
+ """Audio conversion utility properties edit form"""
+
+ id = 'audio_properties'
+ tab_label = _("Audio conversion")
+ legend = None
+ fields = field.Fields(IMediaConversionUtility).select('audio_formats', 'audio_sampling', 'audio_bitrate')
+ label_css_class = 'control-label col-md-4'
+ input_css_class = 'col-md-8'
+
+ weight = 2
+
+
@view_config(name='properties.json', context=IMediaConversionUtility, request_type=IPyAMSLayer,
permission='system.manage', renderer='json', xhr=True)
class MediaConversionUtilityPropertiesAJAXEditForm(AJAXEditForm, MediaConversionUtilityPropertiesEditForm):