diff --git a/src/wx/cmdevents.cpp b/src/wx/cmdevents.cpp index f617213d..416962a1 100644 --- a/src/wx/cmdevents.cpp +++ b/src/wx/cmdevents.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #ifndef NO_FFMPEG extern "C" { @@ -2381,6 +2382,21 @@ EVT_HANDLER(Customize, "Customize UI...") update_opts(); } +EVT_HANDLER(FactoryReset, "Factory Reset...") +{ + wxMessageDialog dlg(NULL, wxString(wxT( +"YOUR CONFIGURATION WILL BE DELETED!\n\n")) + wxString(wxT( +"Are you sure?")), + wxT("FACTORY RESET"), wxYES_NO | wxNO_DEFAULT | wxCENTRE); + + if (dlg.ShowModal() == wxID_YES) { + wxGetApp().cfg->DeleteAll(); + + wxExecute(wxStandardPaths::Get().GetExecutablePath(), wxEXEC_ASYNC); + Close(true); + } +} + EVT_HANDLER(BugReport, "Report bugs...") { wxLaunchDefaultBrowser(wxT("https://github.com/visualboyadvance-m/visualboyadvance-m/issues")); diff --git a/src/wx/xrc/MainMenu.xrc b/src/wx/xrc/MainMenu.xrc index 736e9c86..7d4f9444 100644 --- a/src/wx/xrc/MainMenu.xrc +++ b/src/wx/xrc/MainMenu.xrc @@ -466,6 +466,9 @@ + + +