Skip to content
API Documentation
BastionGuard™
AboutPage.cpp
Go to the documentation of this file.
1/*
2 * BastionGuard™ Secure Connection
3 * Copyright (C) 2025–2026 Calogero Scarnà
4 * GPL-3.0 — BastionGuard™ is a trademark of Calogero Scarnà.
5 */
6
7#include "AboutPage.hpp"
8#include <glibmm/i18n.h>
9#include <gdkmm/pixbuf.h>
10#include "../Resource.hpp"
11#include "config.h"
12
14: Gtk::Box(Gtk::Orientation::VERTICAL, 0)
15{
16 buildContent();
17}
18
19
21{
22 set_valign(Gtk::Align::CENTER);
23 set_halign(Gtk::Align::CENTER);
24 set_spacing(16);
25 set_margin_top(40);
26 set_margin_bottom(40);
27 set_margin_start(40);
28 set_margin_end(40);
29
30 {
31 bool loaded = false;
32 auto pic = Gtk::make_managed<Gtk::Picture>();
33 try {
34 auto tex = Gdk::Texture::create_from_filename(resource("logo-sidebar.png"));
35 pic->set_paintable(tex);
36 pic->set_content_fit(Gtk::ContentFit::CONTAIN);
37 pic->set_size_request(128, 128);
38 pic->set_halign(Gtk::Align::CENTER);
39 pic->set_valign(Gtk::Align::CENTER);
40 append(*pic);
41 loaded = true;
42 } catch (...) {}
43
44 if (!loaded) {
45 auto img = Gtk::make_managed<Gtk::Image>();
46 img->set_from_icon_name("security-high-symbolic");
47 img->set_pixel_size(128);
48 img->set_halign(Gtk::Align::CENTER);
49 img->set_valign(Gtk::Align::CENTER);
50 append(*img);
51 }
52 }
53
54 auto appName = Gtk::make_managed<Gtk::Label>();
55 appName->set_markup("<span size='xx-large' weight='bold'>BastionGuard™ Secure Connection</span>");
56 appName->set_halign(Gtk::Align::CENTER);
57 append(*appName);
58
59 auto version = Gtk::make_managed<Gtk::Label>();
60 version->set_markup(
61 "<span size='large' alpha='70%'>" +
62 Glib::ustring(_("Versione")) + " " +
63 Glib::ustring(BG_SECURE_CONNECTION_VERSION) +
64 "</span>");
65 version->set_halign(Gtk::Align::CENTER);
66 append(*version);
67
68 auto sep = Gtk::make_managed<Gtk::Separator>(Gtk::Orientation::HORIZONTAL);
69 sep->set_margin_top(8);
70 sep->set_margin_bottom(8);
71 append(*sep);
72
73 auto desc = Gtk::make_managed<Gtk::Label>(
74 _("Firewall applicativo interattivo per Linux.\n"
75 "Monitora e controlla le connessioni di rete per ogni applicazione."));
76 desc->set_halign(Gtk::Align::CENTER);
77 desc->set_justify(Gtk::Justification::CENTER);
78 desc->set_wrap(true);
79 desc->set_max_width_chars(60);
80 append(*desc);
81
82
83 auto author = Gtk::make_managed<Gtk::Label>();
84 author->set_markup(Glib::ustring("<b>") + _("Autore") + ":</b> Calogero Scarnà");
85 author->set_halign(Gtk::Align::CENTER);
86 append(*author);
87
88 auto license = Gtk::make_managed<Gtk::Label>();
89 license->set_markup(Glib::ustring("<b>") + _("Licenza") + ":</b> GNU General Public License v3.0");
90 license->set_halign(Gtk::Align::CENTER);
91 append(*license);
92
93 auto ghBox = Gtk::make_managed<Gtk::Box>(Gtk::Orientation::HORIZONTAL, 8);
94 ghBox->set_halign(Gtk::Align::CENTER);
95
96 auto ghBtn = Gtk::make_managed<Gtk::LinkButton>(
97 "https://git.bastionguard.eu/specialworld83/bastionguard-secure-connection",
98 _("Sorgenti su GitHub"));
99 ghBox->append(*ghBtn);
100 append(*ghBox);
101
102 auto copy = Gtk::make_managed<Gtk::Label>();
103 copy->set_markup("<small>Copyright © 2025–2026 Calogero Scarnà</small>");
104 copy->set_halign(Gtk::Align::CENTER);
105 copy->set_margin_top(12);
106 append(*copy);
107}
#define _(s)
void buildContent()
Definition AboutPage.cpp:20
std::string resource(const std::string &rel)
Definition Resource.hpp:31