diff --git a/_locales/en/messages.json b/_locales/en/messages.json index e899aaf4e3b8..301a2d70a6b8 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -1383,7 +1383,7 @@ }, "spellCheckDescription": { "message": "Enable spell check of text entered in message composition box", - "description": "Description of the media permission description" + "description": "Description of the spell check setting" }, "spellCheckWillBeEnabled": { "message": "Spell check will be enabled the next time Signal starts.", @@ -1393,6 +1393,10 @@ "message": "Spell check will be disabled the next time Signal starts.", "description": "Shown when the user disables spellcheck to indicate that they must restart Signal." }, + "autoLaunchDescription": { + "message": "Open at computer login", + "description": "Description for the automatic launch setting" + }, "clearDataHeader": { "message": "Clear Data", "description": "Header in the settings dialog for the section dealing with data deletion" diff --git a/js/settings_start.js b/js/settings_start.js index 1941271a8afb..579261c0b89e 100644 --- a/js/settings_start.js +++ b/js/settings_start.js @@ -36,6 +36,7 @@ const getInitialData = async () => ({ countMutedConversations: await window.getCountMutedConversations(), spellCheck: await window.getSpellCheck(), + autoLaunch: await window.getAutoLaunch(), incomingCallNotification: await window.getIncomingCallNotification(), callRingtoneNotification: await window.getCallRingtoneNotification(), diff --git a/js/views/settings_view.js b/js/views/settings_view.js index e1442aad41d6..66a38ee7556e 100644 --- a/js/views/settings_view.js +++ b/js/views/settings_view.js @@ -152,6 +152,12 @@ window.setSpellCheck(val); }, }); + new CheckboxView({ + el: this.$('.auto-launch-setting'), + name: 'auto-launch-setting', + value: window.initialData.autoLaunch, + setFn: window.setAutoLaunch, + }); if (Settings.isHideMenuBarSupported()) { new CheckboxView({ el: this.$('.menu-bar-setting'), @@ -259,6 +265,7 @@ spellCheckDirtyText: appStartSpellCheck ? i18n('spellCheckWillBeDisabled') : i18n('spellCheckWillBeEnabled'), + autoLaunchDescription: i18n('autoLaunchDescription'), }; }, onClose() { diff --git a/main.js b/main.js index a616ef46c03f..36c5e9e4a475 100644 --- a/main.js +++ b/main.js @@ -1554,6 +1554,9 @@ installSettingsSetter('badge-count-muted-conversations'); installSettingsGetter('spell-check'); installSettingsSetter('spell-check', true); +installSettingsGetter('auto-launch'); +installSettingsSetter('auto-launch'); + installSettingsGetter('always-relay-calls'); installSettingsSetter('always-relay-calls'); installSettingsGetter('call-ringtone-notification'); diff --git a/preload.js b/preload.js index 97be98183bab..52aaf6c85d5e 100644 --- a/preload.js +++ b/preload.js @@ -68,6 +68,10 @@ try { window.getServerPublicParams = () => config.serverPublicParams; window.getSfuUrl = () => config.sfuUrl; window.isBehindProxy = () => Boolean(config.proxyUrl); + window.getAutoLaunch = () => app.getLoginItemSettings().openAtLogin; + window.setAutoLaunch = value => { + app.setLoginItemSettings({ openAtLogin: Boolean(value) }); + }; function setSystemTheme() { window.systemTheme = nativeTheme.shouldUseDarkColors ? 'dark' : 'light'; @@ -251,6 +255,9 @@ try { installGetter('spell-check', 'getSpellCheck'); installSetter('spell-check', 'setSpellCheck'); + installGetter('auto-launch', 'getAutoLaunch'); + installSetter('auto-launch', 'setAutoLaunch'); + installGetter('always-relay-calls', 'getAlwaysRelayCalls'); installSetter('always-relay-calls', 'setAlwaysRelayCalls'); diff --git a/settings.html b/settings.html index fde6bcf2e9c1..a5def47d4abd 100644 --- a/settings.html +++ b/settings.html @@ -118,6 +118,10 @@ {{ spellCheckDirtyText }}
+