diff --git a/share/translations/keepassxc_de.ts b/share/translations/keepassxc_de.ts
index ec732774c..c6118caf5 100644
--- a/share/translations/keepassxc_de.ts
+++ b/share/translations/keepassxc_de.ts
@@ -3151,6 +3151,14 @@ Korrigieren?
Reveal
Zeigen
+
+ Copy
+ Kopieren
+
+
+ Copy text into clipboard
+ Text in die Zwischenablage kopieren
+
Attachments
Anhänge
@@ -10671,4 +10679,4 @@ Beispiel: JBSWY3DPEHPK3PXP
Unbekannt
-
\ No newline at end of file
+
diff --git a/share/translations/keepassxc_en.ts b/share/translations/keepassxc_en.ts
index f974db170..ad8d98c8a 100644
--- a/share/translations/keepassxc_en.ts
+++ b/share/translations/keepassxc_en.ts
@@ -3150,6 +3150,14 @@ Would you like to correct it?
Reveal
+
+ Copy
+
+
+
+ Copy text into clipboard
+
+
Attachments
diff --git a/share/translations/keepassxc_en_GB.ts b/share/translations/keepassxc_en_GB.ts
index 8c878dc04..93109bb73 100644
--- a/share/translations/keepassxc_en_GB.ts
+++ b/share/translations/keepassxc_en_GB.ts
@@ -3150,6 +3150,14 @@ Would you like to correct it?
Reveal
Reveal
+
+ Copy
+ Copy
+
+
+ Copy text into clipboard
+ Copy text into clipboard
+
Attachments
Attachments
@@ -10671,4 +10679,4 @@ Example: JBSWY3DPEHPK3PXP
Unknown
-
\ No newline at end of file
+
diff --git a/share/translations/keepassxc_en_US.ts b/share/translations/keepassxc_en_US.ts
index 75fcf9e92..609e6f0f0 100644
--- a/share/translations/keepassxc_en_US.ts
+++ b/share/translations/keepassxc_en_US.ts
@@ -3150,6 +3150,14 @@ Would you like to correct it?
Reveal
Reveal
+
+ Copy
+ Copy
+
+
+ Copy text into clipboard
+ Copy text into clipboard
+
Attachments
Attachments
@@ -10671,4 +10679,4 @@ Example: JBSWY3DPEHPK3PXP
Unknown
-
\ No newline at end of file
+
diff --git a/src/gui/entry/EditEntryWidget.cpp b/src/gui/entry/EditEntryWidget.cpp
index 2a1dde612..d4ad9bc11 100644
--- a/src/gui/entry/EditEntryWidget.cpp
+++ b/src/gui/entry/EditEntryWidget.cpp
@@ -246,6 +246,7 @@ void EditEntryWidget::setupAdvanced()
connect(m_advancedUi->removeAttributeButton, SIGNAL(clicked()), SLOT(removeCurrentAttribute()));
connect(m_advancedUi->protectAttributeButton, SIGNAL(toggled(bool)), SLOT(protectCurrentAttribute(bool)));
connect(m_advancedUi->revealAttributeButton, SIGNAL(clicked(bool)), SLOT(toggleCurrentAttributeVisibility()));
+ connect(m_advancedUi->copyTextButton, SIGNAL(clicked(bool)), SLOT(copyAttributeText()));
connect(m_advancedUi->attributesView->selectionModel(),
SIGNAL(currentChanged(QModelIndex,QModelIndex)),
SLOT(updateCurrentAttribute()));
@@ -989,6 +990,7 @@ void EditEntryWidget::setForms(Entry* entry, bool restore)
m_advancedUi->addAttributeButton->setEnabled(!m_history);
m_advancedUi->editAttributeButton->setEnabled(false);
m_advancedUi->removeAttributeButton->setEnabled(false);
+ m_advancedUi->copyTextButton->setEnabled(false);
m_advancedUi->attributesEdit->setReadOnly(m_history);
QAbstractItemView::EditTriggers editTriggers;
if (m_history) {
@@ -1518,12 +1520,15 @@ void EditEntryWidget::displayAttribute(QModelIndex index, bool showProtected)
m_advancedUi->protectAttributeButton->setEnabled(!m_history);
m_advancedUi->editAttributeButton->setEnabled(!m_history);
m_advancedUi->removeAttributeButton->setEnabled(!m_history);
+
+ m_advancedUi->copyTextButton->setEnabled(true);
} else {
m_advancedUi->attributesEdit->setPlainText("");
m_advancedUi->attributesEdit->setEnabled(false);
m_advancedUi->revealAttributeButton->setEnabled(false);
m_advancedUi->protectAttributeButton->setChecked(false);
m_advancedUi->protectAttributeButton->setEnabled(false);
+ m_advancedUi->copyTextButton->setEnabled(false);
m_advancedUi->editAttributeButton->setEnabled(false);
m_advancedUi->removeAttributeButton->setEnabled(false);
}
@@ -1568,6 +1573,22 @@ void EditEntryWidget::toggleCurrentAttributeVisibility()
}
}
+void EditEntryWidget::copyAttributeText()
+{
+ QString value;
+ if (m_advancedUi->attributesEdit->isEnabled()) {
+ value = m_advancedUi->attributesEdit->toPlainText();
+ } else {
+ QModelIndex index = m_advancedUi->attributesView->currentIndex();
+ if (index.isValid()) {
+ QString key = m_attributesModel->keyByIndex(index);
+ value = m_entryAttributes->value(key);
+ }
+ }
+
+ clipboard()->setText(value);
+}
+
void EditEntryWidget::updateAutoTypeEnabled()
{
bool autoTypeEnabled = m_autoTypeUi->enableButton->isChecked();
diff --git a/src/gui/entry/EditEntryWidget.h b/src/gui/entry/EditEntryWidget.h
index 3fce4d56d..ba5a4e307 100644
--- a/src/gui/entry/EditEntryWidget.h
+++ b/src/gui/entry/EditEntryWidget.h
@@ -107,6 +107,7 @@ private slots:
void updateCurrentAttribute();
void protectCurrentAttribute(bool state);
void toggleCurrentAttributeVisibility();
+ void copyAttributeText();
void updateAutoTypeEnabled();
void openAutotypeHelp();
void insertAutoTypeAssoc();
diff --git a/src/gui/entry/EditEntryWidgetAdvanced.ui b/src/gui/entry/EditEntryWidgetAdvanced.ui
index 044145226..e13c3c275 100644
--- a/src/gui/entry/EditEntryWidgetAdvanced.ui
+++ b/src/gui/entry/EditEntryWidgetAdvanced.ui
@@ -32,7 +32,7 @@
-
- Qt::Horizontal
+ Qt::Orientation::Horizontal
false
@@ -48,10 +48,10 @@
Attribute selection
- QAbstractScrollArea::AdjustToContents
+ QAbstractScrollArea::SizeAdjustPolicy::AdjustToContents
- QListView::Adjust
+ QListView::ResizeMode::Adjust
@@ -117,7 +117,7 @@
-
- Qt::Vertical
+ Qt::Orientation::Vertical
@@ -146,6 +146,16 @@
+ -
+
+
+ Copy text into clipboard
+
+
+ Copy
+
+
+
-
@@ -236,10 +246,10 @@
-
- Qt::Horizontal
+ Qt::Orientation::Horizontal
- QSizePolicy::Maximum
+ QSizePolicy::Policy::Maximum
@@ -284,7 +294,7 @@
-
- Qt::Horizontal
+ Qt::Orientation::Horizontal