aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorLibravatar Stefan Malzner <stefan@adlk.io>2017-10-30 10:43:27 +0100
committerLibravatar GitHub <noreply@github.com>2017-10-30 10:43:27 +0100
commit099e018fe93c32e2b1e2a07f71d65c09101d8f49 (patch)
tree8c9eac5db9a0196f36e98a893dd6d1dffb7001fc /src/lib
parentChange tray icon on mac theme change (diff)
parentMerge pull request #153 from dannyqiu/fix-high-sierra-build (diff)
downloadferdium-app-099e018fe93c32e2b1e2a07f71d65c09101d8f49.tar.gz
ferdium-app-099e018fe93c32e2b1e2a07f71d65c09101d8f49.tar.zst
ferdium-app-099e018fe93c32e2b1e2a07f71d65c09101d8f49.zip
Merge branch 'develop' into fix-theme-change
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Menu.js61
1 files changed, 47 insertions, 14 deletions
diff --git a/src/lib/Menu.js b/src/lib/Menu.js
index a6cde4d36..6bbf302ca 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, isLinux } 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,15 @@ 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 });
114 }
115 135
116 tpl[1].submenu.unshift({ 136 tpl[1].submenu.unshift({
117 label: 'Reload Service', 137 label: 'Reload Service',
@@ -218,6 +238,18 @@ export default class FranzMenu {
218 role: 'front', 238 role: 'front',
219 }, 239 },
220 ]; 240 ];
241 } else {
242 tpl[4].submenu.unshift({
243 role: 'about',
244 click: () => {
245 dialog.showMessageBox({
246 type: 'info',
247 title: 'Franz',
248 message: 'Franz',
249 detail: `Version: ${remote.app.getVersion()}\nRelease: ${process.versions.electron} / ${process.platform} / ${process.arch}`,
250 });
251 },
252 });
221 } 253 }
222 254
223 const serviceTpl = this.serviceTpl; 255 const serviceTpl = this.serviceTpl;
@@ -244,9 +276,10 @@ export default class FranzMenu {
244 const services = this.stores.services.enabled; 276 const services = this.stores.services.enabled;
245 277
246 if (this.stores.user.isLoggedIn) { 278 if (this.stores.user.isLoggedIn) {
279 const systemAcceleratorKey = isLinux ? 'Alt' : 'CmdOrCtrl';
247 return services.map((service, i) => ({ 280 return services.map((service, i) => ({
248 label: service.name, 281 label: service.name,
249 accelerator: i <= 9 ? `CmdOrCtrl+${i + 1}` : null, 282 accelerator: i <= 9 ? `${systemAcceleratorKey}+${i + 1}` : null,
250 type: 'radio', 283 type: 'radio',
251 checked: service.isActive, 284 checked: service.isActive,
252 click: () => { 285 click: () => {