menu: open torrent file dialog comes from main window
This commit is contained in:
4
index.js
4
index.js
@@ -101,11 +101,11 @@ var template = [
|
||||
label: 'Open Torrent File...',
|
||||
accelerator: 'CmdOrCtrl+O',
|
||||
click: function () {
|
||||
electron.dialog.showOpenDialog({
|
||||
electron.dialog.showOpenDialog(mainWindow, {
|
||||
title: 'Select a .torrent file to open.',
|
||||
properties: [ 'openFile', 'multiSelections' ]
|
||||
}, function (filenames) {
|
||||
if (!Array.isArary(filenames)) return
|
||||
if (!Array.isArray(filenames)) return
|
||||
filenames.forEach(function (filename) {
|
||||
mainWindow.send('action', 'addTorrent', filename)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user