/* RestoreFinishBox.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from RestoreFinishBox.vala, do not modify */

/*
 * RestoreFinishBox.vala
 *
 * Copyright 2012-2018 Tony George <teejeetech@gmail.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 * MA 02110-1301, USA.
 *
 *
 */

#include <gtk/gtk.h>
#include <glib-object.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.h>
#include <gee.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define TYPE_RESTORE_FINISH_BOX (restore_finish_box_get_type ())
#define RESTORE_FINISH_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_RESTORE_FINISH_BOX, RestoreFinishBox))
#define RESTORE_FINISH_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_RESTORE_FINISH_BOX, RestoreFinishBoxClass))
#define IS_RESTORE_FINISH_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_RESTORE_FINISH_BOX))
#define IS_RESTORE_FINISH_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_RESTORE_FINISH_BOX))
#define RESTORE_FINISH_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_RESTORE_FINISH_BOX, RestoreFinishBoxClass))

typedef struct _RestoreFinishBox RestoreFinishBox;
typedef struct _RestoreFinishBoxClass RestoreFinishBoxClass;
typedef struct _RestoreFinishBoxPrivate RestoreFinishBoxPrivate;
enum  {
	RESTORE_FINISH_BOX_0_PROPERTY,
	RESTORE_FINISH_BOX_NUM_PROPERTIES
};
static GParamSpec* restore_finish_box_properties[RESTORE_FINISH_BOX_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

#define TYPE_MAIN (main_get_type ())
#define MAIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MAIN, Main))
#define MAIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MAIN, MainClass))
#define IS_MAIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MAIN))
#define IS_MAIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MAIN))
#define MAIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MAIN, MainClass))

typedef struct _Main Main;
typedef struct _MainClass MainClass;
typedef struct _MainPrivate MainPrivate;

#define TYPE_DEVICE (device_get_type ())
#define DEVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DEVICE, Device))
#define DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DEVICE, DeviceClass))
#define IS_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DEVICE))
#define IS_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DEVICE))
#define DEVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DEVICE, DeviceClass))

typedef struct _Device Device;
typedef struct _DeviceClass DeviceClass;

#define TYPE_APP_EXCLUDE_ENTRY (app_exclude_entry_get_type ())
#define APP_EXCLUDE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_APP_EXCLUDE_ENTRY, AppExcludeEntry))
#define APP_EXCLUDE_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_APP_EXCLUDE_ENTRY, AppExcludeEntryClass))
#define IS_APP_EXCLUDE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_APP_EXCLUDE_ENTRY))
#define IS_APP_EXCLUDE_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_APP_EXCLUDE_ENTRY))
#define APP_EXCLUDE_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_APP_EXCLUDE_ENTRY, AppExcludeEntryClass))

typedef struct _AppExcludeEntry AppExcludeEntry;
typedef struct _AppExcludeEntryClass AppExcludeEntryClass;

#define TYPE_MOUNT_ENTRY (mount_entry_get_type ())
#define MOUNT_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MOUNT_ENTRY, MountEntry))
#define MOUNT_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MOUNT_ENTRY, MountEntryClass))
#define IS_MOUNT_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MOUNT_ENTRY))
#define IS_MOUNT_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MOUNT_ENTRY))
#define MOUNT_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MOUNT_ENTRY, MountEntryClass))

typedef struct _MountEntry MountEntry;
typedef struct _MountEntryClass MountEntryClass;

#define TYPE_SNAPSHOT_REPO (snapshot_repo_get_type ())
#define SNAPSHOT_REPO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SNAPSHOT_REPO, SnapshotRepo))
#define SNAPSHOT_REPO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SNAPSHOT_REPO, SnapshotRepoClass))
#define IS_SNAPSHOT_REPO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SNAPSHOT_REPO))
#define IS_SNAPSHOT_REPO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SNAPSHOT_REPO))
#define SNAPSHOT_REPO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SNAPSHOT_REPO, SnapshotRepoClass))

typedef struct _SnapshotRepo SnapshotRepo;
typedef struct _SnapshotRepoClass SnapshotRepoClass;

#define TYPE_SUBVOLUME (subvolume_get_type ())
#define SUBVOLUME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SUBVOLUME, Subvolume))
#define SUBVOLUME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SUBVOLUME, SubvolumeClass))
#define IS_SUBVOLUME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SUBVOLUME))
#define IS_SUBVOLUME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SUBVOLUME))
#define SUBVOLUME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SUBVOLUME, SubvolumeClass))

typedef struct _Subvolume Subvolume;
typedef struct _SubvolumeClass SubvolumeClass;

#define TYPE_LINUX_DISTRO (linux_distro_get_type ())
#define LINUX_DISTRO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_LINUX_DISTRO, LinuxDistro))
#define LINUX_DISTRO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_LINUX_DISTRO, LinuxDistroClass))
#define IS_LINUX_DISTRO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_LINUX_DISTRO))
#define IS_LINUX_DISTRO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_LINUX_DISTRO))
#define LINUX_DISTRO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_LINUX_DISTRO, LinuxDistroClass))

typedef struct _LinuxDistro LinuxDistro;
typedef struct _LinuxDistroClass LinuxDistroClass;

#define TYPE_APP_LOCK (app_lock_get_type ())
#define APP_LOCK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_APP_LOCK, AppLock))
#define APP_LOCK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_APP_LOCK, AppLockClass))
#define IS_APP_LOCK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_APP_LOCK))
#define IS_APP_LOCK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_APP_LOCK))
#define APP_LOCK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_APP_LOCK, AppLockClass))

typedef struct _AppLock AppLock;
typedef struct _AppLockClass AppLockClass;

#define TYPE_SNAPSHOT (snapshot_get_type ())
#define SNAPSHOT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SNAPSHOT, Snapshot))
#define SNAPSHOT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SNAPSHOT, SnapshotClass))
#define IS_SNAPSHOT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SNAPSHOT))
#define IS_SNAPSHOT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SNAPSHOT))
#define SNAPSHOT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SNAPSHOT, SnapshotClass))

typedef struct _Snapshot Snapshot;
typedef struct _SnapshotClass SnapshotClass;

#define TYPE_ASYNC_TASK (async_task_get_type ())
#define ASYNC_TASK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ASYNC_TASK, AsyncTask))
#define ASYNC_TASK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ASYNC_TASK, AsyncTaskClass))
#define IS_ASYNC_TASK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ASYNC_TASK))
#define IS_ASYNC_TASK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ASYNC_TASK))
#define ASYNC_TASK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ASYNC_TASK, AsyncTaskClass))

typedef struct _AsyncTask AsyncTask;
typedef struct _AsyncTaskClass AsyncTaskClass;

#define TYPE_RSYNC_TASK (rsync_task_get_type ())
#define RSYNC_TASK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_RSYNC_TASK, RsyncTask))
#define RSYNC_TASK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_RSYNC_TASK, RsyncTaskClass))
#define IS_RSYNC_TASK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_RSYNC_TASK))
#define IS_RSYNC_TASK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_RSYNC_TASK))
#define RSYNC_TASK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_RSYNC_TASK, RsyncTaskClass))

typedef struct _RsyncTask RsyncTask;
typedef struct _RsyncTaskClass RsyncTaskClass;

#define TYPE_DELETE_FILE_TASK (delete_file_task_get_type ())
#define DELETE_FILE_TASK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DELETE_FILE_TASK, DeleteFileTask))
#define DELETE_FILE_TASK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DELETE_FILE_TASK, DeleteFileTaskClass))
#define IS_DELETE_FILE_TASK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DELETE_FILE_TASK))
#define IS_DELETE_FILE_TASK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DELETE_FILE_TASK))
#define DELETE_FILE_TASK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DELETE_FILE_TASK, DeleteFileTaskClass))

typedef struct _DeleteFileTask DeleteFileTask;
typedef struct _DeleteFileTaskClass DeleteFileTaskClass;

#define TYPE_RSYNC_SPACE_CHECK_TASK (rsync_space_check_task_get_type ())
#define RSYNC_SPACE_CHECK_TASK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_RSYNC_SPACE_CHECK_TASK, RsyncSpaceCheckTask))
#define RSYNC_SPACE_CHECK_TASK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_RSYNC_SPACE_CHECK_TASK, RsyncSpaceCheckTaskClass))
#define IS_RSYNC_SPACE_CHECK_TASK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_RSYNC_SPACE_CHECK_TASK))
#define IS_RSYNC_SPACE_CHECK_TASK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_RSYNC_SPACE_CHECK_TASK))
#define RSYNC_SPACE_CHECK_TASK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_RSYNC_SPACE_CHECK_TASK, RsyncSpaceCheckTaskClass))

typedef struct _RsyncSpaceCheckTask RsyncSpaceCheckTask;
typedef struct _RsyncSpaceCheckTaskClass RsyncSpaceCheckTaskClass;

#define TYPE_SYSTEM_USER (system_user_get_type ())
#define SYSTEM_USER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SYSTEM_USER, SystemUser))
#define SYSTEM_USER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SYSTEM_USER, SystemUserClass))
#define IS_SYSTEM_USER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SYSTEM_USER))
#define IS_SYSTEM_USER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SYSTEM_USER))
#define SYSTEM_USER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SYSTEM_USER, SystemUserClass))

typedef struct _SystemUser SystemUser;
typedef struct _SystemUserClass SystemUserClass;

struct _RestoreFinishBox {
	GtkBox parent_instance;
	RestoreFinishBoxPrivate * priv;
};

struct _RestoreFinishBoxClass {
	GtkBoxClass parent_class;
};

struct _RestoreFinishBoxPrivate {
	GtkLabel* lbl_header;
	GtkLabel* lbl_message;
	GtkWindow* parent_window;
};

struct _Main {
	GObject parent_instance;
	MainPrivate * priv;
	gchar* app_path;
	gchar* share_folder;
	gchar* rsnapshot_conf_path;
	gchar* app_conf_path;
	gchar* app_conf_path_old;
	gchar* app_conf_path_default;
	gboolean first_run;
	gchar* backup_uuid;
	gchar* backup_parent_uuid;
	gboolean btrfs_mode;
	gboolean include_btrfs_home_for_backup;
	gboolean include_btrfs_home_for_restore;
	gboolean stop_cron_emails;
	GeeArrayList* partitions;
	GeeArrayList* exclude_list_user;
	GeeArrayList* exclude_list_default;
	GeeArrayList* exclude_list_default_extra;
	GeeArrayList* exclude_list_home;
	GeeArrayList* exclude_list_restore;
	GeeArrayList* exclude_list_apps;
	GeeArrayList* mount_list;
	GeeArrayList* exclude_app_names;
	SnapshotRepo* repo;
	Device* sys_root;
	Device* sys_boot;
	Device* sys_efi;
	Device* sys_home;
	GeeHashMap* sys_subvolumes;
	gchar* mount_point_restore;
	gchar* mount_point_app;
	LinuxDistro* current_distro;
	gboolean mirror_system;
	gboolean schedule_monthly;
	gboolean schedule_weekly;
	gboolean schedule_daily;
	gboolean schedule_hourly;
	gboolean schedule_boot;
	gint count_monthly;
	gint count_weekly;
	gint count_daily;
	gint count_hourly;
	gint count_boot;
	gchar* app_mode;
	gboolean dry_run;
	gboolean thr_success;
	gboolean thread_restore_running;
	gboolean thread_restore_success;
	gboolean thread_delete_running;
	gboolean thread_delete_success;
	gboolean thread_subvol_info_running;
	gboolean thread_subvol_info_success;
	gint thr_retval;
	gchar* thr_arg1;
	gboolean thr_timeout_active;
	gchar* thr_timeout_cmd;
	gint startup_delay_interval_mins;
	gint retain_snapshots_max_days;
	gchar* log_dir;
	gchar* log_file;
	AppLock* app_lock;
	gchar* date_format;
	GeeArrayList* delete_list;
	Snapshot* snapshot_to_delete;
	Snapshot* snapshot_to_restore;
	gboolean reinstall_grub2;
	gboolean update_initramfs;
	gboolean update_grub;
	gchar* grub_device;
	gboolean use_option_raw;
	gboolean cmd_skip_grub;
	gchar* cmd_grub_device;
	gchar* cmd_target_device;
	gchar* cmd_backup_device;
	gchar* cmd_snapshot;
	gboolean cmd_confirm;
	gboolean cmd_verbose;
	gboolean cmd_scripted;
	gchar* cmd_comments;
	gchar* cmd_tags;
	gboolean* cmd_btrfs_mode;
	gchar* progress_text;
	GtkWindow* parent_window;
	RsyncTask* task;
	DeleteFileTask* delete_file_task;
	RsyncSpaceCheckTask* space_check_task;
	GeeHashMap* current_system_users;
	gchar* users_with_encrypted_home;
	gchar* encrypted_home_dirs;
	gboolean encrypted_home_warning_shown;
	gchar* encrypted_private_dirs;
	gboolean encrypted_private_warning_shown;
};

struct _MainClass {
	GObjectClass parent_class;
};

static gint RestoreFinishBox_private_offset;
static gpointer restore_finish_box_parent_class = NULL;
VALA_EXTERN Main* App;

VALA_EXTERN GType restore_finish_box_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (RestoreFinishBox, g_object_unref)
VALA_EXTERN RestoreFinishBox* restore_finish_box_new (GtkWindow* _parent_window);
VALA_EXTERN RestoreFinishBox* restore_finish_box_construct (GType object_type,
                                                GtkWindow* _parent_window);
VALA_EXTERN void tee_jee_logging_log_debug (const gchar* message);
VALA_EXTERN GtkLabel* tee_jee_gtk_helper_add_label_header (GtkBox* box,
                                               const gchar* text,
                                               gboolean large_heading);
VALA_EXTERN GtkLabel* tee_jee_gtk_helper_add_label_scrolled (GtkBox* box,
                                                 const gchar* text,
                                                 gboolean show_border,
                                                 gboolean wrap,
                                                 gint ellipsize_chars);
VALA_EXTERN void restore_finish_box_update_message (RestoreFinishBox* self,
                                        gboolean success,
                                        const gchar* message_header,
                                        const gchar* message_body);
VALA_EXTERN GType main_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Main, g_object_unref)
VALA_EXTERN GType device_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Device, g_object_unref)
VALA_EXTERN GType app_exclude_entry_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (AppExcludeEntry, g_object_unref)
VALA_EXTERN GType mount_entry_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MountEntry, g_object_unref)
VALA_EXTERN GType snapshot_repo_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SnapshotRepo, g_object_unref)
VALA_EXTERN GType subvolume_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Subvolume, g_object_unref)
VALA_EXTERN GType linux_distro_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LinuxDistro, g_object_unref)
VALA_EXTERN GType app_lock_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (AppLock, g_object_unref)
VALA_EXTERN GType snapshot_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Snapshot, g_object_unref)
VALA_EXTERN GType async_task_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (AsyncTask, g_object_unref)
VALA_EXTERN GType rsync_task_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (RsyncTask, g_object_unref)
VALA_EXTERN GType delete_file_task_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DeleteFileTask, g_object_unref)
VALA_EXTERN GType rsync_space_check_task_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (RsyncSpaceCheckTask, g_object_unref)
VALA_EXTERN GType system_user_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SystemUser, g_object_unref)
VALA_EXTERN gchar* tee_jee_gtk_helper_format_text (const gchar* text,
                                       gboolean bold,
                                       gboolean italic,
                                       gboolean large);
