| 1 | // Copyright 2020 Dolphin Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | |
| 4 | #include "DolphinQt/Config/FreeLookWindow.h" |
| 5 | |
| 6 | #include <QDialogButtonBox> |
| 7 | #include <QLabel> |
| 8 | #include <QTabWidget> |
| 9 | #include <QVBoxLayout> |
| 10 | |
| 11 | #include "DolphinQt/Config/FreeLookWidget.h" |
| 12 | #include "DolphinQt/Config/HardcoreWarningWidget.h" |
| 13 | |
| 14 | FreeLookWindow::FreeLookWindow(QWidget* parent) : QDialog(parent) |
| 15 | { |
| 16 | CreateMainLayout(); |
| 17 | ConnectWidgets(); |
| 18 | |
| 19 | setWindowTitle(tr("Free Look Settings")); |
| 20 | } |
| 21 | |
| 22 | void FreeLookWindow::CreateMainLayout() |
| 23 | { |
| 24 | #ifdef USE_RETRO_ACHIEVEMENTS |
| 25 | m_hc_warning = new HardcoreWarningWidget(this); |
| 26 | #endif // USE_RETRO_ACHIEVEMENTS |
| 27 | m_button_box = new QDialogButtonBox(QDialogButtonBox::Close); |
| 28 | connect(m_button_box, &QDialogButtonBox::rejected, this, &QDialog::reject); |
| 29 | |
| 30 | auto* main_layout = new QVBoxLayout(); |
| 31 | |
| 32 | #ifdef USE_RETRO_ACHIEVEMENTS |
| 33 | main_layout->addWidget(m_hc_warning); |
| 34 | #endif // USE_RETRO_ACHIEVEMENTS |
| 35 | main_layout->addWidget(new FreeLookWidget(this)); |
| 36 | main_layout->addWidget(m_button_box); |
| 37 | setLayout(main_layout); |
| 38 | } |
| 39 | |
| 40 | void FreeLookWindow::ConnectWidgets() |
| 41 | { |
| 42 | #ifdef USE_RETRO_ACHIEVEMENTS |
| 43 | connect(m_hc_warning, &HardcoreWarningWidget::OpenAchievementSettings, this, |
| 44 | &FreeLookWindow::OpenAchievementSettings); |
| 45 | #endif // USE_RETRO_ACHIEVEMENTS |
| 46 | } |