Browse Source

- Use folder icon for labels

adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
868d423c82
  1. 8
      src/transferlistfilterswidget.h

8
src/transferlistfilterswidget.h

@ -99,11 +99,14 @@ public:
// Add Label filters // Add Label filters
QListWidgetItem *allLabels = new QListWidgetItem(labelFilters); QListWidgetItem *allLabels = new QListWidgetItem(labelFilters);
allLabels->setData(Qt::DisplayRole, tr("All labels") + " (0)"); allLabels->setData(Qt::DisplayRole, tr("All labels") + " (0)");
allLabels->setData(Qt::DecorationRole, QIcon(":/Icons/oxygen/folder.png"));
QListWidgetItem *noLabel = new QListWidgetItem(labelFilters); QListWidgetItem *noLabel = new QListWidgetItem(labelFilters);
noLabel->setData(Qt::DisplayRole, tr("No label") + " (0)"); noLabel->setData(Qt::DisplayRole, tr("Unlabeled") + " (0)");
noLabel->setData(Qt::DecorationRole, QIcon(":/Icons/oxygen/folder.png"));
foreach(const QString& label, customLabels) { foreach(const QString& label, customLabels) {
QListWidgetItem *newLabel = new QListWidgetItem(labelFilters); QListWidgetItem *newLabel = new QListWidgetItem(labelFilters);
newLabel->setText(label + " (0)"); newLabel->setText(label + " (0)");
newLabel->setData(Qt::DecorationRole, QIcon(":/Icons/oxygen/folder.png"));
} }
labelFilters->selectionModel()->select(labelFilters->model()->index(0,0), QItemSelectionModel::Select); labelFilters->selectionModel()->select(labelFilters->model()->index(0,0), QItemSelectionModel::Select);
// Label menu // Label menu
@ -155,6 +158,7 @@ protected slots:
if(customLabels.contains(label)) return; if(customLabels.contains(label)) return;
QListWidgetItem *newLabel = new QListWidgetItem(labelFilters); QListWidgetItem *newLabel = new QListWidgetItem(labelFilters);
newLabel->setText(label + " (0)"); newLabel->setText(label + " (0)");
newLabel->setData(Qt::DecorationRole, QIcon(":/Icons/oxygen/folder.png"));
customLabels << label; customLabels << label;
labelCounters << 0; labelCounters << 0;
saveCustomLabels(); saveCustomLabels();
@ -269,7 +273,7 @@ protected slots:
void updateStickyLabelCounters() { void updateStickyLabelCounters() {
labelFilters->item(0)->setText(tr("All labels") + " ("+QString::number(nb_torrents)+")"); labelFilters->item(0)->setText(tr("All labels") + " ("+QString::number(nb_torrents)+")");
labelFilters->item(1)->setText(tr("No label") + " ("+QString::number(nb_torrents-nb_labeled)+")"); labelFilters->item(1)->setText(tr("Unlabeled") + " ("+QString::number(nb_torrents-nb_labeled)+")");
} }
}; };

Loading…
Cancel
Save