Skip to content
API Documentation
BastionGuard™
BackupPage.hpp
Go to the documentation of this file.
1/*
2 * BastionGuard™
3 * BackupPage.hpp
4 */
5
6#pragma once
7#include <gtkmm.h>
8#include <string>
9
10#include "../LifetimeGuard.hpp"
11
12class BackupPage : public Gtk::Box {
13
14public:
15
16 BackupPage();
17 ~BackupPage() override;
18
19private:
20
21 // Layout
22 Gtk::Notebook notebook;
23
24 // Recovery GRUB tab widgets
26 Gtk::Button installGrubButton;
27 Gtk::Button removeGrubButton;
28
29 Gtk::Label recoveryStatusLabel; // stato immagine (percorso, dimensione, GRUB)
30 Gtk::Label recoverySpaceLabel; // spazio disponibile su /boot (min 2 GB)
31 Gtk::Label recoveryResultLabel; // alert success/error esito comando
32 Gtk::ProgressBar recoveryProgress; // pulse durante build
33
34 // Log
35 Gtk::TextView logView;
36 Glib::RefPtr<Gtk::TextBuffer> logBuffer;
37
38 // UI builders
39 Gtk::Widget* buildBackupTab();
40 Gtk::Widget* buildGrubTab();
41 Gtk::Widget* buildLogSection();
42
43 // Handlers
44 void onBuildRecovery();
45 void onInstallGrub();
46 void onRemoveGrub();
47
48 // Helpers
49 void logSafe(const std::string& msg);
50 void runAsyncStreaming(const std::string& cmd, bool show_success = false);
52 void setResult(bool success, const std::string& msg);
53
54 // Stato build in corso
55 sigc::connection pulseTimer;
56 bool buildRunning = false;
57
59};
sigc::connection pulseTimer
void logSafe(const std::string &msg)
void setResult(bool success, const std::string &msg)
Glib::RefPtr< Gtk::TextBuffer > logBuffer
Gtk::Label recoveryResultLabel
void onRemoveGrub()
void updateRecoveryStatus()
Gtk::Button removeGrubButton
void onInstallGrub()
Gtk::Widget * buildGrubTab()
Gtk::Button installGrubButton
Gtk::Widget * buildBackupTab()
Gtk::Notebook notebook
BastionGuard::AliveFlag alive_
Gtk::Label recoveryStatusLabel
void runAsyncStreaming(const std::string &cmd, bool show_success=false)
Gtk::Label recoverySpaceLabel
Gtk::Button buildRecoveryButton
bool buildRunning
Gtk::ProgressBar recoveryProgress
void onBuildRecovery()
Gtk::TextView logView
Gtk::Widget * buildLogSection()
std::shared_ptr< std::atomic< bool > > AliveFlag
AliveFlag make_alive_flag()