[Partial browse mount location] [Layout changes]

This commit is contained in:
Scott E. Graves
2018-12-13 15:00:07 -06:00
parent 98e06b4498
commit 8618bf9965
5 changed files with 58 additions and 16 deletions

View File

@@ -1,6 +1,6 @@
// Modules to control application life and create native browser window
const {app, BrowserWindow, Tray, nativeImage, Menu} = require('electron');
const {app, BrowserWindow, Tray, nativeImage, Menu, dialog} = require('electron');
const {ipcMain} = require('electron');
const Constants = require('./src/constants');
const path = require('path');
@@ -249,6 +249,20 @@ const standardIPCReply = (event, channel, data, error) => {
}
};
ipcMain.on(Constants.IPC_Browse_Directory, (event, data) => {
dialog.showOpenDialog(mainWindow, {
defaultPath: data.Location,
properties: ['openDirectory'],
title: data.Title,
}, (filePaths) => {
if (filePaths && (filePaths.length > 0)) {
event.returnValue = filePaths[0];
} else {
event.returnValue = '';
}
});
});
ipcMain.on(Constants.IPC_Check_Dependency_Installed, (event, data) => {
try {
const exists = fs.lstatSync(data.File).isFile();