| 56 | constexpr QSize MAXIMUM_RESOLUTION = {100000, 100000}; |
| 57 | |
| 58 | LauncherWindow::LauncherWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::LauncherWindow) |
| 59 | { |
| 60 | const char *fake_argv = "OpenApoc"; |
| 61 | |
| 62 | config().parseOptions(1, &fake_argv); |
| 63 | |
| 64 | this->currentFramework = mkup<OpenApoc::Framework>("OpenApoc_Launcher", false); |
| 65 | ui->setupUi(this); |
| 66 | |
| 67 | connect(ui->exitButton, &QPushButton::clicked, this, &LauncherWindow::exit); |
| 68 | connect(ui->playButton, &QPushButton::clicked, this, &LauncherWindow::play); |
| 69 | connect(ui->browseCDFile, &QPushButton::clicked, this, &LauncherWindow::browseCDFile); |
| 70 | connect(ui->browseCDDir, &QPushButton::clicked, this, &LauncherWindow::browseCDDir); |
| 71 | connect(ui->browseDataDir, &QPushButton::clicked, this, &LauncherWindow::browseDataDir); |
| 72 | connect(ui->resolutionBox, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, |
| 73 | &LauncherWindow::setResolutionSelection); |
| 74 | |
| 75 | connect(ui->languageBox, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, |
| 76 | &LauncherWindow::setLanguageSelection); |
| 77 | |
| 78 | connect(ui->enabledModsList, &QListWidget::currentTextChanged, this, |
| 79 | &LauncherWindow::enabledModSelected); |
| 80 | connect(ui->disabledModsList, &QListWidget::currentTextChanged, this, |
| 81 | &LauncherWindow::disabledModSelected); |
| 82 | connect(ui->enableButton, &QPushButton::clicked, this, &LauncherWindow::enableModClicked); |
| 83 | connect(ui->disableButton, &QPushButton::clicked, this, &LauncherWindow::disableModClicked); |
| 84 | |
| 85 | ui->customResolutionX->setValidator( |
| 86 | new QIntValidator(MINIMUM_RESOLUTION.width(), MAXIMUM_RESOLUTION.width(), this)); |
| 87 | ui->customResolutionY->setValidator( |
| 88 | new QIntValidator(MINIMUM_RESOLUTION.height(), MAXIMUM_RESOLUTION.height(), this)); |
| 89 | |
| 90 | setupResolutionDisplay(); |
| 91 | setupScaling(); |
| 92 | setupScreenModes(); |
| 93 | setupDisplayNum(); |
| 94 | |
| 95 | ui->cdPath->setText(QString::fromStdString(OpenApoc::Options::cdPathOption.get())); |
| 96 | ui->dataPath->setText(QString::fromStdString(OpenApoc::Options::dataPathOption.get())); |
| 97 | |
| 98 | setupModList(); |
| 99 | updateAvailableLanguages(); |
| 100 | } |
| 101 | |
| 102 | LauncherWindow::~LauncherWindow() {} |
| 103 |
nothing calls this directly
no test coverage detected