1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:18:11 +00:00

HackStudio: Disable debug specific context entries

Context menu entries like evaluate expression and
move execution to line action should only be enabled
when a debug session is running. Otherwise they should
be disabled.
This commit is contained in:
Maurice Hieronymus 2021-07-11 17:38:38 +02:00 committed by Gunnar Beutner
parent 488d0722bd
commit dfc33cd412
5 changed files with 28 additions and 8 deletions

View file

@ -639,6 +639,10 @@ NonnullRefPtr<GUI::Action> HackStudioWidget::create_debug_action()
m_debugger_thread->start();
m_stop_action->set_enabled(true);
m_run_action->set_enabled(false);
for (auto& editor_wrapper : m_all_editor_wrappers) {
editor_wrapper.set_debug_mode(true);
}
});
}
@ -690,6 +694,11 @@ void HackStudioWidget::initialize_debugger()
m_stop_action->set_enabled(false);
m_run_action->set_enabled(true);
m_debugger_thread.clear();
for (auto& editor_wrapper : m_all_editor_wrappers) {
editor_wrapper.set_debug_mode(false);
}
HackStudioWidget::hide_action_tabs();
GUI::MessageBox::show(window(), "Program Exited", "Debugger", GUI::MessageBox::Type::Information);
}));