Merge pull request #4244 from leoetlino/stm-shutdown

Shut down Wii software gracefully
This commit is contained in:
shuffle2
2016-10-02 20:25:13 -07:00
committed by GitHub
12 changed files with 268 additions and 146 deletions

View File

@ -1148,9 +1148,12 @@ void CFrame::DoStop()
Core::SetState(Core::CORE_PAUSE);
}
wxMessageDialog m_StopDlg(this, _("Do you want to stop the current emulation?"),
_("Please confirm..."),
wxYES_NO | wxSTAY_ON_TOP | wxICON_EXCLAMATION, wxDefaultPosition);
wxMessageDialog m_StopDlg(
this, !m_tried_graceful_shutdown ? _("Do you want to stop the current emulation?") :
_("A shutdown is already in progress. Unsaved data "
"may be lost if you stop the current emulation "
"before it completes. Force stop?"),
_("Please confirm..."), wxYES_NO | wxSTAY_ON_TOP | wxICON_EXCLAMATION, wxDefaultPosition);
HotkeyManagerEmu::Enable(false);
int Ret = m_StopDlg.ShowModal();
@ -1165,6 +1168,16 @@ void CFrame::DoStop()
}
}
if (SConfig::GetInstance().bWii && !m_tried_graceful_shutdown)
{
Core::DisplayMessage("Shutting down", 30000);
Core::SetState(Core::CORE_RUN);
ProcessorInterface::PowerButton_Tap();
m_confirmStop = false;
m_tried_graceful_shutdown = true;
return;
}
if (UseDebugger && g_pCodeWindow)
{
if (g_pCodeWindow->m_WatchWindow)
@ -1200,6 +1213,7 @@ void CFrame::DoStop()
void CFrame::OnStopped()
{
m_confirmStop = false;
m_tried_graceful_shutdown = false;
#if defined(HAVE_X11) && HAVE_X11
if (SConfig::GetInstance().bDisableScreenSaver)