diff options
author | 2020-01-29 11:17:04 +0100 | |
---|---|---|
committer | 2020-01-29 11:17:04 +0100 | |
commit | 469bc0ee855f5ca46a781213f0959b7841fadaf3 (patch) | |
tree | 428cfd5359d992bc0a8b9855d3d8a57301068a6a /src/components | |
parent | Bump version number (diff) | |
download | ferdium-app-469bc0ee855f5ca46a781213f0959b7841fadaf3.tar.gz ferdium-app-469bc0ee855f5ca46a781213f0959b7841fadaf3.tar.zst ferdium-app-469bc0ee855f5ca46a781213f0959b7841fadaf3.zip |
#179 Add inactivity timer
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/settings/settings/EditSettingsForm.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/components/settings/settings/EditSettingsForm.js b/src/components/settings/settings/EditSettingsForm.js index 74f5924ea..9064ff234 100644 --- a/src/components/settings/settings/EditSettingsForm.js +++ b/src/components/settings/settings/EditSettingsForm.js | |||
@@ -36,6 +36,10 @@ const messages = defineMessages({ | |||
36 | id: 'settings.app.hibernateInfo', | 36 | id: 'settings.app.hibernateInfo', |
37 | defaultMessage: '!!!By default, Ferdi will keep all your services open and loaded in the background so they are ready when you want to use them. Service Hibernation will unload your services after a specified amount. This is useful to save RAM or keeping services from slowing down your computer.', | 37 | defaultMessage: '!!!By default, Ferdi will keep all your services open and loaded in the background so they are ready when you want to use them. Service Hibernation will unload your services after a specified amount. This is useful to save RAM or keeping services from slowing down your computer.', |
38 | }, | 38 | }, |
39 | inactivityLockInfo: { | ||
40 | id: 'settings.app.inactivityLockInfo', | ||
41 | defaultMessage: '!!!Minutes of inactivity, after which Ferdi should automatically lock. Use 0 to disable', | ||
42 | }, | ||
39 | serverInfo: { | 43 | serverInfo: { |
40 | id: 'settings.app.serverInfo', | 44 | id: 'settings.app.serverInfo', |
41 | defaultMessage: '!!!We advice you to logout after changing your server as your settings might not be saved otherwise.', | 45 | defaultMessage: '!!!We advice you to logout after changing your server as your settings might not be saved otherwise.', |
@@ -142,6 +146,10 @@ const messages = defineMessages({ | |||
142 | }, | 146 | }, |
143 | }); | 147 | }); |
144 | 148 | ||
149 | const Hr = () => ( | ||
150 | <hr style={{ marginBottom: 20 }} /> | ||
151 | ); | ||
152 | |||
145 | export default @observer class EditSettingsForm extends Component { | 153 | export default @observer class EditSettingsForm extends Component { |
146 | static propTypes = { | 154 | static propTypes = { |
147 | checkForUpdates: PropTypes.func.isRequired, | 155 | checkForUpdates: PropTypes.func.isRequired, |
@@ -237,6 +245,9 @@ export default @observer class EditSettingsForm extends Component { | |||
237 | <Toggle field={form.$('enableSystemTray')} /> | 245 | <Toggle field={form.$('enableSystemTray')} /> |
238 | <Toggle field={form.$('privateNotifications')} /> | 246 | <Toggle field={form.$('privateNotifications')} /> |
239 | <Toggle field={form.$('showServiceNavigationBar')} /> | 247 | <Toggle field={form.$('showServiceNavigationBar')} /> |
248 | |||
249 | <Hr /> | ||
250 | |||
240 | <Toggle field={form.$('hibernate')} /> | 251 | <Toggle field={form.$('hibernate')} /> |
241 | {hibernationEnabled && ( | 252 | {hibernationEnabled && ( |
242 | <Select field={form.$('hibernationStrategy')} /> | 253 | <Select field={form.$('hibernationStrategy')} /> |
@@ -251,9 +262,13 @@ export default @observer class EditSettingsForm extends Component { | |||
251 | { intl.formatMessage(messages.hibernateInfo) } | 262 | { intl.formatMessage(messages.hibernateInfo) } |
252 | </span> | 263 | </span> |
253 | </p> | 264 | </p> |
265 | |||
266 | <Hr /> | ||
267 | |||
254 | {process.platform === 'win32' && ( | 268 | {process.platform === 'win32' && ( |
255 | <Toggle field={form.$('minimizeToSystemTray')} /> | 269 | <Toggle field={form.$('minimizeToSystemTray')} /> |
256 | )} | 270 | )} |
271 | |||
257 | <Input | 272 | <Input |
258 | placeholder="Server" | 273 | placeholder="Server" |
259 | onChange={e => this.submit(e)} | 274 | onChange={e => this.submit(e)} |
@@ -296,6 +311,10 @@ export default @observer class EditSettingsForm extends Component { | |||
296 | {isWorkspaceEnabled && ( | 311 | {isWorkspaceEnabled && ( |
297 | <Toggle field={form.$('keepAllWorkspacesLoaded')} /> | 312 | <Toggle field={form.$('keepAllWorkspacesLoaded')} /> |
298 | )} | 313 | )} |
314 | |||
315 | |||
316 | <Hr /> | ||
317 | |||
299 | {isTodosEnabled && ( | 318 | {isTodosEnabled && ( |
300 | <> | 319 | <> |
301 | <Toggle field={form.$('enableTodos')} /> | 320 | <Toggle field={form.$('enableTodos')} /> |
@@ -315,6 +334,8 @@ export default @observer class EditSettingsForm extends Component { | |||
315 | </> | 334 | </> |
316 | )} | 335 | )} |
317 | 336 | ||
337 | <Hr /> | ||
338 | |||
318 | <Toggle field={form.$('lockingFeatureEnabled')} /> | 339 | <Toggle field={form.$('lockingFeatureEnabled')} /> |
319 | {lockingFeatureEnabled && ( | 340 | {lockingFeatureEnabled && ( |
320 | <> | 341 | <> |
@@ -329,6 +350,16 @@ export default @observer class EditSettingsForm extends Component { | |||
329 | <p> | 350 | <p> |
330 | { intl.formatMessage(messages.lockedPasswordInfo) } | 351 | { intl.formatMessage(messages.lockedPasswordInfo) } |
331 | </p> | 352 | </p> |
353 | |||
354 | <Input | ||
355 | placeholder="Lock after inactivity" | ||
356 | onChange={e => this.submit(e)} | ||
357 | field={form.$('inactivityLock')} | ||
358 | autoFocus | ||
359 | /> | ||
360 | <p> | ||
361 | { intl.formatMessage(messages.inactivityLockInfo) } | ||
362 | </p> | ||
332 | </> | 363 | </> |
333 | )} | 364 | )} |
334 | <p | 365 | <p |
@@ -342,6 +373,7 @@ export default @observer class EditSettingsForm extends Component { | |||
342 | </span> | 373 | </span> |
343 | </p> | 374 | </p> |
344 | 375 | ||
376 | <Hr /> | ||
345 | 377 | ||
346 | <Toggle field={form.$('scheduledDNDEnabled')} /> | 378 | <Toggle field={form.$('scheduledDNDEnabled')} /> |
347 | {scheduledDNDEnabled && ( | 379 | {scheduledDNDEnabled && ( |