From 1d79d342c0af7436255d56e845def02ec8854ba0 Mon Sep 17 00:00:00 2001 From: Janek Bevendorff Date: Thu, 23 Feb 2017 00:45:57 +0100 Subject: [PATCH] Rework About dialog --- src/gui/AboutDialog.cpp | 50 +++++++--- src/gui/AboutDialog.h | 3 + src/gui/AboutDialog.ui | 198 ++++++++++++++++++++++++++-------------- 3 files changed, 169 insertions(+), 82 deletions(-) diff --git a/src/gui/AboutDialog.cpp b/src/gui/AboutDialog.cpp index a4f180b0..1f4cda9a 100644 --- a/src/gui/AboutDialog.cpp +++ b/src/gui/AboutDialog.cpp @@ -23,15 +23,17 @@ #include "core/FilePath.h" #include "crypto/Crypto.h" +#include +#include + AboutDialog::AboutDialog(QWidget* parent) - : QDialog(parent) - , m_ui(new Ui::AboutDialog()) + : QDialog(parent), + m_ui(new Ui::AboutDialog()) { m_ui->setupUi(this); m_ui->nameLabel->setText(m_ui->nameLabel->text() + " " + KEEPASSX_VERSION); QFont nameLabelFont = m_ui->nameLabel->font(); - nameLabelFont.setBold(true); nameLabelFont.setPointSize(nameLabelFont.pointSize() + 4); m_ui->nameLabel->setFont(nameLabelFont); @@ -45,37 +47,55 @@ AboutDialog::AboutDialog(QWidget* parent) commitHash = DIST_HASH; } + QString debugInfo = "KeePassXC - "; + debugInfo.append(tr("Version %1\n").arg(KEEPASSX_VERSION)); if (!commitHash.isEmpty()) { - QString labelText = tr("Revision").append(": ").append(commitHash); - m_ui->label_git->setText(labelText); + debugInfo.append(tr("Revision: %1").arg(commitHash).append("\n\n")); } - QString libs = QString("%1\n- Qt %2\n- %3") - .arg(m_ui->label_libs->text()) - .arg(QString::fromLocal8Bit(qVersion())) - .arg(Crypto::backendVersion()); - m_ui->label_libs->setText(libs); + debugInfo.append(QString("%1\n- Qt %2\n- %3\n\n") + .arg(tr("Libraries:")) + .arg(QString::fromLocal8Bit(qVersion())) + .arg(Crypto::backendVersion())); + + debugInfo.append(tr("Operating system: %1 (version: %2)\nCPU architecture: %3\nKernel: %4 %5") + .arg(QSysInfo::prettyProductName()) + .arg(QSysInfo::productVersion()) + .arg(QSysInfo::currentCpuArchitecture()) + .arg(QSysInfo::kernelType()) + .arg(QSysInfo::kernelVersion())); + + debugInfo.append("\n\n"); QString extensions; #ifdef WITH_XC_HTTP - extensions += "- KeePassHTTP\n"; + extensions += "\n- KeePassHTTP"; #endif #ifdef WITH_XC_AUTOTYPE - extensions += "- Autotype\n"; + extensions += "\n- Auto-Type"; #endif #ifdef WITH_XC_YUBIKEY - extensions += "- Yubikey\n"; + extensions += "\n- YubiKey"; #endif if (extensions.isEmpty()) - extensions = "None"; + extensions = " None"; - m_ui->label_features->setText(m_ui->label_features->text() + extensions); + debugInfo.append(tr("Enabled extensions:").append(extensions)); + + m_ui->debugInfo->setPlainText(debugInfo); setAttribute(Qt::WA_DeleteOnClose); connect(m_ui->buttonBox, SIGNAL(rejected()), SLOT(close())); + connect(m_ui->copyToClipboard, SIGNAL(clicked()), SLOT(copyToClipboard())); } AboutDialog::~AboutDialog() { } + +void AboutDialog::copyToClipboard() +{ + QClipboard* clipboard = QApplication::clipboard(); + clipboard->setText(m_ui->debugInfo->toPlainText()); +} diff --git a/src/gui/AboutDialog.h b/src/gui/AboutDialog.h index 08db6c88..b69a14db 100644 --- a/src/gui/AboutDialog.h +++ b/src/gui/AboutDialog.h @@ -33,6 +33,9 @@ public: explicit AboutDialog(QWidget* parent = nullptr); ~AboutDialog(); +protected slots: + void copyToClipboard(); + private: QScopedPointer m_ui; }; diff --git a/src/gui/AboutDialog.ui b/src/gui/AboutDialog.ui index 28f4dd0c..baabb52e 100644 --- a/src/gui/AboutDialog.ui +++ b/src/gui/AboutDialog.ui @@ -6,20 +6,23 @@ 0 0 - 455 - 266 + 479 + 488 About KeePassXC - - - QLayout::SetFixedSize - + - + + 15 + + + 20 + + @@ -27,9 +30,21 @@ 0 + + + 48 + 48 + + + + + 48 + 48 + + - + @@ -37,6 +52,12 @@ 0 + + + 75 + true + + KeePassXC @@ -45,66 +66,109 @@ - - - - 0 - 0 - - - - <a href="https://keepassxc.org/">https://keepassxc.org/</a> - - - true - - - - - - - - 0 - 0 - - - - KeePassXC is distributed under the terms of the GNU General Public License (GPL) version 2 or (at your option) version 3. - - - true - - - - - - - - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - Using: - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse - - - - - - - Extensions: - - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + 0 + + + About + + + + + + <html><head/><body><p>Website: <a href="https://keepassxc.org/"><span style=" text-decoration: underline; color:#007af4;">https://keepassxc.org/</span></a></p></body> +Report bugs at: <a href="https://github.com/keepassxreboot/keepassxc/issues">https://github.com/</a></html> + + + true + + + + + + + KeePassXC is distributed under the terms of the GNU General Public License (GPL) version 2 or (at your option) version 3. + + + true + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 0 + 10 + + + + + + + + <html><head/><body><div>Main contributors: +<ul> +<li>debfx (KeePassX)</li> +<li>droidmonkey</li> +<li>louib</li> +<li>phoerious<li> +<li>thezero</li> +</div></body></html> + + + + + + + Qt::Vertical + + + + 0 + 0 + + + + + + + + + Debug Info + + + + + + Include the following information whenever you report a bug: + + + + + + + true + + + + + + + Copy to clipboard + + + + +