|
|
@ -104,6 +104,9 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent){ |
|
|
|
} |
|
|
|
} |
|
|
|
nbTorrents = 0; |
|
|
|
nbTorrents = 0; |
|
|
|
tabs->setTabText(0, tr("Transfers") +" (0)"); |
|
|
|
tabs->setTabText(0, tr("Transfers") +" (0)"); |
|
|
|
|
|
|
|
#ifndef NO_UPNP |
|
|
|
|
|
|
|
connect(&BTSession, SIGNAL(noWanServiceDetected()), this, SLOT(displayNoUPnPWanServiceDetected())); |
|
|
|
|
|
|
|
#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&))); |
|
|
|
connect(&BTSession, SIGNAL(invalidTorrent(const QString&)), this, SLOT(torrentCorrupted(const QString&))); |
|
|
|
connect(&BTSession, SIGNAL(invalidTorrent(const QString&)), this, SLOT(torrentCorrupted(const QString&))); |
|
|
@ -277,6 +280,12 @@ void GUI::readParamsOnSocket(){ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef NO_UPNP |
|
|
|
|
|
|
|
void GUI::displayNoUPnPWanServiceDetected(){ |
|
|
|
|
|
|
|
setInfoBar(tr("UPnP: no WAN service detected..."), "red"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
// Toggle paused state of selected torrent
|
|
|
|
// Toggle paused state of selected torrent
|
|
|
|
void GUI::togglePausedState(const QModelIndex& index){ |
|
|
|
void GUI::togglePausedState(const QModelIndex& index){ |
|
|
|
int row = index.row(); |
|
|
|
int row = index.row(); |
|
|
@ -953,7 +962,7 @@ void GUI::configureSession(bool deleteOptions){ |
|
|
|
BTSession.setListeningPortsRange(options->getPorts()); |
|
|
|
BTSession.setListeningPortsRange(options->getPorts()); |
|
|
|
new_listenPort = BTSession.getListenPort(); |
|
|
|
new_listenPort = BTSession.getListenPort(); |
|
|
|
if(new_listenPort != old_listenPort){ |
|
|
|
if(new_listenPort != old_listenPort){ |
|
|
|
setInfoBar(tr("Listening on port: %1", "e.g: Listening on port: 1666").arg( QString(misc::toString(new_listenPort).c_str()))); |
|
|
|
setInfoBar(tr("qBittorrent is bind to port: %1", "e.g: qBittorrent is bind to port: 1666").arg( QString(misc::toString(new_listenPort).c_str()))); |
|
|
|
} |
|
|
|
} |
|
|
|
// Apply max connec limit (-1 if disabled)
|
|
|
|
// Apply max connec limit (-1 if disabled)
|
|
|
|
BTSession.setMaxConnections(options->getMaxConnec()); |
|
|
|
BTSession.setMaxConnections(options->getMaxConnec()); |
|
|
@ -978,26 +987,32 @@ void GUI::configureSession(bool deleteOptions){ |
|
|
|
BTSession.setGlobalRatio(options->getRatio()); |
|
|
|
BTSession.setGlobalRatio(options->getRatio()); |
|
|
|
// DHT (Trackerless)
|
|
|
|
// DHT (Trackerless)
|
|
|
|
if(options->isDHTEnabled()){ |
|
|
|
if(options->isDHTEnabled()){ |
|
|
|
|
|
|
|
setInfoBar(tr("DHT support [ON], port: %1").arg(options->getDHTPort()), "blue"); |
|
|
|
BTSession.enableDHT(); |
|
|
|
BTSession.enableDHT(); |
|
|
|
// Set DHT Port
|
|
|
|
// Set DHT Port
|
|
|
|
BTSession.setDHTPort(options->getDHTPort()); |
|
|
|
BTSession.setDHTPort(options->getDHTPort()); |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
|
|
|
|
setInfoBar(tr("DHT support [OFF]"), "blue"); |
|
|
|
BTSession.disableDHT(); |
|
|
|
BTSession.disableDHT(); |
|
|
|
} |
|
|
|
} |
|
|
|
#ifndef NO_UPNP |
|
|
|
#ifndef NO_UPNP |
|
|
|
// Upnp
|
|
|
|
// Upnp
|
|
|
|
if(options->isUPnPEnabled()){ |
|
|
|
if(options->isUPnPEnabled()){ |
|
|
|
|
|
|
|
setInfoBar(tr("UPnP support [ON], port: %1").arg(options->getUPnPPort()), "blue"); |
|
|
|
BTSession.enableUPnP(options->getUPnPPort()); |
|
|
|
BTSession.enableUPnP(options->getUPnPPort()); |
|
|
|
BTSession.setUPnPPort(options->getUPnPPort()); |
|
|
|
BTSession.setUPnPPort(options->getUPnPPort()); |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
|
|
|
|
setInfoBar(tr("UPnP support [OFF]"), "blue"); |
|
|
|
BTSession.disableUPnP(); |
|
|
|
BTSession.disableUPnP(); |
|
|
|
} |
|
|
|
} |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
// PeX
|
|
|
|
// PeX
|
|
|
|
if(!options->isPeXDisabled()){ |
|
|
|
if(!options->isPeXDisabled()){ |
|
|
|
qDebug("Enabling Peer eXchange (PeX)"); |
|
|
|
qDebug("Enabling Peer eXchange (PeX)"); |
|
|
|
|
|
|
|
setInfoBar(tr("PeX support [OFF]"), "blue"); |
|
|
|
BTSession.enablePeerExchange(); |
|
|
|
BTSession.enablePeerExchange(); |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
|
|
|
|
setInfoBar(tr("PeX support [OFF]"), "blue"); |
|
|
|
qDebug("Peer eXchange (PeX) disabled"); |
|
|
|
qDebug("Peer eXchange (PeX) disabled"); |
|
|
|
} |
|
|
|
} |
|
|
|
// Apply filtering settings
|
|
|
|
// Apply filtering settings
|
|
|
|