diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 8d35bc9e3b..10278debc9 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -286,7 +286,7 @@ MainWindow::MainWindow() m_actionMultiplexer.connect(m_ui->actionEntrySetupTotp, SIGNAL(triggered()), SLOT(setupTotp())); m_actionMultiplexer.connect(m_ui->actionEntryCopyTotp, SIGNAL(triggered()), SLOT(copyTotp())); - m_actionMultiplexer.connect(m_ui->actionEntryTotpDisplayKey, SIGNAL(triggered()), SLOT(showTotpKeyQrCode())); + m_actionMultiplexer.connect(m_ui->actionEntryTotpQRCode, SIGNAL(triggered()), SLOT(showTotpKeyQrCode())); m_actionMultiplexer.connect(m_ui->actionEntryCopyTitle, SIGNAL(triggered()), SLOT(copyTitle())); m_actionMultiplexer.connect(m_ui->actionEntryCopyUsername, SIGNAL(triggered()), SLOT(copyUsername())); m_actionMultiplexer.connect(m_ui->actionEntryCopyPassword, SIGNAL(triggered()), SLOT(copyPassword())); @@ -479,7 +479,7 @@ void MainWindow::setMenuActionState(DatabaseWidget::Mode mode) m_ui->actionEntryTotp->setEnabled(singleEntrySelected && dbWidget->currentEntryHasTotp()); m_ui->actionEntryCopyTotp->setEnabled(singleEntrySelected && dbWidget->currentEntryHasTotp()); m_ui->actionEntrySetupTotp->setEnabled(singleEntrySelected); - m_ui->actionEntryTotpDisplayKey->setEnabled(singleEntrySelected && dbWidget->currentEntryHasTotp()); + m_ui->actionEntryTotpQRCode->setEnabled(singleEntrySelected && dbWidget->currentEntryHasTotp()); m_ui->actionGroupNew->setEnabled(groupSelected); m_ui->actionGroupEdit->setEnabled(groupSelected); m_ui->actionGroupDelete->setEnabled(groupSelected && dbWidget->canDeleteCurrentGroup()); diff --git a/src/gui/MainWindow.ui b/src/gui/MainWindow.ui index 15982a4fdb..a0b310007b 100644 --- a/src/gui/MainWindow.ui +++ b/src/gui/MainWindow.ui @@ -252,7 +252,7 @@ - + @@ -584,12 +584,12 @@ - Show TOTP + Show TOTP... - + - Export TOTP settings + Show TOTP QR Code... diff --git a/src/gui/SquareSvgWidget.cpp b/src/gui/SquareSvgWidget.cpp index 004fd54a8a..5a907e95bf 100644 --- a/src/gui/SquareSvgWidget.cpp +++ b/src/gui/SquareSvgWidget.cpp @@ -17,9 +17,6 @@ #include "SquareSvgWidget.h" -SquareSvgWidget::SquareSvgWidget() = default; -SquareSvgWidget::~SquareSvgWidget() = default; - bool SquareSvgWidget::hasHeightForWidth() const { return true; diff --git a/src/gui/SquareSvgWidget.h b/src/gui/SquareSvgWidget.h index 7897ddf37b..3fcbbbffba 100644 --- a/src/gui/SquareSvgWidget.h +++ b/src/gui/SquareSvgWidget.h @@ -18,13 +18,13 @@ #ifndef KEEPASSX_SquareSvgWidget_H #define KEEPASSX_SquareSvgWidget_H -#include +#include class SquareSvgWidget : public QSvgWidget { public: - SquareSvgWidget(); - ~SquareSvgWidget(); + SquareSvgWidget() = default; + ~SquareSvgWidget() override = default; bool hasHeightForWidth() const override; int heightForWidth(int width) const override; diff --git a/src/gui/TotpExportSettingsDialog.cpp b/src/gui/TotpExportSettingsDialog.cpp index a521bd75b5..bdeae30c79 100644 --- a/src/gui/TotpExportSettingsDialog.cpp +++ b/src/gui/TotpExportSettingsDialog.cpp @@ -30,7 +30,6 @@ #include #include #include -//#include #include TotpExportSettingsDialog::TotpExportSettingsDialog(DatabaseWidget* parent, Entry* entry) @@ -44,14 +43,9 @@ TotpExportSettingsDialog::TotpExportSettingsDialog(DatabaseWidget* parent, Entry { m_verticalLayout->addItem(new QSpacerItem(0, 0)); - auto horizontalLayout = new QHBoxLayout(); - horizontalLayout->addItem(new QSpacerItem(0, 0)); - horizontalLayout->addWidget(m_totpSvgWidget); - horizontalLayout->addItem(new QSpacerItem(0, 0)); - - m_verticalLayout->addItem(horizontalLayout); - m_verticalLayout->addItem(new QSpacerItem(0, 0)); - + m_verticalLayout->addStretch(0); + m_verticalLayout->addWidget(m_totpSvgWidget); + m_verticalLayout->addStretch(0); m_verticalLayout->addWidget(m_countDown); m_verticalLayout->addWidget(m_buttonBox); @@ -79,17 +73,10 @@ TotpExportSettingsDialog::TotpExportSettingsDialog(DatabaseWidget* parent, Entry if (qrc.isValid()) { QBuffer buffer; - qrc.writeSvg(&buffer, this->logicalDpiX()); + qrc.writeSvg(&buffer, logicalDpiX()); m_totpSvgWidget->load(buffer.data()); - - const int threeInches = this->logicalDpiX() * 3; - const int fourInches = this->logicalDpiX() * 4; - const QSizePolicy sizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); - - m_totpSvgWidget->resize(QSize(threeInches, threeInches)); - m_totpSvgWidget->setSizePolicy(sizePolicy); - setMinimumSize(QSize(threeInches, fourInches)); - setSizePolicy(sizePolicy); + const int minsize = static_cast(logicalDpiX() * 2.5); + m_totpSvgWidget->setMinimumSize(minsize, minsize); } else { auto errorBox = new QMessageBox(parent); errorBox->setAttribute(Qt::WA_DeleteOnClose);