MCPcopy
hub / github.com/agalwood/Motrix / handleCommands

Method handleCommands

src/main/Application.js:720–845  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 1

initMethod · 0.95

Calls 15

relaunchMethod · 0.95
quitMethod · 0.95
showMethod · 0.95
hideMethod · 0.95
resetSessionMethod · 0.95
offConfigListenersMethod · 0.95
sendCommandToAllMethod · 0.95
handleFileMethod · 0.95
openExternalMethod · 0.95
updateTrayByImageMethod · 0.80
resetMethod · 0.80
checkMethod · 0.80

Tested by

no test coverage detected