Abstract electron settings properly to avoid boilerplate-hell (#8798)

* Remove unused method `BasePlatform::screenCaptureErrorString`

* Improve platform typescripting

* Remove redundant awaits

* Abstract electron settings properly to avoid boilerplate-hell

* i18n

* Fix stray semi-colons

* Fix setting level order for Platform settings
This commit is contained in:
Michael Telatynski 2022-06-10 22:38:50 +01:00 committed by GitHub
parent 9b8b1d193e
commit ba2ce5ecba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 122 additions and 220 deletions

View file

@ -1042,4 +1042,32 @@ export const SETTINGS: {[setting: string]: ISetting} = {
supportedLevels: LEVELS_UI_FEATURE,
default: true,
},
// Electron-specific settings, they are stored by Electron and set/read over an IPC.
// We store them over there are they are necessary to know before the renderer process launches.
"Electron.autoLaunch": {
supportedLevels: [SettingLevel.PLATFORM],
displayName: _td("Start automatically after system login"),
default: false,
},
"Electron.warnBeforeExit": {
supportedLevels: [SettingLevel.PLATFORM],
displayName: _td("Warn before quitting"),
default: true,
},
"Electron.alwaysShowMenuBar": {
supportedLevels: [SettingLevel.PLATFORM],
displayName: _td("Always show the window menu bar"),
default: false,
},
"Electron.showTrayIcon": {
supportedLevels: [SettingLevel.PLATFORM],
displayName: _td("Show tray icon and minimise window to it on close"),
default: true,
},
"Electron.enableHardwareAcceleration": {
supportedLevels: [SettingLevel.PLATFORM],
displayName: _td("Enable hardware acceleration"),
default: true,
},
};