mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-22 20:44:15 +00:00
- Added a message log when an UPnP WAN service is detected
This commit is contained in:
parent
3ff075c048
commit
4ca852c2b3
2
TODO
2
TODO
@ -43,5 +43,5 @@
|
|||||||
- Use tooltips to explain options
|
- Use tooltips to explain options
|
||||||
- Exit confirmation only if there are active downloads (display number of downloads) - SMARTER
|
- Exit confirmation only if there are active downloads (display number of downloads) - SMARTER
|
||||||
- Make use of QNetworkInterface (could be useful ?)
|
- Make use of QNetworkInterface (could be useful ?)
|
||||||
- Display more info in log (PeX, UPnP, DHT w/ ports...)
|
- Display more info in log (UPnP successful)
|
||||||
- Possibility to disable the trayicon
|
- Possibility to disable the trayicon
|
@ -106,6 +106,7 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent){
|
|||||||
tabs->setTabText(0, tr("Transfers") +" (0)");
|
tabs->setTabText(0, tr("Transfers") +" (0)");
|
||||||
#ifndef NO_UPNP
|
#ifndef NO_UPNP
|
||||||
connect(&BTSession, SIGNAL(noWanServiceDetected()), this, SLOT(displayNoUPnPWanServiceDetected()));
|
connect(&BTSession, SIGNAL(noWanServiceDetected()), this, SLOT(displayNoUPnPWanServiceDetected()));
|
||||||
|
connect(&BTSession, SIGNAL(wanServiceDetected()), this, SLOT(displayUPnPWanServiceDetected()));
|
||||||
#endif
|
#endif
|
||||||
connect(&BTSession, SIGNAL(addedTorrent(const QString&, torrent_handle&, bool)), this, SLOT(torrentAdded(const QString&, torrent_handle&, bool)));
|
connect(&BTSession, SIGNAL(addedTorrent(const QString&, torrent_handle&, bool)), this, SLOT(torrentAdded(const QString&, torrent_handle&, bool)));
|
||||||
connect(&BTSession, SIGNAL(duplicateTorrent(const QString&)), this, SLOT(torrentDuplicate(const QString&)));
|
connect(&BTSession, SIGNAL(duplicateTorrent(const QString&)), this, SLOT(torrentDuplicate(const QString&)));
|
||||||
@ -284,6 +285,11 @@ void GUI::readParamsOnSocket(){
|
|||||||
void GUI::displayNoUPnPWanServiceDetected(){
|
void GUI::displayNoUPnPWanServiceDetected(){
|
||||||
setInfoBar(tr("UPnP: no WAN service detected..."), "red");
|
setInfoBar(tr("UPnP: no WAN service detected..."), "red");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GUI::displayUPnPWanServiceDetected(){
|
||||||
|
setInfoBar(tr("UPnP: WAN service detected!"), "green");
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Toggle paused state of selected torrent
|
// Toggle paused state of selected torrent
|
||||||
|
@ -142,6 +142,7 @@ class GUI : public QMainWindow, private Ui::MainWindow{
|
|||||||
void askForTorrentUrl();
|
void askForTorrentUrl();
|
||||||
#ifndef NO_UPNP
|
#ifndef NO_UPNP
|
||||||
void displayNoUPnPWanServiceDetected();
|
void displayNoUPnPWanServiceDetected();
|
||||||
|
void displayUPnPWanServiceDetected();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -893,7 +893,7 @@ bool CUPnPControlPoint::AddPortMappings(
|
|||||||
qDebug("UPnP: %s", msg.str().c_str());
|
qDebug("UPnP: %s", msg.str().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
emit yeswanServiceDetected();
|
||||||
int n = upnpPortMapping.size();
|
int n = upnpPortMapping.size();
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
|
|
||||||
|
@ -599,6 +599,7 @@ public:
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
void noWanServiceDetected();
|
void noWanServiceDetected();
|
||||||
|
void yeswanServiceDetected();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void OnEventReceived(
|
void OnEventReceived(
|
||||||
|
@ -90,6 +90,7 @@ void bittorrent::enableUPnP(int port){
|
|||||||
"qBittorrent");
|
"qBittorrent");
|
||||||
m_upnp = new CUPnPControlPoint(port);
|
m_upnp = new CUPnPControlPoint(port);
|
||||||
connect(m_upnp, SIGNAL(noWanServiceDetected()), this, SLOT(noWanServiceEventHandler()));
|
connect(m_upnp, SIGNAL(noWanServiceDetected()), this, SLOT(noWanServiceEventHandler()));
|
||||||
|
connect(m_upnp, SIGNAL(yeswanServiceDetected()), this, SLOT(wanServiceEventHandler()));
|
||||||
m_upnp->AddPortMappings(m_upnpMappings);
|
m_upnp->AddPortMappings(m_upnpMappings);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -99,6 +100,11 @@ void bittorrent::noWanServiceEventHandler(){
|
|||||||
emit noWanServiceDetected();
|
emit noWanServiceDetected();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void bittorrent::wanServiceEventHandler(){
|
||||||
|
// Forward this signal
|
||||||
|
emit wanServiceDetected();
|
||||||
|
}
|
||||||
|
|
||||||
// Set UPnP port (>= 1000)
|
// Set UPnP port (>= 1000)
|
||||||
void bittorrent::setUPnPPort(int upnp_port){
|
void bittorrent::setUPnPPort(int upnp_port){
|
||||||
if(!UPnPEnabled){
|
if(!UPnPEnabled){
|
||||||
|
@ -135,6 +135,7 @@ class bittorrent : public QObject{
|
|||||||
void saveTrackerFile(const QString& hash);
|
void saveTrackerFile(const QString& hash);
|
||||||
#ifndef NO_UPNP
|
#ifndef NO_UPNP
|
||||||
void noWanServiceEventHandler();
|
void noWanServiceEventHandler();
|
||||||
|
void wanServiceEventHandler();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
@ -152,6 +153,7 @@ class bittorrent : public QObject{
|
|||||||
void aboutToDownloadFromUrl(const QString& url);
|
void aboutToDownloadFromUrl(const QString& url);
|
||||||
#ifndef NO_UPNP
|
#ifndef NO_UPNP
|
||||||
void noWanServiceDetected();
|
void noWanServiceDetected();
|
||||||
|
void wanServiceDetected();
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user