From 2baca7ca3ddb974769caedfc948bac734af0e208 Mon Sep 17 00:00:00 2001 From: "XTra.KrazzY" Date: Wed, 17 Jun 2009 06:37:34 +0000 Subject: [PATCH] Added installing of WADs via context menu git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3475 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/DolphinWX/Src/GameListCtrl.cpp | 27 +++++++++++++++++++++- Source/Core/DolphinWX/Src/GameListCtrl.h | 1 + Source/Core/DolphinWX/Src/Globals.h | 1 + 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/Source/Core/DolphinWX/Src/GameListCtrl.cpp b/Source/Core/DolphinWX/Src/GameListCtrl.cpp index 5404d00462..2766a23c4b 100644 --- a/Source/Core/DolphinWX/Src/GameListCtrl.cpp +++ b/Source/Core/DolphinWX/Src/GameListCtrl.cpp @@ -96,6 +96,7 @@ EVT_MENU(IDM_COMPRESSGCM, CGameListCtrl::OnCompressGCM) EVT_MENU(IDM_MULTICOMPRESSGCM, CGameListCtrl::OnMultiCompressGCM) EVT_MENU(IDM_MULTIDECOMPRESSGCM, CGameListCtrl::OnMultiDecompressGCM) EVT_MENU(IDM_DELETEGCM, CGameListCtrl::OnDeleteGCM) +EVT_MENU(IDM_INSTALLWAD, CGameListCtrl::OnInstallWAD) END_EVENT_TABLE() CGameListCtrl::CGameListCtrl(wxWindow* parent, const wxWindowID id, const wxPoint& pos, const wxSize& size, long style) @@ -698,7 +699,8 @@ void CGameListCtrl::OnRightClick(wxMouseEvent& event) popupMenu.Append(IDM_COMPRESSGCM, _("Decompress ISO...")); else popupMenu.Append(IDM_COMPRESSGCM, _("Compress ISO...")); - } + } else + popupMenu.Append(IDM_INSTALLWAD, _("Install to Wii Menu")); PopupMenu(&popupMenu); } @@ -824,6 +826,29 @@ void CGameListCtrl::OnProperties(wxCommandEvent& WXUNUSED (event)) Update(); } +void CGameListCtrl::OnInstallWAD(wxCommandEvent& WXUNUSED (event)) +{ + const GameListItem *iso = GetSelectedISO(); + if (!iso) + return; + + wxProgressDialog dialog(_T("Installing WAD to Wii Menu..."), + _T("Working..."), + 1000, // range + this, // parent + wxPD_APP_MODAL | + // wxPD_AUTO_HIDE | -- try this as well + wxPD_ELAPSED_TIME | + wxPD_ESTIMATED_TIME | + wxPD_REMAINING_TIME | + wxPD_SMOOTH // - makes indeterminate mode bar on WinXP very small + ); + + dialog.CenterOnParent(); + + CBoot::Install_WiiWAD(iso->GetFileName().c_str()); +} + void CGameListCtrl::MultiCompressCB(const char* text, float percent, void* arg) { wxString textString(wxString::Format(wxT("%s (%i/%i) - %s"), m_currentFilename.c_str(), (int)m_currentItem+1, (int)m_numberItem, text)); diff --git a/Source/Core/DolphinWX/Src/GameListCtrl.h b/Source/Core/DolphinWX/Src/GameListCtrl.h index db2bc98d77..27af247e55 100644 --- a/Source/Core/DolphinWX/Src/GameListCtrl.h +++ b/Source/Core/DolphinWX/Src/GameListCtrl.h @@ -87,6 +87,7 @@ private: void OnCompressGCM(wxCommandEvent& event); void OnMultiCompressGCM(wxCommandEvent& event); void OnMultiDecompressGCM(wxCommandEvent& event); + void OnInstallWAD(wxCommandEvent& event); void CompressSelection(bool _compress); void AutomaticColumnWidth(); diff --git a/Source/Core/DolphinWX/Src/Globals.h b/Source/Core/DolphinWX/Src/Globals.h index 230baba3df..386256294b 100644 --- a/Source/Core/DolphinWX/Src/Globals.h +++ b/Source/Core/DolphinWX/Src/Globals.h @@ -100,6 +100,7 @@ enum IDM_COMPRESSGCM, IDM_MULTICOMPRESSGCM, IDM_MULTIDECOMPRESSGCM, + IDM_INSTALLWAD, IDM_UPDATELOGDISPLAY, IDM_UPDATEDISASMDIALOG, IDM_UPDATEGUI,