[PE] Fix Bug 55958: add autopreview option

This commit is contained in:
Julia Radzhabova 2022-04-20 17:56:30 +03:00
parent 0ced8a0c39
commit 27839caa26
4 changed files with 23 additions and 4 deletions

View file

@ -174,7 +174,7 @@ define([
handler : function(result, value) { handler : function(result, value) {
if (result == 'ok') { if (result == 'ok') {
if (me.api) { if (me.api) {
me.addNewEffect(value.activeEffect, value.activeGroupValue, value.activeGroup, replace, undefined, !Common.Utils.InternalSettings.get("pe-animation-no-preview")); me.addNewEffect(value.activeEffect, value.activeGroupValue, value.activeGroup, replace, undefined);
} }
} }
} }
@ -189,7 +189,7 @@ define([
addNewEffect: function (type, group, groupName, replace, parametr, preview) { addNewEffect: function (type, group, groupName, replace, parametr, preview) {
var parameter = this.view.setMenuParameters(type, groupName, parametr); var parameter = this.view.setMenuParameters(type, groupName, parametr);
this.api.asc_AddAnimation(group, type, (parameter != undefined)?parameter:0, replace, preview); this.api.asc_AddAnimation(group, type, (parameter != undefined)?parameter:0, replace, !Common.Utils.InternalSettings.get("pe-animation-no-auto-preview"));
}, },
onDurationChange: function(before,combo, record, e) { onDurationChange: function(before,combo, record, e) {

View file

@ -76,6 +76,12 @@ define([
me.btnPreview.on('click', _.bind(function(btn) { me.btnPreview.on('click', _.bind(function(btn) {
me.fireEvent('animation:preview', [me.btnPreview]); me.fireEvent('animation:preview', [me.btnPreview]);
}, me)); }, me));
me.btnPreview.menu.on('item:click', _.bind(function(menu, item, e) {
if (item.value === 'preview')
me.fireEvent('animation:preview', [me.btnPreview]);
else if (item.value === 'auto')
Common.Utils.InternalSettings.set("pe-animation-no-auto-preview", !item.checked);
}, me));
} }
if(me.cmbTrigger) if(me.cmbTrigger)
@ -239,7 +245,8 @@ define([
this.btnPreview = new Common.UI.Button({ this.btnPreview = new Common.UI.Button({
cls: 'btn-toolbar x-huge icon-top', // x-huge icon-top', cls: 'btn-toolbar x-huge icon-top', // x-huge icon-top',
caption: this.txtPreview, caption: this.txtPreview,
split: false, split: true,
menu: true,
iconCls: 'toolbar__icon animation-preview-start', iconCls: 'toolbar__icon animation-preview-start',
lock: [_set.slideDeleted, _set.noSlides, _set.noAnimationPreview, _set.timingLock], lock: [_set.slideDeleted, _set.noSlides, _set.noAnimationPreview, _set.timingLock],
dataHint: '1', dataHint: '1',
@ -513,6 +520,15 @@ define([
me.btnAddAnimation.menu.setInnerMenu([{menu: picker, index: 0}]); me.btnAddAnimation.menu.setInnerMenu([{menu: picker, index: 0}]);
}; };
me.btnAddAnimation.menu.on('show:before', onShowBefore); me.btnAddAnimation.menu.on('show:before', onShowBefore);
me.btnPreview.setMenu( new Common.UI.Menu({
style: "min-width: auto;",
items: [
{caption: me.txtPreview, value: 'preview'},
{caption: me.textAutoPreview, value: 'auto', checkable: true, checked: !Common.Utils.InternalSettings.get("pe-animation-no-auto-preview")}
]
}));
setEvents.call(me); setEvents.call(me);
}); });
}, },
@ -625,7 +641,8 @@ define([
str3: '3 s (Slow)', str3: '3 s (Slow)',
str2: '2 s (Medium)', str2: '2 s (Medium)',
str1: '1 s (Fast)', str1: '1 s (Fast)',
str0_5: '0.5 s (Very Fast)' str0_5: '0.5 s (Very Fast)',
textAutoPreview: 'AutoPreview'
} }
}()), PE.Views.Animation || {})); }()), PE.Views.Animation || {}));

View file

@ -1321,6 +1321,7 @@
"PE.Views.Animation.txtParameters": "Parameters", "PE.Views.Animation.txtParameters": "Parameters",
"PE.Views.Animation.txtPreview": "Preview", "PE.Views.Animation.txtPreview": "Preview",
"PE.Views.Animation.txtSec": "s", "PE.Views.Animation.txtSec": "s",
"PE.Views.Animation.textAutoPreview": "AutoPreview",
"PE.Views.AnimationDialog.textPreviewEffect": "Preview Effect", "PE.Views.AnimationDialog.textPreviewEffect": "Preview Effect",
"PE.Views.AnimationDialog.textTitle": "More Effects", "PE.Views.AnimationDialog.textTitle": "More Effects",
"PE.Views.ChartSettings.textAdvanced": "Show advanced settings", "PE.Views.ChartSettings.textAdvanced": "Show advanced settings",

View file

@ -1320,6 +1320,7 @@
"PE.Views.Animation.txtAnimationPane": "Область анимации", "PE.Views.Animation.txtAnimationPane": "Область анимации",
"PE.Views.Animation.txtParameters": "Параметры", "PE.Views.Animation.txtParameters": "Параметры",
"PE.Views.Animation.txtPreview": "Просмотр", "PE.Views.Animation.txtPreview": "Просмотр",
"PE.Views.Animation.textAutoPreview": "Автопросмотр",
"PE.Views.Animation.txtSec": "сек", "PE.Views.Animation.txtSec": "сек",
"PE.Views.AnimationDialog.textPreviewEffect": "Просмотр эффекта", "PE.Views.AnimationDialog.textPreviewEffect": "Просмотр эффекта",
"PE.Views.AnimationDialog.textTitle": "Другие эффекты", "PE.Views.AnimationDialog.textTitle": "Другие эффекты",