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

HackStudio: Add a simple "Run" action

Ctrl+R will now execute "make run" in the project directory. :^)
This commit is contained in:
Andreas Kling 2019-10-22 22:18:46 +02:00
parent 654ffdef91
commit 708543c3d6
2 changed files with 12 additions and 0 deletions

View file

@ -22,6 +22,7 @@
String g_currently_open_file;
static void build(TerminalWrapper&);
static void run(TerminalWrapper&);
int main(int argc, char** argv)
{
@ -103,6 +104,9 @@ int main(int argc, char** argv)
build_menu->add_action(GAction::create("Build", { Mod_Ctrl, Key_B }, [&](auto&) {
build(terminal_wrapper);
}));
build_menu->add_action(GAction::create("Run", { Mod_Ctrl, Key_R }, [&](auto&) {
run(terminal_wrapper);
}));
menubar->add_menu(move(build_menu));
auto small_icon = GraphicsBitmap::load_from_file("/res/icons/16x16/app-hack-studio.png");
@ -125,3 +129,8 @@ void build(TerminalWrapper& wrapper)
{
wrapper.run_command("make");
}
void run(TerminalWrapper& wrapper)
{
wrapper.run_command("make run");
}