/* ConfigLabelDescription.c generated by valac 0.30.2, the Vala compiler
 * generated from ConfigLabelDescription.vala, do not modify */

/* -*- Mode: Vala; indent-tabs-mode: nil; tab-width: 2 -*- */
/*
    This file is part of Déjà Dup.
    For copyright information, see AUTHORS.

    Déjà Dup 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 3 of the License, or
    (at your option) any later version.

    Déjà Dup 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 Déjà Dup.  If not, see <http://www.gnu.org/licenses/>.
*/

#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <gio/gio.h>
#include "deja.h"
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.h>


#define DEJA_DUP_TYPE_CONFIG_WIDGET (deja_dup_config_widget_get_type ())
#define DEJA_DUP_CONFIG_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DEJA_DUP_TYPE_CONFIG_WIDGET, DejaDupConfigWidget))
#define DEJA_DUP_CONFIG_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DEJA_DUP_TYPE_CONFIG_WIDGET, DejaDupConfigWidgetClass))
#define DEJA_DUP_IS_CONFIG_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DEJA_DUP_TYPE_CONFIG_WIDGET))
#define DEJA_DUP_IS_CONFIG_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DEJA_DUP_TYPE_CONFIG_WIDGET))
#define DEJA_DUP_CONFIG_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DEJA_DUP_TYPE_CONFIG_WIDGET, DejaDupConfigWidgetClass))

typedef struct _DejaDupConfigWidget DejaDupConfigWidget;
typedef struct _DejaDupConfigWidgetClass DejaDupConfigWidgetClass;
typedef struct _DejaDupConfigWidgetPrivate DejaDupConfigWidgetPrivate;

#define DEJA_DUP_TYPE_CONFIG_LABEL (deja_dup_config_label_get_type ())
#define DEJA_DUP_CONFIG_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DEJA_DUP_TYPE_CONFIG_LABEL, DejaDupConfigLabel))
#define DEJA_DUP_CONFIG_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DEJA_DUP_TYPE_CONFIG_LABEL, DejaDupConfigLabelClass))
#define DEJA_DUP_IS_CONFIG_LABEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DEJA_DUP_TYPE_CONFIG_LABEL))
#define DEJA_DUP_IS_CONFIG_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DEJA_DUP_TYPE_CONFIG_LABEL))
#define DEJA_DUP_CONFIG_LABEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DEJA_DUP_TYPE_CONFIG_LABEL, DejaDupConfigLabelClass))

typedef struct _DejaDupConfigLabel DejaDupConfigLabel;
typedef struct _DejaDupConfigLabelClass DejaDupConfigLabelClass;
typedef struct _DejaDupConfigLabelPrivate DejaDupConfigLabelPrivate;

#define DEJA_DUP_TYPE_CONFIG_LABEL_DESCRIPTION (deja_dup_config_label_description_get_type ())
#define DEJA_DUP_CONFIG_LABEL_DESCRIPTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DEJA_DUP_TYPE_CONFIG_LABEL_DESCRIPTION, DejaDupConfigLabelDescription))
#define DEJA_DUP_CONFIG_LABEL_DESCRIPTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DEJA_DUP_TYPE_CONFIG_LABEL_DESCRIPTION, DejaDupConfigLabelDescriptionClass))
#define DEJA_DUP_IS_CONFIG_LABEL_DESCRIPTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DEJA_DUP_TYPE_CONFIG_LABEL_DESCRIPTION))
#define DEJA_DUP_IS_CONFIG_LABEL_DESCRIPTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DEJA_DUP_TYPE_CONFIG_LABEL_DESCRIPTION))
#define DEJA_DUP_CONFIG_LABEL_DESCRIPTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DEJA_DUP_TYPE_CONFIG_LABEL_DESCRIPTION, DejaDupConfigLabelDescriptionClass))

