mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 09:09:52 -06:00
Added an option for opening up the wiki entry in the compatibility list. The option is in the right click menu of the games list. The game entries in the wiki are currently manually added by the administrator.
Based on an idea by JPeterson. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7250 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -124,6 +124,7 @@ BEGIN_EVENT_TABLE(CGameListCtrl, wxListCtrl)
|
||||
EVT_LIST_COL_BEGIN_DRAG(LIST_CTRL, CGameListCtrl::OnColBeginDrag)
|
||||
EVT_LIST_COL_CLICK(LIST_CTRL, CGameListCtrl::OnColumnClick)
|
||||
EVT_MENU(IDM_PROPERTIES, CGameListCtrl::OnProperties)
|
||||
EVT_MENU(IDM_GAMEWIKI, CGameListCtrl::OnWiki)
|
||||
EVT_MENU(IDM_OPENCONTAININGFOLDER, CGameListCtrl::OnOpenContainingFolder)
|
||||
EVT_MENU(IDM_OPENSAVEFOLDER, CGameListCtrl::OnOpenSaveFolder)
|
||||
EVT_MENU(IDM_EXPORTSAVE, CGameListCtrl::OnExportSave)
|
||||
@ -998,6 +999,7 @@ void CGameListCtrl::OnRightClick(wxMouseEvent& event)
|
||||
{
|
||||
wxMenu* popupMenu = new wxMenu;
|
||||
popupMenu->Append(IDM_PROPERTIES, _("&Properties"));
|
||||
popupMenu->Append(IDM_GAMEWIKI, _("&Wiki"));
|
||||
popupMenu->AppendSeparator();
|
||||
|
||||
if (selected_iso->GetPlatform() != GameListItem::GAMECUBE_DISC)
|
||||
@ -1166,6 +1168,22 @@ void CGameListCtrl::OnProperties(wxCommandEvent& WXUNUSED (event))
|
||||
Update();
|
||||
}
|
||||
|
||||
void CGameListCtrl::OnWiki(wxCommandEvent& WXUNUSED (event))
|
||||
{
|
||||
const GameListItem *iso = GetSelectedISO();
|
||||
if (!iso)
|
||||
return;
|
||||
|
||||
std::string wikiUrl = "http://api.dolphin-emulator.com/wiki.html?id=[GAME_ID]&name=[GAME_NAME]";
|
||||
wikiUrl = ReplaceAll(wikiUrl, "[GAME_ID]", UriEncode(iso->GetUniqueID()));
|
||||
if (UriEncode(iso->GetName(0)).length() < 100)
|
||||
wikiUrl = ReplaceAll(wikiUrl, "[GAME_NAME]", UriEncode(iso->GetName(0)));
|
||||
else
|
||||
wikiUrl = ReplaceAll(wikiUrl, "[GAME_NAME]", "");
|
||||
|
||||
WxUtils::Launch(wikiUrl.c_str());
|
||||
}
|
||||
|
||||
void CGameListCtrl::OnInstallWAD(wxCommandEvent& WXUNUSED (event))
|
||||
{
|
||||
const GameListItem *iso = GetSelectedISO();
|
||||
|
@ -98,6 +98,7 @@ private:
|
||||
void OnKeyPress(wxListEvent& event);
|
||||
void OnSize(wxSizeEvent& event);
|
||||
void OnProperties(wxCommandEvent& event);
|
||||
void OnWiki(wxCommandEvent& event);
|
||||
void OnOpenContainingFolder(wxCommandEvent& event);
|
||||
void OnOpenSaveFolder(wxCommandEvent& event);
|
||||
void OnExportSave(wxCommandEvent& event);
|
||||
|
@ -92,6 +92,7 @@ enum
|
||||
IDM_RESTART,
|
||||
IDM_CHANGEDISC,
|
||||
IDM_PROPERTIES,
|
||||
IDM_GAMEWIKI,
|
||||
IDM_LOAD_WII_MENU,
|
||||
IDM_INSTALL_WII_MENU,
|
||||
IDM_CONNECT_WIIMOTE1,
|
||||
|
Reference in New Issue
Block a user