diff options
Diffstat (limited to 'src/lib/Menu.js')
-rw-r--r-- | src/lib/Menu.js | 91 |
1 files changed, 45 insertions, 46 deletions
diff --git a/src/lib/Menu.js b/src/lib/Menu.js index e4056e536..5a99299c5 100644 --- a/src/lib/Menu.js +++ b/src/lib/Menu.js | |||
@@ -1,12 +1,10 @@ | |||
1 | import { clipboard, shell } from 'electron'; | 1 | import { clipboard } from 'electron'; |
2 | import { | 2 | import { app, Menu, dialog, systemPreferences } from '@electron/remote'; |
3 | app, Menu, dialog, systemPreferences, | ||
4 | } from '@electron/remote'; | ||
5 | import { autorun, observable } from 'mobx'; | 3 | import { autorun, observable } from 'mobx'; |
6 | import { defineMessages } from 'react-intl'; | 4 | import { defineMessages } from 'react-intl'; |
7 | import { CUSTOM_WEBSITE_RECIPE_ID, GITHUB_FERDI_URL, LIVE_API_FERDI_WEBSITE } from '../config'; | 5 | import { CUSTOM_WEBSITE_RECIPE_ID, GITHUB_FERDI_URL, LIVE_API_FERDI_WEBSITE } from '../config'; |
8 | import { | 6 | import { |
9 | shortcutKey, altKey, shiftKey, settingsShortcutKey, isLinux, isMac, aboutAppDetails, lockFerdiShortcutKey, todosToggleShortcutKey, workspaceToggleShortcutKey, addNewServiceShortcutKey, muteFerdiShortcutKey, | 7 | cmdOrCtrlShortcutKey, altKey, shiftKey, settingsShortcutKey, isLinux, isMac, aboutAppDetails, lockFerdiShortcutKey, todosToggleShortcutKey, workspaceToggleShortcutKey, addNewServiceShortcutKey, muteFerdiShortcutKey, |
10 | } from '../environment'; | 8 | } from '../environment'; |
11 | import { announcementsStore } from '../features/announcements'; | 9 | import { announcementsStore } from '../features/announcements'; |
12 | import { announcementActions } from '../features/announcements/actions'; | 10 | import { announcementActions } from '../features/announcements/actions'; |
@@ -15,6 +13,7 @@ import { todoActions } from '../features/todos/actions'; | |||
15 | import { workspaceActions } from '../features/workspaces/actions'; | 13 | import { workspaceActions } from '../features/workspaces/actions'; |
16 | import { workspaceStore } from '../features/workspaces/index'; | 14 | import { workspaceStore } from '../features/workspaces/index'; |
17 | import apiBase, { termsBase } from '../api/apiBase'; | 15 | import apiBase, { termsBase } from '../api/apiBase'; |
16 | import { openExternalUrl } from '../helpers/url-helpers'; | ||
18 | 17 | ||
19 | const menuItems = defineMessages({ | 18 | const menuItems = defineMessages({ |
20 | edit: { | 19 | edit: { |
@@ -318,7 +317,7 @@ function getActiveWebview() { | |||
318 | const _titleBarTemplateFactory = (intl, locked) => [ | 317 | const _titleBarTemplateFactory = (intl, locked) => [ |
319 | { | 318 | { |
320 | label: intl.formatMessage(menuItems.edit), | 319 | label: intl.formatMessage(menuItems.edit), |
321 | accelerator: `${altKey}+E`, | 320 | accelerator: `${altKey()}+E`, |
322 | submenu: [ | 321 | submenu: [ |
323 | { | 322 | { |
324 | label: intl.formatMessage(menuItems.undo), | 323 | label: intl.formatMessage(menuItems.undo), |
@@ -333,22 +332,22 @@ const _titleBarTemplateFactory = (intl, locked) => [ | |||
333 | }, | 332 | }, |
334 | { | 333 | { |
335 | label: intl.formatMessage(menuItems.cut), | 334 | label: intl.formatMessage(menuItems.cut), |
336 | accelerator: `${shortcutKey()}+X`, | 335 | accelerator: `${cmdOrCtrlShortcutKey()}+X`, |
337 | role: 'cut', | 336 | role: 'cut', |
338 | }, | 337 | }, |
339 | { | 338 | { |
340 | label: intl.formatMessage(menuItems.copy), | 339 | label: intl.formatMessage(menuItems.copy), |
341 | accelerator: `${shortcutKey()}+C`, | 340 | accelerator: `${cmdOrCtrlShortcutKey()}+C`, |
342 | role: 'copy', | 341 | role: 'copy', |
343 | }, | 342 | }, |
344 | { | 343 | { |
345 | label: intl.formatMessage(menuItems.paste), | 344 | label: intl.formatMessage(menuItems.paste), |
346 | accelerator: `${shortcutKey()}+V`, | 345 | accelerator: `${cmdOrCtrlShortcutKey()}+V`, |
347 | role: 'paste', | 346 | role: 'paste', |
348 | }, | 347 | }, |
349 | { | 348 | { |
350 | label: intl.formatMessage(menuItems.pasteAndMatchStyle), | 349 | label: intl.formatMessage(menuItems.pasteAndMatchStyle), |
351 | accelerator: `${shortcutKey()}+${shiftKey}+V`, // Override the accelerator since this adds new key combo in macos | 350 | accelerator: `${cmdOrCtrlShortcutKey()}+${shiftKey()}+V`, // Override the accelerator since this adds new key combo in macos |
352 | role: 'pasteAndMatchStyle', | 351 | role: 'pasteAndMatchStyle', |
353 | click() { | 352 | click() { |
354 | getActiveWebview().pasteAndMatchStyle(); | 353 | getActiveWebview().pasteAndMatchStyle(); |
@@ -360,14 +359,14 @@ const _titleBarTemplateFactory = (intl, locked) => [ | |||
360 | }, | 359 | }, |
361 | { | 360 | { |
362 | label: intl.formatMessage(menuItems.selectAll), | 361 | label: intl.formatMessage(menuItems.selectAll), |
363 | accelerator: `${shortcutKey()}+A`, | 362 | accelerator: `${cmdOrCtrlShortcutKey()}+A`, |
364 | role: 'selectall', | 363 | role: 'selectall', |
365 | }, | 364 | }, |
366 | ], | 365 | ], |
367 | }, | 366 | }, |
368 | { | 367 | { |
369 | label: intl.formatMessage(menuItems.view), | 368 | label: intl.formatMessage(menuItems.view), |
370 | accelerator: `${altKey}+V`, | 369 | accelerator: `${altKey()}+V`, |
371 | visible: !locked, | 370 | visible: !locked, |
372 | submenu: [ | 371 | submenu: [ |
373 | { | 372 | { |
@@ -375,7 +374,7 @@ const _titleBarTemplateFactory = (intl, locked) => [ | |||
375 | }, | 374 | }, |
376 | { | 375 | { |
377 | label: intl.formatMessage(menuItems.openQuickSwitch), | 376 | label: intl.formatMessage(menuItems.openQuickSwitch), |
378 | accelerator: `${shortcutKey()}+S`, | 377 | accelerator: `${cmdOrCtrlShortcutKey()}+S`, |
379 | click() { | 378 | click() { |
380 | window.ferdi.features.quickSwitch.state.isModalVisible = true; | 379 | window.ferdi.features.quickSwitch.state.isModalVisible = true; |
381 | }, | 380 | }, |
@@ -385,7 +384,7 @@ const _titleBarTemplateFactory = (intl, locked) => [ | |||
385 | }, | 384 | }, |
386 | { | 385 | { |
387 | label: intl.formatMessage(menuItems.findInPage), | 386 | label: intl.formatMessage(menuItems.findInPage), |
388 | accelerator: `${shortcutKey()}+F`, | 387 | accelerator: `${cmdOrCtrlShortcutKey()}+F`, |
389 | click() { | 388 | click() { |
390 | // Check if there is a service active | 389 | // Check if there is a service active |
391 | if (!window.ferdi.stores.services.active) return; | 390 | if (!window.ferdi.stores.services.active) return; |
@@ -406,14 +405,14 @@ const _titleBarTemplateFactory = (intl, locked) => [ | |||
406 | }, | 405 | }, |
407 | { | 406 | { |
408 | label: intl.formatMessage(menuItems.back), | 407 | label: intl.formatMessage(menuItems.back), |
409 | accelerator: `${shortcutKey()}+Left`, | 408 | accelerator: `${cmdOrCtrlShortcutKey()}+Left`, |
410 | click() { | 409 | click() { |
411 | getActiveWebview().goBack(); | 410 | getActiveWebview().goBack(); |
412 | }, | 411 | }, |
413 | }, | 412 | }, |
414 | { | 413 | { |
415 | label: intl.formatMessage(menuItems.forward), | 414 | label: intl.formatMessage(menuItems.forward), |
416 | accelerator: `${shortcutKey()}+Right`, | 415 | accelerator: `${cmdOrCtrlShortcutKey()}+Right`, |
417 | click() { | 416 | click() { |
418 | getActiveWebview().goForward(); | 417 | getActiveWebview().goForward(); |
419 | }, | 418 | }, |
@@ -423,7 +422,7 @@ const _titleBarTemplateFactory = (intl, locked) => [ | |||
423 | }, | 422 | }, |
424 | { | 423 | { |
425 | label: intl.formatMessage(menuItems.resetZoom), | 424 | label: intl.formatMessage(menuItems.resetZoom), |
426 | accelerator: `${shortcutKey()}+0`, | 425 | accelerator: `${cmdOrCtrlShortcutKey()}+0`, |
427 | role: 'resetZoom', | 426 | role: 'resetZoom', |
428 | click() { | 427 | click() { |
429 | getActiveWebview().setZoomLevel(0); | 428 | getActiveWebview().setZoomLevel(0); |
@@ -431,7 +430,7 @@ const _titleBarTemplateFactory = (intl, locked) => [ | |||
431 | }, | 430 | }, |
432 | { | 431 | { |
433 | label: intl.formatMessage(menuItems.zoomIn), | 432 | label: intl.formatMessage(menuItems.zoomIn), |
434 | accelerator: `${shortcutKey()}+plus`, | 433 | accelerator: `${cmdOrCtrlShortcutKey()}+plus`, |
435 | role: 'zoomIn', | 434 | role: 'zoomIn', |
436 | click() { | 435 | click() { |
437 | const activeService = getActiveWebview(); | 436 | const activeService = getActiveWebview(); |
@@ -443,7 +442,7 @@ const _titleBarTemplateFactory = (intl, locked) => [ | |||
443 | }, | 442 | }, |
444 | { | 443 | { |
445 | label: intl.formatMessage(menuItems.zoomOut), | 444 | label: intl.formatMessage(menuItems.zoomOut), |
446 | accelerator: `${shortcutKey()}+-`, | 445 | accelerator: `${cmdOrCtrlShortcutKey()}+-`, |
447 | role: 'zoomOut', | 446 | role: 'zoomOut', |
448 | click() { | 447 | click() { |
449 | const activeService = getActiveWebview(); | 448 | const activeService = getActiveWebview(); |
@@ -463,7 +462,7 @@ const _titleBarTemplateFactory = (intl, locked) => [ | |||
463 | { | 462 | { |
464 | label: intl.formatMessage(menuItems.toggleDarkMode), | 463 | label: intl.formatMessage(menuItems.toggleDarkMode), |
465 | type: 'checkbox', | 464 | type: 'checkbox', |
466 | accelerator: `${shortcutKey()}+${shiftKey}+D`, | 465 | accelerator: `${cmdOrCtrlShortcutKey()}+${shiftKey()}+D`, |
467 | checked: window.ferdi.stores.settings.app.darkMode, | 466 | checked: window.ferdi.stores.settings.app.darkMode, |
468 | click: () => { | 467 | click: () => { |
469 | window.ferdi.actions.settings.update({ | 468 | window.ferdi.actions.settings.update({ |
@@ -478,13 +477,13 @@ const _titleBarTemplateFactory = (intl, locked) => [ | |||
478 | }, | 477 | }, |
479 | { | 478 | { |
480 | label: intl.formatMessage(menuItems.services), | 479 | label: intl.formatMessage(menuItems.services), |
481 | accelerator: `${altKey}+S`, | 480 | accelerator: `${altKey()}+S`, |
482 | visible: !locked, | 481 | visible: !locked, |
483 | submenu: [], | 482 | submenu: [], |
484 | }, | 483 | }, |
485 | { | 484 | { |
486 | label: intl.formatMessage(menuItems.workspaces), | 485 | label: intl.formatMessage(menuItems.workspaces), |
487 | accelerator: `${altKey}+W`, | 486 | accelerator: `${altKey()}+W`, |
488 | submenu: [], | 487 | submenu: [], |
489 | visible: !locked && workspaceStore.isFeatureEnabled, | 488 | visible: !locked && workspaceStore.isFeatureEnabled, |
490 | }, | 489 | }, |
@@ -509,20 +508,20 @@ const _titleBarTemplateFactory = (intl, locked) => [ | |||
509 | }, | 508 | }, |
510 | { | 509 | { |
511 | label: intl.formatMessage(menuItems.help), | 510 | label: intl.formatMessage(menuItems.help), |
512 | accelerator: `${altKey}+H`, | 511 | accelerator: `${altKey()}+H`, |
513 | role: 'help', | 512 | role: 'help', |
514 | submenu: [ | 513 | submenu: [ |
515 | { | 514 | { |
516 | label: intl.formatMessage(menuItems.learnMore), | 515 | label: intl.formatMessage(menuItems.learnMore), |
517 | click() { shell.openExternal(LIVE_API_FERDI_WEBSITE); }, | 516 | click() { openExternalUrl(LIVE_API_FERDI_WEBSITE, true); }, |
518 | }, | 517 | }, |
519 | { | 518 | { |
520 | label: intl.formatMessage(menuItems.changelog), | 519 | label: intl.formatMessage(menuItems.changelog), |
521 | click() { shell.openExternal(`${GITHUB_FERDI_URL}/ferdi/blob/master/CHANGELOG.md`); }, | 520 | click() { openExternalUrl(`${GITHUB_FERDI_URL}/ferdi/blob/develop/CHANGELOG.md`, true); }, |
522 | }, | 521 | }, |
523 | { | 522 | { |
524 | label: intl.formatMessage(menuItems.importExportData), | 523 | label: intl.formatMessage(menuItems.importExportData), |
525 | click() { shell.openExternal(apiBase(false)); }, | 524 | click() { openExternalUrl(apiBase(false), true); }, |
526 | enabled: !locked, | 525 | enabled: !locked, |
527 | }, | 526 | }, |
528 | { | 527 | { |
@@ -540,18 +539,18 @@ const _titleBarTemplateFactory = (intl, locked) => [ | |||
540 | }, | 539 | }, |
541 | { | 540 | { |
542 | label: intl.formatMessage(menuItems.support), | 541 | label: intl.formatMessage(menuItems.support), |
543 | click() { shell.openExternal(`${LIVE_API_FERDI_WEBSITE}/contact`); }, | 542 | click() { openExternalUrl(`${LIVE_API_FERDI_WEBSITE}/contact`, true); }, |
544 | }, | 543 | }, |
545 | { | 544 | { |
546 | type: 'separator', | 545 | type: 'separator', |
547 | }, | 546 | }, |
548 | { | 547 | { |
549 | label: intl.formatMessage(menuItems.tos), | 548 | label: intl.formatMessage(menuItems.tos), |
550 | click() { shell.openExternal(`${termsBase()}/terms`); }, | 549 | click() { openExternalUrl(`${termsBase()}/terms`, true); }, |
551 | }, | 550 | }, |
552 | { | 551 | { |
553 | label: intl.formatMessage(menuItems.privacy), | 552 | label: intl.formatMessage(menuItems.privacy), |
554 | click() { shell.openExternal(`${termsBase()}/privacy`); }, | 553 | click() { openExternalUrl(`${termsBase()}/privacy`, true); }, |
555 | }, | 554 | }, |
556 | ], | 555 | ], |
557 | }, | 556 | }, |
@@ -612,13 +611,13 @@ export default class FranzMenu { | |||
612 | type: 'separator', | 611 | type: 'separator', |
613 | }, { | 612 | }, { |
614 | label: intl.formatMessage(menuItems.toggleDevTools), | 613 | label: intl.formatMessage(menuItems.toggleDevTools), |
615 | accelerator: `${shortcutKey()}+${altKey}+I`, | 614 | accelerator: `${cmdOrCtrlShortcutKey()}+${altKey()}+I`, |
616 | click: (menuItem, browserWindow) => { | 615 | click: (menuItem, browserWindow) => { |
617 | browserWindow.webContents.toggleDevTools(); | 616 | browserWindow.webContents.toggleDevTools(); |
618 | }, | 617 | }, |
619 | }, { | 618 | }, { |
620 | label: intl.formatMessage(menuItems.toggleServiceDevTools), | 619 | label: intl.formatMessage(menuItems.toggleServiceDevTools), |
621 | accelerator: `${shortcutKey()}+${shiftKey}+${altKey}+I`, | 620 | accelerator: `${cmdOrCtrlShortcutKey()}+${shiftKey()}+${altKey()}+I`, |
622 | click: () => { | 621 | click: () => { |
623 | this.actions.service.openDevToolsForActiveService(); | 622 | this.actions.service.openDevToolsForActiveService(); |
624 | }, | 623 | }, |
@@ -628,7 +627,7 @@ export default class FranzMenu { | |||
628 | if (this.stores.features.features.isTodosEnabled) { | 627 | if (this.stores.features.features.isTodosEnabled) { |
629 | tpl[1].submenu.push({ | 628 | tpl[1].submenu.push({ |
630 | label: intl.formatMessage(menuItems.toggleTodosDevTools), | 629 | label: intl.formatMessage(menuItems.toggleTodosDevTools), |
631 | accelerator: `${shortcutKey()}+${shiftKey}+${altKey}+O`, | 630 | accelerator: `${cmdOrCtrlShortcutKey()}+${shiftKey()}+${altKey()}+O`, |
632 | click: () => { | 631 | click: () => { |
633 | const webview = document.querySelector('#todos-panel webview'); | 632 | const webview = document.querySelector('#todos-panel webview'); |
634 | if (webview) this.actions.todos.openDevTools(); | 633 | if (webview) this.actions.todos.openDevTools(); |
@@ -639,7 +638,7 @@ export default class FranzMenu { | |||
639 | tpl[1].submenu.unshift({ | 638 | tpl[1].submenu.unshift({ |
640 | label: intl.formatMessage(menuItems.reloadService), | 639 | label: intl.formatMessage(menuItems.reloadService), |
641 | id: 'reloadService', // TODO: needed? | 640 | id: 'reloadService', // TODO: needed? |
642 | accelerator: `${shortcutKey()}+R`, | 641 | accelerator: `${cmdOrCtrlShortcutKey()}+R`, |
643 | click: () => { | 642 | click: () => { |
644 | if (this.stores.user.isLoggedIn | 643 | if (this.stores.user.isLoggedIn |
645 | && this.stores.services.enabled.length > 0) { | 644 | && this.stores.services.enabled.length > 0) { |
@@ -654,13 +653,13 @@ export default class FranzMenu { | |||
654 | }, | 653 | }, |
655 | }, { | 654 | }, { |
656 | label: intl.formatMessage(menuItems.reloadFerdi), | 655 | label: intl.formatMessage(menuItems.reloadFerdi), |
657 | accelerator: `${shortcutKey()}+${shiftKey}+R`, | 656 | accelerator: `${cmdOrCtrlShortcutKey()}+${shiftKey()}+R`, |
658 | click: () => { | 657 | click: () => { |
659 | window.location.reload(); | 658 | window.location.reload(); |
660 | }, | 659 | }, |
661 | }, { | 660 | }, { |
662 | label: intl.formatMessage(menuItems.reloadTodos), | 661 | label: intl.formatMessage(menuItems.reloadTodos), |
663 | accelerator: `${shortcutKey()}+${shiftKey}+${altKey}+R`, | 662 | accelerator: `${cmdOrCtrlShortcutKey()}+${shiftKey()}+${altKey()}+R`, |
664 | click: () => { | 663 | click: () => { |
665 | this.actions.todos.reload(); | 664 | this.actions.todos.reload(); |
666 | }, | 665 | }, |
@@ -716,7 +715,7 @@ export default class FranzMenu { | |||
716 | 715 | ||
717 | tpl.unshift({ | 716 | tpl.unshift({ |
718 | label: isMac ? app.name : intl.formatMessage(menuItems.file), | 717 | label: isMac ? app.name : intl.formatMessage(menuItems.file), |
719 | accelerator: `${altKey}+F`, | 718 | accelerator: `${altKey()}+F`, |
720 | submenu: [ | 719 | submenu: [ |
721 | { | 720 | { |
722 | label: intl.formatMessage(menuItems.about), | 721 | label: intl.formatMessage(menuItems.about), |
@@ -832,7 +831,7 @@ export default class FranzMenu { | |||
832 | { | 831 | { |
833 | label: intl.formatMessage(menuItems.quit), | 832 | label: intl.formatMessage(menuItems.quit), |
834 | role: 'quit', | 833 | role: 'quit', |
835 | accelerator: `${shortcutKey()}+Q`, | 834 | accelerator: `${cmdOrCtrlShortcutKey()}+Q`, |
836 | click() { | 835 | click() { |
837 | app.quit(); | 836 | app.quit(); |
838 | }, | 837 | }, |
@@ -883,22 +882,22 @@ export default class FranzMenu { | |||
883 | type: 'separator', | 882 | type: 'separator', |
884 | }, { | 883 | }, { |
885 | label: intl.formatMessage(menuItems.activateNextService), | 884 | label: intl.formatMessage(menuItems.activateNextService), |
886 | accelerator: `${shortcutKey()}+tab`, | 885 | accelerator: `${cmdOrCtrlShortcutKey()}+tab`, |
887 | click: () => this.actions.service.setActiveNext(), | 886 | click: () => this.actions.service.setActiveNext(), |
888 | visible: !cmdAltShortcutsVisibile, | 887 | visible: !cmdAltShortcutsVisibile, |
889 | }, { | 888 | }, { |
890 | label: intl.formatMessage(menuItems.activateNextService), | 889 | label: intl.formatMessage(menuItems.activateNextService), |
891 | accelerator: `${shortcutKey()}+${altKey}+right`, | 890 | accelerator: `${cmdOrCtrlShortcutKey()}+${altKey()}+right`, |
892 | click: () => this.actions.service.setActiveNext(), | 891 | click: () => this.actions.service.setActiveNext(), |
893 | visible: cmdAltShortcutsVisibile, | 892 | visible: cmdAltShortcutsVisibile, |
894 | }, { | 893 | }, { |
895 | label: intl.formatMessage(menuItems.activatePreviousService), | 894 | label: intl.formatMessage(menuItems.activatePreviousService), |
896 | accelerator: `${shortcutKey()}+${shiftKey}+tab`, | 895 | accelerator: `${cmdOrCtrlShortcutKey()}+${shiftKey()}+tab`, |
897 | click: () => this.actions.service.setActivePrev(), | 896 | click: () => this.actions.service.setActivePrev(), |
898 | visible: !cmdAltShortcutsVisibile, | 897 | visible: !cmdAltShortcutsVisibile, |
899 | }, { | 898 | }, { |
900 | label: intl.formatMessage(menuItems.activatePreviousService), | 899 | label: intl.formatMessage(menuItems.activatePreviousService), |
901 | accelerator: `${shortcutKey()}+${altKey}+left`, | 900 | accelerator: `${cmdOrCtrlShortcutKey()}+${altKey()}+left`, |
902 | click: () => this.actions.service.setActivePrev(), | 901 | click: () => this.actions.service.setActivePrev(), |
903 | visible: cmdAltShortcutsVisibile, | 902 | visible: cmdAltShortcutsVisibile, |
904 | }, { | 903 | }, { |
@@ -913,7 +912,7 @@ export default class FranzMenu { | |||
913 | 912 | ||
914 | services.allDisplayed.forEach((service, i) => (menu.push({ | 913 | services.allDisplayed.forEach((service, i) => (menu.push({ |
915 | label: this._getServiceName(service), | 914 | label: this._getServiceName(service), |
916 | accelerator: i < 9 ? `${shortcutKey()}+${i + 1}` : null, | 915 | accelerator: i < 9 ? `${cmdOrCtrlShortcutKey()}+${i + 1}` : null, |
917 | type: 'radio', | 916 | type: 'radio', |
918 | checked: service.isActive, | 917 | checked: service.isActive, |
919 | click: () => { | 918 | click: () => { |
@@ -930,7 +929,7 @@ export default class FranzMenu { | |||
930 | type: 'separator', | 929 | type: 'separator', |
931 | }, { | 930 | }, { |
932 | label: intl.formatMessage(menuItems.serviceGoHome), | 931 | label: intl.formatMessage(menuItems.serviceGoHome), |
933 | accelerator: `${shortcutKey()}+${shiftKey}+H`, | 932 | accelerator: `${cmdOrCtrlShortcutKey()}+${shiftKey()}+H`, |
934 | click: () => this.actions.service.reloadActive(), | 933 | click: () => this.actions.service.reloadActive(), |
935 | }); | 934 | }); |
936 | } | 935 | } |
@@ -946,7 +945,7 @@ export default class FranzMenu { | |||
946 | // Add new workspace item: | 945 | // Add new workspace item: |
947 | menu.push({ | 946 | menu.push({ |
948 | label: intl.formatMessage(menuItems.addNewWorkspace), | 947 | label: intl.formatMessage(menuItems.addNewWorkspace), |
949 | accelerator: `${shortcutKey()}+${shiftKey}+N`, | 948 | accelerator: `${cmdOrCtrlShortcutKey()}+${shiftKey()}+N`, |
950 | click: () => { | 949 | click: () => { |
951 | workspaceActions.openWorkspaceSettings(); | 950 | workspaceActions.openWorkspaceSettings(); |
952 | }, | 951 | }, |
@@ -975,7 +974,7 @@ export default class FranzMenu { | |||
975 | // Default workspace | 974 | // Default workspace |
976 | menu.push({ | 975 | menu.push({ |
977 | label: intl.formatMessage(menuItems.defaultWorkspace), | 976 | label: intl.formatMessage(menuItems.defaultWorkspace), |
978 | accelerator: `${shortcutKey()}+${altKey}+0`, | 977 | accelerator: `${cmdOrCtrlShortcutKey()}+${altKey()}+0`, |
979 | type: 'radio', | 978 | type: 'radio', |
980 | checked: !activeWorkspace, | 979 | checked: !activeWorkspace, |
981 | click: () => { | 980 | click: () => { |
@@ -986,7 +985,7 @@ export default class FranzMenu { | |||
986 | // Workspace items | 985 | // Workspace items |
987 | workspaces.forEach((workspace, i) => menu.push({ | 986 | workspaces.forEach((workspace, i) => menu.push({ |
988 | label: workspace.name, | 987 | label: workspace.name, |
989 | accelerator: i < 9 ? `${shortcutKey()}+${altKey}+${i + 1}` : null, | 988 | accelerator: i < 9 ? `${cmdOrCtrlShortcutKey()}+${altKey()}+${i + 1}` : null, |
990 | type: 'radio', | 989 | type: 'radio', |
991 | checked: activeWorkspace ? workspace.id === activeWorkspace.id : false, | 990 | checked: activeWorkspace ? workspace.id === activeWorkspace.id : false, |
992 | click: () => { | 991 | click: () => { |