| |
|
| | const { app, BrowserWindow, Menu } = require('electron'); |
| | const path = require('path'); |
| |
|
| | function createWindow() { |
| | const win = new BrowserWindow({ |
| | width: 1280, |
| | height: 850, |
| | title: "AuditPro Sync", |
| | show: false, |
| | webPreferences: { |
| | nodeIntegration: true, |
| | contextIsolation: false, |
| | webSecurity: false, |
| | sandbox: false |
| | }, |
| | backgroundColor: '#ffffff' |
| | }); |
| |
|
| | win.loadFile(path.join(__dirname, 'index.html')); |
| |
|
| | win.once('ready-to-show', () => { |
| | win.show(); |
| | |
| | |
| | }); |
| |
|
| | const template = [ |
| | { |
| | label: 'AuditPro', |
| | submenu: [ |
| | { label: 'À propos', role: 'about' }, |
| | { type: 'separator' }, |
| | { label: 'Quitter', role: 'quit' } |
| | ] |
| | }, |
| | { label: 'Édition', role: 'editMenu' }, |
| | { |
| | label: 'Outils', |
| | submenu: [ |
| | { label: 'Actualiser', role: 'reload' }, |
| | { label: 'Outils Développeur', role: 'toggleDevTools' }, |
| | { type: 'separator' }, |
| | { role: 'resetZoom' }, |
| | { role: 'zoomIn' }, |
| | { role: 'zoomOut' } |
| | ] |
| | } |
| | ]; |
| | |
| | const menu = Menu.buildFromTemplate(template); |
| | Menu.setApplicationMenu(menu); |
| | } |
| |
|
| | app.whenReady().then(() => { |
| | createWindow(); |
| | app.on('activate', () => { |
| | if (BrowserWindow.getAllWindows().length === 0) createWindow(); |
| | }); |
| | }); |
| |
|
| | app.on('window-all-closed', () => { |
| | if (process.platform !== 'darwin') app.quit(); |
| | }); |
| |
|