Skip to content

Commit

Permalink
Passkeys: UI adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
droidmonkey committed Jan 13, 2024
1 parent 52afdff commit 54d829b
Show file tree
Hide file tree
Showing 10 changed files with 179 additions and 160 deletions.
102 changes: 53 additions & 49 deletions share/translations/keepassxc_en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -843,10 +843,6 @@ Please select the correct database for saving credentials.</source>
</context>
<context>
<name>BrowserPasskeysConfirmationDialog</name>
<message>
<source>KeePassXC: Passkey credentials</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cancel</source>
<translation type="unfinished"></translation>
Expand Down Expand Up @@ -878,10 +874,6 @@ Please select the correct database for saving credentials.</source>
<source>Do you want to register Passkey for:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>%1 (%2)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Existing Passkey found.
Do you want to register a new Passkey for:</source>
Expand All @@ -895,21 +887,25 @@ Do you want to register a new Passkey for:</source>
<source>Authenticate Passkey credentials for:</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>BrowserService</name>
<message>
<source>KeePassXC: Create a new group</source>
<source>Relying Party: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>A request for creating a new group &quot;%1&quot; has been received.
Do you want to create this group?
</source>
<source>Username: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>KeePassXC: New key association request</source>
<source>KeePassXC - Passkey credentials</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>BrowserService</name>
<message>
<source>A request for creating a new group &quot;%1&quot; has been received.
Do you want to create this group?
</source>
<translation type="unfinished"></translation>
</message>
<message>
Expand All @@ -925,43 +921,51 @@ chrome-laptop.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>KeePassXC: Overwrite existing key?</source>
<source>A shared encryption key with the name &quot;%1&quot; already exists.
Do you want to overwrite it?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>A shared encryption key with the name &quot;%1&quot; already exists.
Do you want to overwrite it?</source>
<source>Do you want to update the information in %1 - %2?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>KeePassXC: Update Entry</source>
<source>A request for deleting entry &quot;%1&quot; has been received.
Do you want to delete the entry?
</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Do you want to update the information in %1 - %2?</source>
<source>%1 (Passkey)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>KeePassXC: Delete entry</source>
<source>Entry already has a Passkey.
Do you want to overwrite the Passkey in %1 - %2?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>A request for deleting entry &quot;%1&quot; has been received.
Do you want to delete the entry?
</source>
<source>KeePassXC - Create a new group</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>%1 (Passkey)</source>
<source>KeePassXC - New key association request</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>KeePassXC: Update Passkey</source>
<source>KeePassXC - Overwrite existing key?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Entry already has a Passkey.
Do you want to overwrite the Passkey in %1 - %2?</source>
<source>KeePassXC - Update Passkey</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>KeePassXC - Update Entry</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>KeePassXC - Delete entry</source>
<translation type="unfinished"></translation>
</message>
<message>
Expand Down Expand Up @@ -1796,18 +1800,10 @@ This may prevent connection to the browser plugin.</source>
This may prevent connection to the browser plugin.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>KeePassXC: No keys found</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>No shared encryption keys found in KeePassXC settings.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>KeePassXC: Removed keys from database</source>
<translation type="unfinished"></translation>
</message>
<message numerus="yes">
<source>Successfully removed %n encryption key(s) from KeePassXC settings.</source>
<translation type="unfinished">
Expand All @@ -1828,21 +1824,13 @@ Permissions to access entries will be revoked.</source>
<source>Abort</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>KeePassXC: Removed permissions</source>
<translation type="unfinished"></translation>
</message>
<message numerus="yes">
<source>Successfully removed permissions from %n entry(s).</source>
<translation type="unfinished">
<numerusform></numerusform>
<numerusform></numerusform>
</translation>
</message>
<message>
<source>KeePassXC: No entry with permissions found!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>The active database does not contain an entry with permissions.</source>
<translation type="unfinished"></translation>
Expand All @@ -1865,6 +1853,22 @@ This is necessary to maintain compatibility with the browser plugin.</source>
This is only necessary if your database is a copy of another and the browser extension cannot connect.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>No keys found</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Removed keys from database</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Removed permissions</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>No entry with permissions found!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DatabaseSettingsWidgetDatabaseKey</name>
Expand Down Expand Up @@ -6026,10 +6030,6 @@ Do you want to overwrite it?
<source>KeePassXC - Passkey Import</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>URL: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Username: %1</source>
<translation type="unfinished"></translation>
Expand Down Expand Up @@ -6074,6 +6074,10 @@ Do you want to overwrite it?
<source>Default Passkeys group (Imported Passkeys)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Relying Party: %1</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>PasskeyImporter</name>
Expand Down
12 changes: 8 additions & 4 deletions src/browser/BrowserPasskeysConfirmationDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ BrowserPasskeysConfirmationDialog::BrowserPasskeysConfirmationDialog(QWidget* pa

m_ui->setupUi(this);
m_ui->updateButton->setVisible(false);
m_ui->verticalLayout->setAlignment(Qt::AlignTop);

connect(m_ui->credentialsTable, SIGNAL(cellDoubleClicked(int, int)), this, SLOT(accept()));
connect(m_ui->confirmButton, SIGNAL(clicked()), SLOT(accept()));
Expand All @@ -48,12 +49,13 @@ BrowserPasskeysConfirmationDialog::~BrowserPasskeysConfirmationDialog()
}

