More SDIO WIP Code: Added ground work for SDCard Mounter wxDialog

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2067 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
omegadox 2009-02-01 20:20:58 +00:00
parent 2620257f47
commit ca741b2526
11 changed files with 151 additions and 67 deletions

View File

@ -19,12 +19,25 @@
#include "SDInterface.h"
namespace SDInterface {
namespace SDInterface
{
bool g_bIsCardInserted = false;
bool g_bIsDumpFile = false;
std::string sourcePath = "";
bool IsCardInserted()
{
return g_bIsCardInserted;
}
void SetSourceType(bool isDumpFile)
{
g_bIsDumpFile = isDumpFile;
}
void SetSourcePath(const std::string path)
{
sourcePath = path;
}
}

View File

@ -19,10 +19,13 @@
#define _SDINTERFACE_H
#include "Common.h"
#include <string>
namespace SDInterface
{
bool IsCardInserted();
void SetSourceType(bool isDumpFile);
void SetSourcePath(const std::string path);
}
#endif

View File

@ -896,6 +896,14 @@
RelativePath=".\Src\PatchAddEdit.h"
>
</File>
<File
RelativePath=".\Src\SDCardWindow.cpp"
>
</File>
<File
RelativePath=".\Src\SDCardWindow.h"
>
</File>
</Filter>
<Filter
Name="Misc"

View File

@ -40,7 +40,7 @@ wxCheatsWindow::wxCheatsWindow(wxFrame* parent, const wxPoint& pos, const wxSize
Init_ChildControls();
// Setup Window
SetBackgroundColour(m_Notebook_Main->GetBackgroundColour());
SetBackgroundColour(wxColour(COLOR_GRAY));
SetSize(size);
SetPosition(pos);

View File

@ -231,6 +231,7 @@ EVT_MENU(IDM_BROWSE, CFrame::OnBrowse)
EVT_MENU(IDM_MEMCARD, CFrame::OnMemcard)
EVT_MENU(IDM_CHEATS, CFrame::OnShow_CheatsWindow)
EVT_MENU(IDM_CHANGEDISC, CFrame::OnChangeDisc)
EVT_MENU(IDM_SDCARD, CFrame::OnShow_SDCardWindow)
EVT_MENU(IDM_TOGGLE_FULLSCREEN, CFrame::OnToggleFullscreen)
EVT_MENU(IDM_TOGGLE_DUALCORE, CFrame::OnToggleDualCore)
EVT_MENU(IDM_TOGGLE_SKIPIDLE, CFrame::OnToggleSkipIdle)

View File

@ -201,6 +201,7 @@ class CFrame : public wxFrame
void OnMemcard(wxCommandEvent& event); // Misc
void OnShow_CheatsWindow(wxCommandEvent& event);
void OnShow_SDCardWindow(wxCommandEvent& event);
void OnGameListCtrl_ItemActivated(wxListEvent& event);

View File

@ -43,6 +43,7 @@ be accessed from Core::GetWindowHandle().
#include "AboutDolphin.h"
#include "GameListCtrl.h"
#include "BootManager.h"
#include "SDCardWindow.h"
#include "Common.h" // Common
#include "FileUtil.h"
@ -81,23 +82,13 @@ extern "C" {
#include "../resources/KDE.h"
};
// ----------------------------------------------------------------------------
// Constants
// ----------------------------------------------------------------------------
static const long TOOLBAR_STYLE = wxTB_FLAT | wxTB_DOCKABLE | wxTB_TEXT;
// ----------------------------------------------------------------------------
// Other Windows
// ----------------------------------------------------------------------------
wxCheatsWindow* CheatsWindow;
// =======================================================
// Create menu items
// -------------
void CFrame::CreateMenu()
{
delete m_pMenuBar;
@ -152,6 +143,7 @@ void CFrame::CreateMenu()
miscMenu->AppendSeparator();
miscMenu->Append(IDM_MEMCARD, _T("&Memcard manager"));
miscMenu->Append(IDM_CHEATS, _T("Action &Replay Manager"));
// miscMenu->Append(IDM_SDCARD, _T("Mount &SDCard")); // Disable for now
m_pMenuBar->Append(miscMenu, _T("&Misc"));
// Help menu
@ -169,9 +161,7 @@ void CFrame::CreateMenu()
}
// =======================================================
// Create toolbar items
// -------------
void CFrame::PopulateToolbar(wxToolBar* toolBar)
{
int w = m_Bitmaps[Toolbar_FileOpen].GetWidth(),
@ -215,9 +205,7 @@ void CFrame::PopulateToolbar(wxToolBar* toolBar)
}
//////////////////////////////////////////////////
// Delete and recreate the toolbar
// ¯¯¯¯¯¯¯¯¯¯
void CFrame::RecreateToolbar()
{
@ -234,9 +222,6 @@ void CFrame::RecreateToolbar()
SetToolBar(TheToolBar);
UpdateGUI();
}
///////////////////////////////
void CFrame::InitBitmaps()
{
// Get selected theme
@ -386,9 +371,7 @@ void CFrame::BootGame()
}
}
// =======================================================
// Open file to boot or for changing disc
// -------------
void CFrame::OnOpen(wxCommandEvent& WXUNUSED (event))
{
// Don't allow this for an initialized core
@ -462,7 +445,7 @@ void CFrame::OnChangeDisc(wxCommandEvent& WXUNUSED (event))
DoOpen(false);
DVDInterface::SetLidOpen(false);
}
// =============
void CFrame::OnRefresh(wxCommandEvent& WXUNUSED (event))
@ -479,16 +462,10 @@ void CFrame::OnBrowse(wxCommandEvent& WXUNUSED (event))
m_GameListCtrl->BrowseForDirectory();
}
// =======================================================
// Play button
// -------------
void CFrame::OnPlay(wxCommandEvent& WXUNUSED (event))
{
BootGame();
}
// =============
void CFrame::DoStop()
{
@ -594,13 +571,8 @@ void CFrame::OnHelp(wxCommandEvent& event)
break;
}
}
// ========= // Toolbar
// =======================================================
// Miscellaneous menu
// -------------
void CFrame::OnMemcard(wxCommandEvent& WXUNUSED (event))
{
CMemcardManager MemcardManager(this);
@ -611,14 +583,13 @@ void CFrame::OnShow_CheatsWindow(wxCommandEvent& WXUNUSED (event))
{
CheatsWindow = new wxCheatsWindow(this, wxDefaultPosition, wxSize(600, 390));
}
// =============
// =======================================================
void CFrame::OnShow_SDCardWindow(wxCommandEvent& WXUNUSED (event))
{
wxSDCardWindow SDWindow(this);
SDWindow.ShowModal();
}
/* Toogle fullscreen. In Windows the fullscreen mode is accomplished by expanding the m_Panel to cover
the entire screen (when we render to the main window). */
// -------------
void CFrame::OnToggleFullscreen(wxCommandEvent& WXUNUSED (event))
{
ShowFullScreen(true);
@ -658,9 +629,7 @@ void CFrame::OnSaveState(wxCommandEvent& event)
}
// =======================================================
// Let us enable and disable the toolbar
// -------------
void CFrame::OnToggleToolbar(wxCommandEvent& event)
{
wxToolBarBase* toolBar = GetToolBar();
@ -677,12 +646,8 @@ void CFrame::OnToggleToolbar(wxCommandEvent& event)
this->SendSizeEvent();
}
// ===================
// =======================================================
// Let us enable and disable the status bar
// -------------
void CFrame::OnToggleStatusbar(wxCommandEvent& event)
{
if (event.IsChecked())
@ -692,12 +657,9 @@ void CFrame::OnToggleStatusbar(wxCommandEvent& event)
this->SendSizeEvent();
}
// ===================
// =======================================================
// Update the enabled/disabled status
// -------------
void CFrame::UpdateGUI()
{
#ifdef MUSICMOD

View File

@ -16,27 +16,16 @@
// http://code.google.com/p/dolphin-emu/
////////////////////////////////////////////////////////////////////////////////////////
// File description
/* ¯¯¯¯¯¯¯¯¯
This file is global in the DolphinWX and DebuggerWX projects.
////////////////////////*/
////////////////////////////////////////////////////////////////////////////////////////
// Settings
// ¯¯¯¯¯¯¯¯¯
// Build with music modification. Define MUSICMOD here.
#include "../../../Branches/MusicMod/Main/Src/Setup.h"
//////////////////////////
// This holds global data for DolphinWx and DebuggerWx
#ifndef _GLOBALS_H
#define _GLOBALS_H
#include "Common.h"
#include "../../../Branches/MusicMod/Main/Src/Setup.h" // Build with music modification. Define MUSICMOD here.
// Constant Colors
const unsigned long COLOR_GRAY = 0xDCDCDC;
enum
{
@ -70,6 +59,7 @@ enum
IDM_CHEATS,
IDM_CHANGEDISC,
IDM_PROPERTIES,
IDM_SDCARD,
IDM_HELPABOUT, // Help menu
IDM_HELPWEBSITE,
@ -146,10 +136,7 @@ enum
#error You need to enable XPM support to use XPM bitmaps with toolbar!
#endif // USE_XPM_BITMAPS
//
// custom message macro
//
#define EVT_HOST_COMMAND(id, fn) \
DECLARE_EVENT_TABLE_ENTRY(\
wxEVT_HOST_COMMAND, id, wxID_ANY, \

View File

@ -34,6 +34,7 @@ if wxenv['HAVE_WX']:
'CheatsWindow.cpp',
'stdafx.cpp',
'FrameWiimote.cpp',
'SDCardWindow.cpp',
]
CPPDEFINES = [

View File

@ -0,0 +1,63 @@
// 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/
#include "SDCardWindow.h"
#include "Globals.h"
#include "IPC_HLE/HW/SDInterface.h"
BEGIN_EVENT_TABLE(wxSDCardWindow, wxWindow)
EVT_CLOSE( wxSDCardWindow::OnEvent_Window_Close)
EVT_BUTTON(ID_BUTTON_CLOSE, wxSDCardWindow::OnEvent_ButtonClose_Press)
END_EVENT_TABLE()
wxSDCardWindow::wxSDCardWindow(wxWindow* parent) :
wxDialog(parent, wxID_ANY, _T("SDCard Mounter"), wxDefaultPosition, wxSize(400, 400), wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE)
{
Init_ChildControls();
Layout();
Show();
}
wxSDCardWindow::~wxSDCardWindow()
{
// On Disposal
}
void wxSDCardWindow::Init_ChildControls()
{
// Button Strip
m_Button_Close = new wxButton(this, ID_BUTTON_CLOSE, _T("Close"), wxDefaultPosition, wxDefaultSize);
wxBoxSizer* sButtons = new wxBoxSizer(wxHORIZONTAL);
sButtons->Add(m_Button_Close, 0, wxALL, 5);
wxBoxSizer* sMain = new wxBoxSizer(wxVERTICAL);
sMain->Add(sButtons, 0, wxALL, 5);
SetSizer(sMain);
Layout();
Fit();
}
void wxSDCardWindow::OnEvent_Window_Close(wxCloseEvent& WXUNUSED(event))
{
EndModal(0);
}
void wxSDCardWindow::OnEvent_ButtonClose_Press(wxCommandEvent& WXUNUSED(event))
{
EndModal(0);
}

View File

@ -0,0 +1,45 @@
// 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/
#ifndef __SDCARD_WINDOW_h__
#define __SDCARD_WINDOW_h__
#include <wx/wx.h>
class wxSDCardWindow : public wxDialog
{
public:
wxSDCardWindow(wxWindow* parent);
virtual ~wxSDCardWindow();
protected:
DECLARE_EVENT_TABLE();
wxButton *m_Button_Close;
enum
{
ID_BUTTON_CLOSE,
};
void Init_ChildControls();
void OnEvent_Window_Close(wxCloseEvent& event);
void OnEvent_ButtonClose_Press(wxCommandEvent& event);
};
#endif