MCPcopy Create free account
hub / github.com/codeHappyDananx/SpecWave / buildApplicationMenuTemplate

Function buildApplicationMenuTemplate

electron/main.js:517–539  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

515}
516
517function buildApplicationMenuTemplate() {
518 const recentProjects = getRecentProjectsForMenu()
519 const recentItems = recentProjects.length > 0
520 ? recentProjects.map((projectPath) => ({
521 label: path.basename(projectPath) || projectPath,
522 click: () => sendMenuEvent('menu-open-recent', projectPath)
523 }))
524 : [{ label: '(暂无最近项目)', enabled: false }]
525
526 return [
527 {
528 label: '项目',
529 submenu: [
530 { label: '新建页签', accelerator: 'Ctrl+T', click: () => sendMenuEvent('menu-new-tab') },
531 { label: '关闭页签', accelerator: 'Ctrl+W', click: () => sendMenuEvent('menu-close-tab') },
532 { type: 'separator' },
533 { label: '打开最近', submenu: recentItems },
534 { type: 'separator' },
535 { role: 'quit', label: '退出' }
536 ]
537 }
538 ]
539}
540
541function refreshApplicationMenu() {
542 try {

Callers 1

refreshApplicationMenuFunction · 0.85

Calls 2

getRecentProjectsForMenuFunction · 0.85
sendMenuEventFunction · 0.85

Tested by

no test coverage detected