feat(ui): aggiunge anteprima desktop dei file non smistati
This commit is contained in:
16
main.js
16
main.js
@@ -1,9 +1,10 @@
|
||||
const { app, BrowserWindow, dialog, ipcMain } = require('electron');
|
||||
const { app, BrowserWindow, dialog, ipcMain, shell } = require('electron');
|
||||
const path = require('path');
|
||||
const fs = require('fs-extra');
|
||||
|
||||
const { processFolder } = require('./services/folderProcessor');
|
||||
const { processZip } = require('./services/zipProcessor');
|
||||
const { resolveUnroutedDir, listUnroutedFiles } = require('./services/unrouted');
|
||||
|
||||
const CAD_EXTENSIONS = ['prt', 'asm', 'dwr'];
|
||||
const DEFAULT_DESTINATION = './output/cad';
|
||||
@@ -168,3 +169,16 @@ ipcMain.handle('update-destination', async (_event, payload) => {
|
||||
await persistDestination(config.destination);
|
||||
return { destination: config.destination };
|
||||
});
|
||||
|
||||
ipcMain.handle('open-unrouted-folder', async () => {
|
||||
const unroutedDir = await resolveUnroutedDir();
|
||||
const openResult = await shell.openPath(unroutedDir);
|
||||
|
||||
if (openResult) {
|
||||
throw new Error(`Impossibile aprire la cartella: ${openResult}`);
|
||||
}
|
||||
|
||||
return { path: unroutedDir };
|
||||
});
|
||||
|
||||
ipcMain.handle('list-unrouted-files', async () => listUnroutedFiles());
|
||||
|
||||
Reference in New Issue
Block a user