* Build and return the tray right-click context menu.
()
| 59 | * Build and return the tray right-click context menu. |
| 60 | */ |
| 61 | buildMenu(): Menu { |
| 62 | const contextMenu = Menu.buildFromTemplate([ |
| 63 | this.checkForUpdatesMenuItem, |
| 64 | this.noUpdateAvailableMenuItem, |
| 65 | this.updateAvailableMenuItem, |
| 66 | this.updateReadyForInstallMenuItem, |
| 67 | { type: 'separator' }, |
| 68 | { |
| 69 | label: 'Developer', |
| 70 | submenu: [ |
| 71 | { |
| 72 | role: 'reload', |
| 73 | accelerator: 'CommandOrControl+R', |
| 74 | }, |
| 75 | { |
| 76 | role: 'toggleDevTools', |
| 77 | accelerator: isMacOS() ? 'Alt+Cmd+I' : 'Ctrl+Shift+I', |
| 78 | }, |
| 79 | { |
| 80 | label: 'Take Screenshot', |
| 81 | accelerator: 'CommandOrControl+S', |
| 82 | click: () => takeScreenshot(this.menubar), |
| 83 | }, |
| 84 | { |
| 85 | label: 'View Application Logs', |
| 86 | click: () => openLogsDirectory(), |
| 87 | }, |
| 88 | { |
| 89 | label: 'Visit Repository', |
| 90 | click: () => { |
| 91 | shell.openExternal( |
| 92 | `${APPLICATION.GITHUB_BASE_URL}/${APPLICATION.REPO_SLUG}`, |
| 93 | ); |
| 94 | }, |
| 95 | }, |
| 96 | { |
| 97 | label: `Reset ${APPLICATION.NAME}`, |
| 98 | click: () => { |
| 99 | resetApp(this.menubar); |
| 100 | }, |
| 101 | }, |
| 102 | ], |
| 103 | }, |
| 104 | { type: 'separator' }, |
| 105 | { |
| 106 | label: 'Visit Website', |
| 107 | click: () => { |
| 108 | shell.openExternal(APPLICATION.WEBSITE); |
| 109 | }, |
| 110 | }, |
| 111 | { |
| 112 | label: `Quit ${APPLICATION.NAME}`, |
| 113 | accelerator: 'CommandOrControl+Q', |
| 114 | click: () => { |
| 115 | this.menubar.app.quit(); |
| 116 | }, |
| 117 | }, |
| 118 | ]); |