Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change database root group Uuid on demand #4315

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/gui/dbsettings/DatabaseSettingsWidgetBrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()
{
Expand Down
1 change: 1 addition & 0 deletions src/gui/dbsettings/DatabaseSettingsWidgetBrowser.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ private slots:
void removeSharedEncryptionKeys();
void removeStoredPermissions();
void convertAttributesToCustomData();
void refreshDatabaseID();

private:
void updateModel();
Expand Down
105 changes: 55 additions & 50 deletions src/gui/dbsettings/DatabaseSettingsWidgetBrowser.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>453</width>
<height>374</height>
<width>669</width>
<height>395</height>
</rect>
</property>
<property name="sizePolicy">
Expand Down Expand Up @@ -50,53 +50,58 @@
<property name="title">
<string>KeePassXC-Browser settings</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="removeSharedEncryptionKeys">
<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>
<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>
<layout class="QGridLayout" name="gridLayout">
<item row="2" column="0">
<widget class="QPushButton" name="convertToCustomData">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Move KeePassHTTP attributes to KeePassXC-Browser custom data</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QPushButton" name="convertToCustomData">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Move KeePassHTTP attributes to KeePassXC-Browser custom data</string>
</property>
</widget>
</item>
</layout>
<item row="2" column="1">
<widget class="QPushButton" name="refreshDatabaseID">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Refresh database root group ID</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QPushButton" name="removeSharedEncryptionKeys">
<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>
</layout>
</widget>
Expand All @@ -106,10 +111,10 @@
<property name="title">
<string>Stored keys</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QGroupBox" name="groupBox_3">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QTableView" name="customDataTable">
<property name="accessibleName">
Expand Down