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
This commit is contained in:
Jake.Stine 2010-01-24 02:26:53 +00:00
parent 3eb3991b9a
commit 6b899c9bbd
7 changed files with 60 additions and 16 deletions

View File

@ -279,7 +279,7 @@ void operator+=( wxSizer* target, const pxWindowAndFlags<WinType>& src )
namespace pxSizerFlags
{
static const int StdPadding = 6;
static const int StdPadding = 5;
extern wxSizerFlags StdSpace();
extern wxSizerFlags StdCenter();

View File

@ -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;
}

View File

@ -30,7 +30,7 @@ static EventSource<IEventListener_SaveStateThread> m_evtsrc_SaveState;
// Used to hold the current state backup (fullcopy of PS2 memory and plugin states).
static SafeArray<u8> 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;

View File

@ -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();
}

View File

@ -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<Pcsx2Config&>(EmuConfig).CdvdVerboseReads = true; // read-only in core thread, so it's safe to modify.
SaveEmuOptions();
}

View File

@ -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 );

View File

@ -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();