new menu option: creating new torrents
This commit is contained in:
9
index.js
9
index.js
@@ -85,16 +85,15 @@ var template = [
|
||||
label: 'File',
|
||||
submenu: [
|
||||
{
|
||||
label: 'Create Torrent File...',
|
||||
label: 'Create New Torrent...',
|
||||
accelerator: 'CmdOrCtrl+N',
|
||||
click: function () {
|
||||
electron.dialog.showOpenDialog({
|
||||
title: 'Select a file or folder for the torrent file.',
|
||||
properties: [ 'openFile', 'multiSelections' ]
|
||||
properties: [ 'openFile', 'openDirectory', 'multiSelections' ]
|
||||
}, function (filenames) {
|
||||
filenames.forEach(function (filename) {
|
||||
mainWindow.send('action', 'addTorrent', filename)
|
||||
})
|
||||
if (!Array.isArray(filenames)) return
|
||||
mainWindow.send('action', 'seed', filenames)
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
@@ -69,6 +69,10 @@ function handler (action, ...args) {
|
||||
var torrentId = args[0]
|
||||
addTorrent(torrentId)
|
||||
}
|
||||
if (action === 'seed') {
|
||||
var files = args[0]
|
||||
seed(files)
|
||||
}
|
||||
if (action === 'openPlayer') {
|
||||
var torrent = args[0]
|
||||
openPlayer(torrent)
|
||||
|
||||
Reference in New Issue
Block a user