diff --git a/apps/documenteditor/mobile/src/controller/settings/ApplicationSettings.jsx b/apps/documenteditor/mobile/src/controller/settings/ApplicationSettings.jsx index 2d71e7d27..451eca7af 100644 --- a/apps/documenteditor/mobile/src/controller/settings/ApplicationSettings.jsx +++ b/apps/documenteditor/mobile/src/controller/settings/ApplicationSettings.jsx @@ -56,7 +56,7 @@ class ApplicationSettingsController extends Component { } setMacrosSettings(value) { - Common.Utils.InternalSettings.set("de-mobile-macros-mode", +value); + // Common.Utils.InternalSettings.set("de-mobile-macros-mode", +value); // Common.localStorage.setItem("de-mobile-macros-mode", +value); } diff --git a/apps/documenteditor/mobile/src/controller/settings/Download.jsx b/apps/documenteditor/mobile/src/controller/settings/Download.jsx index d5c8fa064..2debde916 100644 --- a/apps/documenteditor/mobile/src/controller/settings/Download.jsx +++ b/apps/documenteditor/mobile/src/controller/settings/Download.jsx @@ -1,13 +1,51 @@ import React, { Component } from "react"; import Download from "../../view/settings/Download"; +import { Device } from '../../../../../common/mobile/utils/device'; +import { f7 } from 'framework7-react'; +// import { observer } from "mobx-react"; +// import { withTranslation } from 'react-i18next'; class DownloadController extends Component { constructor(props) { super(props); + this.onSaveFormat = this.onSaveFormat.bind(this); } + + closeModal() { + if (Device.phone) { + f7.sheet.close('#edit-sheet', true); + } else { + f7.popover.close('#edit-popover'); + } + } + + onSaveFormat(format) { + // const api = Common.EditorApi.get(); + console.log(format); + if(format) { + // if (format == Asc.c_oAscFileType.TXT || format == Asc.c_oAscFileType.RTF) { + // // const { t } = this.props; + // // f7.dialog.alert(t('Edit.textNotUrl'), t('Edit.notcriticalErrorTitle')); + // if (format == Asc.c_oAscFileType.TXT) { + // // Common.NotificationCenter.trigger('download:advanced', Asc.c_oAscAdvancedOptionsID.TXT, api.asc_getAdvancedOptions(), 2, new Asc.asc_CDownloadOptions(format)); + + // asc_CDownloadOptions(format); + // } + // else { + // api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format)); + // } + // } + // else { + // api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format)); + // } + + this.closeModal(); + } + } + render() { return ( - + ); } } diff --git a/apps/documenteditor/mobile/src/store/applicationSettings.js b/apps/documenteditor/mobile/src/store/applicationSettings.js index fa3256570..968c84b78 100644 --- a/apps/documenteditor/mobile/src/store/applicationSettings.js +++ b/apps/documenteditor/mobile/src/store/applicationSettings.js @@ -1,9 +1,8 @@ import {action, observable} from 'mobx'; export class storeApplicationSettings { - @observable isActiveUnitCentimeter = false; - @observable isActiveUnitPoint = true; - @observable isActiveUnitInch = false; + + @observable unitMeasurement = 1; @observable isSpellChecking = true; @@ -13,28 +12,10 @@ export class storeApplicationSettings { @observable isComments = true; @observable isResolvedComments = true; - @observable isDisabledAllMacros = false; - @observable isShowNotification = true; - @observable isEnabledAllMacros = false; + @observable macrosMode = 0; @action changeUnitMeasurement(value) { - value = (value !== null) ? +value : Common.Utils.Metric.getDefaultMetric(); - - if(value === Common.Utils.Metric.c_MetricUnits.inch) { - this.isActiveUnitCentimeter = false; - this.isActiveUnitPoint = false; - this.isActiveUnitInch = true; - } - else if(value === Common.Utils.Metric.c_MetricUnits.pt) { - this.isActiveUnitCentimeter = false; - this.isActiveUnitPoint = true; - this.isActiveUnitInch = false; - } - else { - this.isActiveUnitCentimeter = true; - this.isActiveUnitPoint = false; - this.isActiveUnitInch = false; - } + this.unitMeasurement = +value; } @action changeSpellCheck(value) { @@ -59,20 +40,6 @@ export class storeApplicationSettings { } @action changeMacrosSettings(value) { - if(+value === 2) { - this.isDisabledAllMacros = true; - this.isShowNotification = false; - this.isEnabledAllMacros = false; - } - else if(+value === 1) { - this.isDisabledAllMacros = false; - this.isShowNotification = false; - this.isEnabledAllMacros = true; - } - else { - this.isDisabledAllMacros = false; - this.isShowNotification = true; - this.isEnabledAllMacros = false; - } + this.macrosMode = +value; } } \ No newline at end of file diff --git a/apps/documenteditor/mobile/src/view/settings/ApplicationSettings.jsx b/apps/documenteditor/mobile/src/view/settings/ApplicationSettings.jsx index 7991e07fc..5feac9462 100644 --- a/apps/documenteditor/mobile/src/view/settings/ApplicationSettings.jsx +++ b/apps/documenteditor/mobile/src/view/settings/ApplicationSettings.jsx @@ -7,9 +7,7 @@ const PageApplicationSettings = props => { const { t } = useTranslation(); const _t = t("Settings", { returnObjects: true }); const store = props.storeApplicationSettings; - const isActiveUnitCentimeter = store.isActiveUnitCentimeter; - const isActiveUnitPoint = store.isActiveUnitPoint; - const isActiveUnitInch = store.isActiveUnitInch; + const unitMeasurement = store.unitMeasurement; const isSpellChecking = store.isSpellChecking; const isNonprintingCharacters = store.isNonprintingCharacters; const isHiddenTableBorders = store.isHiddenTableBorders; @@ -26,11 +24,11 @@ const PageApplicationSettings = props => { {_t.textUnitOfMeasurement} - changeMeasureSettings(e.target.value)}> - changeMeasureSettings(e.target.value)}> - changeMeasureSettings(e.target.value)}> @@ -98,13 +96,11 @@ const PageMacrosSettings = props => { const { t } = useTranslation(); const _t = t("Settings", { returnObjects: true }); const store = props.storeApplicationSettings; - const isDisabledAllMacros = store.isDisabledAllMacros; - const isShowNotification = store.isShowNotification; - const isEnabledAllMacros = store.isEnabledAllMacros; + const macrosMode = store.macrosMode; const changeMacros = value => { store.changeMacrosSettings(value); - props.setMacrosSettings(value); + // props.setMacrosSettings(value); }; return ( @@ -112,11 +108,11 @@ const PageMacrosSettings = props => { changeMacros(e.target.value)}> + checked={macrosMode === 2} onChange={e => changeMacros(e.target.value)}> changeMacros(e.target.value)}> + checked={macrosMode === 0} onChange={e => changeMacros(e.target.value)}> changeMacros(e.target.value)}> + checked={macrosMode === 1} onChange={e => changeMacros(e.target.value)}> ); diff --git a/apps/documenteditor/mobile/src/view/settings/Download.jsx b/apps/documenteditor/mobile/src/view/settings/Download.jsx index 5bc0af468..580b00948 100644 --- a/apps/documenteditor/mobile/src/view/settings/Download.jsx +++ b/apps/documenteditor/mobile/src/view/settings/Download.jsx @@ -12,31 +12,31 @@ const PageDownload = props => { {_t.textDownloadAs} - + props.onSaveFormat(e.target.value)}> - + props.onSaveFormat(e.target.value)}> - + props.onSaveFormat(e.target.value)}> - + props.onSaveFormat(e.target.value)}> - + props.onSaveFormat(e.target.value)}> - + props.onSaveFormat(e.target.value)}> - + props.onSaveFormat(e.target.value)}> - + props.onSaveFormat(e.target.value)}> - + props.onSaveFormat(e.target.value)}>