Skip to content
API Documentation
BastionGuard™
FinishBox.vala
Go to the documentation of this file.
1/*
2 * FinishBox.vala
3 *
4 * Copyright 2012-2018 Tony George <teejeetech@gmail.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 * MA 02110-1301, USA.
20 *
21 *
22 */
23
24using Gtk;
25using Gee;
26
27using TeeJee.Logging;
32using TeeJee.System;
33using TeeJee.Misc;
34
35class FinishBox : Gtk.Box{
36
37 private Gtk.Label lbl_header;
38 private Gtk.Label lbl_message;
39
40 private Gtk.Window parent_window;
41 private bool show_notes = true;
42
43 public FinishBox (Gtk.Window _parent_window, bool _show_notes) {
44
45 log_debug("FinishBox: FinishBox()");
46
47 //base(Gtk.Orientation.VERTICAL, 6); // issue with vala
48 GLib.Object(orientation: Gtk.Orientation.VERTICAL, spacing: 6); // work-around
49 parent_window = _parent_window;
50 margin_top = 12;
51 margin_bottom = 12;
52 margin_start = 12;
53 margin_end = 12;
54 show_notes = _show_notes;
55
56 // header
57 if (show_notes){
58 lbl_header = add_label_header(this, _("Notes"), true);
59 }
60 else{
61 lbl_header = add_label_header(this, _("Setup Complete"), true);
62 }
63
64 lbl_message = add_label_scrolled(this, "", false, true, 0);
65
66 refresh();
67
68 log_debug("FinishBox: FinishBox(): exit");
69 }
70
71 public void refresh(){
72
73 var msg = "";
74 string bullet = "• ";
75
76 if (!show_notes){
77 if (App.scheduled){
78 msg += bullet + _("Scheduled snapshots are enabled. Snapshots will be created automatically for selected levels.") + "\n\n";
79 }
80 else{
81 msg += bullet + _("Scheduled snapshots are disabled. It's recommended to enable it.") + "\n\n";
82 }
83 }
84
85 msg += bullet + _("System can be rolled-back to a previous date by restoring a snapshot.") + "\n\n";
86
87 if (App.btrfs_mode){
88 msg += bullet + _("Restoring a snapshot will replace system subvolumes, and system subvolumes currently in use will be preserved as a new snapshot. If required, this snapshot can be restored later to 'undo' the restore.") + "\n\n";
89 }
90 else{
91 msg += bullet + _("Restoring snapshots only replaces system files and settings. Non-hidden files and directories in user home directories will not be touched. This behaviour can be changed by adding a filter to include these files. Included files will be backed up when snapshot is created, and replaced when snapshot is restored.") + "\n\n";
92 }
93
94 if (App.btrfs_mode){
95 msg += bullet + _("BTRFS snapshots are saved on the same disk from which it is created. If the system disk fails, snapshots will be lost along with the system. Save snapshots to an external non-system disk in RSYNC mode to guard against disk failures.") + "\n\n";
96 }
97 else{
98 msg += bullet + _("Save snapshots to an external disk instead of the system disk to guard against drive failures.") + "\n\n";
99
100 msg += bullet + _("Saving snapshots to a non-system disk allows you to format and re-install the OS on the system disk without losing snapshots stored on it. You can even install another Linux distribution and later roll-back the previous distribution by restoring a snapshot.") + "\n\n";
101 }
102
103 msg += "\n";
104 msg += "<b>" + _("Close window to exit") + "</b>\n\n";
105
106 lbl_message.label = msg;
107 }
108}
Main App
#define _(s)
FinishBox(Gtk.Window _parent_window, bool _show_notes)
void refresh()
bool show_notes
Gtk.Label lbl_message
Gtk.Window parent_window
Gtk.Label lbl_header
bool btrfs_mode
Definition Main.vala:52
bool scheduled
Definition Main.vala:1050
void log_debug(string message)