From aa4088a49411902a89420edae7796edaf8ba914e Mon Sep 17 00:00:00 2001 From: Anthony Date: Fri, 17 Nov 2017 12:55:43 -0800 Subject: [PATCH] [UI] Remove fullscreen resolution UI. --- Source/Core/Core/ConfigManager.cpp | 4 +- .../Config/Graphics/GeneralWidget.cpp | 34 +--------- .../Config/Graphics/GeneralWidget.h | 1 - Source/Core/DolphinWX/VideoConfigDiag.cpp | 62 ------------------- Source/Core/DolphinWX/VideoConfigDiag.h | 2 - 5 files changed, 3 insertions(+), 100 deletions(-) diff --git a/Source/Core/Core/ConfigManager.cpp b/Source/Core/Core/ConfigManager.cpp index 0163fb9822..220f9e0a0b 100644 --- a/Source/Core/Core/ConfigManager.cpp +++ b/Source/Core/Core/ConfigManager.cpp @@ -180,7 +180,7 @@ void SConfig::SaveDisplaySettings(IniFile& ini) { IniFile::Section* display = ini.GetOrCreateSection("Display"); - display->Set("FullscreenResolution", strFullscreenResolution); + display->Set("FullscreenDisplayRes", strFullscreenResolution); display->Set("Fullscreen", bFullscreen); display->Set("RenderToMain", bRenderToMain); display->Set("RenderWindowXPos", iRenderWindowXPos); @@ -460,7 +460,7 @@ void SConfig::LoadDisplaySettings(IniFile& ini) IniFile::Section* display = ini.GetOrCreateSection("Display"); display->Get("Fullscreen", &bFullscreen, false); - display->Get("FullscreenResolution", &strFullscreenResolution, "Auto"); + display->Get("FullscreenDisplayRes", &strFullscreenResolution, "Auto"); display->Get("RenderToMain", &bRenderToMain, false); display->Get("RenderWindowXPos", &iRenderWindowXPos, -1); display->Get("RenderWindowYPos", &iRenderWindowYPos, -1); diff --git a/Source/Core/DolphinQt2/Config/Graphics/GeneralWidget.cpp b/Source/Core/DolphinQt2/Config/Graphics/GeneralWidget.cpp index b3ae65a802..e76fc6a35c 100644 --- a/Source/Core/DolphinQt2/Config/Graphics/GeneralWidget.cpp +++ b/Source/Core/DolphinQt2/Config/Graphics/GeneralWidget.cpp @@ -47,7 +47,6 @@ void GeneralWidget::CreateWidgets() m_video_layout = new QGridLayout(); m_backend_combo = new QComboBox(); - m_resolution_combo = new QComboBox(); m_aspect_combo = new GraphicsChoice({tr("Auto"), tr("Force 16:9"), tr("Force 4:3"), tr("Stretch to Window")}, Config::GFX_ASPECT_RATIO); @@ -60,25 +59,14 @@ void GeneralWidget::CreateWidgets() for (auto& backend : g_available_video_backends) m_backend_combo->addItem(tr(backend->GetDisplayName().c_str())); -#ifndef __APPLE__ - m_resolution_combo->addItem(tr("Auto")); - - for (const auto& res : VideoUtils::GetAvailableResolutions(m_xrr_config)) - m_resolution_combo->addItem(QString::fromStdString(res)); -#endif - m_video_layout->addWidget(new QLabel(tr("Backend:")), 0, 0); m_video_layout->addWidget(m_backend_combo, 0, 1); + #ifdef _WIN32 m_video_layout->addWidget(new QLabel(tr("Adapter:")), 1, 0); m_video_layout->addWidget(m_adapter_combo, 1, 1); #endif -#ifndef __APPLE__ - m_video_layout->addWidget(new QLabel(tr("Fullscreen Resolution:")), 2, 0); - m_video_layout->addWidget(m_resolution_combo, 2, 1); -#endif - m_video_layout->addWidget(new QLabel(tr("Aspect Ratio:")), 3, 0); m_video_layout->addWidget(m_aspect_combo, 3, 1); @@ -126,10 +114,6 @@ void GeneralWidget::ConnectWidgets() // Video Backend connect(m_backend_combo, static_cast(&QComboBox::currentIndexChanged), [this](int) { SaveSettings(); }); - // Fullscreen Resolution - connect(m_resolution_combo, - static_cast(&QComboBox::currentIndexChanged), - [this](int) { SaveSettings(); }); // Enable Fullscreen for (QCheckBox* checkbox : {m_enable_fullscreen, m_hide_cursor, m_render_main_window}) connect(checkbox, &QCheckBox::toggled, this, &GeneralWidget::SaveSettings); @@ -149,10 +133,6 @@ void GeneralWidget::LoadSettings() } } - // Fullscreen Resolution - auto resolution = SConfig::GetInstance().strFullscreenResolution; - m_resolution_combo->setCurrentIndex( - resolution == "Auto" ? 0 : m_resolution_combo->findText(QString::fromStdString(resolution))); // Enable Fullscreen m_enable_fullscreen->setChecked(SConfig::GetInstance().bFullscreen); // Hide Cursor @@ -210,10 +190,6 @@ void GeneralWidget::SaveSettings() } } - // Fullscreen Resolution - SConfig::GetInstance().strFullscreenResolution = - m_resolution_combo->currentIndex() == 0 ? "Auto" : - m_resolution_combo->currentText().toStdString(); // Enable Fullscreen SConfig::GetInstance().bFullscreen = m_enable_fullscreen->isChecked(); // Hide Cursor @@ -230,9 +206,6 @@ void GeneralWidget::OnEmulationStateChanged(bool running) { m_backend_combo->setEnabled(!running); m_render_main_window->setEnabled(!running); -#ifndef __APPLE__ - m_resolution_combo->setEnabled(!running); -#endif #ifdef _WIN32 m_adapter_combo->setEnabled(!running); @@ -257,10 +230,6 @@ void GeneralWidget::AddDescriptions() "slow and only useful for debugging, so unless you have a reason to use it you'll " "want to select OpenGL here.\n\nIf unsure, select OpenGL."); #endif - static const char* TR_RESOLUTION_DESCRIPTION = - QT_TR_NOOP("Selects the display resolution used in fullscreen mode.\nThis should always be " - "bigger than or equal to the internal resolution. Performance impact is " - "negligible.\n\nIf unsure, select auto."); static const char* TR_FULLSCREEN_DESCRIPTION = QT_TR_NOOP( "Enable this if you want the whole screen to be used for rendering.\nIf this is disabled, a " "render window will be created instead.\n\nIf unsure, leave this unchecked."); @@ -301,7 +270,6 @@ void GeneralWidget::AddDescriptions() #ifdef _WIN32 AddDescription(m_adapter_combo, TR_ADAPTER_DESCRIPTION); #endif - AddDescription(m_resolution_combo, TR_RESOLUTION_DESCRIPTION); AddDescription(m_enable_fullscreen, TR_FULLSCREEN_DESCRIPTION); AddDescription(m_autoadjust_window_size, TR_AUTOSIZE_DESCRIPTION); AddDescription(m_hide_cursor, TR_HIDE_MOUSE_CURSOR_DESCRIPTION); diff --git a/Source/Core/DolphinQt2/Config/Graphics/GeneralWidget.h b/Source/Core/DolphinQt2/Config/Graphics/GeneralWidget.h index 76b0530179..e611950dec 100644 --- a/Source/Core/DolphinQt2/Config/Graphics/GeneralWidget.h +++ b/Source/Core/DolphinQt2/Config/Graphics/GeneralWidget.h @@ -38,7 +38,6 @@ private: // Video QGridLayout* m_video_layout; QComboBox* m_backend_combo; - QComboBox* m_resolution_combo; QComboBox* m_adapter_combo; QComboBox* m_aspect_combo; QCheckBox* m_enable_vsync; diff --git a/Source/Core/DolphinWX/VideoConfigDiag.cpp b/Source/Core/DolphinWX/VideoConfigDiag.cpp index 08d2697514..f94a4419c8 100644 --- a/Source/Core/DolphinWX/VideoConfigDiag.cpp +++ b/Source/Core/DolphinWX/VideoConfigDiag.cpp @@ -382,41 +382,6 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string& title) wxFlexGridSizer* const szr_display = new wxFlexGridSizer(2, space5, space5); { -#if !defined(__APPLE__) - // display resolution - { - wxArrayString res_list; - res_list.Add(_("Auto")); -#if defined(HAVE_XRANDR) && HAVE_XRANDR - const auto resolutions = VideoUtils::GetAvailableResolutions(main_frame->m_xrr_config); -#else - const auto resolutions = VideoUtils::GetAvailableResolutions(nullptr); -#endif - - for (const auto& res : resolutions) - res_list.Add(res); - - if (res_list.empty()) - res_list.Add(_("")); - label_display_resolution = - new wxStaticText(page_general, wxID_ANY, _("Fullscreen Resolution:")); - choice_display_resolution = - new wxChoice(page_general, wxID_ANY, wxDefaultPosition, wxDefaultSize, res_list); - RegisterControl(choice_display_resolution, wxGetTranslation(display_res_desc)); - choice_display_resolution->Bind(wxEVT_CHOICE, &VideoConfigDiag::Event_DisplayResolution, - this); - - choice_display_resolution->SetStringSelection( - StrToWxStr(SConfig::GetInstance().strFullscreenResolution)); - // "Auto" is used as a keyword, convert to translated string - if (SConfig::GetInstance().strFullscreenResolution == "Auto") - choice_display_resolution->SetSelection(0); - - szr_display->Add(label_display_resolution, 0, wxALIGN_CENTER_VERTICAL); - szr_display->Add(choice_display_resolution, 0, wxALIGN_CENTER_VERTICAL); - } -#endif - // aspect-ratio { const wxString ar_choices[] = {_("Auto"), _("Force 16:9"), _("Force 4:3"), @@ -1010,26 +975,6 @@ void VideoConfigDiag::Event_Backend(wxCommandEvent& ev) ev.Skip(); } -void VideoConfigDiag::Event_DisplayResolution(wxCommandEvent& ev) -{ - // "Auto" has been translated, it needs to be the English string "Auto" to work - switch (choice_display_resolution->GetSelection()) - { - case 0: - SConfig::GetInstance().strFullscreenResolution = "Auto"; - break; - case wxNOT_FOUND: - break; // Nothing is selected. - default: - SConfig::GetInstance().strFullscreenResolution = - WxStrToStr(choice_display_resolution->GetStringSelection()); - } -#if defined(HAVE_XRANDR) && HAVE_XRANDR - main_frame->m_xrr_config->Update(); -#endif - ev.Skip(); -} - void VideoConfigDiag::Event_ProgressiveScan(wxCommandEvent& ev) { Config::SetBase(Config::SYSCONF_PROGRESSIVE_SCAN, ev.IsChecked()); @@ -1135,13 +1080,6 @@ void VideoConfigDiag::OnUpdateUI(wxUpdateUIEvent& ev) label_adapter->Disable(); } -#ifndef __APPLE__ - // This isn't supported on OS X. - - choice_display_resolution->Disable(); - label_display_resolution->Disable(); -#endif - progressive_scan_checkbox->Disable(); render_to_main_checkbox->Disable(); } diff --git a/Source/Core/DolphinWX/VideoConfigDiag.h b/Source/Core/DolphinWX/VideoConfigDiag.h index 1730b19090..d02d344325 100644 --- a/Source/Core/DolphinWX/VideoConfigDiag.h +++ b/Source/Core/DolphinWX/VideoConfigDiag.h @@ -100,7 +100,6 @@ public: protected: void Event_Backend(wxCommandEvent& ev); - void Event_DisplayResolution(wxCommandEvent& ev); void Event_ProgressiveScan(wxCommandEvent& ev); void Event_SafeTextureCache(wxCommandEvent& ev); @@ -144,7 +143,6 @@ protected: wxChoice* choice_backend; wxChoice* choice_adapter; - wxChoice* choice_display_resolution; wxStaticText* label_backend; wxStaticText* label_adapter;