diff --git a/.docker/desktop-apps.bake.Dockerfile b/.docker/desktop-apps.bake.Dockerfile index 8ab80540c..1b9ef6901 100644 --- a/.docker/desktop-apps.bake.Dockerfile +++ b/.docker/desktop-apps.bake.Dockerfile @@ -31,6 +31,7 @@ FROM core-base AS desktop-linux bison \ libnotify-dev \ libcups2-dev \ + libwayland-dev \ libdbus-1-dev \ libxcb-util0-dev \ libxcb-xkb-dev \ @@ -102,7 +103,7 @@ FROM core-base AS desktop-linux -DVCPKG_MANIFEST_FEATURES="desktop-editors" \ -DABOUT_PAGE_APP_NAME="${ABOUT_PAGE_APP_NAME}" \ /desktop-apps/win-linux/ && \ - cmake --build . && \ + cmake --build . -- -j4 && \ cmake --install . && \ ccache --show-stats && \ cp -a desktopeditors /desktopeditors diff --git a/common/loginpage/src/document-creation-grid.js b/common/loginpage/src/document-creation-grid.js index a654f0ecf..d40ac57ba 100644 --- a/common/loginpage/src/document-creation-grid.js +++ b/common/loginpage/src/document-creation-grid.js @@ -88,6 +88,13 @@ window.DocumentCreationGrid = function (config = {}) { `).join('')} `; + // clear any previous render (e.g. a re-render with a new + // DocumentCreationGrid instance after the default save format + // changed) -- queried against the DOM rather than the local + // $el, since a fresh instance's own $el starts out empty + // regardless of what an earlier instance already rendered here + parentElement.find('.document-creation-grid').remove(); + $parent = parentElement; $el = $parent.append(_template).find('.document-creation-grid'); }, diff --git a/common/loginpage/src/locale.js b/common/loginpage/src/locale.js index adb518edb..7e7bbf4b6 100644 --- a/common/loginpage/src/locale.js +++ b/common/loginpage/src/locale.js @@ -129,6 +129,10 @@ l10n.en = { settOptLaunchMode: 'Open file', settOptLaunchInTab: 'In its own tab', settOptLaunchInWindow: 'In its own window', + settDefaultSaveFormat: 'Default save format', + settOptFormatOoxml: 'Compatibility (OOXML)', + settOptFormatOdf: 'Sovereign (ODF)', + settDefaultSaveFormatManaged: 'Your default save format is managed by your organization.', settSpellcheckDetection: 'Spelling language detection', settOptDisabled: 'Disabled', settOptEnabled: 'Enabled', diff --git a/common/loginpage/src/panelrecent.js b/common/loginpage/src/panelrecent.js index ac3fe1c60..3aef7ac09 100755 --- a/common/loginpage/src/panelrecent.js +++ b/common/loginpage/src/panelrecent.js @@ -521,6 +521,76 @@ }); }; + function _document_types(format) { + const isODF = format === 'ODF'; + return [ + { + id: 'word', + title: utils.Lang.newDoc, + langKey: 'newDoc', + formatLabel: { + value: isODF ? 'ODT' : 'DOCX', + gradientColorStart: '#4298C5', + gradientColorEnd: '#2D84B2', + bgColorWinXP: '#287ca9', + }, + icon: '#docx-big', + }, + { + id: 'cell', + title: utils.Lang.newXlsx, + langKey: 'newXlsx', + formatLabel: { + value: isODF ? 'ODS' : 'XLSX', + gradientColorStart: '#5BB514', + gradientColorEnd: '#318C2B', + bgColorWinXP: '#3aa133', + }, + icon: '#xlsx-big', + }, + { + id: 'slide', + title: utils.Lang.newPptx, + langKey: 'newPptx', + formatLabel: { + value: isODF ? 'ODP' : 'PPTX', + gradientColorStart: '#F4893A', + gradientColorEnd: '#DE7341', + bgColorWinXP: '#f36700', + }, + icon: '#pptx-big', + }, + { + // forms always stay DOCXF/PDF regardless of the + // ODF/OOXML default save format setting + id: 'form', + title: utils.Lang.newForm, + langKey: 'newForm', + formatLabel: { + value: 'PDF', + gradientColorStart: '#F36653', + gradientColorEnd: '#D2402D', + bgColorWinXP: '#e54d39', + }, + icon: '#pdf-big', + } + ]; + } + + // (re)renders the "create new" tile grid for the given default save + // format ('ODF' or anything else, treated as OOXML). Safe to call + // repeatedly -- DocumentCreationGrid.render() clears its own previous + // output before appending. + function _render_document_grid(format) { + const docGrid = new DocumentCreationGrid({ + documentTypes: _document_types(format), + onDocumentSelect: (docType) => { + window.sdk.command("create:new", docType); + } + }); + docGrid.render(this.view.$panel.find("#area-document-creation-grid")); + } + function _init_ppmenu() { if (ppmenu) { Menu.closeAll(); @@ -657,6 +727,17 @@ } this.appready = true; + } else if (/settings:init/.test(cmd)) { + // read directly rather than relying solely on the + // Settings panel's own defaultformat:changed relay, + // since that panel (and its settings:init parsing) + // isn't constructed until the user opens Settings -- + // this fires at genuine startup regardless + try { + const settings = JSON.parse($('
').html(param).text()); + if (settings.defaultsaveformat) + _render_document_grid.call(this, settings.defaultsaveformat.format); + } catch (e) { /* ignore malformed settings:init */ } } }); @@ -674,66 +755,15 @@ this.dndZone = new DnDFileZone(); this.dndZone.render(this.view.$panel.find("#area-dnd-file")); - const docGrid = new DocumentCreationGrid({ - documentTypes: [ - { - id: 'word', - title: utils.Lang.newDoc, - langKey: 'newDoc', - formatLabel: { - value: 'DOCX', - gradientColorStart: '#4298C5', - gradientColorEnd: '#2D84B2', - bgColorWinXP: '#287ca9', - }, - icon: '#docx-big', - }, - { - id: 'cell', - title: utils.Lang.newXlsx, - langKey: 'newXlsx', - formatLabel: { - value: 'XLSX', - gradientColorStart: '#5BB514', - gradientColorEnd: '#318C2B', - bgColorWinXP: '#3aa133', - }, - icon: '#xlsx-big', - }, - { - id: 'slide', - title: utils.Lang.newPptx, - langKey: 'newPptx', - formatLabel: { - value: 'PPTX', - gradientColorStart: '#F4893A', - gradientColorEnd: '#DE7341', - bgColorWinXP: '#f36700', - }, - icon: '#pptx-big', - }, - { - id: 'form', - title: utils.Lang.newForm, - langKey: 'newForm', - formatLabel: { - value: 'PDF', - gradientColorStart: '#F36653', - gradientColorEnd: '#D2402D', - bgColorWinXP: '#e54d39', - }, - icon: '#pdf-big', - } - ], - onDocumentSelect: (docType) => { - window.sdk.command("create:new", docType); - } - }); + // renders with the OOXML labels first (matches the + // compiled-in Tier-1 default); corrected via settings:init + // above or defaultformat:changed below as soon as the + // actual resolved/chosen format is known + _render_document_grid.call(this, 'OOXML'); + CommonEvents.on('defaultformat:changed', _render_document_grid.bind(this)); CommonEvents.on('lang:changed', _init_ppmenu.bind(this)); - docGrid.render(this.view.$panel.find("#area-document-creation-grid")); - $('#idx-recent-filter', this.view.$panel).on('input', _on_filter_recents.bind(this)); return this; diff --git a/common/loginpage/src/panelsettings.js b/common/loginpage/src/panelsettings.js index fc3d24a24..adeaee696 100644 --- a/common/loginpage/src/panelsettings.js +++ b/common/loginpage/src/panelsettings.js @@ -247,6 +247,18 @@
+