Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PCSX2-WX: Add restore defaults button to GS panel #2003

Merged
merged 1 commit into from Jul 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions pcsx2/gui/Panels/ConfigurationPanels.h
Expand Up @@ -303,6 +303,7 @@ namespace Panels
{
protected:
pxCheckBox* m_check_SynchronousGS;
wxButton* m_restore_defaults;
pxCheckBox* m_check_DisableOutput;
FrameSkipPanel* m_span;
FramelimiterPanel* m_fpan;
Expand All @@ -312,6 +313,7 @@ namespace Panels
virtual ~VideoPanel() = default;
void Apply();
void AppStatusEvent_OnSettingsApplied();
void Defaults_Click(wxCommandEvent& evt);
void ApplyConfigToGui( AppConfig& configToApply, int flags=0 );

protected:
Expand Down
15 changes: 15 additions & 0 deletions pcsx2/gui/Panels/VideoPanel.cpp
Expand Up @@ -291,6 +291,8 @@ Panels::VideoPanel::VideoPanel( wxWindow* parent ) :
_t("For troubleshooting potential bugs in the MTGS only, as it is potentially very slow.")
);

m_restore_defaults = new wxButton(right, wxID_DEFAULT, _("Restore Defaults"));

m_check_DisableOutput = new pxCheckBox( left, _("Disable all GS output"),
_t("Completely disables all GS plugin activity; ideal for benchmarking EEcore components.")
);
Expand Down Expand Up @@ -318,6 +320,7 @@ Panels::VideoPanel::VideoPanel( wxWindow* parent ) :

*right += m_span | pxExpand;
*right += 5;
*right += m_restore_defaults | StdButton();

*left += m_fpan | pxExpand;
*left += 5;
Expand All @@ -329,9 +332,21 @@ Panels::VideoPanel::VideoPanel( wxWindow* parent ) :

*this += s_table | pxExpand;

Bind(wxEVT_BUTTON, &VideoPanel::Defaults_Click, this, wxID_DEFAULT);
AppStatusEvent_OnSettingsApplied();
}

void Panels::VideoPanel::Defaults_Click(wxCommandEvent& evt)
{
AppConfig config = *g_Conf;
config.EmuOptions.GS = Pcsx2Config::GSOptions();
config.Framerate = AppConfig::FramerateOptions();
VideoPanel::ApplyConfigToGui(config);
m_fpan->ApplyConfigToGui(config);
m_span->ApplyConfigToGui(config);
evt.Skip();
}

void Panels::VideoPanel::OnOpenWindowSettings( wxCommandEvent& evt )
{
AppOpenDialog<Dialogs::ComponentsConfigDialog>( this );
Expand Down