gsdump: disable run button when already running

This commit is contained in:
Gauvain 'GovanifY' Roussel-Tarbouriech 2021-03-08 12:21:37 +01:00 committed by Kojin
parent 6249831bb9
commit 1851595aff
2 changed files with 5 additions and 1 deletions

View File

@ -67,6 +67,7 @@ Dialogs::GSDumpDialog::GSDumpDialog(wxWindow* parent)
, m_selection(new wxButton(this, ID_RUN_START, _("Run to Selection"), wxDefaultPosition, wxSize(150, 50))) , m_selection(new wxButton(this, ID_RUN_START, _("Run to Selection"), wxDefaultPosition, wxSize(150, 50)))
, m_vsync(new wxButton(this, ID_RUN_START, _("Go to next VSync"), wxDefaultPosition, wxSize(150, 50))) , m_vsync(new wxButton(this, ID_RUN_START, _("Go to next VSync"), wxDefaultPosition, wxSize(150, 50)))
, m_thread(std::make_unique<GSThread>(this)) , m_thread(std::make_unique<GSThread>(this))
, m_run(new wxButton(this, ID_RUN_DUMP, _("Run"), wxDefaultPosition, wxSize(150, 100)))
{ {
wxBoxSizer& dump_info(*new wxBoxSizer(wxVERTICAL)); wxBoxSizer& dump_info(*new wxBoxSizer(wxVERTICAL));
wxBoxSizer& dump_preview(*new wxBoxSizer(wxVERTICAL)); wxBoxSizer& dump_preview(*new wxBoxSizer(wxVERTICAL));
@ -97,7 +98,7 @@ Dialogs::GSDumpDialog::GSDumpDialog(wxWindow* parent)
dumps_list += new wxStaticText(this, wxID_ANY, _("GS Dumps List")) | StdExpand(); dumps_list += new wxStaticText(this, wxID_ANY, _("GS Dumps List")) | StdExpand();
dumps_list += m_dump_list | StdExpand(); dumps_list += m_dump_list | StdExpand();
dump_info += m_renderer_overrides | StdExpand(); dump_info += m_renderer_overrides | StdExpand();
dump_info += new wxButton(this, ID_RUN_DUMP, _("Run"), wxDefaultPosition, wxSize(150,100)) | StdExpand(); dump_info += m_run | StdExpand();
dump_preview += new wxStaticText(this, wxID_ANY, _("Preview")) | StdExpand(); dump_preview += new wxStaticText(this, wxID_ANY, _("Preview")) | StdExpand();
dump_preview += m_preview_image | StdCenter(); dump_preview += m_preview_image | StdCenter();
@ -176,6 +177,7 @@ void Dialogs::GSDumpDialog::RunDump(wxCommandEvent& event)
m_step->Enable(); m_step->Enable();
m_selection->Enable(); m_selection->Enable();
m_vsync->Enable(); m_vsync->Enable();
m_run->Disable();
GetCorePlugins().Shutdown(); GetCorePlugins().Shutdown();
m_thread->m_dump_file = std::make_unique<pxInputStream>(m_selected_dump, new wxFFileInputStream(m_selected_dump)); m_thread->m_dump_file = std::make_unique<pxInputStream>(m_selected_dump, new wxFFileInputStream(m_selected_dump));
@ -626,6 +628,7 @@ void Dialogs::GSDumpDialog::GSThread::OnStop()
m_root_window->m_gif_list->Refresh(); m_root_window->m_gif_list->Refresh();
m_root_window->m_button_events.clear(); m_root_window->m_button_events.clear();
m_root_window->m_debug_mode->SetValue(false); m_root_window->m_debug_mode->SetValue(false);
m_root_window->m_run->Enable();
m_dump_file->Close(); m_dump_file->Close();
} }

View File

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