Remove torrent/data confirmation modal

This commit is contained in:
Mathias Rasmussen
2016-06-01 16:20:01 +02:00
committed by DC
parent b950829de3
commit 54e70e7158
6 changed files with 41 additions and 8 deletions

View File

@@ -112,6 +112,14 @@ module.exports = class TorrentListController {
ipcRenderer.send('wt-select-files', infoHash, torrentSummary.selections)
}
confirmDeleteTorrent (infoHash, deleteData) {
this.state.modal = {
id: 'remove-torrent-modal',
infoHash,
deleteData
}
}
// TODO: use torrentKey, not infoHash
deleteTorrent (infoHash, deleteData) {
ipcRenderer.send('wt-stop-torrenting', infoHash)
@@ -151,14 +159,12 @@ module.exports = class TorrentListController {
menu.append(new electron.remote.MenuItem({
label: 'Remove From List',
click: () => this.deleteTorrent(
torrentSummary.infoHash, false)
click: dispatch('confirmDeleteTorrent', torrentSummary.infoHash, false)
}))
menu.append(new electron.remote.MenuItem({
label: 'Remove Data File',
click: () => this.deleteTorrent(
torrentSummary.infoHash, true)
click: dispatch('confirmDeleteTorrent', torrentSummary.infoHash, true)
}))
menu.append(new electron.remote.MenuItem({