Browse Source

- Drag'n drop to labels cleanup

adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
5d60295db3
  1. 20
      src/GUI.cpp
  2. 1
      src/GUI.h

20
src/GUI.cpp

@ -598,30 +598,10 @@ void GUI::dragEnterEvent(QDragEnterEvent *event) { @@ -598,30 +598,10 @@ void GUI::dragEnterEvent(QDragEnterEvent *event) {
foreach(const QString &mime, event->mimeData()->formats()){
qDebug("mimeData: %s", mime.toLocal8Bit().data());
}
if (event->mimeData()->hasFormat("application/x-qstandarditemmodeldatalist")) {
if(childAt(event->pos()) == transferListFilters) {
qDebug("DragEnterEvent: torrent to filter list, accepting...");
event->acceptProposedAction();
}
} else {
if (event->mimeData()->hasFormat(QString::fromUtf8("text/plain")) || event->mimeData()->hasFormat(QString::fromUtf8("text/uri-list"))) {
event->acceptProposedAction();
}
}
}
void GUI::dragMoveEvent(QDragMoveEvent *event) {
if (event->mimeData()->hasFormat("application/x-qstandarditemmodeldatalist")) {
if(childAt(event->pos()) == transferListFilters) {
qDebug("DragMoveEvent: torrent to filter list, accepting...");
event->acceptProposedAction();
}
} else {
if (event->mimeData()->hasFormat(QString::fromUtf8("text/plain")) || event->mimeData()->hasFormat(QString::fromUtf8("text/uri-list"))) {
event->acceptProposedAction();
}
}
}
/*****************************************************
* *

1
src/GUI.h

@ -97,7 +97,6 @@ class GUI : public QMainWindow, private Ui::MainWindow{ @@ -97,7 +97,6 @@ class GUI : public QMainWindow, private Ui::MainWindow{
// GUI related slots
void dropEvent(QDropEvent *event);
void dragEnterEvent(QDragEnterEvent *event);
void dragMoveEvent(QDragMoveEvent *event);
void toggleVisibility(QSystemTrayIcon::ActivationReason e);
void on_actionAbout_triggered();
void on_actionCreate_torrent_triggered();

Loading…
Cancel
Save