mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-26 15:59:50 -05:00
Make the purpose of the key file field clearer.
The new unlock dialogue seems to confuse users as to what the purpose of the key file is. This patch changes the generic "Select file..." affordance to the more explicit "Select key file..." and adds a help button to the label just like the one we already have for the hardware key. Furthermore, it prevents the user from using the KDBX file as its own key file (since that would never work anyway). The change breaks existing translations on purpose (instead of simply adjusting the en_US locale) in order to force translators to update this string for their languages. Resolves #3678
This commit is contained in:
parent
1722397040
commit
5d2766e016
@ -65,6 +65,8 @@ DatabaseOpenWidget::DatabaseOpenWidget(QWidget* parent)
|
||||
|
||||
m_ui->hardwareKeyLabelHelp->setIcon(filePath()->icon("actions", "system-help").pixmap(QSize(12, 12)));
|
||||
connect(m_ui->hardwareKeyLabelHelp, SIGNAL(clicked(bool)), SLOT(openHardwareKeyHelp()));
|
||||
m_ui->keyFileLabelHelp->setIcon(filePath()->icon("actions", "system-help").pixmap(QSize(12, 12)));
|
||||
connect(m_ui->keyFileLabelHelp, SIGNAL(clicked(bool)), SLOT(openKeyFileHelp()));
|
||||
|
||||
connect(m_ui->comboKeyFile->lineEdit(), SIGNAL(textChanged(QString)), SLOT(handleKeyFileComboEdited()));
|
||||
connect(m_ui->comboKeyFile, SIGNAL(currentIndexChanged(int)), SLOT(handleKeyFileComboChanged()));
|
||||
@ -148,7 +150,7 @@ void DatabaseOpenWidget::load(const QString& filename)
|
||||
m_filename = filename;
|
||||
m_ui->fileNameLabel->setRawText(m_filename);
|
||||
|
||||
m_ui->comboKeyFile->addItem(tr("Select file..."), -1);
|
||||
m_ui->comboKeyFile->addItem(tr("Select key file..."), -1);
|
||||
m_ui->comboKeyFile->setCurrentIndex(0);
|
||||
m_ui->keyFileClearIcon->setVisible(false);
|
||||
m_keyFileComboEdited = false;
|
||||
@ -365,6 +367,13 @@ void DatabaseOpenWidget::browseKeyFile()
|
||||
}
|
||||
QString filename = fileDialog()->getOpenFileName(this, tr("Select key file"), QString(), filters);
|
||||
|
||||
if (QFileInfo(filename).canonicalFilePath() == QFileInfo(m_filename).canonicalFilePath()) {
|
||||
MessageBox::warning(this, tr("Cannot use database file as key file"),
|
||||
tr("You cannot use your database file as a key file.\nIf you do not have a key file, please leave the field empty."),
|
||||
MessageBox::Button::Ok);
|
||||
filename = "";
|
||||
}
|
||||
|
||||
if (!filename.isEmpty()) {
|
||||
m_ui->comboKeyFile->setCurrentIndex(-1);
|
||||
m_ui->comboKeyFile->setEditText(filename);
|
||||
@ -433,5 +442,10 @@ void DatabaseOpenWidget::noYubikeyFound()
|
||||
|
||||
void DatabaseOpenWidget::openHardwareKeyHelp()
|
||||
{
|
||||
QDesktopServices::openUrl(QUrl("https://keepassxc.org/docs#hwtoken"));
|
||||
QDesktopServices::openUrl(QUrl("https://keepassxc.org/docs#faq-cat-yubikey"));
|
||||
}
|
||||
|
||||
void DatabaseOpenWidget::openKeyFileHelp()
|
||||
{
|
||||
QDesktopServices::openUrl(QUrl("https://keepassxc.org/docs#faq-cat-keyfile"));
|
||||
}
|
@ -68,6 +68,7 @@ private slots:
|
||||
void yubikeyDetectComplete();
|
||||
void noYubikeyFound();
|
||||
void openHardwareKeyHelp();
|
||||
void openKeyFileHelp();
|
||||
|
||||
protected:
|
||||
const QScopedPointer<Ui::DatabaseOpenWidget> m_ui;
|
||||
|
@ -2,14 +2,6 @@
|
||||
<ui version="4.0">
|
||||
<class>DatabaseOpenWidget</class>
|
||||
<widget class="QWidget" name="DatabaseOpenWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>592</width>
|
||||
<height>462</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="accessibleName">
|
||||
<string>Unlock KeePassXC Database</string>
|
||||
</property>
|
||||
@ -210,7 +202,7 @@
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Enter Additional Credentials:</string>
|
||||
<string>Enter Additional Credentials (if any):</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -243,32 +235,6 @@
|
||||
<property name="topMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<item row="0" column="3">
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<property name="verticalSpacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="comboKeyFile">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="accessibleName">
|
||||
<string>Key file selection</string>
|
||||
</property>
|
||||
<property name="editable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="spacing">
|
||||
@ -330,26 +296,36 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="4">
|
||||
<widget class="QPushButton" name="buttonRedetectYubikey">
|
||||
<item row="0" column="3">
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<property name="verticalSpacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="comboKeyFile">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Refresh hardware tokens</string>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="accessibleName">
|
||||
<string>Refresh hardware tokens</string>
|
||||
<string>Key file selection</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Refresh</string>
|
||||
<property name="editable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
<number>5</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="hardwareKeyLabel">
|
||||
@ -368,7 +344,7 @@
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><p>You can use a hardware security key such as a <strong>YubiKey</strong> or <strong>OnlyKey</strong> with slots configured for HMAC-SHA1.</p>
|
||||
<p>Click for more information...</p></string>
|
||||
<p>Click for more information...</p></string>
|
||||
</property>
|
||||
<property name="accessibleName">
|
||||
<string>Hardware key help</string>
|
||||
@ -377,7 +353,7 @@
|
||||
<string notr="true">QToolButton {
|
||||
border: none;
|
||||
background: none;
|
||||
}</string>
|
||||
}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">?</string>
|
||||
@ -396,6 +372,11 @@
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<property name="spacing">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="keyFileLabel">
|
||||
<property name="text">
|
||||
<string>Key File:</string>
|
||||
@ -405,6 +386,55 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="keyFileLabelHelp">
|
||||
<property name="cursor">
|
||||
<cursorShape>PointingHandCursor</cursorShape>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><p>In addition to your master password, you can use a secret file to enhance the security of your database. Such a file can be generated in your database's security settings.</p><p>This is <strong>not</strong> your *.kdbx database file!<br>If you do not have a key file, leave the field empty.</p><p>Click for more information...</p></string>
|
||||
</property>
|
||||
<property name="accessibleName">
|
||||
<string>Key file help</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QToolButton {
|
||||
border: none;
|
||||
background: none;
|
||||
}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>?</string>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>12</width>
|
||||
<height>12</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="popupMode">
|
||||
<enum>QToolButton::InstantPopup</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="4">
|
||||
<widget class="QPushButton" name="buttonRedetectYubikey">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Refresh hardware tokens</string>
|
||||
</property>
|
||||
<property name="accessibleName">
|
||||
<string>Refresh hardware tokens</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Refresh</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
|
Loading…
Reference in New Issue
Block a user