(pgAdminMainScreen, configStore, callbacks={})
| 200 | } |
| 201 | |
| 202 | export function setupMenu(pgAdminMainScreen, configStore, callbacks={}) { |
| 203 | ipcMain.on('setMenus', (event, menus)=>{ |
| 204 | // this is important because the shortcuts are registered multiple times |
| 205 | // when the menu is set multiple times using accelerators. |
| 206 | globalShortcut.unregisterAll(); |
| 207 | cachedMenus = menus; //It will be used later for refreshing the menus |
| 208 | buildAndSetMenus(menus, pgAdminMainScreen, configStore, callbacks); |
| 209 | |
| 210 | ipcMain.on('enable-disable-menu-items', (event, menu, menuItem)=>{ |
| 211 | const menuItemObj = mainMenu.getMenuItemById(menuItem?.id); |
| 212 | if(menuItemObj) { |
| 213 | menuItemObj.enabled = menuItem.isDisabled; |
| 214 | } |
| 215 | }); |
| 216 | }); |
| 217 | } |
no test coverage detected