summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorItamar <itamar8910@gmail.com>2021-02-10 20:02:43 +0200
committerAndreas Kling <kling@serenityos.org>2021-02-10 23:04:54 +0100
commite42b9e879cea25c19434eab732e268a75146fc33 (patch)
treebed538e0b78cef11c6205ab7e38387157e568d36
parent653c3d5812e491b44fed453fcceaf64ebb985e97 (diff)
downloadserenity-e42b9e879cea25c19434eab732e268a75146fc33.zip
HackStudio: Show notification if 'make' is not available
We previously popped a MessageBox for this, but a notification is less disruptive.
-rw-r--r--Userland/DevTools/HackStudio/main.cpp15
1 files 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 <LibGUI/Application.h>
#include <LibGUI/MenuBar.h>
#include <LibGUI/MessageBox.h>
+#include <LibGUI/Notification.h>
#include <LibGUI/Widget.h>
#include <LibGUI/Window.h>
#include <LibThread/Lock.h>
@@ -53,6 +54,7 @@ static RefPtr<GUI::Window> s_window;
static RefPtr<HackStudioWidget> 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;