Skip to content

Commit

Permalink
Add wolfSSL version to the About dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
datadiode committed Apr 24, 2023
1 parent f06b275 commit 693c785
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
21 changes: 20 additions & 1 deletion src/aboutdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,21 @@
#include <qtwebkitversion.h>
#include <qwebkitglobal.h>

#ifdef Q_OS_WIN
#include <windows.h>
#include "VersionData.h"
static QString qWolfSSLVersion()
{
QString version;
if (HMODULE const h = GetModuleHandleW(L"wolfssl.dll"))
if (CVersionData const *const pvd = CVersionData::Load(h)->Find(L"StringFileInfo")->First()->Find(L"ProductVersion"))
version = QString::fromUtf16(reinterpret_cast<const ushort *>(pvd->Data()));
return version;
}
#else
typedef QString qWolfSSLVersion;
#endif

AboutDialog::AboutDialog(QWidget *parent)
: QDialog(parent)
{
Expand All @@ -38,7 +53,11 @@ AboutDialog::AboutDialog(QWidget *parent)
logo->setPixmap(qApp->windowIcon().pixmap(128, 128));
name->setText(qApp->applicationName());
version->setText(qApp->applicationVersion());
webkitVersion->setText(tr("WebKit version: %1").arg(qWebKitVersion()));
QStringList versions;
versions += tr("WebKit version: %1").arg(qWebKitVersion());
versions += tr("wolfSSL version: %1").arg(qWolfSSLVersion());
static char16_t const separator[] = { 0x20, 0x2022, 0x20 };
webkitVersion->setText(versions.join(QString::fromUtf16(separator)));
connect(authorsButton, SIGNAL(clicked()),
this, SLOT(authorsButtonClicked()));
connect(licenseButton, SIGNAL(clicked()),
Expand Down
2 changes: 1 addition & 1 deletion src/aboutdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
</sizepolicy>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:9pt;&quot;&gt;Copyright © 2020 Aaron Dewes &amp;lt; &lt;/span&gt;&lt;a href=&quot;mailto:[email protected]&quot;&gt;&lt;span style=&quot; font-size:9pt; text-decoration: underline; color:#0000ff;&quot;&gt;[email protected]&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-size:9pt;&quot;&gt;&amp;gt; &lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:9pt;&quot;&gt;Copyright © 2020 Aaron Dewes &amp;lt;&lt;/span&gt;&lt;a href=&quot;mailto:[email protected]&quot;&gt;&lt;span style=&quot; font-size:9pt; text-decoration: underline; color:#0000ff;&quot;&gt;[email protected]&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-size:9pt;&quot;&gt;&amp;gt; &lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
Expand Down

0 comments on commit 693c785

Please sign in to comment.