OS X: Bounce the Downloads stack when download completes
(If the download is inside the Downloads folder.)
This commit is contained in:
@@ -93,6 +93,13 @@ function init () {
|
|||||||
windows.focusWindow(windows[windowName])
|
windows.focusWindow(windows[windowName])
|
||||||
})
|
})
|
||||||
|
|
||||||
|
ipcMain.on('downloadFinished', function (e, filePath) {
|
||||||
|
if (app.dock) {
|
||||||
|
// Bounces the Downloads stack if the filePath is inside the Downloads folder.
|
||||||
|
app.dock.downloadFinished(filePath)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
ipcMain.on('checkForVLC', function (e) {
|
ipcMain.on('checkForVLC', function (e) {
|
||||||
vlc.checkForVLC(function (isInstalled) {
|
vlc.checkForVLC(function (isInstalled) {
|
||||||
windows.main.send('checkForVLC', isInstalled)
|
windows.main.send('checkForVLC', isInstalled)
|
||||||
|
|||||||
@@ -773,6 +773,7 @@ function torrentDone (torrentKey, torrentInfo) {
|
|||||||
state.dock.badge += 1
|
state.dock.badge += 1
|
||||||
}
|
}
|
||||||
showDoneNotification(torrentSummary)
|
showDoneNotification(torrentSummary)
|
||||||
|
ipcRenderer.send('downloadFinished', getTorrentPath(torrentSummary))
|
||||||
}
|
}
|
||||||
|
|
||||||
update()
|
update()
|
||||||
@@ -1018,12 +1019,16 @@ function openTorrentContextMenu (infoHash) {
|
|||||||
menu.popup(electron.remote.getCurrentWindow())
|
menu.popup(electron.remote.getCurrentWindow())
|
||||||
}
|
}
|
||||||
|
|
||||||
function showItemInFolder (torrentSummary) {
|
function getTorrentPath (torrentSummary) {
|
||||||
var itemPath = path.join(torrentSummary.path, torrentSummary.files[0].path)
|
var itemPath = path.join(torrentSummary.path, torrentSummary.files[0].path)
|
||||||
if (torrentSummary.files.length > 1) {
|
if (torrentSummary.files.length > 1) {
|
||||||
itemPath = path.dirname(itemPath)
|
itemPath = path.dirname(itemPath)
|
||||||
}
|
}
|
||||||
ipcRenderer.send('showItemInFolder', itemPath)
|
return itemPath
|
||||||
|
}
|
||||||
|
|
||||||
|
function showItemInFolder (torrentSummary) {
|
||||||
|
ipcRenderer.send('showItemInFolder', getTorrentPath(torrentSummary))
|
||||||
}
|
}
|
||||||
|
|
||||||
function saveTorrentFileAs (torrentSummary) {
|
function saveTorrentFileAs (torrentSummary) {
|
||||||
|
|||||||
Reference in New Issue
Block a user