()
| 718 | } |
| 719 | |
| 720 | handleCommands () { |
| 721 | this.on('application:save-preference', this.savePreference) |
| 722 | |
| 723 | this.on('application:update-tray', (tray) => { |
| 724 | this.trayManager.updateTrayByImage(tray) |
| 725 | }) |
| 726 | |
| 727 | this.on('application:relaunch', () => { |
| 728 | this.relaunch() |
| 729 | }) |
| 730 | |
| 731 | this.on('application:quit', () => { |
| 732 | this.quit() |
| 733 | }) |
| 734 | |
| 735 | this.on('application:show', ({ page }) => { |
| 736 | this.show(page) |
| 737 | }) |
| 738 | |
| 739 | this.on('application:hide', ({ page }) => { |
| 740 | this.hide(page) |
| 741 | }) |
| 742 | |
| 743 | this.on('application:reset-session', () => this.resetSession()) |
| 744 | |
| 745 | this.on('application:reset', () => { |
| 746 | this.offConfigListeners() |
| 747 | this.configManager.reset() |
| 748 | this.relaunch() |
| 749 | }) |
| 750 | |
| 751 | this.on('application:check-for-updates', () => { |
| 752 | this.updateManager.check() |
| 753 | }) |
| 754 | |
| 755 | this.on('application:change-theme', (theme) => { |
| 756 | this.themeManager.updateSystemTheme(theme) |
| 757 | this.sendCommandToAll('application:update-theme', { theme }) |
| 758 | }) |
| 759 | |
| 760 | this.on('application:change-locale', (locale) => { |
| 761 | this.localeManager.changeLanguageByLocale(locale) |
| 762 | .then(() => { |
| 763 | this.menuManager.handleLocaleChange(locale) |
| 764 | this.trayManager.handleLocaleChange(locale) |
| 765 | }) |
| 766 | }) |
| 767 | |
| 768 | this.on('application:toggle-dock', (visible) => { |
| 769 | if (visible) { |
| 770 | this.dockManager.show() |
| 771 | } else { |
| 772 | this.dockManager.hide() |
| 773 | // Hiding the dock icon will trigger the entire app to hide. |
| 774 | this.show() |
| 775 | } |
| 776 | }) |
| 777 |
no test coverage detected