Skip to content

Commit 9fe9e1a

Browse files
enyaxuRokt33r
authored andcommitted
Add menu item "About" to "Help"
1 parent b4251a7 commit 9fe9e1a

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

lib/main-menu.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const BrowserWindow = electron.BrowserWindow
33
const shell = electron.shell
44
const ipc = electron.ipcMain
55
const mainWindow = require('./main-window')
6+
const os = require('os')
67

78
const macOS = process.platform === 'darwin'
89
// const WIN = process.platform === 'win32'
@@ -411,6 +412,28 @@ const help = {
411412
click () { shell.openExternal('https://github.com/TobseF/boostnote-markdown-cheatsheet/blob/master/BOOSTNOTE_MARKDOWN_CHEAT_SHEET.md') }
412413
}
413414
]
415+
},
416+
{
417+
type: 'separator'
418+
},
419+
{
420+
label: 'About',
421+
click () {
422+
const version = electron.app.getVersion()
423+
const electronVersion = process.versions.electron
424+
const chromeVersion = process.versions.chrome
425+
const nodeVersion = process.versions.node
426+
const v8Version = process.versions.v8
427+
const OSInfo = `${os.type()} ${os.arch()} ${os.release()}`
428+
const detail = `Version: ${version}\nElectron: ${electronVersion}\nChrome: ${chromeVersion}\nNode.js: ${nodeVersion}\nV8: ${v8Version}\nOS: ${OSInfo}`
429+
electron.dialog.showMessageBox(BrowserWindow.getFocusedWindow(),
430+
{
431+
title: 'BoostNote',
432+
message: 'BoostNote',
433+
type: 'info',
434+
detail: `\n${detail}`
435+
})
436+
}
414437
}
415438
]
416439
}

0 commit comments

Comments
 (0)