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',
|
label: 'File',
|
||||||
submenu: [
|
submenu: [
|
||||||
{
|
{
|
||||||
label: 'Create Torrent File...',
|
label: 'Create New Torrent...',
|
||||||
accelerator: 'CmdOrCtrl+N',
|
accelerator: 'CmdOrCtrl+N',
|
||||||
click: function () {
|
click: function () {
|
||||||
electron.dialog.showOpenDialog({
|
electron.dialog.showOpenDialog({
|
||||||
title: 'Select a file or folder for the torrent file.',
|
title: 'Select a file or folder for the torrent file.',
|
||||||
properties: [ 'openFile', 'multiSelections' ]
|
properties: [ 'openFile', 'openDirectory', 'multiSelections' ]
|
||||||
}, function (filenames) {
|
}, function (filenames) {
|
||||||
filenames.forEach(function (filename) {
|
if (!Array.isArray(filenames)) return
|
||||||
mainWindow.send('action', 'addTorrent', filename)
|
mainWindow.send('action', 'seed', filenames)
|
||||||
})
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -69,6 +69,10 @@ function handler (action, ...args) {
|
|||||||
var torrentId = args[0]
|
var torrentId = args[0]
|
||||||
addTorrent(torrentId)
|
addTorrent(torrentId)
|
||||||
}
|
}
|
||||||
|
if (action === 'seed') {
|
||||||
|
var files = args[0]
|
||||||
|
seed(files)
|
||||||
|
}
|
||||||
if (action === 'openPlayer') {
|
if (action === 'openPlayer') {
|
||||||
var torrent = args[0]
|
var torrent = args[0]
|
||||||
openPlayer(torrent)
|
openPlayer(torrent)
|
||||||
|
|||||||
Reference in New Issue
Block a user