Change database root group Uuid

This commit is contained in:
varjolintu 2020-02-11 09:20:06 +02:00 committed by Jonathan White
parent 83ed9a8d4e
commit 0a61aa0d46
3 changed files with 73 additions and 50 deletions

View File

@ -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(removeSharedEncryptionKeys()));
connect(m_ui->removeSharedEncryptionKeys, SIGNAL(clicked()), this, SLOT(updateSharedKeyList())); connect(m_ui->removeSharedEncryptionKeys, SIGNAL(clicked()), this, SLOT(updateSharedKeyList()));
connect(m_ui->removeStoredPermissions, SIGNAL(clicked()), this, SLOT(removeStoredPermissions())); connect(m_ui->removeStoredPermissions, SIGNAL(clicked()), this, SLOT(removeStoredPermissions()));
connect(m_ui->refreshDatabaseID, SIGNAL(clicked()), this, SLOT(refreshDatabaseID()));
} }
DatabaseSettingsWidgetBrowser::~DatabaseSettingsWidgetBrowser() DatabaseSettingsWidgetBrowser::~DatabaseSettingsWidgetBrowser()
@ -256,6 +257,22 @@ void DatabaseSettingsWidgetBrowser::convertAttributesToCustomData()
m_browserService.convertAttributesToCustomData(m_db); 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 // Updates the shared key list after the list is cleared
void DatabaseSettingsWidgetBrowser::updateSharedKeyList() void DatabaseSettingsWidgetBrowser::updateSharedKeyList()
{ {

View File

@ -63,6 +63,7 @@ private slots:
void removeSharedEncryptionKeys(); void removeSharedEncryptionKeys();
void removeStoredPermissions(); void removeStoredPermissions();
void convertAttributesToCustomData(); void convertAttributesToCustomData();
void refreshDatabaseID();
private: private:
void updateModel(); void updateModel();

View File

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>453</width> <width>669</width>
<height>374</height> <height>395</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@ -50,53 +50,58 @@
<property name="title"> <property name="title">
<string>KeePassXC-Browser settings</string> <string>KeePassXC-Browser settings</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QGridLayout" name="gridLayout">
<item> <item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout"> <widget class="QPushButton" name="convertToCustomData">
<item> <property name="sizePolicy">
<widget class="QPushButton" name="removeSharedEncryptionKeys"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<property name="sizePolicy"> <horstretch>0</horstretch>
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <verstretch>0</verstretch>
<horstretch>0</horstretch> </sizepolicy>
<verstretch>0</verstretch> </property>
</sizepolicy> <property name="text">
</property> <string>Move KeePassHTTP attributes to KeePassXC-Browser custom data</string>
<property name="text"> </property>
<string>Disconnect all browsers</string> </widget>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="removeStoredPermissions">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Forget all site-specific settings on entries</string>
</property>
</widget>
</item>
</layout>
</item> </item>
<item> <item row="2" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_2"> <widget class="QPushButton" name="refreshDatabaseID">
<item> <property name="sizePolicy">
<widget class="QPushButton" name="convertToCustomData"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<property name="sizePolicy"> <horstretch>0</horstretch>
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <verstretch>0</verstretch>
<horstretch>0</horstretch> </sizepolicy>
<verstretch>0</verstretch> </property>
</sizepolicy> <property name="text">
</property> <string>Refresh database root group ID</string>
<property name="text"> </property>
<string>Move KeePassHTTP attributes to KeePassXC-Browser custom data</string> </widget>
</property> </item>
</widget> <item row="0" column="0">
</item> <widget class="QPushButton" name="removeSharedEncryptionKeys">
</layout> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Disconnect all browsers</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="removeStoredPermissions">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Forget all site-specific settings on entries</string>
</property>
</widget>
</item> </item>
</layout> </layout>
</widget> </widget>
@ -106,10 +111,10 @@
<property name="title"> <property name="title">
<string>Stored keys</string> <string>Stored keys</string>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_3"> <layout class="QHBoxLayout" name="horizontalLayout_4">
<item> <item>
<widget class="QGroupBox" name="groupBox_3"> <widget class="QGroupBox" name="groupBox_3">
<layout class="QHBoxLayout" name="horizontalLayout_4"> <layout class="QHBoxLayout" name="horizontalLayout_5">
<item> <item>
<widget class="QTableView" name="customDataTable"> <widget class="QTableView" name="customDataTable">
<property name="accessibleName"> <property name="accessibleName">