VALA_EXTERN gboolean main_get_restore_current_system (Main* self);
static void restore_finish_box_finalize (GObject * obj);
static GType restore_finish_box_get_type_once (void);

static inline gpointer
restore_finish_box_get_instance_private (RestoreFinishBox* self)
{
	return G_STRUCT_MEMBER_P (self, RestoreFinishBox_private_offset);
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

RestoreFinishBox*
restore_finish_box_construct (GType object_type,
                              GtkWindow* _parent_window)
{
	RestoreFinishBox * self = NULL;
	GtkWindow* _tmp0_;
	GtkLabel* _tmp1_;
	GtkLabel* _tmp2_;
	g_return_val_if_fail (_parent_window != NULL, NULL);
	tee_jee_logging_log_debug ("RestoreFinishBox: RestoreFinishBox()");
	self = (RestoreFinishBox*) g_object_new (object_type, "orientation", GTK_ORIENTATION_VERTICAL, "spacing", 6, NULL);
	_tmp0_ = _g_object_ref0 (_parent_window);
	_g_object_unref0 (self->priv->parent_window);
	self->priv->parent_window = _tmp0_;
	g_object_set ((GtkWidget*) self, "margin", 12, NULL);
	_tmp1_ = tee_jee_gtk_helper_add_label_header ((GtkBox*) self, _ ("Completed"), TRUE);
	_g_object_unref0 (self->priv->lbl_header);
	self->priv->lbl_header = _tmp1_;
	_tmp2_ = tee_jee_gtk_helper_add_label_scrolled ((GtkBox*) self, "", FALSE, TRUE, 0);
	_g_object_unref0 (self->priv->lbl_message);
	self->priv->lbl_message = _tmp2_;
	tee_jee_logging_log_debug ("RestoreFinishBox: RestoreFinishBox(): exit");
	return self;
}

RestoreFinishBox*
restore_finish_box_new (GtkWindow* _parent_window)
{
	return restore_finish_box_construct (TYPE_RESTORE_FINISH_BOX, _parent_window);
}

void
restore_finish_box_update_message (RestoreFinishBox* self,
                                   gboolean success,
                                   const gchar* message_header,
                                   const gchar* message_body)
{
	gchar* txt = NULL;
	gchar* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	GtkLabel* _tmp15_;
	const gchar* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	gchar* msg = NULL;
	gchar* _tmp19_;
	gint _tmp20_;
	gint _tmp21_;
	GtkLabel* _tmp61_;
	const gchar* _tmp62_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (message_header != NULL);
	g_return_if_fail (message_body != NULL);
	_tmp0_ = g_strdup ("");
	txt = _tmp0_;
	_tmp1_ = strlen (message_header);
	_tmp2_ = _tmp1_;
	if (_tmp2_ > 0) {
		gchar* _tmp3_;
		_tmp3_ = g_strdup (message_header);
		_g_free0 (txt);
		txt = _tmp3_;
	} else {
		Main* _tmp4_;
		_tmp4_ = App;
		if (_tmp4_->mirror_system) {
			gchar* _tmp5_;
			_tmp5_ = g_strdup (_ ("Cloning"));
			_g_free0 (txt);
			txt = _tmp5_;
		} else {
			gchar* _tmp6_;
			_tmp6_ = g_strdup (_ ("Restore"));
			_g_free0 (txt);
			txt = _tmp6_;
		}
		if (success) {
			const gchar* _tmp7_;
			gchar* _tmp8_;
			gchar* _tmp9_;
			gchar* _tmp10_;
			_tmp7_ = txt;
			_tmp8_ = g_strconcat (" ", _ ("Completed"), NULL);
			_tmp9_ = _tmp8_;
			_tmp10_ = g_strconcat (_tmp7_, _tmp9_, NULL);
			_g_free0 (txt);
			txt = _tmp10_;
			_g_free0 (_tmp9_);
		} else {
			const gchar* _tmp11_;
			gchar* _tmp12_;
			gchar* _tmp13_;
			gchar* _tmp14_;
			_tmp11_ = txt;
			_tmp12_ = g_strconcat (" ", _ ("Completed With Errors"), NULL);
			_tmp13_ = _tmp12_;
			_tmp14_ = g_strconcat (_tmp11_, _tmp13_, NULL);
			_g_free0 (txt);
			txt = _tmp14_;
			_g_free0 (_tmp13_);
		}
	}
	_tmp15_ = self->priv->lbl_header;
	_tmp16_ = txt;
	_tmp17_ = tee_jee_gtk_helper_format_text (_tmp16_, TRUE, FALSE, TRUE);
	_tmp18_ = _tmp17_;
	gtk_label_set_label (_tmp15_, _tmp18_);
	_g_free0 (_tmp18_);
	_tmp19_ = g_strdup ("");
	msg = _tmp19_;
	_tmp20_ = strlen (message_body);
	_tmp21_ = _tmp20_;
	if (_tmp21_ > 0) {
		gchar* _tmp22_;
		_tmp22_ = g_strdup (message_body);
		_g_free0 (msg);
		msg = _tmp22_;
	} else {
		gchar* bullet = NULL;
		gchar* _tmp23_;
		gboolean _tmp24_ = FALSE;
		Main* _tmp25_;
		Main* _tmp45_;
		const gchar* _tmp53_;
		gchar* _tmp54_;
		const gchar* _tmp55_;
		gchar* _tmp56_;
		gchar* _tmp57_;
		gchar* _tmp58_;
		gchar* _tmp59_;
		gchar* _tmp60_;
		_tmp23_ = g_strdup ("• ");
		bullet = _tmp23_;
		_tmp25_ = App;
		if (_tmp25_->btrfs_mode) {
			Main* _tmp26_;
			gboolean _tmp27_;
			gboolean _tmp28_;
			_tmp26_ = App;
			_tmp27_ = main_get_restore_current_system (_tmp26_);
			_tmp28_ = _tmp27_;
			_tmp24_ = _tmp28_;
		} else {
			_tmp24_ = FALSE;
		}
		if (_tmp24_) {
			const gchar* _tmp29_;
			const gchar* _tmp30_;
			gchar* _tmp31_;
			gchar* _tmp32_;
			gchar* _tmp33_;
			gchar* _tmp34_;
			gchar* _tmp35_;
			const gchar* _tmp36_;
			gchar* _tmp37_;
			const gchar* _tmp38_;
			const gchar* _tmp39_;
			gchar* _tmp40_;
			gchar* _tmp41_;
			gchar* _tmp42_;
			gchar* _tmp43_;
			gchar* _tmp44_;
			_tmp29_ = msg;
			_tmp30_ = bullet;
			_tmp31_ = g_strconcat (_tmp30_, _ ("Restored subvolumes will become active after system is restarted."), NULL);
			_tmp32_ = _tmp31_;
			_tmp33_ = g_strconcat (_tmp32_, "\n", NULL);
			_tmp34_ = _tmp33_;
			_tmp35_ = g_strconcat (_tmp29_, _tmp34_, NULL);
			_g_free0 (msg);
			msg = _tmp35_;
			_g_free0 (_tmp34_);
			_g_free0 (_tmp32_);
			_tmp36_ = msg;
			_tmp37_ = g_strconcat (_tmp36_, "\n", NULL);
			_g_free0 (msg);
			msg = _tmp37_;
			_tmp38_ = msg;
			_tmp39_ = bullet;
			_tmp40_ = g_strconcat (_tmp39_, _ ("You can continue working on the current system. After restart, the cur" \
"rent system will be visible as a new snapshot. This snapshot can be re" \
"stored later if required, to 'undo' the restore."), NULL);
			_tmp41_ = _tmp40_;
			_tmp42_ = g_strconcat (_tmp41_, "\n", NULL);
			_tmp43_ = _tmp42_;
			_tmp44_ = g_strconcat (_tmp38_, _tmp43_, NULL);
			_g_free0 (msg);
			msg = _tmp44_;
			_g_free0 (_tmp43_);
			_g_free0 (_tmp41_);
		}
		_tmp45_ = App;
		if (!_tmp45_->btrfs_mode) {
			const gchar* _tmp46_;
			const gchar* _tmp47_;
			gchar* _tmp48_;
			gchar* _tmp49_;
			gchar* _tmp50_;
			gchar* _tmp51_;
			gchar* _tmp52_;
			_tmp46_ = msg;
			_tmp47_ = bullet;
			_tmp48_ = g_strconcat (_tmp47_, _ ("If the restored system fails to boot, then boot from the Live CD/USB, " \
"install Timeshift, and try restoring another snapshot."), NULL);
			_tmp49_ = _tmp48_;
			_tmp50_ = g_strconcat (_tmp49_, "\n\n", NULL);
			_tmp51_ = _tmp50_;
			_tmp52_ = g_strconcat (_tmp46_, _tmp51_, NULL);
			_g_free0 (msg);
			msg = _tmp52_;
			_g_free0 (_tmp51_);
			_g_free0 (_tmp49_);
		}
		_tmp53_ = msg;
		_tmp54_ = g_strconcat (_tmp53_, "\n", NULL);
		_g_free0 (msg);
		msg = _tmp54_;
		_tmp55_ = msg;
		_tmp56_ = g_strconcat ("<b>", _ ("Close window to exit"), NULL);
		_tmp57_ = _tmp56_;
		_tmp58_ = g_strconcat (_tmp57_, "</b>\n\n", NULL);
		_tmp59_ = _tmp58_;
		_tmp60_ = g_strconcat (_tmp55_, _tmp59_, NULL);
		_g_free0 (msg);
		msg = _tmp60_;
		_g_free0 (_tmp59_);
		_g_free0 (_tmp57_);
		_g_free0 (bullet);
	}
	_tmp61_ = self->priv->lbl_message;
	_tmp62_ = msg;
	gtk_label_set_label (_tmp61_, _tmp62_);
	_g_free0 (msg);
	_g_free0 (txt);
}

static void
restore_finish_box_class_init (RestoreFinishBoxClass * klass,
                               gpointer klass_data)
{
	restore_finish_box_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &RestoreFinishBox_private_offset);
	G_OBJECT_CLASS (klass)->finalize = restore_finish_box_finalize;
}

