diff options
author | 2019-10-06 15:09:32 +0200 | |
---|---|---|
committer | 2019-10-06 15:09:32 +0200 | |
commit | 26c075372a1bb461752c873cfed0a96b10a4bba9 (patch) | |
tree | 3eaf471910990e81b2d718e42c3e9e31bbdc6cd0 /src/containers | |
parent | Merge pull request #102 from getferdi/l10n_master (diff) | |
download | ferdium-app-26c075372a1bb461752c873cfed0a96b10a4bba9.tar.gz ferdium-app-26c075372a1bb461752c873cfed0a96b10a4bba9.tar.zst ferdium-app-26c075372a1bb461752c873cfed0a96b10a4bba9.zip |
Add option to choose hibernation strategy
Diffstat (limited to 'src/containers')
-rw-r--r-- | src/containers/settings/EditSettingsScreen.js | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/containers/settings/EditSettingsScreen.js b/src/containers/settings/EditSettingsScreen.js index 463a290d2..8b9d21b87 100644 --- a/src/containers/settings/EditSettingsScreen.js +++ b/src/containers/settings/EditSettingsScreen.js | |||
@@ -9,7 +9,7 @@ import UserStore from '../../stores/UserStore'; | |||
9 | import TodosStore from '../../features/todos/store'; | 9 | import TodosStore from '../../features/todos/store'; |
10 | import Form from '../../lib/Form'; | 10 | import Form from '../../lib/Form'; |
11 | import { APP_LOCALES, SPELLCHECKER_LOCALES } from '../../i18n/languages'; | 11 | import { APP_LOCALES, SPELLCHECKER_LOCALES } from '../../i18n/languages'; |
12 | import { DEFAULT_APP_SETTINGS, DEFAULT_LOCK_PASSWORD } from '../../config'; | 12 | import { DEFAULT_APP_SETTINGS, DEFAULT_LOCK_PASSWORD, HIBERNATION_STRATEGIES } from '../../config'; |
13 | import { config as spellcheckerConfig } from '../../features/spellchecker'; | 13 | import { config as spellcheckerConfig } from '../../features/spellchecker'; |
14 | 14 | ||
15 | import { getSelectOptions } from '../../helpers/i18n-helpers'; | 15 | import { getSelectOptions } from '../../helpers/i18n-helpers'; |
@@ -53,6 +53,10 @@ const messages = defineMessages({ | |||
53 | id: 'settings.app.form.hibernate', | 53 | id: 'settings.app.form.hibernate', |
54 | defaultMessage: '!!!Enable service hibernation', | 54 | defaultMessage: '!!!Enable service hibernation', |
55 | }, | 55 | }, |
56 | hibernationStrategy: { | ||
57 | id: 'settings.app.form.hibernationStrategy', | ||
58 | defaultMessage: '!!!Hibernation strategy', | ||
59 | }, | ||
56 | server: { | 60 | server: { |
57 | id: 'settings.app.form.server', | 61 | id: 'settings.app.form.server', |
58 | defaultMessage: '!!!Server', | 62 | defaultMessage: '!!!Server', |
@@ -151,6 +155,7 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e | |||
151 | minimizeToSystemTray: settingsData.minimizeToSystemTray, | 155 | minimizeToSystemTray: settingsData.minimizeToSystemTray, |
152 | privateNotifications: settingsData.privateNotifications, | 156 | privateNotifications: settingsData.privateNotifications, |
153 | hibernate: settingsData.hibernate, | 157 | hibernate: settingsData.hibernate, |
158 | hibernationStrategy: settingsData.hibernationStrategy, | ||
154 | server: settingsData.server, | 159 | server: settingsData.server, |
155 | todoServer: settingsData.todoServer, | 160 | todoServer: settingsData.todoServer, |
156 | lockingFeatureEnabled: settingsData.lockingFeatureEnabled, | 161 | lockingFeatureEnabled: settingsData.lockingFeatureEnabled, |
@@ -203,6 +208,11 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e | |||
203 | locales: APP_LOCALES, | 208 | locales: APP_LOCALES, |
204 | }); | 209 | }); |
205 | 210 | ||
211 | const hibernationStrategies = getSelectOptions({ | ||
212 | locales: HIBERNATION_STRATEGIES, | ||
213 | sort: false, | ||
214 | }); | ||
215 | |||
206 | const spellcheckingLanguages = getSelectOptions({ | 216 | const spellcheckingLanguages = getSelectOptions({ |
207 | locales: SPELLCHECKER_LOCALES, | 217 | locales: SPELLCHECKER_LOCALES, |
208 | automaticDetectionText: this.context.intl.formatMessage(globalMessages.spellcheckerAutomaticDetection), | 218 | automaticDetectionText: this.context.intl.formatMessage(globalMessages.spellcheckerAutomaticDetection), |
@@ -245,6 +255,12 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e | |||
245 | value: settings.all.app.hibernate, | 255 | value: settings.all.app.hibernate, |
246 | default: DEFAULT_APP_SETTINGS.hibernate, | 256 | default: DEFAULT_APP_SETTINGS.hibernate, |
247 | }, | 257 | }, |
258 | hibernationStrategy: { | ||
259 | label: intl.formatMessage(messages.hibernationStrategy), | ||
260 | value: settings.all.app.hibernationStrategy, | ||
261 | options: hibernationStrategies, | ||
262 | default: DEFAULT_APP_SETTINGS.hibernationStrategy, | ||
263 | }, | ||
248 | server: { | 264 | server: { |
249 | label: intl.formatMessage(messages.server), | 265 | label: intl.formatMessage(messages.server), |
250 | value: settings.all.app.server || API, | 266 | value: settings.all.app.server || API, |
@@ -393,6 +409,7 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e | |||
393 | server={server || 'https://api.franzinfra.com'} | 409 | server={server || 'https://api.franzinfra.com'} |
394 | lockingFeatureEnabled={lockingFeatureEnabled} | 410 | lockingFeatureEnabled={lockingFeatureEnabled} |
395 | noUpdates={this.props.stores.settings.app.noUpdates} | 411 | noUpdates={this.props.stores.settings.app.noUpdates} |
412 | hibernationEnabled={this.props.stores.settings.app.hibernate} | ||
396 | /> | 413 | /> |
397 | </ErrorBoundary> | 414 | </ErrorBoundary> |
398 | ); | 415 | ); |