diff --git a/src/interface_qt.cpp b/src/interface_qt.cpp index b5066e7..c99a8d3 100644 --- a/src/interface_qt.cpp +++ b/src/interface_qt.cpp @@ -300,6 +300,22 @@ void DialogAdd::accept() delete this; } +void DialogAdd::dragEnterEvent(QDragEnterEvent *event) +{ + if (event->mimeData()->hasFormat("text/plain")) + { + event->acceptProposedAction(); + } +} + +void DialogAdd::dropEvent(QDropEvent *event) +{ + const QString text = event->mimeData()->text(); + QListWidgetItem *item = new QListWidgetItem(text); + item->setFlags(item->flags() | Qt::ItemIsEditable); + list_receipts->insertItem(list_receipts->count(), item); +} + int main(int argc, char *argv[]) { QApplication app(argc, argv); diff --git a/src/interface_qt.hpp b/src/interface_qt.hpp index 011afde..9dd69ca 100644 --- a/src/interface_qt.hpp +++ b/src/interface_qt.hpp @@ -73,6 +73,8 @@ public: private: const Dialogdata get_data() const; + void dragEnterEvent(QDragEnterEvent *event); + void dropEvent(QDropEvent *event); MainWindow *_parent; diff --git a/src/whyblocked_add.ui b/src/whyblocked_add.ui index fdb9017..bf882c1 100644 --- a/src/whyblocked_add.ui +++ b/src/whyblocked_add.ui @@ -10,6 +10,9 @@ 300 + + true + Add entry diff --git a/translations/whyblocked_de.ts b/translations/whyblocked_de.ts index 27809f9..e83b12d 100644 --- a/translations/whyblocked_de.ts +++ b/translations/whyblocked_de.ts @@ -4,62 +4,62 @@ DialogAdd - + Add entry Eintrag hinzufügen - + Memory aids, proof Gedächtnisstützen, Beweise - + Rece&ipts Be&lege - + Add receipt Beleg hinzufügen - + &Add &Hinzufügen - + &Blocked &Blockiert - + &Silenced &Gedämpft - + R&eason B&egründung - + Blocked/Silenced Blockiert/Gedämpft - + &User/Instance Ben&utzer/Instanz - + Remove receipt Beleg entfernen - + Re&move Ent&fernen diff --git a/translations/whyblocked_en.ts b/translations/whyblocked_en.ts index a52ce8c..2eb0787 100644 --- a/translations/whyblocked_en.ts +++ b/translations/whyblocked_en.ts @@ -4,62 +4,62 @@ DialogAdd - + Add entry - + Memory aids, proof - + Rece&ipts - + Add receipt - + &Add - + &Blocked - + &Silenced - + R&eason - + Blocked/Silenced - + &User/Instance - + Remove receipt - + Re&move