Merge branch 'pr/607'
This commit is contained in:
@@ -2,7 +2,8 @@ module.exports = {
|
||||
openSeedFile,
|
||||
openSeedDirectory,
|
||||
openTorrentFile,
|
||||
openTorrentAddress
|
||||
openTorrentAddress,
|
||||
openAddFiles
|
||||
}
|
||||
|
||||
var electron = require('electron')
|
||||
@@ -83,6 +84,24 @@ function openTorrentAddress () {
|
||||
windows.main.dispatch('openTorrentAddress')
|
||||
}
|
||||
|
||||
/*
|
||||
* Show open dialog for all file types (.torrent, files to seed)
|
||||
*/
|
||||
function openAddFiles () {
|
||||
if (!windows.main.win) return
|
||||
log('openAddFiles')
|
||||
var opts = {
|
||||
title: 'Select a .torrent file to open or start seeding files.',
|
||||
properties: [ 'openFile', 'multiSelections' ]
|
||||
}
|
||||
setTitle(opts.title)
|
||||
electron.dialog.showOpenDialog(windows.main.win, opts, function (selectedPaths) {
|
||||
resetTitle()
|
||||
if (!Array.isArray(selectedPaths)) return
|
||||
windows.main.dispatch('onOpen', selectedPaths)
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Dialogs on do not show a title on OS X, so the window title is used instead.
|
||||
*/
|
||||
|
||||
@@ -46,6 +46,7 @@ function init () {
|
||||
*/
|
||||
|
||||
ipc.on('openTorrentFile', () => dialog.openTorrentFile())
|
||||
ipc.on('openAddFiles', () => dialog.openAddFiles())
|
||||
|
||||
/**
|
||||
* Dock
|
||||
|
||||
Reference in New Issue
Block a user