mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2026-03-11 08:54:48 +00:00
Merge 7344383655 into d9be1b0682
This commit is contained in:
commit
86edf867ad
3 changed files with 20 additions and 1 deletions
|
|
@ -7369,6 +7369,10 @@ Do you want to overwrite it?</source>
|
||||||
<source>Toggle Password (%1)</source>
|
<source>Toggle Password (%1)</source>
|
||||||
<translation>Conmutar contraseña (%1)</translation>
|
<translation>Conmutar contraseña (%1)</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Copy Password</source>
|
||||||
|
<translation>Copiar contraseña</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>Generate Password (%1)</source>
|
<source>Generate Password (%1)</source>
|
||||||
<translation>Generar contraseña (%1)</translation>
|
<translation>Generar contraseña (%1)</translation>
|
||||||
|
|
@ -10668,4 +10672,4 @@ Ejemplo: JBSWY3DPEHPK3PXP</translation>
|
||||||
<translation>Desconocido</translation>
|
<translation>Desconocido</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
</TS>
|
</TS>
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@
|
||||||
#include "ui_PasswordWidget.h"
|
#include "ui_PasswordWidget.h"
|
||||||
|
|
||||||
#include "core/Config.h"
|
#include "core/Config.h"
|
||||||
|
#include "gui/Clipboard.h"
|
||||||
#include "core/PasswordHealth.h"
|
#include "core/PasswordHealth.h"
|
||||||
#include "gui/Font.h"
|
#include "gui/Font.h"
|
||||||
#include "gui/Icons.h"
|
#include "gui/Icons.h"
|
||||||
|
|
@ -83,6 +84,13 @@ PasswordWidget::PasswordWidget(QWidget* parent)
|
||||||
m_ui->passwordEdit->addAction(m_passwordGeneratorAction, QLineEdit::TrailingPosition);
|
m_ui->passwordEdit->addAction(m_passwordGeneratorAction, QLineEdit::TrailingPosition);
|
||||||
m_passwordGeneratorAction->setVisible(false);
|
m_passwordGeneratorAction->setVisible(false);
|
||||||
|
|
||||||
|
m_copyToClipboardAction = new QAction(
|
||||||
|
icons()->icon("edit-copy"),
|
||||||
|
tr("Copy Password"),
|
||||||
|
this);
|
||||||
|
m_ui->passwordEdit->addAction(m_copyToClipboardAction, QLineEdit::TrailingPosition);
|
||||||
|
connect(m_copyToClipboardAction, &QAction::triggered, this, &PasswordWidget::copyPasswordToClipboard);
|
||||||
|
|
||||||
m_capslockAction =
|
m_capslockAction =
|
||||||
new QAction(icons()->icon("dialog-warning", true, StateColorPalette().color(StateColorPalette::Error)),
|
new QAction(icons()->icon("dialog-warning", true, StateColorPalette().color(StateColorPalette::Error)),
|
||||||
tr("Warning: Caps Lock enabled!"),
|
tr("Warning: Caps Lock enabled!"),
|
||||||
|
|
@ -185,6 +193,11 @@ bool PasswordWidget::isPasswordVisible() const
|
||||||
return m_ui->passwordEdit->echoMode() == QLineEdit::Normal;
|
return m_ui->passwordEdit->echoMode() == QLineEdit::Normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PasswordWidget::copyPasswordToClipboard()
|
||||||
|
{
|
||||||
|
clipboard()->setText(m_ui->passwordEdit->text());
|
||||||
|
}
|
||||||
|
|
||||||
void PasswordWidget::popupPasswordGenerator()
|
void PasswordWidget::popupPasswordGenerator()
|
||||||
{
|
{
|
||||||
auto generator = PasswordGeneratorWidget::popupGenerator(this);
|
auto generator = PasswordGeneratorWidget::popupGenerator(this);
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,7 @@ private slots:
|
||||||
void popupPasswordGenerator();
|
void popupPasswordGenerator();
|
||||||
void updateRepeatStatus();
|
void updateRepeatStatus();
|
||||||
void updatePasswordStrength(const QString& password);
|
void updatePasswordStrength(const QString& password);
|
||||||
|
void copyPasswordToClipboard();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void checkCapslockState();
|
void checkCapslockState();
|
||||||
|
|
@ -74,6 +75,7 @@ private:
|
||||||
QPointer<QAction> m_correctAction;
|
QPointer<QAction> m_correctAction;
|
||||||
QPointer<QAction> m_toggleVisibleAction;
|
QPointer<QAction> m_toggleVisibleAction;
|
||||||
QPointer<QAction> m_passwordGeneratorAction;
|
QPointer<QAction> m_passwordGeneratorAction;
|
||||||
|
QPointer<QAction> m_copyToClipboardAction;
|
||||||
QPointer<QAction> m_capslockAction;
|
QPointer<QAction> m_capslockAction;
|
||||||
QPointer<PasswordWidget> m_repeatPasswordWidget;
|
QPointer<PasswordWidget> m_repeatPasswordWidget;
|
||||||
QPointer<PasswordWidget> m_parentPasswordWidget;
|
QPointer<PasswordWidget> m_parentPasswordWidget;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue