feat(ui): aggiunge guida utente e menu Help > Documentazione

This commit is contained in:
2026-03-16 11:58:55 +01:00
parent 105a23853a
commit 22801f6b75
4 changed files with 635 additions and 3 deletions

23
main.js
View File

@@ -1,4 +1,4 @@
const { app, BrowserWindow, dialog, ipcMain, shell } = require('electron');
const { app, BrowserWindow, dialog, ipcMain, shell, Menu } = require('electron');
const path = require('path');
const fs = require('fs-extra');
@@ -13,7 +13,7 @@ const {
} = require('./services/unrouted');
const CAD_EXTENSIONS = ['prt', 'asm', 'dwr'];
const DEFAULT_DESTINATION = './output/cad';
const DEFAULT_DESTINATION = 'X:\\';
const SETTINGS_FILENAME = 'cad-router-settings.json';
const LINUX_RUNTIME_DIR = '.cadroute';
@@ -79,6 +79,25 @@ function createWindow() {
win.loadFile(path.join(__dirname, 'renderer', 'index.html'));
}
function createDocsWindow() {
const docs = new BrowserWindow({
width: 900,
height: 700,
title: 'CadRoute — Documentazione',
icon: path.join(__dirname, 'build', 'icon.png'),
webPreferences: { contextIsolation: true, nodeIntegration: false },
});
docs.loadFile(path.join(__dirname, 'renderer', 'docs', 'index.html'));
docs.setMenuBarVisibility(false);
}
Menu.setApplicationMenu(Menu.buildFromTemplate([
{
label: 'Help',
submenu: [{ label: 'Documentazione', click: () => createDocsWindow() }],
},
]));
app.whenReady().then(async () => {
await ensureRuntimeDirectory();
const persistedDestination = await loadPersistedDestination();