WX: Add menu item to perform system update from disc

This commit is contained in:
Léo Lam 2017-07-04 18:23:25 +02:00
parent 0fdae2adb8
commit 0e71c0760e
5 changed files with 23 additions and 0 deletions

View File

@ -245,6 +245,7 @@ BEGIN_EVENT_TABLE(CFrame, CRenderFrame)
EVT_MENU_RANGE(IDM_FLOAT_LOG_WINDOW, IDM_FLOAT_CODE_WINDOW, CFrame::OnFloatWindow)
// Game list context menu
EVT_MENU(IDM_LIST_PERFORM_DISC_UPDATE, CFrame::OnPerformDiscWiiUpdate)
EVT_MENU(IDM_LIST_INSTALL_WAD, CFrame::OnInstallWAD)
EVT_MENU(IDM_LIST_UNINSTALL_WAD, CFrame::OnUninstallWAD)

View File

@ -347,6 +347,7 @@ private:
void OnImportBootMiiBackup(wxCommandEvent& event);
void OnExtractCertificates(wxCommandEvent& event);
void OnPerformOnlineWiiUpdate(wxCommandEvent& event);
void OnPerformDiscWiiUpdate(wxCommandEvent& event);
void OnFifoPlayer(wxCommandEvent& event);
void OnConnectWiimote(wxCommandEvent& event);
void GameListChanged(wxCommandEvent& event);

View File

@ -1411,6 +1411,19 @@ void CFrame::OnPerformOnlineWiiUpdate(wxCommandEvent& event)
UpdateLoadWiiMenuItem();
}
void CFrame::OnPerformDiscWiiUpdate(wxCommandEvent&)
{
const GameListItem* iso = m_game_list_ctrl->GetSelectedISO();
if (!iso)
return;
const std::string file_name = iso->GetFileName();
const WiiUtils::UpdateResult result = ShowUpdateProgress(this, WiiUtils::DoDiscUpdate, file_name);
ShowUpdateResult(result);
UpdateLoadWiiMenuItem();
}
void CFrame::UpdateLoadWiiMenuItem() const
{
GetMenuBar()->Refresh(true, nullptr);

View File

@ -1173,6 +1173,13 @@ void GameListCtrl::OnRightClick(wxMouseEvent& event)
changeDiscItem->Enable(Core::IsRunning());
}
if (platform == DiscIO::Platform::WII_DISC)
{
auto* const perform_update_item =
popupMenu.Append(IDM_LIST_PERFORM_DISC_UPDATE, _("Perform System Update"));
perform_update_item->Enable(!Core::IsRunning() || !SConfig::GetInstance().bWii);
}
if (platform == DiscIO::Platform::WII_WAD)
{
auto* const install_wad_item =

View File

@ -100,6 +100,7 @@ enum
IDM_GAME_WIKI,
IDM_LOAD_WII_MENU,
IDM_MENU_INSTALL_WAD,
IDM_LIST_PERFORM_DISC_UPDATE,
IDM_LIST_INSTALL_WAD,
IDM_LIST_UNINSTALL_WAD,
IDM_IMPORT_NAND,