From 2ef549029742d8f93d423d453a0c8c364e36eb80 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sat, 14 Oct 2023 18:45:09 +1000 Subject: [PATCH] Qt: Change settings windows from QDialog to QWidget --- pcsx2-qt/CMakeLists.txt | 12 +- pcsx2-qt/MainWindow.cpp | 113 ++++++++++-------- pcsx2-qt/MainWindow.h | 16 +-- pcsx2-qt/SettingWidgetBinder.h | 2 +- .../Settings/AchievementSettingsWidget.cpp | 4 +- pcsx2-qt/Settings/AchievementSettingsWidget.h | 6 +- pcsx2-qt/Settings/AdvancedSettingsWidget.cpp | 4 +- pcsx2-qt/Settings/AdvancedSettingsWidget.h | 6 +- pcsx2-qt/Settings/AudioSettingsWidget.cpp | 4 +- pcsx2-qt/Settings/AudioSettingsWidget.h | 6 +- pcsx2-qt/Settings/BIOSSettingsWidget.cpp | 4 +- pcsx2-qt/Settings/BIOSSettingsWidget.h | 6 +- .../Settings/ControllerBindingWidgets.cpp | 14 +-- pcsx2-qt/Settings/ControllerBindingWidgets.h | 24 ++-- .../ControllerGlobalSettingsWidget.cpp | 8 +- .../Settings/ControllerGlobalSettingsWidget.h | 12 +- ...ialog.cpp => ControllerSettingsWindow.cpp} | 82 ++++++------- ...ngsDialog.h => ControllerSettingsWindow.h} | 14 +-- ...sDialog.ui => ControllerSettingsWindow.ui} | 10 +- pcsx2-qt/Settings/DEV9DnsHostDialog.cpp | 2 +- pcsx2-qt/Settings/DEV9DnsHostDialog.h | 2 +- pcsx2-qt/Settings/DEV9SettingsWidget.cpp | 4 +- pcsx2-qt/Settings/DEV9SettingsWidget.h | 6 +- pcsx2-qt/Settings/DebugSettingsWidget.cpp | 4 +- pcsx2-qt/Settings/DebugSettingsWidget.h | 6 +- pcsx2-qt/Settings/EmulationSettingsWidget.cpp | 4 +- pcsx2-qt/Settings/EmulationSettingsWidget.h | 6 +- pcsx2-qt/Settings/FolderSettingsWidget.cpp | 4 +- pcsx2-qt/Settings/FolderSettingsWidget.h | 4 +- pcsx2-qt/Settings/GameCheatSettingsWidget.cpp | 4 +- pcsx2-qt/Settings/GameCheatSettingsWidget.h | 6 +- pcsx2-qt/Settings/GameFixSettingsWidget.cpp | 4 +- pcsx2-qt/Settings/GameFixSettingsWidget.h | 4 +- pcsx2-qt/Settings/GameListSettingsWidget.cpp | 2 +- pcsx2-qt/Settings/GameListSettingsWidget.h | 4 +- pcsx2-qt/Settings/GamePatchSettingsWidget.cpp | 6 +- pcsx2-qt/Settings/GamePatchSettingsWidget.h | 10 +- pcsx2-qt/Settings/GameSummaryWidget.cpp | 4 +- pcsx2-qt/Settings/GameSummaryWidget.h | 6 +- pcsx2-qt/Settings/GraphicsSettingsWidget.cpp | 4 +- pcsx2-qt/Settings/GraphicsSettingsWidget.h | 6 +- pcsx2-qt/Settings/HotkeySettingsWidget.cpp | 4 +- pcsx2-qt/Settings/HotkeySettingsWidget.h | 6 +- pcsx2-qt/Settings/InputBindingWidget.cpp | 6 +- pcsx2-qt/Settings/InputBindingWidget.h | 8 +- pcsx2-qt/Settings/InterfaceSettingsWidget.cpp | 4 +- pcsx2-qt/Settings/InterfaceSettingsWidget.h | 4 +- .../Settings/MemoryCardSettingsWidget.cpp | 6 +- pcsx2-qt/Settings/MemoryCardSettingsWidget.h | 8 +- ...{SettingsDialog.cpp => SettingsWindow.cpp} | 102 ++++++++-------- .../{SettingsDialog.h => SettingsWindow.h} | 18 +-- .../{SettingsDialog.ui => SettingsWindow.ui} | 10 +- pcsx2-qt/pcsx2-qt.vcxproj | 16 +-- pcsx2-qt/pcsx2-qt.vcxproj.filters | 16 +-- 54 files changed, 331 insertions(+), 326 deletions(-) rename pcsx2-qt/Settings/{ControllerSettingsDialog.cpp => ControllerSettingsWindow.cpp} (88%) rename pcsx2-qt/Settings/{ControllerSettingsDialog.h => ControllerSettingsWindow.h} (92%) rename pcsx2-qt/Settings/{ControllerSettingsDialog.ui => ControllerSettingsWindow.ui} (95%) rename pcsx2-qt/Settings/{SettingsDialog.cpp => SettingsWindow.cpp} (87%) rename pcsx2-qt/Settings/{SettingsDialog.h => SettingsWindow.h} (94%) rename pcsx2-qt/Settings/{SettingsDialog.ui => SettingsWindow.ui} (94%) diff --git a/pcsx2-qt/CMakeLists.txt b/pcsx2-qt/CMakeLists.txt index b35fe276f49c4..7fbf1de96f16a 100644 --- a/pcsx2-qt/CMakeLists.txt +++ b/pcsx2-qt/CMakeLists.txt @@ -73,9 +73,9 @@ target_sources(pcsx2-qt PRIVATE Settings/ControllerMacroEditWidget.ui Settings/ControllerMacroWidget.ui Settings/ControllerMouseSettingsDialog.ui - Settings/ControllerSettingsDialog.cpp - Settings/ControllerSettingsDialog.h - Settings/ControllerSettingsDialog.ui + Settings/ControllerSettingsWindow.cpp + Settings/ControllerSettingsWindow.h + Settings/ControllerSettingsWindow.ui Settings/ControllerSettingWidgetBinder.h Settings/DebugSettingsWidget.cpp Settings/DebugSettingsWidget.h @@ -137,9 +137,9 @@ target_sources(pcsx2-qt PRIVATE Settings/HddCreateQt.cpp Settings/HddCreateQt.h Settings/PatchDetailsWidget.ui - Settings/SettingsDialog.cpp - Settings/SettingsDialog.h - Settings/SettingsDialog.ui + Settings/SettingsWindow.cpp + Settings/SettingsWindow.h + Settings/SettingsWindow.ui Settings/USBBindingWidget_DrivingForce.ui Settings/USBBindingWidget_GTForce.ui Settings/USBBindingWidget_GunCon2.ui diff --git a/pcsx2-qt/MainWindow.cpp b/pcsx2-qt/MainWindow.cpp index cc68ba0e99023..8a3819eff9123 100644 --- a/pcsx2-qt/MainWindow.cpp +++ b/pcsx2-qt/MainWindow.cpp @@ -26,7 +26,7 @@ #include "QtUtils.h" #include "SettingWidgetBinder.h" #include "Settings/AchievementLoginDialog.h" -#include "Settings/ControllerSettingsDialog.h" +#include "Settings/ControllerSettingsWindow.h" #include "Settings/GameListSettingsWidget.h" #include "Settings/InterfaceSettingsWidget.h" #include "Tools/InputRecording/InputRecordingViewer.h" @@ -117,13 +117,7 @@ MainWindow::~MainWindow() { // make sure the game list isn't refreshing, because it's on a separate thread cancelGameListRefresh(); - - if (m_debugger_window) - { - m_debugger_window->close(); - m_debugger_window->deleteLater(); - m_debugger_window = nullptr; - } + destroySubWindows(); // we compare here, since recreate destroys the window later if (g_main_window == this) @@ -320,7 +314,7 @@ void MainWindow::connectSignals() connect(m_ui.actionToolbarSaveState, &QAction::triggered, this, [this]() { m_ui.menuSaveState->exec(QCursor::pos()); }); connect(m_ui.actionToolbarSettings, &QAction::triggered, this, &MainWindow::onSettingsTriggeredFromToolbar); connect(m_ui.actionToolbarControllerSettings, &QAction::triggered, - [this]() { doControllerSettings(ControllerSettingsDialog::Category::GlobalSettings); }); + [this]() { doControllerSettings(ControllerSettingsWindow::Category::GlobalSettings); }); connect(m_ui.actionToolbarScreenshot, &QAction::triggered, this, &MainWindow::onScreenshotActionTriggered); connect(m_ui.actionExit, &QAction::triggered, this, &MainWindow::close); connect(m_ui.actionScreenshot, &QAction::triggered, this, &MainWindow::onScreenshotActionTriggered); @@ -338,11 +332,11 @@ void MainWindow::connectSignals() connect(m_ui.actionFolderSettings, &QAction::triggered, [this]() { doSettings("Folders"); }); connect(m_ui.actionAchievementSettings, &QAction::triggered, [this]() { doSettings("Achievements"); }); connect(m_ui.actionControllerSettings, &QAction::triggered, - [this]() { doControllerSettings(ControllerSettingsDialog::Category::GlobalSettings); }); + [this]() { doControllerSettings(ControllerSettingsWindow::Category::GlobalSettings); }); connect(m_ui.actionHotkeySettings, &QAction::triggered, - [this]() { doControllerSettings(ControllerSettingsDialog::Category::HotkeySettings); }); + [this]() { doControllerSettings(ControllerSettingsWindow::Category::HotkeySettings); }); connect(m_ui.actionAddGameDirectory, &QAction::triggered, - [this]() { getSettingsDialog()->getGameListSettingsWidget()->addSearchDirectory(this); }); + [this]() { getSettingsWindow()->getGameListSettingsWidget()->addSearchDirectory(this); }); connect(m_ui.actionScanForNewGames, &QAction::triggered, [this]() { refreshGameList(false); }); connect(m_ui.actionRescanAllGames, &QAction::triggered, [this]() { refreshGameList(true); }); connect(m_ui.actionViewToolbar, &QAction::toggled, this, &MainWindow::onViewToolbarActionToggled); @@ -415,7 +409,7 @@ void MainWindow::connectSignals() connect(m_game_list_widget, &GameListWidget::entryContextMenuRequested, this, &MainWindow::onGameListEntryContextMenuRequested, Qt::QueuedConnection); connect(m_game_list_widget, &GameListWidget::addGameDirectoryRequested, this, - [this]() { getSettingsDialog()->getGameListSettingsWidget()->addSearchDirectory(this); }); + [this]() { getSettingsWindow()->getGameListSettingsWidget()->addSearchDirectory(this); }); } void MainWindow::connectVMThreadSignals(EmuThread* thread) @@ -485,14 +479,14 @@ void MainWindow::recreate() void MainWindow::recreateSettings() { QString current_category; - if (m_settings_dialog) + if (m_setings_window) { - const bool was_visible = m_settings_dialog->isVisible(); + const bool was_visible = m_setings_window->isVisible(); - current_category = m_settings_dialog->getCategory(); - m_settings_dialog->hide(); - m_settings_dialog->deleteLater(); - m_settings_dialog = nullptr; + current_category = m_setings_window->getCategory(); + m_setings_window->hide(); + m_setings_window->deleteLater(); + m_setings_window = nullptr; if (!was_visible) return; @@ -518,7 +512,29 @@ void MainWindow::resetSettings(bool ui) g_main_window->recreateSettings(); } +void MainWindow::destroySubWindows() +{ + if (m_debugger_window) + { + m_debugger_window->close(); + m_debugger_window->deleteLater(); + m_debugger_window = nullptr; + } + if (m_controller_settings_window) + { + m_controller_settings_window->close(); + m_controller_settings_window->deleteLater(); + m_controller_settings_window = nullptr; + } + + if (m_setings_window) + { + m_setings_window->close(); + m_setings_window->deleteLater(); + m_setings_window = nullptr; + } +} void MainWindow::onScreenshotActionTriggered() { @@ -594,7 +610,7 @@ void MainWindow::onShowAdvancedSettingsToggled(bool checked) m_ui.menuDebug->menuAction()->setVisible(checked); // just recreate the entire settings window, it's easier. - if (m_settings_dialog) + if (m_setings_window) recreateSettings(); } @@ -1174,7 +1190,7 @@ void MainWindow::onGameListEntryContextMenuRequested(const QPoint& point) if (action->isEnabled()) { connect(action, &QAction::triggered, [entry]() { - SettingsDialog::openGamePropertiesDialog(entry, entry->title, + SettingsWindow::openGamePropertiesDialog(entry, entry->title, (entry->type != GameList::EntryType::ELF) ? entry->serial : std::string(), entry->crc); }); @@ -1191,7 +1207,7 @@ void MainWindow::onGameListEntryContextMenuRequested(const QPoint& point) connect(action, &QAction::triggered, [this, entry]() { setGameListEntryCoverImage(entry); }); connect(menu.addAction(tr("Exclude From List")), &QAction::triggered, - [this, entry]() { getSettingsDialog()->getGameListSettingsWidget()->addExcludedPath(entry->path); }); + [this, entry]() { getSettingsWindow()->getGameListSettingsWidget()->addExcludedPath(entry->path); }); connect(menu.addAction(tr("Reset Play Time")), &QAction::triggered, [this, entry]() { clearGameListEntryPlayTime(entry); }); @@ -1239,7 +1255,7 @@ void MainWindow::onGameListEntryContextMenuRequested(const QPoint& point) } connect(menu.addAction(tr("Add Search Directory...")), &QAction::triggered, - [this]() { getSettingsDialog()->getGameListSettingsWidget()->addSearchDirectory(this); }); + [this]() { getSettingsWindow()->getGameListSettingsWidget()->addSearchDirectory(this); }); menu.exec(point); } @@ -1387,7 +1403,7 @@ void MainWindow::onViewGamePropertiesActionTriggered() const GameList::Entry* entry = GameList::GetEntryForPath(path.toUtf8().constData()); if (entry) { - SettingsDialog::openGamePropertiesDialog( + SettingsWindow::openGamePropertiesDialog( entry, entry->title, m_current_elf_override.isEmpty() ? entry->serial : std::string(), entry->crc); return; } @@ -1403,12 +1419,12 @@ void MainWindow::onViewGamePropertiesActionTriggered() // can't use serial for ELFs, because they might have a disc set if (m_current_elf_override.isEmpty()) { - SettingsDialog::openGamePropertiesDialog( + SettingsWindow::openGamePropertiesDialog( nullptr, m_current_title.toStdString(), m_current_disc_serial.toStdString(), m_current_disc_crc); } else { - SettingsDialog::openGamePropertiesDialog( + SettingsWindow::openGamePropertiesDialog( nullptr, m_current_title.toStdString(), std::string(), m_current_disc_crc); } } @@ -1812,6 +1828,7 @@ void MainWindow::closeEvent(QCloseEvent* event) saveStateToConfig(); if (m_display_widget) g_emu_thread->stopFullscreenUI(); + destroySubWindows(); QMainWindow::closeEvent(event); return; } @@ -2267,13 +2284,13 @@ void MainWindow::restoreDisplayWindowGeometryFromConfig() } } -SettingsDialog* MainWindow::getSettingsDialog() +SettingsWindow* MainWindow::getSettingsWindow() { - if (!m_settings_dialog) + if (!m_setings_window) { - m_settings_dialog = new SettingsDialog(this); - connect(m_settings_dialog->getInterfaceSettingsWidget(), &InterfaceSettingsWidget::themeChanged, this, &MainWindow::updateTheme); - connect(m_settings_dialog->getInterfaceSettingsWidget(), &InterfaceSettingsWidget::languageChanged, this, [this]() { + m_setings_window = new SettingsWindow(); + connect(m_setings_window->getInterfaceSettingsWidget(), &InterfaceSettingsWidget::themeChanged, this, &MainWindow::updateTheme); + connect(m_setings_window->getInterfaceSettingsWidget(), &InterfaceSettingsWidget::languageChanged, this, [this]() { // reopen settings dialog after it applies updateLanguage(); // If you doSettings now, on macOS, the window will somehow end up underneath the main window that was created above @@ -2284,21 +2301,16 @@ SettingsDialog* MainWindow::getSettingsDialog() }); } - return m_settings_dialog; + return m_setings_window; } void MainWindow::doSettings(const char* category /* = nullptr */) { - SettingsDialog* dlg = getSettingsDialog(); + SettingsWindow* dlg = getSettingsWindow(); if (dlg->isVisible()) - { dlg->raise(); - } else - { - dlg->setModal(false); dlg->show(); - } if (category) dlg->setCategory(category); @@ -2319,25 +2331,20 @@ void MainWindow::openDebugger() dwnd->isVisible() ? dwnd->hide() : dwnd->show(); } -ControllerSettingsDialog* MainWindow::getControllerSettingsDialog() -{ - if (!m_controller_settings_dialog) - m_controller_settings_dialog = new ControllerSettingsDialog(this); - - return m_controller_settings_dialog; -} - -void MainWindow::doControllerSettings(ControllerSettingsDialog::Category category) +void MainWindow::doControllerSettings(ControllerSettingsWindow::Category category) { - ControllerSettingsDialog* dlg = getControllerSettingsDialog(); - if (!dlg->isVisible()) + if (m_controller_settings_window) { - dlg->setModal(false); - dlg->show(); + m_controller_settings_window->raise(); + } + else + { + m_controller_settings_window = new ControllerSettingsWindow(); + m_controller_settings_window->show(); } - if (category != ControllerSettingsDialog::Category::Count) - dlg->setCategory(category); + if (category != ControllerSettingsWindow::Category::Count) + m_controller_settings_window->setCategory(category); } QString MainWindow::getDiscDevicePath(const QString& title) diff --git a/pcsx2-qt/MainWindow.h b/pcsx2-qt/MainWindow.h index c905e7b8ffe7e..7dbc595a1af18 100644 --- a/pcsx2-qt/MainWindow.h +++ b/pcsx2-qt/MainWindow.h @@ -24,8 +24,8 @@ #include #include "Tools/InputRecording/InputRecordingViewer.h" -#include "Settings/ControllerSettingsDialog.h" -#include "Settings/SettingsDialog.h" +#include "Settings/ControllerSettingsWindow.h" +#include "Settings/SettingsWindow.h" #include "Debugger/DebuggerWindow.h" #include "ui_MainWindow.h" @@ -35,7 +35,7 @@ class AutoUpdaterDialog; class DisplayWidget; class DisplayContainer; class GameListWidget; -class ControllerSettingsDialog; +class ControllerSettingsWindow; class EmuThread; @@ -218,6 +218,7 @@ private Q_SLOTS: void connectSignals(); void recreate(); void recreateSettings(); + void destroySubWindows(); void registerForDeviceNotifications(); void unregisterForDeviceNotifications(); @@ -250,7 +251,7 @@ private Q_SLOTS: void destroyDisplayWidget(bool show_game_list); void updateDisplayWidgetCursor(); - SettingsDialog* getSettingsDialog(); + SettingsWindow* getSettingsWindow(); void doSettings(const char* category = nullptr); InputRecordingViewer* getInputRecordingViewer(); @@ -258,8 +259,7 @@ private Q_SLOTS: DebuggerWindow* getDebuggerWindow(); - ControllerSettingsDialog* getControllerSettingsDialog(); - void doControllerSettings(ControllerSettingsDialog::Category category = ControllerSettingsDialog::Category::Count); + void doControllerSettings(ControllerSettingsWindow::Category category = ControllerSettingsWindow::Category::Count); QString getDiscDevicePath(const QString& title); @@ -282,9 +282,9 @@ private Q_SLOTS: DisplayWidget* m_display_widget = nullptr; DisplayContainer* m_display_container = nullptr; - SettingsDialog* m_settings_dialog = nullptr; + SettingsWindow* m_setings_window = nullptr; + ControllerSettingsWindow* m_controller_settings_window = nullptr; InputRecordingViewer* m_input_recording_viewer = nullptr; - ControllerSettingsDialog* m_controller_settings_dialog = nullptr; AutoUpdaterDialog* m_auto_updater_dialog = nullptr; DebuggerWindow* m_debugger_window = nullptr; diff --git a/pcsx2-qt/SettingWidgetBinder.h b/pcsx2-qt/SettingWidgetBinder.h index f3d38fa2b3dec..3618ae85a9be1 100644 --- a/pcsx2-qt/SettingWidgetBinder.h +++ b/pcsx2-qt/SettingWidgetBinder.h @@ -41,7 +41,7 @@ #include "QtHost.h" #include "QtUtils.h" -#include "Settings/SettingsDialog.h" +#include "Settings/SettingsWindow.h" namespace SettingWidgetBinder { diff --git a/pcsx2-qt/Settings/AchievementSettingsWidget.cpp b/pcsx2-qt/Settings/AchievementSettingsWidget.cpp index 34a1ba65bacb2..f69cb9a0e56ab 100644 --- a/pcsx2-qt/Settings/AchievementSettingsWidget.cpp +++ b/pcsx2-qt/Settings/AchievementSettingsWidget.cpp @@ -18,7 +18,7 @@ #include "AchievementSettingsWidget.h" #include "AchievementLoginDialog.h" #include "MainWindow.h" -#include "SettingsDialog.h" +#include "SettingsWindow.h" #include "SettingWidgetBinder.h" #include "QtUtils.h" @@ -30,7 +30,7 @@ #include #include -AchievementSettingsWidget::AchievementSettingsWidget(SettingsDialog* dialog, QWidget* parent) +AchievementSettingsWidget::AchievementSettingsWidget(SettingsWindow* dialog, QWidget* parent) : QWidget(parent) , m_dialog(dialog) { diff --git a/pcsx2-qt/Settings/AchievementSettingsWidget.h b/pcsx2-qt/Settings/AchievementSettingsWidget.h index f73b4b95bb459..9940b30964842 100644 --- a/pcsx2-qt/Settings/AchievementSettingsWidget.h +++ b/pcsx2-qt/Settings/AchievementSettingsWidget.h @@ -17,14 +17,14 @@ #include #include "ui_AchievementSettingsWidget.h" -class SettingsDialog; +class SettingsWindow; class AchievementSettingsWidget : public QWidget { Q_OBJECT public: - explicit AchievementSettingsWidget(SettingsDialog* dialog, QWidget* parent); + explicit AchievementSettingsWidget(SettingsWindow* dialog, QWidget* parent); ~AchievementSettingsWidget(); private Q_SLOTS: @@ -41,5 +41,5 @@ private Q_SLOTS: Ui::AchievementSettingsWidget m_ui; - SettingsDialog* m_dialog; + SettingsWindow* m_dialog; }; diff --git a/pcsx2-qt/Settings/AdvancedSettingsWidget.cpp b/pcsx2-qt/Settings/AdvancedSettingsWidget.cpp index 1d676a363777c..9342e702a9713 100644 --- a/pcsx2-qt/Settings/AdvancedSettingsWidget.cpp +++ b/pcsx2-qt/Settings/AdvancedSettingsWidget.cpp @@ -22,9 +22,9 @@ #include "QtHost.h" #include "QtUtils.h" #include "SettingWidgetBinder.h" -#include "SettingsDialog.h" +#include "SettingsWindow.h" -AdvancedSettingsWidget::AdvancedSettingsWidget(SettingsDialog* dialog, QWidget* parent) +AdvancedSettingsWidget::AdvancedSettingsWidget(SettingsWindow* dialog, QWidget* parent) : QWidget(parent) , m_dialog(dialog) { diff --git a/pcsx2-qt/Settings/AdvancedSettingsWidget.h b/pcsx2-qt/Settings/AdvancedSettingsWidget.h index 1677f12c88bb6..328ad4f52d341 100644 --- a/pcsx2-qt/Settings/AdvancedSettingsWidget.h +++ b/pcsx2-qt/Settings/AdvancedSettingsWidget.h @@ -19,14 +19,14 @@ #include "ui_AdvancedSettingsWidget.h" -class SettingsDialog; +class SettingsWindow; class AdvancedSettingsWidget : public QWidget { Q_OBJECT public: - AdvancedSettingsWidget(SettingsDialog* dialog, QWidget* parent); + AdvancedSettingsWidget(SettingsWindow* dialog, QWidget* parent); ~AdvancedSettingsWidget(); private: @@ -34,7 +34,7 @@ class AdvancedSettingsWidget : public QWidget int getClampingModeIndex(int vunum) const; void setClampingMode(int vunum, int index); - SettingsDialog* m_dialog; + SettingsWindow* m_dialog; Ui::AdvancedSystemSettingsWidget m_ui; }; diff --git a/pcsx2-qt/Settings/AudioSettingsWidget.cpp b/pcsx2-qt/Settings/AudioSettingsWidget.cpp index 0887ee8545b64..06d2458321d63 100644 --- a/pcsx2-qt/Settings/AudioSettingsWidget.cpp +++ b/pcsx2-qt/Settings/AudioSettingsWidget.cpp @@ -26,7 +26,7 @@ #include "QtHost.h" #include "QtUtils.h" #include "SettingWidgetBinder.h" -#include "SettingsDialog.h" +#include "SettingsWindow.h" static constexpr s32 DEFAULT_SYNCHRONIZATION_MODE = 0; static constexpr s32 DEFAULT_EXPANSION_MODE = 0; @@ -39,7 +39,7 @@ static constexpr s32 DEFAULT_SOUNDTOUCH_SEQUENCE_LENGTH = 30; static constexpr s32 DEFAULT_SOUNDTOUCH_SEEK_WINDOW = 20; static constexpr s32 DEFAULT_SOUNDTOUCH_OVERLAP = 10; -AudioSettingsWidget::AudioSettingsWidget(SettingsDialog* dialog, QWidget* parent) +AudioSettingsWidget::AudioSettingsWidget(SettingsWindow* dialog, QWidget* parent) : QWidget(parent) , m_dialog(dialog) { diff --git a/pcsx2-qt/Settings/AudioSettingsWidget.h b/pcsx2-qt/Settings/AudioSettingsWidget.h index 5a2254d6926e8..2a13b3a1721b0 100644 --- a/pcsx2-qt/Settings/AudioSettingsWidget.h +++ b/pcsx2-qt/Settings/AudioSettingsWidget.h @@ -19,14 +19,14 @@ #include "ui_AudioSettingsWidget.h" -class SettingsDialog; +class SettingsWindow; class AudioSettingsWidget : public QWidget { Q_OBJECT public: - AudioSettingsWidget(SettingsDialog* dialog, QWidget* parent); + AudioSettingsWidget(SettingsWindow* dialog, QWidget* parent); ~AudioSettingsWidget(); private Q_SLOTS: @@ -45,7 +45,7 @@ private Q_SLOTS: void populateOutputModules(); void updateVolumeLabel(); - SettingsDialog* m_dialog; + SettingsWindow* m_dialog; Ui::AudioSettingsWidget m_ui; u32 m_output_device_latency = 0; }; diff --git a/pcsx2-qt/Settings/BIOSSettingsWidget.cpp b/pcsx2-qt/Settings/BIOSSettingsWidget.cpp index 17837d9d663b8..5b1a4aebbd803 100644 --- a/pcsx2-qt/Settings/BIOSSettingsWidget.cpp +++ b/pcsx2-qt/Settings/BIOSSettingsWidget.cpp @@ -26,9 +26,9 @@ #include "QtHost.h" #include "QtUtils.h" #include "SettingWidgetBinder.h" -#include "SettingsDialog.h" +#include "SettingsWindow.h" -BIOSSettingsWidget::BIOSSettingsWidget(SettingsDialog* dialog, QWidget* parent) +BIOSSettingsWidget::BIOSSettingsWidget(SettingsWindow* dialog, QWidget* parent) : QWidget(parent) , m_dialog(dialog) { diff --git a/pcsx2-qt/Settings/BIOSSettingsWidget.h b/pcsx2-qt/Settings/BIOSSettingsWidget.h index 3a3adf3b8c1a2..0b04ae917d8bf 100644 --- a/pcsx2-qt/Settings/BIOSSettingsWidget.h +++ b/pcsx2-qt/Settings/BIOSSettingsWidget.h @@ -24,7 +24,7 @@ #include "ui_BIOSSettingsWidget.h" -class SettingsDialog; +class SettingsWindow; class QThread; // TODO: Move to core. @@ -43,7 +43,7 @@ class BIOSSettingsWidget : public QWidget Q_OBJECT public: - BIOSSettingsWidget(SettingsDialog* dialog, QWidget* parent); + BIOSSettingsWidget(SettingsWindow* dialog, QWidget* parent); ~BIOSSettingsWidget(); class RefreshThread final : public QThread @@ -71,7 +71,7 @@ private Q_SLOTS: private: Ui::BIOSSettingsWidget m_ui; - SettingsDialog* m_dialog; + SettingsWindow* m_dialog; RefreshThread* m_refresh_thread = nullptr; }; diff --git a/pcsx2-qt/Settings/ControllerBindingWidgets.cpp b/pcsx2-qt/Settings/ControllerBindingWidgets.cpp index d77cd40b065fb..dc311b154ae81 100644 --- a/pcsx2-qt/Settings/ControllerBindingWidgets.cpp +++ b/pcsx2-qt/Settings/ControllerBindingWidgets.cpp @@ -29,9 +29,9 @@ #include "pcsx2/SIO/Pad/Pad.h" #include "Settings/ControllerBindingWidgets.h" -#include "Settings/ControllerSettingsDialog.h" +#include "Settings/ControllerSettingsWindow.h" #include "Settings/ControllerSettingWidgetBinder.h" -#include "Settings/SettingsDialog.h" +#include "Settings/SettingsWindow.h" #include "QtHost.h" #include "QtUtils.h" #include "SettingWidgetBinder.h" @@ -40,7 +40,7 @@ #include "ui_USBBindingWidget_GTForce.h" #include "ui_USBBindingWidget_GunCon2.h" -ControllerBindingWidget::ControllerBindingWidget(QWidget* parent, ControllerSettingsDialog* dialog, u32 port) +ControllerBindingWidget::ControllerBindingWidget(QWidget* parent, ControllerSettingsWindow* dialog, u32 port) : QWidget(parent) , m_dialog(dialog) , m_config_section(fmt::format("Pad{}", port + 1)) @@ -325,7 +325,7 @@ ControllerMacroEditWidget::ControllerMacroEditWidget(ControllerMacroWidget* pare { m_ui.setupUi(this); - ControllerSettingsDialog* dialog = m_bwidget->getDialog(); + ControllerSettingsWindow* dialog = m_bwidget->getDialog(); const std::string& section = m_bwidget->getConfigSection(); const Pad::ControllerInfo* cinfo = Pad::GetControllerInfo(m_bwidget->getControllerType()); if (!cinfo) @@ -445,7 +445,7 @@ void ControllerMacroEditWidget::updateFrequencyText() void ControllerMacroEditWidget::updateBinds() { - ControllerSettingsDialog* dialog = m_bwidget->getDialog(); + ControllerSettingsWindow* dialog = m_bwidget->getDialog(); const Pad::ControllerInfo* cinfo = Pad::GetControllerInfo(m_bwidget->getControllerType()); if (!cinfo) return; @@ -495,7 +495,7 @@ void ControllerMacroEditWidget::updateBinds() ////////////////////////////////////////////////////////////////////////// ControllerCustomSettingsWidget::ControllerCustomSettingsWidget(std::span settings, std::string config_section, - std::string config_prefix, const char* translation_ctx, ControllerSettingsDialog* dialog, QWidget* parent_widget) + std::string config_prefix, const char* translation_ctx, ControllerSettingsWindow* dialog, QWidget* parent_widget) : QWidget(parent_widget) , m_settings(settings) , m_config_section(std::move(config_section)) @@ -912,7 +912,7 @@ ControllerBindingWidget_Base* ControllerBindingWidget_Guitar::createInstance(Con ////////////////////////////////////////////////////////////////////////// -USBDeviceWidget::USBDeviceWidget(QWidget* parent, ControllerSettingsDialog* dialog, u32 port) +USBDeviceWidget::USBDeviceWidget(QWidget* parent, ControllerSettingsWindow* dialog, u32 port) : QWidget(parent) , m_dialog(dialog) , m_config_section(fmt::format("USB{}", port + 1)) diff --git a/pcsx2-qt/Settings/ControllerBindingWidgets.h b/pcsx2-qt/Settings/ControllerBindingWidgets.h index 472d548e1ae9d..bab0db0c64a9a 100644 --- a/pcsx2-qt/Settings/ControllerBindingWidgets.h +++ b/pcsx2-qt/Settings/ControllerBindingWidgets.h @@ -29,7 +29,7 @@ #include "ui_USBDeviceWidget.h" class InputBindingWidget; -class ControllerSettingsDialog; +class ControllerSettingsWindow; class ControllerCustomSettingsWidget; class ControllerMacroWidget; class ControllerMacroEditWidget; @@ -42,12 +42,12 @@ class ControllerBindingWidget final : public QWidget Q_OBJECT public: - ControllerBindingWidget(QWidget* parent, ControllerSettingsDialog* dialog, u32 port); + ControllerBindingWidget(QWidget* parent, ControllerSettingsWindow* dialog, u32 port); ~ControllerBindingWidget(); QIcon getIcon() const; - __fi ControllerSettingsDialog* getDialog() const { return m_dialog; } + __fi ControllerSettingsWindow* getDialog() const { return m_dialog; } __fi const std::string& getConfigSection() const { return m_config_section; } __fi Pad::ControllerType getControllerType() const { return m_controller_type; } __fi u32 getPortNumber() const { return m_port_number; } @@ -67,7 +67,7 @@ private Q_SLOTS: Ui::ControllerBindingWidget m_ui; - ControllerSettingsDialog* m_dialog; + ControllerSettingsWindow* m_dialog; std::string m_config_section; Pad::ControllerType m_controller_type; @@ -97,7 +97,7 @@ class ControllerMacroWidget : public QWidget void createWidgets(ControllerBindingWidget* parent); Ui::ControllerMacroWidget m_ui; - ControllerSettingsDialog* m_dialog; + ControllerSettingsWindow* m_dialog; std::array m_macros; }; @@ -142,7 +142,7 @@ class ControllerCustomSettingsWidget : public QWidget public: ControllerCustomSettingsWidget(std::span settings, std::string config_section, std::string config_prefix, - const char* translation_ctx, ControllerSettingsDialog* dialog, QWidget* parent_widget); + const char* translation_ctx, ControllerSettingsWindow* dialog, QWidget* parent_widget); ~ControllerCustomSettingsWidget(); private Q_SLOTS: @@ -154,7 +154,7 @@ private Q_SLOTS: std::span m_settings; std::string m_config_section; std::string m_config_prefix; - ControllerSettingsDialog* m_dialog; + ControllerSettingsWindow* m_dialog; }; ////////////////////////////////////////////////////////////////////////// @@ -168,7 +168,7 @@ class ControllerBindingWidget_Base : public QWidget ControllerBindingWidget_Base(ControllerBindingWidget* parent); virtual ~ControllerBindingWidget_Base(); - __fi ControllerSettingsDialog* getDialog() const { return static_cast(parent())->getDialog(); } + __fi ControllerSettingsWindow* getDialog() const { return static_cast(parent())->getDialog(); } __fi const std::string& getConfigSection() const { return static_cast(parent())->getConfigSection(); } __fi Pad::ControllerType getControllerType() const { return static_cast(parent())->getControllerType(); } __fi u32 getPortNumber() const { return static_cast(parent())->getPortNumber(); } @@ -218,12 +218,12 @@ class USBDeviceWidget final : public QWidget Q_OBJECT public: - USBDeviceWidget(QWidget* parent, ControllerSettingsDialog* dialog, u32 port); + USBDeviceWidget(QWidget* parent, ControllerSettingsWindow* dialog, u32 port); ~USBDeviceWidget(); QIcon getIcon() const; - __fi ControllerSettingsDialog* getDialog() const { return m_dialog; } + __fi ControllerSettingsWindow* getDialog() const { return m_dialog; } __fi const std::string& getConfigSection() const { return m_config_section; } __fi const std::string& getDeviceType() const { return m_device_type; } __fi u32 getPortNumber() const { return m_port_number; } @@ -244,7 +244,7 @@ private Q_SLOTS: Ui::USBDeviceWidget m_ui; - ControllerSettingsDialog* m_dialog; + ControllerSettingsWindow* m_dialog; std::string m_config_section; std::string m_device_type; @@ -263,7 +263,7 @@ class USBBindingWidget : public QWidget USBBindingWidget(USBDeviceWidget* parent); ~USBBindingWidget() override; - __fi ControllerSettingsDialog* getDialog() const { return static_cast(parent())->getDialog(); } + __fi ControllerSettingsWindow* getDialog() const { return static_cast(parent())->getDialog(); } __fi const std::string& getConfigSection() const { return static_cast(parent())->getConfigSection(); } __fi const std::string& getDeviceType() const { return static_cast(parent())->getDeviceType(); } __fi u32 getPortNumber() const { return static_cast(parent())->getPortNumber(); } diff --git a/pcsx2-qt/Settings/ControllerGlobalSettingsWidget.cpp b/pcsx2-qt/Settings/ControllerGlobalSettingsWidget.cpp index c1fa57665b33d..e42f1260341ac 100644 --- a/pcsx2-qt/Settings/ControllerGlobalSettingsWidget.cpp +++ b/pcsx2-qt/Settings/ControllerGlobalSettingsWidget.cpp @@ -16,7 +16,7 @@ #include "PrecompiledHeader.h" #include "Settings/ControllerGlobalSettingsWidget.h" -#include "Settings/ControllerSettingsDialog.h" +#include "Settings/ControllerSettingsWindow.h" #include "Settings/ControllerSettingWidgetBinder.h" #include "QtUtils.h" #include "SettingWidgetBinder.h" @@ -24,7 +24,7 @@ #include "pcsx2/Input/InputManager.h" #include "pcsx2/Input/SDLInputSource.h" -ControllerGlobalSettingsWidget::ControllerGlobalSettingsWidget(QWidget* parent, ControllerSettingsDialog* dialog) +ControllerGlobalSettingsWidget::ControllerGlobalSettingsWidget(QWidget* parent, ControllerSettingsWindow* dialog) : QWidget(parent) , m_dialog(dialog) { @@ -132,7 +132,7 @@ void ControllerGlobalSettingsWidget::mouseSettingsClicked() dialog.exec(); } -ControllerLEDSettingsDialog::ControllerLEDSettingsDialog(QWidget* parent, ControllerSettingsDialog* dialog) +ControllerLEDSettingsDialog::ControllerLEDSettingsDialog(QWidget* parent, ControllerSettingsWindow* dialog) : QDialog(parent) , m_dialog(dialog) { @@ -159,7 +159,7 @@ void ControllerLEDSettingsDialog::linkButton(ColorPickerButton* button, u32 play }); } -ControllerMouseSettingsDialog::ControllerMouseSettingsDialog(QWidget* parent, ControllerSettingsDialog* dialog) +ControllerMouseSettingsDialog::ControllerMouseSettingsDialog(QWidget* parent, ControllerSettingsWindow* dialog) : QDialog(parent) { m_ui.setupUi(this); diff --git a/pcsx2-qt/Settings/ControllerGlobalSettingsWidget.h b/pcsx2-qt/Settings/ControllerGlobalSettingsWidget.h index 9c4b0954ccebe..27846fa60b978 100644 --- a/pcsx2-qt/Settings/ControllerGlobalSettingsWidget.h +++ b/pcsx2-qt/Settings/ControllerGlobalSettingsWidget.h @@ -26,14 +26,14 @@ #include "ui_ControllerLEDSettingsDialog.h" #include "ui_ControllerMouseSettingsDialog.h" -class ControllerSettingsDialog; +class ControllerSettingsWindow; class ControllerGlobalSettingsWidget : public QWidget { Q_OBJECT public: - ControllerGlobalSettingsWidget(QWidget* parent, ControllerSettingsDialog* dialog); + ControllerGlobalSettingsWidget(QWidget* parent, ControllerSettingsWindow* dialog); ~ControllerGlobalSettingsWidget(); void addDeviceToList(const QString& identifier, const QString& name); @@ -49,7 +49,7 @@ private Q_SLOTS: private: Ui::ControllerGlobalSettingsWidget m_ui; - ControllerSettingsDialog* m_dialog; + ControllerSettingsWindow* m_dialog; }; class ControllerLEDSettingsDialog : public QDialog @@ -57,14 +57,14 @@ class ControllerLEDSettingsDialog : public QDialog Q_OBJECT public: - ControllerLEDSettingsDialog(QWidget* parent, ControllerSettingsDialog* dialog); + ControllerLEDSettingsDialog(QWidget* parent, ControllerSettingsWindow* dialog); ~ControllerLEDSettingsDialog(); private: void linkButton(ColorPickerButton* button, u32 player_id); Ui::ControllerLEDSettingsDialog m_ui; - ControllerSettingsDialog* m_dialog; + ControllerSettingsWindow* m_dialog; }; class ControllerMouseSettingsDialog : public QDialog @@ -72,7 +72,7 @@ class ControllerMouseSettingsDialog : public QDialog Q_OBJECT public: - ControllerMouseSettingsDialog(QWidget* parent, ControllerSettingsDialog* dialog); + ControllerMouseSettingsDialog(QWidget* parent, ControllerSettingsWindow* dialog); ~ControllerMouseSettingsDialog(); private: diff --git a/pcsx2-qt/Settings/ControllerSettingsDialog.cpp b/pcsx2-qt/Settings/ControllerSettingsWindow.cpp similarity index 88% rename from pcsx2-qt/Settings/ControllerSettingsDialog.cpp rename to pcsx2-qt/Settings/ControllerSettingsWindow.cpp index 2db2cfceb1d46..9430276f8fa48 100644 --- a/pcsx2-qt/Settings/ControllerSettingsDialog.cpp +++ b/pcsx2-qt/Settings/ControllerSettingsWindow.cpp @@ -1,5 +1,5 @@ /* PCSX2 - PS2 Emulator for PCs - * Copyright (C) 2002-2022 PCSX2 Dev Team + * Copyright (C) 2002-2023 PCSX2 Dev Team * * PCSX2 is free software: you can redistribute it and/or modify it under the terms * of the GNU Lesser General Public License as published by the Free Software Found- @@ -16,7 +16,7 @@ #include "PrecompiledHeader.h" #include "QtHost.h" -#include "Settings/ControllerSettingsDialog.h" +#include "Settings/ControllerSettingsWindow.h" #include "Settings/ControllerGlobalSettingsWidget.h" #include "Settings/ControllerBindingWidgets.h" #include "Settings/HotkeySettingsWidget.h" @@ -36,8 +36,8 @@ static constexpr const std::array s_mtap_slot_names = {{'A', 'B', 'C', 'D'}}; -ControllerSettingsDialog::ControllerSettingsDialog(QWidget* parent /* = nullptr */) - : QDialog(parent) +ControllerSettingsWindow::ControllerSettingsWindow() + : QWidget(nullptr) { m_ui.setupUi(this); @@ -47,27 +47,27 @@ ControllerSettingsDialog::ControllerSettingsDialog(QWidget* parent /* = nullptr createWidgets(); m_ui.settingsCategory->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - connect(m_ui.settingsCategory, &QListWidget::currentRowChanged, this, &ControllerSettingsDialog::onCategoryCurrentRowChanged); - connect(m_ui.currentProfile, &QComboBox::currentIndexChanged, this, &ControllerSettingsDialog::onCurrentProfileChanged); - connect(m_ui.buttonBox, &QDialogButtonBox::rejected, this, &ControllerSettingsDialog::close); - connect(m_ui.newProfile, &QPushButton::clicked, this, &ControllerSettingsDialog::onNewProfileClicked); - connect(m_ui.loadProfile, &QPushButton::clicked, this, &ControllerSettingsDialog::onLoadProfileClicked); - connect(m_ui.deleteProfile, &QPushButton::clicked, this, &ControllerSettingsDialog::onDeleteProfileClicked); - connect(m_ui.restoreDefaults, &QPushButton::clicked, this, &ControllerSettingsDialog::onRestoreDefaultsClicked); - - connect(g_emu_thread, &EmuThread::onInputDevicesEnumerated, this, &ControllerSettingsDialog::onInputDevicesEnumerated); - connect(g_emu_thread, &EmuThread::onInputDeviceConnected, this, &ControllerSettingsDialog::onInputDeviceConnected); - connect(g_emu_thread, &EmuThread::onInputDeviceDisconnected, this, &ControllerSettingsDialog::onInputDeviceDisconnected); - connect(g_emu_thread, &EmuThread::onVibrationMotorsEnumerated, this, &ControllerSettingsDialog::onVibrationMotorsEnumerated); + connect(m_ui.settingsCategory, &QListWidget::currentRowChanged, this, &ControllerSettingsWindow::onCategoryCurrentRowChanged); + connect(m_ui.currentProfile, &QComboBox::currentIndexChanged, this, &ControllerSettingsWindow::onCurrentProfileChanged); + connect(m_ui.buttonBox, &QDialogButtonBox::rejected, this, &ControllerSettingsWindow::close); + connect(m_ui.newProfile, &QPushButton::clicked, this, &ControllerSettingsWindow::onNewProfileClicked); + connect(m_ui.loadProfile, &QPushButton::clicked, this, &ControllerSettingsWindow::onLoadProfileClicked); + connect(m_ui.deleteProfile, &QPushButton::clicked, this, &ControllerSettingsWindow::onDeleteProfileClicked); + connect(m_ui.restoreDefaults, &QPushButton::clicked, this, &ControllerSettingsWindow::onRestoreDefaultsClicked); + + connect(g_emu_thread, &EmuThread::onInputDevicesEnumerated, this, &ControllerSettingsWindow::onInputDevicesEnumerated); + connect(g_emu_thread, &EmuThread::onInputDeviceConnected, this, &ControllerSettingsWindow::onInputDeviceConnected); + connect(g_emu_thread, &EmuThread::onInputDeviceDisconnected, this, &ControllerSettingsWindow::onInputDeviceDisconnected); + connect(g_emu_thread, &EmuThread::onVibrationMotorsEnumerated, this, &ControllerSettingsWindow::onVibrationMotorsEnumerated); // trigger a device enumeration to populate the device list g_emu_thread->enumerateInputDevices(); g_emu_thread->enumerateVibrationMotors(); } -ControllerSettingsDialog::~ControllerSettingsDialog() = default; +ControllerSettingsWindow::~ControllerSettingsWindow() = default; -void ControllerSettingsDialog::setCategory(Category category) +void ControllerSettingsWindow::setCategory(Category category) { switch (category) { @@ -89,17 +89,17 @@ void ControllerSettingsDialog::setCategory(Category category) } } -void ControllerSettingsDialog::onCategoryCurrentRowChanged(int row) +void ControllerSettingsWindow::onCategoryCurrentRowChanged(int row) { m_ui.settingsContainer->setCurrentIndex(row); } -void ControllerSettingsDialog::onCurrentProfileChanged(int index) +void ControllerSettingsWindow::onCurrentProfileChanged(int index) { switchProfile((index == 0) ? 0 : m_ui.currentProfile->itemText(index)); } -void ControllerSettingsDialog::onNewProfileClicked() +void ControllerSettingsWindow::onNewProfileClicked() { const QString profile_name(QInputDialog::getText(this, tr("Create Input Profile"), tr("Custom input profiles are used to override the Shared input profile for specific games.\n" @@ -154,7 +154,7 @@ void ControllerSettingsDialog::onNewProfileClicked() switchProfile(profile_name); } -void ControllerSettingsDialog::onLoadProfileClicked() +void ControllerSettingsWindow::onLoadProfileClicked() { if (QMessageBox::question(this, tr("Load Input Profile"), tr("Are you sure you want to load the input profile named '%1'?\n\n" @@ -178,7 +178,7 @@ void ControllerSettingsDialog::onLoadProfileClicked() switchProfile({}); } -void ControllerSettingsDialog::onDeleteProfileClicked() +void ControllerSettingsWindow::onDeleteProfileClicked() { if (QMessageBox::question(this, tr("Delete Input Profile"), tr("Are you sure you want to delete the input profile named '%1'?\n\n" @@ -200,7 +200,7 @@ void ControllerSettingsDialog::onDeleteProfileClicked() switchProfile({}); } -void ControllerSettingsDialog::onRestoreDefaultsClicked() +void ControllerSettingsWindow::onRestoreDefaultsClicked() { if (QMessageBox::question(this, tr("Restore Defaults"), tr("Are you sure you want to restore the default controller configuration?\n\n" @@ -223,21 +223,21 @@ void ControllerSettingsDialog::onRestoreDefaultsClicked() switchProfile({}); } -void ControllerSettingsDialog::onInputDevicesEnumerated(const QList>& devices) +void ControllerSettingsWindow::onInputDevicesEnumerated(const QList>& devices) { m_device_list = devices; for (const QPair& device : devices) m_global_settings->addDeviceToList(device.first, device.second); } -void ControllerSettingsDialog::onInputDeviceConnected(const QString& identifier, const QString& device_name) +void ControllerSettingsWindow::onInputDeviceConnected(const QString& identifier, const QString& device_name) { m_device_list.emplace_back(identifier, device_name); m_global_settings->addDeviceToList(identifier, device_name); g_emu_thread->enumerateVibrationMotors(); } -void ControllerSettingsDialog::onInputDeviceDisconnected(const QString& identifier) +void ControllerSettingsWindow::onInputDeviceDisconnected(const QString& identifier) { for (auto iter = m_device_list.begin(); iter != m_device_list.end(); ++iter) { @@ -252,7 +252,7 @@ void ControllerSettingsDialog::onInputDeviceDisconnected(const QString& identifi g_emu_thread->enumerateVibrationMotors(); } -void ControllerSettingsDialog::onVibrationMotorsEnumerated(const QList& motors) +void ControllerSettingsWindow::onVibrationMotorsEnumerated(const QList& motors) { m_vibration_motors.clear(); m_vibration_motors.reserve(motors.size()); @@ -265,7 +265,7 @@ void ControllerSettingsDialog::onVibrationMotorsEnumerated(const QListGetBoolValue(section, key, default_value); @@ -273,7 +273,7 @@ bool ControllerSettingsDialog::getBoolValue(const char* section, const char* key return Host::GetBaseBoolSettingValue(section, key, default_value); } -s32 ControllerSettingsDialog::getIntValue(const char* section, const char* key, s32 default_value) const +s32 ControllerSettingsWindow::getIntValue(const char* section, const char* key, s32 default_value) const { if (m_profile_interface) return m_profile_interface->GetIntValue(section, key, default_value); @@ -281,7 +281,7 @@ s32 ControllerSettingsDialog::getIntValue(const char* section, const char* key, return Host::GetBaseIntSettingValue(section, key, default_value); } -std::string ControllerSettingsDialog::getStringValue(const char* section, const char* key, const char* default_value) const +std::string ControllerSettingsWindow::getStringValue(const char* section, const char* key, const char* default_value) const { std::string value; if (m_profile_interface) @@ -291,7 +291,7 @@ std::string ControllerSettingsDialog::getStringValue(const char* section, const return value; } -void ControllerSettingsDialog::setBoolValue(const char* section, const char* key, bool value) +void ControllerSettingsWindow::setBoolValue(const char* section, const char* key, bool value) { if (m_profile_interface) { @@ -307,7 +307,7 @@ void ControllerSettingsDialog::setBoolValue(const char* section, const char* key } } -void ControllerSettingsDialog::setIntValue(const char* section, const char* key, s32 value) +void ControllerSettingsWindow::setIntValue(const char* section, const char* key, s32 value) { if (m_profile_interface) { @@ -323,7 +323,7 @@ void ControllerSettingsDialog::setIntValue(const char* section, const char* key, } } -void ControllerSettingsDialog::setStringValue(const char* section, const char* key, const char* value) +void ControllerSettingsWindow::setStringValue(const char* section, const char* key, const char* value) { if (m_profile_interface) { @@ -339,7 +339,7 @@ void ControllerSettingsDialog::setStringValue(const char* section, const char* k } } -void ControllerSettingsDialog::clearSettingValue(const char* section, const char* key) +void ControllerSettingsWindow::clearSettingValue(const char* section, const char* key) { if (m_profile_interface) { @@ -355,7 +355,7 @@ void ControllerSettingsDialog::clearSettingValue(const char* section, const char } } -void ControllerSettingsDialog::createWidgets() +void ControllerSettingsWindow::createWidgets() { QSignalBlocker sb(m_ui.settingsContainer); QSignalBlocker sb2(m_ui.settingsCategory); @@ -381,7 +381,7 @@ void ControllerSettingsDialog::createWidgets() m_ui.settingsCategory->setCurrentRow(0); m_global_settings = new ControllerGlobalSettingsWidget(m_ui.settingsContainer, this); m_ui.settingsContainer->addWidget(m_global_settings); - connect(m_global_settings, &ControllerGlobalSettingsWidget::bindingSetupChanged, this, &ControllerSettingsDialog::createWidgets); + connect(m_global_settings, &ControllerGlobalSettingsWidget::bindingSetupChanged, this, &ControllerSettingsWindow::createWidgets); for (const QPair& dev : m_device_list) m_global_settings->addDeviceToList(dev.first, dev.second); } @@ -448,7 +448,7 @@ void ControllerSettingsDialog::createWidgets() m_ui.restoreDefaults->setEnabled(isEditingGlobalSettings()); } -void ControllerSettingsDialog::updateListDescription(u32 global_slot, ControllerBindingWidget* widget) +void ControllerSettingsWindow::updateListDescription(u32 global_slot, ControllerBindingWidget* widget) { for (int i = 0; i < m_ui.settingsCategory->count(); i++) { @@ -472,7 +472,7 @@ void ControllerSettingsDialog::updateListDescription(u32 global_slot, Controller } } -void ControllerSettingsDialog::updateListDescription(u32 port, USBDeviceWidget* widget) +void ControllerSettingsWindow::updateListDescription(u32 port, USBDeviceWidget* widget) { for (int i = 0; i < m_ui.settingsCategory->count(); i++) { @@ -490,7 +490,7 @@ void ControllerSettingsDialog::updateListDescription(u32 port, USBDeviceWidget* } } -void ControllerSettingsDialog::refreshProfileList() +void ControllerSettingsWindow::refreshProfileList() { const std::vector names = Pad::GetInputProfileNames(); @@ -510,7 +510,7 @@ void ControllerSettingsDialog::refreshProfileList() } } -void ControllerSettingsDialog::switchProfile(const QString& name) +void ControllerSettingsWindow::switchProfile(const QString& name) { QSignalBlocker sb(m_ui.currentProfile); diff --git a/pcsx2-qt/Settings/ControllerSettingsDialog.h b/pcsx2-qt/Settings/ControllerSettingsWindow.h similarity index 92% rename from pcsx2-qt/Settings/ControllerSettingsDialog.h rename to pcsx2-qt/Settings/ControllerSettingsWindow.h index c3984bc15353c..2c18dab8bb600 100644 --- a/pcsx2-qt/Settings/ControllerSettingsDialog.h +++ b/pcsx2-qt/Settings/ControllerSettingsWindow.h @@ -1,5 +1,5 @@ /* PCSX2 - PS2 Emulator for PCs - * Copyright (C) 2002-2023 PCSX2 Dev Team + * Copyright (C) 2002-2023 PCSX2 Dev Team * * PCSX2 is free software: you can redistribute it and/or modify it under the terms * of the GNU Lesser General Public License as published by the Free Software Found- @@ -14,7 +14,7 @@ */ #pragma once -#include "ui_ControllerSettingsDialog.h" +#include "ui_ControllerSettingsWindow.h" #include "pcsx2/Input/InputManager.h" #include "pcsx2/USB/USB.h" @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include @@ -34,7 +34,7 @@ class USBDeviceWidget; class SettingsInterface; -class ControllerSettingsDialog final : public QDialog +class ControllerSettingsWindow final : public QWidget { Q_OBJECT @@ -52,8 +52,8 @@ class ControllerSettingsDialog final : public QDialog MAX_PORTS = 8 }; - ControllerSettingsDialog(QWidget* parent = nullptr); - ~ControllerSettingsDialog(); + ControllerSettingsWindow(); + ~ControllerSettingsWindow(); __fi HotkeySettingsWidget* getHotkeySettingsWidget() const { return m_hotkey_settings; } @@ -101,7 +101,7 @@ private Q_SLOTS: void refreshProfileList(); void switchProfile(const QString& name); - Ui::ControllerSettingsDialog m_ui; + Ui::ControllerSettingsWindow m_ui; ControllerGlobalSettingsWidget* m_global_settings = nullptr; std::array m_port_bindings{}; diff --git a/pcsx2-qt/Settings/ControllerSettingsDialog.ui b/pcsx2-qt/Settings/ControllerSettingsWindow.ui similarity index 95% rename from pcsx2-qt/Settings/ControllerSettingsDialog.ui rename to pcsx2-qt/Settings/ControllerSettingsWindow.ui index cebf55c8f299d..23caa78bca689 100644 --- a/pcsx2-qt/Settings/ControllerSettingsDialog.ui +++ b/pcsx2-qt/Settings/ControllerSettingsWindow.ui @@ -1,9 +1,11 @@ - ControllerSettingsDialog - - - Qt::WindowModal + ControllerSettingsWindow + + + + :/icons/AppIcon64.png + diff --git a/pcsx2-qt/Settings/DEV9DnsHostDialog.cpp b/pcsx2-qt/Settings/DEV9DnsHostDialog.cpp index a0c900129f1bf..e311e787d2954 100644 --- a/pcsx2-qt/Settings/DEV9DnsHostDialog.cpp +++ b/pcsx2-qt/Settings/DEV9DnsHostDialog.cpp @@ -25,7 +25,7 @@ #include "QtHost.h" #include "QtUtils.h" #include "SettingWidgetBinder.h" -#include "SettingsDialog.h" +#include "SettingsWindow.h" //Figure out lists //On export, we take list from settings (or are given it from the DEV9 panel) diff --git a/pcsx2-qt/Settings/DEV9DnsHostDialog.h b/pcsx2-qt/Settings/DEV9DnsHostDialog.h index 7ccdc0b1c8535..bdd1c84cda7c0 100644 --- a/pcsx2-qt/Settings/DEV9DnsHostDialog.h +++ b/pcsx2-qt/Settings/DEV9DnsHostDialog.h @@ -23,7 +23,7 @@ #include "DEV9UiCommon.h" -class SettingsDialog; +class SettingsWindow; class DEV9DnsHostDialog : public QDialog { diff --git a/pcsx2-qt/Settings/DEV9SettingsWidget.cpp b/pcsx2-qt/Settings/DEV9SettingsWidget.cpp index ab12883f31a5c..5b18f3a7e8d62 100644 --- a/pcsx2-qt/Settings/DEV9SettingsWidget.cpp +++ b/pcsx2-qt/Settings/DEV9SettingsWidget.cpp @@ -30,7 +30,7 @@ #include "QtHost.h" #include "QtUtils.h" #include "SettingWidgetBinder.h" -#include "SettingsDialog.h" +#include "SettingsWindow.h" #include "HddCreateQt.h" @@ -58,7 +58,7 @@ static const char* s_dns_name[] = { using PacketReader::IP::IP_Address; -DEV9SettingsWidget::DEV9SettingsWidget(SettingsDialog* dialog, QWidget* parent) +DEV9SettingsWidget::DEV9SettingsWidget(SettingsWindow* dialog, QWidget* parent) : QWidget(parent) , m_dialog{dialog} { diff --git a/pcsx2-qt/Settings/DEV9SettingsWidget.h b/pcsx2-qt/Settings/DEV9SettingsWidget.h index dd6ce0d2886f0..765383100f092 100644 --- a/pcsx2-qt/Settings/DEV9SettingsWidget.h +++ b/pcsx2-qt/Settings/DEV9SettingsWidget.h @@ -24,7 +24,7 @@ #include "DEV9DnsHostDialog.h" #include "DEV9/net.h" -class SettingsDialog; +class SettingsWindow; class DEV9SettingsWidget : public QWidget { @@ -54,7 +54,7 @@ private Q_SLOTS: void onHddCreateClicked(); public: - DEV9SettingsWidget(SettingsDialog* dialog, QWidget* parent); + DEV9SettingsWidget(SettingsWindow* dialog, QWidget* parent); ~DEV9SettingsWidget(); protected: @@ -73,7 +73,7 @@ private Q_SLOTS: void UpdateHddSizeUIEnabled(); void UpdateHddSizeUIValues(); - SettingsDialog* m_dialog; + SettingsWindow* m_dialog; Ui::DEV9SettingsWidget m_ui; diff --git a/pcsx2-qt/Settings/DebugSettingsWidget.cpp b/pcsx2-qt/Settings/DebugSettingsWidget.cpp index 969683172503f..dc5135739c5d8 100644 --- a/pcsx2-qt/Settings/DebugSettingsWidget.cpp +++ b/pcsx2-qt/Settings/DebugSettingsWidget.cpp @@ -18,13 +18,13 @@ #include "DebugSettingsWidget.h" #include "QtUtils.h" #include "SettingWidgetBinder.h" -#include "SettingsDialog.h" +#include "SettingsWindow.h" #include "pcsx2/Host.h" #include -DebugSettingsWidget::DebugSettingsWidget(SettingsDialog* dialog, QWidget* parent) +DebugSettingsWidget::DebugSettingsWidget(SettingsWindow* dialog, QWidget* parent) : QWidget(parent) , m_dialog(dialog) { diff --git a/pcsx2-qt/Settings/DebugSettingsWidget.h b/pcsx2-qt/Settings/DebugSettingsWidget.h index 43d0f284d64f7..c8d670ab3f2ca 100644 --- a/pcsx2-qt/Settings/DebugSettingsWidget.h +++ b/pcsx2-qt/Settings/DebugSettingsWidget.h @@ -21,21 +21,21 @@ enum class GSRendererType : s8; -class SettingsDialog; +class SettingsWindow; class DebugSettingsWidget : public QWidget { Q_OBJECT public: - DebugSettingsWidget(SettingsDialog* dialog, QWidget* parent); + DebugSettingsWidget(SettingsWindow* dialog, QWidget* parent); ~DebugSettingsWidget(); private Q_SLOTS: void onDrawDumpingChanged(); private: - SettingsDialog* m_dialog; + SettingsWindow* m_dialog; Ui::DebugSettingsWidget m_ui; }; diff --git a/pcsx2-qt/Settings/EmulationSettingsWidget.cpp b/pcsx2-qt/Settings/EmulationSettingsWidget.cpp index 1ab080ae98271..ebcab929c2f00 100644 --- a/pcsx2-qt/Settings/EmulationSettingsWidget.cpp +++ b/pcsx2-qt/Settings/EmulationSettingsWidget.cpp @@ -24,7 +24,7 @@ #include "EmulationSettingsWidget.h" #include "QtUtils.h" #include "SettingWidgetBinder.h" -#include "SettingsDialog.h" +#include "SettingsWindow.h" static constexpr int MINIMUM_EE_CYCLE_RATE = -3; static constexpr int MAXIMUM_EE_CYCLE_RATE = 3; @@ -32,7 +32,7 @@ static constexpr int DEFAULT_EE_CYCLE_RATE = 0; static constexpr int DEFAULT_EE_CYCLE_SKIP = 0; static constexpr u32 DEFAULT_FRAME_LATENCY = 2; -EmulationSettingsWidget::EmulationSettingsWidget(SettingsDialog* dialog, QWidget* parent) +EmulationSettingsWidget::EmulationSettingsWidget(SettingsWindow* dialog, QWidget* parent) : QWidget(parent) , m_dialog(dialog) { diff --git a/pcsx2-qt/Settings/EmulationSettingsWidget.h b/pcsx2-qt/Settings/EmulationSettingsWidget.h index 95dae600ad6e4..80f488659b914 100644 --- a/pcsx2-qt/Settings/EmulationSettingsWidget.h +++ b/pcsx2-qt/Settings/EmulationSettingsWidget.h @@ -19,14 +19,14 @@ #include "ui_EmulationSettingsWidget.h" -class SettingsDialog; +class SettingsWindow; class EmulationSettingsWidget : public QWidget { Q_OBJECT public: - EmulationSettingsWidget(SettingsDialog* dialog, QWidget* parent); + EmulationSettingsWidget(SettingsWindow* dialog, QWidget* parent); ~EmulationSettingsWidget(); private Q_SLOTS: @@ -37,7 +37,7 @@ private Q_SLOTS: void handleSpeedComboChange(QComboBox* cb, const char* section, const char* key); void updateOptimalFramePacing(); - SettingsDialog* m_dialog; + SettingsWindow* m_dialog; Ui::EmulationSettingsWidget m_ui; }; diff --git a/pcsx2-qt/Settings/FolderSettingsWidget.cpp b/pcsx2-qt/Settings/FolderSettingsWidget.cpp index b097e8d5dba67..258d376e68a61 100644 --- a/pcsx2-qt/Settings/FolderSettingsWidget.cpp +++ b/pcsx2-qt/Settings/FolderSettingsWidget.cpp @@ -20,9 +20,9 @@ #include "FolderSettingsWidget.h" #include "SettingWidgetBinder.h" -#include "SettingsDialog.h" +#include "SettingsWindow.h" -FolderSettingsWidget::FolderSettingsWidget(SettingsDialog* dialog, QWidget* parent) +FolderSettingsWidget::FolderSettingsWidget(SettingsWindow* dialog, QWidget* parent) : QWidget(parent) { SettingsInterface* sif = dialog->getSettingsInterface(); diff --git a/pcsx2-qt/Settings/FolderSettingsWidget.h b/pcsx2-qt/Settings/FolderSettingsWidget.h index 0f2d0c1f1f7e4..9d651eef7e9c5 100644 --- a/pcsx2-qt/Settings/FolderSettingsWidget.h +++ b/pcsx2-qt/Settings/FolderSettingsWidget.h @@ -19,14 +19,14 @@ #include "ui_FolderSettingsWidget.h" -class SettingsDialog; +class SettingsWindow; class FolderSettingsWidget : public QWidget { Q_OBJECT public: - FolderSettingsWidget(SettingsDialog* dialog, QWidget* parent); + FolderSettingsWidget(SettingsWindow* dialog, QWidget* parent); ~FolderSettingsWidget(); private: diff --git a/pcsx2-qt/Settings/GameCheatSettingsWidget.cpp b/pcsx2-qt/Settings/GameCheatSettingsWidget.cpp index 7124b1604cd15..22a23391f1be6 100644 --- a/pcsx2-qt/Settings/GameCheatSettingsWidget.cpp +++ b/pcsx2-qt/Settings/GameCheatSettingsWidget.cpp @@ -20,14 +20,14 @@ #include "QtUtils.h" #include "SettingWidgetBinder.h" #include "Settings/GameCheatSettingsWidget.h" -#include "Settings/SettingsDialog.h" +#include "Settings/SettingsWindow.h" #include "pcsx2/GameList.h" #include "pcsx2/Patch.h" #include "common/HeterogeneousContainers.h" -GameCheatSettingsWidget::GameCheatSettingsWidget(SettingsDialog* dialog, QWidget* parent) +GameCheatSettingsWidget::GameCheatSettingsWidget(SettingsWindow* dialog, QWidget* parent) : m_dialog(dialog) { m_ui.setupUi(this); diff --git a/pcsx2-qt/Settings/GameCheatSettingsWidget.h b/pcsx2-qt/Settings/GameCheatSettingsWidget.h index 8467d221a0e36..eeff96e718580 100644 --- a/pcsx2-qt/Settings/GameCheatSettingsWidget.h +++ b/pcsx2-qt/Settings/GameCheatSettingsWidget.h @@ -32,14 +32,14 @@ namespace GameList struct Entry; } -class SettingsDialog; +class SettingsWindow; class GameCheatSettingsWidget : public QWidget { Q_OBJECT public: - GameCheatSettingsWidget(SettingsDialog* dialog, QWidget* parent); + GameCheatSettingsWidget(SettingsWindow* dialog, QWidget* parent); ~GameCheatSettingsWidget(); private Q_SLOTS: @@ -57,7 +57,7 @@ private Q_SLOTS: void reloadList(); Ui::GameCheatSettingsWidget m_ui; - SettingsDialog* m_dialog; + SettingsWindow* m_dialog; UnorderedStringMap m_parent_map; std::vector m_patches; diff --git a/pcsx2-qt/Settings/GameFixSettingsWidget.cpp b/pcsx2-qt/Settings/GameFixSettingsWidget.cpp index 736747a795708..5a7be819ded81 100644 --- a/pcsx2-qt/Settings/GameFixSettingsWidget.cpp +++ b/pcsx2-qt/Settings/GameFixSettingsWidget.cpp @@ -22,9 +22,9 @@ #include "QtHost.h" #include "QtUtils.h" #include "SettingWidgetBinder.h" -#include "SettingsDialog.h" +#include "SettingsWindow.h" -GameFixSettingsWidget::GameFixSettingsWidget(SettingsDialog* dialog, QWidget* parent) +GameFixSettingsWidget::GameFixSettingsWidget(SettingsWindow* dialog, QWidget* parent) : QWidget(parent) { SettingsInterface* sif = dialog->getSettingsInterface(); diff --git a/pcsx2-qt/Settings/GameFixSettingsWidget.h b/pcsx2-qt/Settings/GameFixSettingsWidget.h index 0e7ab53dde9a4..14bef809735ed 100644 --- a/pcsx2-qt/Settings/GameFixSettingsWidget.h +++ b/pcsx2-qt/Settings/GameFixSettingsWidget.h @@ -19,14 +19,14 @@ #include "ui_GameFixSettingsWidget.h" -class SettingsDialog; +class SettingsWindow; class GameFixSettingsWidget : public QWidget { Q_OBJECT public: - GameFixSettingsWidget(SettingsDialog* dialog, QWidget* parent); + GameFixSettingsWidget(SettingsWindow* dialog, QWidget* parent); ~GameFixSettingsWidget(); private: diff --git a/pcsx2-qt/Settings/GameListSettingsWidget.cpp b/pcsx2-qt/Settings/GameListSettingsWidget.cpp index b91e0797821ab..a4682a98606a1 100644 --- a/pcsx2-qt/Settings/GameListSettingsWidget.cpp +++ b/pcsx2-qt/Settings/GameListSettingsWidget.cpp @@ -31,7 +31,7 @@ #include "QtHost.h" #include "QtUtils.h" -GameListSettingsWidget::GameListSettingsWidget(SettingsDialog* dialog, QWidget* parent) +GameListSettingsWidget::GameListSettingsWidget(SettingsWindow* dialog, QWidget* parent) : QWidget(parent) { m_ui.setupUi(this); diff --git a/pcsx2-qt/Settings/GameListSettingsWidget.h b/pcsx2-qt/Settings/GameListSettingsWidget.h index eaa76d76717a5..1c9bce55ce457 100644 --- a/pcsx2-qt/Settings/GameListSettingsWidget.h +++ b/pcsx2-qt/Settings/GameListSettingsWidget.h @@ -19,14 +19,14 @@ #include "ui_GameListSettingsWidget.h" -class SettingsDialog; +class SettingsWindow; class GameListSettingsWidget : public QWidget { Q_OBJECT public: - GameListSettingsWidget(SettingsDialog* dialog, QWidget* parent); + GameListSettingsWidget(SettingsWindow* dialog, QWidget* parent); ~GameListSettingsWidget(); bool addExcludedPath(const std::string& path); diff --git a/pcsx2-qt/Settings/GamePatchSettingsWidget.cpp b/pcsx2-qt/Settings/GamePatchSettingsWidget.cpp index f83f29e440385..3e1b7ed68f7d7 100644 --- a/pcsx2-qt/Settings/GamePatchSettingsWidget.cpp +++ b/pcsx2-qt/Settings/GamePatchSettingsWidget.cpp @@ -19,7 +19,7 @@ #include "QtHost.h" #include "QtUtils.h" #include "Settings/GamePatchSettingsWidget.h" -#include "Settings/SettingsDialog.h" +#include "Settings/SettingsWindow.h" #include "pcsx2/GameList.h" #include "pcsx2/Patch.h" @@ -29,7 +29,7 @@ #include GamePatchDetailsWidget::GamePatchDetailsWidget(std::string name, const std::string& author, - const std::string& description, bool enabled, SettingsDialog* dialog, QWidget* parent) + const std::string& description, bool enabled, SettingsWindow* dialog, QWidget* parent) : QWidget(parent) , m_dialog(dialog) , m_name(name) @@ -61,7 +61,7 @@ void GamePatchDetailsWidget::onEnabledStateChanged(int state) g_emu_thread->reloadGameSettings(); } -GamePatchSettingsWidget::GamePatchSettingsWidget(SettingsDialog* dialog, QWidget* parent) +GamePatchSettingsWidget::GamePatchSettingsWidget(SettingsWindow* dialog, QWidget* parent) : m_dialog(dialog) { m_ui.setupUi(this); diff --git a/pcsx2-qt/Settings/GamePatchSettingsWidget.h b/pcsx2-qt/Settings/GamePatchSettingsWidget.h index dc10b3184d487..323942f5b53cd 100644 --- a/pcsx2-qt/Settings/GamePatchSettingsWidget.h +++ b/pcsx2-qt/Settings/GamePatchSettingsWidget.h @@ -27,7 +27,7 @@ namespace GameList struct Entry; } -class SettingsDialog; +class SettingsWindow; class GamePatchDetailsWidget : public QWidget { @@ -35,7 +35,7 @@ class GamePatchDetailsWidget : public QWidget public: GamePatchDetailsWidget(std::string name, const std::string& author, const std::string& description, bool enabled, - SettingsDialog* dialog, QWidget* parent); + SettingsWindow* dialog, QWidget* parent); ~GamePatchDetailsWidget(); private Q_SLOTS: @@ -43,7 +43,7 @@ private Q_SLOTS: private: Ui::GamePatchDetailsWidget m_ui; - SettingsDialog* m_dialog; + SettingsWindow* m_dialog; std::string m_name; }; @@ -52,7 +52,7 @@ class GamePatchSettingsWidget : public QWidget Q_OBJECT public: - GamePatchSettingsWidget(SettingsDialog* dialog, QWidget* parent); + GamePatchSettingsWidget(SettingsWindow* dialog, QWidget* parent); ~GamePatchSettingsWidget(); private Q_SLOTS: @@ -62,5 +62,5 @@ private Q_SLOTS: void reloadList(); Ui::GamePatchSettingsWidget m_ui; - SettingsDialog* m_dialog; + SettingsWindow* m_dialog; }; diff --git a/pcsx2-qt/Settings/GameSummaryWidget.cpp b/pcsx2-qt/Settings/GameSummaryWidget.cpp index 9bbbf8c337835..2601b3815ee27 100644 --- a/pcsx2-qt/Settings/GameSummaryWidget.cpp +++ b/pcsx2-qt/Settings/GameSummaryWidget.cpp @@ -17,7 +17,7 @@ #include "pcsx2/SIO/Pad/Pad.h" #include "GameSummaryWidget.h" -#include "SettingsDialog.h" +#include "SettingsWindow.h" #include "MainWindow.h" #include "QtHost.h" #include "QtProgressCallback.h" @@ -38,7 +38,7 @@ #include #include -GameSummaryWidget::GameSummaryWidget(const GameList::Entry* entry, SettingsDialog* dialog, QWidget* parent) +GameSummaryWidget::GameSummaryWidget(const GameList::Entry* entry, SettingsWindow* dialog, QWidget* parent) : m_dialog(dialog) { m_ui.setupUi(this); diff --git a/pcsx2-qt/Settings/GameSummaryWidget.h b/pcsx2-qt/Settings/GameSummaryWidget.h index 75f1e78788cc4..79b823db58049 100644 --- a/pcsx2-qt/Settings/GameSummaryWidget.h +++ b/pcsx2-qt/Settings/GameSummaryWidget.h @@ -24,14 +24,14 @@ namespace GameList struct Entry; } -class SettingsDialog; +class SettingsWindow; class GameSummaryWidget : public QWidget { Q_OBJECT public: - GameSummaryWidget(const GameList::Entry* entry, SettingsDialog* dialog, QWidget* parent); + GameSummaryWidget(const GameList::Entry* entry, SettingsWindow* dialog, QWidget* parent); ~GameSummaryWidget(); private Q_SLOTS: @@ -53,7 +53,7 @@ private Q_SLOTS: void setCustomRegion(int region); Ui::GameSummaryWidget m_ui; - SettingsDialog* m_dialog; + SettingsWindow* m_dialog; std::string m_entry_path; std::string m_redump_search_keyword; }; diff --git a/pcsx2-qt/Settings/GraphicsSettingsWidget.cpp b/pcsx2-qt/Settings/GraphicsSettingsWidget.cpp index 3d5c840f4772f..fca9cb3df9156 100644 --- a/pcsx2-qt/Settings/GraphicsSettingsWidget.cpp +++ b/pcsx2-qt/Settings/GraphicsSettingsWidget.cpp @@ -18,7 +18,7 @@ #include "GraphicsSettingsWidget.h" #include "QtUtils.h" #include "SettingWidgetBinder.h" -#include "SettingsDialog.h" +#include "SettingsWindow.h" #include #include "pcsx2/Host.h" @@ -67,7 +67,7 @@ static constexpr int DEFAULT_INTERLACE_MODE = 0; static constexpr int DEFAULT_TV_SHADER_MODE = 0; static constexpr int DEFAULT_CAS_SHARPNESS = 50; -GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsDialog* dialog, QWidget* parent) +GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsWindow* dialog, QWidget* parent) : QWidget(parent) , m_dialog(dialog) { diff --git a/pcsx2-qt/Settings/GraphicsSettingsWidget.h b/pcsx2-qt/Settings/GraphicsSettingsWidget.h index 248aa8d277c6d..dce3eaab3a0e2 100644 --- a/pcsx2-qt/Settings/GraphicsSettingsWidget.h +++ b/pcsx2-qt/Settings/GraphicsSettingsWidget.h @@ -21,14 +21,14 @@ enum class GSRendererType : s8; -class SettingsDialog; +class SettingsWindow; class GraphicsSettingsWidget : public QWidget { Q_OBJECT public: - GraphicsSettingsWidget(SettingsDialog* dialog, QWidget* parent); + GraphicsSettingsWidget(SettingsWindow* dialog, QWidget* parent); ~GraphicsSettingsWidget(); Q_SIGNALS: @@ -56,7 +56,7 @@ private Q_SLOTS: void updateRendererDependentOptions(); void resetManualHardwareFixes(); - SettingsDialog* m_dialog; + SettingsWindow* m_dialog; Ui::GraphicsSettingsWidget m_ui; diff --git a/pcsx2-qt/Settings/HotkeySettingsWidget.cpp b/pcsx2-qt/Settings/HotkeySettingsWidget.cpp index 865525fd44cd9..8cd334f1b7daf 100644 --- a/pcsx2-qt/Settings/HotkeySettingsWidget.cpp +++ b/pcsx2-qt/Settings/HotkeySettingsWidget.cpp @@ -16,7 +16,7 @@ #include "PrecompiledHeader.h" #include "Settings/HotkeySettingsWidget.h" -#include "Settings/ControllerSettingsDialog.h" +#include "Settings/ControllerSettingsWindow.h" #include "InputBindingWidget.h" #include "QtUtils.h" #include "SettingWidgetBinder.h" @@ -29,7 +29,7 @@ #include #include -HotkeySettingsWidget::HotkeySettingsWidget(QWidget* parent, ControllerSettingsDialog* dialog) +HotkeySettingsWidget::HotkeySettingsWidget(QWidget* parent, ControllerSettingsWindow* dialog) : QWidget(parent) , m_dialog(dialog) { diff --git a/pcsx2-qt/Settings/HotkeySettingsWidget.h b/pcsx2-qt/Settings/HotkeySettingsWidget.h index 647d7122497a0..171f308d252f8 100644 --- a/pcsx2-qt/Settings/HotkeySettingsWidget.h +++ b/pcsx2-qt/Settings/HotkeySettingsWidget.h @@ -24,21 +24,21 @@ class QScrollArea; class QGridLayout; class QVBoxLayout; -class ControllerSettingsDialog; +class ControllerSettingsWindow; class HotkeySettingsWidget : public QWidget { Q_OBJECT public: - HotkeySettingsWidget(QWidget* parent, ControllerSettingsDialog* dialog); + HotkeySettingsWidget(QWidget* parent, ControllerSettingsWindow* dialog); ~HotkeySettingsWidget(); private: void createUi(); void createButtons(); - ControllerSettingsDialog* m_dialog; + ControllerSettingsWindow* m_dialog; QScrollArea* m_scroll_area = nullptr; QWidget* m_container = nullptr; QVBoxLayout* m_layout = nullptr; diff --git a/pcsx2-qt/Settings/InputBindingWidget.cpp b/pcsx2-qt/Settings/InputBindingWidget.cpp index b424309b92464..601d774ae4cfa 100644 --- a/pcsx2-qt/Settings/InputBindingWidget.cpp +++ b/pcsx2-qt/Settings/InputBindingWidget.cpp @@ -29,7 +29,7 @@ #include "QtHost.h" #include "QtUtils.h" -#include "Settings/ControllerSettingsDialog.h" +#include "Settings/ControllerSettingsWindow.h" #include "Settings/InputBindingDialog.h" #include "Settings/InputBindingWidget.h" @@ -416,7 +416,7 @@ InputVibrationBindingWidget::InputVibrationBindingWidget(QWidget* parent) } InputVibrationBindingWidget::InputVibrationBindingWidget( - QWidget* parent, ControllerSettingsDialog* dialog, std::string section_name, std::string key_name) + QWidget* parent, ControllerSettingsWindow* dialog, std::string section_name, std::string key_name) { setMinimumWidth(225); setMaximumWidth(225); @@ -430,7 +430,7 @@ InputVibrationBindingWidget::~InputVibrationBindingWidget() { } -void InputVibrationBindingWidget::setKey(ControllerSettingsDialog* dialog, std::string section_name, std::string key_name) +void InputVibrationBindingWidget::setKey(ControllerSettingsWindow* dialog, std::string section_name, std::string key_name) { m_dialog = dialog; m_section_name = std::move(section_name); diff --git a/pcsx2-qt/Settings/InputBindingWidget.h b/pcsx2-qt/Settings/InputBindingWidget.h index 080be9fe9e046..214f98014189d 100644 --- a/pcsx2-qt/Settings/InputBindingWidget.h +++ b/pcsx2-qt/Settings/InputBindingWidget.h @@ -25,7 +25,7 @@ class QTimer; -class ControllerSettingsDialog; +class ControllerSettingsWindow; class SettingsInterface; class InputBindingWidget : public QPushButton @@ -92,10 +92,10 @@ class InputVibrationBindingWidget : public QPushButton public: InputVibrationBindingWidget(QWidget* parent); - InputVibrationBindingWidget(QWidget* parent, ControllerSettingsDialog* dialog, std::string section_name, std::string key_name); + InputVibrationBindingWidget(QWidget* parent, ControllerSettingsWindow* dialog, std::string section_name, std::string key_name); ~InputVibrationBindingWidget(); - void setKey(ControllerSettingsDialog* dialog, std::string section_name, std::string key_name); + void setKey(ControllerSettingsWindow* dialog, std::string section_name, std::string key_name); public Q_SLOTS: void clearBinding(); @@ -111,5 +111,5 @@ protected Q_SLOTS: std::string m_key_name; std::string m_binding; - ControllerSettingsDialog* m_dialog; + ControllerSettingsWindow* m_dialog; }; diff --git a/pcsx2-qt/Settings/InterfaceSettingsWidget.cpp b/pcsx2-qt/Settings/InterfaceSettingsWidget.cpp index f89cd998149ed..c5f3cf2f7c5a7 100644 --- a/pcsx2-qt/Settings/InterfaceSettingsWidget.cpp +++ b/pcsx2-qt/Settings/InterfaceSettingsWidget.cpp @@ -19,7 +19,7 @@ #include "AutoUpdaterDialog.h" #include "MainWindow.h" #include "SettingWidgetBinder.h" -#include "SettingsDialog.h" +#include "SettingsWindow.h" #include "QtHost.h" const char* InterfaceSettingsWidget::THEME_NAMES[] = { @@ -69,7 +69,7 @@ const char* InterfaceSettingsWidget::THEME_VALUES[] = { "Custom", nullptr}; -InterfaceSettingsWidget::InterfaceSettingsWidget(SettingsDialog* dialog, QWidget* parent) +InterfaceSettingsWidget::InterfaceSettingsWidget(SettingsWindow* dialog, QWidget* parent) : QWidget(parent) { SettingsInterface* sif = dialog->getSettingsInterface(); diff --git a/pcsx2-qt/Settings/InterfaceSettingsWidget.h b/pcsx2-qt/Settings/InterfaceSettingsWidget.h index 547142cae23fc..e3788c1f21f42 100644 --- a/pcsx2-qt/Settings/InterfaceSettingsWidget.h +++ b/pcsx2-qt/Settings/InterfaceSettingsWidget.h @@ -19,14 +19,14 @@ #include "ui_InterfaceSettingsWidget.h" -class SettingsDialog; +class SettingsWindow; class InterfaceSettingsWidget : public QWidget { Q_OBJECT public: - InterfaceSettingsWidget(SettingsDialog* dialog, QWidget* parent); + InterfaceSettingsWidget(SettingsWindow* dialog, QWidget* parent); ~InterfaceSettingsWidget(); Q_SIGNALS: diff --git a/pcsx2-qt/Settings/MemoryCardSettingsWidget.cpp b/pcsx2-qt/Settings/MemoryCardSettingsWidget.cpp index e7edfbb968eb2..20b166a014b71 100644 --- a/pcsx2-qt/Settings/MemoryCardSettingsWidget.cpp +++ b/pcsx2-qt/Settings/MemoryCardSettingsWidget.cpp @@ -30,7 +30,7 @@ #include "QtHost.h" #include "QtUtils.h" #include "SettingWidgetBinder.h" -#include "SettingsDialog.h" +#include "SettingsWindow.h" #include "pcsx2/SIO/Memcard/MemoryCardFile.h" @@ -41,7 +41,7 @@ static std::string getSlotFilenameKey(u32 slot) return StringUtil::StdStringFromFormat("Slot%u_Filename", slot + 1); } -MemoryCardSettingsWidget::MemoryCardSettingsWidget(SettingsDialog* dialog, QWidget* parent) +MemoryCardSettingsWidget::MemoryCardSettingsWidget(SettingsWindow* dialog, QWidget* parent) : QWidget(parent) , m_dialog(dialog) { @@ -442,7 +442,7 @@ void MemoryCardListWidget::mouseMoveEvent(QMouseEvent* event) drag->exec(Qt::CopyAction); } -void MemoryCardListWidget::refresh(SettingsDialog* dialog) +void MemoryCardListWidget::refresh(SettingsWindow* dialog) { clear(); diff --git a/pcsx2-qt/Settings/MemoryCardSettingsWidget.h b/pcsx2-qt/Settings/MemoryCardSettingsWidget.h index 8e2fe78485324..b4757343a5249 100644 --- a/pcsx2-qt/Settings/MemoryCardSettingsWidget.h +++ b/pcsx2-qt/Settings/MemoryCardSettingsWidget.h @@ -25,7 +25,7 @@ #include #include -class SettingsDialog; +class SettingsWindow; struct AvailableMcdInfo; @@ -36,7 +36,7 @@ class MemoryCardListWidget final : public QTreeWidget explicit MemoryCardListWidget(QWidget* parent); ~MemoryCardListWidget() override; - void refresh(SettingsDialog* dialog); + void refresh(SettingsWindow* dialog); protected: void mousePressEvent(QMouseEvent* event) override; @@ -78,7 +78,7 @@ class MemoryCardSettingsWidget : public QWidget MAX_SLOTS = 2 }; - MemoryCardSettingsWidget(SettingsDialog* dialog, QWidget* parent); + MemoryCardSettingsWidget(SettingsWindow* dialog, QWidget* parent); ~MemoryCardSettingsWidget(); protected: @@ -115,7 +115,7 @@ private Q_SLOTS: void renameCard(); void convertCard(); - SettingsDialog* m_dialog; + SettingsWindow* m_dialog; Ui::MemoryCardSettingsWidget m_ui; std::array m_slots; diff --git a/pcsx2-qt/Settings/SettingsDialog.cpp b/pcsx2-qt/Settings/SettingsWindow.cpp similarity index 87% rename from pcsx2-qt/Settings/SettingsDialog.cpp rename to pcsx2-qt/Settings/SettingsWindow.cpp index cf7c3f60871ef..b222f2e5b1b56 100644 --- a/pcsx2-qt/Settings/SettingsDialog.cpp +++ b/pcsx2-qt/Settings/SettingsWindow.cpp @@ -35,7 +35,7 @@ #include "Settings/HotkeySettingsWidget.h" #include "Settings/InterfaceSettingsWidget.h" #include "Settings/MemoryCardSettingsWidget.h" -#include "SettingsDialog.h" +#include "SettingsWindow.h" #include "pcsx2/Achievements.h" #include "pcsx2/GameList.h" @@ -49,18 +49,18 @@ #include #include -static QList s_open_game_properties_dialogs; +static QList s_open_game_properties_dialogs; -SettingsDialog::SettingsDialog(QWidget* parent) - : QDialog(parent) +SettingsWindow::SettingsWindow() + : QWidget(nullptr) , m_disc_crc(0) { setupUi(nullptr); } -SettingsDialog::SettingsDialog(QWidget* parent, std::unique_ptr sif, const GameList::Entry* game, +SettingsWindow::SettingsWindow(std::unique_ptr sif, const GameList::Entry* game, std::string serial, u32 disc_crc, QString filename) - : QDialog(parent) + : QWidget(nullptr) , m_sif(std::move(sif)) , m_filename(std::move(filename)) , m_game_list_filename(game ? game->path : std::string()) @@ -72,12 +72,12 @@ SettingsDialog::SettingsDialog(QWidget* parent, std::unique_ptrsetCurrentRow(0); m_ui.settingsContainer->setCurrentIndex(0); m_ui.helpText->setText(m_category_help_text[0]); - connect(m_ui.settingsCategory, &QListWidget::currentRowChanged, this, &SettingsDialog::onCategoryCurrentRowChanged); - connect(m_ui.closeButton, &QPushButton::clicked, this, &SettingsDialog::close); + connect(m_ui.settingsCategory, &QListWidget::currentRowChanged, this, &SettingsWindow::onCategoryCurrentRowChanged); + connect(m_ui.closeButton, &QPushButton::clicked, this, &SettingsWindow::close); if (m_ui.restoreDefaultsButton) - connect(m_ui.restoreDefaultsButton, &QPushButton::clicked, this, &SettingsDialog::onRestoreDefaultsClicked); + connect(m_ui.restoreDefaultsButton, &QPushButton::clicked, this, &SettingsWindow::onRestoreDefaultsClicked); if (m_ui.copyGlobalSettingsButton) - connect(m_ui.copyGlobalSettingsButton, &QPushButton::clicked, this, &SettingsDialog::onCopyGlobalSettingsClicked); + connect(m_ui.copyGlobalSettingsButton, &QPushButton::clicked, this, &SettingsWindow::onCopyGlobalSettingsClicked); if (m_ui.clearGameSettingsButton) - connect(m_ui.clearGameSettingsButton, &QPushButton::clicked, this, &SettingsDialog::onClearSettingsClicked); + connect(m_ui.clearGameSettingsButton, &QPushButton::clicked, this, &SettingsWindow::onClearSettingsClicked); } -SettingsDialog::~SettingsDialog() +SettingsWindow::~SettingsWindow() { if (isPerGameSettings()) s_open_game_properties_dialogs.removeOne(this); } -void SettingsDialog::closeEvent(QCloseEvent*) +void SettingsWindow::closeEvent(QCloseEvent*) { // we need to clean up ourselves, since we're not modal if (isPerGameSettings()) deleteLater(); } -QString SettingsDialog::getCategory() const +QString SettingsWindow::getCategory() const { return m_ui.settingsCategory->item(m_ui.settingsCategory->currentRow())->text(); } -void SettingsDialog::setCategory(const char* category) +void SettingsWindow::setCategory(const char* category) { // the titles in the category list will be translated. const QString translated_category(qApp->translate("SettingsDialog", category)); @@ -269,13 +269,13 @@ void SettingsDialog::setCategory(const char* category) } } -void SettingsDialog::onCategoryCurrentRowChanged(int row) +void SettingsWindow::onCategoryCurrentRowChanged(int row) { m_ui.settingsContainer->setCurrentIndex(row); m_ui.helpText->setText(m_category_help_text[row]); } -void SettingsDialog::onRestoreDefaultsClicked() +void SettingsWindow::onRestoreDefaultsClicked() { QMessageBox msgbox(this); msgbox.setIcon(QMessageBox::Question); @@ -293,7 +293,7 @@ void SettingsDialog::onRestoreDefaultsClicked() g_main_window->resetSettings(ui_cb->isChecked()); } -void SettingsDialog::onCopyGlobalSettingsClicked() +void SettingsWindow::onCopyGlobalSettingsClicked() { if (!isPerGameSettings()) return; @@ -316,7 +316,7 @@ void SettingsDialog::onCopyGlobalSettingsClicked() QMessageBox::information(reopen(), tr("PCSX2 Settings"), tr("Per-game configuration copied from global settings.")); } -void SettingsDialog::onClearSettingsClicked() +void SettingsWindow::onClearSettingsClicked() { if (!isPerGameSettings()) return; @@ -335,7 +335,7 @@ void SettingsDialog::onClearSettingsClicked() QMessageBox::information(reopen(), tr("PCSX2 Settings"), tr("Per-game configuration cleared.")); } -SettingsDialog* SettingsDialog::reopen() +SettingsWindow* SettingsWindow::reopen() { // This doesn't work for global settings, because MainWindow maintains a pointer. if (!m_sif) @@ -350,15 +350,14 @@ SettingsDialog* SettingsDialog::reopen() auto lock = GameList::GetLock(); const GameList::Entry* game = m_game_list_filename.empty() ? nullptr : GameList::GetEntryForPath(m_game_list_filename.c_str()); - SettingsDialog* dlg = new SettingsDialog(g_main_window, std::move(new_sif), game, m_serial, m_disc_crc, m_filename); - dlg->QDialog::setWindowTitle(windowTitle()); - dlg->setModal(false); + SettingsWindow* dlg = new SettingsWindow(std::move(new_sif), game, m_serial, m_disc_crc, m_filename); + dlg->QWidget::setWindowTitle(windowTitle()); dlg->show(); return dlg; } -void SettingsDialog::addWidget(QWidget* widget, QString title, QString icon, QString help_text) +void SettingsWindow::addWidget(QWidget* widget, QString title, QString icon, QString help_text) { const int index = m_ui.settingsCategory->count(); @@ -372,7 +371,7 @@ void SettingsDialog::addWidget(QWidget* widget, QString title, QString icon, QSt m_category_help_text[index] = std::move(help_text); } -void SettingsDialog::registerWidgetHelp(QObject* object, QString title, QString recommended_value, QString text) +void SettingsWindow::registerWidgetHelp(QObject* object, QString title, QString recommended_value, QString text) { if (!object) return; @@ -392,7 +391,7 @@ void SettingsDialog::registerWidgetHelp(QObject* object, QString title, QString object->installEventFilter(this); } -bool SettingsDialog::eventFilter(QObject* object, QEvent* event) +bool SettingsWindow::eventFilter(QObject* object, QEvent* event) { if (event->type() == QEvent::Enter) { @@ -412,22 +411,18 @@ bool SettingsDialog::eventFilter(QObject* object, QEvent* event) } } - return QDialog::eventFilter(object, event); + return QWidget::eventFilter(object, event); } -void SettingsDialog::setWindowTitle(const QString& title) +void SettingsWindow::setWindowTitle(const QString& title) { if (m_filename.isEmpty()) - { - QDialog::setWindowTitle(title); - } + QWidget::setWindowTitle(title); else - { - QDialog::setWindowTitle(QStringLiteral("%1 [%2]").arg(title, m_filename)); - } + QWidget::setWindowTitle(QStringLiteral("%1 [%2]").arg(title, m_filename)); } -bool SettingsDialog::getEffectiveBoolValue(const char* section, const char* key, bool default_value) const +bool SettingsWindow::getEffectiveBoolValue(const char* section, const char* key, bool default_value) const { bool value; if (m_sif && m_sif->GetBoolValue(section, key, &value)) @@ -436,7 +431,7 @@ bool SettingsDialog::getEffectiveBoolValue(const char* section, const char* key, return Host::GetBaseBoolSettingValue(section, key, default_value); } -int SettingsDialog::getEffectiveIntValue(const char* section, const char* key, int default_value) const +int SettingsWindow::getEffectiveIntValue(const char* section, const char* key, int default_value) const { int value; if (m_sif && m_sif->GetIntValue(section, key, &value)) @@ -445,7 +440,7 @@ int SettingsDialog::getEffectiveIntValue(const char* section, const char* key, i return Host::GetBaseIntSettingValue(section, key, default_value); } -float SettingsDialog::getEffectiveFloatValue(const char* section, const char* key, float default_value) const +float SettingsWindow::getEffectiveFloatValue(const char* section, const char* key, float default_value) const { float value; if (m_sif && m_sif->GetFloatValue(section, key, &value)) @@ -454,7 +449,7 @@ float SettingsDialog::getEffectiveFloatValue(const char* section, const char* ke return Host::GetBaseFloatSettingValue(section, key, default_value); } -std::string SettingsDialog::getEffectiveStringValue(const char* section, const char* key, const char* default_value) const +std::string SettingsWindow::getEffectiveStringValue(const char* section, const char* key, const char* default_value) const { std::string value; if (!m_sif || !m_sif->GetStringValue(section, key, &value)) @@ -462,7 +457,7 @@ std::string SettingsDialog::getEffectiveStringValue(const char* section, const c return value; } -std::optional SettingsDialog::getBoolValue(const char* section, const char* key, std::optional default_value) const +std::optional SettingsWindow::getBoolValue(const char* section, const char* key, std::optional default_value) const { std::optional value; if (m_sif) @@ -481,7 +476,7 @@ std::optional SettingsDialog::getBoolValue(const char* section, const char return value; } -std::optional SettingsDialog::getIntValue(const char* section, const char* key, std::optional default_value) const +std::optional SettingsWindow::getIntValue(const char* section, const char* key, std::optional default_value) const { std::optional value; if (m_sif) @@ -500,7 +495,7 @@ std::optional SettingsDialog::getIntValue(const char* section, const char* return value; } -std::optional SettingsDialog::getFloatValue(const char* section, const char* key, std::optional default_value) const +std::optional SettingsWindow::getFloatValue(const char* section, const char* key, std::optional default_value) const { std::optional value; if (m_sif) @@ -519,7 +514,7 @@ std::optional SettingsDialog::getFloatValue(const char* section, const ch return value; } -std::optional SettingsDialog::getStringValue( +std::optional SettingsWindow::getStringValue( const char* section, const char* key, std::optional default_value) const { std::optional value; @@ -539,7 +534,7 @@ std::optional SettingsDialog::getStringValue( return value; } -void SettingsDialog::setBoolSettingValue(const char* section, const char* key, std::optional value) +void SettingsWindow::setBoolSettingValue(const char* section, const char* key, std::optional value) { if (m_sif) { @@ -555,7 +550,7 @@ void SettingsDialog::setBoolSettingValue(const char* section, const char* key, s } } -void SettingsDialog::setIntSettingValue(const char* section, const char* key, std::optional value) +void SettingsWindow::setIntSettingValue(const char* section, const char* key, std::optional value) { if (m_sif) { @@ -571,7 +566,7 @@ void SettingsDialog::setIntSettingValue(const char* section, const char* key, st } } -void SettingsDialog::setFloatSettingValue(const char* section, const char* key, std::optional value) +void SettingsWindow::setFloatSettingValue(const char* section, const char* key, std::optional value) { if (m_sif) { @@ -587,7 +582,7 @@ void SettingsDialog::setFloatSettingValue(const char* section, const char* key, } } -void SettingsDialog::setStringSettingValue(const char* section, const char* key, std::optional value) +void SettingsWindow::setStringSettingValue(const char* section, const char* key, std::optional value) { if (m_sif) { @@ -603,7 +598,7 @@ void SettingsDialog::setStringSettingValue(const char* section, const char* key, } } -bool SettingsDialog::containsSettingValue(const char* section, const char* key) const +bool SettingsWindow::containsSettingValue(const char* section, const char* key) const { if (m_sif) return m_sif->ContainsValue(section, key); @@ -611,7 +606,7 @@ bool SettingsDialog::containsSettingValue(const char* section, const char* key) return Host::ContainsBaseSettingValue(section, key); } -void SettingsDialog::removeSettingValue(const char* section, const char* key) +void SettingsWindow::removeSettingValue(const char* section, const char* key) { if (m_sif) { @@ -627,10 +622,10 @@ void SettingsDialog::removeSettingValue(const char* section, const char* key) } } -void SettingsDialog::openGamePropertiesDialog(const GameList::Entry* game, const std::string_view& title, std::string serial, u32 disc_crc) +void SettingsWindow::openGamePropertiesDialog(const GameList::Entry* game, const std::string_view& title, std::string serial, u32 disc_crc) { // check for an existing dialog with this crc - for (SettingsDialog* dialog : s_open_game_properties_dialogs) + for (SettingsWindow* dialog : s_open_game_properties_dialogs) { if (dialog->m_disc_crc == disc_crc) { @@ -645,9 +640,8 @@ void SettingsDialog::openGamePropertiesDialog(const GameList::Entry* game, const if (FileSystem::FileExists(sif->GetFileName().c_str())) sif->Load(); - SettingsDialog* dialog = new SettingsDialog(g_main_window, std::move(sif), game, std::move(serial), disc_crc, QtUtils::StringViewToQString(Path::GetFileName(filename))); + SettingsWindow* dialog = new SettingsWindow(std::move(sif), game, std::move(serial), disc_crc, QtUtils::StringViewToQString(Path::GetFileName(filename))); dialog->setWindowTitle(QtUtils::StringViewToQString(title)); - dialog->setModal(false); dialog->show(); } diff --git a/pcsx2-qt/Settings/SettingsDialog.h b/pcsx2-qt/Settings/SettingsWindow.h similarity index 94% rename from pcsx2-qt/Settings/SettingsDialog.h rename to pcsx2-qt/Settings/SettingsWindow.h index e660b94e67cc0..1a95d4c3fcaa4 100644 --- a/pcsx2-qt/Settings/SettingsDialog.h +++ b/pcsx2-qt/Settings/SettingsWindow.h @@ -1,5 +1,5 @@ /* PCSX2 - PS2 Emulator for PCs - * Copyright (C) 2002-2022 PCSX2 Dev Team + * Copyright (C) 2002-2023 PCSX2 Dev Team * * PCSX2 is free software: you can redistribute it and/or modify it under the terms * of the GNU Lesser General Public License as published by the Free Software Found- @@ -14,10 +14,10 @@ */ #pragma once -#include "ui_SettingsDialog.h" +#include "ui_SettingsWindow.h" #include #include -#include +#include #include #include @@ -45,15 +45,15 @@ class AchievementSettingsWidget; class AdvancedSettingsWidget; class DebugSettingsWidget; -class SettingsDialog final : public QDialog +class SettingsWindow final : public QWidget { Q_OBJECT public: - explicit SettingsDialog(QWidget* parent); - SettingsDialog(QWidget* parent, std::unique_ptr sif, const GameList::Entry* game, std::string serial, + explicit SettingsWindow(); + SettingsWindow(std::unique_ptr sif, const GameList::Entry* game, std::string serial, u32 disc_crc, QString filename = QString()); - ~SettingsDialog(); + ~SettingsWindow(); static void openGamePropertiesDialog(const GameList::Entry* game, const std::string_view& title, std::string serial, u32 disc_crc); @@ -125,11 +125,11 @@ private Q_SLOTS: void addWidget(QWidget* widget, QString title, QString icon, QString help_text); - SettingsDialog* reopen(); + SettingsWindow* reopen(); std::unique_ptr m_sif; - Ui::SettingsDialog m_ui; + Ui::SettingsWindow m_ui; InterfaceSettingsWidget* m_interface_settings = nullptr; GameListSettingsWidget* m_game_list_settings = nullptr; diff --git a/pcsx2-qt/Settings/SettingsDialog.ui b/pcsx2-qt/Settings/SettingsWindow.ui similarity index 94% rename from pcsx2-qt/Settings/SettingsDialog.ui rename to pcsx2-qt/Settings/SettingsWindow.ui index 72cb49afb080b..8573dc68a450d 100644 --- a/pcsx2-qt/Settings/SettingsDialog.ui +++ b/pcsx2-qt/Settings/SettingsWindow.ui @@ -1,9 +1,11 @@ - SettingsDialog - - - Qt::WindowModal + SettingsWindow + + + + :/icons/AppIcon64.png + diff --git a/pcsx2-qt/pcsx2-qt.vcxproj b/pcsx2-qt/pcsx2-qt.vcxproj index 4f3c280a5aa17..6fe15b2a8ef3c 100644 --- a/pcsx2-qt/pcsx2-qt.vcxproj +++ b/pcsx2-qt/pcsx2-qt.vcxproj @@ -111,13 +111,13 @@ - + - + @@ -151,13 +151,13 @@ - + - + @@ -212,13 +212,13 @@ - + - + @@ -274,7 +274,7 @@ Document - + Document @@ -301,7 +301,7 @@ Document - + Document diff --git a/pcsx2-qt/pcsx2-qt.vcxproj.filters b/pcsx2-qt/pcsx2-qt.vcxproj.filters index 4d84ce1358133..7665f894c9657 100644 --- a/pcsx2-qt/pcsx2-qt.vcxproj.filters +++ b/pcsx2-qt/pcsx2-qt.vcxproj.filters @@ -66,7 +66,7 @@ Settings - + Settings @@ -84,7 +84,7 @@ moc - + moc @@ -130,7 +130,7 @@ moc - + moc @@ -142,7 +142,7 @@ moc - + Settings @@ -374,7 +374,7 @@ Settings - + Settings @@ -402,7 +402,7 @@ GameList - + Settings @@ -513,7 +513,7 @@ Settings - + Settings @@ -525,7 +525,7 @@ Settings - + Settings