87 log_debug(
"RestoreWindow: RestoreWindow()");
89 this.title = App.mirror_system ?
_(
"Clone System") :
_(
"Restore Snapshot");
93 this.set_icon_name(
"bastionguard-backup");
109 log_debug(
"RestoreWindow: RestoreWindow(): exit");
114 root_box =
new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0);
115 root_box.hexpand =
true;
116 root_box.vexpand =
true;
117 root_box.halign = Gtk.Align.FILL;
118 root_box.valign = Gtk.Align.FILL;
130 sidebar =
new Gtk.Box(Gtk.Orientation.VERTICAL, 0);
131 sidebar.set_size_request(220, -1);
132 sidebar.get_style_context().add_class(
"sidebar");
133 sidebar.hexpand =
false;
134 sidebar.vexpand =
true;
135 sidebar.halign = Gtk.Align.FILL;
136 sidebar.valign = Gtk.Align.FILL;
138 var sidebar_header =
new Gtk.Box(Gtk.Orientation.HORIZONTAL, 8);
139 sidebar_header.get_style_context().add_class(
"sidebar-header");
140 sidebar.append(sidebar_header);
142 Gtk.Widget logo_widget;
144 logo_widget =
new Gtk.Image.from_pixbuf(
IconManager.
lookup(
"bastionguard-backup", 48));
147 logo_widget =
themed_icon(
"document-open-recent-symbolic", 48);
150 var title =
new Gtk.Label(
_(
"BastionGuard™\nRestore"));
152 title.get_style_context().add_class(
"sidebar-title");
154 sidebar_header.append(logo_widget);
155 sidebar_header.append(title);
157 sidebar.append(
new Gtk.Box(Gtk.Orientation.VERTICAL, 0));
167 btn_nav_target.sensitive =
false;
168 btn_nav_check.sensitive =
false;
169 btn_nav_log.sensitive =
false;
170 btn_nav_users.sensitive =
false;
171 btn_nav_summary.sensitive =
false;
172 btn_nav_restore.sensitive =
false;
173 btn_nav_finish.sensitive =
false;
175 var spacer =
new Gtk.Box(Gtk.Orientation.VERTICAL, 0);
176 spacer.vexpand =
true;
182 var btn =
new Gtk.Button();
183 btn.get_style_context().add_class(
"sidebar-button");
185 btn.margin_start = 8;
188 btn.margin_bottom = 2;
190 var row =
new Gtk.Box(Gtk.Orientation.HORIZONTAL, 10);
191 row.margin_start = 8;
194 row.margin_bottom = 8;
197 var lbl =
new Gtk.Label(label_text);
211 content_box =
new Gtk.Box(Gtk.Orientation.VERTICAL, 0);
212 content_box.get_style_context().add_class(
"content");
213 content_box.hexpand =
true;
214 content_box.vexpand =
true;
215 content_box.halign = Gtk.Align.FILL;
216 content_box.valign = Gtk.Align.FILL;
218 header_box =
new Gtk.Box(Gtk.Orientation.VERTICAL, 0);
219 header_box.margin_start = 20;
220 header_box.margin_end = 20;
221 header_box.margin_top = 20;
222 header_box.margin_bottom = 10;
225 lbl_page_title.xalign = 0.0f;
229 body_box =
new Gtk.Box(Gtk.Orientation.VERTICAL, 0);
230 body_box.margin_start = 14;
231 body_box.margin_end = 14;
232 body_box.margin_bottom = 12;
233 body_box.hexpand =
true;
234 body_box.vexpand =
true;
237 page_stack.hexpand =
true;
238 page_stack.vexpand =
true;
239 page_stack.halign = Gtk.Align.FILL;
240 page_stack.valign = Gtk.Align.FILL;
249 var card =
new Gtk.Box(Gtk.Orientation.VERTICAL, 0);
250 card.get_style_context().add_class(
"card");
253 card.margin_start = 6;
256 card.margin_bottom = 6;
265 label =
new Gtk.Label(
_(
"Restore Device"));
267 restore_device_box.margin_start = 12;
268 restore_device_box.margin_end = 12;
269 restore_device_box.margin_top = 12;
270 restore_device_box.margin_bottom = 12;
273 label =
new Gtk.Label(
_(
"Restore Exclude"));
275 restore_exclude_box.margin_start = 12;
276 restore_exclude_box.margin_end = 12;
277 restore_exclude_box.margin_top = 12;
278 restore_exclude_box.margin_bottom = 12;
281 label =
new Gtk.Label(
_(
"Exclude Apps"));
283 exclude_apps_box.margin_start = 12;
284 exclude_apps_box.margin_end = 12;
285 exclude_apps_box.margin_top = 12;
286 exclude_apps_box.margin_bottom = 12;
289 label =
new Gtk.Label(
_(
"Checking Restore Actions (Dry Run)"));
291 check_box.margin_start = 0;
292 check_box.margin_end = 0;
293 check_box.margin_top = 0;
294 check_box.margin_bottom = 0;
297 label =
new Gtk.Label(
_(
"Confirm Actions"));
299 log_box.margin_start = 12;
300 log_box.margin_end = 12;
301 log_box.margin_top = 12;
302 log_box.margin_bottom = 12;
305 label =
new Gtk.Label(
_(
"Users Home"));
308 users_box.margin_start = 12;
309 users_box.margin_end = 12;
310 users_box.margin_top = 12;
311 users_box.margin_bottom = 12;
314 label =
new Gtk.Label(
_(
"Summary"));
316 summary_box.margin_start = 12;
317 summary_box.margin_end = 12;
318 summary_box.margin_top = 12;
319 summary_box.margin_bottom = 12;
322 label =
new Gtk.Label(
_(
"Restore"));
324 restore_box.margin_start = 0;
325 restore_box.margin_end = 0;
326 restore_box.margin_top = 0;
327 restore_box.margin_bottom = 0;
330 label =
new Gtk.Label(
_(
"Finished"));
332 restore_finish_box.margin_start = 12;
333 restore_finish_box.margin_end = 12;
334 restore_finish_box.margin_top = 12;
335 restore_finish_box.margin_bottom = 12;
363 var hbox =
new Gtk.Box(Gtk.Orientation.HORIZONTAL, 6);
366 var bbox =
new Gtk.Box(Gtk.Orientation.HORIZONTAL, 8);
367 bbox.margin_start = 12;
368 bbox.margin_end = 12;
369 bbox.margin_top = 12;
370 bbox.margin_bottom = 12;
378 bbox.halign = Gtk.Align.CENTER;
381 Gtk.SizeGroup size_group =
null;
383 btn_prev = add_button(bbox,
_(
"Previous"),
"", size_group,
null);
384 btn_prev.get_style_context().add_class(
"btn-back");
389 btn_next = add_button(bbox,
_(
"Next"),
"", size_group,
null);
390 btn_next.get_style_context().add_class(
"btn-next");
398 btn_close = add_button(bbox,
_(
"Cancel"),
"", size_group,
null);
399 btn_close.get_style_context().add_class(
"btn-cancel");
400 btn_close.get_style_context().add_class(
"btn-finish");
409 btn_cancel = add_button(bbox,
_(
"Cancel"),
"", size_group,
null);
410 btn_cancel.get_style_context().add_class(
"btn-cancel");
414 var title =
_(
"Cancel restore?");
415 var msg =
_(
"Cancelling the restore process will leave the target system in an inconsistent state. The system may fail to boot or you may run into various issues. After cancelling, you need to restore another snapshot, to bring the system to a consistent state. Click Yes to confirm.");
417 var dlg =
new CustomMessageDialog(title, msg, Gtk.MessageType.ERROR,
this, Gtk.ButtonsType.YES_NO);
421 if (response != Gtk.ResponseType.YES) {
436 btn_prev.hexpand =
true;
437 btn_next.hexpand =
true;
438 btn_cancel.hexpand =
true;
439 btn_close.hexpand =
true;
445 btn_prev.visible = visible;
446 btn_next.visible = visible;
447 btn_close.visible = visible;
448 btn_cancel.visible = visible;
473 case Tabs.RESTORE_EXCLUDE:
477 case Tabs.EXCLUDE_APPS:
501 case Tabs.TARGET_DEVICE:
517 case Tabs.TARGET_DEVICE:
572 btn_cancel.sensitive =
true;
575 case Tabs.TARGET_DEVICE:
576 case Tabs.RESTORE_EXCLUDE:
577 case Tabs.EXCLUDE_APPS:
586 btn_prev.sensitive =
false;
587 btn_next.sensitive =
true;
588 btn_close.sensitive =
true;
597 btn_prev.sensitive =
false;
598 btn_next.sensitive =
false;
599 btn_close.sensitive =
true;
606 case Tabs.TARGET_DEVICE:
610 case Tabs.RESTORE_EXCLUDE:
614 case Tabs.EXCLUDE_APPS:
652 btn_close.label =
_(
"Close");
684 btn_nav_target.get_style_context().remove_class(
"active-sidebar-button");
685 btn_nav_check.get_style_context().remove_class(
"active-sidebar-button");
686 btn_nav_log.get_style_context().remove_class(
"active-sidebar-button");
687 btn_nav_users.get_style_context().remove_class(
"active-sidebar-button");
688 btn_nav_summary.get_style_context().remove_class(
"active-sidebar-button");
689 btn_nav_restore.get_style_context().remove_class(
"active-sidebar-button");
690 btn_nav_finish.get_style_context().remove_class(
"active-sidebar-button");
694 btn.get_style_context().add_class(
"active-sidebar-button");
703 case Tabs.TARGET_DEVICE:
730 case Tabs.TARGET_DEVICE:
731 lbl_page_title.label =
_(
"Select Restore Device");
733 case Tabs.RESTORE_EXCLUDE:
734 lbl_page_title.label =
_(
"Restore Exclude");
736 case Tabs.EXCLUDE_APPS:
737 lbl_page_title.label =
_(
"Exclude Apps");
740 lbl_page_title.label =
_(
"Checking Restore Actions");
743 lbl_page_title.label =
_(
"Review Log");
746 lbl_page_title.label =
_(
"Users Home");
749 lbl_page_title.label =
_(
"Summary");
752 lbl_page_title.label = App.mirror_system ?
_(
"Cloning System") :
_(
"Restoring Snapshot");
755 lbl_page_title.label =
_(
"Finished");
763 case Tabs.TARGET_DEVICE:
764 page_stack.set_visible_child_name(
"target-device");
766 case Tabs.RESTORE_EXCLUDE:
767 page_stack.set_visible_child_name(
"restore-exclude");
769 case Tabs.EXCLUDE_APPS:
770 page_stack.set_visible_child_name(
"exclude-apps");
776 page_stack.set_visible_child_name(
"show-log");
831 img.set_from_pixbuf(pix);
833 img.set_from_icon_name(name);
void stop(AppStatus status_to_update=AppStatus.CANCELLED)
CustomMessageDialog(string _msg_title, string _msg_body, Gtk.MessageType _msg_type, Window? parent, Gtk.ButtonsType _buttons_type)
ExcludeAppsBox(Gtk.Window _parent_window)
ExcludeBox(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)
Snapshot snapshot_to_restore
void add_app_exclude_entries()
void save_exclude_list_selections()
RestoreBox(Gtk.Window _parent_window)
RestoreDeviceBox(Gtk.Window _parent_window)
void refresh(bool reset_device_selections=true)
bool check_and_mount_devices()
RestoreExcludeBox(Gtk.Window _parent_window)
RestoreFinishBox(Gtk.Window _parent_window)
void update_message(bool success, string message_header, string message_body)
RestoreSummaryBox(Gtk.Window _parent_window)
void update_sidebar_state()
void action_buttons_set_initial_visibility(bool visible)
Gee.ArrayList< string > themed_img_name
RestoreSummaryBox summary_box
Gtk.? Button current_nav_btn
Gee.ArrayList< Gtk.Image > themed_img_list
Gtk.Widget detach_root_widget()
Gee.ArrayList< int > themed_img_size
void reload_themed_icons()
void set_sidebar_active(Gtk.Button btn)
void clear_sidebar_selection()
RestoreDeviceBox restore_device_box
Gtk.Button btn_nav_target
RestoreFinishBox restore_finish_box
Gtk.Widget wrap_page(Gtk.Widget child)
RestoreExcludeBox restore_exclude_box
Gtk.Button btn_nav_restore
signal void request_close()
Gtk.Button btn_nav_summary
Gtk.Button btn_nav_finish
ExcludeAppsBox exclude_apps_box
Gtk.Button make_nav_button(string icon_name, string label_text)
Gtk.Image themed_icon(string icon_name, int size)
bool validate_current_tab()
RestoreWindow(bool embedded=false)
bool check_before_restore
void open_log(string _rsync_log_file)
RsyncLogBox(Gtk.Window _window)
Gee.HashMap< string, Subvolume > subvolumes
string rsync_restore_log_file
UsersBox(Gtk.Window _parent_window, ExcludeBox _exclude_box, bool _restore_mode)
bool file_exists(string file_path)
void gtk_set_busy(bool busy, Gtk.Window win)
int gtk_dialog_run(Gtk.Dialog dlg)
void log_debug(string message)