1
1
#include " aboutdialog.h"
2
2
#include " ui_aboutdialog.h"
3
+ #include " ../../redasmsettings.h"
3
4
#include " ../../themeprovider.h"
5
+ #include < rdapi/rdapi.h>
4
6
#include < QPushButton>
5
7
#include < QPainter>
6
8
#include < vector>
9
+ #include < iostream>
7
10
8
11
AboutDialog::AboutDialog (QWidget *parent) : QDialog(parent), ui(new Ui::AboutDialog)
9
12
{
10
13
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));
12
18
13
- this ->setStyleSheet (" QTextEdit {"
14
- " background: transparent;"
15
- " border: 0;"
16
- " }" );
19
+ ui-> tbDependencies ->setStyleSheet (" QTextEdit {"
20
+ " background: transparent;"
21
+ " border: 0;"
22
+ " }" );
17
23
18
24
this ->initDependencies ();
25
+ this ->initSearchPaths ();
19
26
20
27
if (ThemeProvider::isDarkTheme ()) ui->lblLogo ->setPixmap (QPixmap (" :/res/logo_dark.png" ));
21
28
else ui->lblLogo ->setPixmap (QPixmap (" :/res/logo.png" ));
@@ -34,11 +41,30 @@ void AboutDialog::initDependencies()
34
41
};
35
42
36
43
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);
38
47
39
48
for (const auto & [name, url] : DEPENDENCIES)
40
49
{
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);
42
55
if (name != DEPENDENCIES.back ().first ) cursor.insertText (" \n " );
43
56
}
44
57
}
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