|
@@ -1,8 +1,7 @@ |
|
|
// Modules to control application life and create native browser window |
|
|
// Modules to control application life and create native browser window |
|
|
const { app, BrowserWindow, protocol, ipcMain, dialog } = require('electron') |
|
|
|
|
|
|
|
|
const { app, BrowserWindow, protocol, ipcMain, dialog, nativeImage } = require('electron') |
|
|
const path = require('path') |
|
|
const path = require('path') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const gotTheLock = app.requestSingleInstanceLock(); |
|
|
const gotTheLock = app.requestSingleInstanceLock(); |
|
|
|
|
|
|
|
|
if (!gotTheLock) { |
|
|
if (!gotTheLock) { |
|
@@ -76,4 +75,15 @@ ipcMain.handle('project-upload-file', async (event, args) => { |
|
|
properties: ['openFile'], |
|
|
properties: ['openFile'], |
|
|
}); |
|
|
}); |
|
|
return res; |
|
|
return res; |
|
|
}); |
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
const testIcon = nativeImage.createFromPath(path.resolve(__dirname, 'file_word.png')); |
|
|
|
|
|
|
|
|
|
|
|
ipcMain.handle('project-file-dnd', (event, filePath) => { |
|
|
|
|
|
console.log('receive file path: ', filePath) |
|
|
|
|
|
event.sender.startDrag({ |
|
|
|
|
|
file: filePath, // path.resolve(__dirname, 'file_word.png'), |
|
|
|
|
|
// icon: nativeImage.createFromNamedImage('NS') |
|
|
|
|
|
icon: testIcon, |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
}) |