void BrowserPasskeysConfirmationDialog::registerCredential(const QString& username,
const QString& siteId,
const QString& relyingParty,
const QList<Entry*>& existingEntries,
int timeout)
{
m_ui->firstLabel->setText(tr("Do you want to register Passkey for:"));
m_ui->dataLabel->setText(tr("%1 (%2)").arg(username, siteId));
m_ui->relyingPartyLabel->setText(tr("Relying Party: %1").arg(relyingParty));
m_ui->usernameLabel->setText(tr("Username: %1").arg(username));
m_ui->secondLabel->setText("");

if (!existingEntries.isEmpty()) {
Expand All @@ -64,6 +66,7 @@ void BrowserPasskeysConfirmationDialog::registerCredential(const QString& userna
m_ui->confirmButton->setText(tr("Register new"));
updateEntriesToTable(existingEntries);
} else {
m_ui->verticalLayout->setSizeConstraint(QLayout::SetFixedSize);
m_ui->confirmButton->setText(tr("Register"));
m_ui->credentialsTable->setVisible(false);
}
Expand All @@ -72,11 +75,12 @@ void BrowserPasskeysConfirmationDialog::registerCredential(const QString& userna
}

void BrowserPasskeysConfirmationDialog::authenticateCredential(const QList<Entry*>& entries,
const QString& origin,
const QString& relyingParty,
int timeout)
{
m_ui->firstLabel->setText(tr("Authenticate Passkey credentials for:"));
m_ui->dataLabel->setText(origin);
m_ui->relyingPartyLabel->setText(tr("Relying Party: %1").arg(relyingParty));
m_ui->usernameLabel->setVisible(false);
m_ui->secondLabel->setText("");
updateEntriesToTable(entries);
startCounter(timeout);
Expand Down
4 changes: 2 additions & 2 deletions src/browser/BrowserPasskeysConfirmationDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ class BrowserPasskeysConfirmationDialog : public QDialog
~BrowserPasskeysConfirmationDialog() override;

void registerCredential(const QString& username,
const QString& siteId,
const QString& relyingParty,
const QList<Entry*>& existingEntries,
int timeout);
void authenticateCredential(const QList<Entry*>& entries, const QString& origin, int timeout);
void authenticateCredential(const QList<Entry*>& entries, const QString& relyingParty, int timeout);
Entry* getSelectedEntry() const;
bool isPasskeyUpdated() const;

Expand Down
108 changes: 56 additions & 52 deletions src/browser/BrowserPasskeysConfirmationDialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,69 +6,73 @@
<rect>
<x>0</x>
<y>0</y>
<width>405</width>
<height>282</height>
<width>400</width>
<height>274</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>KeePassXC: Passkey credentials</string>
<string>KeePassXC - Passkey credentials</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="firstLabel">
<property name="font">
<font>
<bold>true</bold>
</font>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="dataLabel">
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="secondLabel">
<property name="font">
<font>
<bold>true</bold>
</font>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="firstLabel">
<property name="font">
<font>
<bold>true</bold>
</font>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="relyingPartyLabel">
<property name="text">
<string>Relying Party: %1</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="usernameLabel">
<property name="text">
<string>Username: %1</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="secondLabel">
<property name="font">
<font>
<bold>true</bold>
</font>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QTableWidget" name="credentialsTable">
Expand Down
Loading

0 comments on commit 54d829b

Please sign in to comment.