1
// Copyright 2013 Dolphin Emulator Project
2
// Licensed under GPLv2
3
// Refer to the license.txt file included.
5
#ifndef __MEMCARD_MANAGER_h__
6
#define __MEMCARD_MANAGER_h__
10
#include <wx/filepicker.h>
11
#include <wx/statbmp.h>
12
#include <wx/stattext.h>
13
#include <wx/listctrl.h>
14
#include <wx/imaglist.h>
15
#include <wx/fontmap.h>
19
#include "HW/GCMemcard.h"
21
#undef MEMCARD_MANAGER_STYLE
22
#define MEMCARD_MANAGER_STYLE wxCAPTION | wxSYSTEM_MENU | wxDIALOG_NO_PARENT | wxCLOSE_BOX | wxRESIZE_BORDER | wxMAXIMIZE_BOX
23
#define MEMCARDMAN_TITLE _trans("Memory Card Manager WARNING-Make backups before using, should be fixed but could mangle stuff!")
25
#define E_SAVEFAILED "File write failed"
26
#define E_UNK "Unknown error"
29
class CMemcardManager : public wxDialog
33
CMemcardManager(wxWindow *parent, wxWindowID id = wxID_ANY, const wxString& title = wxGetTranslation(wxT(MEMCARDMAN_TITLE)),
34
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = MEMCARD_MANAGER_STYLE);
35
virtual ~CMemcardManager();
38
DECLARE_EVENT_TABLE();
43
std::string DefaultMemcard[2],
45
IniFile MemcardManagerIni;
46
IniFile::Section* iniMemcardSection;
48
wxButton *m_CopyFrom[2],
55
wxFilePickerCtrl *m_MemcardPath[2];
56
wxStaticText *t_Status[2];
60
ID_COPYFROM_A = 1000, // Do not rearrange these items,
61
ID_COPYFROM_B, // ID_..._B must be 1 more than ID_..._A
82
ID_DUMMY_VALUE_ //don't remove this value unless you have other enum values
103
COLUMN_COMMENTSADDRESS,
107
GCMemcard *memoryCard[2];
109
void CreateGUIControls();
110
void CopyDeleteClick(wxCommandEvent& event);
111
bool ReloadMemcard(const char *fileName, int card);
112
void OnMenuChange(wxCommandEvent& event);
113
void OnPageChange(wxCommandEvent& event);
114
void OnPathChange(wxFileDirPickerEvent& event);
115
void ChangePath(int id);
116
bool CopyDeleteSwitch(u32 error, int slot);
124
bool column[NUMBER_OF_COLUMN + 1];
127
class CMemcardListCtrl : public wxListCtrl
129
//BEGIN_EVENT_TABLE(CMemcardManager::CMemcardListCtrl, wxListCtrl)
130
// EVT_RIGHT_DOWN(CMemcardManager::CMemcardListCtrl::OnRightClick)
133
CMemcardListCtrl(wxWindow* parent, const wxWindowID id,
134
const wxPoint& pos, const wxSize& size,
135
long style, _mcmSettings& _mcmSetngs)
136
: wxListCtrl(parent, id, pos, size, style)
137
, __mcmSettings(_mcmSetngs)
139
Bind(wxEVT_RIGHT_DOWN, &CMemcardListCtrl::OnRightClick, this);
143
Unbind(wxEVT_RIGHT_DOWN, &CMemcardListCtrl::OnRightClick, this);
145
_mcmSettings & __mcmSettings;
149
void OnRightClick(wxMouseEvent& event);
152
CMemcardListCtrl *m_MemcardList[2];