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

HackStudio: Add a simple "Build" action

Pressing Ctrl+B now invokes "make" in the project directory and routes
the output from the make command to the little terminal widget.
This commit is contained in:
Andreas Kling 2019-10-22 22:15:43 +02:00
parent 5a83e053b3
commit 654ffdef91
3 changed files with 56 additions and 12 deletions

View file

@ -21,6 +21,8 @@
String g_currently_open_file;
static void build(TerminalWrapper&);
int main(int argc, char** argv)
{
GApplication app(argc, argv);
@ -97,6 +99,12 @@ int main(int argc, char** argv)
}));
menubar->add_menu(move(app_menu));
auto build_menu = make<GMenu>("Build");
build_menu->add_action(GAction::create("Build", { Mod_Ctrl, Key_B }, [&](auto&) {
build(terminal_wrapper);
}));
menubar->add_menu(move(build_menu));
auto small_icon = GraphicsBitmap::load_from_file("/res/icons/16x16/app-hack-studio.png");
auto help_menu = make<GMenu>("Help");
@ -112,3 +120,8 @@ int main(int argc, char** argv)
window->show();
return app.exec();
}
void build(TerminalWrapper& wrapper)
{
wrapper.run_command("make");
}