Dialog showing an ASCII-armored public GPG key for sharing.
More...
#include <exportpublickeydialog.h>
|
| static auto | sanitizeKeyIdForFilename (const QString &keyId) -> QString |
| | Reduce a key identifier to a filesystem-safe token.
|
|
| void | on_copyButton_clicked () |
| | Copy the armored key text to the system clipboard; the button reads "Copied!" for 1.5 s as feedback. Public keys are not secrets, so this bypasses ClipboardManager and its autoclear.
|
| void | on_saveButton_clicked () |
| | Prompt for a destination and write the armored key to that file through a QSaveFile. The suggested name is <sanitizeKeyIdForFilename(keyId)>.asc, or public_key.asc when nothing of the key id survives. Failures are reported in a warning box.
|
|
| QScopedPointer< Ui::ExportPublicKeyDialog > | ui |
| | Generated form (exportpublickeydialog.ui); owned.
|
| QString | m_keyId |
| | Key id as passed to the constructor; the basis of the suggested file name.
|
| QString | m_copyButtonOriginalText |
| | The copy button's label from the form, restored after the "Copied!" flash.
|
Dialog showing an ASCII-armored public GPG key for sharing.
Displays the armored key text and offers Copy-to-Clipboard and Save-to-File actions so the user can hand the key to teammates.
Definition at line 27 of file exportpublickeydialog.h.
◆ ExportPublicKeyDialog()
| ExportPublicKeyDialog::ExportPublicKeyDialog |
( |
const QString & | keyId, |
|
|
const QString & | armoredKey, |
|
|
QWidget * | parent = nullptr ) |
|
explicit |
Construct an ExportPublicKeyDialog.
- Parameters
-
| keyId | GPG key identifier or fingerprint shown in the header and used as the default file name when saving. |
| armoredKey | ASCII-armored public key text to display. |
| parent | Optional parent widget. |
Definition at line 22 of file exportpublickeydialog.cpp.
◆ ~ExportPublicKeyDialog()
| ExportPublicKeyDialog::~ExportPublicKeyDialog |
( |
| ) |
|
|
overridedefault |
Destroys the dialog and its generated UI.
◆ on_copyButton_clicked
| void ExportPublicKeyDialog::on_copyButton_clicked |
( |
| ) |
|
|
privateslot |
Copy the armored key text to the system clipboard; the button reads "Copied!" for 1.5 s as feedback. Public keys are not secrets, so this bypasses ClipboardManager and its autoclear.
Definition at line 49 of file exportpublickeydialog.cpp.
◆ on_saveButton_clicked
| void ExportPublicKeyDialog::on_saveButton_clicked |
( |
| ) |
|
|
privateslot |
Prompt for a destination and write the armored key to that file through a QSaveFile. The suggested name is <sanitizeKeyIdForFilename(keyId)>.asc, or public_key.asc when nothing of the key id survives. Failures are reported in a warning box.
Definition at line 57 of file exportpublickeydialog.cpp.
◆ sanitizeKeyIdForFilename()
| auto ExportPublicKeyDialog::sanitizeKeyIdForFilename |
( |
const QString & | keyId | ) |
-> QString |
|
static |
Reduce a key identifier to a filesystem-safe token.
- Parameters
-
| keyId | Raw identifier, possibly containing whitespace-separated IDs or characters not valid in a filename. |
- Returns
- The first whitespace-separated token of keyId with anything outside [A-Za-z0-9_-] stripped. Empty if no characters survive.
Definition at line 36 of file exportpublickeydialog.cpp.
◆ m_copyButtonOriginalText
| QString ExportPublicKeyDialog::m_copyButtonOriginalText |
|
private |
The copy button's label from the form, restored after the "Copied!" flash.
Definition at line 77 of file exportpublickeydialog.h.
◆ m_keyId
| QString ExportPublicKeyDialog::m_keyId |
|
private |
Key id as passed to the constructor; the basis of the suggested file name.
Definition at line 74 of file exportpublickeydialog.h.
◆ ui
| QScopedPointer<Ui::ExportPublicKeyDialog> ExportPublicKeyDialog::ui |
|
private |
The documentation for this class was generated from the following files: