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

Public Types

enum  Tabs { ESTIMATE = 0 , BACKUP_DEVICE = 1 , BACKUP = 2 , BACKUP_FINISH = 3 }

Public Member Functions

signal void request_close ()
 BackupWindow (bool embedded=false)
Gtk.Widget detach_root_widget ()
void reload_themed_icons ()

Private Member Functions

void build_ui ()
void build_sidebar ()
Gtk.Button make_nav_button (string icon_name, string label_text)
void build_content ()
Gtk.Widget wrap_page (Gtk.Widget child)
void build_pages ()
bool init_delayed ()
bool on_close_request ()
void save_changes ()
void create_actions ()
void action_buttons_set_initial_visibility (bool visible)
void go_first ()
void go_prev ()
void go_next ()
void initialize_tab ()
bool validate_current_tab ()
void clear_sidebar_selection ()
void set_sidebar_active (Gtk.Button btn)
void update_sidebar_state ()
void update_page_title ()
void set_page (int page)
Gtk.Image themed_icon (string icon_name, int size)

Private Attributes

Gtk.Box root_box
Gtk.Box sidebar
Gtk.Box content_box
Gtk.Box header_box
Gtk.Box body_box
Gtk.Box bbox_action
Gtk.Stack page_stack
int current_page = -1
Gtk.Button btn_nav_estimate
Gtk.Button btn_nav_location
Gtk.Button btn_nav_backup
Gtk.Button btn_nav_finish
Gtk.? Button current_nav_btn = null
Gtk.Label lbl_page_title
EstimateBox estimate_box
BackupDeviceBox backup_dev_box
BackupBox backup_box
BackupFinishBox backup_finish_box
Gtk.Button btn_prev
Gtk.Button btn_next
Gtk.Button btn_cancel
Gtk.Button btn_pause
Gtk.Button btn_close
uint tmr_init
int def_width = 980
int def_height = 680
bool success = false
bool embedded_mode = false
Gee.ArrayList< Gtk.Image > themed_img_list = new Gee.ArrayList<Gtk.Image>()
Gee.ArrayList< string > themed_img_name = new Gee.ArrayList<string>()
Gee.ArrayList< int > themed_img_size = new Gee.ArrayList<int>()

Detailed Description

Definition at line 34 of file BackupWindow.vala.

Member Enumeration Documentation

◆ Tabs

Enumerator
ESTIMATE 
BACKUP_DEVICE 
BACKUP 
BACKUP_FINISH 

Definition at line 642 of file BackupWindow.vala.

642 {
643 ESTIMATE = 0,
644 BACKUP_DEVICE = 1,
645 BACKUP = 2,
646 BACKUP_FINISH = 3
647 }

Constructor & Destructor Documentation

◆ BackupWindow()

BackupWindow.BackupWindow ( bool embedded = false)
inline

Definition at line 75 of file BackupWindow.vala.

75 {
76 embedded_mode = embedded;
77
78 log_debug("BackupWindow: BackupWindow()");
79
80 this.title = _("Create Snapshot");
81 if (!embedded_mode) this.modal = true;
82 this.set_default_size(def_width, def_height);
83 this.set_default_size(def_width, def_height);
84 this.set_icon_name("bastionguard-backup");
85 if (!embedded_mode) this.close_request.connect(on_close_request);
86
87 if (!embedded_mode) this.set_titlebar(HeaderFactory.create_main_headerbar(this, 220));
88
89 build_ui();
92
93 if (!embedded_mode)
94 show();
95
96 tmr_init = Timeout.add(100, init_delayed);
97
98 log_debug("BackupWindow: BackupWindow(): exit");
99 }
#define _(s)
void create_actions()
bool on_close_request()
void log_debug(string message)

References _, build_pages(), build_ui(), create_actions(), HeaderFactory.create_main_headerbar(), def_height, def_width, embedded_mode, init_delayed(), TeeJee.Logging.log_debug(), on_close_request(), and tmr_init.

Referenced by MainWindow.open_backup_flow().

Member Function Documentation

◆ action_buttons_set_initial_visibility()

void BackupWindow.action_buttons_set_initial_visibility ( bool visible)
inlineprivate

Definition at line 377 of file BackupWindow.vala.

377 {
378
379 btn_prev.visible = visible;
380 btn_next.visible = visible;
381 btn_close.visible = visible;
382 btn_cancel.visible = visible;
383 btn_pause.visible = visible;
384 }

Referenced by create_actions(), and initialize_tab().

◆ build_content()

void BackupWindow.build_content ( )
inlineprivate

Definition at line 193 of file BackupWindow.vala.

193 {
194
195 content_box = new Gtk.Box(Gtk.Orientation.VERTICAL, 0);
196 content_box.get_style_context().add_class("content");
197 content_box.hexpand = true;
198 content_box.vexpand = true;
199 content_box.halign = Gtk.Align.FILL;
200 content_box.valign = Gtk.Align.FILL;
201
202 header_box = new Gtk.Box(Gtk.Orientation.VERTICAL, 0);
203 header_box.margin_start = 20;
204 header_box.margin_end = 20;
205 header_box.margin_top = 20;
206 header_box.margin_bottom = 10;
207
208 lbl_page_title = new Gtk.Label(_("Create Snapshot"));
209 lbl_page_title.xalign = 0.0f;
210 lbl_page_title.get_style_context().add_class("title");
212
213 body_box = new Gtk.Box(Gtk.Orientation.VERTICAL, 0);
214 body_box.margin_start = 14;
215 body_box.margin_end = 14;
216 body_box.margin_bottom = 12;
217 body_box.hexpand = true;
218 body_box.vexpand = true;
219
220 page_stack = new Gtk.Stack();
221 page_stack.hexpand = true;
222 page_stack.vexpand = true;
223 page_stack.halign = Gtk.Align.FILL;
224 page_stack.valign = Gtk.Align.FILL;
225
226 body_box.append(page_stack);
227
228 content_box.append(header_box);
229 content_box.append(body_box);
230 }
Gtk.Box header_box
Gtk.Label lbl_page_title
Gtk.Stack page_stack
Gtk.Box content_box

References _, body_box, content_box, header_box, lbl_page_title, and page_stack.

Referenced by build_ui().

◆ build_pages()

void BackupWindow.build_pages ( )
inlineprivate

Definition at line 245 of file BackupWindow.vala.

245 {
246
247 Gtk.Label label;
248
249 label = new Gtk.Label(_("Estimate"));
250 estimate_box = new EstimateBox(this);
251 estimate_box.margin_start = 12;
252 estimate_box.margin_end = 12;
253 estimate_box.margin_top = 12;
254 estimate_box.margin_bottom = 12;
255 page_stack.add_named(wrap_page(estimate_box), "estimate");
256
257 label = new Gtk.Label(_("Location"));
259 backup_dev_box.margin_start = 12;
260 backup_dev_box.margin_end = 12;
261 backup_dev_box.margin_top = 12;
262 backup_dev_box.margin_bottom = 12;
263 page_stack.add_named(wrap_page(backup_dev_box), "location");
264
265 label = new Gtk.Label(_("Backup"));
266 backup_box = new BackupBox(this);
267 backup_box.margin_start = 12;
268 backup_box.margin_end = 12;
269 backup_box.margin_top = 12;
270 backup_box.margin_bottom = 12;
271 page_stack.add_named(wrap_page(backup_box), "backup");
272
273 label = new Gtk.Label(_("Finish"));
275 backup_finish_box.margin_start = 12;
276 backup_finish_box.margin_end = 12;
277 backup_finish_box.margin_top = 12;
278 backup_finish_box.margin_bottom = 12;
279 page_stack.add_named(wrap_page(backup_finish_box), "finish");
280 }
BackupBox(Gtk.Window _parent_window)
BackupDeviceBox(Gtk.Window _parent_window)
BackupFinishBox(Gtk.Window _parent_window)
Gtk.Widget wrap_page(Gtk.Widget child)
EstimateBox estimate_box
BackupBox backup_box
BackupFinishBox backup_finish_box
BackupDeviceBox backup_dev_box
EstimateBox(Gtk.Window _parent_window)

References _, backup_box, backup_dev_box, backup_finish_box, BackupBox.BackupBox(), BackupDeviceBox.BackupDeviceBox(), BackupFinishBox.BackupFinishBox(), estimate_box, EstimateBox.EstimateBox(), page_stack, and wrap_page().

Referenced by BackupWindow().

◆ build_sidebar()

void BackupWindow.build_sidebar ( )
inlineprivate

Definition at line 117 of file BackupWindow.vala.

117 {
118
119 sidebar = new Gtk.Box(Gtk.Orientation.VERTICAL, 0);
120 sidebar.set_size_request(220, -1);
121 sidebar.get_style_context().add_class("sidebar");
122 sidebar.hexpand = false;
123 sidebar.vexpand = true;
124 sidebar.halign = Gtk.Align.FILL;
125 sidebar.valign = Gtk.Align.FILL;
126
127 var sidebar_header = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 8);
128 sidebar_header.get_style_context().add_class("sidebar-header");
129 sidebar.append(sidebar_header);
130
131 Gtk.Widget logo_widget;
132 try {
133 logo_widget = new Gtk.Image.from_pixbuf(IconManager.lookup("bastionguard-backup", 48));
134 }
135 catch (Error e) {
136 logo_widget = themed_icon("document-save-symbolic", 48);
137 }
138
139 var title = new Gtk.Label(_("BastionGuard™\nBackup"));
140 title.xalign = 0.0f;
141 title.get_style_context().add_class("sidebar-title");
142
143 sidebar_header.append(logo_widget);
144 sidebar_header.append(title);
145
146 sidebar.append(new Gtk.Box(Gtk.Orientation.VERTICAL, 0));
147
148 btn_nav_estimate = make_nav_button("system-search-symbolic", _("Estimate"));
149 btn_nav_location = make_nav_button("drive-harddisk-symbolic", _("Location"));
150 btn_nav_backup = make_nav_button("document-save-symbolic", _("Backup"));
151 btn_nav_finish = make_nav_button("emblem-ok-symbolic", _("Finish"));
152
153 // flow lineare
154 btn_nav_estimate.sensitive = false;
155 btn_nav_location.sensitive = false;
156 btn_nav_backup.sensitive = false;
157 btn_nav_finish.sensitive = false;
158
159 var spacer = new Gtk.Box(Gtk.Orientation.VERTICAL, 0);
160 spacer.vexpand = true;
161 sidebar.append(spacer);
162 }
Gtk.Button btn_nav_finish
Gtk.Button btn_nav_backup
Gtk.Button make_nav_button(string icon_name, string label_text)
Gtk.Button btn_nav_estimate
Gtk.Image themed_icon(string icon_name, int size)
Gtk.Button btn_nav_location

References _, btn_nav_backup, btn_nav_estimate, btn_nav_finish, btn_nav_location, Error, IconManager.lookup(), make_nav_button(), sidebar, and themed_icon().

Referenced by build_ui().

◆ build_ui()

void BackupWindow.build_ui ( )
inlineprivate

Definition at line 101 of file BackupWindow.vala.

101 {
102
103 root_box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0);
104 root_box.hexpand = true;
105 root_box.vexpand = true;
106 root_box.halign = Gtk.Align.FILL;
107 root_box.valign = Gtk.Align.FILL;
108 set_child(root_box);
109
112
113 root_box.append(sidebar);
114 root_box.append(content_box);
115 }

References build_content(), build_sidebar(), content_box, root_box, and sidebar.

Referenced by BackupWindow().

◆ clear_sidebar_selection()

void BackupWindow.clear_sidebar_selection ( )
inlineprivate

Definition at line 574 of file BackupWindow.vala.

574 {
575 btn_nav_estimate.get_style_context().remove_class("active-sidebar-button");
576 btn_nav_location.get_style_context().remove_class("active-sidebar-button");
577 btn_nav_backup.get_style_context().remove_class("active-sidebar-button");
578 btn_nav_finish.get_style_context().remove_class("active-sidebar-button");
579 }

References btn_nav_backup, btn_nav_estimate, btn_nav_finish, and btn_nav_location.

Referenced by update_sidebar_state().

◆ create_actions()

void BackupWindow.create_actions ( )
inlineprivate

Definition at line 302 of file BackupWindow.vala.

302 {
303
304 var hbox = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 6);
305 content_box.append(hbox);
306
307 var bbox = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 8);
308 bbox.margin_start = 12;
309 bbox.margin_end = 12;
310 bbox.margin_top = 12;
311 bbox.margin_bottom = 12;
312 bbox.spacing = 6;
313 bbox.hexpand = true;
314 hbox.append(bbox);
315
316 bbox_action = bbox;
317
318 #if GTK3_18
319 bbox.halign = Gtk.Align.CENTER;
320 #endif
321
322 Gtk.SizeGroup size_group = null;
323
324 btn_prev = add_button(bbox, _("Previous"), "", size_group, null);
325 btn_prev.get_style_context().add_class("btn-back");
326 btn_prev.clicked.connect(() => {
327 go_prev();
328 });
329
330 btn_next = add_button(bbox, _("Next"), "", size_group, null);
331 btn_next.get_style_context().add_class("btn-next");
332 btn_next.clicked.connect(() => {
333 go_next();
334 });
335
336 btn_close = add_button(bbox, _("Close"), "", size_group, null);
337 btn_close.get_style_context().add_class("btn-finish");
338 btn_close.clicked.connect(() => {
339 save_changes();
340 if (embedded_mode)
342 else
343 this.destroy();
344 });
345
346 btn_cancel = add_button(bbox, _("Cancel"), "", size_group, null);
347 btn_cancel.get_style_context().add_class("btn-cancel");
348 btn_cancel.clicked.connect(() => {
349 if (App.task != null) {
350 App.task.stop(AppStatus.CANCELLED);
351 }
352 if (embedded_mode)
354 else
355 this.destroy();
356 });
357
358 btn_pause = add_button(bbox, _("Pause"), "", size_group, null);
359 btn_pause.clicked.connect(() => {
360 if (App.task != null) {
361 if (AppStatus.PAUSED == App.task.status) {
362 App.task.resume();
363 this.backup_box.resume();
364 this.btn_pause.set_label(_("Pause"));
365 }
366 else {
367 App.task.pause();
368 this.backup_box.pause();
369 this.btn_pause.set_label(_("Resume"));
370 }
371 }
372 });
373
375 }
Main App
AppStatus
void pause(AppStatus status_to_update=AppStatus.PAUSED)
void stop(AppStatus status_to_update=AppStatus.CANCELLED)
void resume(AppStatus status_to_update=AppStatus.RUNNING)
AppStatus status
void resume()
void pause()
Gtk.Button btn_pause
Gtk.Box bbox_action
Gtk.Button btn_next
Gtk.Button btn_prev
Gtk.Button btn_cancel
Gtk.Button btn_close
signal void request_close()
void action_buttons_set_initial_visibility(bool visible)
RsyncTask task
Definition Main.vala:160

References _, action_buttons_set_initial_visibility(), App, bbox_action, btn_cancel, btn_close, btn_next, btn_pause, btn_prev, content_box, embedded_mode, go_next(), go_prev(), AsyncTask.pause(), BackupBox.pause(), request_close(), AsyncTask.resume(), BackupBox.resume(), save_changes(), AsyncTask.status, AsyncTask.stop(), and Main.task.

Referenced by BackupWindow().

◆ detach_root_widget()

Gtk.Widget BackupWindow.detach_root_widget ( )
inline

Definition at line 649 of file BackupWindow.vala.

649 {
650 set_child(null);
651 return root_box;
652 }

References root_box.

◆ go_first()

void BackupWindow.go_first ( )
inlineprivate

Definition at line 388 of file BackupWindow.vala.

388 {
389
390 if (App.btrfs_mode) {
391 set_page(Tabs.BACKUP);
392 }
393 else {
394 if (Main.first_snapshot_size == 0) {
395 set_page(Tabs.ESTIMATE);
396 }
397 else if (!App.repo.available() || !App.repo.has_space()) {
398 set_page(Tabs.BACKUP_DEVICE);
399 }
400 else {
401 set_page(Tabs.BACKUP);
402 }
403 }
404
406 }
void initialize_tab()
void set_page(int page)
SnapshotRepo repo
Definition Main.vala:70
bool btrfs_mode
Definition Main.vala:52
bool has_space(uint64 needed=0)

References App, SnapshotRepo.available(), Main.btrfs_mode, Main.first_snapshot_size, SnapshotRepo.has_space(), initialize_tab(), Main.repo, and set_page().

Referenced by init_delayed().

◆ go_next()

void BackupWindow.go_next ( )
inlineprivate

Definition at line 436 of file BackupWindow.vala.

436 {
437
438 if (!validate_current_tab()) {
439 return;
440 }
441
442 switch (current_page) {
443 case Tabs.ESTIMATE:
444 set_page(Tabs.BACKUP_DEVICE);
445 break;
446
447 case Tabs.BACKUP_DEVICE:
448 set_page(Tabs.BACKUP);
449 break;
450
451 case Tabs.BACKUP:
452 set_page(Tabs.BACKUP_FINISH);
453 break;
454
455 case Tabs.BACKUP_FINISH:
456 destroy();
457 break;
458 }
459
461 }
bool validate_current_tab()

References current_page, initialize_tab(), set_page(), and validate_current_tab().

Referenced by create_actions(), and initialize_tab().

◆ go_prev()

void BackupWindow.go_prev ( )
inlineprivate

Definition at line 408 of file BackupWindow.vala.

408 {
409
410 switch (current_page) {
411 case Tabs.ESTIMATE:
412 break;
413
414 case Tabs.BACKUP_DEVICE:
415 if (!App.btrfs_mode && Main.first_snapshot_size == 0) {
416 set_page(Tabs.ESTIMATE);
417 }
418 break;
419
420 case Tabs.BACKUP:
421 if (!App.btrfs_mode && (!App.repo.available() || !App.repo.has_space())) {
422 set_page(Tabs.BACKUP_DEVICE);
423 }
424 else if (!App.btrfs_mode && Main.first_snapshot_size == 0) {
425 set_page(Tabs.ESTIMATE);
426 }
427 break;
428
429 case Tabs.BACKUP_FINISH:
430 break;
431 }
432
434 }

References App, SnapshotRepo.available(), Main.btrfs_mode, current_page, Main.first_snapshot_size, SnapshotRepo.has_space(), initialize_tab(), Main.repo, and set_page().

Referenced by create_actions().

◆ init_delayed()

bool BackupWindow.init_delayed ( )
inlineprivate

Definition at line 282 of file BackupWindow.vala.

282 {
283
284 if (tmr_init > 0) {
285 Source.remove(tmr_init);
286 tmr_init = 0;
287 }
288
289 go_first();
290 return false;
291 }

References go_first(), and tmr_init.

Referenced by BackupWindow().

◆ initialize_tab()

void BackupWindow.initialize_tab ( )
inlineprivate

Definition at line 463 of file BackupWindow.vala.

463 {
464
465 if (current_page < 0) {
466 return;
467 }
468
469 log_msg("");
470 log_debug("page: %d".printf(current_page));
471
473
474 switch (current_page) {
475 case Tabs.ESTIMATE:
476 btn_prev.hide();
477 btn_next.hide();
478 btn_close.hide();
479 btn_cancel.show();
480 btn_pause.hide();
481 break;
482
483 case Tabs.BACKUP:
484 btn_prev.hide();
485 btn_next.hide();
486 btn_close.hide();
487 btn_cancel.show();
488 btn_pause.show();
489 break;
490
491 case Tabs.BACKUP_DEVICE:
492 btn_prev.show();
493 btn_next.show();
494 btn_close.show();
495 btn_cancel.hide();
496 btn_pause.hide();
497
498 btn_prev.sensitive = false;
499 btn_next.sensitive = true;
500 btn_close.sensitive = true;
501 break;
502
503 case Tabs.BACKUP_FINISH:
504 btn_prev.hide();
505 btn_next.hide();
506 btn_close.show();
507 btn_close.sensitive = true;
508 btn_cancel.hide();
509 btn_pause.hide();
510 break;
511 }
512
513 switch (current_page) {
514 case Tabs.ESTIMATE:
518 go_next();
519 return;
520
521 case Tabs.BACKUP_DEVICE:
525 go_next();
526 return;
527
528 case Tabs.BACKUP:
532 go_next();
533 return;
534
535 case Tabs.BACKUP_FINISH:
538
540
541 if (App.repo.status_code == SnapshotLocationStatus.HAS_SNAPSHOTS_NO_SPACE) {
542 this.hide();
543 gtk_messagebox(App.repo.status_message, App.repo.status_details, this, true);
544 if (embedded_mode)
546 else
547 this.destroy();
548 }
549 else {
551 wait_and_close_window(1000, this);
552 }
553 break;
554 }
555 }
SnapshotLocationStatus
bool take_snapshot()
void update_message(bool success)
void update_page_title()
void update_sidebar_state()
void estimate_system_size()
string status_details
string status_message
SnapshotLocationStatus status_code
void wait_and_close_window(int milliseconds, Gtk.Window window)
void log_msg(string message, bool highlight=false)

References action_buttons_set_initial_visibility(), App, backup_box, backup_dev_box, backup_finish_box, btn_cancel, btn_close, btn_next, btn_pause, btn_prev, current_page, embedded_mode, estimate_box, EstimateBox.estimate_system_size(), go_next(), TeeJee.Logging.log_debug(), TeeJee.Logging.log_msg(), BackupDeviceBox.refresh(), Main.repo, request_close(), SnapshotRepo.status_code, SnapshotRepo.status_details, SnapshotRepo.status_message, success, BackupBox.take_snapshot(), BackupFinishBox.update_message(), update_page_title(), update_sidebar_state(), and TeeJee.GtkHelper.wait_and_close_window().

Referenced by go_first(), go_next(), and go_prev().

◆ make_nav_button()

Gtk.Button BackupWindow.make_nav_button ( string icon_name,
string label_text )
inlineprivate

Definition at line 164 of file BackupWindow.vala.

164 {
165
166 var btn = new Gtk.Button();
167 btn.get_style_context().add_class("sidebar-button");
168 btn.hexpand = true;
169 btn.margin_start = 8;
170 btn.margin_end = 8;
171 btn.margin_top = 2;
172 btn.margin_bottom = 2;
173
174 var row = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 10);
175 row.margin_start = 8;
176 row.margin_end = 8;
177 row.margin_top = 8;
178 row.margin_bottom = 8;
179
180 var img = themed_icon(icon_name, 18);
181 var lbl = new Gtk.Label(label_text);
182 lbl.xalign = 0.0f;
183
184 row.append(img);
185 row.append(lbl);
186
187 btn.set_child(row);
188 sidebar.append(btn);
189
190 return btn;
191 }

References sidebar, and themed_icon().

Referenced by build_sidebar().

◆ on_close_request()

bool BackupWindow.on_close_request ( )
inlineprivate

Definition at line 293 of file BackupWindow.vala.

293 {
294 save_changes();
295 return false;
296 }

References save_changes().

Referenced by BackupWindow().

◆ reload_themed_icons()

void BackupWindow.reload_themed_icons ( )
inline

Definition at line 667 of file BackupWindow.vala.

667 {
668 for (int i = 0; i < themed_img_list.size; i++) {
669 var img = themed_img_list[i];
670 var name = themed_img_name[i];
671 var sz = themed_img_size[i];
672 var pix = IconManager.lookup(name, sz);
673 if (pix != null) {
674 img.set_from_pixbuf(pix);
675 } else {
676 img.set_from_icon_name(name);
677 }
678 }
679 }
Gee.ArrayList< string > themed_img_name
Gee.ArrayList< Gtk.Image > themed_img_list
Gee.ArrayList< int > themed_img_size

References IconManager.lookup(), themed_img_list, themed_img_name, and themed_img_size.

◆ request_close()

signal void BackupWindow.request_close ( )

Referenced by create_actions(), and initialize_tab().

◆ save_changes()

void BackupWindow.save_changes ( )
inlineprivate

Definition at line 298 of file BackupWindow.vala.

298 {
300 }
void cron_job_update()
Definition Main.vala:4463

References App, and Main.cron_job_update().

Referenced by create_actions(), and on_close_request().

◆ set_page()

void BackupWindow.set_page ( int page)
inlineprivate

Definition at line 624 of file BackupWindow.vala.

624 {
625 current_page = page;
626 switch (page) {
627 case Tabs.ESTIMATE:
628 page_stack.set_visible_child_name("estimate");
629 break;
630 case Tabs.BACKUP_DEVICE:
631 page_stack.set_visible_child_name("location");
632 break;
633 case Tabs.BACKUP:
634 page_stack.set_visible_child_name("backup");
635 break;
636 case Tabs.BACKUP_FINISH:
637 page_stack.set_visible_child_name("finish");
638 break;
639 }
640 }

References current_page, and page_stack.

Referenced by go_first(), go_next(), and go_prev().

◆ set_sidebar_active()

void BackupWindow.set_sidebar_active ( Gtk.Button btn)
inlineprivate

Definition at line 581 of file BackupWindow.vala.

581 {
582 btn.get_style_context().add_class("active-sidebar-button");
583 current_nav_btn = btn;
584 }
Gtk.? Button current_nav_btn

References current_nav_btn.

Referenced by update_sidebar_state().

◆ themed_icon()

Gtk.Image BackupWindow.themed_icon ( string icon_name,
int size )
inlineprivate

Definition at line 659 of file BackupWindow.vala.

659 {
660 var img = IconManager.lookup_image(icon_name, size);
661 themed_img_list.add(img);
662 themed_img_name.add(icon_name);
663 themed_img_size.add(size);
664 return img;
665 }

References IconManager.lookup_image(), themed_img_list, themed_img_name, and themed_img_size.

Referenced by build_sidebar(), and make_nav_button().

◆ update_page_title()

void BackupWindow.update_page_title ( )
inlineprivate

Definition at line 606 of file BackupWindow.vala.

606 {
607
608 switch (current_page) {
609 case Tabs.ESTIMATE:
610 lbl_page_title.label = _("Estimate");
611 break;
612 case Tabs.BACKUP_DEVICE:
613 lbl_page_title.label = _("Backup Location");
614 break;
615 case Tabs.BACKUP:
616 lbl_page_title.label = _("Create Snapshot");
617 break;
618 case Tabs.BACKUP_FINISH:
619 lbl_page_title.label = _("Finished");
620 break;
621 }
622 }

References _, and current_page.

Referenced by initialize_tab().

◆ update_sidebar_state()

void BackupWindow.update_sidebar_state ( )
inlineprivate

Definition at line 586 of file BackupWindow.vala.

586 {
587
589
590 switch (current_page) {
591 case Tabs.ESTIMATE:
593 break;
594 case Tabs.BACKUP_DEVICE:
596 break;
597 case Tabs.BACKUP:
599 break;
600 case Tabs.BACKUP_FINISH:
602 break;
603 }
604 }
void set_sidebar_active(Gtk.Button btn)
void clear_sidebar_selection()

References btn_nav_backup, btn_nav_estimate, btn_nav_finish, btn_nav_location, clear_sidebar_selection(), current_page, and set_sidebar_active().

Referenced by initialize_tab().

◆ validate_current_tab()

bool BackupWindow.validate_current_tab ( )
inlineprivate

Definition at line 557 of file BackupWindow.vala.

557 {
558
559 if (current_page == Tabs.BACKUP_DEVICE) {
560 if (!App.repo.available() || !App.repo.has_space()) {
561 gtk_messagebox(
564 this,
565 true
566 );
567 return false;
568 }
569 }
570
571 return true;
572 }

References App, SnapshotRepo.available(), current_page, SnapshotRepo.has_space(), Main.repo, SnapshotRepo.status_details, and SnapshotRepo.status_message.

Referenced by go_next().

◆ wrap_page()

Gtk.Widget BackupWindow.wrap_page ( Gtk.Widget child)
inlineprivate

Definition at line 232 of file BackupWindow.vala.

232 {
233 var card = new Gtk.Box(Gtk.Orientation.VERTICAL, 0);
234 card.get_style_context().add_class("card");
235 card.hexpand = true;
236 card.vexpand = true;
237 card.margin_start = 6;
238 card.margin_end = 6;
239 card.margin_top = 6;
240 card.margin_bottom = 6;
241 card.append(child);
242 return card;
243 }

Referenced by build_pages().

Member Data Documentation

◆ backup_box

BackupBox BackupWindow.backup_box
private

Definition at line 59 of file BackupWindow.vala.

Referenced by build_pages(), and initialize_tab().

◆ backup_dev_box

BackupDeviceBox BackupWindow.backup_dev_box
private

Definition at line 58 of file BackupWindow.vala.

Referenced by build_pages(), and initialize_tab().

◆ backup_finish_box

BackupFinishBox BackupWindow.backup_finish_box
private

Definition at line 60 of file BackupWindow.vala.

Referenced by build_pages(), and initialize_tab().

◆ bbox_action

Gtk.Box BackupWindow.bbox_action
private

Definition at line 43 of file BackupWindow.vala.

Referenced by create_actions().

◆ body_box

Gtk.Box BackupWindow.body_box
private

Definition at line 42 of file BackupWindow.vala.

Referenced by build_content().

◆ btn_cancel

Gtk.Button BackupWindow.btn_cancel
private

Definition at line 65 of file BackupWindow.vala.

Referenced by create_actions(), and initialize_tab().

◆ btn_close

Gtk.Button BackupWindow.btn_close
private

Definition at line 67 of file BackupWindow.vala.

Referenced by create_actions(), and initialize_tab().

◆ btn_nav_backup

Gtk.Button BackupWindow.btn_nav_backup
private

Definition at line 50 of file BackupWindow.vala.

Referenced by build_sidebar(), clear_sidebar_selection(), and update_sidebar_state().

◆ btn_nav_estimate

Gtk.Button BackupWindow.btn_nav_estimate
private

Definition at line 48 of file BackupWindow.vala.

Referenced by build_sidebar(), clear_sidebar_selection(), and update_sidebar_state().

◆ btn_nav_finish

Gtk.Button BackupWindow.btn_nav_finish
private

Definition at line 51 of file BackupWindow.vala.

Referenced by build_sidebar(), clear_sidebar_selection(), and update_sidebar_state().

◆ btn_nav_location

Gtk.Button BackupWindow.btn_nav_location
private

Definition at line 49 of file BackupWindow.vala.

Referenced by build_sidebar(), clear_sidebar_selection(), and update_sidebar_state().

◆ btn_next

Gtk.Button BackupWindow.btn_next
private

Definition at line 64 of file BackupWindow.vala.

Referenced by create_actions(), and initialize_tab().

◆ btn_pause

Gtk.Button BackupWindow.btn_pause
private

Definition at line 66 of file BackupWindow.vala.

Referenced by create_actions(), and initialize_tab().

◆ btn_prev

Gtk.Button BackupWindow.btn_prev
private

Definition at line 63 of file BackupWindow.vala.

Referenced by create_actions(), and initialize_tab().

◆ content_box

Gtk.Box BackupWindow.content_box
private

Definition at line 40 of file BackupWindow.vala.

Referenced by build_content(), build_ui(), and create_actions().

◆ current_nav_btn

Gtk.? Button BackupWindow.current_nav_btn = null
private

Definition at line 52 of file BackupWindow.vala.

Referenced by set_sidebar_active().

◆ current_page

int BackupWindow.current_page = -1
private

◆ def_height

int BackupWindow.def_height = 680
private

Definition at line 71 of file BackupWindow.vala.

Referenced by BackupWindow().

◆ def_width

int BackupWindow.def_width = 980
private

Definition at line 70 of file BackupWindow.vala.

Referenced by BackupWindow().

◆ embedded_mode

bool BackupWindow.embedded_mode = false
private

Definition at line 73 of file BackupWindow.vala.

Referenced by BackupWindow(), create_actions(), and initialize_tab().

◆ estimate_box

EstimateBox BackupWindow.estimate_box
private

Definition at line 57 of file BackupWindow.vala.

Referenced by build_pages(), and initialize_tab().

◆ header_box

Gtk.Box BackupWindow.header_box
private

Definition at line 41 of file BackupWindow.vala.

Referenced by build_content().

◆ lbl_page_title

Gtk.Label BackupWindow.lbl_page_title
private

Definition at line 54 of file BackupWindow.vala.

Referenced by build_content().

◆ page_stack

Gtk.Stack BackupWindow.page_stack
private

Definition at line 44 of file BackupWindow.vala.

Referenced by build_content(), build_pages(), and set_page().

◆ root_box

Gtk.Box BackupWindow.root_box
private

Definition at line 38 of file BackupWindow.vala.

Referenced by build_ui(), and detach_root_widget().

◆ sidebar

Gtk.Box BackupWindow.sidebar
private

Definition at line 39 of file BackupWindow.vala.

Referenced by build_sidebar(), build_ui(), and make_nav_button().

◆ success

bool BackupWindow.success = false
private

Definition at line 72 of file BackupWindow.vala.

Referenced by initialize_tab().

◆ themed_img_list

Gee.ArrayList<Gtk.Image> BackupWindow.themed_img_list = new Gee.ArrayList<Gtk.Image>()
private

Definition at line 655 of file BackupWindow.vala.

Referenced by reload_themed_icons(), and themed_icon().

◆ themed_img_name

Gee.ArrayList<string> BackupWindow.themed_img_name = new Gee.ArrayList<string>()
private

Definition at line 656 of file BackupWindow.vala.

Referenced by reload_themed_icons(), and themed_icon().

◆ themed_img_size

Gee.ArrayList<int> BackupWindow.themed_img_size = new Gee.ArrayList<int>()
private

Definition at line 657 of file BackupWindow.vala.

Referenced by reload_themed_icons(), and themed_icon().

◆ tmr_init

uint BackupWindow.tmr_init
private

Definition at line 69 of file BackupWindow.vala.

Referenced by BackupWindow(), and init_delayed().


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