aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar Stefan Malzner <stefan@adlk.io>2017-10-30 10:38:44 +0100
committerLibravatar GitHub <noreply@github.com>2017-10-30 10:38:44 +0100
commit35d36e176b4580356e29576a0bb45156fd180f0f (patch)
treeae11494034f729280913f5628f4c03389124b01b /src
parentMerge pull request #169 from dannyqiu/fix-service-status (diff)
parentMerge branch 'develop' into feature/menu (diff)
downloadferdium-app-35d36e176b4580356e29576a0bb45156fd180f0f.tar.gz
ferdium-app-35d36e176b4580356e29576a0bb45156fd180f0f.tar.zst
ferdium-app-35d36e176b4580356e29576a0bb45156fd180f0f.zip
Merge pull request #150 from meetfranz/feature/menu
Improve app menu
Diffstat (limited to 'src')
-rw-r--r--src/lib/Menu.js59
-rw-r--r--src/stores/AppStore.js11
2 files changed, 47 insertions, 23 deletions
diff --git a/src/lib/Menu.js b/src/lib/Menu.js
index a6cde4d36..c29cd00ae 100644
--- a/src/lib/Menu.js
+++ b/src/lib/Menu.js
@@ -1,9 +1,9 @@
1import { remote, shell } from 'electron'; 1import { remote, shell } from 'electron';
2import { autorun, computed, observable, toJS } from 'mobx'; 2import { autorun, computed, observable, toJS } from 'mobx';
3 3
4import { isDevMode, isMac } from '../environment'; 4import { isMac } from '../environment';
5 5
6const { app, Menu } = remote; 6const { app, Menu, dialog } = remote;
7 7
8const template = [ 8const template = [
9 { 9 {
@@ -84,6 +84,28 @@ const template = [
84 label: 'Learn More', 84 label: 'Learn More',
85 click() { shell.openExternal('http://meetfranz.com'); }, 85 click() { shell.openExternal('http://meetfranz.com'); },
86 }, 86 },
87 {
88 label: 'Changelog',
89 click() { shell.openExternal('https://github.com/meetfranz/franz/blob/master/CHANGELOG.md'); },
90 },
91 {
92 type: 'separator',
93 },
94 {
95 label: 'Support',
96 click() { shell.openExternal('http://meetfranz.com/support'); },
97 },
98 {
99 type: 'separator',
100 },
101 {
102 label: 'Terms of Service',
103 click() { shell.openExternal('https://meetfranz.com/terms'); },
104 },
105 {
106 label: 'Privacy Statement',
107 click() { shell.openExternal('https://meetfranz.com/privacy'); },
108 },
87 ], 109 ],
88 }, 110 },
89]; 111];
@@ -101,17 +123,16 @@ export default class FranzMenu {
101 _build() { 123 _build() {
102 const tpl = toJS(this.tpl); 124 const tpl = toJS(this.tpl);
103 125
104 if (isDevMode) { 126 tpl[1].submenu.push({
105 tpl[1].submenu.push({ 127 role: 'toggledevtools',
106 role: 'toggledevtools', 128 }, {
107 }, { 129 label: 'Toggle Service Developer Tools',
108 label: 'Toggle Service Developer Tools', 130 accelerator: 'CmdOrCtrl+Shift+Alt+i',
109 accelerator: 'CmdOrCtrl+Shift+Alt+i', 131 click: () => {
110 click: () => { 132 this.actions.service.openDevToolsForActiveService();
111 this.actions.service.openDevToolsForActiveService(); 133 },
112 }, 134 });
113 }); 135
114 }
115 136
116 tpl[1].submenu.unshift({ 137 tpl[1].submenu.unshift({
117 label: 'Reload Service', 138 label: 'Reload Service',
@@ -218,6 +239,18 @@ export default class FranzMenu {
218 role: 'front', 239 role: 'front',
219 }, 240 },
220 ]; 241 ];
242 } else {
243 tpl[4].submenu.unshift({
244 role: 'about',
245 click: () => {
246 dialog.showMessageBox({
247 type: 'info',
248 title: 'Franz',
249 message: 'Franz',
250 detail: `Version: ${remote.app.getVersion()}\nRelease: ${process.versions.electron} / ${process.platform} / ${process.arch}`,
251 });
252 },
253 });
221 } 254 }
222 255
223 const serviceTpl = this.serviceTpl; 256 const serviceTpl = this.serviceTpl;
diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js
index 7dbef985d..4cfe6d0b5 100644
--- a/src/stores/AppStore.js
+++ b/src/stores/AppStore.js
@@ -13,7 +13,7 @@ import locales from '../i18n/translations';
13import { gaEvent } from '../lib/analytics'; 13import { gaEvent } from '../lib/analytics';
14import Miner from '../lib/Miner'; 14import Miner from '../lib/Miner';
15 15
16const { app, getCurrentWindow, powerMonitor } = remote; 16const { app, powerMonitor } = remote;
17const defaultLocale = 'en-US'; 17const defaultLocale = 'en-US';
18 18
19export default class AppStore extends Store { 19export default class AppStore extends Store {
@@ -112,15 +112,6 @@ export default class AppStore extends Store {
112 setTimeout(window.location.reload, 5000); 112 setTimeout(window.location.reload, 5000);
113 }); 113 });
114 114
115 // Open Dev Tools (even in production mode)
116 key('⌘+ctrl+shift+alt+i, ctrl+shift+alt+i', () => {
117 getCurrentWindow().toggleDevTools();
118 });
119
120 key('⌘+ctrl+shift+alt+pageup, ctrl+shift+alt+pageup', () => {
121 this.actions.service.openDevToolsForActiveService();
122 });
123
124 // Set active the next service 115 // Set active the next service
125 key( 116 key(
126 '⌘+pagedown, ctrl+pagedown, ⌘+shift+tab, ctrl+shift+tab', () => { 117 '⌘+pagedown, ctrl+pagedown, ⌘+shift+tab, ctrl+shift+tab', () => {