Unverified Commit d7cf15e0 authored by Rafael Kitover's avatar Rafael Kitover
Browse files

implement factory reset option #368



Add a "Factory Reset" item to the Options menu, which calls
`DeleteAll()` on the config object, which actually deletes the config
file. After this the application is relaunched asynchronously without
parameters and the current instance is closed.
Signed-off-by: default avatarRafael Kitover <rkitover@gmail.com>
parent 12fa61af
......@@ -13,6 +13,7 @@
#include <wx/sstream.h>
#include <wx/url.h>
#include <wx/wfstream.h>
#include <wx/msgdlg.h>
#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"));
......
......@@ -466,6 +466,9 @@
<object class="wxMenuItem" name="Customize">
<label>_Key Shortcuts ...</label>
</object>
<object class="wxMenuItem" name="FactoryReset">
<label>_Factory Reset...</label>
</object>
</object>
<object class="wxMenu">
<label>_Tools</label>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment