UI User relativ functional

This commit is contained in:
andrei-mihnea-cerbu
2024-04-01 22:44:09 +03:00
parent 79e508d3de
commit fb957a6f97
18 changed files with 381 additions and 83 deletions
+8
View File
@@ -167,6 +167,14 @@ ipcMain.handle('open-backup-dir-dialog', async (event) => {
}
});
ipcMain.handle('open-file-dialog', async (event) => {
const result = await dialog.showOpenDialog({
properties: ['openFile']
});
return result.filePaths[0] || '';
});
ipcMain.handle('check-file-exists', async (event, fileName) => {
try {
const filePath = path.join(__dirname, '..', '..', fileName);
+1
View File
@@ -8,5 +8,6 @@ contextBridge.exposeInMainWorld('electronAPI', {
showAlert: (message) => ipcRenderer.invoke('show-alert', message),
closeAlertWindow: () => ipcRenderer.send('close-alert-window'),
openBackupDirDialog: () => ipcRenderer.invoke('open-backup-dir-dialog'),
openFileDialog: () => ipcRenderer.invoke('open-file-dialog'),
checkFileExists: (fileName) => ipcRenderer.invoke('check-file-exists', fileName)
});