aboutsummaryrefslogtreecommitdiffstats
path: root/keydetailsdialog.cpp
diff options
context:
space:
mode:
authorubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910>2012-01-08 02:44:08 +0000
committerubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910>2012-01-08 02:44:08 +0000
commita9997b0a135917abe4113ebb50229afd30945ff0 (patch)
tree356fb32e01094408fe4cf0c60ba68126a5c07829 /keydetailsdialog.cpp
parentdo not use formatGpgHeader() yet. needs some more care before production use. (diff)
downloadgpg4usb-a9997b0a135917abe4113ebb50229afd30945ff0.tar.gz
gpg4usb-a9997b0a135917abe4113ebb50229afd30945ff0.zip
add copyFingerprint button to detailsdialog
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@733 34ebc366-c3a9-4b3c-9f84-69acf7962910
Diffstat (limited to 'keydetailsdialog.cpp')
-rw-r--r--keydetailsdialog.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/keydetailsdialog.cpp b/keydetailsdialog.cpp
index 0e97da9..a4ede02 100644
--- a/keydetailsdialog.cpp
+++ b/keydetailsdialog.cpp
@@ -116,8 +116,21 @@ KeyDetailsDialog::KeyDetailsDialog(GpgME::GpgContext* ctx, gpgme_key_t key, QWid
vboxFP = new QVBoxLayout();
fingerPrintVarLabel = new QLabel(beautifyFingerprint(key->subkeys->fpr));
fingerPrintVarLabel->setTextInteractionFlags(Qt::TextSelectableByMouse);
- vboxFP->addWidget(fingerPrintVarLabel);
- fingerprintBox->setLayout(vboxFP);
+ fingerPrintVarLabel->setStyleSheet("margin-left: 20; margin-right: 20;");
+ QHBoxLayout *hboxFP = new QHBoxLayout();
+
+ hboxFP->addWidget(fingerPrintVarLabel);
+ QIcon ico(":/button_copy.png");
+
+ QPushButton copyFingerprintButton(QIcon(ico.pixmap(12, 12)), "");
+ //copyFingerprintButton.setStyleSheet("QPushButton {border: 0px; } QPushButton:Pressed {} ");
+ copyFingerprintButton.setFlat(true);
+ copyFingerprintButton.setToolTip(tr("copy fingerprint to clipboard"));
+ connect(&copyFingerprintButton, SIGNAL(clicked()), this, SLOT(copyFingerprint()));
+
+ hboxFP->addWidget(&copyFingerprintButton);
+
+ fingerprintBox->setLayout(hboxFP);
mvbox->addWidget(fingerprintBox);
// If key has more than primary uid, also show the other uids
@@ -211,3 +224,9 @@ QString KeyDetailsDialog::beautifyFingerprint(QString fingerprint)
fingerprint.insert(5 * n + 4, ' ');
return fingerprint;
}
+
+void KeyDetailsDialog::copyFingerprint() {
+ QString fpr = fingerPrintVarLabel->text().trimmed().replace(" ", "");
+ QClipboard *cb = QApplication::clipboard();
+ cb->setText(fpr);
+}