Switch to the Play / Record tab when fifo playback stops

This commit is contained in:
Pokechu22 2021-09-05 18:51:52 -07:00
parent d1cc539476
commit f4f4dbbc63
2 changed files with 12 additions and 6 deletions

View File

@ -150,18 +150,18 @@ void FIFOPlayerWindow::CreateWidgets()
layout->addWidget(recording_group); layout->addWidget(recording_group);
layout->addWidget(m_button_box); layout->addWidget(m_button_box);
QWidget* main_widget = new QWidget(this); m_main_widget = new QWidget(this);
main_widget->setLayout(layout); m_main_widget->setLayout(layout);
auto* tab_widget = new QTabWidget(this); m_tab_widget = new QTabWidget(this);
m_analyzer = new FIFOAnalyzer; m_analyzer = new FIFOAnalyzer;
tab_widget->addTab(main_widget, tr("Play / Record")); m_tab_widget->addTab(m_main_widget, tr("Play / Record"));
tab_widget->addTab(m_analyzer, tr("Analyze")); m_tab_widget->addTab(m_analyzer, tr("Analyze"));
auto* tab_layout = new QVBoxLayout; auto* tab_layout = new QVBoxLayout;
tab_layout->addWidget(tab_widget); tab_layout->addWidget(m_tab_widget);
setLayout(tab_layout); setLayout(tab_layout);
} }
@ -250,6 +250,8 @@ void FIFOPlayerWindow::OnEmulationStopped()
StopRecording(); StopRecording();
UpdateControls(); UpdateControls();
// When emulation stops, switch away from the analyzer tab, as it no longer shows anything useful
m_tab_widget->setCurrentWidget(m_main_widget);
m_analyzer->Update(); m_analyzer->Update();
} }

View File

@ -12,6 +12,7 @@ class QDialogButtonBox;
class QLabel; class QLabel;
class QPushButton; class QPushButton;
class QSpinBox; class QSpinBox;
class QTabWidget;
class FIFOAnalyzer; class FIFOAnalyzer;
class FIFOPlayerWindow : public QWidget class FIFOPlayerWindow : public QWidget
@ -64,6 +65,9 @@ private:
QCheckBox* m_early_memory_updates; QCheckBox* m_early_memory_updates;
QDialogButtonBox* m_button_box; QDialogButtonBox* m_button_box;
QWidget* m_main_widget;
QTabWidget* m_tab_widget;
FIFOAnalyzer* m_analyzer; FIFOAnalyzer* m_analyzer;
Core::State m_emu_state = Core::State::Uninitialized; Core::State m_emu_state = Core::State::Uninitialized;
}; };