typedef struct _DejaDupConfigLabelDescription DejaDupConfigLabelDescription;
typedef struct _DejaDupConfigLabelDescriptionClass DejaDupConfigLabelDescriptionClass;
typedef struct _DejaDupConfigLabelDescriptionPrivate DejaDupConfigLabelDescriptionPrivate;

#define DEJA_DUP_CONFIG_LABEL_DESCRIPTION_TYPE_KIND (deja_dup_config_label_description_kind_get_type ())
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _DejaDupConfigLabelDescriptionSetFromConfigData DejaDupConfigLabelDescriptionSetFromConfigData;

struct _DejaDupConfigWidget {
	GtkEventBox parent_instance;
	DejaDupConfigWidgetPrivate * priv;
	gboolean syncing;
	DejaDupFilteredSettings* settings;
	GList* all_settings;
};

struct _DejaDupConfigWidgetClass {
	GtkEventBoxClass parent_class;
	void (*set_from_config) (DejaDupConfigWidget* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*set_from_config_finish) (DejaDupConfigWidget* self, GAsyncResult* _res_);
};

struct _DejaDupConfigLabel {
	DejaDupConfigWidget parent_instance;
	DejaDupConfigLabelPrivate * priv;
	GtkGrid* box;
	GtkLabel* label;
};

struct _DejaDupConfigLabelClass {
	DejaDupConfigWidgetClass parent_class;
	void (*fill_box) (DejaDupConfigLabel* self);
};

struct _DejaDupConfigLabelDescription {
	DejaDupConfigLabel parent_instance;
	DejaDupConfigLabelDescriptionPrivate * priv;
};

struct _DejaDupConfigLabelDescriptionClass {
	DejaDupConfigLabelClass parent_class;
};

typedef enum  {
	DEJA_DUP_CONFIG_LABEL_DESCRIPTION_KIND_BACKUP,
	DEJA_DUP_CONFIG_LABEL_DESCRIPTION_KIND_RESTORE
} DejaDupConfigLabelDescriptionKind;

struct _DejaDupConfigLabelDescriptionPrivate {
	DejaDupConfigLabelDescriptionKind _kind;
	gboolean _everything_installed;
};

struct _DejaDupConfigLabelDescriptionSetFromConfigData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	DejaDupConfigLabelDescription* self;
	DejaDupConfigLabelDescriptionKind _tmp0_;
};


static gpointer deja_dup_config_label_description_parent_class = NULL;

