mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-08 04:15:23 +03:00
DevTools/HackStudio: Fix 'enabled' property of 'build' and 'run' buttons
This commit is contained in:
parent
00075afb07
commit
b56282d4b2
Notes:
sideshowbarker
2024-07-19 17:04:43 +09:00
Author: https://github.com/ferhatgec Commit: https://github.com/SerenityOS/serenity/commit/b56282d4b29 Pull-request: https://github.com/SerenityOS/serenity/pull/14281 Reviewed-by: https://github.com/AtkinsSJ
@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user