|
|
@ -600,8 +600,6 @@ void PropertiesWidget::displayFilesListMenu(const QPoint &) |
|
|
|
|
|
|
|
|
|
|
|
if (!m_torrent->isSeed()) |
|
|
|
if (!m_torrent->isSeed()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
QMenu *subMenu = menu->addMenu(tr("Priority")); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const auto applyPriorities = [this, selectedRows](const BitTorrent::DownloadPriority prio) |
|
|
|
const auto applyPriorities = [this, selectedRows](const BitTorrent::DownloadPriority prio) |
|
|
|
{ |
|
|
|
{ |
|
|
|
for (const QModelIndex &index : selectedRows) |
|
|
|
for (const QModelIndex &index : selectedRows) |
|
|
@ -614,29 +612,24 @@ void PropertiesWidget::displayFilesListMenu(const QPoint &) |
|
|
|
filteredFilesChanged(); |
|
|
|
filteredFilesChanged(); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
connect(m_ui->actionNotDownloaded, &QAction::triggered, subMenu, [applyPriorities]() |
|
|
|
QMenu *subMenu = menu->addMenu(tr("Priority")); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
subMenu->addAction(tr("Do not download"), subMenu, [applyPriorities]() |
|
|
|
{ |
|
|
|
{ |
|
|
|
applyPriorities(BitTorrent::DownloadPriority::Ignored); |
|
|
|
applyPriorities(BitTorrent::DownloadPriority::Ignored); |
|
|
|
}); |
|
|
|
}); |
|
|
|
subMenu->addAction(m_ui->actionNotDownloaded); |
|
|
|
subMenu->addAction(tr("Normal"), subMenu, [applyPriorities]() |
|
|
|
|
|
|
|
|
|
|
|
connect(m_ui->actionNormal, &QAction::triggered, subMenu, [applyPriorities]() |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
applyPriorities(BitTorrent::DownloadPriority::Normal); |
|
|
|
applyPriorities(BitTorrent::DownloadPriority::Normal); |
|
|
|
}); |
|
|
|
}); |
|
|
|
subMenu->addAction(m_ui->actionNormal); |
|
|
|
subMenu->addAction(tr("High"), subMenu, [applyPriorities]() |
|
|
|
|
|
|
|
|
|
|
|
connect(m_ui->actionHigh, &QAction::triggered, subMenu, [applyPriorities]() |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
applyPriorities(BitTorrent::DownloadPriority::High); |
|
|
|
applyPriorities(BitTorrent::DownloadPriority::High); |
|
|
|
}); |
|
|
|
}); |
|
|
|
subMenu->addAction(m_ui->actionHigh); |
|
|
|
subMenu->addAction(tr("Maximum"), subMenu, [applyPriorities]() |
|
|
|
|
|
|
|
|
|
|
|
connect(m_ui->actionMaximum, &QAction::triggered, subMenu, [applyPriorities]() |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
applyPriorities(BitTorrent::DownloadPriority::Maximum); |
|
|
|
applyPriorities(BitTorrent::DownloadPriority::Maximum); |
|
|
|
}); |
|
|
|
}); |
|
|
|
subMenu->addAction(m_ui->actionMaximum); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// The selected torrent might have disappeared during exec()
|
|
|
|
// The selected torrent might have disappeared during exec()
|
|
|
|