mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-03-25 23:48:18 -04:00
parent
a35f446585
commit
a7f857d32c
@ -3939,6 +3939,10 @@ Error: %1</source>
|
||||
<source>Disabled</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Double click to copy to clipboard</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>EntryURLModel</name>
|
||||
|
@ -68,6 +68,8 @@ EntryPreviewWidget::EntryPreviewWidget(QWidget* parent)
|
||||
m_ui->entryNotesTextEdit->document()->setDocumentMargin(0);
|
||||
m_ui->groupNotesTextEdit->document()->setDocumentMargin(0);
|
||||
|
||||
m_ui->entryTotpLabel->installEventFilter(this);
|
||||
|
||||
connect(m_ui->entryTotpButton, SIGNAL(toggled(bool)), m_ui->entryTotpLabel, SLOT(setVisible(bool)));
|
||||
connect(m_ui->entryTotpButton, SIGNAL(toggled(bool)), m_ui->entryTotpProgress, SLOT(setVisible(bool)));
|
||||
connect(m_ui->entryCloseButton, SIGNAL(clicked()), SLOT(hide()));
|
||||
@ -111,6 +113,18 @@ EntryPreviewWidget::EntryPreviewWidget(QWidget* parent)
|
||||
|
||||
EntryPreviewWidget::~EntryPreviewWidget() = default;
|
||||
|
||||
bool EntryPreviewWidget::eventFilter(QObject* object, QEvent* event)
|
||||
{
|
||||
if (object == m_ui->entryTotpLabel && event->type() == QEvent::MouseButtonDblClick) {
|
||||
if (m_currentEntry && m_currentEntry->hasTotp()) {
|
||||
clipboard()->setText(m_currentEntry->totp());
|
||||
m_ui->entryTotpLabel->clearFocus();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return QWidget::eventFilter(object, event);
|
||||
}
|
||||
|
||||
void EntryPreviewWidget::clear()
|
||||
{
|
||||
hide();
|
||||
|
@ -46,6 +46,9 @@ public slots:
|
||||
signals:
|
||||
void entryUrlActivated(Entry* entry);
|
||||
|
||||
protected:
|
||||
bool eventFilter(QObject* object, QEvent* event) override;
|
||||
|
||||
private slots:
|
||||
void updateEntryHeaderLine();
|
||||
void updateEntryTotp();
|
||||
|
@ -123,6 +123,9 @@
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Double click to copy to clipboard</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">1234567</string>
|
||||
</property>
|
||||
|
Loading…
x
Reference in New Issue
Block a user