Skip to content
API Documentation
BastionGuard™
first-run-services-window.hpp
Go to the documentation of this file.
1/*
2 * BastionGuard™
3 * Copyright (C) 2025–2026 Calogero Scarnà
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, version 3.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 *
17 * BastionGuard™ is a trademark of Calogero Scarnà.
18 * The BastionGuard™ name and branding are not licensed under the GPL.
19 */
20
21#ifndef FIRST_RUN_SERVICES_WINDOW_HPP
22#define FIRST_RUN_SERVICES_WINDOW_HPP
23
24#include <gtkmm.h>
25#include <vector>
26#include <string>
27
28class FirstRunServicesWindow : public Gtk::Window
29{
30public:
32
33 static void maybe_show();
34
35protected:
36 bool on_close_request() override;
37
38private:
39 struct ServiceInfo {
40 std::string name;
41 std::string label;
42 std::string description;
43 };
44
45 std::vector<Gtk::CheckButton*> check_buttons;
46 std::vector<std::string> service_names;
47 void build_headerbar();
48 void build_ui();
50 void select_all();
51 void select_minimal();
52 void apply_and_close();
54 void on_close_clicked();
55 bool is_user_service_enabled(const std::string& service_name);
56 bool enable_user_service(const std::string& service_name);
57 bool disable_user_service(const std::string& service_name);
58 bool is_system_service_enabled(const std::string& unit_name);
59 bool enable_system_service(const std::string& unit_name);
60 bool disable_system_service(const std::string& unit_name);
61
62 Gtk::Button* btn_minimize = nullptr;
63 Gtk::Button* btn_close = nullptr;
64};
65
66#endif // FIRST_RUN_SERVICES_WINDOW_HPP
bool disable_user_service(const std::string &service_name)
bool enable_system_service(const std::string &unit_name)
std::vector< Gtk::CheckButton * > check_buttons
bool is_user_service_enabled(const std::string &service_name)
bool is_system_service_enabled(const std::string &unit_name)
bool disable_system_service(const std::string &unit_name)
bool enable_user_service(const std::string &service_name)
std::vector< std::string > service_names