diff options
Diffstat (limited to 'src/forms/aboutdialog.cpp')
-rw-r--r-- | src/forms/aboutdialog.cpp | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/src/forms/aboutdialog.cpp b/src/forms/aboutdialog.cpp index 5b788bd..93cb688 100644 --- a/src/forms/aboutdialog.cpp +++ b/src/forms/aboutdialog.cpp @@ -7,6 +7,7 @@ */ #include "aboutdialog.h" +#include "browser.h" #include "ui_aboutdialog.h" #include "version.h" #include <boost/version.hpp> @@ -28,10 +29,9 @@ AboutDialog::AboutDialog(QWidget *parent) setAttribute(Qt::WA_DeleteOnClose, true); ui->setupUi(this); - // clang-tidy: don't use static_cast to downcast from a base to a derived class, - // use dynamic_cast instead - //ui->icon->setPixmap(qApp->windowIcon().pixmap(72, 72)); - ui->icon->setPixmap(dynamic_cast<QApplication *>(QApplication::instance())->windowIcon().pixmap(72, 72)); + auto *browser = dynamic_cast<Browser *>(QApplication::instance()); + + ui->icon->setPixmap(dynamic_cast<QApplication *>(browser)->windowIcon().pixmap(72, 72)); auto *aboutLabel = new QLabel(this); aboutLabel->setWordWrap(true); @@ -63,6 +63,31 @@ AboutDialog::AboutDialog(QWidget *parent) "<li>Boost " BOOST_LIB_VERSION " </li>" "</ul></p>")); ui->toolBox->addItem(libsLabel, tr("Details")); + + // list profiles + if(!browser->profiles().isEmpty()) { + QString profilesText = tr("<p>Profile list:</p>" + "<p><ul>"); + for(const QString &name : browser->profiles()) { + if(name.isEmpty()) + profilesText += tr("<li>Off-the-record</li>"); + else + profilesText += tr("<li>%1</li>").arg(name); + } + profilesText += tr("</ul></p>"); + libsLabel->setText(libsLabel->text() + profilesText); + } + + // list plugins + if(!browser->plugins().isEmpty()) { + QString pluginText = tr("<p>Plugin list:</p>" + "<p><ul>"); + for(const Browser::Plugin &plugin : browser->plugins()) { + pluginText += tr("<li>%1 (%2)</li>").arg(plugin.meta["name"].toString(), plugin.meta["author"].toString()); + } + pluginText += tr("</ul></p>"); + libsLabel->setText(libsLabel->text() + pluginText); + } } AboutDialog::~AboutDialog() |