Skip to content
API Documentation
BastionGuard™
ExcludeListSummaryWindow.vala
Go to the documentation of this file.
1/*
2 * ExcludeListSummaryWindow.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 ExcludeListSummaryWindow : Gtk.Window{
36
37 private Gtk.Box vbox_main;
38 private Gtk.Label lbl_list;
39 private Gtk.Button btn_close;
40 private bool for_restore = false;
41
42 private int def_width = 500;
43 private int def_height = 450;
44
45 public ExcludeListSummaryWindow(bool _for_restore) {
46
47 log_debug("ExcludeListSummaryWindow: ExcludeListSummaryWindow()");
48
49 this.title = _("Exclude List Summary");
50 this.modal = true;
51 this.set_default_size (def_width, def_height);
52 this.set_icon_name("bastionguard-backup");
53
54 for_restore = _for_restore;
55
56 // vbox_main
57 vbox_main = new Gtk.Box(Orientation.VERTICAL, 6);
58 vbox_main.margin_start = 12;
59 vbox_main.margin_end = 12;
60 vbox_main.margin_top = 12;
61 vbox_main.margin_bottom = 12;
62 set_child(vbox_main);
63
64 add_label(vbox_main, _("Files &amp; directories matching the patterns below will be excluded. Patterns starting with a + will include the item instead of excluding."));
65
66 lbl_list = add_label_scrolled(vbox_main, "", true, true);
67
69
70 refresh();
71
72 show();
73
74 log_debug("ExcludeListSummaryWindow: ExcludeListSummaryWindow(): exit");
75 }
76
77 private void create_actions(){
78
79 var hbox = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 6);
80 vbox_main.append(hbox);
81 var size_group = new Gtk.SizeGroup(SizeGroupMode.HORIZONTAL);
82
83 // close
84
85 var img = IconManager.lookup_image("emblem-ok-symbolic", 16);
86 btn_close = add_button(hbox, _("OK"), "", size_group, img);
87
88 btn_close.clicked.connect(()=>{
89 this.destroy();
90 });
91 }
92
93 public void refresh(){
94
95 Gee.ArrayList<string> list;
96
97 if (for_restore){
99 }
100 else{
102 }
103
104 var txt = "";
105 foreach(var pattern in list){
106 if (pattern.strip().length > 0){
107 txt += "%s\n".printf(pattern);
108 }
109 }
110
111 lbl_list.label = txt;
112 }
113}
114
115
116
117
118
Main App
#define _(s)
ExcludeListSummaryWindow(bool _for_restore)
static Gtk.Image lookup_image(string icon_name, int icon_size, bool symbolic=false, bool use_hardcoded=false)
Gee.ArrayList< string > create_exclude_list_for_backup()
Definition Main.vala:797
Gee.ArrayList< string > create_exclude_list_for_restore()
Definition Main.vala:907
Gtk.Label add_label(Gtk.Box box, string text, bool bold=false, bool italic=false, bool large=false)
void log_debug(string message)