Total Complexity | 1 |
Complexity/F | 1 |
Lines of Code | 31 |
Function Count | 1 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | // jshint esversion: 8 |
||
3 | const electron = require('electron'), |
||
4 | debug = require('debug')('main.bwa.fileinput'); |
||
5 | |||
6 | const { |
||
7 | app, |
||
8 | BrowserWindow, |
||
9 | Menu, |
||
10 | ipcMain, |
||
11 | dialog |
||
12 | } = electron; |
||
13 | |||
14 | /* |
||
15 | ipcMain.on('bwa:input.file', function(...) {...}); |
||
16 | File input, select file dialog |
||
17 | parameters |
||
18 | event |
||
19 | */ |
||
20 | ipcMain.on('bwa:input.file', function(event) { |
||
21 | var { |
||
22 | sender |
||
23 | } = event; |
||
24 | |||
25 | debug("Waiting for file selection"); |
||
26 | var filePath = dialog.showOpenDialogSync({ |
||
27 | title: "Select wordlist file", |
||
28 | buttonLabel: "Open", |
||
29 | properties: ['openFile', 'showHiddenFiles'] |
||
30 | }); |
||
31 | debug("Using selected file at {0}".format(filePath)); |
||
32 | sender.send('bwa:fileinput.confirmation', filePath); |
||
33 | }); |
||
34 | |||
46 |