diff options
author | 2021-08-14 15:17:27 +0530 | |
---|---|---|
committer | 2021-08-14 10:20:16 +0000 | |
commit | ae033f72650f54c5804134a2ff2a461294b7c2f5 (patch) | |
tree | 88d79ae806b7e677ba8fdeae55c8fdbfd26afe59 /src/components/settings | |
parent | doc: Updated Changelog [skip ci] (diff) | |
download | ferdium-app-ae033f72650f54c5804134a2ff2a461294b7c2f5.tar.gz ferdium-app-ae033f72650f54c5804134a2ff2a461294b7c2f5.tar.zst ferdium-app-ae033f72650f54c5804134a2ff2a461294b7c2f5.zip |
feat: Add buttons in the 'Advanced' section of preferences to allow the user to quickly open the Ferdi profile folder
Diffstat (limited to 'src/components/settings')
-rw-r--r-- | src/components/settings/settings/EditSettingsForm.js | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/src/components/settings/settings/EditSettingsForm.js b/src/components/settings/settings/EditSettingsForm.js index 9db434099..1df8c3527 100644 --- a/src/components/settings/settings/EditSettingsForm.js +++ b/src/components/settings/settings/EditSettingsForm.js | |||
@@ -16,7 +16,7 @@ import { | |||
16 | FRANZ_TRANSLATION, | 16 | FRANZ_TRANSLATION, |
17 | GITHUB_FRANZ_URL, | 17 | GITHUB_FRANZ_URL, |
18 | } from '../../../config'; | 18 | } from '../../../config'; |
19 | import { DEFAULT_APP_SETTINGS, ferdiVersion, isMac, isWindows, lockFerdiShortcutKey } from '../../../environment'; | 19 | import { DEFAULT_APP_SETTINGS, ferdiVersion, isMac, isWindows, lockFerdiShortcutKey, openPath, userDataPath, userDataRecipesPath } from '../../../environment'; |
20 | import globalMessages from '../../../i18n/globalMessages'; | 20 | import globalMessages from '../../../i18n/globalMessages'; |
21 | 21 | ||
22 | const messages = defineMessages({ | 22 | const messages = defineMessages({ |
@@ -116,6 +116,18 @@ const messages = defineMessages({ | |||
116 | id: 'settings.app.buttonClearAllCache', | 116 | id: 'settings.app.buttonClearAllCache', |
117 | defaultMessage: '!!!Clear cache', | 117 | defaultMessage: '!!!Clear cache', |
118 | }, | 118 | }, |
119 | subheadlineFerdiProfile: { | ||
120 | id: 'settings.app.subheadlineFerdiProfile', | ||
121 | defaultMessage: '!!!Ferdi Profile', | ||
122 | }, | ||
123 | buttonOpenFerdiProfileFolder: { | ||
124 | id: 'settings.app.buttonOpenFerdiProfileFolder', | ||
125 | defaultMessage: '!!!Open Profile folder', | ||
126 | }, | ||
127 | buttonOpenFerdiServiceRecipesFolder: { | ||
128 | id: 'settings.app.buttonOpenFerdiServiceRecipesFolder', | ||
129 | defaultMessage: '!!!Open Service Recipes folder', | ||
130 | }, | ||
119 | buttonSearchForUpdate: { | 131 | buttonSearchForUpdate: { |
120 | id: 'settings.app.buttonSearchForUpdate', | 132 | id: 'settings.app.buttonSearchForUpdate', |
121 | defaultMessage: '!!!Check for updates', | 133 | defaultMessage: '!!!Check for updates', |
@@ -259,6 +271,9 @@ export default @observer class EditSettingsForm extends Component { | |||
259 | } | 271 | } |
260 | } | 272 | } |
261 | 273 | ||
274 | const profileFolder = userDataPath(); | ||
275 | const recipeFolder = userDataRecipesPath(); | ||
276 | |||
262 | return ( | 277 | return ( |
263 | <div className="settings__main"> | 278 | <div className="settings__main"> |
264 | <div className="settings__header"> | 279 | <div className="settings__header"> |
@@ -631,6 +646,30 @@ export default @observer class EditSettingsForm extends Component { | |||
631 | /> | 646 | /> |
632 | </p> | 647 | </p> |
633 | </div> | 648 | </div> |
649 | |||
650 | <Hr /> | ||
651 | |||
652 | <div className="settings__settings-group"> | ||
653 | <h3> | ||
654 | {intl.formatMessage(messages.subheadlineFerdiProfile)} | ||
655 | </h3> | ||
656 | <p> | ||
657 | <div className="settings__open-settings-file-container"> | ||
658 | <Button | ||
659 | buttonType="secondary" | ||
660 | label={intl.formatMessage(messages.buttonOpenFerdiProfileFolder)} | ||
661 | className="settings__open-settings-file-button" | ||
662 | onClick={() => openPath(profileFolder)} | ||
663 | /> | ||
664 | <Button | ||
665 | buttonType="secondary" | ||
666 | label={intl.formatMessage(messages.buttonOpenFerdiServiceRecipesFolder)} | ||
667 | className="settings__open-settings-file-button" | ||
668 | onClick={() => openPath(recipeFolder)} | ||
669 | /> | ||
670 | </div> | ||
671 | </p> | ||
672 | </div> | ||
634 | </div> | 673 | </div> |
635 | )} | 674 | )} |
636 | 675 | ||