Remove unnecessary IPC
This commit is contained in:
@@ -120,11 +120,11 @@ function sliceArgv (argv) {
|
|||||||
function processArgv (argv) {
|
function processArgv (argv) {
|
||||||
argv.forEach(function (arg) {
|
argv.forEach(function (arg) {
|
||||||
if (arg === '-n') {
|
if (arg === '-n') {
|
||||||
windows.main.send('dispatch', 'showOpenSeedFiles')
|
menu.showOpenSeedFiles()
|
||||||
} else if (arg === '-o') {
|
} else if (arg === '-o') {
|
||||||
windows.main.send('dispatch', 'showOpenTorrentFile')
|
menu.showOpenTorrentFile()
|
||||||
} else if (arg === '-u') {
|
} else if (arg === '-u') {
|
||||||
windows.main.send('showOpenTorrentAddress')
|
menu.showOpenTorrentAddress()
|
||||||
} else if (arg.startsWith('-psn')) {
|
} else if (arg.startsWith('-psn')) {
|
||||||
// Ignore OS X launchd "process serial number" argument
|
// Ignore OS X launchd "process serial number" argument
|
||||||
// More: https://github.com/feross/webtorrent-desktop/issues/214
|
// More: https://github.com/feross/webtorrent-desktop/issues/214
|
||||||
|
|||||||
@@ -43,8 +43,6 @@ function init () {
|
|||||||
|
|
||||||
ipcMain.on('showOpenTorrentFile', menu.showOpenTorrentFile)
|
ipcMain.on('showOpenTorrentFile', menu.showOpenTorrentFile)
|
||||||
|
|
||||||
ipcMain.on('showOpenSeedFiles', menu.showOpenSeedFiles)
|
|
||||||
|
|
||||||
ipcMain.on('setBounds', function (e, bounds, maximize) {
|
ipcMain.on('setBounds', function (e, bounds, maximize) {
|
||||||
setBounds(bounds, maximize)
|
setBounds(bounds, maximize)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
init,
|
init,
|
||||||
|
onPlayerClose,
|
||||||
|
onPlayerOpen,
|
||||||
onToggleFullScreen,
|
onToggleFullScreen,
|
||||||
onWindowHide,
|
onWindowHide,
|
||||||
onWindowShow,
|
onWindowShow,
|
||||||
onPlayerOpen,
|
|
||||||
onPlayerClose,
|
|
||||||
showOpenSeedFiles,
|
showOpenSeedFiles,
|
||||||
|
showOpenTorrentAddress,
|
||||||
showOpenTorrentFile,
|
showOpenTorrentFile,
|
||||||
toggleFullScreen
|
toggleFullScreen
|
||||||
}
|
}
|
||||||
@@ -111,8 +112,8 @@ function getMenuItem (label) {
|
|||||||
// Prompts the user for a file, then makes a torrent out of the data
|
// Prompts the user for a file, then makes a torrent out of the data
|
||||||
function showOpenSeedFile () {
|
function showOpenSeedFile () {
|
||||||
electron.dialog.showOpenDialog({
|
electron.dialog.showOpenDialog({
|
||||||
title: 'Select a file for the torrent file',
|
title: 'Select a file for the torrent file.',
|
||||||
properties: ['openFile']
|
properties: [ 'openFile' ]
|
||||||
}, function (filenames) {
|
}, function (filenames) {
|
||||||
if (!Array.isArray(filenames)) return
|
if (!Array.isArray(filenames)) return
|
||||||
var file = filenames[0]
|
var file = filenames[0]
|
||||||
|
|||||||
@@ -211,9 +211,6 @@ function dispatch (action, ...args) {
|
|||||||
if (action === 'addTorrent') {
|
if (action === 'addTorrent') {
|
||||||
addTorrent(args[0] /* torrent */)
|
addTorrent(args[0] /* torrent */)
|
||||||
}
|
}
|
||||||
if (action === 'showOpenSeedFiles') {
|
|
||||||
ipcRenderer.send('showOpenSeedFiles') /* open file or folder to seed */
|
|
||||||
}
|
|
||||||
if (action === 'showOpenTorrentFile') {
|
if (action === 'showOpenTorrentFile') {
|
||||||
ipcRenderer.send('showOpenTorrentFile') /* open torrent file */
|
ipcRenderer.send('showOpenTorrentFile') /* open torrent file */
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user