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:
committed by
Jonathan White
parent
80749958b7
commit
bb16dc6d01
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user