diff --git a/Source/Core/DolphinQt2/Config/ControllersWindow.cpp b/Source/Core/DolphinQt2/Config/ControllersWindow.cpp index 6e1fe5f14b..cb62e6e50d 100644 --- a/Source/Core/DolphinQt2/Config/ControllersWindow.cpp +++ b/Source/Core/DolphinQt2/Config/ControllersWindow.cpp @@ -223,7 +223,7 @@ void ControllersWindow::CreateAdvancedLayout() void ControllersWindow::CreateMainLayout() { auto* layout = new QVBoxLayout(); - m_button_box = new QDialogButtonBox(QDialogButtonBox::Ok); + m_button_box = new QDialogButtonBox(QDialogButtonBox::Close); layout->addWidget(m_gc_box); layout->addWidget(m_wiimote_box); @@ -235,6 +235,7 @@ void ControllersWindow::CreateMainLayout() void ControllersWindow::ConnectWidgets() { + connect(m_button_box, &QDialogButtonBox::rejected, this, &QDialog::reject); connect(&Settings::Instance(), &Settings::EmulationStateChanged, this, [=](Core::State state) { OnEmulationStateChanged(state != Core::State::Uninitialized); }); @@ -253,7 +254,6 @@ void ControllersWindow::ConnectWidgets() &ControllersWindow::OnBluetoothPassthroughResetPressed); connect(m_wiimote_refresh, &QPushButton::clicked, this, &ControllersWindow::OnWiimoteRefreshPressed); - connect(m_button_box, &QDialogButtonBox::accepted, this, &ControllersWindow::accept); for (size_t i = 0; i < m_wiimote_groups.size(); i++) { diff --git a/Source/Core/DolphinQt2/Config/Graphics/GraphicsWindow.cpp b/Source/Core/DolphinQt2/Config/Graphics/GraphicsWindow.cpp index 4b3d920378..d04f75d1b8 100644 --- a/Source/Core/DolphinQt2/Config/Graphics/GraphicsWindow.cpp +++ b/Source/Core/DolphinQt2/Config/Graphics/GraphicsWindow.cpp @@ -24,7 +24,6 @@ GraphicsWindow::GraphicsWindow(X11Utils::XRRConfiguration* xrr_config, MainWindo : QDialog(parent), m_xrr_config(xrr_config) { CreateMainLayout(); - ConnectWidgets(); setWindowTitle(tr("Graphics")); setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); @@ -40,7 +39,9 @@ void GraphicsWindow::CreateMainLayout() m_description = new QLabel(tr("Move the mouse pointer over an option to display a detailed description.")); m_tab_widget = new QTabWidget(); - m_button_box = new QDialogButtonBox(QDialogButtonBox::Ok); + m_button_box = new QDialogButtonBox(QDialogButtonBox::Close); + + connect(m_button_box, &QDialogButtonBox::rejected, this, &QDialog::reject); description_box->setLayout(description_layout); description_box->setMinimumHeight(230); @@ -81,11 +82,6 @@ void GraphicsWindow::CreateMainLayout() setLayout(main_layout); } -void GraphicsWindow::ConnectWidgets() -{ - connect(m_button_box, &QDialogButtonBox::accepted, this, &QDialog::accept); -} - void GraphicsWindow::OnBackendChanged(const QString& backend) { setWindowTitle(tr("Dolphin %1 Graphics Configuration").arg(backend)); diff --git a/Source/Core/DolphinQt2/Config/Graphics/GraphicsWindow.h b/Source/Core/DolphinQt2/Config/Graphics/GraphicsWindow.h index 2874a4c2f0..e0c812bd71 100644 --- a/Source/Core/DolphinQt2/Config/Graphics/GraphicsWindow.h +++ b/Source/Core/DolphinQt2/Config/Graphics/GraphicsWindow.h @@ -36,7 +36,6 @@ signals: private: void CreateMainLayout(); - void ConnectWidgets(); void OnBackendChanged(const QString& backend); void OnDescriptionAdded(QWidget* widget, const char* description); diff --git a/Source/Core/DolphinQt2/Config/Mapping/MappingWindow.cpp b/Source/Core/DolphinQt2/Config/Mapping/MappingWindow.cpp index a5c7900d81..1699efde4d 100644 --- a/Source/Core/DolphinQt2/Config/Mapping/MappingWindow.cpp +++ b/Source/Core/DolphinQt2/Config/Mapping/MappingWindow.cpp @@ -109,7 +109,7 @@ void MappingWindow::CreateMainLayout() m_main_layout = new QVBoxLayout(); m_config_layout = new QHBoxLayout(); m_tab_widget = new QTabWidget(); - m_button_box = new QDialogButtonBox(QDialogButtonBox::Ok); + m_button_box = new QDialogButtonBox(QDialogButtonBox::Close); m_config_layout->addWidget(m_devices_box); m_config_layout->addWidget(m_reset_box); @@ -124,6 +124,7 @@ void MappingWindow::CreateMainLayout() void MappingWindow::ConnectWidgets() { + connect(m_button_box, &QDialogButtonBox::rejected, this, &QDialog::reject); connect(m_devices_refresh, &QPushButton::clicked, this, &MappingWindow::RefreshDevices); connect(m_devices_combo, static_cast(&QComboBox::currentIndexChanged), this, &MappingWindow::OnDeviceChanged); @@ -132,7 +133,6 @@ void MappingWindow::ConnectWidgets() connect(m_profiles_save, &QPushButton::clicked, this, &MappingWindow::OnSaveProfilePressed); connect(m_profiles_load, &QPushButton::clicked, this, &MappingWindow::OnLoadProfilePressed); connect(m_profiles_delete, &QPushButton::clicked, this, &MappingWindow::OnDeleteProfilePressed); - connect(m_button_box, &QDialogButtonBox::accepted, this, &MappingWindow::accept); } void MappingWindow::OnDeleteProfilePressed() diff --git a/Source/Core/DolphinQt2/Config/PropertiesDialog.cpp b/Source/Core/DolphinQt2/Config/PropertiesDialog.cpp index 9303dcdca0..bbaef1098a 100644 --- a/Source/Core/DolphinQt2/Config/PropertiesDialog.cpp +++ b/Source/Core/DolphinQt2/Config/PropertiesDialog.cpp @@ -3,6 +3,7 @@ // Refer to the license.txt file included. #include +#include #include #include @@ -52,9 +53,11 @@ PropertiesDialog::PropertiesDialog(QWidget* parent, const UICommon::GameFile& ga layout->addWidget(tab_widget); - QDialogButtonBox* ok_box = new QDialogButtonBox(QDialogButtonBox::Ok); - connect(ok_box, &QDialogButtonBox::accepted, this, &PropertiesDialog::accept); - layout->addWidget(ok_box); + QDialogButtonBox* close_box = new QDialogButtonBox(QDialogButtonBox::Close); + + connect(close_box, &QDialogButtonBox::rejected, this, &QDialog::reject); + + layout->addWidget(close_box); setLayout(layout); } diff --git a/Source/Core/DolphinQt2/Config/SettingsWindow.cpp b/Source/Core/DolphinQt2/Config/SettingsWindow.cpp index 0e5f12fdf8..7cd50debc0 100644 --- a/Source/Core/DolphinQt2/Config/SettingsWindow.cpp +++ b/Source/Core/DolphinQt2/Config/SettingsWindow.cpp @@ -3,6 +3,7 @@ // Refer to the license.txt file included. #include +#include #include #include "DolphinQt2/Config/SettingsWindow.h" @@ -59,9 +60,11 @@ SettingsWindow::SettingsWindow(QWidget* parent) : QDialog(parent) AddTab(m_tabs, tr("Advanced"), new AdvancedPane(), "config"); // Dialog box buttons - QDialogButtonBox* ok_box = new QDialogButtonBox(QDialogButtonBox::Ok); - connect(ok_box, &QDialogButtonBox::accepted, this, &SettingsWindow::accept); - layout->addWidget(ok_box); + QDialogButtonBox* close_box = new QDialogButtonBox(QDialogButtonBox::Close); + + connect(close_box, &QDialogButtonBox::rejected, this, &QDialog::reject); + + layout->addWidget(close_box); setLayout(layout); } diff --git a/Source/Core/DolphinQt2/GCMemcardManager.cpp b/Source/Core/DolphinQt2/GCMemcardManager.cpp index a8e01e8b56..a022207aaa 100644 --- a/Source/Core/DolphinQt2/GCMemcardManager.cpp +++ b/Source/Core/DolphinQt2/GCMemcardManager.cpp @@ -55,7 +55,7 @@ GCMemcardManager::~GCMemcardManager() = default; void GCMemcardManager::CreateWidgets() { - m_button_box = new QDialogButtonBox(QDialogButtonBox::Ok); + m_button_box = new QDialogButtonBox(QDialogButtonBox::Close); // Actions m_select_button = new QPushButton; @@ -109,7 +109,7 @@ void GCMemcardManager::CreateWidgets() void GCMemcardManager::ConnectWidgets() { - connect(m_button_box, &QDialogButtonBox::accepted, this, &QDialog::accept); + connect(m_button_box, &QDialogButtonBox::rejected, this, &QDialog::reject); connect(m_select_button, &QPushButton::pressed, this, [this] { SetActiveSlot(!m_active_slot); }); connect(m_export_button, &QPushButton::pressed, this, [this] { ExportFiles(true); }); connect(m_export_all_button, &QPushButton::pressed, this, &GCMemcardManager::ExportAllFiles); @@ -252,7 +252,6 @@ void GCMemcardManager::SetSlotFileInteractive(int slot) tr("Set memory card file for Slot B"), QString::fromStdString(File::GetUserPath(D_GCUSER_IDX)), tr("GameCube Memory Cards (*.raw *.gcp)")); - if (!path.isEmpty()) m_slot_file_edit[slot]->setText(path); }