GType deja_dup_config_widget_get_type (void) G_GNUC_CONST;
GType deja_dup_config_label_get_type (void) G_GNUC_CONST;
GType deja_dup_config_label_description_get_type (void) G_GNUC_CONST;
GType deja_dup_config_label_description_kind_get_type (void) G_GNUC_CONST;
#define DEJA_DUP_CONFIG_LABEL_DESCRIPTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), DEJA_DUP_TYPE_CONFIG_LABEL_DESCRIPTION, DejaDupConfigLabelDescriptionPrivate))
enum  {
	DEJA_DUP_CONFIG_LABEL_DESCRIPTION_DUMMY_PROPERTY,
	DEJA_DUP_CONFIG_LABEL_DESCRIPTION_KIND,
	DEJA_DUP_CONFIG_LABEL_DESCRIPTION_EVERYTHING_INSTALLED
};
DejaDupConfigLabelDescription* deja_dup_config_label_description_new (DejaDupConfigLabelDescriptionKind kind, gboolean everything_installed);
DejaDupConfigLabelDescription* deja_dup_config_label_description_construct (GType object_type, DejaDupConfigLabelDescriptionKind kind, gboolean everything_installed);
static void deja_dup_config_label_description_real_fill_box (DejaDupConfigLabel* base);
void deja_dup_config_label_fill_box (DejaDupConfigLabel* self);
static gboolean deja_dup_config_label_description_enable_auto_backup (DejaDupConfigLabelDescription* self);
static gboolean _deja_dup_config_label_description_enable_auto_backup_gtk_label_activate_link (GtkLabel* _sender, const gchar* uri, gpointer self);
static void deja_dup_config_label_description_set_from_config_restore (DejaDupConfigLabelDescription* self);
gboolean deja_dup_config_label_description_get_everything_installed (DejaDupConfigLabelDescription* self);
static void deja_dup_config_label_description_set_from_config_backup (DejaDupConfigLabelDescription* self);
static void deja_dup_config_label_description_real_set_from_config_data_free (gpointer _data);
static void deja_dup_config_label_description_real_set_from_config (DejaDupConfigWidget* base, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean deja_dup_config_label_description_real_set_from_config_co (DejaDupConfigLabelDescriptionSetFromConfigData* _data_);
DejaDupConfigLabelDescriptionKind deja_dup_config_label_description_get_kind (DejaDupConfigLabelDescription* self);
static void deja_dup_config_label_description_set_kind (DejaDupConfigLabelDescription* self, DejaDupConfigLabelDescriptionKind value);
void deja_dup_config_label_description_set_everything_installed (DejaDupConfigLabelDescription* self, gboolean value);
static GObject * deja_dup_config_label_description_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
void deja_dup_config_widget_watch_key (DejaDupConfigWidget* self, const gchar* key, DejaDupFilteredSettings* s);
static void _deja_dup_config_label_description___lambda4_ (DejaDupConfigLabelDescription* self, GObject* s, GParamSpec* p);
void deja_dup_config_widget_set_from_config (DejaDupConfigWidget* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
void deja_dup_config_widget_set_from_config_finish (DejaDupConfigWidget* self, GAsyncResult* _res_);
static void __deja_dup_config_label_description___lambda4__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void deja_dup_config_label_description_finalize (GObject* obj);
static void _vala_deja_dup_config_label_description_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_deja_dup_config_label_description_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);


GType deja_dup_config_label_description_kind_get_type (void) {
	static volatile gsize deja_dup_config_label_description_kind_type_id__volatile = 0;
	if (g_once_init_enter (&deja_dup_config_label_description_kind_type_id__volatile)) {
		static const GEnumValue values[] = {{DEJA_DUP_CONFIG_LABEL_DESCRIPTION_KIND_BACKUP, "DEJA_DUP_CONFIG_LABEL_DESCRIPTION_KIND_BACKUP", "backup"}, {DEJA_DUP_CONFIG_LABEL_DESCRIPTION_KIND_RESTORE, "DEJA_DUP_CONFIG_LABEL_DESCRIPTION_KIND_RESTORE", "restore"}, {0, NULL, NULL}};
		GType deja_dup_config_label_description_kind_type_id;
		deja_dup_config_label_description_kind_type_id = g_enum_register_static ("DejaDupConfigLabelDescriptionKind", values);
		g_once_init_leave (&deja_dup_config_label_description_kind_type_id__volatile, deja_dup_config_label_description_kind_type_id);
	}
	return deja_dup_config_label_description_kind_type_id__volatile;
}


DejaDupConfigLabelDescription* deja_dup_config_label_description_construct (GType object_type, DejaDupConfigLabelDescriptionKind kind, gboolean everything_installed) {
	DejaDupConfigLabelDescription * self = NULL;
	DejaDupConfigLabelDescriptionKind _tmp0_ = 0;
	gboolean _tmp1_ = FALSE;
	_tmp0_ = kind;
	_tmp1_ = everything_installed;
	self = (DejaDupConfigLabelDescription*) g_object_new (object_type, "kind", _tmp0_, "everything-installed", _tmp1_, NULL);
	return self;
}


DejaDupConfigLabelDescription* deja_dup_config_label_description_new (DejaDupConfigLabelDescriptionKind kind, gboolean everything_installed) {
	return deja_dup_config_label_description_construct (DEJA_DUP_TYPE_CONFIG_LABEL_DESCRIPTION, kind, everything_installed);
}


static gboolean _deja_dup_config_label_description_enable_auto_backup_gtk_label_activate_link (GtkLabel* _sender, const gchar* uri, gpointer self) {
	gboolean result;
	result = deja_dup_config_label_description_enable_auto_backup ((DejaDupConfigLabelDescription*) self);
	return result;
}


static void deja_dup_config_label_description_real_fill_box (DejaDupConfigLabel* base) {
	DejaDupConfigLabelDescription * self;
	GtkLabel* _tmp0_ = NULL;
	GtkLabel* _tmp1_ = NULL;
	GtkLabel* _tmp2_ = NULL;
	GtkLabel* _tmp3_ = NULL;
	self = (DejaDupConfigLabelDescription*) base;
	DEJA_DUP_CONFIG_LABEL_CLASS (deja_dup_config_label_description_parent_class)->fill_box (G_TYPE_CHECK_INSTANCE_CAST (self, DEJA_DUP_TYPE_CONFIG_LABEL, DejaDupConfigLabel));
	_tmp0_ = ((DejaDupConfigLabel*) self)->label;
	gtk_label_set_use_markup (_tmp0_, TRUE);
	_tmp1_ = ((DejaDupConfigLabel*) self)->label;
	g_object_set (_tmp1_, "wrap", TRUE, NULL);
	_tmp2_ = ((DejaDupConfigLabel*) self)->label;
	gtk_label_set_max_width_chars (_tmp2_, 70);
	_tmp3_ = ((DejaDupConfigLabel*) self)->label;
	g_signal_connect_object (_tmp3_, "activate-link", (GCallback) _deja_dup_config_label_description_enable_auto_backup_gtk_label_activate_link, self, 0);
}


static void deja_dup_config_label_description_set_from_config_restore (DejaDupConfigLabelDescription* self) {
	gboolean _tmp0_ = FALSE;
	gchar* val = NULL;
	gchar* _tmp8_ = NULL;
	GTimeVal time = {0};
	gchar* button_name = NULL;
	const gchar* _tmp9_ = NULL;
	gchar* _tmp10_ = NULL;
	gboolean _tmp11_ = FALSE;
	const gchar* _tmp12_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_everything_installed;
	if (!_tmp0_) {
		gchar* button_name = NULL;
		const gchar* _tmp1_ = NULL;
		gchar* _tmp2_ = NULL;
		GtkLabel* _tmp3_ = NULL;
		const gchar* _tmp4_ = NULL;
		const gchar* _tmp5_ = NULL;
		gchar* _tmp6_ = NULL;
		gchar* _tmp7_ = NULL;
		_tmp1_ = _ ("Install…");
		_tmp2_ = g_strdup_printf ("<b>%s</b>", _tmp1_);
		button_name = _tmp2_;
		_tmp3_ = ((DejaDupConfigLabel*) self)->label;
		_tmp4_ = _ ("You can restore existing backups after you first install some necessar" \
"y software by clicking the %s button.");
		_tmp5_ = button_name;
		_tmp6_ = g_strdup_printf (_tmp4_, _tmp5_);
		_tmp7_ = _tmp6_;
		gtk_label_set_label (_tmp3_, _tmp7_);
		_g_free0 (_tmp7_);
		_g_free0 (button_name);
		return;
	}
	_tmp8_ = deja_dup_last_run_date (DEJA_DUP_TIMESTAMP_TYPE_BACKUP);
	val = _tmp8_;
	g_get_current_time (&time);
	_tmp9_ = _ ("Restore…");
	_tmp10_ = g_strdup_printf ("<b>%s</b>", _tmp9_);
	button_name = _tmp10_;
	_tmp12_ = val;
	if (g_strcmp0 (_tmp12_, "") == 0) {
		_tmp11_ = TRUE;
	} else {
		const gchar* _tmp13_ = NULL;
		gboolean _tmp14_ = FALSE;
		_tmp13_ = val;
		_tmp14_ = g_time_val_from_iso8601 (_tmp13_, &time);
		_tmp11_ = !_tmp14_;
	}
	if (_tmp11_) {
		GtkLabel* _tmp15_ = NULL;
		const gchar* _tmp16_ = NULL;
		const gchar* _tmp17_ = NULL;
		gchar* _tmp18_ = NULL;
		gchar* _tmp19_ = NULL;
		_tmp15_ = ((DejaDupConfigLabel*) self)->label;
		_tmp16_ = _ ("You may use the %s button to browse for existing backups.");
		_tmp17_ = button_name;
		_tmp18_ = g_strdup_printf (_tmp16_, _tmp17_);
		_tmp19_ = _tmp18_;
		gtk_label_set_label (_tmp15_, _tmp19_);
		_g_free0 (_tmp19_);
	} else {
		GtkLabel* _tmp20_ = NULL;
		const gchar* _tmp21_ = NULL;
		const gchar* _tmp22_ = NULL;
		gchar* _tmp23_ = NULL;
		gchar* _tmp24_ = NULL;
		_tmp20_ = ((DejaDupConfigLabel*) self)->label;
		_tmp21_ = _ ("You can restore the entire backup with the %s button or use Files to e" \
"ither revert individual files or restore missing ones.");
		_tmp22_ = button_name;
		_tmp23_ = g_strdup_printf (_tmp21_, _tmp22_);
		_tmp24_ = _tmp23_;
		gtk_label_set_label (_tmp20_, _tmp24_);
		_g_free0 (_tmp24_);
	}
	_g_free0 (button_name);
	_g_free0 (val);
}


static void deja_dup_config_label_description_set_from_config_backup (DejaDupConfigLabelDescription* self) {
	gboolean _tmp0_ = FALSE;
	GDateTime* next = NULL;
	GDateTime* _tmp8_ = NULL;
	GDateTime* _tmp9_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_everything_installed;
	if (!_tmp0_) {
		gchar* button_name = NULL;
		const gchar* _tmp1_ = NULL;
		gchar* _tmp2_ = NULL;
		GtkLabel* _tmp3_ = NULL;
		const gchar* _tmp4_ = NULL;
		const gchar* _tmp5_ = NULL;
		gchar* _tmp6_ = NULL;
		gchar* _tmp7_ = NULL;
		_tmp1_ = _ ("Install…");
		_tmp2_ = g_strdup_printf ("<b>%s</b>", _tmp1_);
		button_name = _tmp2_;
		_tmp3_ = ((DejaDupConfigLabel*) self)->label;
		_tmp4_ = _ ("You can create a backup after you first install some necessary softwar" \
"e by clicking the %s button.");
		_tmp5_ = button_name;
		_tmp6_ = g_strdup_printf (_tmp4_, _tmp5_);
		_tmp7_ = _tmp6_;
		gtk_label_set_label (_tmp3_, _tmp7_);
		_g_free0 (_tmp7_);
		_g_free0 (button_name);
		return;
	}
	_tmp8_ = deja_dup_next_run_date ();
	next = _tmp8_;
	_tmp9_ = next;
	if (_tmp9_ == NULL) {
		gchar* button_name = NULL;
		const gchar* _tmp10_ = NULL;
		gchar* _tmp11_ = NULL;
		GtkLabel* _tmp12_ = NULL;
		const gchar* _tmp13_ = NULL;
		const gchar* _tmp14_ = NULL;
		gchar* _tmp15_ = NULL;
		gchar* _tmp16_ = NULL;
		_tmp10_ = _ ("Back Up Now…");
		_tmp11_ = g_strdup_printf ("<b>%s</b>", _tmp10_);
		button_name = _tmp11_;
		_tmp12_ = ((DejaDupConfigLabel*) self)->label;
		_tmp13_ = _ ("You should <a href=''>enable</a> automatic backups or use the %s butto" \
"n to start one now.");
		_tmp14_ = button_name;
		_tmp15_ = g_strdup_printf (_tmp13_, _tmp14_);
		_tmp16_ = _tmp15_;
		gtk_label_set_label (_tmp12_, _tmp16_);
		_g_free0 (_tmp16_);
		_g_free0 (button_name);
	} else {
		gint period = 0;
		DejaDupFilteredSettings* _tmp17_ = NULL;
		gint _tmp18_ = 0;
		gchar* desc = NULL;
		gint _tmp19_ = 0;
		GtkLabel* _tmp29_ = NULL;
		const gchar* _tmp30_ = NULL;
		_tmp17_ = ((DejaDupConfigWidget*) self)->settings;
		_tmp18_ = g_settings_get_int ((GSettings*) _tmp17_, DEJA_DUP_PERIODIC_PERIOD_KEY);
		period = _tmp18_;
		_tmp19_ = period;
		if (_tmp19_ == 1) {
			const gchar* _tmp20_ = NULL;
			gchar* _tmp21_ = NULL;
			_tmp20_ = _ ("A backup automatically starts every day.");
			_tmp21_ = g_strdup (_tmp20_);
			_g_free0 (desc);
			desc = _tmp21_;
		} else {
			gint _tmp22_ = 0;
			_tmp22_ = period;
			if (_tmp22_ == 7) {
				const gchar* _tmp23_ = NULL;
				gchar* _tmp24_ = NULL;
				_tmp23_ = _ ("A backup automatically starts every week.");
				_tmp24_ = g_strdup (_tmp23_);
				_g_free0 (desc);
				desc = _tmp24_;
			} else {
				gint _tmp25_ = 0;
				const gchar* _tmp26_ = NULL;
				gint _tmp27_ = 0;
				gchar* _tmp28_ = NULL;
				_tmp25_ = period;
				_tmp26_ = g_dngettext (GETTEXT_PACKAGE, "A backup automatically starts every %d day.", "A backup automatically starts every %d days.", (gulong) _tmp25_);
				_tmp27_ = period;
				_tmp28_ = g_strdup_printf (_tmp26_, _tmp27_);
				_g_free0 (desc);
				desc = _tmp28_;
			}
		}
		_tmp29_ = ((DejaDupConfigLabel*) self)->label;
		_tmp30_ = desc;
		gtk_label_set_label (_tmp29_, _tmp30_);
		_g_free0 (desc);
	}
	_g_date_time_unref0 (next);
}


static void deja_dup_config_label_description_real_set_from_config_data_free (gpointer _data) {
	DejaDupConfigLabelDescriptionSetFromConfigData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DejaDupConfigLabelDescriptionSetFromConfigData, _data_);
}


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


