mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
Add right click menu to SearchJobWidget
This commit is contained in:
parent
cf89c2f5bf
commit
32a861fd1b
2 changed files with 23 additions and 0 deletions
|
@ -370,6 +370,28 @@ void SearchJobWidget::showFilterContextMenu(const QPoint &)
|
||||||
menu->popup(QCursor::pos());
|
menu->popup(QCursor::pos());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SearchJobWidget::contextMenuEvent(QContextMenuEvent *event)
|
||||||
|
{
|
||||||
|
auto *menu = new QMenu(this);
|
||||||
|
menu->setAttribute(Qt::WA_DeleteOnClose);
|
||||||
|
|
||||||
|
const QAction *downloadAction = menu->addAction(
|
||||||
|
GuiIconProvider::instance()->getIcon("download"), tr("Download"));
|
||||||
|
connect(downloadAction, &QAction::triggered, this, &SearchJobWidget::downloadTorrents);
|
||||||
|
|
||||||
|
menu->addSeparator();
|
||||||
|
|
||||||
|
const QAction *openDescriptionAction = menu->addAction(
|
||||||
|
GuiIconProvider::instance()->getIcon("application-x-mswinurl"), tr("Go to description page"));
|
||||||
|
connect(openDescriptionAction, &QAction::triggered, this, &SearchJobWidget::openTorrentPages);
|
||||||
|
|
||||||
|
const QAction *copyDescriptionAction = menu->addAction(
|
||||||
|
GuiIconProvider::instance()->getIcon("edit-copy"), tr("Copy description page URL"));
|
||||||
|
connect(copyDescriptionAction, &QAction::triggered, this, &SearchJobWidget::copyTorrentURLs);
|
||||||
|
|
||||||
|
menu->popup(event->globalPos());
|
||||||
|
}
|
||||||
|
|
||||||
QString SearchJobWidget::statusText(SearchJobWidget::Status st)
|
QString SearchJobWidget::statusText(SearchJobWidget::Status st)
|
||||||
{
|
{
|
||||||
switch (st) {
|
switch (st) {
|
||||||
|
|
|
@ -99,6 +99,7 @@ private:
|
||||||
void updateFilter();
|
void updateFilter();
|
||||||
void filterSearchResults(const QString &name);
|
void filterSearchResults(const QString &name);
|
||||||
void showFilterContextMenu(const QPoint &);
|
void showFilterContextMenu(const QPoint &);
|
||||||
|
void contextMenuEvent(QContextMenuEvent *event) override;
|
||||||
void displayToggleColumnsMenu(const QPoint &);
|
void displayToggleColumnsMenu(const QPoint &);
|
||||||
void onItemDoubleClicked(const QModelIndex &index);
|
void onItemDoubleClicked(const QModelIndex &index);
|
||||||
void searchFinished(bool cancelled);
|
void searchFinished(bool cancelled);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue