Skip to content
API Documentation
BastionGuard™
BootOptionsWindow.vala
Go to the documentation of this file.
1/*
2 * BootOptionsWindow.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 BootOptionsWindow : Gtk.Window{
36
37 private Gtk.Box vbox_main;
39
40 private uint tmr_init;
41
43
44 log_debug("BootOptionsWindow: BootOptionsWindow()");
45
46 this.title = _("Bootloader Options");
47 this.modal = true;
48 //this.set_default_size (def_width, def_height);
49 this.set_icon_name("bastionguard-backup");
50
51 this.close_request.connect(() => {
52 return on_close_request();
53 });
54
55 // vbox_main
56 vbox_main = new Gtk.Box(Orientation.VERTICAL, 6);
57 vbox_main.margin_start = 12;
58 vbox_main.margin_end = 12;
59 vbox_main.margin_top = 12;
60 vbox_main.margin_bottom = 12;
61 set_child(vbox_main);
62
64 boot_options_box.margin_start = 0;
65 boot_options_box.margin_end = 0;
66 boot_options_box.margin_top = 0;
67 boot_options_box.margin_bottom = 0;
69
71
72 show();
73
74 tmr_init = Timeout.add(100, init_delayed);
75
76 log_debug("BootOptionsWindow: BootOptionsWindow(): exit");
77 }
78
79 private bool init_delayed(){
80
81 if (tmr_init > 0){
82 Source.remove(tmr_init);
83 tmr_init = 0;
84 }
85
86 return false;
87 }
88
89 private bool on_close_request(){
90
91 //save_changes();
92
93 return false; // close window
94 }
95
96 private void save_changes(){
97 //App.cron_job_update();
98 }
99
100 private void create_actions(){
101
102 var hbox = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6);
103 hbox.margin_start = 0;
104 hbox.margin_end = 0;
105 hbox.margin_top = 0;
106 hbox.margin_bottom = 0;
107 hbox.margin_top = 24;
108 vbox_main.append(hbox);
109
110 var size_group = new Gtk.SizeGroup(SizeGroupMode.HORIZONTAL);
111
112 // close
113 var btn_close = add_button(hbox, _("Close"), "", size_group, null);
114 //hbox.set_child_packing(btn_close, false, true, 6, Gtk.PackType.END);
115
116 btn_close.clicked.connect(()=>{
117 save_changes();
118 this.destroy();
119 });
120 }
121
122}
123
124
125
#define _(s)
BootOptionsBox(Gtk.Window _parent_window)
BootOptionsBox boot_options_box
void log_debug(string message)