mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-13 00:33:09 -07:00
- Use torrent addition dialog for Magnet URIs too
This commit is contained in:
parent
a1dd724220
commit
ba0c7334b7
5 changed files with 132 additions and 43 deletions
17
src/GUI.cpp
17
src/GUI.cpp
|
@ -651,8 +651,12 @@ void GUI::processParams(const QStringList& params) {
|
|||
BTSession->downloadFromUrl(param);
|
||||
}else{
|
||||
if(param.startsWith("magnet:", Qt::CaseInsensitive)) {
|
||||
// FIXME: Possibily skipped torrent addition dialog
|
||||
BTSession->addMagnetUri(param);
|
||||
if(useTorrentAdditionDialog) {
|
||||
torrentAdditionDialog *dialog = new torrentAdditionDialog(this, BTSession);
|
||||
dialog->showLoadMagnetURI(param);
|
||||
} else {
|
||||
BTSession->addMagnetUri(param);
|
||||
}
|
||||
} else {
|
||||
if(useTorrentAdditionDialog) {
|
||||
torrentAdditionDialog *dialog = new torrentAdditionDialog(this, BTSession);
|
||||
|
@ -833,9 +837,16 @@ void GUI::showNotificationBaloon(QString title, QString msg) const {
|
|||
*****************************************************/
|
||||
|
||||
void GUI::downloadFromURLList(const QStringList& url_list) {
|
||||
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||
bool useTorrentAdditionDialog = settings.value(QString::fromUtf8("Preferences/Downloads/AdditionDialog"), true).toBool();
|
||||
foreach(const QString url, url_list) {
|
||||
if(url.startsWith("magnet:", Qt::CaseInsensitive)) {
|
||||
BTSession->addMagnetUri(url);
|
||||
if(useTorrentAdditionDialog) {
|
||||
torrentAdditionDialog *dialog = new torrentAdditionDialog(this, BTSession);
|
||||
dialog->showLoadMagnetURI(url);
|
||||
} else {
|
||||
BTSession->addMagnetUri(url);
|
||||
}
|
||||
} else {
|
||||
BTSession->downloadFromUrl(url);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue