2012-05-02 09:37:21 -04:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2012 Felix Geyer <debfx@fobos.de>
|
2017-06-09 17:40:36 -04:00
|
|
|
* Copyright (C) 2017 KeePassXC Team <team@keepassxc.org>
|
2012-05-02 09:37:21 -04:00
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 2 or (at your option)
|
|
|
|
* version 3 of the License.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "AboutDialog.h"
|
|
|
|
#include "ui_AboutDialog.h"
|
|
|
|
|
|
|
|
#include "config-keepassx.h"
|
2012-07-18 14:44:28 -04:00
|
|
|
#include "core/FilePath.h"
|
2015-10-10 11:02:43 -04:00
|
|
|
#include "crypto/Crypto.h"
|
2018-03-31 16:01:30 -04:00
|
|
|
#include "version.h"
|
2012-05-02 09:37:21 -04:00
|
|
|
|
2017-02-22 18:45:57 -05:00
|
|
|
#include <QClipboard>
|
|
|
|
#include <QSysInfo>
|
|
|
|
|
2012-05-02 09:37:21 -04:00
|
|
|
AboutDialog::AboutDialog(QWidget* parent)
|
2019-01-16 22:53:29 -05:00
|
|
|
: QDialog(parent)
|
|
|
|
, m_ui(new Ui::AboutDialog())
|
2012-05-02 09:37:21 -04:00
|
|
|
{
|
2019-01-16 22:53:29 -05:00
|
|
|
m_ui->setupUi(this);
|
2012-05-02 10:21:59 -04:00
|
|
|
|
2019-01-16 22:53:29 -05:00
|
|
|
resize(minimumSize());
|
|
|
|
setWindowFlags(Qt::Sheet);
|
|
|
|
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
2017-02-24 18:27:51 -05:00
|
|
|
|
2019-01-16 22:53:29 -05:00
|
|
|
m_ui->nameLabel->setText(m_ui->nameLabel->text().replace("${VERSION}", KEEPASSXC_VERSION));
|
|
|
|
QFont nameLabelFont = m_ui->nameLabel->font();
|
|
|
|
nameLabelFont.setPointSize(nameLabelFont.pointSize() + 4);
|
|
|
|
m_ui->nameLabel->setFont(nameLabelFont);
|
2012-05-02 09:37:21 -04:00
|
|
|
|
2019-01-16 22:53:29 -05:00
|
|
|
m_ui->iconLabel->setPixmap(filePath()->applicationIcon().pixmap(48));
|
2012-05-02 10:21:59 -04:00
|
|
|
|
2019-01-16 22:53:29 -05:00
|
|
|
QString commitHash;
|
|
|
|
if (!QString(GIT_HEAD).isEmpty()) {
|
|
|
|
commitHash = GIT_HEAD;
|
|
|
|
} else if (!QString(DIST_HASH).contains("Format")) {
|
|
|
|
commitHash = DIST_HASH;
|
|
|
|
}
|
2015-07-18 03:05:26 -04:00
|
|
|
|
2019-01-16 22:53:29 -05:00
|
|
|
QString debugInfo = "KeePassXC - ";
|
|
|
|
debugInfo.append(tr("Version %1").arg(KEEPASSXC_VERSION).append("\n"));
|
2018-02-17 11:46:19 -05:00
|
|
|
#ifndef KEEPASSXC_BUILD_TYPE_RELEASE
|
2019-01-16 22:53:29 -05:00
|
|
|
debugInfo.append(tr("Build Type: %1").arg(KEEPASSXC_BUILD_TYPE).append("\n"));
|
2017-11-27 22:46:03 -05:00
|
|
|
#endif
|
2019-01-16 22:53:29 -05:00
|
|
|
if (!commitHash.isEmpty()) {
|
|
|
|
debugInfo.append(tr("Revision: %1").arg(commitHash.left(7)).append("\n"));
|
|
|
|
}
|
2015-07-18 03:05:26 -04:00
|
|
|
|
2017-10-16 11:47:19 -04:00
|
|
|
#ifdef KEEPASSXC_DIST
|
2019-01-16 22:53:29 -05:00
|
|
|
debugInfo.append(tr("Distribution: %1").arg(KEEPASSXC_DIST_TYPE).append("\n"));
|
2017-10-16 11:47:19 -04:00
|
|
|
#endif
|
|
|
|
|
2019-01-16 22:53:29 -05:00
|
|
|
debugInfo.append("\n").append(
|
|
|
|
QString("%1\n- Qt %2\n- %3\n\n")
|
|
|
|
.arg(tr("Libraries:"), QString::fromLocal8Bit(qVersion()), Crypto::backendVersion()));
|
2017-02-22 18:45:57 -05:00
|
|
|
|
2017-02-22 19:08:26 -05:00
|
|
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
|
2019-01-16 22:53:29 -05:00
|
|
|
debugInfo.append(tr("Operating system: %1\nCPU architecture: %2\nKernel: %3 %4")
|
|
|
|
.arg(QSysInfo::prettyProductName(),
|
|
|
|
QSysInfo::currentCpuArchitecture(),
|
|
|
|
QSysInfo::kernelType(),
|
|
|
|
QSysInfo::kernelVersion()));
|
2017-02-22 18:45:57 -05:00
|
|
|
|
2019-01-16 22:53:29 -05:00
|
|
|
debugInfo.append("\n\n");
|
2017-02-22 19:08:26 -05:00
|
|
|
#endif
|
2015-10-10 11:02:43 -04:00
|
|
|
|
2019-01-16 22:53:29 -05:00
|
|
|
QString extensions;
|
2016-12-07 22:40:09 -05:00
|
|
|
#ifdef WITH_XC_AUTOTYPE
|
2019-01-16 22:53:29 -05:00
|
|
|
extensions += "\n- " + tr("Auto-Type");
|
2016-12-07 22:40:09 -05:00
|
|
|
#endif
|
2018-01-16 18:56:47 -05:00
|
|
|
#ifdef WITH_XC_BROWSER
|
2019-01-16 22:53:29 -05:00
|
|
|
extensions += "\n- " + tr("Browser Integration");
|
2018-01-16 18:56:47 -05:00
|
|
|
#endif
|
2017-10-29 11:17:24 -04:00
|
|
|
#ifdef WITH_XC_SSHAGENT
|
2019-01-16 22:53:29 -05:00
|
|
|
extensions += "\n- " + tr("SSH Agent");
|
2017-10-29 11:17:24 -04:00
|
|
|
#endif
|
2019-01-03 02:46:32 -05:00
|
|
|
#if defined(WITH_XC_KEESHARE_SECURE) && defined(WITH_XC_KEESHARE_INSECURE)
|
2019-01-16 22:53:29 -05:00
|
|
|
extensions += "\n- " + tr("KeeShare (signed and unsigned sharing)");
|
2019-01-03 02:46:32 -05:00
|
|
|
#elif defined(WITH_XC_KEESHARE_SECURE)
|
2019-01-16 22:53:29 -05:00
|
|
|
extensions += "\n- " + tr("KeeShare (only signed sharing)");
|
2019-01-03 02:46:32 -05:00
|
|
|
#elif defined(WITH_XC_KEESHARE_INSECURE)
|
2019-01-16 22:53:29 -05:00
|
|
|
extensions += "\n- " + tr("KeeShare (only unsigned sharing)");
|
2018-10-01 10:26:24 -04:00
|
|
|
#endif
|
2018-01-16 18:56:47 -05:00
|
|
|
#ifdef WITH_XC_YUBIKEY
|
2019-01-16 22:53:29 -05:00
|
|
|
extensions += "\n- " + tr("YubiKey");
|
2017-12-12 03:15:23 -05:00
|
|
|
#endif
|
2018-04-04 11:39:26 -04:00
|
|
|
#ifdef WITH_XC_TOUCHID
|
2019-01-16 22:53:29 -05:00
|
|
|
extensions += "\n- " + tr("TouchID");
|
2018-04-04 11:39:26 -04:00
|
|
|
#endif
|
2016-12-07 22:40:09 -05:00
|
|
|
|
2019-01-16 22:53:29 -05:00
|
|
|
if (extensions.isEmpty())
|
|
|
|
extensions = " " + tr("None");
|
2017-02-22 18:45:57 -05:00
|
|
|
|
2019-01-16 22:53:29 -05:00
|
|
|
debugInfo.append(tr("Enabled extensions:").append(extensions));
|
2016-12-07 22:40:09 -05:00
|
|
|
|
2019-01-16 22:53:29 -05:00
|
|
|
m_ui->debugInfo->setPlainText(debugInfo);
|
2016-12-07 22:40:09 -05:00
|
|
|
|
2019-01-16 22:53:29 -05:00
|
|
|
setAttribute(Qt::WA_DeleteOnClose);
|
|
|
|
connect(m_ui->buttonBox, SIGNAL(rejected()), SLOT(close()));
|
|
|
|
connect(m_ui->copyToClipboard, SIGNAL(clicked()), SLOT(copyToClipboard()));
|
2012-05-02 09:37:21 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
AboutDialog::~AboutDialog()
|
|
|
|
{
|
|
|
|
}
|
2017-02-22 18:45:57 -05:00
|
|
|
|
|
|
|
void AboutDialog::copyToClipboard()
|
|
|
|
{
|
2019-01-16 22:53:29 -05:00
|
|
|
QClipboard* clipboard = QApplication::clipboard();
|
|
|
|
clipboard->setText(m_ui->debugInfo->toPlainText());
|
2017-02-22 18:45:57 -05:00
|
|
|
}
|