From cb9929712cc4fb9573b2ad3c50a5e7c2c681af30 Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Fri, 8 Nov 2019 18:04:42 -0500 Subject: [PATCH] Start Database Widget in view mode * Fix #3713 - DatabaseWidget starts in locked mode instead of view mode fixing tab names on launch. --- src/gui/DatabaseWidget.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gui/DatabaseWidget.cpp b/src/gui/DatabaseWidget.cpp index 45645fa55..a8e6b4274 100644 --- a/src/gui/DatabaseWidget.cpp +++ b/src/gui/DatabaseWidget.cpp @@ -95,6 +95,8 @@ DatabaseWidget::DatabaseWidget(QSharedPointer db, QWidget* parent) , m_groupView(new GroupView(m_db.data(), m_mainSplitter)) , m_saveAttempts(0) { + Q_ASSERT(m_db); + m_messageWidget->setHidden(true); auto* mainLayout = new QVBoxLayout(); @@ -221,7 +223,11 @@ DatabaseWidget::DatabaseWidget(QSharedPointer db, QWidget* parent) KeeShare::instance()->connectDatabase(m_db, {}); #endif - switchToMainView(); + if (m_db->isInitialized()) { + switchToMainView(); + } else { + switchToOpenDatabase(); + } } DatabaseWidget::DatabaseWidget(const QString& filePath, QWidget* parent)