From 56170870eb10dee8fd4ae8c4f1380d51d5730a0b Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Tue, 25 May 2010 02:08:17 +0000 Subject: [PATCH] More user interface work. Moved some of the configuration panels around; just to confuse you all. ;) git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3070 96395faa-99c1-11dd-bbfe-3dabce05a288 --- common/include/Utilities/pxCheckBox.h | 4 +- common/src/Utilities/pxCheckBox.cpp | 22 ++ pcsx2/gui/App.h | 17 +- pcsx2/gui/ApplyState.h | 2 +- pcsx2/gui/Dialogs/BaseConfigurationDialog.cpp | 31 ++- pcsx2/gui/Dialogs/ConfigurationDialog.h | 18 +- pcsx2/gui/Dialogs/McdConfigDialog.cpp | 95 +++++---- pcsx2/gui/Dialogs/SysConfigDialog.cpp | 24 +-- pcsx2/gui/MSWstuff.cpp | 2 +- pcsx2/gui/MainFrame.cpp | 26 ++- pcsx2/gui/MainFrame.h | 5 +- pcsx2/gui/MainMenuClicks.cpp | 18 +- pcsx2/gui/Panels/ConfigurationPanels.h | 24 --- pcsx2/gui/Panels/GSWindowPanel.cpp | 1 - pcsx2/gui/Panels/MemoryCardListPanel.cpp | 197 ++++++------------ pcsx2/gui/Panels/MemoryCardListView.cpp | 113 +++++++++- pcsx2/gui/Panels/MemoryCardPanels.h | 51 ++--- pcsx2/gui/Panels/MemoryCardsPanel.cpp | 148 +------------ pcsx2/gui/Panels/PathsPanel.cpp | 7 +- pcsx2/gui/Panels/VideoPanel.cpp | 2 +- pcsx2/gui/Readme-MemoryCardFile.txt | 12 ++ pcsx2/windows/VCprojects/pcsx2_2008.vcproj | 60 +++--- 22 files changed, 410 insertions(+), 469 deletions(-) create mode 100644 pcsx2/gui/Readme-MemoryCardFile.txt diff --git a/common/include/Utilities/pxCheckBox.h b/common/include/Utilities/pxCheckBox.h index ba8533e423..05d7f5c5d7 100644 --- a/common/include/Utilities/pxCheckBox.h +++ b/common/include/Utilities/pxCheckBox.h @@ -50,10 +50,12 @@ public: wxCheckBox* GetWxPtr() { return m_checkbox; } const wxCheckBox* GetWxPtr() const { return m_checkbox; } - wxWindowID GetId() const { pxAssert( m_checkbox != NULL ); return m_checkbox->GetId(); } + //wxWindowID GetId() const { pxAssert( m_checkbox != NULL ); return m_checkbox->GetId(); } protected: void Init( const wxString& label, const wxString& subtext ); + void OnCheckpartCommand( wxCommandEvent& evt ); + void OnSubtextClicked( wxCommandEvent& evt ); }; extern void operator+=( wxSizer& target, pxCheckBox* src ); diff --git a/common/src/Utilities/pxCheckBox.cpp b/common/src/Utilities/pxCheckBox.cpp index eff764cffd..d834c0a370 100644 --- a/common/src/Utilities/pxCheckBox.cpp +++ b/common/src/Utilities/pxCheckBox.cpp @@ -48,6 +48,8 @@ void pxCheckBox::Init(const wxString& label, const wxString& subtext) *this += &spaced; } + + Connect( m_checkbox->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(pxCheckBox::OnCheckpartCommand) ); } // applies the tooltip to both both the checkbox and it's static subtext (if present), and @@ -77,6 +79,26 @@ void operator+=( wxSizer& target, pxCheckBox* src ) target.Add( src, pxExpand ); } +// Forwards checkbox actions on the internal checkbox (called 'checkpart') to listeners +// bound to the pxCheckBox "parent" panel. This helps the pxCheckBox behave more like a +// traditional checkbox. +void pxCheckBox::OnCheckpartCommand( wxCommandEvent& evt ) +{ + evt.Skip(); + + wxCommandEvent newevt( evt ); + newevt.SetEventObject( this ); + newevt.SetId( GetId() ); + GetEventHandler()->ProcessEvent( newevt ); +} + +void pxCheckBox::OnSubtextClicked( wxCommandEvent& evt ) +{ + // TODO? + // We can enable the ability to allow clicks on the subtext desc/label to toggle + // the checkmark. Not sure if that's desirable. +} + void operator+=( wxSizer& target, pxCheckBox& src ) { target.Add( &src, pxExpand ); diff --git a/pcsx2/gui/App.h b/pcsx2/gui/App.h index 0eed6416e6..7f2b42f4ca 100644 --- a/pcsx2/gui/App.h +++ b/pcsx2/gui/App.h @@ -136,7 +136,7 @@ enum MenuIdentifiers MenuId_PluginBase_Settings = 0x101, MenuId_Video_CoreSettings = 0x200,// includes frame timings and skippings settings - + MenuId_Video_WindowSettings, // Miscellaneous Menu! (Misc) MenuId_Website, // Visit our awesome website! @@ -636,13 +636,18 @@ DECLARE_APP(Pcsx2App) // -------------------------------------------------------------------------------------- // AppOpenDialog // -------------------------------------------------------------------------------------- +// Returns a wxWindow handle to the opened window. +// template -void AppOpenDialog( wxWindow* parent=NULL ) +wxWindow* AppOpenDialog( wxWindow* parent=NULL ) { - if( wxWindow* window = wxFindWindowByName( L"Dialog:" + DialogType::GetNameStatic() ) ) - window->SetFocus(); - else - (new DialogType( parent ))->Show(); + wxWindow* window = wxFindWindowByName( L"Dialog:" + DialogType::GetNameStatic() ); + + if( !window ) window = new DialogType( parent ); + + window->Show(); + window->SetFocus(); + return window; } extern pxDoAssertFnType AppDoAssert; diff --git a/pcsx2/gui/ApplyState.h b/pcsx2/gui/ApplyState.h index 0dad2d1218..144c6590e6 100644 --- a/pcsx2/gui/ApplyState.h +++ b/pcsx2/gui/ApplyState.h @@ -136,7 +136,7 @@ protected: BaseApplicableDialog(wxWindow* parent, const wxString& title ); BaseApplicableDialog(wxWindow* parent, const wxString& title, wxOrientation sizerOrient ); - void OnSettingsApplied( wxCommandEvent& evt ); + virtual void OnSettingsApplied( wxCommandEvent& evt ); // Note: This method *will* be called automatically after a successful Apply, but will not // be called after a failed Apply (canceled due to error). diff --git a/pcsx2/gui/Dialogs/BaseConfigurationDialog.cpp b/pcsx2/gui/Dialogs/BaseConfigurationDialog.cpp index 5f2ed27e0c..a85d611239 100644 --- a/pcsx2/gui/Dialogs/BaseConfigurationDialog.cpp +++ b/pcsx2/gui/Dialogs/BaseConfigurationDialog.cpp @@ -16,6 +16,7 @@ #include "PrecompiledHeader.h" #include "System.h" #include "App.h" +#include "MSWstuff.h" #include "ConfigurationDialog.h" #include "ModalPopups.h" @@ -29,6 +30,7 @@ #include DEFINE_EVENT_TYPE( pxEvt_ApplySettings ) +DEFINE_EVENT_TYPE( pxEvt_SetSettingsPage ) using namespace Panels; @@ -101,6 +103,8 @@ Dialogs::BaseConfigurationDialog::BaseConfigurationDialog( wxWindow* parent, con Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler(BaseConfigurationDialog::OnCloseWindow) ); + Connect( pxEvt_SetSettingsPage, wxCommandEventHandler( BaseConfigurationDialog::OnSetSettingsPage ) ); + // ---------------------------------------------------------------------------- // 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. :) @@ -138,7 +142,7 @@ void Dialogs::BaseConfigurationDialog::CreateListbook( wxImageList& bookicons ) void Dialogs::BaseConfigurationDialog::AddOkCancel( wxSizer* sizer ) { _parent::AddOkCancel( sizer, true ); - FindWindow( wxID_APPLY )->Disable(); + if( wxWindow* apply = FindWindow( wxID_APPLY ) ) apply->Disable(); wxBitmapButton& screenshotButton( *new wxBitmapButton( this, wxID_SAVE, EmbeddedImage().Get() ) ); screenshotButton.SetToolTip( _("Saves a snapshot of this settings panel to a PNG file.") ); @@ -150,13 +154,28 @@ Dialogs::BaseConfigurationDialog::~BaseConfigurationDialog() throw() { } +void Dialogs::BaseConfigurationDialog::OnSetSettingsPage( wxCommandEvent& evt ) +{ + if( !m_listbook ) return; + + size_t pages = m_labels.GetCount(); + + for( size_t i=0; iSetSelection( i ); + break; + } + } +} void Dialogs::BaseConfigurationDialog::OnSomethingChanged( wxCommandEvent& evt ) { evt.Skip(); if( (evt.GetId() != wxID_OK) && (evt.GetId() != wxID_CANCEL) && (evt.GetId() != wxID_APPLY) ) { - if( wxWindow *apply = FindWindow( wxID_APPLY ) ) apply->Enable(); + if( wxWindow* apply = FindWindow( wxID_APPLY ) ) apply->Enable(); } } @@ -171,7 +190,7 @@ void Dialogs::BaseConfigurationDialog::OnOk_Click( wxCommandEvent& evt ) { if( m_ApplyState.ApplyAll() ) { - FindWindow( wxID_APPLY )->Disable(); + if( wxWindow* apply = FindWindow( wxID_APPLY ) ) apply->Disable(); if( m_listbook ) GetConfSettingsTabName() = m_labels[m_listbook->GetSelection()]; AppSaveSettings(); evt.Skip(); @@ -219,3 +238,9 @@ void Dialogs::BaseConfigurationDialog::OnScreenshot_Click( wxCommandEvent& evt ) memBmp.SaveFile( filename, wxBITMAP_TYPE_PNG ); } } + +void Dialogs::BaseConfigurationDialog::OnSettingsApplied( wxCommandEvent& evt ) +{ + evt.Skip(); + MSW_ListView_SetIconSpacing( m_listbook, GetClientSize().GetWidth() ); +} \ No newline at end of file diff --git a/pcsx2/gui/Dialogs/ConfigurationDialog.h b/pcsx2/gui/Dialogs/ConfigurationDialog.h index ad2581ce3c..ce6081a726 100644 --- a/pcsx2/gui/Dialogs/ConfigurationDialog.h +++ b/pcsx2/gui/Dialogs/ConfigurationDialog.h @@ -25,11 +25,14 @@ namespace Panels { class BaseSelectorPanel; - class MemoryCardListPanel_Advanced; class McdConfigPanel_Toggles; class BaseMcdListPanel; } +BEGIN_DECLARE_EVENT_TYPES() + DECLARE_EVENT_TYPE( pxEvt_SetSettingsPage, -1 ) +END_DECLARE_EVENT_TYPES() + namespace Dialogs { // -------------------------------------------------------------------------------------- @@ -56,12 +59,16 @@ namespace Dialogs void AddPage( const char* label, int iconid ); protected: + void OnSettingsApplied( wxCommandEvent& evt ); + void OnOk_Click( wxCommandEvent& evt ); void OnCancel_Click( wxCommandEvent& evt ); void OnApply_Click( wxCommandEvent& evt ); void OnScreenshot_Click( wxCommandEvent& evt ); void OnCloseWindow( wxCloseEvent& evt ); + void OnSetSettingsPage( wxCommandEvent& evt ); + virtual void OnSomethingChanged( wxCommandEvent& evt ); virtual wxString& GetConfSettingsTabName() const=0; }; @@ -102,18 +109,19 @@ namespace Dialogs protected: virtual wxString& GetConfSettingsTabName() const { return g_Conf->McdSettingsTabName; } + void OnMultitapClicked( wxCommandEvent& evt ); }; // -------------------------------------------------------------------------------------- - // AppConfigDialog + // ComponentsConfigDialog // -------------------------------------------------------------------------------------- - class AppConfigDialog : public BaseConfigurationDialog + class ComponentsConfigDialog : public BaseConfigurationDialog { protected: public: - virtual ~AppConfigDialog() throw() {} - AppConfigDialog(wxWindow* parent=NULL); + virtual ~ComponentsConfigDialog() throw() {} + ComponentsConfigDialog(wxWindow* parent=NULL); static wxString GetNameStatic() { return L"AppSettings"; } wxString GetDialogName() const { return GetNameStatic(); } diff --git a/pcsx2/gui/Dialogs/McdConfigDialog.cpp b/pcsx2/gui/Dialogs/McdConfigDialog.cpp index 20e1f9d62c..7f5f2ca6b8 100644 --- a/pcsx2/gui/Dialogs/McdConfigDialog.cpp +++ b/pcsx2/gui/Dialogs/McdConfigDialog.cpp @@ -57,22 +57,41 @@ Panels::McdConfigPanel_Toggles::McdConfigPanel_Toggles(wxWindow *parent) ) ); - *this += m_check_Ejection | pxExpand; - - #ifdef __WXMSW__ +#ifdef __WXMSW__ m_check_CompressNTFS = new pxCheckBox( this, _("Enable NTFS Compression on all cards by default."), GetMsg_McdNtfsCompress() - ); - + ); +#endif + + for( uint i=0; i<2; ++i ) + { + m_check_Multitap[i] = new pxCheckBox( this, wxsFormat(_("Enable Multitap on Port %u"), i+1) ); + m_check_Multitap[i]->SetClientData( (void*)i ); + m_check_Multitap[i]->SetName(wxsFormat( L"CheckBox::Multitap%u", i )); + } + + // ------------------------------ + // Sizers and Layout Section + // ------------------------------ + + for( uint i=0; i<2; ++i ) + *this += m_check_Multitap[i]| pxExpand; + + *this += 4; + + *this += m_check_Ejection | pxExpand; + #ifdef __WXMSW__ *this += m_check_CompressNTFS | pxExpand; #endif } void Panels::McdConfigPanel_Toggles::Apply() { + g_Conf->EmuOptions.MultitapPort0_Enabled = m_check_Multitap[0]->GetValue(); + g_Conf->EmuOptions.MultitapPort1_Enabled = m_check_Multitap[1]->GetValue(); + g_Conf->McdEnableEjection = m_check_Ejection->GetValue(); - #ifdef __WXMSW__ g_Conf->McdCompressNTFS = m_check_CompressNTFS->GetValue(); #endif @@ -80,9 +99,12 @@ void Panels::McdConfigPanel_Toggles::Apply() void Panels::McdConfigPanel_Toggles::AppStatusEvent_OnSettingsApplied() { - m_check_Ejection ->SetValue( g_Conf->McdEnableEjection ); + m_check_Multitap[0] ->SetValue( g_Conf->EmuOptions.MultitapPort0_Enabled ); + m_check_Multitap[1] ->SetValue( g_Conf->EmuOptions.MultitapPort1_Enabled ); + + m_check_Ejection ->SetValue( g_Conf->McdEnableEjection ); #ifdef __WXMSW__ - m_check_CompressNTFS ->SetValue( g_Conf->McdCompressNTFS ); + m_check_CompressNTFS->SetValue( g_Conf->McdCompressNTFS ); #endif } @@ -142,45 +164,38 @@ using namespace pxSizerFlags; Dialogs::McdConfigDialog::McdConfigDialog( wxWindow* parent ) : BaseConfigurationDialog( parent, _("MemoryCard Manager"), 600 ) { - // [TODO] : Discover and use a good multitap port icon! Possibility might be a - // simple 3x memorycards icon, in cascading form. - // (for now everything defaults to the redundant memorycard icon) + m_panel_mcdlist = new MemoryCardListPanel_Simple( this ); - if( false ) //g_Conf->McdAdvancedMode ) + // [TODO] : Plan here is to add an advanced tab which gives the user the ability + // to configure the names of each memorycard slot. + + //AddPage ( wxLt("Settings"), cfgid.MemoryCard ); + //AddPage ( wxLt("Slots 1/2"), cfgid.MemoryCard ); + + *this += m_panel_mcdlist | StdExpand(); + //*this += StdPadding; + *this += new wxStaticLine( this ) | StdExpand(); + *this += StdPadding; + *this += new McdConfigPanel_Toggles( this ) | StdExpand(); + + for( uint i=0; i<2; ++i ) { - m_panel_mcdlist = new MemoryCardListPanel_Advanced( this ); - - CreateListbook( wxGetApp().GetImgList_Config() ); - - const AppImageIds::ConfigIds& cfgid( wxGetApp().GetImgId().Config ); - AddPage ( wxLt("Settings"), cfgid.MemoryCard ); - AddPage ( wxLt("Slots 1/2"), cfgid.MemoryCard ); - AddPage ( wxLt("Multitap 1"), cfgid.MemoryCard ); - AddPage ( wxLt("Multitap 2"), cfgid.MemoryCard ); - - MSW_ListView_SetIconSpacing( m_listbook, m_idealWidth ); - - AddListbook(); - - *this += StdPadding; - *this += new wxStaticLine( this ) | StdExpand(); - *this += StdPadding; - *this += m_panel_mcdlist | StdExpand(); - } - else - { - m_panel_mcdlist = new MemoryCardListPanel_Simple( this ); - - *this += m_panel_mcdlist | StdExpand(); - //*this += StdPadding; - *this += new wxStaticLine( this ) | StdExpand(); - *this += StdPadding; - *this += new McdConfigPanel_Toggles( this ) | StdExpand(); + if( pxCheckBox* check = (pxCheckBox*)FindWindow(wxsFormat( L"CheckBox::Multitap%u", i )) ) + Connect( check->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(McdConfigDialog::OnMultitapClicked) ); } AddOkCancel(); } +void Dialogs::McdConfigDialog::OnMultitapClicked( wxCommandEvent& evt ) +{ + evt.Skip(); + if( !m_panel_mcdlist ) return; + + if( pxCheckBox* box = (pxCheckBox*)evt.GetEventObject() ) + m_panel_mcdlist->SetMultitapEnabled( (int)box->GetClientData(), box->IsChecked() ); +} + bool Dialogs::McdConfigDialog::Show( bool show ) { if( show && m_panel_mcdlist ) diff --git a/pcsx2/gui/Dialogs/SysConfigDialog.cpp b/pcsx2/gui/Dialogs/SysConfigDialog.cpp index 21235ff65b..065de93c0f 100644 --- a/pcsx2/gui/Dialogs/SysConfigDialog.cpp +++ b/pcsx2/gui/Dialogs/SysConfigDialog.cpp @@ -16,15 +16,12 @@ #include "PrecompiledHeader.h" #include "System.h" #include "App.h" -#include "MSWstuff.h" #include "ConfigurationDialog.h" #include "BaseConfigurationDialog.inl" #include "ModalPopups.h" #include "Panels/ConfigurationPanels.h" -//#include - using namespace Panels; Dialogs::SysConfigDialog::SysConfigDialog(wxWindow* parent) @@ -33,30 +30,27 @@ Dialogs::SysConfigDialog::SysConfigDialog(wxWindow* parent) CreateListbook( wxGetApp().GetImgList_Config() ); const AppImageIds::ConfigIds& cfgid( wxGetApp().GetImgId().Config ); - AddPage ( wxLt("EE/IOP"), cfgid.Cpu ); - AddPage ( wxLt("VUs"), cfgid.Cpu ); - AddPage ( wxLt("GS"), cfgid.Video ); - AddPage ( wxLt("Speedhacks"), cfgid.Speedhacks ); - AddPage ( wxLt("Game Fixes"), cfgid.Gamefixes ); - AddPage( wxLt("Plugins"), cfgid.Plugins ); - - MSW_ListView_SetIconSpacing( m_listbook, m_idealWidth ); + AddPage ( wxLt("EE/IOP"), cfgid.Cpu ); + AddPage ( wxLt("VUs"), cfgid.Cpu ); + AddPage ( wxLt("GS"), cfgid.Cpu ); + AddPage ( wxLt("Window"), cfgid.Video ); + AddPage ( wxLt("Speedhacks"), cfgid.Speedhacks ); + AddPage ( wxLt("Game Fixes"), cfgid.Gamefixes ); AddListbook(); AddOkCancel(); } -Dialogs::AppConfigDialog::AppConfigDialog(wxWindow* parent) +Dialogs::ComponentsConfigDialog::ComponentsConfigDialog(wxWindow* parent) : BaseConfigurationDialog( parent, _("Application Settings - PCSX2"), 600 ) { CreateListbook( wxGetApp().GetImgList_Config() ); const AppImageIds::ConfigIds& cfgid( wxGetApp().GetImgId().Config ); - AddPage ( wxLt("GS Window"), cfgid.Paths ); + AddPage ( wxLt("Plugins"), cfgid.Plugins ); + AddPage ( wxLt("BIOS"), cfgid.Cpu ); AddPage ( wxLt("Folders"), cfgid.Paths ); - MSW_ListView_SetIconSpacing( m_listbook, GetClientSize().GetWidth() ); - AddListbook(); AddOkCancel(); } diff --git a/pcsx2/gui/MSWstuff.cpp b/pcsx2/gui/MSWstuff.cpp index 3f4437e1d0..d8be803d10 100644 --- a/pcsx2/gui/MSWstuff.cpp +++ b/pcsx2/gui/MSWstuff.cpp @@ -55,7 +55,7 @@ void MSW_ListView_SetIconSpacing( wxListbook& listbook, int width ) // to the size of the frame's ideal width. ListView_SetIconSpacing( (HWND)listbook.GetListView()->GetHWND(), - (width / listbook.GetPageCount()) - 6, g_Conf->Listbook_ImageSize+32 // y component appears to be ignored + (width / listbook.GetPageCount()) - 4, g_Conf->Listbook_ImageSize+32 // y component appears to be ignored ); #endif } diff --git a/pcsx2/gui/MainFrame.cpp b/pcsx2/gui/MainFrame.cpp index db5c699527..d3ed28f833 100644 --- a/pcsx2/gui/MainFrame.cpp +++ b/pcsx2/gui/MainFrame.cpp @@ -152,13 +152,17 @@ void MainEmuFrame::ConnectMenus() ConnectMenu( MenuId_Config_SysSettings, Menu_SysSettings_Click ); ConnectMenu( MenuId_Config_McdSettings, Menu_McdSettings_Click ); - ConnectMenu( MenuId_Config_AppSettings, Menu_AppSettings_Click ); - ConnectMenu( MenuId_Config_BIOS, Menu_SelectBios_Click ); + ConnectMenu( MenuId_Config_AppSettings, Menu_WindowSettings_Click ); + ConnectMenu( MenuId_Config_BIOS, Menu_SelectPluginsBios_Click ); ConnectMenu( MenuId_Config_ResetAll, Menu_ResetAllSettings_Click ); ConnectMenu( MenuId_Config_Multitap0Toggle, Menu_MultitapToggle_Click ); ConnectMenu( MenuId_Config_Multitap1Toggle, Menu_MultitapToggle_Click ); + ConnectMenu( MenuId_Video_WindowSettings, Menu_WindowSettings_Click ); + ConnectMenu( MenuId_Video_CoreSettings, Menu_GSSettings_Click ); + + ConnectMenuRange(MenuId_Config_GS, PluginId_Count, Menu_ConfigPlugin_Click); ConnectMenuRange(MenuId_Src_Iso, 3, Menu_CdvdSource_Click); @@ -411,21 +415,19 @@ MainEmuFrame::MainEmuFrame(wxWindow* parent, const wxString& title) // ------------------------------------------------------------------------ m_menuConfig.Append(MenuId_Config_SysSettings, _("Emulation &Settings") ); - m_menuConfig.Append(MenuId_Config_AppSettings, _("App Settings") ); m_menuConfig.Append(MenuId_Config_McdSettings, _("&MemoryCards") ); + m_menuConfig.Append(MenuId_Config_BIOS, _("&Plugin/BIOS Selector...") ); m_menuConfig.AppendSeparator(); - - m_menuConfig.Append(MenuId_Config_GS, _("Video (GS)"), m_PluginMenuPacks[PluginId_GS]); - m_menuConfig.Append(MenuId_Config_SPU2, _("Audio (SPU2)"), m_PluginMenuPacks[PluginId_SPU2]); - m_menuConfig.Append(MenuId_Config_PAD, _("Controllers (PAD)"), m_PluginMenuPacks[PluginId_PAD]); + m_menuConfig.Append(MenuId_Config_GS, _("&Video (GS)"), m_PluginMenuPacks[PluginId_GS]); + m_menuConfig.Append(MenuId_Config_SPU2, _("&Audio (SPU2)"), m_PluginMenuPacks[PluginId_SPU2]); + m_menuConfig.Append(MenuId_Config_PAD, _("&Controllers (PAD)"), m_PluginMenuPacks[PluginId_PAD]); m_menuConfig.Append(MenuId_Config_DEV9, _("Dev9"), m_PluginMenuPacks[PluginId_DEV9]); m_menuConfig.Append(MenuId_Config_USB, _("USB"), m_PluginMenuPacks[PluginId_USB]); m_menuConfig.Append(MenuId_Config_FireWire, _("Firewire"), m_PluginMenuPacks[PluginId_FW]); m_menuConfig.AppendSeparator(); m_menuConfig.Append(MenuId_Config_Patches, _("Patches (unimplemented)"), wxEmptyString); - m_menuConfig.Append(MenuId_Config_BIOS, _("BIOS") ); m_menuConfig.AppendSeparator(); m_menuConfig.Append(MenuId_Config_Multitap0Toggle, _("Multitap 1"), wxEmptyString, wxITEM_CHECK ); @@ -637,8 +639,12 @@ void PerPluginMenuInfo::Populate( PluginsEnum_t pid ) if( PluginId == PluginId_GS ) { - MyMenu.Append( MenuId_Video_CoreSettings, _("Core Settings..."), - _("Modify video emulation settings regulated by the PCSX2 core virtual machine."), wxITEM_CHECK ); + MyMenu.Append( MenuId_Video_CoreSettings, _("Core GS Settings..."), + _("Modify hardware emulation settings regulated by the PCSX2 core virtual machine.") ); + + MyMenu.Append( MenuId_Video_WindowSettings, _("Window Settings..."), + _("Modify window and appearance options, including aspect ratio.") ); + MyMenu.AppendSeparator(); } diff --git a/pcsx2/gui/MainFrame.h b/pcsx2/gui/MainFrame.h index e1555f7a27..a3c717fbc5 100644 --- a/pcsx2/gui/MainFrame.h +++ b/pcsx2/gui/MainFrame.h @@ -163,8 +163,9 @@ protected: void Menu_SysSettings_Click(wxCommandEvent &event); void Menu_McdSettings_Click(wxCommandEvent &event); - void Menu_AppSettings_Click(wxCommandEvent &event); - void Menu_SelectBios_Click(wxCommandEvent &event); + void Menu_WindowSettings_Click(wxCommandEvent &event); + void Menu_GSSettings_Click(wxCommandEvent &event); + void Menu_SelectPluginsBios_Click(wxCommandEvent &event); void Menu_ResetAllSettings_Click(wxCommandEvent &event); void Menu_IsoBrowse_Click(wxCommandEvent &event); diff --git a/pcsx2/gui/MainMenuClicks.cpp b/pcsx2/gui/MainMenuClicks.cpp index 490568fd3a..13be9255db 100644 --- a/pcsx2/gui/MainMenuClicks.cpp +++ b/pcsx2/gui/MainMenuClicks.cpp @@ -48,14 +48,24 @@ void MainEmuFrame::Menu_McdSettings_Click(wxCommandEvent &event) AppOpenDialog( this ); } -void MainEmuFrame::Menu_AppSettings_Click(wxCommandEvent &event) +void MainEmuFrame::Menu_WindowSettings_Click(wxCommandEvent &event) { - AppOpenDialog( this ); + wxCommandEvent evt( pxEvt_SetSettingsPage ); + evt.SetString( L"Window" ); + AppOpenDialog( this )->GetEventHandler()->ProcessEvent( evt ); } -void MainEmuFrame::Menu_SelectBios_Click(wxCommandEvent &event) +void MainEmuFrame::Menu_GSSettings_Click(wxCommandEvent &event) { - AppOpenDialog( this ); + wxCommandEvent evt( pxEvt_SetSettingsPage ); + evt.SetString( L"GS" ); + AppOpenDialog( this )->GetEventHandler()->ProcessEvent( evt ); +} + +void MainEmuFrame::Menu_SelectPluginsBios_Click(wxCommandEvent &event) +{ + //AppOpenDialog( this ); + AppOpenDialog( this ); } diff --git a/pcsx2/gui/Panels/ConfigurationPanels.h b/pcsx2/gui/Panels/ConfigurationPanels.h index d9ee66dc5f..8b1688c74e 100644 --- a/pcsx2/gui/Panels/ConfigurationPanels.h +++ b/pcsx2/gui/Panels/ConfigurationPanels.h @@ -413,32 +413,8 @@ namespace Panels virtual bool ValidateEnumerationStatus(); }; - class MemoryCardListPanel_Advanced; class MemoryCardInfoPanel; - // -------------------------------------------------------------------------------------- - // MemoryCardsPanel - // -------------------------------------------------------------------------------------- - class MemoryCardsPanel : public BaseApplicableConfigPanel - { - protected: - MemoryCardListPanel_Advanced* m_panel_AllKnownCards; - MemoryCardInfoPanel* m_panel_cardinfo[8]; - pxCheckBox* m_check_Ejection; - pxCheckBox* m_check_Multitap[2]; - - uint m_Bindings[8]; - - public: - MemoryCardsPanel( wxWindow* parent ); - virtual ~MemoryCardsPanel() throw() { } - void Apply(); - - protected: - void OnMultitapChecked( wxCommandEvent& evt ); - void AppStatusEvent_OnSettingsApplied(); - }; - // -------------------------------------------------------------------------------------- // PluginSelectorPanel // -------------------------------------------------------------------------------------- diff --git a/pcsx2/gui/Panels/GSWindowPanel.cpp b/pcsx2/gui/Panels/GSWindowPanel.cpp index f27b6035ea..339d4db0a9 100644 --- a/pcsx2/gui/Panels/GSWindowPanel.cpp +++ b/pcsx2/gui/Panels/GSWindowPanel.cpp @@ -123,7 +123,6 @@ void Panels::GSWindowSettingsPanel::AppStatusEvent_OnSettingsApplied() m_text_WindowWidth ->SetValue( wxsFormat( L"%d", conf.WindowSize.GetWidth() ) ); m_text_WindowHeight ->SetValue( wxsFormat( L"%d", conf.WindowSize.GetHeight() ) ); - } void Panels::GSWindowSettingsPanel::Apply() diff --git a/pcsx2/gui/Panels/MemoryCardListPanel.cpp b/pcsx2/gui/Panels/MemoryCardListPanel.cpp index 6fc828185a..ea536c2be0 100644 --- a/pcsx2/gui/Panels/MemoryCardListPanel.cpp +++ b/pcsx2/gui/Panels/MemoryCardListPanel.cpp @@ -43,7 +43,6 @@ static bool IsMcdFormatted( wxFFile& fhand ) bool EnumerateMemoryCard( McdListItem& dest, const wxFileName& filename ) { dest.IsFormatted = false; - dest.IsEnabled = false; dest.IsPresent = false; const wxString fullpath( filename.GetFullPath() ); @@ -59,7 +58,6 @@ bool EnumerateMemoryCard( McdListItem& dest, const wxFileName& filename ) } dest.IsPresent = true; - dest.IsEnabled = true; dest.Filename = filename; dest.SizeInMB = (uint)(mcdFile.Length() / (1024 * 528 * 2)); dest.IsFormatted = IsMcdFormatted( mcdFile ); @@ -158,12 +156,6 @@ void Panels::BaseMcdListPanel::RefreshMcds() const GetEventHandler()->AddPendingEvent( refit ); } -/*void Panels::BaseMcdListPanel::OnEvent_McdRefresh( wxCommandEvent& evt ) const -{ - RefreshSelections(); - evt.Skip(); -}*/ - void Panels::BaseMcdListPanel::CreateLayout() { if( m_listview ) m_listview->SetMinSize( wxSize( m_idealWidth, 140 ) ); @@ -183,131 +175,16 @@ void Panels::BaseMcdListPanel::CreateLayout() *s_leftside_buttons += m_btn_Refresh; } -// ===================================================================================================== -// MemoryCardListPanel_Advanced (implementations) -// ===================================================================================================== -Panels::MemoryCardListPanel_Advanced::MemoryCardListPanel_Advanced( wxWindow* parent ) - : _parent( parent ) +void Panels::BaseMcdListPanel::AppStatusEvent_OnSettingsApplied() { - m_FolderPicker = new DirPickerPanel( this, FolderId_MemoryCards, - //_("MemoryCard Search Path:"), // static box label - _("Select folder with PS2 MemoryCards") // dir picker popup label - ); - - m_listview = new MemoryCardListView_Advanced(this); - - wxButton* button_Create = new wxButton(this, wxID_ANY, _("Create new card...")); - - // ------------------------------------ - // Sizer / Layout Section - // ------------------------------------ - - CreateLayout(); - *s_leftside_buttons += button_Create | StdSpace(); - - Connect( m_listview->GetId(), wxEVT_COMMAND_LIST_BEGIN_DRAG, wxListEventHandler (MemoryCardListPanel_Advanced::OnListDrag)); - Connect( button_Create->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (MemoryCardListPanel_Advanced::OnCreateNewCard)); -} - -void Panels::MemoryCardListPanel_Advanced::Apply() -{ -} - -void Panels::MemoryCardListPanel_Advanced::AppStatusEvent_OnSettingsApplied() -{ -} - -bool Panels::MemoryCardListPanel_Advanced::OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filenames) -{ - if( filenames.GetCount() == 1 && wxFileName(filenames[0]).IsDir() ) + if( (m_MultitapEnabled[0] != g_Conf->EmuOptions.MultitapPort0_Enabled) || + (m_MultitapEnabled[0] != g_Conf->EmuOptions.MultitapPort0_Enabled) ) { - m_FolderPicker->SetPath( filenames[0] ); - return true; + m_MultitapEnabled[0] = g_Conf->EmuOptions.MultitapPort0_Enabled; + m_MultitapEnabled[1] = g_Conf->EmuOptions.MultitapPort1_Enabled; + + RefreshMcds(); } - return false; -} - -bool Panels::MemoryCardListPanel_Advanced::ValidateEnumerationStatus() -{ - bool validated = true; - - // Impl Note: ScopedPtr used so that resources get cleaned up if an exception - // occurs during file enumeration. - ScopedPtr mcdlist( new McdList() ); - - if( m_FolderPicker->GetPath().Exists() ) - { - wxArrayString files; - wxDir::GetAllFiles( m_FolderPicker->GetPath().ToString(), &files, L"*.ps2", wxDIR_FILES ); - EnumerateMemoryCards( *mcdlist, files ); - } - - if( !m_KnownCards || (*mcdlist != *m_KnownCards) ) - validated = false; - - m_listview->SetMcdProvider( NULL ); - m_KnownCards.SwapPtr( mcdlist ); - - return validated; -} - -void Panels::MemoryCardListPanel_Advanced::DoRefresh() -{ - if( !m_KnownCards ) return; - - for( size_t i=0; isize(); ++i ) - { - McdListItem& mcditem( (*m_KnownCards)[i] ); - - for( int slot=0; slot<8; ++slot ) - { - wxFileName right( g_Conf->FullpathToMcd(slot) ); - right.MakeAbsolute(); - - wxFileName left( mcditem.Filename ); - left.MakeAbsolute(); - - if( left == right ) - { - mcditem.Slot = slot; - } - } - } - - m_listview->SetMcdProvider( this ); - //m_listview->SetCardCount( m_KnownCards->size() ); -} - -void Panels::MemoryCardListPanel_Advanced::OnCreateNewCard(wxCommandEvent& evt) -{ - -} - -void Panels::MemoryCardListPanel_Advanced::OnListDrag(wxListEvent& evt) -{ - wxFileDataObject my_data; - my_data.AddFile( (*m_KnownCards)[m_listview->GetItemData(m_listview->GetFirstSelected())].Filename.GetFullPath() ); - - wxDropSource dragSource( m_listview ); - dragSource.SetData( my_data ); - wxDragResult result = dragSource.DoDragDrop(wxDrag_AllowMove); -} - -int Panels::MemoryCardListPanel_Advanced::GetLength() const -{ - return m_KnownCards ? m_KnownCards->size() : 0; -} - -const McdListItem& Panels::MemoryCardListPanel_Advanced::GetCard( int idx ) const -{ - pxAssume(!!m_KnownCards); - return (*m_KnownCards)[idx]; -} - -McdListItem& Panels::MemoryCardListPanel_Advanced::GetCard( int idx ) -{ - pxAssume(!!m_KnownCards); - return (*m_KnownCards)[idx]; } // -------------------------------------------------------------------------------------- @@ -528,6 +405,13 @@ public: } }; +enum McdMenuId +{ + McdMenuId_Create = 0x888, + McdMenuId_Mount, + McdMenuId_RefreshList +}; + // ===================================================================================================== // MemoryCardListPanel_Simple (implementations) // ===================================================================================================== @@ -558,8 +442,16 @@ Panels::MemoryCardListPanel_Simple::MemoryCardListPanel_Simple( wxWindow* parent Connect( m_listview->GetId(), wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(MemoryCardListPanel_Simple::OnListSelectionChanged)); Connect( m_listview->GetId(), wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler(MemoryCardListPanel_Simple::OnListSelectionChanged)); + Connect( m_listview->GetId(), wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, wxListEventHandler(MemoryCardListPanel_Simple::OnOpenItemContextMenu) ); + Connect( m_button_Mount->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(MemoryCardListPanel_Simple::OnMountCard)); Connect( m_button_Create->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(MemoryCardListPanel_Simple::OnCreateCard)); + + // Popup Menu Connections! + + Connect( McdMenuId_Create, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MemoryCardListPanel_Simple::OnCreateCard) ); + Connect( McdMenuId_Mount, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MemoryCardListPanel_Simple::OnMountCard) ); + Connect( McdMenuId_RefreshList, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MemoryCardListPanel_Simple::OnRefreshSelections) ); } void Panels::MemoryCardListPanel_Simple::UpdateUI() @@ -575,13 +467,6 @@ void Panels::MemoryCardListPanel_Simple::UpdateUI() return; } - /*if( !pxAssertDev( m_listview->GetItemData(sel), "Selected memorycard item data is NULL!" ) ) - { - m_button_Create->Disable(); - m_button_Mount->Disable(); - return; - }*/ - const McdListItem& item( m_Cards[sel] ); m_button_Create->Enable(); @@ -604,10 +489,22 @@ void Panels::MemoryCardListPanel_Simple::UpdateUI() void Panels::MemoryCardListPanel_Simple::Apply() { + //_parent::Apply(); + + for( uint slot=0; slot<8; ++slot ) + { + g_Conf->Mcd[slot].Enabled = m_Cards[slot].IsEnabled && m_Cards[slot].IsPresent; + } } void Panels::MemoryCardListPanel_Simple::AppStatusEvent_OnSettingsApplied() { + for( uint slot=0; slot<8; ++slot ) + { + m_Cards[slot].IsEnabled = g_Conf->Mcd[slot].Enabled; + } + + _parent::AppStatusEvent_OnSettingsApplied(); } bool Panels::MemoryCardListPanel_Simple::OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filenames) @@ -689,7 +586,8 @@ void Panels::MemoryCardListPanel_Simple::OnMountCard(wxCommandEvent& evt) const uint slot = sel; m_Cards[slot].IsEnabled = !m_Cards[slot].IsEnabled; - RefreshSelections(); + m_listview->RefreshItem(slot); + UpdateUI(); } void Panels::MemoryCardListPanel_Simple::OnListDrag(wxListEvent& evt) @@ -709,6 +607,29 @@ void Panels::MemoryCardListPanel_Simple::OnListSelectionChanged(wxListEvent& evt UpdateUI(); } +void Panels::MemoryCardListPanel_Simple::OnOpenItemContextMenu(wxListEvent& evt) +{ + int idx = evt.GetIndex(); + + wxMenu* junk = new wxMenu(); + + if( idx != wxNOT_FOUND ) + { + const McdListItem& item( m_Cards[idx] ); + + junk->Append( McdMenuId_Create, item.IsPresent ? _("Delete") : _("Create new...") ); + junk->Append( McdMenuId_Mount, item.IsEnabled ? _("Disable") : _("Enable") ); + + junk->AppendSeparator(); + } + + junk->Append( McdMenuId_RefreshList, _("Refresh List") ); + + PopupMenu( junk ); + m_listview->RefreshItem( idx ); + UpdateUI(); +} + // Interface Implementation for IMcdList int Panels::MemoryCardListPanel_Simple::GetLength() const { diff --git a/pcsx2/gui/Panels/MemoryCardListView.cpp b/pcsx2/gui/Panels/MemoryCardListView.cpp index 9e3f8fa3ec..c3940286d2 100644 --- a/pcsx2/gui/Panels/MemoryCardListView.cpp +++ b/pcsx2/gui/Panels/MemoryCardListView.cpp @@ -22,6 +22,9 @@ using namespace pxSizerFlags; using namespace Panels; +// -------------------------------------------------------------------------------------- +// MemoryCardListView_Simple (implementations) +// -------------------------------------------------------------------------------------- enum McdColumnType_Simple { McdColS_PortSlot, // port and slot of the card @@ -33,6 +36,12 @@ enum McdColumnType_Simple McdColS_Count }; +MemoryCardListView_Simple::MemoryCardListView_Simple( wxWindow* parent ) + : _parent( parent ) +{ + CreateColumns(); +} + void MemoryCardListView_Simple::CreateColumns() { struct ColumnInfo @@ -55,12 +64,6 @@ void MemoryCardListView_Simple::CreateColumns() InsertColumn( i, columns[i].name, columns[i].align, -1 ); } -MemoryCardListView_Simple::MemoryCardListView_Simple( wxWindow* parent ) - : _parent( parent ) -{ - CreateColumns(); -} - void MemoryCardListView_Simple::SetCardCount( int length ) { if( !m_CardProvider ) length = 0; @@ -124,3 +127,101 @@ wxListItemAttr* MemoryCardListView_Simple::OnGetItemAttr(long item) const return &m_ItemAttr; } + +// -------------------------------------------------------------------------------------- +// MemoryCardListView_Advanced (implementations) +// -------------------------------------------------------------------------------------- +enum McdColumnType_Advanced +{ + McdColA_Filename, + McdColA_Mounted, + McdColA_Size, + McdColA_Formatted, + McdColA_DateModified, + McdColA_DateCreated, + McdColA_Count +}; + +MemoryCardListView_Advanced::MemoryCardListView_Advanced( wxWindow* parent ) + : _parent( parent ) +{ + CreateColumns(); +} + +void MemoryCardListView_Advanced::CreateColumns() +{ + struct ColumnInfo + { + wxString name; + wxListColumnFormat align; + }; + + const ColumnInfo columns[] = + { + { _("Filename"), wxLIST_FORMAT_LEFT }, + { _("Mounted"), wxLIST_FORMAT_CENTER }, + { _("Size"), wxLIST_FORMAT_LEFT }, + { _("Formatted"), wxLIST_FORMAT_CENTER }, + { _("Last Modified"), wxLIST_FORMAT_LEFT }, + { _("Created On"), wxLIST_FORMAT_LEFT }, + //{ _("Path"), wxLIST_FORMAT_LEFT } + }; + + for( int i=0; iGetCard(item) ); + + switch( column ) + { + case McdColA_Mounted: + { + if( !it.IsEnabled ) return _("No"); + return wxsFormat( L"%u", it.Slot+1); + } + + case McdColA_Filename: return it.Filename.GetName(); + case McdColA_Size: return wxsFormat( L"%u MB", it.SizeInMB ); + case McdColA_Formatted: return it.IsFormatted ? L"Yes" : L"No"; + case McdColA_DateModified: return it.DateModified.FormatDate(); + case McdColA_DateCreated: return it.DateModified.FormatDate(); + } + + pxFail( "Unknown column index in MemoryCardListView_Advanced -- returning an empty string." ); + return wxEmptyString; +} + +// return the icon for the given item. In report view, OnGetItemImage will +// only be called for the first column. See OnGetItemColumnImage for +// details. +int MemoryCardListView_Advanced::OnGetItemImage(long item) const +{ + return _parent::OnGetItemImage( item ); +} + +// return the icon for the given item and column. +int MemoryCardListView_Advanced::OnGetItemColumnImage(long item, long column) const +{ + return _parent::OnGetItemColumnImage( item, column ); +} + +// return the attribute for the item (may return NULL if none) +wxListItemAttr* MemoryCardListView_Advanced::OnGetItemAttr(long item) const +{ + wxListItemAttr* retval = _parent::OnGetItemAttr(item); + //const McdListItem& it( (*m_KnownCards)[item] ); + return retval; +} diff --git a/pcsx2/gui/Panels/MemoryCardPanels.h b/pcsx2/gui/Panels/MemoryCardPanels.h index af015598ce..0848f601e8 100644 --- a/pcsx2/gui/Panels/MemoryCardPanels.h +++ b/pcsx2/gui/Panels/MemoryCardPanels.h @@ -174,6 +174,8 @@ namespace Panels wxBoxSizer* s_leftside_buttons; wxBoxSizer* s_rightside_buttons; + bool m_MultitapEnabled[2]; + virtual void RefreshMcds() const; virtual wxDirName GetMcdPath() const @@ -187,6 +189,13 @@ namespace Panels BaseMcdListPanel( wxWindow* parent ); void CreateLayout(); + void SetMultitapEnabled( uint port, bool enabled ) + { + m_MultitapEnabled[port] = enabled; + RefreshMcds(); + } + + void AppStatusEvent_OnSettingsApplied(); }; // -------------------------------------------------------------------------------------- @@ -205,8 +214,6 @@ namespace Panels // Doubles as Mount and Unmount buttons wxButton* m_button_Mount; - - bool m_MultitapEnabled[2]; public: virtual ~MemoryCardListPanel_Simple() throw() {} @@ -224,40 +231,10 @@ namespace Panels void OnCreateCard(wxCommandEvent& evt); void OnMountCard(wxCommandEvent& evt); - virtual void OnListDrag(wxListEvent& evt); - virtual void OnListSelectionChanged(wxListEvent& evt); - virtual bool OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filenames); - - virtual void Apply(); - virtual void AppStatusEvent_OnSettingsApplied(); - virtual void DoRefresh(); - virtual bool ValidateEnumerationStatus(); - }; - - // -------------------------------------------------------------------------------------- - // MemoryCardListPanel_Advanced - // -------------------------------------------------------------------------------------- - class MemoryCardListPanel_Advanced - : public BaseMcdListPanel - { - typedef BaseMcdListPanel _parent; - - protected: - ScopedPtr m_KnownCards; - - public: - virtual ~MemoryCardListPanel_Advanced() throw() {} - MemoryCardListPanel_Advanced( wxWindow* parent ); - - // Interface Implementation for IMcdList - virtual int GetLength() const; - virtual const McdListItem& GetCard( int idx ) const; - virtual McdListItem& GetCard( int idx ); - - protected: - void OnCreateNewCard(wxCommandEvent& evt); - - virtual void OnListDrag(wxListEvent& evt); + void OnListDrag(wxListEvent& evt); + void OnListSelectionChanged(wxListEvent& evt); + void OnOpenItemContextMenu(wxListEvent& evt); + virtual bool OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filenames); virtual void Apply(); @@ -299,6 +276,7 @@ namespace Panels typedef BaseApplicableConfigPanel _parent; protected: + pxCheckBox* m_check_Multitap[2]; pxCheckBox* m_check_Ejection; #ifdef __WXMSW__ @@ -312,6 +290,7 @@ namespace Panels protected: void AppStatusEvent_OnSettingsApplied(); + void OnMultitapClicked(); }; class McdConfigPanel_Standard : public BaseApplicableConfigPanel diff --git a/pcsx2/gui/Panels/MemoryCardsPanel.cpp b/pcsx2/gui/Panels/MemoryCardsPanel.cpp index b463108bb5..20872e49a7 100644 --- a/pcsx2/gui/Panels/MemoryCardsPanel.cpp +++ b/pcsx2/gui/Panels/MemoryCardsPanel.cpp @@ -27,105 +27,8 @@ using namespace pxSizerFlags; using namespace Panels; -enum McdColumnType_Advanced -{ - McdCol_Filename, - McdCol_Mounted, - McdCol_Size, - McdCol_Formatted, - McdCol_DateModified, - McdCol_DateCreated, - McdCol_Count -}; - -void MemoryCardListView_Advanced::CreateColumns() -{ - struct ColumnInfo - { - wxString name; - wxListColumnFormat align; - }; - - const ColumnInfo columns[] = - { - { _("Filename"), wxLIST_FORMAT_LEFT }, - { _("Mounted"), wxLIST_FORMAT_CENTER }, - { _("Size"), wxLIST_FORMAT_LEFT }, - { _("Formatted"), wxLIST_FORMAT_CENTER }, - { _("Last Modified"), wxLIST_FORMAT_LEFT }, - { _("Created On"), wxLIST_FORMAT_LEFT }, - //{ _("Path"), wxLIST_FORMAT_LEFT } - }; - - for( int i=0; iGetCard(item) ); - - switch( column ) - { - case McdCol_Mounted: - { - if( !it.IsEnabled ) return _("No"); - return wxsFormat( L"%u", it.Slot+1); - } - - case McdCol_Filename: return it.Filename.GetName(); - case McdCol_Size: return wxsFormat( L"%u MB", it.SizeInMB ); - case McdCol_Formatted: return it.IsFormatted ? L"Yes" : L"No"; - case McdCol_DateModified: return it.DateModified.FormatDate(); - case McdCol_DateCreated: return it.DateModified.FormatDate(); - //case McdCol_Path: return it.Filename.GetPath(); - } - - pxFail( "Unknown column index in MemoryCardListView_Advanced -- returning an empty string." ); - return wxEmptyString; -} - -// return the icon for the given item. In report view, OnGetItemImage will -// only be called for the first column. See OnGetItemColumnImage for -// details. -int MemoryCardListView_Advanced::OnGetItemImage(long item) const -{ - return _parent::OnGetItemImage( item ); -} - -// return the icon for the given item and column. -int MemoryCardListView_Advanced::OnGetItemColumnImage(long item, long column) const -{ - return _parent::OnGetItemColumnImage( item, column ); -} - -// return the attribute for the item (may return NULL if none) -wxListItemAttr* MemoryCardListView_Advanced::OnGetItemAttr(long item) const -{ - wxListItemAttr* retval = _parent::OnGetItemAttr(item); - //const McdListItem& it( (*m_KnownCards)[item] ); - return retval; -} - - // ===================================================================================================== -// MemoryCardInfoPanel +// MemoryCardInfoPanel (implementations) // ===================================================================================================== MemoryCardInfoPanel::MemoryCardInfoPanel( wxWindow* parent, uint slot ) : BaseApplicableConfigPanel( parent, wxVERTICAL ) //, wxEmptyString ) @@ -260,52 +163,3 @@ void MemoryCardInfoPanel::AppStatusEvent_OnSettingsApplied() Refresh(); } - - -// -------------------------------------------------------------------------------------- -// MemoryCardsPanel Implementations -// -------------------------------------------------------------------------------------- -Panels::MemoryCardsPanel::MemoryCardsPanel( wxWindow* parent ) - : BaseApplicableConfigPanel( parent ) -{ - m_panel_AllKnownCards = new MemoryCardListPanel_Advanced( this ); - - for( uint slot=0; slot<2; ++slot ) - { - m_panel_cardinfo[slot] = new MemoryCardInfoPanel( this, slot ); - } - - // ------------------------------------ - // Sizer / Layout Section - // ------------------------------------ - - *this += m_panel_AllKnownCards | StdExpand(); -} - -void Panels::MemoryCardsPanel::OnMultitapChecked( wxCommandEvent& evt ) -{ - for( int port=0; port<2; ++port ) - { - if( m_check_Multitap[port]->GetId() != evt.GetId() ) continue; - - for( uint slot=1; slot<4; ++slot ) - { - //m_panel_cardinfo[port][slot]->Enable( m_check_Multitap[port]->IsChecked() ); - } - } -} - -void Panels::MemoryCardsPanel::Apply() -{ -} - -void Panels::MemoryCardsPanel::AppStatusEvent_OnSettingsApplied() -{ - const Pcsx2Config& emuconf( g_Conf->EmuOptions ); - - for( uint port=0; port<2; ++port ) - for( uint slot=1; slot<4; ++slot ) - { - //m_panel_cardinfo[port][slot]->Enable( emuconf.MultitapEnabled(port) ); - } -} diff --git a/pcsx2/gui/Panels/PathsPanel.cpp b/pcsx2/gui/Panels/PathsPanel.cpp index b965d1ed7e..fe4d54670f 100644 --- a/pcsx2/gui/Panels/PathsPanel.cpp +++ b/pcsx2/gui/Panels/PathsPanel.cpp @@ -32,8 +32,6 @@ Panels::BasePathsPanel::BasePathsPanel( wxWindow* parent ) Panels::StandardPathsPanel::StandardPathsPanel( wxWindow* parent ) : BasePathsPanel( parent ) { - //wxSizer& s_main( *GetSizer() ); - *this += BetweenFolderSpace; *this += (new DirPickerPanel( this, FolderId_Savestates, _("Savestates:"), @@ -64,6 +62,7 @@ Panels::StandardPathsPanel::StandardPathsPanel( wxWindow* parent ) : ) ) | SubGroup(); + /* *this += BetweenFolderSpace; *this += (new DirPickerPanel( this, FolderId_MemoryCards, _("Memorycards:"), @@ -72,9 +71,9 @@ Panels::StandardPathsPanel::StandardPathsPanel( wxWindow* parent ) : L"This is the default path where PCSX2 loads or creates its memory cards, and can be " L"overridden in the MemoryCard Configuration by using absolute filenames." ) - ) | SubGroup(); + ) | SubGroup();*/ - *this += 5; + *this += BetweenFolderSpace; GetSizer()->SetMinSize( wxSize( 475, GetSizer()->GetMinSize().GetHeight() ) ); } diff --git a/pcsx2/gui/Panels/VideoPanel.cpp b/pcsx2/gui/Panels/VideoPanel.cpp index 0583b5c89c..63486c125a 100644 --- a/pcsx2/gui/Panels/VideoPanel.cpp +++ b/pcsx2/gui/Panels/VideoPanel.cpp @@ -337,7 +337,7 @@ Panels::VideoPanel::VideoPanel( wxWindow* parent ) : void Panels::VideoPanel::OnOpenWindowSettings( wxCommandEvent& evt ) { - AppOpenDialog( this ); + AppOpenDialog( this ); // don't evt.skip, this prevents the Apply button from being activated. :) } diff --git a/pcsx2/gui/Readme-MemoryCardFile.txt b/pcsx2/gui/Readme-MemoryCardFile.txt new file mode 100644 index 0000000000..5193bcc964 --- /dev/null +++ b/pcsx2/gui/Readme-MemoryCardFile.txt @@ -0,0 +1,12 @@ + +-/- MemoryCardFile SVN Status -/- + +Currently the MemoryCardFile "plugin" is integrated into the main UI of PCSX2. It provides +standard raw/block emulation of a memorycard device. The plugin-ification of the MemoryCard +system has not yet been completed, which is why the plugin as of right now is "integrated" +into the UI. As the new PS2E.v2 plugin API is completed, the MemoryCardFile provider will +be moved into an external DLL. + +Due to these future plans, and due to the number of files involved in implementing the +user interface for memorycard management, I have arranged the MemoryCardFile plugin files +in their own sub-folder inside the Visual Studio project. \ No newline at end of file diff --git a/pcsx2/windows/VCprojects/pcsx2_2008.vcproj b/pcsx2/windows/VCprojects/pcsx2_2008.vcproj index 0a82118efd..57d2371582 100644 --- a/pcsx2/windows/VCprojects/pcsx2_2008.vcproj +++ b/pcsx2/windows/VCprojects/pcsx2_2008.vcproj @@ -2028,10 +2028,6 @@ RelativePath="..\..\gui\MainMenuClicks.cpp" > - - @@ -2111,10 +2107,6 @@ RelativePath="..\..\gui\Dialogs\LogOptionsDialog.h" > - - @@ -2661,22 +2653,6 @@ RelativePath="..\..\gui\Panels\LogOptionsPanels.h" > - - - - - - - - @@ -2934,6 +2910,42 @@ > + + + + + + + + + + + + + + + + + +