From 0a61aa0d4679ca91f2cd1ab628a3a1893fd91352 Mon Sep 17 00:00:00 2001 From: varjolintu Date: Tue, 11 Feb 2020 09:20:06 +0200 Subject: [PATCH] Change database root group Uuid --- .../DatabaseSettingsWidgetBrowser.cpp | 17 +++ .../DatabaseSettingsWidgetBrowser.h | 1 + .../DatabaseSettingsWidgetBrowser.ui | 105 +++++++++--------- 3 files changed, 73 insertions(+), 50 deletions(-) diff --git a/src/gui/dbsettings/DatabaseSettingsWidgetBrowser.cpp b/src/gui/dbsettings/DatabaseSettingsWidgetBrowser.cpp index 906278c92..31fe34eef 100644 --- a/src/gui/dbsettings/DatabaseSettingsWidgetBrowser.cpp +++ b/src/gui/dbsettings/DatabaseSettingsWidgetBrowser.cpp @@ -54,6 +54,7 @@ DatabaseSettingsWidgetBrowser::DatabaseSettingsWidgetBrowser(QWidget* parent) connect(m_ui->removeSharedEncryptionKeys, SIGNAL(clicked()), this, SLOT(removeSharedEncryptionKeys())); connect(m_ui->removeSharedEncryptionKeys, SIGNAL(clicked()), this, SLOT(updateSharedKeyList())); connect(m_ui->removeStoredPermissions, SIGNAL(clicked()), this, SLOT(removeStoredPermissions())); + connect(m_ui->refreshDatabaseID, SIGNAL(clicked()), this, SLOT(refreshDatabaseID())); } DatabaseSettingsWidgetBrowser::~DatabaseSettingsWidgetBrowser() @@ -256,6 +257,22 @@ void DatabaseSettingsWidgetBrowser::convertAttributesToCustomData() m_browserService.convertAttributesToCustomData(m_db); } +void DatabaseSettingsWidgetBrowser::refreshDatabaseID() +{ + if (MessageBox::Yes + != MessageBox::question(this, + tr("Refresh database ID"), + tr("Do you really want refresh the database ID?\n" + "This is only necessary if your database is a copy of another and the " + "browser extension cannot connect."), + MessageBox::Yes | MessageBox::Cancel, + MessageBox::Cancel)) { + return; + } + + m_db->rootGroup()->setUuid(QUuid::createUuid()); +} + // Updates the shared key list after the list is cleared void DatabaseSettingsWidgetBrowser::updateSharedKeyList() { diff --git a/src/gui/dbsettings/DatabaseSettingsWidgetBrowser.h b/src/gui/dbsettings/DatabaseSettingsWidgetBrowser.h index d9d9885ca..c3cc0b122 100644 --- a/src/gui/dbsettings/DatabaseSettingsWidgetBrowser.h +++ b/src/gui/dbsettings/DatabaseSettingsWidgetBrowser.h @@ -63,6 +63,7 @@ private slots: void removeSharedEncryptionKeys(); void removeStoredPermissions(); void convertAttributesToCustomData(); + void refreshDatabaseID(); private: void updateModel(); diff --git a/src/gui/dbsettings/DatabaseSettingsWidgetBrowser.ui b/src/gui/dbsettings/DatabaseSettingsWidgetBrowser.ui index 34553f97d..4fcf091e1 100644 --- a/src/gui/dbsettings/DatabaseSettingsWidgetBrowser.ui +++ b/src/gui/dbsettings/DatabaseSettingsWidgetBrowser.ui @@ -6,8 +6,8 @@ 0 0 - 453 - 374 + 669 + 395 @@ -50,53 +50,58 @@ KeePassXC-Browser settings - - - - - - - - 0 - 0 - - - - Disconnect all browsers - - - - - - - - 0 - 0 - - - - Forget all site-specific settings on entries - - - - + + + + + + 0 + 0 + + + + Move KeePassHTTP attributes to KeePassXC-Browser custom data + + - - - - - - - 0 - 0 - - - - Move KeePassHTTP attributes to KeePassXC-Browser custom data - - - - + + + + + 0 + 0 + + + + Refresh database root group ID + + + + + + + + 0 + 0 + + + + Disconnect all browsers + + + + + + + + 0 + 0 + + + + Forget all site-specific settings on entries + + @@ -106,10 +111,10 @@ Stored keys - + - +