Added drop-support to add dialog (closes #8)
If text is dropped in the add dialog, a receipt is added with that text.develop
parent
f6ff77571d
commit
9cc5af5142
|
@ -300,6 +300,22 @@ void DialogAdd::accept()
|
||||||
delete this;
|
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[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
QApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
|
|
|
@ -73,6 +73,8 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const Dialogdata get_data() const;
|
const Dialogdata get_data() const;
|
||||||
|
void dragEnterEvent(QDragEnterEvent *event);
|
||||||
|
void dropEvent(QDropEvent *event);
|
||||||
|
|
||||||
MainWindow *_parent;
|
MainWindow *_parent;
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,9 @@
|
||||||
<height>300</height>
|
<height>300</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="acceptDrops">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Add entry</string>
|
<string>Add entry</string>
|
||||||
</property>
|
</property>
|
||||||
|
|
|
@ -4,62 +4,62 @@
|
||||||
<context>
|
<context>
|
||||||
<name>DialogAdd</name>
|
<name>DialogAdd</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/whyblocked_add.ui" line="14"/>
|
<location filename="../src/whyblocked_add.ui" line="17"/>
|
||||||
<source>Add entry</source>
|
<source>Add entry</source>
|
||||||
<translation>Eintrag hinzufügen</translation>
|
<translation>Eintrag hinzufügen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/whyblocked_add.ui" line="37"/>
|
<location filename="../src/whyblocked_add.ui" line="40"/>
|
||||||
<source>Memory aids, proof</source>
|
<source>Memory aids, proof</source>
|
||||||
<translation>Gedächtnisstützen, Beweise</translation>
|
<translation>Gedächtnisstützen, Beweise</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/whyblocked_add.ui" line="40"/>
|
<location filename="../src/whyblocked_add.ui" line="43"/>
|
||||||
<source>Rece&ipts</source>
|
<source>Rece&ipts</source>
|
||||||
<translation>Be&lege</translation>
|
<translation>Be&lege</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/whyblocked_add.ui" line="53"/>
|
<location filename="../src/whyblocked_add.ui" line="56"/>
|
||||||
<source>Add receipt</source>
|
<source>Add receipt</source>
|
||||||
<translation>Beleg hinzufügen</translation>
|
<translation>Beleg hinzufügen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/whyblocked_add.ui" line="56"/>
|
<location filename="../src/whyblocked_add.ui" line="59"/>
|
||||||
<source>&Add</source>
|
<source>&Add</source>
|
||||||
<translation>&Hinzufügen</translation>
|
<translation>&Hinzufügen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/whyblocked_add.ui" line="76"/>
|
<location filename="../src/whyblocked_add.ui" line="79"/>
|
||||||
<source>&Blocked</source>
|
<source>&Blocked</source>
|
||||||
<translation>&Blockiert</translation>
|
<translation>&Blockiert</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/whyblocked_add.ui" line="95"/>
|
<location filename="../src/whyblocked_add.ui" line="98"/>
|
||||||
<source>&Silenced</source>
|
<source>&Silenced</source>
|
||||||
<translation>&Gedämpft</translation>
|
<translation>&Gedämpft</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/whyblocked_add.ui" line="102"/>
|
<location filename="../src/whyblocked_add.ui" line="105"/>
|
||||||
<source>R&eason</source>
|
<source>R&eason</source>
|
||||||
<translation>B&egründung</translation>
|
<translation>B&egründung</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/whyblocked_add.ui" line="131"/>
|
<location filename="../src/whyblocked_add.ui" line="134"/>
|
||||||
<source>Blocked/Silenced</source>
|
<source>Blocked/Silenced</source>
|
||||||
<translation>Blockiert/Gedämpft</translation>
|
<translation>Blockiert/Gedämpft</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/whyblocked_add.ui" line="141"/>
|
<location filename="../src/whyblocked_add.ui" line="144"/>
|
||||||
<source>&User/Instance</source>
|
<source>&User/Instance</source>
|
||||||
<translation>Ben&utzer/Instanz</translation>
|
<translation>Ben&utzer/Instanz</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/whyblocked_add.ui" line="151"/>
|
<location filename="../src/whyblocked_add.ui" line="154"/>
|
||||||
<source>Remove receipt</source>
|
<source>Remove receipt</source>
|
||||||
<translation>Beleg entfernen</translation>
|
<translation>Beleg entfernen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/whyblocked_add.ui" line="154"/>
|
<location filename="../src/whyblocked_add.ui" line="157"/>
|
||||||
<source>Re&move</source>
|
<source>Re&move</source>
|
||||||
<translation>Ent&fernen</translation>
|
<translation>Ent&fernen</translation>
|
||||||
</message>
|
</message>
|
||||||
|
|
|
@ -4,62 +4,62 @@
|
||||||
<context>
|
<context>
|
||||||
<name>DialogAdd</name>
|
<name>DialogAdd</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/whyblocked_add.ui" line="14"/>
|
<location filename="../src/whyblocked_add.ui" line="17"/>
|
||||||
<source>Add entry</source>
|
<source>Add entry</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/whyblocked_add.ui" line="37"/>
|
<location filename="../src/whyblocked_add.ui" line="40"/>
|
||||||
<source>Memory aids, proof</source>
|
<source>Memory aids, proof</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/whyblocked_add.ui" line="40"/>
|
<location filename="../src/whyblocked_add.ui" line="43"/>
|
||||||
<source>Rece&ipts</source>
|
<source>Rece&ipts</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/whyblocked_add.ui" line="53"/>
|
<location filename="../src/whyblocked_add.ui" line="56"/>
|
||||||
<source>Add receipt</source>
|
<source>Add receipt</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/whyblocked_add.ui" line="56"/>
|
<location filename="../src/whyblocked_add.ui" line="59"/>
|
||||||
<source>&Add</source>
|
<source>&Add</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/whyblocked_add.ui" line="76"/>
|
<location filename="../src/whyblocked_add.ui" line="79"/>
|
||||||
<source>&Blocked</source>
|
<source>&Blocked</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/whyblocked_add.ui" line="95"/>
|
<location filename="../src/whyblocked_add.ui" line="98"/>
|
||||||
<source>&Silenced</source>
|
<source>&Silenced</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/whyblocked_add.ui" line="102"/>
|
<location filename="../src/whyblocked_add.ui" line="105"/>
|
||||||
<source>R&eason</source>
|
<source>R&eason</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/whyblocked_add.ui" line="131"/>
|
<location filename="../src/whyblocked_add.ui" line="134"/>
|
||||||
<source>Blocked/Silenced</source>
|
<source>Blocked/Silenced</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/whyblocked_add.ui" line="141"/>
|
<location filename="../src/whyblocked_add.ui" line="144"/>
|
||||||
<source>&User/Instance</source>
|
<source>&User/Instance</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/whyblocked_add.ui" line="151"/>
|
<location filename="../src/whyblocked_add.ui" line="154"/>
|
||||||
<source>Remove receipt</source>
|
<source>Remove receipt</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/whyblocked_add.ui" line="154"/>
|
<location filename="../src/whyblocked_add.ui" line="157"/>
|
||||||
<source>Re&move</source>
|
<source>Re&move</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
|
Loading…
Reference in New Issue