Merge pull request #4811 from lioncash/memcardmanager

MemcardManager: Minor changes
This commit is contained in:
Matthew Parlane 2017-02-04 10:09:01 +13:00 committed by GitHub
commit 529dc6aa53
2 changed files with 21 additions and 21 deletions

View File

@ -809,7 +809,7 @@ void CMemcardManager::CMemcardListCtrl::OnRightClick(wxMouseEvent& event)
popupMenu.Append(ID_SAVEEXPORT_A + slot, _("Export Save"));
popupMenu.Append(ID_EXPORTALL_A + slot, _("Export all saves"));
popupMenu.FindItem(ID_COPYFROM_A + slot)->Enable(__mcmSettings.twoCardsLoaded);
popupMenu.FindItem(ID_COPYFROM_A + slot)->Enable(mgr_settings.twoCardsLoaded);
popupMenu.AppendSeparator();
@ -820,9 +820,9 @@ void CMemcardManager::CMemcardListCtrl::OnRightClick(wxMouseEvent& event)
wxString::Format(_("Set as default Memory Card %c"), 'A' + slot));
popupMenu.AppendCheckItem(ID_USEPAGES, _("Enable pages"));
popupMenu.FindItem(ID_PREVPAGE_A + slot)->Enable(prevPage && __mcmSettings.usePages);
popupMenu.FindItem(ID_NEXTPAGE_A + slot)->Enable(nextPage && __mcmSettings.usePages);
popupMenu.FindItem(ID_USEPAGES)->Check(__mcmSettings.usePages);
popupMenu.FindItem(ID_PREVPAGE_A + slot)->Enable(prevPage && mgr_settings.usePages);
popupMenu.FindItem(ID_NEXTPAGE_A + slot)->Enable(nextPage && mgr_settings.usePages);
popupMenu.FindItem(ID_USEPAGES)->Check(mgr_settings.usePages);
popupMenu.AppendSeparator();
@ -836,7 +836,7 @@ void CMemcardManager::CMemcardListCtrl::OnRightClick(wxMouseEvent& event)
// for (int i = COLUMN_BANNER; i <= COLUMN_FIRSTBLOCK; i++)
for (int i = COLUMN_TITLE; i <= COLUMN_FIRSTBLOCK; i++)
{
popupMenu.FindItem(i)->Check(__mcmSettings.column[i]);
popupMenu.FindItem(i)->Check(mgr_settings.column[i]);
}
}
PopupMenu(&popupMenu);

View File

@ -28,23 +28,23 @@ public:
private:
DECLARE_EVENT_TABLE();
int page[2];
std::array<int, 2> page;
int itemsPerPage;
int maxPages;
std::string DefaultMemcard[2];
std::array<std::string, 2> DefaultMemcard;
std::string DefaultIOPath;
IniFile MemcardManagerIni;
IniFile::Section* iniMemcardSection;
wxButton* m_CopyFrom[2];
wxButton* m_SaveImport[2];
wxButton* m_SaveExport[2];
wxButton* m_Delete[2];
wxButton* m_NextPage[2];
wxButton* m_PrevPage[2];
std::array<wxButton*, 2> m_CopyFrom;
std::array<wxButton*, 2> m_SaveImport;
std::array<wxButton*, 2> m_SaveExport;
std::array<wxButton*, 2> m_Delete;
std::array<wxButton*, 2> m_NextPage;
std::array<wxButton*, 2> m_PrevPage;
wxButton* m_ConvertToGci;
wxFilePickerCtrl* m_MemcardPath[2];
wxStaticText* t_Status[2];
std::array<wxFilePickerCtrl*, 2> m_MemcardPath;
std::array<wxStaticText*, 2> t_Status;
enum
{
@ -108,24 +108,24 @@ private:
bool LoadSettings();
bool SaveSettings();
struct _mcmSettings
struct ManagerSettings
{
bool twoCardsLoaded;
bool usePages;
bool column[NUMBER_OF_COLUMN + 1];
std::array<bool, NUMBER_OF_COLUMN + 1> column;
} mcmSettings;
class CMemcardListCtrl : public wxListCtrl
{
public:
CMemcardListCtrl(wxWindow* parent, const wxWindowID id, const wxPoint& pos, const wxSize& size,
long style, _mcmSettings& _mcmSetngs)
: wxListCtrl(parent, id, pos, size, style), __mcmSettings(_mcmSetngs)
long style, ManagerSettings& manager_settings)
: wxListCtrl(parent, id, pos, size, style), mgr_settings(manager_settings)
{
Bind(wxEVT_RIGHT_DOWN, &CMemcardListCtrl::OnRightClick, this);
}
~CMemcardListCtrl() { Unbind(wxEVT_RIGHT_DOWN, &CMemcardListCtrl::OnRightClick, this); }
_mcmSettings& __mcmSettings;
ManagerSettings& mgr_settings;
bool prevPage;
bool nextPage;
@ -134,5 +134,5 @@ private:
};
wxSize m_image_list_size;
CMemcardListCtrl* m_MemcardList[2];
std::array<CMemcardListCtrl*, 2> m_MemcardList;
};