forked from CityOfZion/neon-wallet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
78 lines (72 loc) · 1.8 KB
/
main.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
const {app, shell, Menu, BrowserWindow} = require('electron');
const path = require('path');
const url = require('url');
let mainWindow = null;
app.on('window-all-closed', () => {
app.quit()
})
app.on('ready', () => {
mainWindow = new BrowserWindow({
height: 750,
width: 1000,
minHeight: 750,
minWidth: 1000,
icon: path.join(__dirname, 'icons/png/64x64.png'),
webPreferences: {
webSecurity: false
},
});
if (process.platform !== 'darwin') {
// Windows/Linxu Menu
mainWindow.setMenu(null);
} else {
// Menu is required for MacOS
const template = [
{
label: app.getName(),
submenu: [
{role: 'about'},
{type: 'separator'},
{role: 'quit'}
],
},
{
label: 'Edit',
submenu: [
{role: 'undo'},
{role: 'redo'},
{type: 'separator'},
{role: 'cut'},
{role: 'copy'},
{role: 'paste'}
]
},
{
label: 'View',
submenu: [
{role: 'toggledevtools'}
]
},
{
role: 'help',
submenu: [
{label: 'City of Zion', click () { shell.openExternal('https://cityofzion.io/') }},
{label: 'GithHub', click () { shell.openExternal('https://github.com/CityOfZion') }},
{label: 'NEO Reddit', click () { shell.openExternal('https://www.reddit.com/r/NEO/') }},
{label: 'Slack', click () { shell.openExternal('https://neosmarteconomy.slack.com') }}
]
}
];
const menu = Menu.buildFromTemplate(template);
Menu.setApplicationMenu(menu);
}
// load the local HTML file
mainWindow.loadURL(url.format({
protocol: 'file',
slashes: true,
pathname: path.join(__dirname, '/app/dist/index.html')
}));
mainWindow.on('closed', function () {
mainWindow = null;
});
})