55 BrowserWindow ,
66 MenuItemConstructorOptions ,
77} from 'electron' ;
8+ import log from 'electron-log/main' ;
89
910interface DarwinMenuItemConstructorOptions extends MenuItemConstructorOptions {
1011 selector ?: string ;
@@ -54,17 +55,17 @@ export default class MenuBuilder {
5455
5556 buildDarwinTemplate ( ) : MenuItemConstructorOptions [ ] {
5657 const subMenuAbout : DarwinMenuItemConstructorOptions = {
57- label : 'Electron ' ,
58+ label : 'Cobolt ' ,
5859 submenu : [
5960 {
60- label : 'About ElectronReact ' ,
61+ label : 'About Cobolt ' ,
6162 selector : 'orderFrontStandardAboutPanel:' ,
6263 } ,
6364 { type : 'separator' } ,
6465 { label : 'Services' , submenu : [ ] } ,
6566 { type : 'separator' } ,
6667 {
67- label : 'Hide ElectronReact ' ,
68+ label : 'Hide Cobolt ' ,
6869 accelerator : 'Command+H' ,
6970 selector : 'hide:' ,
7071 } ,
@@ -180,6 +181,15 @@ export default class MenuBuilder {
180181 shell . openExternal ( 'https://github.com/electron/electron/issues' ) ;
181182 } ,
182183 } ,
184+ { type : 'separator' } ,
185+ {
186+ label : 'Check for Updates...' ,
187+ click : ( ) => {
188+ log . info ( '[Menu] Check for Updates clicked' ) ;
189+ this . mainWindow . webContents . send ( 'check-for-updates-menu' ) ;
190+ log . info ( '[Menu] Sent check-for-updates-menu event to renderer' ) ;
191+ } ,
192+ } ,
183193 ] ,
184194 } ;
185195
@@ -189,11 +199,18 @@ export default class MenuBuilder {
189199 ? subMenuViewDev
190200 : subMenuViewProd ;
191201
192- return [ subMenuAbout , subMenuEdit , subMenuView , subMenuWindow , subMenuHelp ] ;
202+ // Cast to MenuItemConstructorOptions[] for compatibility with Menu.buildFromTemplate
203+ return [
204+ subMenuAbout ,
205+ subMenuEdit ,
206+ subMenuView ,
207+ subMenuWindow ,
208+ subMenuHelp ,
209+ ] as MenuItemConstructorOptions [ ] ;
193210 }
194211
195- buildDefaultTemplate ( ) {
196- const templateDefault = [
212+ buildDefaultTemplate ( ) : MenuItemConstructorOptions [ ] {
213+ const templateDefault : MenuItemConstructorOptions [ ] = [
197214 {
198215 label : '&File' ,
199216 submenu : [
@@ -272,7 +289,18 @@ export default class MenuBuilder {
272289 {
273290 label : 'Search Issues' ,
274291 click ( ) {
275- shell . openExternal ( 'https://github.com/platinum-hill/cobolt/issues' ) ;
292+ shell . openExternal (
293+ 'https://github.com/platinum-hill/cobolt/issues' ,
294+ ) ;
295+ } ,
296+ } ,
297+ { type : 'separator' } ,
298+ {
299+ label : 'Check for Updates...' ,
300+ click : ( ) => {
301+ log . info ( '[Menu] Check for Updates clicked' ) ;
302+ this . mainWindow . webContents . send ( 'check-for-updates-menu' ) ;
303+ log . info ( '[Menu] Sent check-for-updates-menu event to renderer' ) ;
276304 } ,
277305 } ,
278306 ] ,
0 commit comments