From 00ce60ef20a7799cb0abd2b94e01f595695b8698 Mon Sep 17 00:00:00 2001 From: thez3ro Date: Thu, 18 Jan 2018 01:16:46 +0100 Subject: [PATCH] create new entry while searching --- src/gui/DatabaseWidget.cpp | 5 +++++ src/gui/MainWindow.cpp | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gui/DatabaseWidget.cpp b/src/gui/DatabaseWidget.cpp index 6ea82b330..8f4fc9bb3 100644 --- a/src/gui/DatabaseWidget.cpp +++ b/src/gui/DatabaseWidget.cpp @@ -339,6 +339,11 @@ void DatabaseWidget::createEntry() } m_newEntry = new Entry(); + + if (isInSearchMode()) { + m_newEntry->setTitle(getCurrentSearch()); + endSearch(); + } m_newEntry->setUuid(Uuid::random()); m_newEntry->setUsername(m_db->metadata()->defaultUserName()); m_newParent = m_groupView->currentGroup(); diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 08331ffec..9c0fe1dfb 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -493,13 +493,13 @@ void MainWindow::setMenuActionState(DatabaseWidget::Mode mode) switch (mode) { case DatabaseWidget::ViewMode: { - bool inSearch = dbWidget->isInSearchMode(); + //bool inSearch = dbWidget->isInSearchMode(); bool singleEntrySelected = dbWidget->numberOfSelectedEntries() == 1; bool entriesSelected = dbWidget->numberOfSelectedEntries() > 0; bool groupSelected = dbWidget->isGroupSelected(); bool recycleBinSelected = dbWidget->isRecycleBinSelected(); - m_ui->actionEntryNew->setEnabled(!inSearch); + m_ui->actionEntryNew->setEnabled(true); m_ui->actionEntryClone->setEnabled(singleEntrySelected); m_ui->actionEntryEdit->setEnabled(singleEntrySelected); m_ui->actionEntryDelete->setEnabled(entriesSelected);