From 79e139268a1d671d2731d9fc689832751127a655 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Wed, 18 Nov 2009 10:39:56 +0000 Subject: [PATCH] - Refresh list and torrent numbers on torrent addition --- src/TransferListFiltersWidget.h | 10 +++++----- src/TransferListWidget.cpp | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/TransferListFiltersWidget.h b/src/TransferListFiltersWidget.h index 0a2801c30..b7ae5490b 100644 --- a/src/TransferListFiltersWidget.h +++ b/src/TransferListFiltersWidget.h @@ -48,19 +48,19 @@ public: TransferListFiltersWidget(QWidget *parent, TransferListWidget *transferList): QListWidget(parent), transferList(transferList) { // Add filters QListWidgetItem *all = new QListWidgetItem(this); - all->setData(Qt::DisplayRole, tr("All")); + all->setData(Qt::DisplayRole, tr("All") + " (0)"); all->setData(Qt::DecorationRole, QIcon(":/Icons/oxygen/folder-remote16.png")); QListWidgetItem *downloading = new QListWidgetItem(this); - downloading->setData(Qt::DisplayRole, tr("Downloading")); + downloading->setData(Qt::DisplayRole, tr("Downloading") + " (0)"); downloading->setData(Qt::DecorationRole, QIcon(":/Icons/skin/downloading.png")); QListWidgetItem *completed = new QListWidgetItem(this); - completed->setData(Qt::DisplayRole, tr("Completed")); + completed->setData(Qt::DisplayRole, tr("Completed") + " (0)"); completed->setData(Qt::DecorationRole, QIcon(":/Icons/skin/seeding.png")); QListWidgetItem *active = new QListWidgetItem(this); - active->setData(Qt::DisplayRole, tr("Active")); + active->setData(Qt::DisplayRole, tr("Active") + " (0)"); active->setData(Qt::DecorationRole, QIcon(":/Icons/oxygen/draw-triangle2.png")); QListWidgetItem *inactive = new QListWidgetItem(this); - inactive->setData(Qt::DisplayRole, tr("Inactive")); + inactive->setData(Qt::DisplayRole, tr("Inactive") + " (0)"); inactive->setData(Qt::DecorationRole, QIcon(":/Icons/oxygen/draw-rectangle.png")); // SIGNAL/SLOT diff --git a/src/TransferListWidget.cpp b/src/TransferListWidget.cpp index 94d837122..cb761039f 100644 --- a/src/TransferListWidget.cpp +++ b/src/TransferListWidget.cpp @@ -161,6 +161,7 @@ void TransferListWidget::addTorrent(QTorrentHandle& h) { // Select first torrent to be added if(listModel->rowCount() == 1) selectionModel()->setCurrentIndex(proxyModel->index(row, NAME), QItemSelectionModel::SelectCurrent|QItemSelectionModel::Rows); + refreshList(); } catch(invalid_handle e) { // Remove added torrent listModel->removeRow(row);