diff --git a/src/gui/DatabaseTabWidget.cpp b/src/gui/DatabaseTabWidget.cpp index f824f7d18..c6e9eb84f 100644 --- a/src/gui/DatabaseTabWidget.cpp +++ b/src/gui/DatabaseTabWidget.cpp @@ -268,6 +268,11 @@ void DatabaseTabWidget::editEntry() currentDatabaseWidget()->switchToEntryEdit(); } +void DatabaseTabWidget::deleteEntry() +{ + currentDatabaseWidget()->deleteEntry(); +} + void DatabaseTabWidget::createGroup() { currentDatabaseWidget()->createGroup(); diff --git a/src/gui/DatabaseTabWidget.h b/src/gui/DatabaseTabWidget.h index 143356537..19f2cae5a 100644 --- a/src/gui/DatabaseTabWidget.h +++ b/src/gui/DatabaseTabWidget.h @@ -60,6 +60,7 @@ public Q_SLOTS: void changeMasterKey(); void createEntry(); void editEntry(); + void deleteEntry(); void createGroup(); void editGroup(); diff --git a/src/gui/DatabaseWidget.cpp b/src/gui/DatabaseWidget.cpp index 7c499713a..deccd4377 100644 --- a/src/gui/DatabaseWidget.cpp +++ b/src/gui/DatabaseWidget.cpp @@ -102,6 +102,11 @@ void DatabaseWidget::createEntry() switchToEntryEdit(m_newEntry, true); } +void DatabaseWidget::deleteEntry() +{ + delete m_entryView->currentEntry(); +} + void DatabaseWidget::createGroup() { m_newGroup = new Group(); diff --git a/src/gui/DatabaseWidget.h b/src/gui/DatabaseWidget.h index 64e54f9b0..1035e7c4e 100644 --- a/src/gui/DatabaseWidget.h +++ b/src/gui/DatabaseWidget.h @@ -38,6 +38,7 @@ public: GroupView* groupView(); EntryView* entryView(); bool dbHasKey(); + void deleteEntry(); Q_SIGNALS: void closeRequest(); diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index d25585aaa..c50e81553 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -44,6 +44,7 @@ MainWindow::MainWindow() connect(m_ui->actionChangeMasterKey, SIGNAL(triggered()), m_ui->tabWidget, SLOT(changeMasterKey())); connect(m_ui->actionEntryNew, SIGNAL(triggered()), m_ui->tabWidget, SLOT(createEntry())); connect(m_ui->actionEntryEdit, SIGNAL(triggered()), m_ui->tabWidget, SLOT(editEntry())); + connect(m_ui->actionEntryDelete, SIGNAL(triggered()), m_ui->tabWidget, SLOT(deleteEntry())); connect(m_ui->actionGroupNew, SIGNAL(triggered()), m_ui->tabWidget, SLOT(createGroup())); connect(m_ui->actionGroupEdit, SIGNAL(triggered()), m_ui->tabWidget, SLOT(editGroup())); connect(m_ui->actionQuit, SIGNAL(triggered()), SLOT(close())); diff --git a/src/gui/MainWindow.ui b/src/gui/MainWindow.ui index 396c13781..6fa422f05 100644 --- a/src/gui/MainWindow.ui +++ b/src/gui/MainWindow.ui @@ -36,7 +36,7 @@ <x>0</x> <y>0</y> <width>800</width> - <height>19</height> + <height>20</height> </rect> </property> <widget class="QMenu" name="menuFile"> @@ -96,6 +96,7 @@ </attribute> <addaction name="actionEntryNew"/> <addaction name="actionEntryEdit"/> + <addaction name="actionEntryDelete"/> </widget> <action name="actionQuit"> <property name="text">