Skip to content
API Documentation
BastionGuard™
DashboardPage.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#pragma once
22#include <gtkmm.h>
23#include <string>
24
25#include "LifetimeGuard.hpp"
26
27class DashboardPage : public Gtk::Box {
28public:
30 ~DashboardPage() override;
31
32
33 void update_from_logs(const std::string& log_path,
34 const Glib::ustring& db_version,
35 bool on_access_enabled);
36
37
38 bool update_from_logs();
39
40private:
41
42 Gtk::Label lbl_title_;
43 Gtk::Grid grid_cards_;
44
45
46 Gtk::Frame* card_status_ = nullptr;
47 Gtk::Frame* card_db_version_ = nullptr;
48 Gtk::Frame* card_db_date_ = nullptr;
49 Gtk::Frame* card_logs_ = nullptr;
50 Gtk::Label lbl_status_;
51 Gtk::Label lbl_db_version_;
52 Gtk::Label lbl_db_date_;
55 Gtk::TextView txt_onaccess_report_;
56 Glib::RefPtr<Gtk::TextBuffer> buf_onaccess_report_;
57 Gtk::Box* footer_box_ = nullptr;
59 Gtk::Button* btn_theme_light_ = nullptr;
60 Gtk::Button* btn_theme_dark_ = nullptr;
61 sigc::connection update_check_timer_;
64 void set_update_status(const std::string& state);
66
67 sigc::connection refresh_timer_;
68
69
70 Gtk::Frame* make_card(const std::string& icon_path,
71 Gtk::Widget& content,
72 const Glib::ustring& title);
73
75};
Gtk::Frame * make_card(const std::string &icon_path, Gtk::Widget &content, const Glib::ustring &title)
Gtk::Label lbl_title_
Gtk::Frame * card_db_date_
Gtk::Grid grid_cards_
Gtk::Label lbl_update_status_
Gtk::Frame * card_status_
Gtk::Frame * card_db_version_
sigc::connection update_check_timer_
void set_update_status(const std::string &state)
Gtk::Label lbl_ransomware_status_
Gtk::Button * btn_theme_light_
void check_updates_async()
Gtk::Frame * card_logs_
Gtk::Label lbl_db_version_
Gtk::Box * footer_box_
Gtk::Label lbl_db_date_
Gtk::Label lbl_phishing_status_
Gtk::Button * btn_theme_dark_
bool update_check_in_progress_
Gtk::TextView txt_onaccess_report_
bool on_update_check_timer()
Gtk::Label lbl_status_
sigc::connection refresh_timer_
void update_from_logs(const std::string &log_path, const Glib::ustring &db_version, bool on_access_enabled)
BastionGuard::AliveFlag alive_
Glib::RefPtr< Gtk::TextBuffer > buf_onaccess_report_
std::shared_ptr< std::atomic< bool > > AliveFlag
AliveFlag make_alive_flag()