mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-13 00:33:09 -07:00
- Queueing systems now updates the number of active torrents in tab titles
This commit is contained in:
parent
4b8532ea2d
commit
15ce9a7369
4 changed files with 30 additions and 0 deletions
14
src/GUI.cpp
14
src/GUI.cpp
|
@ -133,6 +133,8 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
|
|||
connect(BTSession, SIGNAL(deletedTorrent(QString)), this, SLOT(deleteTorrent(QString)));
|
||||
connect(BTSession, SIGNAL(torrent_ratio_deleted(QString)), this, SLOT(deleteRatioTorrent(QString)));
|
||||
connect(BTSession, SIGNAL(pausedTorrent(QString)), this, SLOT(pauseTorrent(QString)));
|
||||
connect(BTSession, SIGNAL(updateUnfinishedTorrentNumber()), this, SLOT(updateUnfinishedTorrentNumberCalc()));
|
||||
connect(BTSession, SIGNAL(updateFinishedTorrentNumber()), this, SLOT(updateFinishedTorrentNumberCalc()));
|
||||
qDebug("create tabWidget");
|
||||
tabs = new QTabWidget();
|
||||
// Download torrents tab
|
||||
|
@ -1142,11 +1144,23 @@ void GUI::updateUnfinishedTorrentNumber(unsigned int nb) {
|
|||
tabs->setTabText(0, tr("Downloads") +QString::fromUtf8(" (")+misc::toQString(nb-paused)+"/"+misc::toQString(nb)+QString::fromUtf8(")"));
|
||||
}
|
||||
|
||||
void GUI::updateUnfinishedTorrentNumberCalc() {
|
||||
unsigned int paused = BTSession->getUnfinishedPausedTorrentsNb();
|
||||
unsigned int nb = BTSession->getUnfinishedTorrents().size();
|
||||
tabs->setTabText(0, tr("Downloads") +QString::fromUtf8(" (")+misc::toQString(nb-paused)+"/"+misc::toQString(nb)+QString::fromUtf8(")"));
|
||||
}
|
||||
|
||||
void GUI::updateFinishedTorrentNumber(unsigned int nb) {
|
||||
unsigned int paused = BTSession->getFinishedPausedTorrentsNb();
|
||||
tabs->setTabText(1, tr("Finished") +QString::fromUtf8(" (")+misc::toQString(nb-paused)+"/"+misc::toQString(nb)+QString::fromUtf8(")"));
|
||||
}
|
||||
|
||||
void GUI::updateFinishedTorrentNumberCalc() {
|
||||
unsigned int paused = BTSession->getFinishedPausedTorrentsNb();
|
||||
unsigned int nb = BTSession->getFinishedTorrents().size();
|
||||
tabs->setTabText(1, tr("Finished") +QString::fromUtf8(" (")+misc::toQString(nb-paused)+"/"+misc::toQString(nb)+QString::fromUtf8(")"));
|
||||
}
|
||||
|
||||
// Allow to change action on double-click
|
||||
void GUI::torrentDoubleClicked(QString hash, bool finished) {
|
||||
int action;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue