|
7 | 7 |
|
8 | 8 | #include <QtGui/QDesktopServices> |
9 | 9 | #include <QtCore/QUrl> |
| 10 | +#include <QtWidgets/QApplication> |
10 | 11 |
|
11 | | -#include <project.h> |
12 | | -#include <graphics/2d.h> |
| 12 | +namespace fso::fred::dialogs { |
13 | 13 |
|
14 | | -namespace fso { |
15 | | -namespace fred { |
16 | | -namespace dialogs { |
17 | | - |
18 | | -AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent), ui(new Ui::AboutDialog()) { |
| 14 | +AboutDialog::AboutDialog(QWidget* parent, EditorViewport* viewport) |
| 15 | + : QDialog(parent), |
| 16 | + ui(new Ui::AboutDialog()), |
| 17 | + _model(new AboutDialogModel(this, viewport)) |
| 18 | +{ |
19 | 19 | ui->setupUi(this); |
20 | | - |
21 | | - connect(ui->buttonReportBug, &QPushButton::pressed, this, &AboutDialog::onBugPressed); |
22 | | - connect(ui->buttonVisitForums, &QPushButton::pressed, this, &AboutDialog::onForumsPressed); |
23 | | - connect(ui->buttonAboutQt, &QPushButton::pressed, this, &AboutDialog::onAboutQtPressed); |
24 | | - |
25 | | - QString graphicsAPI; |
26 | | - switch(gr_screen.mode) |
27 | | - { |
28 | | - case GR_OPENGL: |
29 | | - graphicsAPI = QString::fromUtf8("OpenGL"); |
30 | | - break; |
31 | | - case GR_VULKAN: |
32 | | - graphicsAPI = QString::fromUtf8("Vulkan"); |
33 | | - break; |
34 | | - } |
35 | | - |
36 | | - ui->labelVersion->setText(tr("qtFRED - FreeSpace Editor, Version %1 %2").arg(FS_VERSION_FULL, graphicsAPI)); |
37 | | -} |
38 | | -AboutDialog::~AboutDialog() { |
| 20 | + ui->labelVersion->setText(QString::fromStdString(_model->getVersionString())); |
39 | 21 | } |
40 | | -void AboutDialog::onBugPressed() { |
| 22 | + |
| 23 | +void AboutDialog::on_reportBugButton_clicked() |
| 24 | +{ |
41 | 25 | QDesktopServices::openUrl(QUrl("https://github.com/scp-fs2open/fs2open.github.com/issues", QUrl::TolerantMode)); |
42 | 26 | } |
43 | | -void AboutDialog::onForumsPressed() { |
| 27 | + |
| 28 | +void AboutDialog::on_visitForumsButton_clicked() |
| 29 | +{ |
44 | 30 | QDesktopServices::openUrl(QUrl("https://www.hard-light.net/forums/", QUrl::TolerantMode)); |
45 | 31 | } |
46 | | -void AboutDialog::onAboutQtPressed() { |
| 32 | + |
| 33 | +void AboutDialog::on_aboutQtButton_clicked() |
| 34 | +{ |
47 | 35 | QApplication::aboutQt(); |
48 | 36 | } |
49 | 37 |
|
50 | | -} |
51 | | -} |
52 | | -} |
| 38 | +} // namespace fso::fred::dialogs |
0 commit comments