From d51057dbc2c95b405bb8b50d68f67bbe7903fc08 Mon Sep 17 00:00:00 2001 From: JuliaSvinareva Date: Wed, 25 Jan 2023 02:13:46 +0300 Subject: [PATCH] [DE PE SSE] Add alert when RTL interface setting was changed --- .../main/app/view/FileMenuPanels.js | 15 ++++++++++++++- .../main/app/view/FileMenuPanels.js | 15 ++++++++++++++- .../main/app/view/FileMenuPanels.js | 15 ++++++++++++++- 3 files changed, 42 insertions(+), 3 deletions(-) diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index 2700d53896..f8e78d82d8 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -992,6 +992,7 @@ define([ } Common.localStorage.setItem("de-settings-paste-button", this.chPaste.isChecked() ? 1 : 0); + var isRtlChanged = this.chRTL.$el.is(':visible') && Common.localStorage.getBool("ui-rtl") !== this.chRTL.isChecked(); Common.localStorage.setBool("ui-rtl", this.chRTL.isChecked()); Common.localStorage.setBool("de-settings-quick-print-button", this.chQuickPrint.isChecked()); @@ -1003,6 +1004,16 @@ define([ if (this._oldUnits !== this.cmbUnit.getValue()) Common.NotificationCenter.trigger('settings:unitschanged', this); } + + if (isRtlChanged) { + var config = { + title: this.txtWorkspaceSettingChange, + msg: this.txtRestartEditor, + iconCls: 'warn', + buttons: ['ok'] + }; + Common.UI.alert(config); + } }, fillShowChanges: function(fastmode) { @@ -1095,7 +1106,9 @@ define([ strShowOthersChanges: 'Show changes from other users', txtAdvancedSettings: 'Advanced Settings', txtQuickPrint: 'Show the Quick Print button in the editor header', - txtQuickPrintTip: 'The document will be printed on the last selected or default printer' + txtQuickPrintTip: 'The document will be printed on the last selected or default printer', + txtWorkspaceSettingChange: 'Workspace setting (RTL interface) change', + txtRestartEditor: 'Please restart document editor so that your workspace settings can take effect' }, DE.Views.FileMenuPanels.Settings || {})); DE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({ diff --git a/apps/presentationeditor/main/app/view/FileMenuPanels.js b/apps/presentationeditor/main/app/view/FileMenuPanels.js index 50b6fdb834..aa5ce8ff45 100644 --- a/apps/presentationeditor/main/app/view/FileMenuPanels.js +++ b/apps/presentationeditor/main/app/view/FileMenuPanels.js @@ -791,6 +791,7 @@ define([ Common.Utils.InternalSettings.set("pe-macros-mode", this.cmbMacros.getValue()); Common.localStorage.setItem("pe-settings-paste-button", this.chPaste.isChecked() ? 1 : 0); + var isRtlChanged = this.chRTL.$el.is(':visible') && Common.localStorage.getBool("ui-rtl") !== this.chRTL.isChecked(); Common.localStorage.setBool("ui-rtl", this.chRTL.isChecked()); Common.localStorage.setBool("pe-settings-quick-print-button", this.chQuickPrint.isChecked()); @@ -802,6 +803,16 @@ define([ if (this._oldUnits !== this.cmbUnit.getValue()) Common.NotificationCenter.trigger('settings:unitschanged', this); } + + if (isRtlChanged) { + var config = { + title: this.txtWorkspaceSettingChange, + msg: this.txtRestartEditor, + iconCls: 'warn', + buttons: ['ok'] + }; + Common.UI.alert(config); + } }, onFontRenderSelected: function(combo, record) { @@ -872,7 +883,9 @@ define([ strShowOthersChanges: 'Show changes from other users', txtAdvancedSettings: 'Advanced Settings', txtQuickPrint: 'Show the Quick Print button in the editor header', - txtQuickPrintTip: 'The document will be printed on the last selected or default printer' + txtQuickPrintTip: 'The document will be printed on the last selected or default printer', + txtWorkspaceSettingChange: 'Workspace setting (RTL interface) change', + txtRestartEditor: 'Please restart presentation editor so that your workspace settings can take effect' }, PE.Views.FileMenuPanels.Settings || {})); PE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({ diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index 869569b424..68bec24332 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -1069,6 +1069,7 @@ define([ Common.Utils.InternalSettings.set("sse-macros-mode", this.cmbMacros.getValue()); Common.localStorage.setItem("sse-settings-paste-button", this.chPaste.isChecked() ? 1 : 0); + var isRtlChanged = this.chRTL.$el.is(':visible') && Common.localStorage.getBool("ui-rtl") !== this.chRTL.isChecked(); Common.localStorage.setBool("ui-rtl", this.chRTL.isChecked()); Common.localStorage.setBool("sse-settings-quick-print-button", this.chQuickPrint.isChecked()); @@ -1103,6 +1104,16 @@ define([ if (this.mode.isEdit) this.api.asc_setDate1904(this.chDateSystem.isChecked()); + + if (isRtlChanged) { + var config = { + title: this.txtWorkspaceSettingChange, + msg: this.txtRestartEditor, + iconCls: 'warn', + buttons: ['ok'] + }; + Common.UI.alert(config); + } }, updateRegionalExample: function(landId) { @@ -1267,7 +1278,9 @@ define([ strDateFormat1904: 'Use 1904 date system', txtAdvancedSettings: 'Advanced Settings', txtQuickPrint: 'Show the Quick Print button in the editor header', - txtQuickPrintTip: 'The document will be printed on the last selected or default printer' + txtQuickPrintTip: 'The document will be printed on the last selected or default printer', + txtWorkspaceSettingChange: 'Workspace setting (RTL interface) change', + txtRestartEditor: 'Please restart spreadsheet editor so that your workspace settings can take effect' }, SSE.Views.FileMenuPanels.MainSettingsGeneral || {}));