diff --git a/src/wx/cmdevents.cpp b/src/wx/cmdevents.cpp index 69c1fd5a..bc124623 100644 --- a/src/wx/cmdevents.cpp +++ b/src/wx/cmdevents.cpp @@ -94,7 +94,6 @@ EVT_HANDLER(wxID_OPEN, "Open ROM...") "*.dmg;*.gb;*.gbc;*.cgb;*.sgb" "*.dmg.gz;*.gb.gz;*.gbc.gz;*.cgb.gz;*.sgb.gz" "*.dmg.z;*.gb.z;*.gbc.z;*.cgb.z;*.sgb.z" - "|" ); pats.append(wxALL_FILES); wxFileDialog dlg(this, _("Open ROM file"), open_dir, wxT(""), @@ -102,7 +101,7 @@ EVT_HANDLER(wxID_OPEN, "Open ROM...") wxFD_OPEN|wxFD_FILE_MUST_EXIST); dlg.SetFilterIndex(open_ft); if(ShowModal(&dlg) == wxID_OK) - wxGetApp().pending_load = dlg.GetPath(); + wxGetApp().pending_load = dlg.GetPath(); open_ft = dlg.GetFilterIndex(); open_dir = dlg.GetDirectory(); } @@ -636,6 +635,37 @@ EVT_HANDLER_MASK(RomInformation, "ROM information...", CMDEN_GB|CMDEN_GBA) } } +static wxString loaddotcodefile_path; +static wxString savedotcodefile_path; + +EVT_HANDLER_MASK(LoadDotCodeFile, "Load e-Reader Dot Code...", CMDEN_GBA) +{ + wxFileDialog dlg(this, _("Select Dot Code file"), loaddotcodefile_path, wxEmptyString, + _( + "e-Reader Dot Code (*.bin;*.raw)|" + "*.bin;*.raw" + ), wxFD_OPEN | wxFD_FILE_MUST_EXIST); + int ret = ShowModal(&dlg); + if (ret != wxID_OK) + return; + loaddotcodefile_path = dlg.GetPath(); + SetLoadDotCodeFile(loaddotcodefile_path.mb_str(wxConvUTF8)); +} + +EVT_HANDLER_MASK(SaveDotCodeFile, "Save e-Reader Dot Code...", CMDEN_GBA) +{ + wxFileDialog dlg(this, _("Select Dot Code file"), savedotcodefile_path, wxEmptyString, + _( + "e-Reader Dot Code (*.bin;*.raw)|" + "*.bin;*.raw" + ), wxFD_SAVE | wxFD_OVERWRITE_PROMPT); + int ret = ShowModal(&dlg); + if (ret != wxID_OK) + return; + savedotcodefile_path = dlg.GetPath(); + SetLoadDotCodeFile(savedotcodefile_path.mb_str(wxConvUTF8)); +} + static wxString batimp_path; EVT_HANDLER_MASK(ImportBatteryFile, "Import battery file...", CMDEN_GB|CMDEN_GBA) diff --git a/src/wx/wxvbam.xrc b/src/wx/wxvbam.xrc index 683aad4e..9a62c6bd 100644 --- a/src/wx/wxvbam.xrc +++ b/src/wx/wxvbam.xrc @@ -38,6 +38,16 @@ + + + + + + + + + + diff --git a/src/wx/xrc/MainMenu.xrc b/src/wx/xrc/MainMenu.xrc index 1ff5e638..d5649e93 100644 --- a/src/wx/xrc/MainMenu.xrc +++ b/src/wx/xrc/MainMenu.xrc @@ -18,6 +18,16 @@ + + + + + + + + + +