Skip to content
API Documentation
BastionGuard™
RestoreExcludeBox Class Reference
Inheritance diagram for RestoreExcludeBox:

Public Member Functions

 RestoreExcludeBox (Gtk.Window _parent_window)
void refresh ()

Private Attributes

Gtk.CheckButton chk_other
Gtk.CheckButton chk_web
Gtk.CheckButton chk_torrent
Gtk.Window parent_window

Detailed Description

Definition at line 35 of file RestoreExcludeBox.vala.

Constructor & Destructor Documentation

◆ RestoreExcludeBox()

RestoreExcludeBox.RestoreExcludeBox ( Gtk.Window _parent_window)
inline

Definition at line 44 of file RestoreExcludeBox.vala.

44 {
45
46 log_debug("RestoreExcludeBox: RestoreExcludeBox()");
47
48 //base(Gtk.Orientation.VERTICAL, 6); // issue with vala
49 GLib.Object(orientation: Gtk.Orientation.VERTICAL, spacing: 6); // work-around
50 parent_window = _parent_window;
51 margin_top = 12;
52 margin_bottom = 12;
53 margin_start = 12;
54 margin_end = 12;
55
56 // app settings header --------------------------------
57
58 var label = add_label_header(this, _("Exclude Application Settings"), true);
59
60 add_label(this, _("Select applications to exclude from restore"));
61
62 // web browsers --------------------------------
63
64 var chk = add_checkbox(this, _("Web Browsers") + " (%s)".printf(_("Recommended")));
65 chk.active = true;
66 chk.margin_top = 12;
67 chk.margin_bottom = 0;
68 chk_web = chk;
69
70 chk.toggled.connect(()=>{
71 foreach(var name in new string[]{
72 "chromium", "google-chrome", "mozilla", "midori", "epiphany",
73 "opera", "opera-stable", "opera-beta", "opera-developer" }){
74 if (AppExcludeEntry.app_map.has_key(name)){
75 AppExcludeEntry.app_map[name].enabled = chk_web.active;
76 }
77 }
78 });
79
80 label = add_label(
81 this, _("Firefox, Chromium, Chrome, Opera, Epiphany, Midori"), false, true);
82 label.margin_top = 0;
83 label.margin_bottom = 6;
84 label.margin_start = 24;
85 label.wrap = true;
86 label.wrap_mode = Pango.WrapMode.WORD_CHAR;
87
88 var tt = _("Keep configuration files for web browsers like Firefox and Chrome. If un-checked, previous configuration files will be restored from snapshot");
89 chk.set_tooltip_text(tt);
90 label.set_tooltip_text(tt);
91
92 // torrent clients ----------------------------
93
94 chk = add_checkbox(this, _("Bittorrent Clients") + " (%s)".printf(_("Recommended")));
95 chk.active = true;
96 chk.margin_bottom = 0;
97 chk_torrent = chk;
98
99 chk.toggled.connect(()=>{
100 foreach(var name in new string[]{
101 "deluge", "transmission" }){
102 if (AppExcludeEntry.app_map.has_key(name)){
103 AppExcludeEntry.app_map[name].enabled = chk_torrent.active;
104 }
105 }
106 });
107
108 label = add_label(this, _("Deluge, Transmission"), false, true);
109 label.margin_top = 0;
110 label.margin_bottom = 6;
111 label.margin_start = 24;
112 label.wrap = true;
113 label.wrap_mode = Pango.WrapMode.WORD_CHAR;
114
115 tt = _("Keep configuration files for bittorrent clients like Deluge, Transmission, etc. If un-checked, previous configuration files will be restored from snapshot.");
116 chk.set_tooltip_text(tt);
117 label.set_tooltip_text(tt);
118
119 // all apps ----------------------------
120
121 chk = add_checkbox(this, _("Other applications (next page)"));
122 chk_other = chk;
123
124 tt = _("Show more applications to exclude on the next page");
125 chk.set_tooltip_text(tt);
126
127 // TODO: medium: add more exclude options
128
129 log_debug("RestoreExcludeBox: RestoreExcludeBox(): exit");
130 }
#define _(s)
Gtk.CheckButton chk_web
Gtk.CheckButton chk_torrent
Gtk.CheckButton chk_other
Gtk.Label add_label(Gtk.Box box, string text, bool bold=false, bool italic=false, bool large=false)
void log_debug(string message)

References _, TeeJee.GtkHelper.add_label(), AppExcludeEntry.app_map, chk_other, chk_torrent, chk_web, TeeJee.Logging.log_debug(), and parent_window.

Referenced by RestoreWindow.build_pages().

Member Function Documentation

◆ refresh()

void RestoreExcludeBox.refresh ( )
inline

Definition at line 132 of file RestoreExcludeBox.vala.

132 {
133
134 chk_web.toggled();
135 chk_torrent.toggled();
136 }

References chk_torrent, and chk_web.

Referenced by RestoreWindow.initialize_tab().

Member Data Documentation

◆ chk_other

Gtk.CheckButton RestoreExcludeBox.chk_other
private

Definition at line 38 of file RestoreExcludeBox.vala.

Referenced by RestoreExcludeBox().

◆ chk_torrent

Gtk.CheckButton RestoreExcludeBox.chk_torrent
private

Definition at line 40 of file RestoreExcludeBox.vala.

Referenced by refresh(), and RestoreExcludeBox().

◆ chk_web

Gtk.CheckButton RestoreExcludeBox.chk_web
private

Definition at line 39 of file RestoreExcludeBox.vala.

Referenced by refresh(), and RestoreExcludeBox().

◆ parent_window

Gtk.Window RestoreExcludeBox.parent_window
private

Definition at line 42 of file RestoreExcludeBox.vala.

Referenced by RestoreExcludeBox().


The documentation for this class was generated from the following file: