2008-09-07 20:26:38 +00:00
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
2008-10-14 03:16:09 +00:00
2008-09-07 20:26:38 +00:00
# ifndef __MEMCARD_MANAGER_h__
# define __MEMCARD_MANAGER_h__
# include <wx/sizer.h>
# include <wx/filepicker.h>
# include <wx/statbmp.h>
# include <wx/stattext.h>
# include <wx/listctrl.h>
# include <wx/imaglist.h>
# include "MemoryCards/GCMemcard.h"
# undef MEMCARD_MANAGER_STYLE
# define MEMCARD_MANAGER_STYLE wxCAPTION | wxSYSTEM_MENU | wxDIALOG_NO_PARENT | wxCLOSE_BOX | wxRESIZE_BORDER | wxMAXIMIZE_BOX
class CMemcardManager
: public wxDialog
{
public :
2008-11-08 20:34:43 +00:00
CMemcardManager ( wxWindow * parent , wxWindowID id = 1 , const wxString & title = wxT ( " Memory Card Manager WARNING-Make backups before using, should be fixed but could mangle stuff! " ) , const wxPoint & pos = wxDefaultPosition , const wxSize & size = wxDefaultSize , long style = MEMCARD_MANAGER_STYLE ) ;
2008-09-07 20:26:38 +00:00
virtual ~ CMemcardManager ( ) ;
private :
DECLARE_EVENT_TABLE ( ) ;
2008-11-23 06:41:27 +00:00
int page1 ,
page2 ;
2008-10-12 06:09:52 +00:00
wxBoxSizer * sMain ;
2008-11-23 06:41:27 +00:00
wxBoxSizer * sPagesLeft ;
wxBoxSizer * sPagesRight ;
wxStaticText * t_StatusLeft ;
wxStaticText * t_StatusRight ;
2008-11-08 20:34:43 +00:00
wxButton * m_CopyToLeft ;
wxButton * m_CopyToRight ;
2008-11-23 06:41:27 +00:00
wxButton * m_FixChecksumLeft ;
wxButton * m_FixChecksumRight ;
2008-10-18 05:33:52 +00:00
wxButton * m_SaveImportLeft ;
wxButton * m_SaveExportLeft ;
wxButton * m_SaveImportRight ;
wxButton * m_SaveExportRight ;
2008-10-14 03:16:09 +00:00
wxButton * m_ConvertToGci ;
2008-10-12 06:09:52 +00:00
wxButton * m_DeleteLeft ;
wxButton * m_DeleteRight ;
2008-11-23 06:41:27 +00:00
wxButton * m_Memcard1PrevPage ;
wxButton * m_Memcard1NextPage ;
wxButton * m_Memcard2PrevPage ;
wxButton * m_Memcard2NextPage ;
2008-10-12 06:09:52 +00:00
wxStaticBoxSizer * sMemcard1 ;
wxStaticBoxSizer * sMemcard2 ;
wxFilePickerCtrl * m_Memcard1Path ;
wxFilePickerCtrl * m_Memcard2Path ;
wxListCtrl * m_MemcardList [ 2 ] ;
2008-09-07 20:26:38 +00:00
enum
{
2008-11-08 20:34:43 +00:00
ID_COPYTORIGHT = 1000 ,
ID_COPYTOLEFT ,
2008-11-23 06:41:27 +00:00
ID_FIXCHECKSUMRIGHT ,
ID_FIXCHECKSUMLEFT ,
2008-09-07 20:26:38 +00:00
ID_DELETERIGHT ,
ID_DELETELEFT ,
ID_MEMCARD1PATH ,
ID_MEMCARD2PATH ,
2008-11-23 06:41:27 +00:00
ID_MEMCARD1NEXTPAGE ,
ID_MEMCARD1PREVPAGE ,
ID_MEMCARD2NEXTPAGE ,
ID_MEMCARD2PREVPAGE ,
2008-10-18 05:33:52 +00:00
ID_SAVEEXPORTRIGHT ,
ID_SAVEEXPORTLEFT ,
ID_SAVEIMPORTRIGHT ,
ID_SAVEIMPORTLEFT ,
2008-10-14 03:16:09 +00:00
ID_CONVERTTOGCI ,
2008-09-07 20:26:38 +00:00
ID_MEMCARD1LIST ,
ID_MEMCARD2LIST ,
ID_DUMMY_VALUE_ //don't remove this value unless you have other enum values
} ;
enum
{
COLUMN_BANNER = 0 ,
COLUMN_TITLE ,
COLUMN_COMMENT ,
COLUMN_ICON ,
2008-11-23 06:41:27 +00:00
COLUMN_BLOCKS ,
COLUMN_FIRSTBLOCK ,
2008-09-07 20:26:38 +00:00
NUMBER_OF_COLUMN
} ;
GCMemcard * memoryCard [ 2 ] ;
void CreateGUIControls ( ) ;
void OnClose ( wxCloseEvent & event ) ;
void CopyDeleteClick ( wxCommandEvent & event ) ;
2008-11-23 06:41:27 +00:00
bool ReloadMemcard ( const char * fileName , int card , int page ) ;
void OnPageChange ( wxCommandEvent & event ) ;
2008-09-07 20:26:38 +00:00
void OnPathChange ( wxFileDirPickerEvent & event ) ;
2008-11-23 06:41:27 +00:00
bool ReadError ( GCMemcard * memcard ) ;
2008-09-07 20:26:38 +00:00
} ;
# endif