78 log_debug(
"BackupWindow: BackupWindow()");
80 this.title =
_(
"Create Snapshot");
84 this.set_icon_name(
"bastionguard-backup");
98 log_debug(
"BackupWindow: BackupWindow(): exit");
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;
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;
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);
131 Gtk.Widget logo_widget;
133 logo_widget =
new Gtk.Image.from_pixbuf(
IconManager.
lookup(
"bastionguard-backup", 48));
136 logo_widget =
themed_icon(
"document-save-symbolic", 48);
139 var title =
new Gtk.Label(
_(
"BastionGuard™\nBackup"));
141 title.get_style_context().add_class(
"sidebar-title");
143 sidebar_header.append(logo_widget);
144 sidebar_header.append(title);
146 sidebar.append(
new Gtk.Box(Gtk.Orientation.VERTICAL, 0));
154 btn_nav_estimate.sensitive =
false;
155 btn_nav_location.sensitive =
false;
156 btn_nav_backup.sensitive =
false;
157 btn_nav_finish.sensitive =
false;
159 var spacer =
new Gtk.Box(Gtk.Orientation.VERTICAL, 0);
160 spacer.vexpand =
true;
166 var btn =
new Gtk.Button();
167 btn.get_style_context().add_class(
"sidebar-button");
169 btn.margin_start = 8;
172 btn.margin_bottom = 2;
174 var row =
new Gtk.Box(Gtk.Orientation.HORIZONTAL, 10);
175 row.margin_start = 8;
178 row.margin_bottom = 8;
181 var lbl =
new Gtk.Label(label_text);
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;
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;
209 lbl_page_title.xalign = 0.0f;
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;
221 page_stack.hexpand =
true;
222 page_stack.vexpand =
true;
223 page_stack.halign = Gtk.Align.FILL;
224 page_stack.valign = Gtk.Align.FILL;
233 var card =
new Gtk.Box(Gtk.Orientation.VERTICAL, 0);
234 card.get_style_context().add_class(
"card");
237 card.margin_start = 6;
240 card.margin_bottom = 6;
249 label =
new Gtk.Label(
_(
"Estimate"));
251 estimate_box.margin_start = 12;
252 estimate_box.margin_end = 12;
253 estimate_box.margin_top = 12;
254 estimate_box.margin_bottom = 12;
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;
265 label =
new Gtk.Label(
_(
"Backup"));
267 backup_box.margin_start = 12;
268 backup_box.margin_end = 12;
269 backup_box.margin_top = 12;
270 backup_box.margin_bottom = 12;
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;
304 var hbox =
new Gtk.Box(Gtk.Orientation.HORIZONTAL, 6);
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;
319 bbox.halign = Gtk.Align.CENTER;
322 Gtk.SizeGroup size_group =
null;
324 btn_prev = add_button(bbox,
_(
"Previous"),
"", size_group,
null);
325 btn_prev.get_style_context().add_class(
"btn-back");
330 btn_next = add_button(bbox,
_(
"Next"),
"", size_group,
null);
331 btn_next.get_style_context().add_class(
"btn-next");
336 btn_close = add_button(bbox,
_(
"Close"),
"", size_group,
null);
337 btn_close.get_style_context().add_class(
"btn-finish");
346 btn_cancel = add_button(bbox,
_(
"Cancel"),
"", size_group,
null);
347 btn_cancel.get_style_context().add_class(
"btn-cancel");
358 btn_pause = add_button(bbox,
_(
"Pause"),
"", size_group,
null);
364 this.btn_pause.set_label(
_(
"Pause"));
368 this.backup_box.
pause();
369 this.btn_pause.set_label(
_(
"Resume"));
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;
414 case Tabs.BACKUP_DEVICE:
429 case Tabs.BACKUP_FINISH:
447 case Tabs.BACKUP_DEVICE:
455 case Tabs.BACKUP_FINISH:
491 case Tabs.BACKUP_DEVICE:
498 btn_prev.sensitive =
false;
499 btn_next.sensitive =
true;
500 btn_close.sensitive =
true;
503 case Tabs.BACKUP_FINISH:
507 btn_close.sensitive =
true;
521 case Tabs.BACKUP_DEVICE:
535 case Tabs.BACKUP_FINISH:
577 btn_nav_backup.get_style_context().remove_class(
"active-sidebar-button");
578 btn_nav_finish.get_style_context().remove_class(
"active-sidebar-button");
582 btn.get_style_context().add_class(
"active-sidebar-button");
594 case Tabs.BACKUP_DEVICE:
600 case Tabs.BACKUP_FINISH:
610 lbl_page_title.label =
_(
"Estimate");
612 case Tabs.BACKUP_DEVICE:
613 lbl_page_title.label =
_(
"Backup Location");
616 lbl_page_title.label =
_(
"Create Snapshot");
618 case Tabs.BACKUP_FINISH:
619 lbl_page_title.label =
_(
"Finished");
628 page_stack.set_visible_child_name(
"estimate");
630 case Tabs.BACKUP_DEVICE:
631 page_stack.set_visible_child_name(
"location");
636 case Tabs.BACKUP_FINISH:
674 img.set_from_pixbuf(pix);
676 img.set_from_icon_name(name);
void pause(AppStatus status_to_update=AppStatus.PAUSED)
void stop(AppStatus status_to_update=AppStatus.CANCELLED)
void resume(AppStatus status_to_update=AppStatus.RUNNING)
BackupBox(Gtk.Window _parent_window)
BackupDeviceBox(Gtk.Window _parent_window)
BackupFinishBox(Gtk.Window _parent_window)
void update_message(bool success)
Gtk.Widget wrap_page(Gtk.Widget child)
Gtk.Button btn_nav_finish
Gtk.Button btn_nav_backup
Gtk.Button make_nav_button(string icon_name, string label_text)
BackupWindow(bool embedded=false)
Gtk.? Button current_nav_btn
Gee.ArrayList< string > themed_img_name
void set_sidebar_active(Gtk.Button btn)
Gee.ArrayList< Gtk.Image > themed_img_list
void reload_themed_icons()
Gtk.Button btn_nav_estimate
Gee.ArrayList< int > themed_img_size
BackupFinishBox backup_finish_box
BackupDeviceBox backup_dev_box
bool validate_current_tab()
Gtk.Widget detach_root_widget()
signal void request_close()
Gtk.Image themed_icon(string icon_name, int size)
void clear_sidebar_selection()
void action_buttons_set_initial_visibility(bool visible)
Gtk.Button btn_nav_location
void update_sidebar_state()
void estimate_system_size()
EstimateBox(Gtk.Window _parent_window)
static Gdk.? Pixbuf lookup(string icon_name, int icon_size, bool symbolic=false, bool use_hardcoded=false, int scale=1)
static Gtk.Image lookup_image(string icon_name, int icon_size, bool symbolic=false, bool use_hardcoded=false)
static uint64 first_snapshot_size
bool has_space(uint64 needed=0)
SnapshotLocationStatus status_code
void wait_and_close_window(int milliseconds, Gtk.Window window)
void log_debug(string message)
void log_msg(string message, bool highlight=false)