summaryrefslogtreecommitdiff
path: root/DevTools/HackStudio
diff options
context:
space:
mode:
authorSergey Bugaev <bugaevc@gmail.com>2019-11-14 19:26:25 +0300
committerAndreas Kling <awesomekling@gmail.com>2019-11-14 20:10:16 +0100
commitc6a8b956432370500df4c19cdccd13806bc18d79 (patch)
treeffbf5ef6edc1ebb4fb1c828ec399a45dfe035abb /DevTools/HackStudio
parent1f5001c581a6b4d13f2d930f228f75b9bafedb50 (diff)
downloadserenity-c6a8b956432370500df4c19cdccd13806bc18d79.zip
HackStudio: Add a Stop action to kill the current process
Also give the Run action a different icon that has the same style as the stop icon that's now alongside it. Closes https://github.com/SerenityOS/serenity/issues/771
Diffstat (limited to 'DevTools/HackStudio')
-rw-r--r--DevTools/HackStudio/main.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/DevTools/HackStudio/main.cpp b/DevTools/HackStudio/main.cpp
index c18a7abcb1..61be7ba8f4 100644
--- a/DevTools/HackStudio/main.cpp
+++ b/DevTools/HackStudio/main.cpp
@@ -367,21 +367,34 @@ int main(int argc, char** argv)
}));
menubar->add_menu(move(edit_menu));
+ auto stop_action = GAction::create("Stop", GraphicsBitmap::load_from_file("/res/icons/16x16/stop.png"), [&](auto&) {
+ terminal_wrapper->kill_running_command();
+ });
+
+ stop_action->set_enabled(false);
+ terminal_wrapper->on_command_exit = [&] {
+ stop_action->set_enabled(false);
+ };
+
auto build_action = GAction::create("Build", { Mod_Ctrl, Key_B }, GraphicsBitmap::load_from_file("/res/icons/16x16/build.png"), [&](auto&) {
reveal_action_tab(terminal_wrapper);
build(terminal_wrapper);
+ stop_action->set_enabled(true);
});
toolbar->add_action(build_action);
- auto run_action = GAction::create("Run", { Mod_Ctrl, Key_R }, GraphicsBitmap::load_from_file("/res/icons/16x16/run.png"), [&](auto&) {
+ auto run_action = GAction::create("Run", { Mod_Ctrl, Key_R }, GraphicsBitmap::load_from_file("/res/icons/16x16/play.png"), [&](auto&) {
reveal_action_tab(terminal_wrapper);
run(terminal_wrapper);
+ stop_action->set_enabled(true);
});
toolbar->add_action(run_action);
+ toolbar->add_action(stop_action);
auto build_menu = make<GMenu>("Build");
build_menu->add_action(build_action);
build_menu->add_action(run_action);
+ build_menu->add_action(stop_action);
menubar->add_menu(move(build_menu));
auto view_menu = make<GMenu>("View");