diff options
-rw-r--r-- | src/entryLayout.cpp | 11 | ||||
-rw-r--r-- | src/entryLayout.h | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/entryLayout.cpp b/src/entryLayout.cpp index f569829..ac31f4b 100644 --- a/src/entryLayout.cpp +++ b/src/entryLayout.cpp @@ -131,6 +131,10 @@ void EntryLayout::showContextMenu() { QObject::connect(toggle_done_act, &QAction::triggered, this, &EntryLayout::toggleDone); menu.addAction(toggle_done_act); + QAction *clone_entry_act = new QAction("Clone Entry"); + QObject::connect(clone_entry_act, &QAction::triggered, this, &EntryLayout::cloneEntry); + menu.addAction(clone_entry_act); + QAction *del_entry_act = new QAction("Remove Entry"); QObject::connect(del_entry_act, &QAction::triggered, this, &EntryLayout::removeEntry); menu.addAction(del_entry_act); @@ -158,6 +162,13 @@ void EntryLayout::toggleDone() { getMainWindow()->displayWidgets(); } +void EntryLayout::cloneEntry() { + BackendDB database; + + database.insertEntry(this->entry); + getMainWindow()->displayWidgets(); +} + void EntryLayout::removeEntry() { BackendDB database; diff --git a/src/entryLayout.h b/src/entryLayout.h index c38a51b..54e523f 100644 --- a/src/entryLayout.h +++ b/src/entryLayout.h @@ -25,6 +25,7 @@ class EntryLayout : public QHBoxLayout { void editEntry(); void setRules(); void toggleDone(); + void cloneEntry(); void removeEntry(); }; |