forked from tmoreno/open-log-viewer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainMenu.js
44 lines (42 loc) · 1.14 KB
/
mainMenu.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
const { Menu } = require('electron');
const { dialog } = require('electron');
const electron = require('electron');
const app = electron.app;
const template = [
{
label: 'File',
submenu: [
{
role: 'quit'
}
]
},
{
label: 'Help',
submenu: [
{
label: 'Source code',
click () {
electron.shell.openExternal('https://github.com/tmoreno/open-log-viewer');
}
},
{
type: 'separator'
},
{
label: 'About',
click () {
dialog.showMessageBox({
type: "info",
title: "About",
buttons: ["OK"],
message: "Open Log Viewer 1.5.0",
detail: "Developed by Tomás Moreno Bernal\nLicensed under the GNU General Public License v3.0"
});
}
}
]
}
];
const menu = Menu.buildFromTemplate(template)
Menu.setApplicationMenu(menu)