Merge pull request #532 from zhuowei/master

Add Change Disc option to the right-click menu in the game list.
This commit is contained in:
Lioncash 2014-06-30 15:09:28 -04:00
commit aec4cc7e29
3 changed files with 18 additions and 0 deletions

View File

@ -52,6 +52,7 @@
#include "Core/CoreParameter.h"
#include "Core/Movie.h"
#include "Core/Boot/Boot.h"
#include "Core/HW/DVDInterface.h"
#include "DiscIO/Blob.h"
#include "DiscIO/Volume.h"
#include "DiscIO/VolumeCreator.h"
@ -209,6 +210,7 @@ BEGIN_EVENT_TABLE(CGameListCtrl, wxListCtrl)
EVT_MENU(IDM_MULTICOMPRESSGCM, CGameListCtrl::OnMultiCompressGCM)
EVT_MENU(IDM_MULTIDECOMPRESSGCM, CGameListCtrl::OnMultiDecompressGCM)
EVT_MENU(IDM_DELETEGCM, CGameListCtrl::OnDeleteGCM)
EVT_MENU(IDM_LIST_CHANGEDISC, CGameListCtrl::OnChangeDisc)
END_EVENT_TABLE()
CGameListCtrl::CGameListCtrl(wxWindow* parent, const wxWindowID id, const
@ -903,6 +905,12 @@ void CGameListCtrl::OnRightClick(wxMouseEvent& event)
{
popupMenu->Append(IDM_LIST_INSTALLWAD, _("Install to Wii Menu"));
}
if (selected_iso->GetPlatform() == GameListItem::GAMECUBE_DISC ||
selected_iso->GetPlatform() == GameListItem::WII_DISC)
{
wxMenuItem* changeDiscItem = popupMenu->Append(IDM_LIST_CHANGEDISC, _("Change &Disc"));
changeDiscItem->Enable(Core::IsRunning());
}
PopupMenu(popupMenu);
}
@ -1263,6 +1271,14 @@ void CGameListCtrl::OnCompressGCM(wxCommandEvent& WXUNUSED (event))
Update();
}
void CGameListCtrl::OnChangeDisc(wxCommandEvent& WXUNUSED(event))
{
const GameListItem *iso = GetSelectedISO();
if (!iso || !Core::IsRunning())
return;
DVDInterface::ChangeDisc(WxStrToStr(iso->GetFileName()));
}
void CGameListCtrl::OnSize(wxSizeEvent& event)
{
if (lastpos == event.GetSize())

View File

@ -104,6 +104,7 @@ private:
void OnMultiCompressGCM(wxCommandEvent& event);
void OnMultiDecompressGCM(wxCommandEvent& event);
void OnInstallWAD(wxCommandEvent& event);
void OnChangeDisc(wxCommandEvent& event);
void CompressSelection(bool _compress);
void AutomaticColumnWidth();

View File

@ -90,6 +90,7 @@ enum
IDM_NETPLAY,
IDM_RESTART,
IDM_CHANGEDISC,
IDM_LIST_CHANGEDISC,
IDM_PROPERTIES,
IDM_GAMEWIKI,
IDM_LOAD_WII_MENU,