|
|
@ -151,31 +151,31 @@ StatusFilterWidget::StatusFilterWidget(QWidget *parent, TransferListWidget *tran |
|
|
|
|
|
|
|
|
|
|
|
// Add status filters
|
|
|
|
// Add status filters
|
|
|
|
auto *all = new QListWidgetItem(this); |
|
|
|
auto *all = new QListWidgetItem(this); |
|
|
|
all->setData(Qt::DisplayRole, QVariant(tr("All (0)", "this is for the status filter"))); |
|
|
|
all->setData(Qt::DisplayRole, tr("All (0)", "this is for the status filter")); |
|
|
|
all->setData(Qt::DecorationRole, QIcon(":/icons/skin/filterall.svg")); |
|
|
|
all->setData(Qt::DecorationRole, QIcon(":/icons/skin/filterall.svg")); |
|
|
|
auto *downloading = new QListWidgetItem(this); |
|
|
|
auto *downloading = new QListWidgetItem(this); |
|
|
|
downloading->setData(Qt::DisplayRole, QVariant(tr("Downloading (0)"))); |
|
|
|
downloading->setData(Qt::DisplayRole, tr("Downloading (0)")); |
|
|
|
downloading->setData(Qt::DecorationRole, QIcon(":/icons/skin/downloading.svg")); |
|
|
|
downloading->setData(Qt::DecorationRole, QIcon(":/icons/skin/downloading.svg")); |
|
|
|
auto *seeding = new QListWidgetItem(this); |
|
|
|
auto *seeding = new QListWidgetItem(this); |
|
|
|
seeding->setData(Qt::DisplayRole, QVariant(tr("Seeding (0)"))); |
|
|
|
seeding->setData(Qt::DisplayRole, tr("Seeding (0)")); |
|
|
|
seeding->setData(Qt::DecorationRole, QIcon(":/icons/skin/uploading.svg")); |
|
|
|
seeding->setData(Qt::DecorationRole, QIcon(":/icons/skin/uploading.svg")); |
|
|
|
auto *completed = new QListWidgetItem(this); |
|
|
|
auto *completed = new QListWidgetItem(this); |
|
|
|
completed->setData(Qt::DisplayRole, QVariant(tr("Completed (0)"))); |
|
|
|
completed->setData(Qt::DisplayRole, tr("Completed (0)")); |
|
|
|
completed->setData(Qt::DecorationRole, QIcon(":/icons/skin/completed.svg")); |
|
|
|
completed->setData(Qt::DecorationRole, QIcon(":/icons/skin/completed.svg")); |
|
|
|
auto *resumed = new QListWidgetItem(this); |
|
|
|
auto *resumed = new QListWidgetItem(this); |
|
|
|
resumed->setData(Qt::DisplayRole, QVariant(tr("Resumed (0)"))); |
|
|
|
resumed->setData(Qt::DisplayRole, tr("Resumed (0)")); |
|
|
|
resumed->setData(Qt::DecorationRole, QIcon(":/icons/skin/resumed.svg")); |
|
|
|
resumed->setData(Qt::DecorationRole, QIcon(":/icons/skin/resumed.svg")); |
|
|
|
auto *paused = new QListWidgetItem(this); |
|
|
|
auto *paused = new QListWidgetItem(this); |
|
|
|
paused->setData(Qt::DisplayRole, QVariant(tr("Paused (0)"))); |
|
|
|
paused->setData(Qt::DisplayRole, tr("Paused (0)")); |
|
|
|
paused->setData(Qt::DecorationRole, QIcon(":/icons/skin/paused.svg")); |
|
|
|
paused->setData(Qt::DecorationRole, QIcon(":/icons/skin/paused.svg")); |
|
|
|
auto *active = new QListWidgetItem(this); |
|
|
|
auto *active = new QListWidgetItem(this); |
|
|
|
active->setData(Qt::DisplayRole, QVariant(tr("Active (0)"))); |
|
|
|
active->setData(Qt::DisplayRole, tr("Active (0)")); |
|
|
|
active->setData(Qt::DecorationRole, QIcon(":/icons/skin/filteractive.svg")); |
|
|
|
active->setData(Qt::DecorationRole, QIcon(":/icons/skin/filteractive.svg")); |
|
|
|
auto *inactive = new QListWidgetItem(this); |
|
|
|
auto *inactive = new QListWidgetItem(this); |
|
|
|
inactive->setData(Qt::DisplayRole, QVariant(tr("Inactive (0)"))); |
|
|
|
inactive->setData(Qt::DisplayRole, tr("Inactive (0)")); |
|
|
|
inactive->setData(Qt::DecorationRole, QIcon(":/icons/skin/filterinactive.svg")); |
|
|
|
inactive->setData(Qt::DecorationRole, QIcon(":/icons/skin/filterinactive.svg")); |
|
|
|
auto *errored = new QListWidgetItem(this); |
|
|
|
auto *errored = new QListWidgetItem(this); |
|
|
|
errored->setData(Qt::DisplayRole, QVariant(tr("Errored (0)"))); |
|
|
|
errored->setData(Qt::DisplayRole, tr("Errored (0)")); |
|
|
|
errored->setData(Qt::DecorationRole, QIcon(":/icons/skin/error.svg")); |
|
|
|
errored->setData(Qt::DecorationRole, QIcon(":/icons/skin/error.svg")); |
|
|
|
|
|
|
|
|
|
|
|
const Preferences *const pref = Preferences::instance(); |
|
|
|
const Preferences *const pref = Preferences::instance(); |
|
|
@ -190,17 +190,17 @@ StatusFilterWidget::~StatusFilterWidget() |
|
|
|
|
|
|
|
|
|
|
|
void StatusFilterWidget::updateTorrentNumbers() |
|
|
|
void StatusFilterWidget::updateTorrentNumbers() |
|
|
|
{ |
|
|
|
{ |
|
|
|
auto report = BitTorrent::Session::instance()->torrentStatusReport(); |
|
|
|
const BitTorrent::TorrentStatusReport report = BitTorrent::Session::instance()->torrentStatusReport(); |
|
|
|
|
|
|
|
|
|
|
|
item(TorrentFilter::All)->setData(Qt::DisplayRole, QVariant(tr("All (%1)").arg(report.nbActive + report.nbInactive))); |
|
|
|
item(TorrentFilter::All)->setData(Qt::DisplayRole, tr("All (%1)").arg(report.nbActive + report.nbInactive)); |
|
|
|
item(TorrentFilter::Downloading)->setData(Qt::DisplayRole, QVariant(tr("Downloading (%1)").arg(report.nbDownloading))); |
|
|
|
item(TorrentFilter::Downloading)->setData(Qt::DisplayRole, tr("Downloading (%1)").arg(report.nbDownloading)); |
|
|
|
item(TorrentFilter::Seeding)->setData(Qt::DisplayRole, QVariant(tr("Seeding (%1)").arg(report.nbSeeding))); |
|
|
|
item(TorrentFilter::Seeding)->setData(Qt::DisplayRole, tr("Seeding (%1)").arg(report.nbSeeding)); |
|
|
|
item(TorrentFilter::Completed)->setData(Qt::DisplayRole, QVariant(tr("Completed (%1)").arg(report.nbCompleted))); |
|
|
|
item(TorrentFilter::Completed)->setData(Qt::DisplayRole, tr("Completed (%1)").arg(report.nbCompleted)); |
|
|
|
item(TorrentFilter::Paused)->setData(Qt::DisplayRole, QVariant(tr("Paused (%1)").arg(report.nbPaused))); |
|
|
|
item(TorrentFilter::Paused)->setData(Qt::DisplayRole, tr("Paused (%1)").arg(report.nbPaused)); |
|
|
|
item(TorrentFilter::Resumed)->setData(Qt::DisplayRole, QVariant(tr("Resumed (%1)").arg(report.nbResumed))); |
|
|
|
item(TorrentFilter::Resumed)->setData(Qt::DisplayRole, tr("Resumed (%1)").arg(report.nbResumed)); |
|
|
|
item(TorrentFilter::Active)->setData(Qt::DisplayRole, QVariant(tr("Active (%1)").arg(report.nbActive))); |
|
|
|
item(TorrentFilter::Active)->setData(Qt::DisplayRole, tr("Active (%1)").arg(report.nbActive)); |
|
|
|
item(TorrentFilter::Inactive)->setData(Qt::DisplayRole, QVariant(tr("Inactive (%1)").arg(report.nbInactive))); |
|
|
|
item(TorrentFilter::Inactive)->setData(Qt::DisplayRole, tr("Inactive (%1)").arg(report.nbInactive)); |
|
|
|
item(TorrentFilter::Errored)->setData(Qt::DisplayRole, QVariant(tr("Errored (%1)").arg(report.nbErrored))); |
|
|
|
item(TorrentFilter::Errored)->setData(Qt::DisplayRole, tr("Errored (%1)").arg(report.nbErrored)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void StatusFilterWidget::showMenu(const QPoint &) {} |
|
|
|
void StatusFilterWidget::showMenu(const QPoint &) {} |
|
|
@ -220,16 +220,16 @@ TrackerFiltersList::TrackerFiltersList(QWidget *parent, TransferListWidget *tran |
|
|
|
, m_downloadTrackerFavicon(downloadFavicon) |
|
|
|
, m_downloadTrackerFavicon(downloadFavicon) |
|
|
|
{ |
|
|
|
{ |
|
|
|
auto *allTrackers = new QListWidgetItem(this); |
|
|
|
auto *allTrackers = new QListWidgetItem(this); |
|
|
|
allTrackers->setData(Qt::DisplayRole, QVariant(tr("All (0)", "this is for the tracker filter"))); |
|
|
|
allTrackers->setData(Qt::DisplayRole, tr("All (0)", "this is for the tracker filter")); |
|
|
|
allTrackers->setData(Qt::DecorationRole, UIThemeManager::instance()->getIcon("network-server")); |
|
|
|
allTrackers->setData(Qt::DecorationRole, UIThemeManager::instance()->getIcon("network-server")); |
|
|
|
auto *noTracker = new QListWidgetItem(this); |
|
|
|
auto *noTracker = new QListWidgetItem(this); |
|
|
|
noTracker->setData(Qt::DisplayRole, QVariant(tr("Trackerless (0)"))); |
|
|
|
noTracker->setData(Qt::DisplayRole, tr("Trackerless (0)")); |
|
|
|
noTracker->setData(Qt::DecorationRole, UIThemeManager::instance()->getIcon("network-server")); |
|
|
|
noTracker->setData(Qt::DecorationRole, UIThemeManager::instance()->getIcon("network-server")); |
|
|
|
auto *errorTracker = new QListWidgetItem(this); |
|
|
|
auto *errorTracker = new QListWidgetItem(this); |
|
|
|
errorTracker->setData(Qt::DisplayRole, QVariant(tr("Error (0)"))); |
|
|
|
errorTracker->setData(Qt::DisplayRole, tr("Error (0)")); |
|
|
|
errorTracker->setData(Qt::DecorationRole, style()->standardIcon(QStyle::SP_MessageBoxCritical)); |
|
|
|
errorTracker->setData(Qt::DecorationRole, style()->standardIcon(QStyle::SP_MessageBoxCritical)); |
|
|
|
auto *warningTracker = new QListWidgetItem(this); |
|
|
|
auto *warningTracker = new QListWidgetItem(this); |
|
|
|
warningTracker->setData(Qt::DisplayRole, QVariant(tr("Warning (0)"))); |
|
|
|
warningTracker->setData(Qt::DisplayRole, tr("Warning (0)")); |
|
|
|
warningTracker->setData(Qt::DecorationRole, style()->standardIcon(QStyle::SP_MessageBoxWarning)); |
|
|
|
warningTracker->setData(Qt::DecorationRole, style()->standardIcon(QStyle::SP_MessageBoxWarning)); |
|
|
|
m_trackers.insert("", QStringList()); |
|
|
|
m_trackers.insert("", QStringList()); |
|
|
|
|
|
|
|
|
|
|
@ -460,7 +460,7 @@ void TrackerFiltersList::handleFavicoDownloadFinished(const Net::DownloadResult |
|
|
|
Utils::Fs::forceRemove(result.filePath); |
|
|
|
Utils::Fs::forceRemove(result.filePath); |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
else { |
|
|
|
trackerItem->setData(Qt::DecorationRole, QVariant(QIcon(result.filePath))); |
|
|
|
trackerItem->setData(Qt::DecorationRole, QIcon(result.filePath)); |
|
|
|
m_iconPaths.append(result.filePath); |
|
|
|
m_iconPaths.append(result.filePath); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|