diff options
Diffstat (limited to 'src/containers/settings')
-rw-r--r-- | src/containers/settings/AccountScreen.js | 3 | ||||
-rw-r--r-- | src/containers/settings/EditServiceScreen.js | 14 | ||||
-rw-r--r-- | src/containers/settings/EditSettingsScreen.js | 65 | ||||
-rw-r--r-- | src/containers/settings/EditUserScreen.js | 3 | ||||
-rw-r--r-- | src/containers/settings/InviteScreen.js | 3 | ||||
-rw-r--r-- | src/containers/settings/RecipesScreen.js | 3 | ||||
-rw-r--r-- | src/containers/settings/ServicesScreen.js | 3 | ||||
-rw-r--r-- | src/containers/settings/SettingsWindow.js | 3 |
8 files changed, 50 insertions, 47 deletions
diff --git a/src/containers/settings/AccountScreen.js b/src/containers/settings/AccountScreen.js index c5c2982b0..5818af0b1 100644 --- a/src/containers/settings/AccountScreen.js +++ b/src/containers/settings/AccountScreen.js | |||
@@ -12,8 +12,7 @@ import AccountDashboard from '../../components/settings/account/AccountDashboard | |||
12 | 12 | ||
13 | const { BrowserWindow } = remote; | 13 | const { BrowserWindow } = remote; |
14 | 14 | ||
15 | @inject('stores', 'actions') @observer | 15 | export default @inject('stores', 'actions') @observer class AccountScreen extends Component { |
16 | export default class AccountScreen extends Component { | ||
17 | componentDidMount() { | 16 | componentDidMount() { |
18 | gaPage('Settings/Account Dashboard'); | 17 | gaPage('Settings/Account Dashboard'); |
19 | } | 18 | } |
diff --git a/src/containers/settings/EditServiceScreen.js b/src/containers/settings/EditServiceScreen.js index f2d5550e1..17d727642 100644 --- a/src/containers/settings/EditServiceScreen.js +++ b/src/containers/settings/EditServiceScreen.js | |||
@@ -7,6 +7,7 @@ import UserStore from '../../stores/UserStore'; | |||
7 | import RecipesStore from '../../stores/RecipesStore'; | 7 | import RecipesStore from '../../stores/RecipesStore'; |
8 | import ServicesStore from '../../stores/ServicesStore'; | 8 | import ServicesStore from '../../stores/ServicesStore'; |
9 | import FeaturesStore from '../../stores/FeaturesStore'; | 9 | import FeaturesStore from '../../stores/FeaturesStore'; |
10 | import SettingsStore from '../../stores/SettingsStore'; | ||
10 | import Form from '../../lib/Form'; | 11 | import Form from '../../lib/Form'; |
11 | import { gaPage } from '../../lib/analytics'; | 12 | import { gaPage } from '../../lib/analytics'; |
12 | 13 | ||
@@ -51,10 +52,13 @@ const messages = defineMessages({ | |||
51 | id: 'settings.service.form.icon', | 52 | id: 'settings.service.form.icon', |
52 | defaultMessage: '!!!Custom icon', | 53 | defaultMessage: '!!!Custom icon', |
53 | }, | 54 | }, |
55 | enableDarkMode: { | ||
56 | id: 'settings.service.form.enableDarkMode', | ||
57 | defaultMessage: '!!!Enable Dark Mode', | ||
58 | }, | ||
54 | }); | 59 | }); |
55 | 60 | ||
56 | @inject('stores', 'actions') @observer | 61 | export default @inject('stores', 'actions') @observer class EditServiceScreen extends Component { |
57 | export default class EditServiceScreen extends Component { | ||
58 | static contextTypes = { | 62 | static contextTypes = { |
59 | intl: intlShape, | 63 | intl: intlShape, |
60 | }; | 64 | }; |
@@ -113,6 +117,11 @@ export default class EditServiceScreen extends Component { | |||
113 | default: null, | 117 | default: null, |
114 | type: 'file', | 118 | type: 'file', |
115 | }, | 119 | }, |
120 | isDarkModeEnabled: { | ||
121 | label: intl.formatMessage(messages.enableDarkMode), | ||
122 | value: service.isDarkModeEnabled, | ||
123 | default: this.props.stores.settings.all.app.darkMode, | ||
124 | }, | ||
116 | }, | 125 | }, |
117 | }; | 126 | }; |
118 | 127 | ||
@@ -245,6 +254,7 @@ EditServiceScreen.wrappedComponent.propTypes = { | |||
245 | recipes: PropTypes.instanceOf(RecipesStore).isRequired, | 254 | recipes: PropTypes.instanceOf(RecipesStore).isRequired, |
246 | services: PropTypes.instanceOf(ServicesStore).isRequired, | 255 | services: PropTypes.instanceOf(ServicesStore).isRequired, |
247 | features: PropTypes.instanceOf(FeaturesStore).isRequired, | 256 | features: PropTypes.instanceOf(FeaturesStore).isRequired, |
257 | settings: PropTypes.instanceOf(SettingsStore).isRequired, | ||
248 | }).isRequired, | 258 | }).isRequired, |
249 | router: PropTypes.shape({ | 259 | router: PropTypes.shape({ |
250 | params: PropTypes.shape({ | 260 | params: PropTypes.shape({ |
diff --git a/src/containers/settings/EditSettingsScreen.js b/src/containers/settings/EditSettingsScreen.js index 1fa7ce8bc..df6442eb8 100644 --- a/src/containers/settings/EditSettingsScreen.js +++ b/src/containers/settings/EditSettingsScreen.js | |||
@@ -39,6 +39,10 @@ const messages = defineMessages({ | |||
39 | id: 'settings.app.form.language', | 39 | id: 'settings.app.form.language', |
40 | defaultMessage: '!!!Language', | 40 | defaultMessage: '!!!Language', |
41 | }, | 41 | }, |
42 | darkMode: { | ||
43 | id: 'settings.app.form.darkMode', | ||
44 | defaultMessage: '!!!Dark Mode', | ||
45 | }, | ||
42 | showDisabledServices: { | 46 | showDisabledServices: { |
43 | id: 'settings.app.form.showDisabledServices', | 47 | id: 'settings.app.form.showDisabledServices', |
44 | defaultMessage: '!!!Display disabled services tabs', | 48 | defaultMessage: '!!!Display disabled services tabs', |
@@ -51,22 +55,21 @@ const messages = defineMessages({ | |||
51 | id: 'settings.app.form.enableSpellchecking', | 55 | id: 'settings.app.form.enableSpellchecking', |
52 | defaultMessage: '!!!Enable spell checking', | 56 | defaultMessage: '!!!Enable spell checking', |
53 | }, | 57 | }, |
58 | enableGPUAcceleration: { | ||
59 | id: 'settings.app.form.enableGPUAcceleration', | ||
60 | defaultMessage: '!!!Enable GPU Acceleration', | ||
61 | }, | ||
54 | spellcheckingLanguage: { | 62 | spellcheckingLanguage: { |
55 | id: 'settings.app.form.spellcheckingLanguage', | 63 | id: 'settings.app.form.spellcheckingLanguage', |
56 | defaultMessage: '!!!Language for spell checking', | 64 | defaultMessage: '!!!Language for spell checking', |
57 | }, | 65 | }, |
58 | // spellcheckingAutomaticDetection: { | ||
59 | // id: 'settings.app.form.spellcheckingAutomaticDetection', | ||
60 | // defaultMessage: '!!!Detect language automatically', | ||
61 | // }, | ||
62 | beta: { | 66 | beta: { |
63 | id: 'settings.app.form.beta', | 67 | id: 'settings.app.form.beta', |
64 | defaultMessage: '!!!Include beta versions', | 68 | defaultMessage: '!!!Include beta versions', |
65 | }, | 69 | }, |
66 | }); | 70 | }); |
67 | 71 | ||
68 | @inject('stores', 'actions') @observer | 72 | export default @inject('stores', 'actions') @observer class EditSettingsScreen extends Component { |
69 | export default class EditSettingsScreen extends Component { | ||
70 | static contextTypes = { | 73 | static contextTypes = { |
71 | intl: intlShape, | 74 | intl: intlShape, |
72 | }; | 75 | }; |
@@ -84,22 +87,25 @@ export default class EditSettingsScreen extends Component { | |||
84 | }); | 87 | }); |
85 | 88 | ||
86 | settings.update({ | 89 | settings.update({ |
87 | settings: { | 90 | type: 'app', |
91 | data: { | ||
88 | runInBackground: settingsData.runInBackground, | 92 | runInBackground: settingsData.runInBackground, |
89 | enableSystemTray: settingsData.enableSystemTray, | 93 | enableSystemTray: settingsData.enableSystemTray, |
90 | minimizeToSystemTray: settingsData.minimizeToSystemTray, | 94 | minimizeToSystemTray: settingsData.minimizeToSystemTray, |
95 | enableGPUAcceleration: settingsData.enableGPUAcceleration, | ||
91 | showDisabledServices: settingsData.showDisabledServices, | 96 | showDisabledServices: settingsData.showDisabledServices, |
97 | darkMode: settingsData.darkMode, | ||
92 | showMessageBadgeWhenMuted: settingsData.showMessageBadgeWhenMuted, | 98 | showMessageBadgeWhenMuted: settingsData.showMessageBadgeWhenMuted, |
93 | enableSpellchecking: settingsData.enableSpellchecking, | 99 | enableSpellchecking: settingsData.enableSpellchecking, |
94 | // spellcheckingLanguage: settingsData.spellcheckingLanguage, | 100 | beta: settingsData.beta, // we need this info in the main process as well |
95 | locale: settingsData.locale, | 101 | locale: settingsData.locale, // we need this info in the main process as well |
96 | beta: settingsData.beta, | ||
97 | }, | 102 | }, |
98 | }); | 103 | }); |
99 | 104 | ||
100 | user.update({ | 105 | user.update({ |
101 | userData: { | 106 | userData: { |
102 | beta: settingsData.beta, | 107 | beta: settingsData.beta, |
108 | locale: settingsData.locale, | ||
103 | }, | 109 | }, |
104 | }); | 110 | }); |
105 | } | 111 | } |
@@ -116,17 +122,6 @@ export default class EditSettingsScreen extends Component { | |||
116 | }); | 122 | }); |
117 | }); | 123 | }); |
118 | 124 | ||
119 | // const spellcheckerLocales = [{ | ||
120 | // value: 'auto', | ||
121 | // label: intl.formatMessage(messages.spellcheckingAutomaticDetection), | ||
122 | // }]; | ||
123 | // Object.keys(SPELLCHECKER_LOCALES).forEach((key) => { | ||
124 | // spellcheckerLocales.push({ | ||
125 | // value: key, | ||
126 | // label: SPELLCHECKER_LOCALES[key], | ||
127 | // }); | ||
128 | // }); | ||
129 | |||
130 | const config = { | 125 | const config = { |
131 | fields: { | 126 | fields: { |
132 | autoLaunchOnStart: { | 127 | autoLaunchOnStart: { |
@@ -141,40 +136,44 @@ export default class EditSettingsScreen extends Component { | |||
141 | }, | 136 | }, |
142 | runInBackground: { | 137 | runInBackground: { |
143 | label: intl.formatMessage(messages.runInBackground), | 138 | label: intl.formatMessage(messages.runInBackground), |
144 | value: settings.all.runInBackground, | 139 | value: settings.all.app.runInBackground, |
145 | default: DEFAULT_APP_SETTINGS.runInBackground, | 140 | default: DEFAULT_APP_SETTINGS.runInBackground, |
146 | }, | 141 | }, |
147 | enableSystemTray: { | 142 | enableSystemTray: { |
148 | label: intl.formatMessage(messages.enableSystemTray), | 143 | label: intl.formatMessage(messages.enableSystemTray), |
149 | value: settings.all.enableSystemTray, | 144 | value: settings.all.app.enableSystemTray, |
150 | default: DEFAULT_APP_SETTINGS.enableSystemTray, | 145 | default: DEFAULT_APP_SETTINGS.enableSystemTray, |
151 | }, | 146 | }, |
152 | minimizeToSystemTray: { | 147 | minimizeToSystemTray: { |
153 | label: intl.formatMessage(messages.minimizeToSystemTray), | 148 | label: intl.formatMessage(messages.minimizeToSystemTray), |
154 | value: settings.all.minimizeToSystemTray, | 149 | value: settings.all.app.minimizeToSystemTray, |
155 | default: DEFAULT_APP_SETTINGS.minimizeToSystemTray, | 150 | default: DEFAULT_APP_SETTINGS.minimizeToSystemTray, |
156 | }, | 151 | }, |
157 | showDisabledServices: { | 152 | showDisabledServices: { |
158 | label: intl.formatMessage(messages.showDisabledServices), | 153 | label: intl.formatMessage(messages.showDisabledServices), |
159 | value: settings.all.showDisabledServices, | 154 | value: settings.all.app.showDisabledServices, |
160 | default: DEFAULT_APP_SETTINGS.showDisabledServices, | 155 | default: DEFAULT_APP_SETTINGS.showDisabledServices, |
161 | }, | 156 | }, |
162 | showMessageBadgeWhenMuted: { | 157 | showMessageBadgeWhenMuted: { |
163 | label: intl.formatMessage(messages.showMessageBadgeWhenMuted), | 158 | label: intl.formatMessage(messages.showMessageBadgeWhenMuted), |
164 | value: settings.all.showMessageBadgeWhenMuted, | 159 | value: settings.all.app.showMessageBadgeWhenMuted, |
165 | default: DEFAULT_APP_SETTINGS.showMessageBadgeWhenMuted, | 160 | default: DEFAULT_APP_SETTINGS.showMessageBadgeWhenMuted, |
166 | }, | 161 | }, |
167 | enableSpellchecking: { | 162 | enableSpellchecking: { |
168 | label: intl.formatMessage(messages.enableSpellchecking), | 163 | label: intl.formatMessage(messages.enableSpellchecking), |
169 | value: settings.all.enableSpellchecking, | 164 | value: settings.all.app.enableSpellchecking, |
170 | default: DEFAULT_APP_SETTINGS.enableSpellchecking, | 165 | default: DEFAULT_APP_SETTINGS.enableSpellchecking, |
171 | }, | 166 | }, |
172 | // spellcheckingLanguage: { | 167 | darkMode: { |
173 | // label: intl.formatMessage(messages.spellcheckingLanguage), | 168 | label: intl.formatMessage(messages.darkMode), |
174 | // value: settings.all.spellcheckingLanguage, | 169 | value: settings.all.app.darkMode, |
175 | // options: spellcheckerLocales, | 170 | default: DEFAULT_APP_SETTINGS.darkMode, |
176 | // default: DEFAULT_APP_SETTINGS.spellcheckingLanguage, | 171 | }, |
177 | // }, | 172 | enableGPUAcceleration: { |
173 | label: intl.formatMessage(messages.enableGPUAcceleration), | ||
174 | value: settings.all.app.enableGPUAcceleration, | ||
175 | default: DEFAULT_APP_SETTINGS.enableGPUAcceleration, | ||
176 | }, | ||
178 | locale: { | 177 | locale: { |
179 | label: intl.formatMessage(messages.language), | 178 | label: intl.formatMessage(messages.language), |
180 | value: app.locale, | 179 | value: app.locale, |
diff --git a/src/containers/settings/EditUserScreen.js b/src/containers/settings/EditUserScreen.js index a67fa7fb5..3da3e8d2c 100644 --- a/src/containers/settings/EditUserScreen.js +++ b/src/containers/settings/EditUserScreen.js | |||
@@ -50,8 +50,7 @@ const messages = defineMessages({ | |||
50 | }, | 50 | }, |
51 | }); | 51 | }); |
52 | 52 | ||
53 | @inject('stores', 'actions') @observer | 53 | export default @inject('stores', 'actions') @observer class EditUserScreen extends Component { |
54 | export default class EditUserScreen extends Component { | ||
55 | static contextTypes = { | 54 | static contextTypes = { |
56 | intl: intlShape, | 55 | intl: intlShape, |
57 | }; | 56 | }; |
diff --git a/src/containers/settings/InviteScreen.js b/src/containers/settings/InviteScreen.js index 5f341b1b3..38ca6ec74 100644 --- a/src/containers/settings/InviteScreen.js +++ b/src/containers/settings/InviteScreen.js | |||
@@ -5,8 +5,7 @@ import { inject, observer } from 'mobx-react'; | |||
5 | import Invite from '../../components/auth/Invite'; | 5 | import Invite from '../../components/auth/Invite'; |
6 | import { gaPage } from '../../lib/analytics'; | 6 | import { gaPage } from '../../lib/analytics'; |
7 | 7 | ||
8 | @inject('stores', 'actions') @observer | 8 | export default @inject('stores', 'actions') @observer class InviteScreen extends Component { |
9 | export default class InviteScreen extends Component { | ||
10 | componentDidMount() { | 9 | componentDidMount() { |
11 | gaPage('Settings/Invite'); | 10 | gaPage('Settings/Invite'); |
12 | } | 11 | } |
diff --git a/src/containers/settings/RecipesScreen.js b/src/containers/settings/RecipesScreen.js index 65341e9e3..4efe81505 100644 --- a/src/containers/settings/RecipesScreen.js +++ b/src/containers/settings/RecipesScreen.js | |||
@@ -11,8 +11,7 @@ import { gaPage } from '../../lib/analytics'; | |||
11 | 11 | ||
12 | import RecipesDashboard from '../../components/settings/recipes/RecipesDashboard'; | 12 | import RecipesDashboard from '../../components/settings/recipes/RecipesDashboard'; |
13 | 13 | ||
14 | @inject('stores', 'actions') @observer | 14 | export default @inject('stores', 'actions') @observer class RecipesScreen extends Component { |
15 | export default class RecipesScreen extends Component { | ||
16 | static propTypes = { | 15 | static propTypes = { |
17 | params: PropTypes.shape({ | 16 | params: PropTypes.shape({ |
18 | filter: PropTypes.string, | 17 | filter: PropTypes.string, |
diff --git a/src/containers/settings/ServicesScreen.js b/src/containers/settings/ServicesScreen.js index 12db1bcd3..c1a133ef7 100644 --- a/src/containers/settings/ServicesScreen.js +++ b/src/containers/settings/ServicesScreen.js | |||
@@ -10,8 +10,7 @@ import { gaPage } from '../../lib/analytics'; | |||
10 | 10 | ||
11 | import ServicesDashboard from '../../components/settings/services/ServicesDashboard'; | 11 | import ServicesDashboard from '../../components/settings/services/ServicesDashboard'; |
12 | 12 | ||
13 | @inject('stores', 'actions') @observer | 13 | export default @inject('stores', 'actions') @observer class ServicesScreen extends Component { |
14 | export default class ServicesScreen extends Component { | ||
15 | componentDidMount() { | 14 | componentDidMount() { |
16 | gaPage('Settings/Service Dashboard'); | 15 | gaPage('Settings/Service Dashboard'); |
17 | } | 16 | } |
diff --git a/src/containers/settings/SettingsWindow.js b/src/containers/settings/SettingsWindow.js index 13ca96f72..55589d0be 100644 --- a/src/containers/settings/SettingsWindow.js +++ b/src/containers/settings/SettingsWindow.js | |||
@@ -7,8 +7,7 @@ import ServicesStore from '../../stores/ServicesStore'; | |||
7 | import Layout from '../../components/settings/SettingsLayout'; | 7 | import Layout from '../../components/settings/SettingsLayout'; |
8 | import Navigation from '../../components/settings/navigation/SettingsNavigation'; | 8 | import Navigation from '../../components/settings/navigation/SettingsNavigation'; |
9 | 9 | ||
10 | @inject('stores', 'actions') @observer | 10 | export default @inject('stores', 'actions') @observer class SettingsContainer extends Component { |
11 | export default class SettingsContainer extends Component { | ||
12 | render() { | 11 | render() { |
13 | const { children, stores } = this.props; | 12 | const { children, stores } = this.props; |
14 | const { closeSettings } = this.props.actions.ui; | 13 | const { closeSettings } = this.props.actions.ui; |