From 6b899c9bbddb71203f0de36fd0a6d996a39ecdb6 Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Sun, 24 Jan 2010 02:26:53 +0000 Subject: [PATCH] More UI bugfixes and tweaks: * Hopeful fix for GSwindow getting stuck maximized when pcsx2 crashes when fullcreen. * Altered RestoreDefaults behaior for EE/IOP and VU CPU panels. * CDVD Verbose Reads toggle takes effect immediately now. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2506 96395faa-99c1-11dd-bbfe-3dabce05a288 --- common/include/Utilities/wxGuiTools.h | 2 +- common/src/Utilities/pxRadioPanel.cpp | 10 +++--- pcsx2/RecoverySystem.cpp | 2 +- pcsx2/gui/FrameForGS.cpp | 4 +-- pcsx2/gui/MainMenuClicks.cpp | 1 + pcsx2/gui/Panels/ConfigurationPanels.h | 8 +++++ pcsx2/gui/Panels/CpuPanel.cpp | 49 ++++++++++++++++++++++---- 7 files changed, 60 insertions(+), 16 deletions(-) diff --git a/common/include/Utilities/wxGuiTools.h b/common/include/Utilities/wxGuiTools.h index 8bcd4fe9a2..0c4df63ae4 100644 --- a/common/include/Utilities/wxGuiTools.h +++ b/common/include/Utilities/wxGuiTools.h @@ -279,7 +279,7 @@ void operator+=( wxSizer* target, const pxWindowAndFlags& src ) namespace pxSizerFlags { - static const int StdPadding = 6; + static const int StdPadding = 5; extern wxSizerFlags StdSpace(); extern wxSizerFlags StdCenter(); diff --git a/common/src/Utilities/pxRadioPanel.cpp b/common/src/Utilities/pxRadioPanel.cpp index 920e1b979c..66d1cccb02 100644 --- a/common/src/Utilities/pxRadioPanel.cpp +++ b/common/src/Utilities/pxRadioPanel.cpp @@ -210,31 +210,31 @@ wxWindowID pxRadioPanel::GetSelectionId() const bool pxRadioPanel::IsSelected( int idx ) const { - if( VerifyRealizedState() ) return false; + if( !VerifyRealizedState() ) return false; pxAssert( m_objects[idx].LabelObj != NULL ); return m_objects[idx].LabelObj->GetValue(); } wxStaticText* pxRadioPanel::GetSubText( int idx ) { - if( VerifyRealizedState() ) return NULL; + if( !VerifyRealizedState() ) return NULL; return m_objects[idx].SubTextObj; } const wxStaticText* pxRadioPanel::GetSubText( int idx ) const { - if( VerifyRealizedState() ) return NULL; + if( !VerifyRealizedState() ) return NULL; return m_objects[idx].SubTextObj; } wxRadioButton* pxRadioPanel::GetButton( int idx ) { - if( VerifyRealizedState() ) return NULL; + if( !VerifyRealizedState() ) return NULL; return m_objects[idx].LabelObj; } const wxRadioButton* pxRadioPanel::GetButton( int idx ) const { - if( VerifyRealizedState() ) return NULL; + if( !VerifyRealizedState() ) return NULL; return m_objects[idx].LabelObj; } diff --git a/pcsx2/RecoverySystem.cpp b/pcsx2/RecoverySystem.cpp index 0452d24b1e..a4a9d7e359 100644 --- a/pcsx2/RecoverySystem.cpp +++ b/pcsx2/RecoverySystem.cpp @@ -30,7 +30,7 @@ static EventSource m_evtsrc_SaveState; // Used to hold the current state backup (fullcopy of PS2 memory and plugin states). static SafeArray state_buffer; -_BaseStateThread* current_state_thread = NULL; +static _BaseStateThread* current_state_thread = NULL; // Simple lock boolean for the state buffer being in use by a thread. static NonblockingMutex state_buffer_lock; diff --git a/pcsx2/gui/FrameForGS.cpp b/pcsx2/gui/FrameForGS.cpp index 4fbe2d45b0..f451f98851 100644 --- a/pcsx2/gui/FrameForGS.cpp +++ b/pcsx2/gui/FrameForGS.cpp @@ -355,7 +355,7 @@ void GSFrame::OnMove( wxMoveEvent& evt ) evt.Skip(); // evt.GetPosition() returns the client area position, not the window frame position. - if( !IsMaximized() && IsVisible() ) + if( !IsFullScreen() && !IsMaximized() && IsVisible() ) g_Conf->GSWindow.WindowPos = GetScreenPosition(); // wxGTK note: X sends gratuitous amounts of OnMove messages for various crap actions @@ -371,7 +371,7 @@ void GSFrame::OnResize( wxSizeEvent& evt ) { if( IsBeingDeleted() ) return; - if( !IsMaximized() && IsVisible() ) + if( !IsFullScreen() && !IsMaximized() && IsVisible() ) { g_Conf->GSWindow.WindowSize = GetClientSize(); } diff --git a/pcsx2/gui/MainMenuClicks.cpp b/pcsx2/gui/MainMenuClicks.cpp index 1b50098c92..96281a3152 100644 --- a/pcsx2/gui/MainMenuClicks.cpp +++ b/pcsx2/gui/MainMenuClicks.cpp @@ -405,6 +405,7 @@ void MainEmuFrame::Menu_ShowConsole_Stdio(wxCommandEvent &event) void MainEmuFrame::Menu_PrintCDVD_Info(wxCommandEvent &event) { g_Conf->EmuOptions.CdvdVerboseReads = GetMenuBar()->IsChecked( MenuId_CDVD_Info ); + const_cast(EmuConfig).CdvdVerboseReads = true; // read-only in core thread, so it's safe to modify. SaveEmuOptions(); } diff --git a/pcsx2/gui/Panels/ConfigurationPanels.h b/pcsx2/gui/Panels/ConfigurationPanels.h index 40a2d93c69..da9c773ccd 100644 --- a/pcsx2/gui/Panels/ConfigurationPanels.h +++ b/pcsx2/gui/Panels/ConfigurationPanels.h @@ -105,6 +105,9 @@ namespace Panels CpuPanelEE( wxWindow* parent ); void Apply(); void AppStatusEvent_OnSettingsApplied(); + + protected: + void OnRestoreDefaults( wxCommandEvent& evt ); }; class CpuPanelVU : public BaseApplicableConfigPanel @@ -117,6 +120,9 @@ namespace Panels CpuPanelVU( wxWindow* parent ); void Apply(); void AppStatusEvent_OnSettingsApplied(); + + protected: + void OnRestoreDefaults( wxCommandEvent& evt ); }; class BaseAdvancedCpuOptions : public BaseApplicableConfigPanel @@ -135,6 +141,8 @@ namespace Panels BaseAdvancedCpuOptions( wxWindow* parent ); virtual ~BaseAdvancedCpuOptions() throw() { } + void RestoreDefaults(); + protected: void OnRestoreDefaults( wxCommandEvent& evt ); void ApplyRoundmode( SSE_MXCSR& mxcsr ); diff --git a/pcsx2/gui/Panels/CpuPanel.cpp b/pcsx2/gui/Panels/CpuPanel.cpp index f37e3f9edc..296a18c890 100644 --- a/pcsx2/gui/Panels/CpuPanel.cpp +++ b/pcsx2/gui/Panels/CpuPanel.cpp @@ -68,8 +68,6 @@ Panels::BaseAdvancedCpuOptions::BaseAdvancedCpuOptions( wxWindow* parent ) s_daz += m_Option_FTZ; s_daz += m_Option_DAZ; s_daz += 4; - s_daz += 22; - s_daz += new wxButton( this, wxID_DEFAULT, _("Restore Defaults") ) | pxCenter; *s_round+= m_RoundModePanel | StdExpand(); *s_clamp+= m_ClampModePanel | StdExpand(); @@ -80,24 +78,27 @@ Panels::BaseAdvancedCpuOptions::BaseAdvancedCpuOptions( wxWindow* parent ) grid += &s_daz | pxExpand; *this += grid | StdExpand(); - - Connect( wxID_DEFAULT, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BaseAdvancedCpuOptions::OnRestoreDefaults ) ); } -void Panels::BaseAdvancedCpuOptions::OnRestoreDefaults(wxCommandEvent &evt) +void Panels::BaseAdvancedCpuOptions::OnRestoreDefaults(wxCommandEvent& evt) +{ + RestoreDefaults(); + evt.Skip(); +} + +void Panels::BaseAdvancedCpuOptions::RestoreDefaults() { m_RoundModePanel->SetSelection( 3 ); // Roundmode chop m_ClampModePanel->SetSelection( 1 ); // clamp mode normal m_Option_DAZ->SetValue(true); m_Option_FTZ->SetValue(true); - - evt.Skip(); } Panels::AdvancedOptionsFPU::AdvancedOptionsFPU( wxWindow* parent ) : BaseAdvancedCpuOptions( parent ) { + SetName( L"AdvancedOptionsFPU" ); AddFrame(_("EE/FPU Advanced Recompiler Options")); m_ClampModePanel->Append(_("Extra + Preserve Sign")); @@ -113,6 +114,7 @@ Panels::AdvancedOptionsFPU::AdvancedOptionsFPU( wxWindow* parent ) Panels::AdvancedOptionsVU::AdvancedOptionsVU( wxWindow* parent ) : BaseAdvancedCpuOptions( parent ) { + SetName( L"AdvancedOptionsVU" ); AddFrame(_("VU0 / VU1 Advanced Recompiler Options")); m_ClampModePanel->Append(_("Extra")); @@ -175,6 +177,11 @@ Panels::CpuPanelEE::CpuPanelEE( wxWindow* parent ) *this += new wxStaticLine( this ) | wxSF.Border(wxALL, 18).Expand(); *this += new AdvancedOptionsFPU( this ) | StdExpand(); + *this += 12; + *this += new wxButton( this, wxID_DEFAULT, _("Restore Defaults") ) | StdButton(); + + Connect( wxID_DEFAULT, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CpuPanelEE::OnRestoreDefaults ) ); + AppStatusEvent_OnSettingsApplied(); } @@ -221,6 +228,11 @@ Panels::CpuPanelVU::CpuPanelVU( wxWindow* parent ) *this += new wxStaticLine( this ) | wxSF.Border(wxALL, 18).Expand(); *this += new AdvancedOptionsVU( this ) | StdExpand(); + *this += 12; + *this += new wxButton( this, wxID_DEFAULT, _("Restore Defaults") ) | StdButton(); + + Connect( wxID_DEFAULT, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CpuPanelVU::OnRestoreDefaults ) ); + AppStatusEvent_OnSettingsApplied(); } @@ -243,6 +255,18 @@ void Panels::CpuPanelEE::AppStatusEvent_OnSettingsApplied() m_panel_RecIOP->SetSelection( (int)recOps.EnableIOP ); } +void Panels::CpuPanelEE::OnRestoreDefaults(wxCommandEvent &evt) +{ + m_panel_RecEE->SetSelection( m_panel_RecEE->GetButton(1)->IsEnabled() ? 1 : 0 ); + m_panel_RecIOP->SetSelection( m_panel_RecIOP->GetButton(1)->IsEnabled() ? 1 : 0 ); + + if( BaseAdvancedCpuOptions* opts = (BaseAdvancedCpuOptions*)FindWindowByName(L"AdvancedOptionsFPU") ) + opts->RestoreDefaults(); + + evt.Skip(); +} + + void Panels::CpuPanelVU::Apply() { Pcsx2Config::RecompilerOptions& recOps( g_Conf->EmuOptions.Cpu.Recompiler ); @@ -276,6 +300,17 @@ void Panels::CpuPanelVU::AppStatusEvent_OnSettingsApplied() m_panel_VU1->SetSelection( recOps.EnableVU1 ? 2 : 0 ); } +void Panels::CpuPanelVU::OnRestoreDefaults(wxCommandEvent &evt) +{ + m_panel_VU0->SetSelection( m_panel_VU0->GetButton(1)->IsEnabled() ? 1 : 0 ); + m_panel_VU1->SetSelection( m_panel_VU1->GetButton(1)->IsEnabled() ? 1 : 0 ); + + if( BaseAdvancedCpuOptions* opts = (BaseAdvancedCpuOptions*)FindWindowByName(L"AdvancedOptionsVU") ) + opts->RestoreDefaults(); + + evt.Skip(); +} + void Panels::BaseAdvancedCpuOptions::ApplyRoundmode( SSE_MXCSR& mxcsr ) { mxcsr.RoundingControl = m_RoundModePanel->GetSelection();