Skip to content

Commit

Permalink
[UI] Remove fullscreen resolution UI.
Browse files Browse the repository at this point in the history
  • Loading branch information
Helios747 committed Nov 17, 2017
1 parent 84ca9a4 commit aa4088a
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 100 deletions.
4 changes: 2 additions & 2 deletions Source/Core/Core/ConfigManager.cpp
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
34 changes: 1 addition & 33 deletions Source/Core/DolphinQt2/Config/Graphics/GeneralWidget.cpp
Expand Up @@ -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);
Expand All @@ -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);

Expand Down Expand Up @@ -126,10 +114,6 @@ void GeneralWidget::ConnectWidgets()
// Video Backend
connect(m_backend_combo, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
[this](int) { SaveSettings(); });
// Fullscreen Resolution
connect(m_resolution_combo,
static_cast<void (QComboBox::*)(int)>(&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);
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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);
Expand All @@ -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.");
Expand Down Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion Source/Core/DolphinQt2/Config/Graphics/GeneralWidget.h
Expand Up @@ -38,7 +38,6 @@ class GeneralWidget final : public GraphicsWidget
// 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;
Expand Down
62 changes: 0 additions & 62 deletions Source/Core/DolphinWX/VideoConfigDiag.cpp
Expand Up @@ -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(_("<No resolutions found>"));
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"),
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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();
}
Expand Down
2 changes: 0 additions & 2 deletions Source/Core/DolphinWX/VideoConfigDiag.h
Expand Up @@ -100,7 +100,6 @@ class VideoConfigDiag : public wxDialog

protected:
void Event_Backend(wxCommandEvent& ev);
void Event_DisplayResolution(wxCommandEvent& ev);
void Event_ProgressiveScan(wxCommandEvent& ev);
void Event_SafeTextureCache(wxCommandEvent& ev);

Expand Down Expand Up @@ -144,7 +143,6 @@ class VideoConfigDiag : public wxDialog

wxChoice* choice_backend;
wxChoice* choice_adapter;
wxChoice* choice_display_resolution;

wxStaticText* label_backend;
wxStaticText* label_adapter;
Expand Down

0 comments on commit aa4088a

Please sign in to comment.