1 // Copyright (C) 2003 Dolphin Project.
3 // This program is free software: you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation, version 2.0.
7 // This program is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 // GNU General Public License 2.0 for more details.
12 // A copy of the GPL 2.0 should have been included with the program.
13 // If not, see http://www.gnu.org/licenses/
15 // Official SVN repository and contact information can be found at
16 // http://code.google.com/p/dolphin-emu/
18 #ifndef __MEMCARD_MANAGER_h__
19 #define __MEMCARD_MANAGER_h__
23 #include <wx/filepicker.h>
24 #include <wx/statbmp.h>
25 #include <wx/stattext.h>
26 #include <wx/listctrl.h>
27 #include <wx/imaglist.h>
28 #include <wx/fontmap.h>
32 #include "MemoryCards/GCMemcard.h"
34 #undef MEMCARD_MANAGER_STYLE
35 #define MEMCARD_MANAGER_STYLE wxCAPTION | wxSYSTEM_MENU | wxDIALOG_NO_PARENT | wxCLOSE_BOX | wxRESIZE_BORDER | wxMAXIMIZE_BOX
36 #define MEMCARDMAN_TITLE "Memory Card Manager WARNING-Make backups before using, should be fixed but could mangle stuff!"
38 #define E_SAVEFAILED "File write failed"
39 #define E_UNK "Unknown error"
44 #define CONFIG_FILE "./MemcardManager.ini"
46 #define MCM_DEBUG_FRAME
51 class CMemcardManager
: public wxDialog
55 CMemcardManager(wxWindow
*parent
, wxWindowID id
= wxID_ANY
, const wxString
& title
= wxT(MEMCARDMAN_TITLE
),
56 const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
, long style
= MEMCARD_MANAGER_STYLE
);
57 virtual ~CMemcardManager();
60 DECLARE_EVENT_TABLE();
65 std::string DefaultMemcard
[2],
67 IniFile MemcardManagerIni
;
68 #ifdef MCM_DEBUG_FRAME
69 CMemcardManagerDebug
* MemcardManagerDebug
;
75 wxButton
*m_CopyFrom
[2],
82 wxFilePickerCtrl
*m_MemcardPath
[2];
83 wxStaticBoxSizer
*sMemcard
[2];
84 wxStaticText
*t_Status
[2];
88 ID_COPYFROM_A
= 1000, // Do not rearrange these items,
89 ID_COPYFROM_B
, // ID_..._B must be 1 more than ID_..._A
110 ID_DUMMY_VALUE_
//don't remove this value unless you have other enum values
131 COLUMN_COMMENTSADDRESS
,
135 GCMemcard
*memoryCard
[2];
137 void CreateGUIControls();
138 void OnClose(wxCloseEvent
& event
);
139 void CopyDeleteClick(wxCommandEvent
& event
);
140 bool ReloadMemcard(const char *fileName
, int card
);
141 void OnMenuChange(wxCommandEvent
& event
);
142 void OnPageChange(wxCommandEvent
& event
);
143 void OnPathChange(wxFileDirPickerEvent
& event
);
144 void ChangePath(int id
);
145 bool CopyDeleteSwitch(u32 error
, int slot
);
147 class CMemcardListCtrl
: public wxListCtrl
150 IniFile MemcardManagerIni
;
152 CMemcardListCtrl(wxWindow
* parent
, const wxWindowID id
, const wxPoint
& pos
, const wxSize
& size
, long style
);
158 column
[NUMBER_OF_COLUMN
+1];
160 DECLARE_EVENT_TABLE()
161 void OnRightClick(wxMouseEvent
& event
);
164 CMemcardListCtrl
*m_MemcardList
[2];