Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #532 from zhuowei/master
Add Change Disc option to the right-click menu in the game list.
  • Loading branch information
lioncash committed Jun 30, 2014
2 parents fb18b8b + 25bd5e2 commit aec4cc7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Source/Core/DolphinWX/GameListCtrl.cpp
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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())
Expand Down
1 change: 1 addition & 0 deletions Source/Core/DolphinWX/GameListCtrl.h
Expand Up @@ -104,6 +104,7 @@ class CGameListCtrl : public wxListCtrl
void OnMultiCompressGCM(wxCommandEvent& event);
void OnMultiDecompressGCM(wxCommandEvent& event);
void OnInstallWAD(wxCommandEvent& event);
void OnChangeDisc(wxCommandEvent& event);

void CompressSelection(bool _compress);
void AutomaticColumnWidth();
Expand Down
1 change: 1 addition & 0 deletions Source/Core/DolphinWX/Globals.h
Expand Up @@ -90,6 +90,7 @@ enum
IDM_NETPLAY,
IDM_RESTART,
IDM_CHANGEDISC,
IDM_LIST_CHANGEDISC,
IDM_PROPERTIES,
IDM_GAMEWIKI,
IDM_LOAD_WII_MENU,
Expand Down

0 comments on commit aec4cc7

Please sign in to comment.