diff options
| author | mitaclaw <140017135+mitaclaw@users.noreply.github.com> | 2024-03-05 14:02:45 -0800 |
|---|---|---|
| committer | mitaclaw <140017135+mitaclaw@users.noreply.github.com> | 2024-03-07 15:59:03 -0800 |
| commit | 0645b4d5792111cc992b85cda6694c95ab43408f (patch) | |
| tree | e1e7755f2fa5f6a3b5e863fa13190a5fb81b96c3 /Source/Core/DolphinQt/Debugger/CodeWidget.cpp | |
| parent | 8f6fd912f7ef3d744661cfdd0c9c33d44c223310 (diff) | |
BranchWatchDialog: Fix Misc. Errata
Window icon was missing from QDialog lacking a parent.
Giving the QDialog a parent revealed I had failed to make it properly non-modal, necessitating further changes.
Settings save less often, now only upon destruction.
Construction of BranchWatchDialog is now deferred.
Diffstat (limited to 'Source/Core/DolphinQt/Debugger/CodeWidget.cpp')
| -rw-r--r-- | Source/Core/DolphinQt/Debugger/CodeWidget.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/Source/Core/DolphinQt/Debugger/CodeWidget.cpp b/Source/Core/DolphinQt/Debugger/CodeWidget.cpp index 94662bba71..382ec03861 100644 --- a/Source/Core/DolphinQt/Debugger/CodeWidget.cpp +++ b/Source/Core/DolphinQt/Debugger/CodeWidget.cpp @@ -36,10 +36,7 @@ static const QString BOX_SPLITTER_STYLESHEET = QStringLiteral( "QSplitter::handle { border-top: 1px dashed black; width: 1px; margin-left: 10px; " "margin-right: 10px; }"); -CodeWidget::CodeWidget(QWidget* parent) - : QDockWidget(parent), m_system(Core::System::GetInstance()), - m_branch_watch_dialog( - new BranchWatchDialog(m_system, m_system.GetPowerPC().GetBranchWatch(), this)) +CodeWidget::CodeWidget(QWidget* parent) : QDockWidget(parent), m_system(Core::System::GetInstance()) { setWindowTitle(tr("Code")); setObjectName(QStringLiteral("code")); @@ -215,7 +212,12 @@ void CodeWidget::ConnectWidgets() void CodeWidget::OnBranchWatchDialog() { - m_branch_watch_dialog->open(); + if (m_branch_watch_dialog == nullptr) + { + m_branch_watch_dialog = + new BranchWatchDialog(m_system, m_system.GetPowerPC().GetBranchWatch(), this, this); + } + m_branch_watch_dialog->show(); m_branch_watch_dialog->raise(); m_branch_watch_dialog->activateWindow(); } @@ -397,7 +399,8 @@ void CodeWidget::UpdateSymbols() // TODO: There seems to be a lack of a ubiquitous signal for when symbols change. // This is the best location to catch the signals from MenuBar and CodeViewWidget. - m_branch_watch_dialog->UpdateSymbols(); + if (m_branch_watch_dialog != nullptr) + m_branch_watch_dialog->UpdateSymbols(); } void CodeWidget::UpdateFunctionCalls(const Common::Symbol* symbol) @@ -470,7 +473,8 @@ void CodeWidget::Step() // Will get a UpdateDisasmDialog(), don't update the GUI here. // TODO: Step doesn't cause EmulationStateChanged to be emitted, so it has to call this manually. - m_branch_watch_dialog->Update(); + if (m_branch_watch_dialog != nullptr) + m_branch_watch_dialog->Update(); } void CodeWidget::StepOver() |
