forked from polimediaupv/paella
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
53 lines (44 loc) · 1.33 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
const {app, BrowserWindow} = require('electron');
const url = require('url');
const path = require('path');
const WindowStateManager = require('electron-window-state-manager');
function buildPaella() {
let exec = require('child_process').execSync;
exec('gulp build.debug');
}
function launch(indexFile) {
let win = null;
const mainWindowState = new WindowStateManager('mainWindow', {
defaultWidth: 1024,
defaultHeight: 768
});
function createWindow() {
win = new BrowserWindow({
width: mainWindowState.width,
height: mainWindowState.height,
x: mainWindowState.x,
y: mainWindowState.y
// icon: path.join(__dirname, "data/paella-512.png")
});
if (mainWindowState.maximized) {
win.maximize();
}
win.loadURL(url.format({
pathname: path.join(__dirname, indexFile),
search:'id=belmar-multiresolution-remote',
protocol: 'file',
slashes: true
}));
win.on('close', () => {
mainWindowState.saveState(win);
});
app.on('window-all-closed', () => {
app.quit();
});
}
app.on('ready', () => {
createWindow();
});
}
buildPaella();
launch("index-debug.html",false);