2021-11-21 01:01:21 +01:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2021, the SerenityOS developers.
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "TerminalSettingsWidget.h"
|
2021-11-27 17:35:00 +01:00
|
|
|
#include <LibCore/System.h>
|
2021-11-21 01:01:21 +01:00
|
|
|
#include <LibGUI/Application.h>
|
|
|
|
|
#include <LibGUI/SettingsWindow.h>
|
|
|
|
|
#include <LibGUI/WindowServerConnection.h>
|
2021-11-27 17:35:00 +01:00
|
|
|
#include <LibMain/Main.h>
|
2021-11-21 01:01:21 +01:00
|
|
|
|
|
|
|
|
// Including this after to avoid LibIPC errors
|
|
|
|
|
#include <LibConfig/Client.h>
|
|
|
|
|
|
2021-11-27 17:35:00 +01:00
|
|
|
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
2021-11-21 01:01:21 +01:00
|
|
|
{
|
2021-11-27 17:35:00 +01:00
|
|
|
TRY(Core::System::pledge("stdio rpath cpath wpath recvfd sendfd unix proc exec", nullptr));
|
|
|
|
|
auto app = TRY(GUI::Application::try_create(arguments));
|
2021-11-21 01:01:21 +01:00
|
|
|
Config::pledge_domains("Terminal");
|
|
|
|
|
|
2021-11-27 17:35:00 +01:00
|
|
|
TRY(Core::System::pledge("stdio rpath cpath wpath recvfd sendfd proc exec", nullptr));
|
|
|
|
|
TRY(Core::System::unveil("/res", "r"));
|
|
|
|
|
TRY(Core::System::unveil("/bin/keymap", "x"));
|
|
|
|
|
TRY(Core::System::unveil("/proc/keymap", "r"));
|
|
|
|
|
TRY(Core::System::unveil(nullptr, nullptr));
|
2021-11-21 01:01:21 +01:00
|
|
|
|
|
|
|
|
auto app_icon = GUI::Icon::default_icon("app-terminal");
|
|
|
|
|
|
2021-11-27 17:35:00 +01:00
|
|
|
auto window = TRY(GUI::SettingsWindow::try_create("Terminal Settings"));
|
2021-11-21 01:01:21 +01:00
|
|
|
window->set_icon(app_icon.bitmap_for_size(16));
|
|
|
|
|
window->add_tab<TerminalSettingsMainWidget>("Terminal");
|
|
|
|
|
window->add_tab<TerminalSettingsViewWidget>("View");
|
|
|
|
|
|
|
|
|
|
window->show();
|
|
|
|
|
return app->exec();
|
|
|
|
|
}
|