|
|
|
@ -147,7 +147,7 @@ protected:
@@ -147,7 +147,7 @@ protected:
|
|
|
|
|
class StatusFiltersWidget : public QListWidget { |
|
|
|
|
public: |
|
|
|
|
StatusFiltersWidget(QWidget *parent) : QListWidget(parent) { |
|
|
|
|
setFixedHeight(100); |
|
|
|
|
setFixedHeight(120); |
|
|
|
|
} |
|
|
|
|
protected: |
|
|
|
|
void changeEvent(QEvent *e) { |
|
|
|
@ -155,7 +155,7 @@ void changeEvent(QEvent *e) {
@@ -155,7 +155,7 @@ void changeEvent(QEvent *e) {
|
|
|
|
|
switch (e->type()) { |
|
|
|
|
case QEvent::StyleChange: |
|
|
|
|
setSpacing(0); |
|
|
|
|
setFixedHeight(100); |
|
|
|
|
setFixedHeight(120); |
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|
break; |
|
|
|
@ -200,6 +200,9 @@ public:
@@ -200,6 +200,9 @@ public:
|
|
|
|
|
QListWidgetItem *completed = new QListWidgetItem(statusFilters); |
|
|
|
|
completed->setData(Qt::DisplayRole, QVariant(tr("Completed") + " (0)")); |
|
|
|
|
completed->setData(Qt::DecorationRole, QIcon(":/Icons/skin/uploading.png")); |
|
|
|
|
QListWidgetItem *paused = new QListWidgetItem(statusFilters); |
|
|
|
|
paused->setData(Qt::DisplayRole, QVariant(tr("Paused") + " (0)")); |
|
|
|
|
paused->setData(Qt::DecorationRole, QIcon(":/Icons/skin/paused.png")); |
|
|
|
|
QListWidgetItem *active = new QListWidgetItem(statusFilters); |
|
|
|
|
active->setData(Qt::DisplayRole, QVariant(tr("Active") + " (0)")); |
|
|
|
|
active->setData(Qt::DecorationRole, QIcon(":/Icons/skin/filteractive.png")); |
|
|
|
@ -209,7 +212,7 @@ public:
@@ -209,7 +212,7 @@ public:
|
|
|
|
|
|
|
|
|
|
// SIGNAL/SLOT
|
|
|
|
|
connect(statusFilters, SIGNAL(currentRowChanged(int)), transferList, SLOT(applyStatusFilter(int))); |
|
|
|
|
connect(transferList, SIGNAL(torrentStatusUpdate(uint,uint,uint,uint)), this, SLOT(updateTorrentNumbers(uint, uint, uint, uint))); |
|
|
|
|
connect(transferList, SIGNAL(torrentStatusUpdate(uint,uint,uint,uint,uint)), this, SLOT(updateTorrentNumbers(uint, uint, uint, uint, uint))); |
|
|
|
|
connect(labelFilters, SIGNAL(currentRowChanged(int)), this, SLOT(applyLabelFilter(int))); |
|
|
|
|
connect(labelFilters, SIGNAL(torrentDropped(int)), this, SLOT(torrentDropped(int))); |
|
|
|
|
connect(transferList, SIGNAL(torrentAdded(QModelIndex)), this, SLOT(torrentAdded(QModelIndex))); |
|
|
|
@ -276,10 +279,11 @@ public:
@@ -276,10 +279,11 @@ public:
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected slots: |
|
|
|
|
void updateTorrentNumbers(uint nb_downloading, uint nb_seeding, uint nb_active, uint nb_inactive) { |
|
|
|
|
void updateTorrentNumbers(uint nb_downloading, uint nb_seeding, uint nb_active, uint nb_inactive, uint nb_paused) { |
|
|
|
|
statusFilters->item(FILTER_ALL)->setData(Qt::DisplayRole, QVariant(tr("All")+" ("+QString::number(nb_active+nb_inactive)+")")); |
|
|
|
|
statusFilters->item(FILTER_DOWNLOADING)->setData(Qt::DisplayRole, QVariant(tr("Downloading")+" ("+QString::number(nb_downloading)+")")); |
|
|
|
|
statusFilters->item(FILTER_COMPLETED)->setData(Qt::DisplayRole, QVariant(tr("Completed")+" ("+QString::number(nb_seeding)+")")); |
|
|
|
|
statusFilters->item(FILTER_PAUSED)->setData(Qt::DisplayRole, QVariant(tr("Paused")+" ("+QString::number(nb_paused)+")")); |
|
|
|
|
statusFilters->item(FILTER_ACTIVE)->setData(Qt::DisplayRole, QVariant(tr("Active")+" ("+QString::number(nb_active)+")")); |
|
|
|
|
statusFilters->item(FILTER_INACTIVE)->setData(Qt::DisplayRole, QVariant(tr("Inactive")+" ("+QString::number(nb_inactive)+")")); |
|
|
|
|
} |
|
|
|
|