From 00d680f4bd77804a64a581b59b37dec27eb2ef58 Mon Sep 17 00:00:00 2001 From: Gauvain 'GovanifY' Roussel-Tarbouriech Date: Mon, 8 Mar 2021 16:52:59 +0100 Subject: [PATCH] gsdump: reset state when dump is invalid & ensure you can't run it if started --- pcsx2/gui/Dialogs/GSDumpDialog.cpp | 15 ++++++++------- pcsx2/gui/Dialogs/ModalPopups.h | 1 + 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/pcsx2/gui/Dialogs/GSDumpDialog.cpp b/pcsx2/gui/Dialogs/GSDumpDialog.cpp index e7d2e526b1..21325ef133 100644 --- a/pcsx2/gui/Dialogs/GSDumpDialog.cpp +++ b/pcsx2/gui/Dialogs/GSDumpDialog.cpp @@ -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(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; } diff --git a/pcsx2/gui/Dialogs/ModalPopups.h b/pcsx2/gui/Dialogs/ModalPopups.h index 029230f8c3..1c93f1d5f4 100644 --- a/pcsx2/gui/Dialogs/ModalPopups.h +++ b/pcsx2/gui/Dialogs/ModalPopups.h @@ -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();