Added installing of WADs via context menu

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3475 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
XTra.KrazzY 2009-06-17 06:37:34 +00:00
parent 232217c1cd
commit 2baca7ca3d
3 changed files with 28 additions and 1 deletions

View File

@ -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));

View File

@ -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();

View File

@ -100,6 +100,7 @@ enum
IDM_COMPRESSGCM,
IDM_MULTICOMPRESSGCM,
IDM_MULTIDECOMPRESSGCM,
IDM_INSTALLWAD,
IDM_UPDATELOGDISPLAY,
IDM_UPDATEDISASMDIALOG,
IDM_UPDATEGUI,