Add ability to delete entries via gui.

This commit is contained in:
Florian Geyer 2012-04-18 20:08:54 +02:00 committed by Felix Geyer
parent 37291d278e
commit 5661f29f7d
6 changed files with 15 additions and 1 deletions

View File

@ -268,6 +268,11 @@ void DatabaseTabWidget::editEntry()
currentDatabaseWidget()->switchToEntryEdit();
}
void DatabaseTabWidget::deleteEntry()
{
currentDatabaseWidget()->deleteEntry();
}
void DatabaseTabWidget::createGroup()
{
currentDatabaseWidget()->createGroup();

View File

@ -60,6 +60,7 @@ public Q_SLOTS:
void changeMasterKey();
void createEntry();
void editEntry();
void deleteEntry();
void createGroup();
void editGroup();

View File

@ -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();

View File

@ -38,6 +38,7 @@ public:
GroupView* groupView();
EntryView* entryView();
bool dbHasKey();
void deleteEntry();
Q_SIGNALS:
void closeRequest();

View File

@ -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()));

View File

@ -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">