mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-10 14:57:52 +00:00
- Added magnet URI support to Web UI
This commit is contained in:
parent
462f6c41cd
commit
25d998f1b5
@ -1445,6 +1445,10 @@ void bittorrent::downloadFromUrl(QString url) {
|
||||
downloader->downloadUrl(url);
|
||||
}
|
||||
|
||||
void bittorrent::addMagnetSkipAddDlg(QString uri) {
|
||||
addMagnetUri(uri, false);
|
||||
}
|
||||
|
||||
void bittorrent::downloadUrlAndSkipDialog(QString url, QString save_path) {
|
||||
//emit aboutToDownloadFromUrl(url);
|
||||
if(!save_path.isEmpty())
|
||||
|
@ -167,6 +167,7 @@ class bittorrent : public QObject {
|
||||
void addPeerBanMessage(QString msg, bool from_ipfilter);
|
||||
void processDownloadedFile(QString, QString);
|
||||
void saveTrackerFile(QString hash);
|
||||
void addMagnetSkipAddDlg(QString uri);
|
||||
|
||||
protected slots:
|
||||
void scanDirectory(QString);
|
||||
|
@ -187,10 +187,14 @@ void HttpConnection::respondCommand(QString command)
|
||||
foreach(QString url, list){
|
||||
url = url.trimmed();
|
||||
if(!url.isEmpty()){
|
||||
if(url.startsWith("magnet:", Qt::CaseInsensitive)) {
|
||||
emit MagnetReadyToBeDownloaded(url);
|
||||
} else {
|
||||
qDebug("Downloading url: %s", (const char*)url.toLocal8Bit());
|
||||
emit UrlReadyToBeDownloaded(url);
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
if(command == "upload")
|
||||
|
@ -68,6 +68,7 @@ class HttpConnection : public QObject
|
||||
|
||||
signals:
|
||||
void UrlReadyToBeDownloaded(QString url);
|
||||
void MagnetReadyToBeDownloaded(QString uri);
|
||||
void torrentReadyToBeDownloaded(QString, bool, QString, bool);
|
||||
void deleteTorrent(QString hash, bool permanently);
|
||||
void resumeTorrent(QString hash);
|
||||
|
@ -72,6 +72,7 @@ void HttpServer::newHttpConnection()
|
||||
HttpConnection *connection = new HttpConnection(socket, this);
|
||||
//connect connection to BTSession
|
||||
connect(connection, SIGNAL(UrlReadyToBeDownloaded(QString)), BTSession, SLOT(downloadUrlAndSkipDialog(QString)));
|
||||
connect(connection, SIGNAL(MagnetReadyToBeDownloaded(QString)), BTSession, SLOT(addMagnetSkipAddDlg(QString)));
|
||||
connect(connection, SIGNAL(torrentReadyToBeDownloaded(QString, bool, QString, bool)), BTSession, SLOT(addTorrent(QString, bool, QString, bool)));
|
||||
connect(connection, SIGNAL(deleteTorrent(QString, bool)), BTSession, SLOT(deleteTorrent(QString, bool)));
|
||||
connect(connection, SIGNAL(pauseTorrent(QString)), BTSession, SLOT(pauseTorrent(QString)));
|
||||
|
@ -10,8 +10,8 @@
|
||||
</head>
|
||||
<body>
|
||||
<center>
|
||||
<h1 class="vcenter"><img class="vcenter" title="Download from URL" src="images/skin/url.png"/>Download Torrents from URLs</h1>
|
||||
<textarea name="list" id="urls" rows="10" cols="1"></textarea><p>Only One URL per Line</p><a id=downButton>Download</a>
|
||||
<h1 class="vcenter"><img class="vcenter" title="Download from URL" src="images/skin/url.png"/>Download Torrents from their URL or Magnet link</h1>
|
||||
<textarea name="list" id="urls" rows="10" cols="1"></textarea><p>Only one link per line</p><a id=downButton>Download</a>
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -23,7 +23,7 @@
|
||||
<div id="desktop">
|
||||
<div id="desktopHeader">
|
||||
<div id="desktopTitlebar">
|
||||
<h1 class="applicationTitle">qBittorrent Web User Interface <span class="version">version 1.3.1</span></h1>
|
||||
<h1 class="applicationTitle">qBittorrent Web User Interface <span class="version">version 1.3.2</span></h1>
|
||||
</div>
|
||||
<div id="desktopNavbar">
|
||||
<ul>
|
||||
|
Loading…
Reference in New Issue
Block a user