mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-12 08:16:16 -07:00
Brand new torrent model for the transfer list
This commit is contained in:
parent
01cc4452b2
commit
d76877b1a2
12 changed files with 609 additions and 602 deletions
|
@ -69,6 +69,7 @@
|
|||
#include "qinisettings.h"
|
||||
#include "torrentimportdlg.h"
|
||||
#include "rsssettings.h"
|
||||
#include "torrentmodel.h"
|
||||
#ifdef Q_WS_MAC
|
||||
#include "qmacapplication.h"
|
||||
void qt_mac_set_dock_menu(QMenu *menu);
|
||||
|
@ -162,7 +163,9 @@ MainWindow::MainWindow(QWidget *parent, QStringList torrentCmdLine) : QMainWindo
|
|||
vSplitter->setCollapsible(0, true);
|
||||
vSplitter->setCollapsible(1, false);
|
||||
tabs->addTab(vSplitter, QIcon(QString::fromUtf8(":/Icons/oxygen/folder-remote.png")), tr("Transfers"));
|
||||
connect(transferList, SIGNAL(torrentStatusUpdate(uint,uint,uint,uint,uint)), this, SLOT(updateNbTorrents(uint,uint,uint,uint,uint)));
|
||||
connect(transferList->getSourceModel(), SIGNAL(rowsInserted(QModelIndex, int, int)), this, SLOT(updateNbTorrents()));
|
||||
connect(transferList->getSourceModel(), SIGNAL(rowsRemoved(QModelIndex, int, int)), this, SLOT(updateNbTorrents()));
|
||||
|
||||
vboxLayout->addWidget(tabs);
|
||||
|
||||
// Name filter
|
||||
|
@ -236,6 +239,9 @@ MainWindow::MainWindow(QWidget *parent, QStringList torrentCmdLine) : QMainWindo
|
|||
// Add torrent given on command line
|
||||
processParams(torrentCmdLine);
|
||||
|
||||
// Populate the transfer list
|
||||
transferList->getSourceModel()->populate();
|
||||
|
||||
qDebug("GUI Built");
|
||||
#ifdef Q_WS_WIN
|
||||
if(!Preferences::neverCheckFileAssoc() && !Preferences::isFileAssocOk()) {
|
||||
|
@ -395,11 +401,8 @@ void MainWindow::displaySearchTab(bool enable) {
|
|||
}
|
||||
}
|
||||
|
||||
void MainWindow::updateNbTorrents(unsigned int nb_downloading, unsigned int nb_seeding, unsigned int nb_active, unsigned int nb_inactive, unsigned int nb_paused) {
|
||||
Q_UNUSED(nb_downloading);
|
||||
Q_UNUSED(nb_seeding);
|
||||
Q_UNUSED(nb_paused);
|
||||
tabs->setTabText(0, tr("Transfers (%1)").arg(QString::number(nb_inactive+nb_active)));
|
||||
void MainWindow::updateNbTorrents() {
|
||||
tabs->setTabText(0, tr("Transfers (%1)").arg(transferList->getSourceModel()->rowCount()));
|
||||
}
|
||||
|
||||
void MainWindow::on_actionWebsite_triggered() const {
|
||||
|
@ -420,7 +423,6 @@ void MainWindow::tab_changed(int new_tab) {
|
|||
// because the tab order is undetermined now
|
||||
if(tabs->currentWidget() == vSplitter) {
|
||||
qDebug("Changed tab to transfer list, refreshing the list");
|
||||
transferList->refreshList();
|
||||
properties->loadDynamicData();
|
||||
return;
|
||||
}
|
||||
|
@ -665,8 +667,6 @@ void MainWindow::on_actionAbout_triggered() {
|
|||
void MainWindow::showEvent(QShowEvent *e) {
|
||||
qDebug("** Show Event **");
|
||||
if(getCurrentTabWidget() == transferList) {
|
||||
qDebug("-> Refreshing transfer list");
|
||||
transferList->refreshList();
|
||||
properties->loadDynamicData();
|
||||
}
|
||||
e->accept();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue