added start / stop events; starting / stopping folder watcher.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
module.exports = {
|
||||
init
|
||||
init,
|
||||
setModule
|
||||
}
|
||||
|
||||
const electron = require('electron')
|
||||
@@ -13,6 +14,14 @@ const windows = require('./windows')
|
||||
// Messages from the main process, to be sent once the WebTorrent process starts
|
||||
const messageQueueMainToWebTorrent = []
|
||||
|
||||
// Will hold modules injected from the app that will be used on fired
|
||||
// IPC events.
|
||||
const modules = {}
|
||||
|
||||
function setModule (name, module) {
|
||||
modules[name] = module
|
||||
}
|
||||
|
||||
function init () {
|
||||
const ipc = electron.ipcMain
|
||||
|
||||
@@ -106,6 +115,16 @@ function init () {
|
||||
thumbar.onPlayerPause()
|
||||
})
|
||||
|
||||
ipc.on('startFolderWatcher', function () {
|
||||
log('--- Torrent Watcher started')
|
||||
modules['folderWatcher'].start()
|
||||
})
|
||||
|
||||
ipc.on('stopFolderWatcher', function () {
|
||||
log('--- Torrent Watcher stop')
|
||||
modules['folderWatcher'].stop()
|
||||
})
|
||||
|
||||
/**
|
||||
* Shell
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user