-
Notifications
You must be signed in to change notification settings - Fork 0
/
renderer.js
37 lines (31 loc) · 968 Bytes
/
renderer.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
const { ipcRenderer, remote, shell } = require('electron');
const { dialog } = remote;
const openFileButton = document.getElementById('openFileButton');
const destinationInput = document.getElementById('destinationInput');
openFileButton.addEventListener('click', () => {
const file = dialog.showOpenDialog({
properties: [
'openFile'
],
});
if (file) {
destinationInput.value = file;
}
});
saveButton.addEventListener('click', (event) => {
event.preventDefault();
ipcRenderer.send('save-settings', {
xmlPath: destinationInput.value
});
});
restoreDefaultButton.addEventListener('click', (event) => {
event.preventDefault();
ipcRenderer.send('restore-defaults');
});
ideaFoldersPageLink.addEventListener('click', (event) => {
event.preventDefault();
ipcRenderer.send('open-folder-page');
});
ipcRenderer.on('set-recent-project-path', (event, path) => {
alert(path);
});