11#include " aboutdialog.h"
22#include " ui_aboutdialog.h"
3+ #include " ../../redasmsettings.h"
34#include " ../../themeprovider.h"
5+ #include < rdapi/rdapi.h>
46#include < QPushButton>
57#include < QPainter>
68#include < vector>
9+ #include < iostream>
710
811AboutDialog::AboutDialog (QWidget *parent) : QDialog(parent), ui(new Ui::AboutDialog)
912{
1013 ui->setupUi (this );
11- ui->lblHeader ->setText (QString (ui->lblHeader ->text ()).arg (REDASM_VERSION, QT_VERSION_STR));
14+ ui->lblVersion ->setText (REDASM_VERSION);
15+ ui->lblQtVersion ->setText (QT_VERSION_STR);
16+ ui->lblLibREDasmVersion ->setText (LIBREDASM_VERSION);
17+ ui->lblRDApiLevel ->setText (QString::number (RDAPI_LEVEL));
1218
13- this ->setStyleSheet (" QTextEdit {"
14- " background: transparent;"
15- " border: 0;"
16- " }" );
19+ ui-> tbDependencies ->setStyleSheet (" QTextEdit {"
20+ " background: transparent;"
21+ " border: 0;"
22+ " }" );
1723
1824 this ->initDependencies ();
25+ this ->initSearchPaths ();
1926
2027 if (ThemeProvider::isDarkTheme ()) ui->lblLogo ->setPixmap (QPixmap (" :/res/logo_dark.png" ));
2128 else ui->lblLogo ->setPixmap (QPixmap (" :/res/logo.png" ));
@@ -34,11 +41,30 @@ void AboutDialog::initDependencies()
3441 };
3542
3643 QTextCursor cursor (ui->tbDependencies ->document ());
37- cursor.insertHtml (" <b>Thanks to:</b><br>" );
44+ QTextListFormat lf;
45+ lf.setStyle (QTextListFormat::ListDisc);
46+ cursor.insertList (lf);
3847
3948 for (const auto & [name, url] : DEPENDENCIES)
4049 {
41- cursor.insertHtml (QString (" - <a href='%1'>%2</a>" ).arg (url, name));
50+ QTextCharFormat cf;
51+ cf.setAnchor (true );
52+ cf.setAnchorHref (url);
53+ cf.setForeground (qApp->palette ().brush (QPalette::Highlight));
54+ cursor.insertText (" " + name, cf);
4255 if (name != DEPENDENCIES.back ().first ) cursor.insertText (" \n " );
4356 }
4457}
58+
59+ void AboutDialog::initSearchPaths ()
60+ {
61+ RDConfig_GetPluginPaths ([](const char * path, void * userdata) {
62+ auto * thethis = reinterpret_cast <QListWidget*>(userdata);
63+ thethis->addItem (path);
64+ }, ui->lwPluginPaths );
65+
66+ RDConfig_GetDatabasePaths ([](const char * path, void * userdata) {
67+ auto * thethis = reinterpret_cast <QListWidget*>(userdata);
68+ thethis->addItem (path);
69+ }, ui->lwDatabasePaths );
70+ }
0 commit comments