mirror of
https://github.com/PR0M3TH3AN/VoxVera.git
synced 2025-09-08 23:18:42 +00:00
Add Electron GUI and packaging scripts
This commit is contained in:
28
gui/electron/main.js
Normal file
28
gui/electron/main.js
Normal file
@@ -0,0 +1,28 @@
|
||||
const { app, BrowserWindow, ipcMain } = require('electron');
|
||||
const { spawn } = require('child_process');
|
||||
const path = require('path');
|
||||
|
||||
function createWindow() {
|
||||
const win = new BrowserWindow({
|
||||
width: 800,
|
||||
height: 600,
|
||||
webPreferences: {
|
||||
preload: path.join(__dirname, 'preload.js')
|
||||
}
|
||||
});
|
||||
win.loadFile('index.html');
|
||||
}
|
||||
|
||||
app.whenReady().then(createWindow);
|
||||
|
||||
ipcMain.handle('run-quickstart', async () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
const proc = spawn('voxvera', ['quickstart'], { stdio: 'inherit' });
|
||||
proc.on('close', code => resolve(code));
|
||||
proc.on('error', err => reject(err));
|
||||
});
|
||||
});
|
||||
|
||||
app.on('window-all-closed', () => {
|
||||
if (process.platform !== 'darwin') app.quit();
|
||||
});
|
Reference in New Issue
Block a user