aboutsummaryrefslogtreecommitdiff
path: root/lib/about
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-06-15 09:59:57 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2018-06-15 09:59:57 +0200
commitfeaec1906ea336b77022809aacc2ec4115b329c2 (patch)
tree7d7c88d5e2e0df9822b826583d2eeaf75bdec659 /lib/about
parentProfileEditor: add delete button (diff)
downloadsmolbote-feaec1906ea336b77022809aacc2ec4115b329c2.tar.xz
AboutDialog: add profile list to details tab
Diffstat (limited to 'lib/about')
-rw-r--r--lib/about/CMakeLists.txt2
-rw-r--r--lib/about/aboutdialog.cpp28
2 files changed, 24 insertions, 6 deletions
diff --git a/lib/about/CMakeLists.txt b/lib/about/CMakeLists.txt
index be506fe..7f53e8d 100644
--- a/lib/about/CMakeLists.txt
+++ b/lib/about/CMakeLists.txt
@@ -15,6 +15,8 @@ add_library(about
target_include_directories(about
PRIVATE ${Boost_INCLUDE_DIRS}
PRIVATE ${CMAKE_BINARY_DIR}/src
+ PRIVATE ${CMAKE_SOURCE_DIR}/src
+ PRIVATE ${CMAKE_SOURCE_DIR}/plugins
)
target_link_libraries(about Qt5::Widgets)
diff --git a/lib/about/aboutdialog.cpp b/lib/about/aboutdialog.cpp
index 6b4ebb8..e716217 100644
--- a/lib/about/aboutdialog.cpp
+++ b/lib/about/aboutdialog.cpp
@@ -11,6 +11,7 @@
#include <QtWebEngine/QtWebEngineVersion>
#include <boost/version.hpp>
#include "version.h"
+#include <browser.h>
// compiler
// clang also defines __GNUC__, so we need to check for clang first
@@ -24,6 +25,21 @@
#define compiler "unknown compiler"
#endif
+inline QString getPluginList()
+{
+ auto *browser = qobject_cast<Browser*>(qApp);
+ Q_CHECK_PTR(browser);
+
+ QString plugins;
+ for(const Plugin &p : browser->plugins()) {
+ plugins.append(QString("<li>%1 (%2)</li>").arg(p.name, p.author));
+ }
+ if(!plugins.isEmpty())
+ plugins = "Loaded plugins: <ul>" + plugins + "</ul";
+
+ return plugins;
+}
+
AboutDialog::AboutDialog(QWidget *parent)
: QDialog(parent)
, ui(new Ui::AboutDialog)
@@ -36,7 +52,8 @@ AboutDialog::AboutDialog(QWidget *parent)
auto *aboutLabel = new QLabel(this);
aboutLabel->setWordWrap(true);
aboutLabel->setText(tr("<h2>smolbote %1</h2>"
- "<p><i>yet another no-frills browser</i></p>")
+ "<p><i>yet another no-frills browser</i></p>"
+ "<p>This program is free software, and is built upon other free software: Qt " QT_VERSION_STR " and Boost " BOOST_LIB_VERSION "</p>")
.arg(qApp->applicationVersion()));
ui->toolBox->addItem(aboutLabel, tr("About"));
@@ -54,15 +71,14 @@ AboutDialog::AboutDialog(QWidget *parent)
"<p>This program is distributed in the hope that it will be useful, but without any warranty.</p>"));
ui->toolBox->addItem(licenseLabel, tr("License"));
+
+
+
auto *detailsLabel = new QLabel(this);
detailsLabel->setWordWrap(true);
detailsLabel->setText(tr("<p>Build " SMOLBOTE_BRANCH ":" SMOLBOTE_COMMIT "</p>"
"<p>Compiled with " compiler "</p>"
- "<p>Libraries: <ul>"
- "<li>Qt " QT_VERSION_STR "</li>"
- "<li>QtWebEngine " QTWEBENGINE_VERSION_STR "</li>"
- "<li>Boost " BOOST_LIB_VERSION " </li>"
- "</ul></p>"));
+ "<p>%1</p>").arg(getPluginList()));
ui->toolBox->addItem(detailsLabel, tr("Details"));
}