static void
restore_finish_box_instance_init (RestoreFinishBox * self,
                                  gpointer klass)
{
	self->priv = restore_finish_box_get_instance_private (self);
}

static void
restore_finish_box_finalize (GObject * obj)
{
	RestoreFinishBox * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_RESTORE_FINISH_BOX, RestoreFinishBox);
	_g_object_unref0 (self->priv->lbl_header);
	_g_object_unref0 (self->priv->lbl_message);
	_g_object_unref0 (self->priv->parent_window);
	G_OBJECT_CLASS (restore_finish_box_parent_class)->finalize (obj);
}

static GType
restore_finish_box_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (RestoreFinishBoxClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) restore_finish_box_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RestoreFinishBox), 0, (GInstanceInitFunc) restore_finish_box_instance_init, NULL };
	GType restore_finish_box_type_id;
	restore_finish_box_type_id = g_type_register_static (gtk_box_get_type (), "RestoreFinishBox", &g_define_type_info, 0);
	RestoreFinishBox_private_offset = g_type_add_instance_private (restore_finish_box_type_id, sizeof (RestoreFinishBoxPrivate));
	return restore_finish_box_type_id;
}

GType
restore_finish_box_get_type (void)
{
	static volatile gsize restore_finish_box_type_id__once = 0;
	if (g_once_init_enter (&restore_finish_box_type_id__once)) {
		GType restore_finish_box_type_id;
		restore_finish_box_type_id = restore_finish_box_get_type_once ();
		g_once_init_leave (&restore_finish_box_type_id__once, restore_finish_box_type_id);
	}
	return restore_finish_box_type_id__once;
}

