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

This commit is contained in:
Gauvain 'GovanifY' Roussel-Tarbouriech authored and Kojin committed 2021-03-22 23:37:24 -04:00
1 parent d6a671d4ae
commit 00d680f4bd
2 files changed
+9 -7

No files matched your search

+8 -7
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;
}
+1
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();