Browse Source

Now user-created labels "all" and "none" works as regular labels

adaptive-webui-19844
Ivan Sorokin 10 years ago
parent
commit
976982ba09
  1. 4
      src/transferlistfilterswidget.cpp
  2. 12
      src/transferlistwidget.cpp
  3. 1
      src/transferlistwidget.h

4
src/transferlistfilterswidget.cpp

@ -359,10 +359,10 @@ void TransferListFiltersWidget::removeSelectedLabel() { @@ -359,10 +359,10 @@ void TransferListFiltersWidget::removeSelectedLabel() {
void TransferListFiltersWidget::applyLabelFilter(int row) {
switch(row) {
case 0:
transferList->applyLabelFilter("all");
transferList->applyLabelFilterAll();
break;
case 1:
transferList->applyLabelFilter("none");
transferList->applyLabelFilter(QString());
break;
default:
transferList->applyLabelFilter(labelFilters->labelFromRow(row));

12
src/transferlistwidget.cpp

@ -885,15 +885,11 @@ void TransferListWidget::currentChanged(const QModelIndex& current, const QModel @@ -885,15 +885,11 @@ void TransferListWidget::currentChanged(const QModelIndex& current, const QModel
emit currentTorrentChanged(h);
}
void TransferListWidget::applyLabelFilterAll() {
nameFilterModel->disableLabelFilter();
}
void TransferListWidget::applyLabelFilter(QString label) {
if (label == "all") {
nameFilterModel->disableLabelFilter();
return;
}
if (label == "none") {
nameFilterModel->setLabelFilter(QString());
return;
}
qDebug("Applying Label filter: %s", qPrintable(label));
nameFilterModel->setLabelFilter(label);
}

1
src/transferlistwidget.h

@ -80,6 +80,7 @@ public slots: @@ -80,6 +80,7 @@ public slots:
void displayDLHoSMenu(const QPoint&);
void applyNameFilter(const QString& name);
void applyStatusFilter(int f);
void applyLabelFilterAll();
void applyLabelFilter(QString label);
void previewFile(QString filePath);
void removeLabelFromRows(QString label);

Loading…
Cancel
Save