aboutsummaryrefslogtreecommitdiff
path: root/lib/about/aboutdialog.cpp
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-06-21 15:32:05 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2018-06-21 15:32:05 +0200
commitd9d213c80353b843c18af6e49db61fa77039f056 (patch)
tree21eaa71e62e88815a5c1caa9e0b0f273a6f63b1d /lib/about/aboutdialog.cpp
parentAddressBar: code cleanup (diff)
downloadsmolbote-d9d213c80353b843c18af6e49db61fa77039f056.tar.xz
Add Browser::about
Diffstat (limited to 'lib/about/aboutdialog.cpp')
-rw-r--r--lib/about/aboutdialog.cpp74
1 files changed, 28 insertions, 46 deletions
diff --git a/lib/about/aboutdialog.cpp b/lib/about/aboutdialog.cpp
index 9b4d3bc..4fb7a27 100644
--- a/lib/about/aboutdialog.cpp
+++ b/lib/about/aboutdialog.cpp
@@ -8,10 +8,9 @@
#include "aboutdialog.h"
#include "ui_aboutdialog.h"
+#include "version.h"
#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
@@ -25,21 +24,6 @@
#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)
@@ -49,41 +33,39 @@ AboutDialog::AboutDialog(QWidget *parent)
ui->icon->setPixmap(qApp->windowIcon().pixmap(72, 72));
- 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>This program is free software, see <i>License</i> for more information.</p>"
- "<p>This program uses free software: Qt " QT_VERSION_STR " and Boost " BOOST_LIB_VERSION "</p>")
- .arg(qApp->applicationVersion()));
- ui->toolBox->addItem(aboutLabel, tr("About"));
+ ui->aboutLabel->setText(tr("<h2>smolbote %1</h2>"
+ "<p><i>yet another no-frills browser</i></p>"
+ "<p>This program is free software, see <i>License</i> for more information.</p>"
+ "<p>This program uses free software: Qt " QT_VERSION_STR " and Boost " BOOST_LIB_VERSION "</p>")
+ .arg(qApp->applicationVersion()));
- auto *licenseLabel = new QLabel(this);
- licenseLabel->setWordWrap(true);
- licenseLabel->setText(tr("<p>Copyright 2017 - 2018 aqua</p>"
- "<p>This program is free software, and you are welcome to use it under the conditions set by the GNU GPLv3.<br>"
- "This is a short summary: <ul>"
- "<li> the freedom to use the software for any purpose,</li>"
- "<li> the freedom to change the software to suit your needs,</li>"
- "<li> the freedom to share the software with anyone,</li>"
- "<li> the freedom to share the changes you make, and</li>"
- "<li> the responsibility to grant the same freedoms when sharing the software.</li>"
- "</ul>"
- "<p>This program is distributed in the hope that it will be useful, but without any warranty.</p>"));
- ui->toolBox->addItem(licenseLabel, tr("License"));
+ ui->licenseLabel->setText(tr("<p>Copyright 2017 - 2018 aqua</p>"
+ "<p>This program is free software, and you are welcome to use it under the conditions set by the GNU GPLv3.<br>"
+ "This is a short summary: <ul>"
+ "<li> the freedom to use the software for any purpose,</li>"
+ "<li> the freedom to change the software to suit your needs,</li>"
+ "<li> the freedom to share the software with anyone,</li>"
+ "<li> the freedom to share the changes you make, and</li>"
+ "<li> the responsibility to grant the same freedoms when sharing the software.</li>"
+ "</ul>"
+ "<p>This program is distributed in the hope that it will be useful, but without any warranty.</p>"));
+ ui->detailsLabel->setText(tr("<p>Build " SMOLBOTE_BRANCH ":" SMOLBOTE_COMMIT "</p>"
+ "<p>Compiled with " compiler "</p>"));
-
-
- auto *detailsLabel = new QLabel(this);
- detailsLabel->setWordWrap(true);
- detailsLabel->setText(tr("<p>Build " SMOLBOTE_BRANCH ":" SMOLBOTE_COMMIT "</p>"
- "<p>Compiled with " compiler "</p>"
- "<p>%1</p>").arg(getPluginList()));
- ui->toolBox->addItem(detailsLabel, tr("Details"));
}
AboutDialog::~AboutDialog()
{
delete ui;
}
+
+void AboutDialog::addPlugin(const QString &name, const QString &author, const QString &shortcut)
+{
+ auto index = ui->pluginsTable->rowCount();
+ ui->pluginsTable->setRowCount(index + 1);
+
+ ui->pluginsTable->setItem(index, 0, new QTableWidgetItem(name));
+ ui->pluginsTable->setItem(index, 1, new QTableWidgetItem(author));
+ ui->pluginsTable->setItem(index, 2, new QTableWidgetItem(shortcut));
+}