From 441ded0788720c2416c7d0685ba5130d5a530e07 Mon Sep 17 00:00:00 2001 From: "avihal@gmail.com" Date: Fri, 18 Mar 2011 17:34:08 +0000 Subject: [PATCH] MCD manager: remove port-status and related button/context-menu. - Following rama's suggestion, and because cards can now be easily ejected/inserted, there's no more need for enabling/disabling the port. It also makes it easier to use (less configuration), and resembles the real PS2 counterpart more closely (a card can either be used or not used and that's it). - For consistency, the MCD manager now automatically ejects cards which are "disabled" (Note: multitap cards can still be internally enabled when MT is disabled, but they not used because MT is disabled). git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4453 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/gui/Dialogs/McdConfigDialog.cpp | 2 +- pcsx2/gui/Panels/MemoryCardListPanel.cpp | 35 ++++++++++++++++-------- pcsx2/gui/Panels/MemoryCardListView.cpp | 12 ++++---- pcsx2/gui/Panels/MemoryCardPanels.h | 2 +- 4 files changed, 32 insertions(+), 19 deletions(-) diff --git a/pcsx2/gui/Dialogs/McdConfigDialog.cpp b/pcsx2/gui/Dialogs/McdConfigDialog.cpp index 532e4fc2e8..d36c05e2ec 100644 --- a/pcsx2/gui/Dialogs/McdConfigDialog.cpp +++ b/pcsx2/gui/Dialogs/McdConfigDialog.cpp @@ -110,7 +110,7 @@ Dialogs::McdConfigDialog::McdConfigDialog( wxWindow* parent ) wxBoxSizer* s_top = new wxBoxSizer(wxVERTICAL); wxString title=_("Drag cards to or from PS2-ports"); - title+=_("\nNote: Rename/Duplicate/Create/Delete will NOT be reverted with 'Cancel'."); + title+=_("\nNote: Duplicate/Rename/Create/Delete will NOT be reverted with 'Cancel'."); *s_top += Heading(title) | StdExpand(); *s_top += StdPadding; diff --git a/pcsx2/gui/Panels/MemoryCardListPanel.cpp b/pcsx2/gui/Panels/MemoryCardListPanel.cpp index 7e5f41b54d..54be581c40 100644 --- a/pcsx2/gui/Panels/MemoryCardListPanel.cpp +++ b/pcsx2/gui/Panels/MemoryCardListPanel.cpp @@ -418,7 +418,7 @@ public: enum McdMenuId { McdMenuId_Create = 0x888, - McdMenuId_Mount, + //McdMenuId_Mount, McdMenuId_Rename, McdMenuId_RefreshList, McdMenuId_AssignUnassign, @@ -439,11 +439,11 @@ Panels::MemoryCardListPanel_Simple::MemoryCardListPanel_Simple( wxWindow* parent m_listview = new MemoryCardListView_Simple(this); - m_listview->SetMinSize(wxSize(700, m_listview->GetCharHeight() * 13)); // 740 is nice for default font sizes + m_listview->SetMinSize(wxSize(600, m_listview->GetCharHeight() * 13)); // 740 is nice for default font sizes m_listview->SetDropTarget( new McdDropTarget(m_listview) ); - m_button_Mount = new wxButton(this, wxID_ANY, _("Enable port")); + //m_button_Mount = new wxButton(this, wxID_ANY, _("Enable port")); m_button_AssignUnassign = new wxButton(this, wxID_ANY, _("Eject")); m_button_Duplicate = new wxButton(this, wxID_ANY, _("Duplicate ...")); @@ -457,16 +457,16 @@ Panels::MemoryCardListPanel_Simple::MemoryCardListPanel_Simple( wxWindow* parent CreateLayout(); *s_leftside_buttons += 20; - *s_leftside_buttons += m_button_Mount; - *s_leftside_buttons += 20; + //*s_leftside_buttons += m_button_Mount; + //*s_leftside_buttons += 20; *s_leftside_buttons += Label(_("Card: ")) | pxMiddle; *s_leftside_buttons += m_button_AssignUnassign; - *s_leftside_buttons += 2; + *s_leftside_buttons += 20; *s_leftside_buttons += m_button_Duplicate; *s_leftside_buttons += 2; *s_leftside_buttons += m_button_Rename; - *s_leftside_buttons += 8; + *s_leftside_buttons += 2; *s_leftside_buttons += m_button_Create; SetSizerAndFit(GetSizer()); @@ -481,7 +481,7 @@ Panels::MemoryCardListPanel_Simple::MemoryCardListPanel_Simple( wxWindow* parent 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_Mount->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(MemoryCardListPanel_Simple::OnMountCard)); Connect( m_button_Create->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(MemoryCardListPanel_Simple::OnCreateOrDeleteCard)); Connect( m_button_Rename->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(MemoryCardListPanel_Simple::OnRenameFile)); Connect( m_button_Duplicate->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(MemoryCardListPanel_Simple::OnDuplicateFile)); @@ -489,7 +489,7 @@ Panels::MemoryCardListPanel_Simple::MemoryCardListPanel_Simple( wxWindow* parent // Popup Menu Connections! Connect( McdMenuId_Create, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MemoryCardListPanel_Simple::OnCreateOrDeleteCard) ); - Connect( McdMenuId_Mount, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MemoryCardListPanel_Simple::OnMountCard) ); + //Connect( McdMenuId_Mount, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MemoryCardListPanel_Simple::OnMountCard) ); Connect( McdMenuId_Rename, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MemoryCardListPanel_Simple::OnRenameFile) ); Connect( McdMenuId_AssignUnassign, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MemoryCardListPanel_Simple::OnAssignUnassignFile) ); Connect( McdMenuId_Duplicate, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MemoryCardListPanel_Simple::OnDuplicateFile) ); @@ -511,7 +511,7 @@ void Panels::MemoryCardListPanel_Simple::UpdateUI() if( wxNOT_FOUND == sel ) { m_button_Create->Disable(); - m_button_Mount->Disable(); +// m_button_Mount->Disable(); m_button_Rename->Disable(); m_button_Duplicate->Disable(); m_button_AssignUnassign->Disable(); @@ -520,6 +520,7 @@ void Panels::MemoryCardListPanel_Simple::UpdateUI() const McdSlotItem& card( GetCardForViewIndex(sel) ); + m_button_Rename->Enable( card.IsPresent ); wxString renameTip = _("Rename this memory card ..."); pxSetToolTip( m_button_Rename, renameTip ); @@ -542,6 +543,7 @@ void Panels::MemoryCardListPanel_Simple::UpdateUI() else pxSetToolTip( m_button_Create, _("Create a new memory card and assign it to the selected PS2-Port." )); +/* m_button_Mount->Enable( card.IsPresent && card.Slot>=0); m_button_Mount->SetLabel( card.IsEnabled ? _("Disable Port") : _("Enable Port") ); pxSetToolTip( m_button_Mount, @@ -549,7 +551,7 @@ void Panels::MemoryCardListPanel_Simple::UpdateUI() ? _("Disable the selected PS2-Port (this memory card will be invisible to games/BIOS).") : _("Enable the selected PS2-Port (games/BIOS will see this memory card).") ); - +*/ } void Panels::MemoryCardListPanel_Simple::Apply() @@ -597,6 +599,13 @@ void Panels::MemoryCardListPanel_Simple::AppStatusEvent_OnSettingsApplied() } } + if ( !m_Cards[slot].IsEnabled || !wxFileExists( targetFile ) ) + { + m_Cards[slot].IsEnabled = false; + m_Cards[slot].IsPresent = false; + m_Cards[slot].Filename = L""; + } + } DoRefresh(); @@ -869,6 +878,7 @@ void Panels::MemoryCardListPanel_Simple::OnCreateOrDeleteCard(wxCommandEvent& ev } //enable/disapbe port +/* void Panels::MemoryCardListPanel_Simple::OnMountCard(wxCommandEvent& evt) { evt.Skip(); @@ -882,6 +892,7 @@ void Panels::MemoryCardListPanel_Simple::OnMountCard(wxCommandEvent& evt) m_listview->RefreshItem(selectedViewIndex); UpdateUI(); } +*/ /* //text dialog: can be used for rename: wxGetTextFromUser - avih void Panels::MemoryCardListPanel_Simple::OnRelocateCard(wxCommandEvent& evt) @@ -1021,11 +1032,13 @@ void Panels::MemoryCardListPanel_Simple::OnOpenItemContextMenu(wxListEvent& evt) const McdSlotItem& card( GetCardForViewIndex(idx) ); if (card.IsPresent){ + /* if (card.Slot>=0) { junk->Append( McdMenuId_Mount, card.IsEnabled ? _("Disable Port") : _("Enable Port") ); junk->AppendSeparator(); } + */ junk->Append( McdMenuId_AssignUnassign, card.Slot>=0?_("Eject card"):_("Insert card ...") ); junk->Append( McdMenuId_Duplicate, _("Duplicate card ...") ); junk->Append( McdMenuId_Rename, _("Rename card ...") ); diff --git a/pcsx2/gui/Panels/MemoryCardListView.cpp b/pcsx2/gui/Panels/MemoryCardListView.cpp index 162d8c22fd..9f08545bd1 100644 --- a/pcsx2/gui/Panels/MemoryCardListView.cpp +++ b/pcsx2/gui/Panels/MemoryCardListView.cpp @@ -72,7 +72,7 @@ void BaseMcdListView::LoadSaveColumns( IniInterface& ini ) enum McdColumnType_Simple { McdColS_PortSlot, // port and slot of the card - McdColS_Status, // either Enabled/Disabled, or Missing (no card). + //McdColS_Status, // either Enabled/Disabled, or Missing (no card). McdColS_Filename, McdColS_Size, McdColS_Formatted, @@ -103,9 +103,9 @@ const ListViewColumnInfo& MemoryCardListView_Simple::GetDefaultColumnInfo( uint static const ListViewColumnInfo columns[] = { { _("PS2 Port") , 154 , wxLIST_FORMAT_LEFT }, - { _("Port status") , 80 , wxLIST_FORMAT_LEFT }, - { _("File name") , 126 , wxLIST_FORMAT_LEFT }, - { _("File size") , 60 , wxLIST_FORMAT_LEFT }, + //{ _("Port status") , 80 , wxLIST_FORMAT_LEFT }, + { _("Card (file) name") , 126 , wxLIST_FORMAT_LEFT }, + { _("Card size") , 60 , wxLIST_FORMAT_LEFT }, { _("Formatted") , 80 , wxLIST_FORMAT_LEFT }, { _("Last Modified"), 85 , wxLIST_FORMAT_LEFT }, { _("Created on") , 85 , wxLIST_FORMAT_LEFT }, @@ -141,7 +141,7 @@ wxString MemoryCardListView_Simple::OnGetItemText(long item, long column) const } return L""; - +/* case McdColS_Status: { wxString res = prefix + (it.IsEnabled ? _("Enabled") : _("Disabled")); @@ -151,7 +151,7 @@ wxString MemoryCardListView_Simple::OnGetItemText(long item, long column) const res= L""; return prefix + res; } - +*/ case McdColS_Size: return prefix + ( !it.IsPresent ? L"" : pxsFmt( L"%u MB", it.SizeInMB ) ); case McdColS_Formatted: return prefix + ( !it.IsPresent ? L"" : ( it.IsFormatted ? _("Yes") : _("No")) ); case McdColS_DateModified: return prefix + ( !it.IsPresent ? L"" : it.DateModified.FormatDate() ); diff --git a/pcsx2/gui/Panels/MemoryCardPanels.h b/pcsx2/gui/Panels/MemoryCardPanels.h index 3e7b612b23..bf32c7113f 100644 --- a/pcsx2/gui/Panels/MemoryCardPanels.h +++ b/pcsx2/gui/Panels/MemoryCardPanels.h @@ -211,7 +211,7 @@ namespace Panels wxButton* m_button_Create; // Doubles as Mount and Unmount buttons ("Enable"/"Disable" port) - wxButton* m_button_Mount; +// wxButton* m_button_Mount; wxButton* m_button_AssignUnassign; //insert/eject card wxButton* m_button_Duplicate;