Revision 1791 trunk/client/gui_qt/WidgetDownloadQueue.cpp
| WidgetDownloadQueue.cpp (revision 1791) | ||
|---|---|---|
| 2 | 2 |
#include |
| 3 | 3 |
#include |
| 4 | 4 |
#include |
| 5 |
#include |
|
| 5 | 6 |
|
| 6 | 7 |
#include "WidgetDownloadQueue.h" |
| 7 | 8 |
#include "ui_WidgetDownloadQueue.h" |
| ... | ... | |
| 50 | 51 |
ui->treeView->setContextMenuPolicy(Qt::CustomContextMenu); |
| 51 | 52 |
connect(ui->treeView, SIGNAL(customContextMenuRequested(const QPoint &)), SLOT(showContextMenu(const QPoint &))); |
| 52 | 53 |
|
| 54 |
/* Catch the DEL key */ |
|
| 55 |
ui->treeView->installEventFilter(this); |
|
| 56 |
|
|
| 53 | 57 |
/* Add custom fields to the list */ |
| 54 | 58 |
ui->treeView->setColumnHidden(DownloadQueueItem::FIELD_PROGRESS, true); |
| 55 | 59 |
ui->treeView->setColumnHidden(DownloadQueueItem::FIELD_FILE_SIZE, true); |
| ... | ... | |
| 91 | 95 |
} |
| 92 | 96 |
} |
| 93 | 97 |
|
| 98 |
bool WidgetDownloadQueue::eventFilter(QObject *watched, QEvent *e) |
|
| 99 |
{
|
|
| 100 |
if (watched == ui->treeView) {
|
|
| 101 |
if (e->type() == QEvent::KeyPress) {
|
|
| 102 |
QKeyEvent *keyEvent = static_cast |
|
| 103 |
if (keyEvent->key() == Qt::Key_Delete) {
|
|
| 104 |
actionRemoveSelectedFiles_activated(); |
|
| 105 |
return true; |
|
| 106 |
} |
|
| 107 |
} |
|
| 108 |
} |
|
| 109 |
|
|
| 110 |
return QWidget::eventFilter(watched, e); |
|
| 111 |
} |
|
| 112 |
|
|
| 94 | 113 |
void WidgetDownloadQueue::doMoveItem(QString collection_name, QString subject, int new_position) |
| 95 | 114 |
{
|
| 96 | 115 |
if (subject.isNull()) {
|
Also available in: Unified diff
NNTPGrab

