Expose version of used libraries in the About dialog.

This commit is contained in:
Felix Geyer 2015-10-10 17:02:43 +02:00
parent 58ed99d562
commit 316a7e6fb7
4 changed files with 23 additions and 1 deletions

View File

@ -27,6 +27,7 @@
bool Crypto::m_initalized(false);
QString Crypto::m_errorStr;
QString Crypto::m_backendVersion;
#if !defined(GCRYPT_VERSION_NUMBER) || (GCRYPT_VERSION_NUMBER < 0x010600)
static int gcry_qt_mutex_init(void** p_sys)
@ -80,7 +81,7 @@ bool Crypto::init()
#if !defined(GCRYPT_VERSION_NUMBER) || (GCRYPT_VERSION_NUMBER < 0x010600)
gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_qt);
#endif
gcry_check_version(0);
m_backendVersion = QString::fromLocal8Bit(gcry_check_version(0));
gcry_control(GCRYCTL_INITIALIZATION_FINISHED, 0);
if (!checkAlgorithms()) {
@ -108,6 +109,11 @@ QString Crypto::errorString()
return m_errorStr;
}
QString Crypto::backendVersion()
{
return QString("libgcrypt ").append(m_backendVersion);
}
bool Crypto::backendSelfTest()
{
return (gcry_control(GCRYCTL_SELFTEST) == 0);

View File

@ -29,6 +29,7 @@ public:
static bool initalized();
static bool backendSelfTest();
static QString errorString();
static QString backendVersion();
private:
Crypto();
@ -43,6 +44,7 @@ private:
static bool m_initalized;
static QString m_errorStr;
static QString m_backendVersion;
};
#endif // KEEPASSX_CRYPTO_H

View File

@ -21,6 +21,7 @@
#include "config-keepassx.h"
#include "version.h"
#include "core/FilePath.h"
#include "crypto/Crypto.h"
AboutDialog::AboutDialog(QWidget* parent)
: QDialog(parent)
@ -49,6 +50,12 @@ AboutDialog::AboutDialog(QWidget* parent)
m_ui->label_git->setText(labelText);
}
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);
setAttribute(Qt::WA_DeleteOnClose);
connect(m_ui->buttonBox, SIGNAL(rejected()), SLOT(close()));
}

View File

@ -86,6 +86,13 @@
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_libs">
<property name="text">
<string>Using:</string>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">