mirror of https://github.com/PCSX2/pcsx2.git
wxgui: Connected up the CPU panel controls so that they do something, and fancied up the "Apply" button so that it ungrays only after changes to the config have been made. :)
git-svn-id: http://pcsx2.googlecode.com/svn/branches/wxgui@1695 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
ab08bc730e
commit
e6f8b4e8d0
|
@ -387,7 +387,7 @@ void CALLBACK ISOnewDiskCB(void(CALLBACK*)())
|
|||
{
|
||||
}
|
||||
|
||||
wxString ISOgetUniqueFilename(__unused void (*callback)())
|
||||
wxString ISOgetUniqueFilename()
|
||||
{
|
||||
return Path::GetFilenameWithoutExt(wxString::FromAscii(isoFileName));
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ extern struct KeyModifiers keymodifiers;
|
|||
// So a rename to pDisplay is in the works, but it will not, in fact, be removed.
|
||||
extern uptr pDsp; //Used in GS, MTGS, Plugins, Misc
|
||||
|
||||
int GetPS2ElfName( wxString& dest ); // Used in Misc, System, Linux, CDVD
|
||||
extern int GetPS2ElfName( wxString& dest ); // Used in Misc, System, Linux, CDVD
|
||||
|
||||
// Not sure what header these should go in. Probably not this one.
|
||||
void SetCPUState(u32 sseMXCSR, u32 sseVUMXCSR);
|
||||
|
|
|
@ -408,6 +408,7 @@ CDVD_API CDVDapi_Plugin =
|
|||
// The rest are filled in by the plugin manager
|
||||
NULL
|
||||
};
|
||||
|
||||
CDVD_API* CDVD = NULL;
|
||||
|
||||
static const LegacyApi_ReqMethod s_MethMessReq_CDVD[] =
|
||||
|
|
|
@ -123,7 +123,9 @@ public:
|
|||
|
||||
bool PrepForExit();
|
||||
|
||||
//void OnAssertionFailure( const wxChar *file, int line, const wxChar *func, const wxChar *cond, const wxChar *msg );
|
||||
#ifdef __WXDEBUG__
|
||||
void OnAssertFailure( const wxChar *file, int line, const wxChar *func, const wxChar *cond, const wxChar *msg );
|
||||
#endif
|
||||
|
||||
const wxBitmap& GetLogoBitmap();
|
||||
wxImageList& GetImgList_Config();
|
||||
|
|
|
@ -453,7 +453,7 @@ void ConsoleLogFrame::OnClear(wxMenuEvent& WXUNUSED(event))
|
|||
m_TextCtrl.Clear();
|
||||
}
|
||||
|
||||
void ConsoleLogFrame::OnFontSize(wxMenuEvent& evt )
|
||||
void ConsoleLogFrame::OnFontSize( wxMenuEvent& evt )
|
||||
{
|
||||
int ptsize = 8;
|
||||
switch( evt.GetId() )
|
||||
|
|
|
@ -78,6 +78,8 @@ Dialogs::ConfigurationDialog::ConfigurationDialog( wxWindow* parent, int id ) :
|
|||
mainSizer.Add( &m_listbook );
|
||||
AddOkCancel( mainSizer, true );
|
||||
|
||||
GetWindowChild( wxID_APPLY )->Disable();
|
||||
|
||||
SetSizerAndFit( &mainSizer );
|
||||
CenterOnScreen();
|
||||
|
||||
|
@ -93,6 +95,23 @@ Dialogs::ConfigurationDialog::ConfigurationDialog( wxWindow* parent, int id ) :
|
|||
|
||||
Connect( wxID_OK, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ConfigurationDialog::OnOk_Click ) );
|
||||
Connect( wxID_APPLY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ConfigurationDialog::OnApply_Click ) );
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Bind a variety of standard "something probably changed" events. If the user invokes
|
||||
// any of these, we'll automatically de-gray the Apply button for this dialog box. :)
|
||||
|
||||
#define ConnectSomethingChanged( command ) \
|
||||
Connect( wxEVT_COMMAND_##command, wxCommandEventHandler( ConfigurationDialog::OnSomethingChanged ) );
|
||||
|
||||
ConnectSomethingChanged( RADIOBUTTON_SELECTED );
|
||||
ConnectSomethingChanged( COMBOBOX_SELECTED );
|
||||
ConnectSomethingChanged( CHECKBOX_CLICKED );
|
||||
ConnectSomethingChanged( BUTTON_CLICKED );
|
||||
ConnectSomethingChanged( CHOICE_SELECTED );
|
||||
ConnectSomethingChanged( LISTBOX_SELECTED );
|
||||
ConnectSomethingChanged( SPINCTRL_UPDATED );
|
||||
ConnectSomethingChanged( SLIDER_UPDATED );
|
||||
ConnectSomethingChanged( DIRPICKER_CHANGED );
|
||||
}
|
||||
|
||||
Dialogs::ConfigurationDialog::~ConfigurationDialog()
|
||||
|
@ -111,7 +130,7 @@ void Dialogs::ConfigurationDialog::OnOk_Click( wxCommandEvent& evt )
|
|||
|
||||
void Dialogs::ConfigurationDialog::OnApply_Click( wxCommandEvent& evt )
|
||||
{
|
||||
evt.Skip();
|
||||
GetWindowChild( wxID_APPLY )->Disable();
|
||||
g_ApplyState.ApplyAll();
|
||||
}
|
||||
|
||||
|
|
|
@ -40,6 +40,15 @@ namespace Dialogs
|
|||
protected:
|
||||
void OnOk_Click( wxCommandEvent& evt );
|
||||
void OnApply_Click( wxCommandEvent& evt );
|
||||
|
||||
virtual void OnSomethingChanged( wxCommandEvent& evt )
|
||||
{
|
||||
evt.Skip();
|
||||
if( (evt.GetId() != wxID_OK) && (evt.GetId() != wxID_CANCEL) && (evt.GetId() != wxID_APPLY) )
|
||||
{
|
||||
GetWindowChild( wxID_APPLY )->Enable();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -209,6 +209,13 @@ namespace Panels
|
|||
class CpuPanel : public BaseApplicableConfigPanel
|
||||
{
|
||||
protected:
|
||||
wxRadioButton* m_Option_RecEE;
|
||||
wxRadioButton* m_Option_RecIOP;
|
||||
wxRadioButton* m_Option_mVU0;
|
||||
wxRadioButton* m_Option_mVU1;
|
||||
|
||||
wxRadioButton* m_Option_sVU0;
|
||||
wxRadioButton* m_Option_sVU1;
|
||||
|
||||
public:
|
||||
CpuPanel( wxWindow& parent, int idealWidth );
|
||||
|
|
|
@ -37,30 +37,58 @@ Panels::CpuPanel::CpuPanel( wxWindow& parent, int idealWidth ) :
|
|||
|
||||
m_StartNewRadioGroup = true;
|
||||
AddRadioButton( s_ee, _("Interpreter"), wxEmptyString, _("Quite possibly the slowest thing in the universe.") );
|
||||
AddRadioButton( s_ee, _("Recompiler") );
|
||||
m_Option_RecEE = &AddRadioButton( s_ee, _("Recompiler") );
|
||||
|
||||
m_StartNewRadioGroup = true;
|
||||
AddRadioButton( s_iop, _("Interpreter") );
|
||||
AddRadioButton( s_iop, _("Recompiler") );
|
||||
m_Option_RecIOP = &AddRadioButton( s_iop, _("Recompiler") );
|
||||
|
||||
m_StartNewRadioGroup = true;
|
||||
AddRadioButton( s_vu0, _("Interpreter") );
|
||||
AddRadioButton( s_vu0, _("microVU Recompiler [new!]") );
|
||||
AddRadioButton( s_vu0, _("superVU Recompiler [legacy]"), wxEmptyString, _("Useful for diagnosing possible bugs in the new mVU recompiler.") );
|
||||
AddRadioButton( s_vu0, _("Interpreter") ).SetValue( true );
|
||||
m_Option_mVU0 = &AddRadioButton( s_vu0, _("microVU Recompiler [new!]") );
|
||||
m_Option_sVU0 = &AddRadioButton( s_vu0, _("superVU Recompiler [legacy]"), wxEmptyString, _("Useful for diagnosing possible bugs in the new mVU recompiler.") );
|
||||
|
||||
m_StartNewRadioGroup = true;
|
||||
AddRadioButton( s_vu1, _("Interpreter") );
|
||||
AddRadioButton( s_vu1, _("microVU Recompiler [new!]") );
|
||||
AddRadioButton( s_vu1, _("superVU Recompiler [legacy]"), wxEmptyString, _("Useful for diagnosing possible bugs in the new mVU recompiler.") );
|
||||
AddRadioButton( s_vu1, _("Interpreter") ).SetValue( true );
|
||||
m_Option_mVU1 = &AddRadioButton( s_vu1, _("microVU Recompiler [new!]") );
|
||||
m_Option_sVU1 = &AddRadioButton( s_vu1, _("superVU Recompiler [legacy]"), wxEmptyString, _("Useful for diagnosing possible bugs in the new mVU recompiler.") );
|
||||
|
||||
s_main.Add( &s_ee, SizerFlags::StdExpand() );
|
||||
s_main.Add( &s_iop, SizerFlags::StdExpand() );
|
||||
s_main.Add( &s_vu0, SizerFlags::StdExpand() );
|
||||
s_main.Add( &s_vu1, SizerFlags::StdExpand() );
|
||||
|
||||
SetSizerAndFit( &s_main );
|
||||
// [TODO] : Add advanced CPU settings -- FPU/VU rounding, clamping, etc.
|
||||
|
||||
SetSizer( &s_main );
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Apply current configuration options...
|
||||
|
||||
Pcsx2Config::RecompilerOptions& recOps( g_Conf->EmuOptions.Cpu.Recompiler );
|
||||
|
||||
m_Option_RecEE->SetValue( recOps.EnableEE );
|
||||
m_Option_RecIOP->SetValue( recOps.EnableIOP );
|
||||
|
||||
if( recOps.UseMicroVU0 )
|
||||
m_Option_mVU0->SetValue( recOps.EnableVU0 );
|
||||
else
|
||||
m_Option_sVU0->SetValue( recOps.EnableVU0 );
|
||||
|
||||
if( recOps.UseMicroVU1 )
|
||||
m_Option_mVU1->SetValue( recOps.EnableVU1 );
|
||||
else
|
||||
m_Option_sVU1->SetValue( recOps.EnableVU1 );
|
||||
}
|
||||
|
||||
void Panels::CpuPanel::Apply( AppConfig& conf )
|
||||
{
|
||||
Pcsx2Config::RecompilerOptions& recOps( conf.EmuOptions.Cpu.Recompiler );
|
||||
recOps.EnableEE = m_Option_RecEE->GetValue();
|
||||
recOps.EnableIOP = m_Option_RecIOP->GetValue();
|
||||
recOps.EnableVU0 = m_Option_mVU0->GetValue() || m_Option_sVU0->GetValue();
|
||||
recOps.EnableVU1 = m_Option_mVU1->GetValue() || m_Option_sVU1->GetValue();
|
||||
|
||||
recOps.UseMicroVU0 = m_Option_mVU0->GetValue();
|
||||
recOps.UseMicroVU1 = m_Option_mVU1->GetValue();
|
||||
}
|
||||
|
|
|
@ -48,13 +48,14 @@ void Panels::DirPickerPanel::UpdateCheckStatus( bool someNoteworthyBoolean )
|
|||
}
|
||||
}
|
||||
|
||||
void Panels::DirPickerPanel::UseDefaultPath_Click( wxCommandEvent &event )
|
||||
void Panels::DirPickerPanel::UseDefaultPath_Click( wxCommandEvent &evt )
|
||||
{
|
||||
evt.Skip();
|
||||
wxASSERT( m_pickerCtrl != NULL && m_checkCtrl != NULL );
|
||||
UpdateCheckStatus( m_checkCtrl->IsChecked() );
|
||||
}
|
||||
|
||||
void Panels::DirPickerPanel::Explore_Click( wxCommandEvent &event )
|
||||
void Panels::DirPickerPanel::Explore_Click( wxCommandEvent &evt )
|
||||
{
|
||||
wxHelpers::Explore( m_pickerCtrl->GetPath() );
|
||||
}
|
||||
|
|
|
@ -241,6 +241,9 @@ Panels::PluginSelectorPanel::~PluginSelectorPanel()
|
|||
|
||||
void Panels::PluginSelectorPanel::Apply( AppConfig& conf )
|
||||
{
|
||||
// user never entered plugins panel? Skip application since combo boxes are invalid/uninitialized.
|
||||
if( m_FileList == NULL ) return;
|
||||
|
||||
for( int i=0; i<NumPluginTypes; ++i )
|
||||
{
|
||||
int sel = m_ComponentBoxes.Get(i).GetSelection();
|
||||
|
|
Loading…
Reference in New Issue