From 77110a7a36f9576afb32e70e0c038a0aab1cdf42 Mon Sep 17 00:00:00 2001 From: Yuya Ochiai Date: Thu, 2 Feb 2017 00:04:48 +0900 Subject: [PATCH] Update the order and messages of app options --- src/browser/components/SettingsPage.jsx | 126 +++++++++++++++--------- 1 file changed, 79 insertions(+), 47 deletions(-) diff --git a/src/browser/components/SettingsPage.jsx b/src/browser/components/SettingsPage.jsx index c8143508..8d57df30 100644 --- a/src/browser/components/SettingsPage.jsx +++ b/src/browser/components/SettingsPage.jsx @@ -1,6 +1,6 @@ const React = require('react'); const ReactDOM = require('react-dom'); -const {Button, Checkbox, Col, FormGroup, FormControl, ControlLabel, Grid, Navbar, Row} = require('react-bootstrap'); +const {Button, Checkbox, Col, FormGroup, FormControl, ControlLabel, Grid, HelpBlock, Navbar, Row} = require('react-bootstrap'); const {ipcRenderer, remote} = require('electron'); const AutoLaunch = require('auto-launch'); @@ -99,7 +99,7 @@ const SettingsPage = React.createClass({ }, handleChangeDisableWebSecurity() { this.setState({ - disablewebsecurity: !this.refs.disablewebsecurity.props.checked + disablewebsecurity: this.refs.disablewebsecurity.props.checked }); }, handleChangeHideMenuBar() { @@ -198,6 +198,70 @@ const SettingsPage = React.createClass({ ); var options = []; + + // MacOS has an option in the Dock, to set the app to autostart, so we choose to not support this option for OSX + if (process.platform === 'win32' || process.platform === 'linux') { + options.push( + {'Start app on login'} + + {'Enabling automatically starts the app when you log in to your machine.'} + {' '} + {'The app will initially start minimized and appear on the taskbar.'} + + ); + } + + options.push( + {'Display secure content only'} + + {'Enabling allows only secure (HTTPS/SSL) content.'} + {' '} + {'Disabling allows the app to display non-secure (HTTP) content such as images.'} + + ); + + if (process.platform === 'darwin' || process.platform === 'win32') { + options.push( + {'Show red badge on taskbar icon to indicate unread messages'} + + {'Regardless of this setting, mentions are always indicated with a red badge and item count on the taskbar icon.'} + + ); + } + + if (process.platform === 'win32' || process.platform === 'linux') { + options.push( + {'Flash taskbar icon when a new message is received'} + + {'Taskbar icon flashes for a few seconds when a new message is received.'} + + ); + } + if (process.platform === 'darwin' || process.platform === 'linux') { options.push( {process.platform === 'darwin' ? - 'Show icon on menu bar (need to restart the application)' : - 'Show icon in notification area (need to restart the application)'}); + 'Show Mattermost icon in the menu bar' : + 'Show icon in the notification area'} + + {'Setting takes effect after restarting the app.'} + + ); } if (process.platform === 'linux') { options.push( @@ -226,26 +294,6 @@ const SettingsPage = React.createClass({ ); } - options.push( - {'Allow mixed content (Enabling allows both secure and insecure content, images and scripts to render and execute. Disabling allows only secure content.)'}); - - //OSX has an option in the Dock, to set the app to autostart, so we choose to not support this option for OSX - if (process.platform === 'win32' || process.platform === 'linux') { - options.push( - {'Start app on login.'}); - } if (process.platform === 'linux') { options.push( @@ -256,29 +304,13 @@ const SettingsPage = React.createClass({ disabled={!this.state.showTrayIcon || !this.state.trayWasVisible} checked={this.state.minimizeToTray} onChange={this.handleChangeMinimizeToTray} - >{this.state.trayWasVisible || !this.state.showTrayIcon ? 'Leave app running in notification area when the window is closed' : 'Leave app running in notification area when the window is closed (available on next restart)'}); - } - - if (process.platform === 'darwin' || process.platform === 'win32') { - options.push( - {'Show red badge on taskbar icon to indicate unread messages. Regardless of this setting, mentions are always indicated with a red badge and item count on the taskbar icon.'}); - } - - if (process.platform === 'win32' || process.platform === 'linux') { - options.push( - {'Flash the taskbar icon when a new message is received.'}); + > + {'Leave app running in notification area when application window is closed'} + + {'Enabling will leave the app running in the notification center when app window is closed.'} + {this.state.trayWasVisible || !this.state.showTrayIcon ? '' : ' Setting takes effect after restarting the app.'} + + ); } const settingsPage = {