mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:07:46 +00:00
HackStudio: Show notification if 'make' is not available
We previously popped a MessageBox for this, but a notification is less disruptive.
This commit is contained in:
parent
653c3d5812
commit
e42b9e879c
1 changed files with 13 additions and 2 deletions
|
@ -35,6 +35,7 @@
|
||||||
#include <LibGUI/Application.h>
|
#include <LibGUI/Application.h>
|
||||||
#include <LibGUI/MenuBar.h>
|
#include <LibGUI/MenuBar.h>
|
||||||
#include <LibGUI/MessageBox.h>
|
#include <LibGUI/MessageBox.h>
|
||||||
|
#include <LibGUI/Notification.h>
|
||||||
#include <LibGUI/Widget.h>
|
#include <LibGUI/Widget.h>
|
||||||
#include <LibGUI/Window.h>
|
#include <LibGUI/Window.h>
|
||||||
#include <LibThread/Lock.h>
|
#include <LibThread/Lock.h>
|
||||||
|
@ -53,6 +54,7 @@ static RefPtr<GUI::Window> s_window;
|
||||||
static RefPtr<HackStudioWidget> s_hack_studio_widget;
|
static RefPtr<HackStudioWidget> s_hack_studio_widget;
|
||||||
|
|
||||||
static bool make_is_available();
|
static bool make_is_available();
|
||||||
|
static void notify_make_not_available();
|
||||||
static void update_path_environment_variable();
|
static void update_path_environment_variable();
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
|
@ -75,8 +77,9 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
update_path_environment_variable();
|
update_path_environment_variable();
|
||||||
|
|
||||||
if (!make_is_available())
|
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);
|
notify_make_not_available();
|
||||||
|
}
|
||||||
|
|
||||||
const char* path_argument = nullptr;
|
const char* path_argument = nullptr;
|
||||||
Core::ArgsParser args_parser;
|
Core::ArgsParser args_parser;
|
||||||
|
@ -122,6 +125,14 @@ static bool make_is_available()
|
||||||
return WEXITSTATUS(wstatus) == 0;
|
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()
|
static void update_path_environment_variable()
|
||||||
{
|
{
|
||||||
StringBuilder path;
|
StringBuilder path;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue