aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar Vijay A <avijayr@protonmail.com>2021-09-14 05:57:08 +0530
committerLibravatar Vijay A <avijayr@protonmail.com>2021-09-14 05:57:08 +0530
commit1612c2abc4a9c1423388510b7cffb256ce811493 (patch)
tree3b16d2e690fbac66d5bd9b355f20258afed17112 /src
parentUpdate submodules, browserslist data updates and linter fixes [skip ci] (diff)
downloadferdium-app-1612c2abc4a9c1423388510b7cffb256ce811493.tar.gz
ferdium-app-1612c2abc4a9c1423388510b7cffb256ce811493.tar.zst
ferdium-app-1612c2abc4a9c1423388510b7cffb256ce811493.zip
Revert "refactor: reuse method from the core electron framework for the 'About' dialog."
This reverts commit af56a07359400e53cb3096e321bf6ee1bae12068. Fixes #1928 and #1929
Diffstat (limited to 'src')
-rw-r--r--src/environment.js16
-rw-r--r--src/index.js19
-rw-r--r--src/lib/Menu.js10
3 files changed, 26 insertions, 19 deletions
diff --git a/src/environment.js b/src/environment.js
index 9d7ffaf78..b30e3778d 100644
--- a/src/environment.js
+++ b/src/environment.js
@@ -5,6 +5,7 @@ import { is, api as electronApi } from 'electron-util';
5 5
6import { DEFAULT_ACCENT_COLOR } from '@meetfranz/theme'; 6import { DEFAULT_ACCENT_COLOR } from '@meetfranz/theme';
7 7
8import osName from 'os-name';
8import { 9import {
9 LIVE_FERDI_API, 10 LIVE_FERDI_API,
10 DEV_FRANZ_API, 11 DEV_FRANZ_API,
@@ -23,6 +24,7 @@ import {
23} from './config'; 24} from './config';
24 25
25import { asarPath } from './helpers/asar-helpers'; 26import { asarPath } from './helpers/asar-helpers';
27import * as buildInfo from './buildInfo.json'; // eslint-disable-line import/no-unresolved
26 28
27export const { app } = electronApi; 29export const { app } = electronApi;
28export const ferdiVersion = app.getVersion(); 30export const ferdiVersion = app.getVersion();
@@ -171,3 +173,17 @@ export const DEFAULT_APP_SETTINGS = {
171 alwaysShowWorkspaces: false, 173 alwaysShowWorkspaces: false,
172 liftSingleInstanceLock: false, 174 liftSingleInstanceLock: false,
173}; 175};
176
177export function aboutAppDetails() {
178 return [
179 `Version: ${ferdiVersion}`,
180 `Electron: ${electronVersion}`,
181 `Chrome: ${chromeVersion}`,
182 `Node.js: ${nodeVersion}`,
183 `Platform: ${osName()}`,
184 `Arch: ${process.arch}`,
185 `Build date: ${new Date(Number(buildInfo.timestamp))}`,
186 `Git SHA: ${buildInfo.gitHashShort}`,
187 `Git branch: ${buildInfo.gitBranch}`,
188 ].join('\n');
189}
diff --git a/src/index.js b/src/index.js
index 1f3510361..7f1f77b4e 100644
--- a/src/index.js
+++ b/src/index.js
@@ -10,7 +10,6 @@ import ms from 'ms';
10 10
11require('@electron/remote/main').initialize(); 11require('@electron/remote/main').initialize();
12 12
13import osName from 'os-name';
14import { DEFAULT_WINDOW_OPTIONS } from './config'; 13import { DEFAULT_WINDOW_OPTIONS } from './config';
15 14
16import { 15import {
@@ -19,12 +18,9 @@ import {
19 isMac, 18 isMac,
20 isWindows, 19 isWindows,
21 isLinux, 20 isLinux,
21 aboutAppDetails,
22 userDataRecipesPath, 22 userDataRecipesPath,
23 userDataPath, 23 userDataPath,
24 ferdiVersion,
25 electronVersion,
26 chromeVersion,
27 nodeVersion,
28} from './environment'; 24} from './environment';
29import { ifUndefinedBoolean } from './jsUtils'; 25import { ifUndefinedBoolean } from './jsUtils';
30 26
@@ -41,7 +37,6 @@ import './electron/exception';
41import { asarPath } from './helpers/asar-helpers'; 37import { asarPath } from './helpers/asar-helpers';
42import { openExternalUrl } from './helpers/url-helpers'; 38import { openExternalUrl } from './helpers/url-helpers';
43import userAgent from './helpers/userAgent-helpers'; 39import userAgent from './helpers/userAgent-helpers';
44import * as buildInfo from './buildInfo.json'; // eslint-disable-line import/no-unresolved
45 40
46const debug = require('debug')('Ferdi:App'); 41const debug = require('debug')('Ferdi:App');
47 42
@@ -160,17 +155,7 @@ if (!retrieveSettingValue('enableGPUAcceleration', false)) {
160} 155}
161 156
162app.setAboutPanelOptions({ 157app.setAboutPanelOptions({
163 applicationVersion: [ 158 applicationVersion: aboutAppDetails(),
164 `Version: ${ferdiVersion}`,
165 `Electron: ${electronVersion}`,
166 `Chrome: ${chromeVersion}`,
167 `Node.js: ${nodeVersion}`,
168 `Platform: ${osName()}`,
169 `Arch: ${process.arch}`,
170 `Build date: ${new Date(Number(buildInfo.timestamp))}`,
171 `Git SHA: ${buildInfo.gitHashShort}`,
172 `Git branch: ${buildInfo.gitBranch}`,
173 ].join('\n'),
174 version: '', 159 version: '',
175}); 160});
176 161
diff --git a/src/lib/Menu.js b/src/lib/Menu.js
index d7f3dbecf..623638d33 100644
--- a/src/lib/Menu.js
+++ b/src/lib/Menu.js
@@ -1,5 +1,5 @@
1import { clipboard } from 'electron'; 1import { clipboard } from 'electron';
2import { app, Menu, systemPreferences } from '@electron/remote'; 2import { app, Menu, dialog, systemPreferences } from '@electron/remote';
3import { autorun, observable } from 'mobx'; 3import { autorun, observable } from 'mobx';
4import { defineMessages } from 'react-intl'; 4import { defineMessages } from 'react-intl';
5import { 5import {
@@ -14,6 +14,7 @@ import {
14 settingsShortcutKey, 14 settingsShortcutKey,
15 isLinux, 15 isLinux,
16 isMac, 16 isMac,
17 aboutAppDetails,
17 lockFerdiShortcutKey, 18 lockFerdiShortcutKey,
18 todosToggleShortcutKey, 19 todosToggleShortcutKey,
19 workspaceToggleShortcutKey, 20 workspaceToggleShortcutKey,
@@ -804,7 +805,12 @@ class FranzMenu {
804 const about = { 805 const about = {
805 label: intl.formatMessage(menuItems.about), 806 label: intl.formatMessage(menuItems.about),
806 click: () => { 807 click: () => {
807 app.showAboutPanel(); 808 dialog.showMessageBox({
809 type: 'info',
810 title: 'Franz Ferdinand',
811 message: 'Ferdi',
812 detail: aboutAppDetails(),
813 });
808 }, 814 },
809 }; 815 };
810 816