-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain-preload.js
More file actions
40 lines (31 loc) · 1.11 KB
/
main-preload.js
File metadata and controls
40 lines (31 loc) · 1.11 KB
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
const { ipcRenderer, BrowserWindow } = require('electron')
const path = require('path')
function setupAutoStart(){
ipcRenderer.on('autoStartReply', (event, arg) => {
console.log("auto start" + arg)
})
ipcRenderer.send('setAutoStart', 'ping')
}
function downloadEngine(){
ipcRenderer.send('downloadEngine', {payload : {url, properties: {}}})
}
ipcRenderer.on("engine-download-progress", (event, args) => {
const progress = args[0];
// set progress in progress bar
})
ipcRenderer.on("engine-download-complete", (event, args) => {
const progress = args[0];
// set progress in progress bar
})
window.addEventListener("load", (event) => {
// ------------------ AUTO START -------------------
let btn_auto_start = document.getElementById('click')
btn_auto_start.addEventListener("click", ()=>{
setupAutoStart()
});
// ------------------ CONFIGURATION WINDOW ------------------
let btn_configuration = document.getElementById('btn-configuration')
btn_configuration.addEventListener("click", ()=>{
ipcRenderer.send("showConfigurationWindow")
});
});