mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-12-03 04:45:19 -05:00
Add QR code generator for TOTP export (#1167)
* Resolves #764 * Add libqrencode and qtsvg dependencies * Ensure QR code remains square * Auto-close QR code dialog when database is locked * Add databaseLocked() Signal to databaseWidget * Correct otpauth URI output in Totp::writeSettings(...)
This commit is contained in:
parent
80749958b7
commit
bb16dc6d01
21 changed files with 584 additions and 16 deletions
|
|
@ -49,6 +49,7 @@
|
|||
#include "gui/MessageBox.h"
|
||||
#include "gui/TotpSetupDialog.h"
|
||||
#include "gui/TotpDialog.h"
|
||||
#include "gui/TotpExportSettingsDialog.h"
|
||||
#include "gui/UnlockDatabaseDialog.h"
|
||||
#include "gui/UnlockDatabaseWidget.h"
|
||||
#include "gui/entry/EditEntryWidget.h"
|
||||
|
|
@ -572,6 +573,18 @@ void DatabaseWidget::copyAttribute(QAction* action)
|
|||
currentEntry->resolveMultiplePlaceholders(currentEntry->attributes()->value(action->data().toString())));
|
||||
}
|
||||
|
||||
void DatabaseWidget::showTotpKeyQrCode()
|
||||
{
|
||||
Entry* currentEntry = m_entryView->currentEntry();
|
||||
Q_ASSERT(currentEntry);
|
||||
if (!currentEntry) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto totpDisplayDialog = new TotpExportSettingsDialog(this, currentEntry);
|
||||
totpDisplayDialog->open();
|
||||
}
|
||||
|
||||
void DatabaseWidget::setClipboardTextAndMinimize(const QString& text)
|
||||
{
|
||||
clipboard()->setText(text);
|
||||
|
|
@ -1171,6 +1184,7 @@ void DatabaseWidget::lock()
|
|||
Database* newDb = new Database();
|
||||
newDb->metadata()->setName(m_db->metadata()->name());
|
||||
replaceDatabase(newDb);
|
||||
emit lockedDatabase();
|
||||
}
|
||||
|
||||
void DatabaseWidget::updateFilePath(const QString& filePath)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue