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

View File

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

View File

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

View File

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