GUI: Added restart option to File menu

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4173 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
John Peterson
2009-09-02 21:54:53 +00:00
parent 97af2f1126
commit bbd56ec92c
7 changed files with 37 additions and 10 deletions

View File

@ -248,6 +248,7 @@ EVT_MENU(IDM_BROWSE, CFrame::OnBrowse)
EVT_MENU(IDM_MEMCARD, CFrame::OnMemcard)
EVT_MENU(IDM_CHEATS, CFrame::OnShow_CheatsWindow)
EVT_MENU(IDM_INFO, CFrame::OnShow_InfoWindow)
EVT_MENU(IDM_RESTART, CFrame::OnRestart)
EVT_MENU(IDM_CHANGEDISC, CFrame::OnChangeDisc)
EVT_MENU(IDM_LOAD_WII_MENU, CFrame::OnLoadWiiMenu)
EVT_MENU(IDM_TOGGLE_FULLSCREEN, CFrame::OnToggleFullscreen)
@ -496,7 +497,25 @@ void CFrame::OnQuit(wxCommandEvent& WXUNUSED (event))
Close(true);
}
void CFrame::OnRestart(wxCommandEvent& WXUNUSED (event))
{
if (Core::GetState() != Core::CORE_UNINITIALIZED)
{
wxMessageBox(wxT("Please stop the current game before restarting."), wxT("Notice"), wxOK, this);
return;
}
// Get exe name and restart
#ifdef _WIN32
char Str[MAX_PATH + 1];
DWORD Size = sizeof(Str)/sizeof(char);
DWORD n = GetModuleFileNameA(NULL, Str, Size);
ShellExecuteA(NULL, "open", PathToFilename(*new std::string(Str)).c_str(), UseDebugger ? "" : "-d", NULL, SW_SHOW);
#endif
Close(true);
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// Events
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
@ -794,10 +813,10 @@ void CFrame::Update()
}
}
#endif
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// Functions
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
wxPanel* CFrame::CreateEmptyPanel()
@ -827,4 +846,4 @@ void CFrame::DoFullscreen(bool _F)
m_Mgr->LoadPerspective(AuiCurrent, true);
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -283,6 +283,7 @@ class CFrame : public wxFrame
void OnShow_CheatsWindow(wxCommandEvent& event);
void OnShow_InfoWindow(wxCommandEvent& event);
void OnRestart(wxCommandEvent& event);
void OnLoadWiiMenu(wxCommandEvent& event);
void GameListChanged(wxCommandEvent& event);

View File

@ -119,7 +119,8 @@ void CFrame::CreateMenu()
fileMenu->Append(wxID_REFRESH, _T("&Refresh List"));
fileMenu->AppendSeparator();
fileMenu->Append(IDM_BROWSE, _T("&Browse for ISOs..."));
fileMenu->AppendSeparator();
fileMenu->Append(IDM_RESTART, UseDebugger ? _T("Restart in regular mode") : _T("Restart in debugging mode"));
fileMenu->AppendSeparator();
fileMenu->Append(wxID_EXIT, _T("E&xit\tAlt+F4"));
menuBar->Append(fileMenu, _T("&File"));

View File

@ -90,6 +90,7 @@ enum
IDM_CHEATS,
IDM_NETPLAY,
IDM_INFO,
IDM_RESTART,
IDM_CHANGEDISC,
IDM_PROPERTIES,
IDM_LOAD_WII_MENU,