Missed one instance of the Shift-JIS font. Hopefully this fixes issue 2736?
[dolphin.git] / Source / Core / DolphinWX / Src / MemcardManager.h
blob32f7e82dcfa453b125078e49e8308e583eed5c43
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__
21 #include <wx/wx.h>
22 #include <wx/sizer.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>
30 #include "IniFile.h"
31 #include "FileUtil.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"
40 #define FIRSTPAGE 0
42 #ifdef MEMCMAN
43 #undef CONFIG_FILE
44 #define CONFIG_FILE "./MemcardManager.ini"
45 #define DEBUG_MCM
46 #define MCM_DEBUG_FRAME
47 #include "MCMdebug.h"
48 #endif
51 class CMemcardManager : public wxDialog
53 public:
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();
59 private:
60 DECLARE_EVENT_TABLE();
62 int page[2],
63 itemsPerPage,
64 maxPages;
65 std::string DefaultMemcard[2],
66 DefaultIOPath;
67 IniFile MemcardManagerIni;
68 #ifdef MCM_DEBUG_FRAME
69 CMemcardManagerDebug * MemcardManagerDebug;
70 #endif
72 wxBoxSizer *sMain,
73 *sButtons,
74 *sPages[2];
75 wxButton *m_CopyFrom[2],
76 *m_SaveImport[2],
77 *m_SaveExport[2],
78 *m_Delete[2],
79 *m_NextPage[2],
80 *m_PrevPage[2],
81 *m_ConvertToGci;
82 wxFilePickerCtrl *m_MemcardPath[2];
83 wxStaticBoxSizer *sMemcard[2];
84 wxStaticText *t_Status[2];
86 enum
88 ID_COPYFROM_A = 1000, // Do not rearrange these items,
89 ID_COPYFROM_B, // ID_..._B must be 1 more than ID_..._A
90 ID_FIXCHECKSUM_A,
91 ID_FIXCHECKSUM_B,
92 ID_DELETE_A,
93 ID_DELETE_B,
94 ID_SAVEEXPORT_A,
95 ID_SAVEEXPORT_B,
96 ID_SAVEIMPORT_A,
97 ID_SAVEIMPORT_B,
98 ID_EXPORTALL_A,
99 ID_EXPORTALL_B,
100 ID_CONVERTTOGCI,
101 ID_NEXTPAGE_A,
102 ID_NEXTPAGE_B,
103 ID_PREVPAGE_A,
104 ID_PREVPAGE_B,
105 ID_MEMCARDLIST_A,
106 ID_MEMCARDLIST_B,
107 ID_MEMCARDPATH_A,
108 ID_MEMCARDPATH_B,
109 ID_USEPAGES,
110 ID_DUMMY_VALUE_ //don't remove this value unless you have other enum values
113 enum
115 COLUMN_BANNER = 0,
116 COLUMN_TITLE,
117 COLUMN_COMMENT,
118 COLUMN_ICON,
119 COLUMN_BLOCKS,
120 COLUMN_FIRSTBLOCK,
121 COLUMN_GAMECODE,
122 COLUMN_MAKERCODE,
123 COLUMN_FILENAME,
124 COLUMN_BIFLAGS,
125 COLUMN_MODTIME,
126 COLUMN_IMAGEADD,
127 COLUMN_ICONFMT,
128 COLUMN_ANIMSPEED,
129 COLUMN_PERMISSIONS,
130 COLUMN_COPYCOUNTER,
131 COLUMN_COMMENTSADDRESS,
132 NUMBER_OF_COLUMN
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
149 public:
150 IniFile MemcardManagerIni;
152 CMemcardListCtrl(wxWindow* parent, const wxWindowID id, const wxPoint& pos, const wxSize& size, long style);
153 ~CMemcardListCtrl();
154 bool twoCardsLoaded,
155 usePages,
156 prevPage,
157 nextPage,
158 column[NUMBER_OF_COLUMN+1];
159 private:
160 DECLARE_EVENT_TABLE()
161 void OnRightClick(wxMouseEvent& event);
164 CMemcardListCtrl *m_MemcardList[2];
167 #endif