From e42b9e879cea25c19434eab732e268a75146fc33 Mon Sep 17 00:00:00 2001 From: Itamar Date: Wed, 10 Feb 2021 20:02:43 +0200 Subject: [PATCH] HackStudio: Show notification if 'make' is not available We previously popped a MessageBox for this, but a notification is less disruptive. --- Userland/DevTools/HackStudio/main.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Userland/DevTools/HackStudio/main.cpp b/Userland/DevTools/HackStudio/main.cpp index 92d8796e64..142a03ddff 100644 --- a/Userland/DevTools/HackStudio/main.cpp +++ b/Userland/DevTools/HackStudio/main.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -53,6 +54,7 @@ static RefPtr s_window; static RefPtr s_hack_studio_widget; static bool make_is_available(); +static void notify_make_not_available(); static void update_path_environment_variable(); int main(int argc, char** argv) @@ -75,8 +77,9 @@ int main(int argc, char** argv) update_path_environment_variable(); - if (!make_is_available()) - GUI::MessageBox::show(s_window, "The 'make' command is not available. You probably want to install the binutils, gcc, and make ports from the root of the Serenity repository.", "Error", GUI::MessageBox::Type::Error); + if (!make_is_available()) { + notify_make_not_available(); + } const char* path_argument = nullptr; Core::ArgsParser args_parser; @@ -122,6 +125,14 @@ static bool make_is_available() return WEXITSTATUS(wstatus) == 0; } +static void notify_make_not_available() +{ + auto notification = GUI::Notification::construct(); + notification->set_title("'make' Not Available"); + notification->set_text("You probably want to install the binutils, gcc, and make ports from the root of the Serenity repository"); + notification->show(); +} + static void update_path_environment_variable() { StringBuilder path;