gsdump: reset state when dump is invalid & ensure you can't run it if started

This commit is contained in:
Gauvain 'GovanifY' Roussel-Tarbouriech 2021-03-08 16:52:59 +01:00 committed by Kojin
parent d6a671d4ae
commit 00d680f4bd
2 changed files with 9 additions and 7 deletions

View File

@ -174,13 +174,8 @@ void Dialogs::GSDumpDialog::SelectedDump(wxListEvent& evt)
void Dialogs::GSDumpDialog::RunDump(wxCommandEvent& event)
{
m_debug_mode->Enable();
m_start->Enable();
m_step->Enable();
m_selection->Enable();
m_vsync->Enable();
m_run->Disable();
if (!m_run->IsEnabled())
return;
m_thread->m_dump_file = std::make_unique<pxInputStream>(m_selected_dump, new wxFFileInputStream(m_selected_dump));
if (!(m_thread->m_dump_file)->IsOk())
@ -190,6 +185,12 @@ void Dialogs::GSDumpDialog::RunDump(wxCommandEvent& event)
wxMessageBox(s, _("GSDumpGov"), wxICON_ERROR);
return;
}
m_run->Disable();
m_debug_mode->Enable();
m_start->Enable();
m_step->Enable();
m_selection->Enable();
m_vsync->Enable();
m_thread->Start();
return;
}

View File

@ -162,6 +162,7 @@ namespace Dialogs
wxButton* m_selection;
wxButton* m_vsync;
wxButton* m_run;
long m_focused_dump;
wxFileSystemWatcher m_fs_watcher;
void GetDumpsList();