MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / setupMenu

Function setupMenu

runtime/src/js/menu.js:202–217  ·  view source on GitHub ↗
(pgAdminMainScreen, configStore, callbacks={})

Source from the content-addressed store, hash-verified

200}
201
202export 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}

Callers 1

launchPgAdminWindowFunction · 0.90

Calls 2

buildAndSetMenusFunction · 0.85
onMethod · 0.80

Tested by

no test coverage detected