Search in sources :

Example 1 with OpenTorrentWindow

use of com.biglybt.ui.swt.shells.opentorrent.OpenTorrentWindow in project BiglyBT by BiglySoftware.

the class UIFunctionsImpl method openTorrentOpenOptions.

@Override
public void openTorrentOpenOptions(Shell shell, String sPathOfFilesToOpen, String[] sFilesToOpen, Map<String, Object> options) {
    Boolean _defaultToStopped = (Boolean) options.get(UIFunctions.OTO_DEFAULT_TO_STOPPED);
    boolean defaultToStopped = _defaultToStopped != null ? _defaultToStopped : UIFunctions.OTO_DEFAULT_TO_STOPPED_DEFAULT;
    Boolean _hideErrors = (Boolean) options.get(UIFunctions.OTO_HIDE_ERRORS);
    boolean hideErrors = _hideErrors != null ? _hideErrors : UIFunctions.OTO_HIDE_ERRORS_DEFAULT;
    TorrentOpenOptions torrentOptions = new TorrentOpenOptions();
    if (defaultToStopped) {
        torrentOptions.setStartMode(TorrentOpenOptions.STARTMODE_STOPPED);
    }
    torrentOptions.setHideErrors(hideErrors);
    if (sFilesToOpen == null) {
        new OpenTorrentWindow(shell);
    } else {
        // with no listener, Downloader will open options window if user configured
        Boolean _forceOpen = (Boolean) options.get(UIFunctions.OTO_FORCE_OPEN);
        boolean forceOpen = _forceOpen != null ? _forceOpen : UIFunctions.OTO_FORCE_OPEN_DEFAULT;
        TorrentOpener.openTorrentsFromStrings(torrentOptions, shell, sPathOfFilesToOpen, sFilesToOpen, null, null, forceOpen);
    }
}
Also used : TorrentOpenOptions(com.biglybt.core.torrent.impl.TorrentOpenOptions) OpenTorrentWindow(com.biglybt.ui.swt.shells.opentorrent.OpenTorrentWindow)

Aggregations

TorrentOpenOptions (com.biglybt.core.torrent.impl.TorrentOpenOptions)1 OpenTorrentWindow (com.biglybt.ui.swt.shells.opentorrent.OpenTorrentWindow)1