static void deja_dup_config_label_description_real_set_from_config (DejaDupConfigWidget* base, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	DejaDupConfigLabelDescription * self;
	DejaDupConfigLabelDescriptionSetFromConfigData* _data_;
	DejaDupConfigLabelDescription* _tmp0_ = NULL;
	self = (DejaDupConfigLabelDescription*) base;
	_data_ = g_slice_new0 (DejaDupConfigLabelDescriptionSetFromConfigData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, deja_dup_config_label_description_real_set_from_config);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, deja_dup_config_label_description_real_set_from_config_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	deja_dup_config_label_description_real_set_from_config_co (_data_);
}


static void deja_dup_config_label_description_real_set_from_config_finish (DejaDupConfigWidget* base, GAsyncResult* _res_) {
	DejaDupConfigLabelDescriptionSetFromConfigData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static gboolean deja_dup_config_label_description_real_set_from_config_co (DejaDupConfigLabelDescriptionSetFromConfigData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = 0;
	_data_->_tmp0_ = _data_->self->priv->_kind;
	if (_data_->_tmp0_ == DEJA_DUP_CONFIG_LABEL_DESCRIPTION_KIND_RESTORE) {
		deja_dup_config_label_description_set_from_config_restore (_data_->self);
	} else {
		deja_dup_config_label_description_set_from_config_backup (_data_->self);
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static gboolean deja_dup_config_label_description_enable_auto_backup (DejaDupConfigLabelDescription* self) {
	gboolean result = FALSE;
	DejaDupFilteredSettings* settings = NULL;
	DejaDupFilteredSettings* _tmp0_ = NULL;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = deja_dup_get_settings (NULL);
	settings = _tmp0_;
	deja_dup_filtered_settings_set_boolean (settings, DEJA_DUP_PERIODIC_KEY, TRUE);
	result = TRUE;
	_g_object_unref0 (settings);
	return result;
}


DejaDupConfigLabelDescriptionKind deja_dup_config_label_description_get_kind (DejaDupConfigLabelDescription* self) {
	DejaDupConfigLabelDescriptionKind result;
	DejaDupConfigLabelDescriptionKind _tmp0_ = 0;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = self->priv->_kind;
	result = _tmp0_;
	return result;
}


static void deja_dup_config_label_description_set_kind (DejaDupConfigLabelDescription* self, DejaDupConfigLabelDescriptionKind value) {
	DejaDupConfigLabelDescriptionKind _tmp0_ = 0;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	self->priv->_kind = _tmp0_;
	g_object_notify ((GObject *) self, "kind");
}


gboolean deja_dup_config_label_description_get_everything_installed (DejaDupConfigLabelDescription* self) {
	gboolean result;
	gboolean _tmp0_ = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_everything_installed;
	result = _tmp0_;
	return result;
}


void deja_dup_config_label_description_set_everything_installed (DejaDupConfigLabelDescription* self, gboolean value) {
	gboolean _tmp0_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	self->priv->_everything_installed = _tmp0_;
	g_object_notify ((GObject *) self, "everything-installed");
}


static void _deja_dup_config_label_description___lambda4_ (DejaDupConfigLabelDescription* self, GObject* s, GParamSpec* p) {
	g_return_if_fail (s != NULL);
	g_return_if_fail (p != NULL);
	deja_dup_config_widget_set_from_config ((DejaDupConfigWidget*) self, NULL, NULL);
}


static void __deja_dup_config_label_description___lambda4__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	_deja_dup_config_label_description___lambda4_ ((DejaDupConfigLabelDescription*) self, _sender, pspec);
}


static GObject * deja_dup_config_label_description_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
	GObject * obj;
	GObjectClass * parent_class;
	DejaDupConfigLabelDescription * self;
	DejaDupConfigLabelDescriptionKind _tmp0_ = 0;
	parent_class = G_OBJECT_CLASS (deja_dup_config_label_description_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DEJA_DUP_TYPE_CONFIG_LABEL_DESCRIPTION, DejaDupConfigLabelDescription);
	deja_dup_config_widget_watch_key ((DejaDupConfigWidget*) self, DEJA_DUP_LAST_BACKUP_KEY, NULL);
	_tmp0_ = self->priv->_kind;
	if (_tmp0_ == DEJA_DUP_CONFIG_LABEL_DESCRIPTION_KIND_BACKUP) {
		deja_dup_config_widget_watch_key ((DejaDupConfigWidget*) self, DEJA_DUP_PERIODIC_KEY, NULL);
		deja_dup_config_widget_watch_key ((DejaDupConfigWidget*) self, DEJA_DUP_PERIODIC_PERIOD_KEY, NULL);
	}
	g_signal_connect_object ((GObject*) self, "notify::everything-installed", (GCallback) __deja_dup_config_label_description___lambda4__g_object_notify, self, 0);
	return obj;
}


static void deja_dup_config_label_description_class_init (DejaDupConfigLabelDescriptionClass * klass) {
	deja_dup_config_label_description_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (DejaDupConfigLabelDescriptionPrivate));
	((DejaDupConfigLabelClass *) klass)->fill_box = deja_dup_config_label_description_real_fill_box;
	((DejaDupConfigWidgetClass *) klass)->set_from_config = deja_dup_config_label_description_real_set_from_config;
	((DejaDupConfigWidgetClass *) klass)->set_from_config_finish = deja_dup_config_label_description_real_set_from_config_finish;
	G_OBJECT_CLASS (klass)->get_property = _vala_deja_dup_config_label_description_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_deja_dup_config_label_description_set_property;
	G_OBJECT_CLASS (klass)->constructor = deja_dup_config_label_description_constructor;
	G_OBJECT_CLASS (klass)->finalize = deja_dup_config_label_description_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DEJA_DUP_CONFIG_LABEL_DESCRIPTION_KIND, g_param_spec_enum ("kind", "kind", "kind", DEJA_DUP_CONFIG_LABEL_DESCRIPTION_TYPE_KIND, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DEJA_DUP_CONFIG_LABEL_DESCRIPTION_EVERYTHING_INSTALLED, g_param_spec_boolean ("everything-installed", "everything-installed", "everything-installed", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
}


static void deja_dup_config_label_description_instance_init (DejaDupConfigLabelDescription * self) {
	self->priv = DEJA_DUP_CONFIG_LABEL_DESCRIPTION_GET_PRIVATE (self);
}


static void deja_dup_config_label_description_finalize (GObject* obj) {
	DejaDupConfigLabelDescription * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DEJA_DUP_TYPE_CONFIG_LABEL_DESCRIPTION, DejaDupConfigLabelDescription);
	G_OBJECT_CLASS (deja_dup_config_label_description_parent_class)->finalize (obj);
}


GType deja_dup_config_label_description_get_type (void) {
	static volatile gsize deja_dup_config_label_description_type_id__volatile = 0;
	if (g_once_init_enter (&deja_dup_config_label_description_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (DejaDupConfigLabelDescriptionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) deja_dup_config_label_description_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DejaDupConfigLabelDescription), 0, (GInstanceInitFunc) deja_dup_config_label_description_instance_init, NULL };
		GType deja_dup_config_label_description_type_id;
		deja_dup_config_label_description_type_id = g_type_register_static (DEJA_DUP_TYPE_CONFIG_LABEL, "DejaDupConfigLabelDescription", &g_define_type_info, 0);
		g_once_init_leave (&deja_dup_config_label_description_type_id__volatile, deja_dup_config_label_description_type_id);
	}
	return deja_dup_config_label_description_type_id__volatile;
}


static void _vala_deja_dup_config_label_description_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	DejaDupConfigLabelDescription * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DEJA_DUP_TYPE_CONFIG_LABEL_DESCRIPTION, DejaDupConfigLabelDescription);
	switch (property_id) {
		case DEJA_DUP_CONFIG_LABEL_DESCRIPTION_KIND:
		g_value_set_enum (value, deja_dup_config_label_description_get_kind (self));
		break;
		case DEJA_DUP_CONFIG_LABEL_DESCRIPTION_EVERYTHING_INSTALLED:
		g_value_set_boolean (value, deja_dup_config_label_description_get_everything_installed (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_deja_dup_config_label_description_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	DejaDupConfigLabelDescription * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DEJA_DUP_TYPE_CONFIG_LABEL_DESCRIPTION, DejaDupConfigLabelDescription);
	switch (property_id) {
		case DEJA_DUP_CONFIG_LABEL_DESCRIPTION_KIND:
		deja_dup_config_label_description_set_kind (self, g_value_get_enum (value));
		break;
		case DEJA_DUP_CONFIG_LABEL_DESCRIPTION_EVERYTHING_INSTALLED:
		deja_dup_config_label_description_set_everything_installed (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}



