diff options
author | ferhatgec <ferhat2gecdogan_fix_me5@protonmail.com> | 2022-06-20 19:14:00 +0300 |
---|---|---|
committer | Sam Atkins <atkinssj@gmail.com> | 2022-07-12 11:56:23 +0100 |
commit | b56282d4b297499b2a73604587dcecf380830496 (patch) | |
tree | 04276463fea9f855cc2327878514726d8c4f145c | |
parent | 00075afb0792b9217fe64df2a86ba2f6f7749a14 (diff) | |
download | serenity-b56282d4b297499b2a73604587dcecf380830496.zip |
DevTools/HackStudio: Fix 'enabled' property of 'build' and 'run' buttons
-rw-r--r-- | Userland/DevTools/HackStudio/HackStudioWidget.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Userland/DevTools/HackStudio/HackStudioWidget.cpp b/Userland/DevTools/HackStudio/HackStudioWidget.cpp index 80f14a890c..44f4987202 100644 --- a/Userland/DevTools/HackStudio/HackStudioWidget.cpp +++ b/Userland/DevTools/HackStudio/HackStudioWidget.cpp @@ -1128,6 +1128,10 @@ void HackStudioWidget::build() auto result = m_project_builder->build(active_file()); if (result.is_error()) { GUI::MessageBox::show(window(), String::formatted("{}", result.error()), "Build failed", GUI::MessageBox::Type::Error); + m_build_action->set_enabled(true); + m_stop_action->set_enabled(false); + } else { + m_stop_action->set_enabled(true); } } @@ -1136,6 +1140,10 @@ void HackStudioWidget::run() auto result = m_project_builder->run(active_file()); if (result.is_error()) { GUI::MessageBox::show(window(), String::formatted("{}", result.error()), "Run failed", GUI::MessageBox::Type::Error); + m_run_action->set_enabled(true); + m_stop_action->set_enabled(false); + } else { + m_stop_action->set_enabled(true); } } @@ -1277,7 +1285,6 @@ NonnullRefPtr<GUI::Action> HackStudioWidget::create_build_action() reveal_action_tab(*m_terminal_wrapper); build(); - m_stop_action->set_enabled(true); }); } @@ -1286,7 +1293,6 @@ NonnullRefPtr<GUI::Action> HackStudioWidget::create_run_action() return GUI::Action::create("&Run", { Mod_Ctrl, Key_R }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/program-run.png").release_value_but_fixme_should_propagate_errors(), [this](auto&) { reveal_action_tab(*m_terminal_wrapper); run(); - m_stop_action->set_enabled(true); }); } |