/* security-widget.c generated by valac 0.56.19, the Vala compiler
 * generated from security-widget.vala, do not modify */

/* -*- Mode: vala; tab-width: 4; intend-tabs-mode: t -*- */
/* alm
 *
 * Copyright (C) 2013 Jeremy Bicha <jbicha@ubuntu.com>
 *
 * alm is free software: you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * alm 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 Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#include <gtk/gtk.h>
#include <glib-object.h>
#include <gio/gio.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.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 ALM_TYPE_SECURITY_WIDGET (alm_security_widget_get_type ())
#define ALM_SECURITY_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ALM_TYPE_SECURITY_WIDGET, AlmSecurityWidget))
#define ALM_SECURITY_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ALM_TYPE_SECURITY_WIDGET, AlmSecurityWidgetClass))
#define ALM_IS_SECURITY_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ALM_TYPE_SECURITY_WIDGET))
#define ALM_IS_SECURITY_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ALM_TYPE_SECURITY_WIDGET))
#define ALM_SECURITY_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ALM_TYPE_SECURITY_WIDGET, AlmSecurityWidgetClass))

typedef struct _AlmSecurityWidget AlmSecurityWidget;
typedef struct _AlmSecurityWidgetClass AlmSecurityWidgetClass;
typedef struct _AlmSecurityWidgetPrivate AlmSecurityWidgetPrivate;
enum  {
	ALM_SECURITY_WIDGET_0_PROPERTY,
	ALM_SECURITY_WIDGET_NUM_PROPERTIES
};
static GParamSpec* alm_security_widget_properties[ALM_SECURITY_WIDGET_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block1Data Block1Data;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

struct _AlmSecurityWidget {
	GtkBox parent_instance;
	AlmSecurityWidgetPrivate * priv;
};

struct _AlmSecurityWidgetClass {
	GtkBoxClass parent_class;
};

struct _AlmSecurityWidgetPrivate {
	GSettings* power_settings;
	GSettings* screensaver_settings;
};

struct _Block1Data {
	int _ref_count_;
	AlmSecurityWidget* self;
	GtkComboBox* combo_delay;
};

static gint AlmSecurityWidget_private_offset;
static gpointer alm_security_widget_parent_class = NULL;

VALA_EXTERN GType alm_security_widget_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (AlmSecurityWidget, g_object_unref)
VALA_EXTERN AlmSecurityWidget* alm_security_widget_new (void);
VALA_EXTERN AlmSecurityWidget* alm_security_widget_construct (GType object_type);
static void alm_security_widget_set_up_ui (AlmSecurityWidget* self);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
static void alm_security_widget_set_delay_cb (AlmSecurityWidget* self,
                                       GtkComboBox* combo);
static void _alm_security_widget_set_delay_cb_gtk_combo_box_changed (GtkComboBox* _sender,
                                                              gpointer self);
static void __lambda4_ (Block1Data* _data1_);
static void ___lambda4__g_settings_changed (GSettings* _sender,
                                     const gchar* key,
                                     gpointer self);
static void __lambda5_ (Block1Data* _data1_);
static void alm_security_widget_get_delay_cb (AlmSecurityWidget* self,
                                       GtkComboBox* combo);
static void ___lambda5__g_settings_changed (GSettings* _sender,
                                     const gchar* key,
                                     gpointer self);
static gboolean __lambda6_ (AlmSecurityWidget* self);
static gboolean ___lambda6__gtk_link_button_activate_link (GtkLinkButton* _sender,
                                                    gpointer self);
static gboolean __lambda7_ (AlmSecurityWidget* self);
static gboolean ___lambda7__gtk_link_button_activate_link (GtkLinkButton* _sender,
                                                    gpointer self);
static void _g_object_unref0_ (gpointer var);
static inline void _g_list_free__g_object_unref0_ (GList* self);
static void alm_security_widget_finalize (GObject * obj);
static GType alm_security_widget_get_type_once (void);

static inline gpointer
alm_security_widget_get_instance_private (AlmSecurityWidget* self)
{
	return G_STRUCT_MEMBER_P (self, AlmSecurityWidget_private_offset);
}

AlmSecurityWidget*
alm_security_widget_construct (GType object_type)
{
	AlmSecurityWidget * self = NULL;
	GSettings* _tmp0_;
	GSettings* _tmp1_;
	self = (AlmSecurityWidget*) g_object_new (object_type, "orientation", GTK_ORIENTATION_VERTICAL, NULL);
	gtk_box_set_spacing ((GtkBox*) self, 5);
	gtk_container_set_border_width ((GtkContainer*) self, (guint) 12);
	_tmp0_ = g_settings_new ("org.gnome.settings-daemon.plugins.power");
	_g_object_unref0 (self->priv->power_settings);
	self->priv->power_settings = _tmp0_;
	_tmp1_ = g_settings_new ("org.gnome.desktop.screensaver");
	_g_object_unref0 (self->priv->screensaver_settings);
	self->priv->screensaver_settings = _tmp1_;
	alm_security_widget_set_up_ui (self);
	return self;
}

AlmSecurityWidget*
alm_security_widget_new (void)
{
	return alm_security_widget_construct (ALM_TYPE_SECURITY_WIDGET);
}

static Block1Data*
block1_data_ref (Block1Data* _data1_)
{
	g_atomic_int_inc (&_data1_->_ref_count_);
	return _data1_;
}

static void
block1_data_unref (void * _userdata_)
{
	Block1Data* _data1_;
	_data1_ = (Block1Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
		AlmSecurityWidget* self;
		self = _data1_->self;
		_g_object_unref0 (_data1_->combo_delay);
		_g_object_unref0 (self);
		g_slice_free (Block1Data, _data1_);
	}
}

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

static void
_alm_security_widget_set_delay_cb_gtk_combo_box_changed (GtkComboBox* _sender,
                                                         gpointer self)
{
	alm_security_widget_set_delay_cb ((AlmSecurityWidget*) self, _sender);
}

static void
__lambda4_ (Block1Data* _data1_)
{
	AlmSecurityWidget* self;
	GSettings* _tmp0_;
	self = _data1_->self;
	_tmp0_ = self->priv->screensaver_settings;
	gtk_widget_set_sensitive ((GtkWidget*) _data1_->combo_delay, g_settings_get_boolean (_tmp0_, "lock-enabled"));
}

static void
___lambda4__g_settings_changed (GSettings* _sender,
                                const gchar* key,
                                gpointer self)
{
	__lambda4_ (self);
}

static void
__lambda5_ (Block1Data* _data1_)
{
	AlmSecurityWidget* self;
	self = _data1_->self;
	alm_security_widget_get_delay_cb (self, _data1_->combo_delay);
}

static void
___lambda5__g_settings_changed (GSettings* _sender,
                                const gchar* key,
                                gpointer self)
{
	__lambda5_ (self);
}

static gboolean
__lambda6_ (AlmSecurityWidget* self)
{
	GError* _inner_error0_ = NULL;
	gboolean result;
	{
		g_spawn_command_line_async ("gnome-control-center user-accounts", &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			gboolean _tmp0_ = FALSE;
			if (_inner_error0_->domain == G_SPAWN_ERROR) {
				goto __catch0_g_spawn_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return _tmp0_;
		}
	}
	goto __finally0;
	__catch0_g_spawn_error:
	{
		GError* e = NULL;
		GError* _tmp1_;
		const gchar* _tmp2_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp1_ = e;
		_tmp2_ = _tmp1_->message;
		g_warning ("security-widget.vala:116: %s", _tmp2_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp3_ = FALSE;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return _tmp3_;
	}
	result = TRUE;
	return result;
}

static gboolean
___lambda6__gtk_link_button_activate_link (GtkLinkButton* _sender,
                                           gpointer self)
{
	gboolean result;
	result = __lambda6_ ((AlmSecurityWidget*) self);
	return result;
}

static gboolean
__lambda7_ (AlmSecurityWidget* self)
{
	GError* _inner_error0_ = NULL;
	gboolean result;
	{
		g_spawn_command_line_async ("gnome-control-center power", &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			gboolean _tmp0_ = FALSE;
			if (_inner_error0_->domain == G_SPAWN_ERROR) {
				goto __catch0_g_spawn_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return _tmp0_;
		}
	}
	goto __finally0;
	__catch0_g_spawn_error:
	{
		GError* e = NULL;
		GError* _tmp1_;
		const gchar* _tmp2_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp1_ = e;
		_tmp2_ = _tmp1_->message;
		g_warning ("security-widget.vala:129: %s", _tmp2_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp3_ = FALSE;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return _tmp3_;
	}
	result = TRUE;
	return result;
}

static gboolean
___lambda7__gtk_link_button_activate_link (GtkLinkButton* _sender,
                                           gpointer self)
{
	gboolean result;
	result = __lambda7_ ((AlmSecurityWidget*) self);
	return result;
}

static void
_g_object_unref0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
}

static inline void
_g_list_free__g_object_unref0_ (GList* self)
{
	g_list_free_full (self, (GDestroyNotify) _g_object_unref0_);
}

static void
alm_security_widget_set_up_ui (AlmSecurityWidget* self)
{
	Block1Data* _data1_;
	GtkListStore* liststore_delay = NULL;
	GtkListStore* _tmp0_;
	GtkTreeIter iter = {0};
	GtkTreeIter _tmp1_ = {0};
	GtkTreeIter _tmp2_;
	GtkTreeIter _tmp3_ = {0};
	GtkTreeIter _tmp4_;
	GtkTreeIter _tmp5_ = {0};
	GtkTreeIter _tmp6_;
	GtkTreeIter _tmp7_ = {0};
	GtkTreeIter _tmp8_;
	GtkTreeIter _tmp9_ = {0};
	GtkTreeIter _tmp10_;
	GtkTreeIter _tmp11_ = {0};
	GtkTreeIter _tmp12_;
	GtkTreeIter _tmp13_ = {0};
	GtkTreeIter _tmp14_;
	GtkTreeIter _tmp15_ = {0};
	GtkTreeIter _tmp16_;
	GtkTreeIter _tmp17_ = {0};
	GtkTreeIter _tmp18_;
	GtkGrid* grid = NULL;
	GtkGrid* _tmp19_;
	GList* list_focus = NULL;
	GtkLabel* header = NULL;
	GtkLabel* _tmp20_;
	gchar* _tmp21_;
	gchar* _tmp22_;
	GtkCheckButton* checkbox_suspend = NULL;
	GtkCheckButton* _tmp23_;
	GSettings* _tmp24_;
	GtkWidget* _tmp25_;
	GtkCheckButton* checkbox_screensaver = NULL;
	GtkCheckButton* _tmp26_;
	GSettings* _tmp27_;
	GtkWidget* _tmp28_;
	GtkLabel* label_combo_delay = NULL;
	GtkLabel* _tmp29_;
	GtkComboBox* _tmp30_;
	GtkCellRendererText* cell = NULL;
	GtkCellRendererText* _tmp31_;
	GtkWidget* _tmp32_;
	GSettings* _tmp33_;
	GSettings* _tmp34_;
	GSettings* _tmp35_;
	GtkLinkButton* link_password = NULL;
	GtkLinkButton* _tmp36_;
	GtkWidget* _tmp37_;
	GtkLinkButton* link_power = NULL;
	GtkLinkButton* _tmp38_;
	GtkWidget* _tmp39_;
	g_return_if_fail (self != NULL);
	_data1_ = g_slice_new0 (Block1Data);
	_data1_->_ref_count_ = 1;
	_data1_->self = g_object_ref (self);
	_tmp0_ = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_INT, -1);
	liststore_delay = _tmp0_;
	gtk_list_store_append (liststore_delay, &_tmp1_);
	iter = _tmp1_;
	_tmp2_ = iter;
	gtk_list_store_set (liststore_delay, &_tmp2_, 0, "1 second", 1, 0, -1);
	gtk_list_store_append (liststore_delay, &_tmp3_);
	iter = _tmp3_;
	_tmp4_ = iter;
	gtk_list_store_set (liststore_delay, &_tmp4_, 0, "30 seconds", 1, 30, -1);
	gtk_list_store_append (liststore_delay, &_tmp5_);
	iter = _tmp5_;
	_tmp6_ = iter;
	gtk_list_store_set (liststore_delay, &_tmp6_, 0, "1 minute", 1, 60, -1);
	gtk_list_store_append (liststore_delay, &_tmp7_);
	iter = _tmp7_;
	_tmp8_ = iter;
	gtk_list_store_set (liststore_delay, &_tmp8_, 0, "2 minutes", 1, 120, -1);
	gtk_list_store_append (liststore_delay, &_tmp9_);
	iter = _tmp9_;
	_tmp10_ = iter;
	gtk_list_store_set (liststore_delay, &_tmp10_, 0, "3 minutes", 1, 180, -1);
	gtk_list_store_append (liststore_delay, &_tmp11_);
	iter = _tmp11_;
	_tmp12_ = iter;
	gtk_list_store_set (liststore_delay, &_tmp12_, 0, "5 minutes", 1, 300, -1);
	gtk_list_store_append (liststore_delay, &_tmp13_);
	iter = _tmp13_;
	_tmp14_ = iter;
	gtk_list_store_set (liststore_delay, &_tmp14_, 0, "10 minutes", 1, 600, -1);
	gtk_list_store_append (liststore_delay, &_tmp15_);
	iter = _tmp15_;
	_tmp16_ = iter;
	gtk_list_store_set (liststore_delay, &_tmp16_, 0, "30 minutes", 1, 1800, -1);
	gtk_list_store_append (liststore_delay, &_tmp17_);
	iter = _tmp17_;
	_tmp18_ = iter;
	gtk_list_store_set (liststore_delay, &_tmp18_, 0, "1 hour", 1, 3600, -1);
	_tmp19_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp19_);
	grid = _tmp19_;
	gtk_widget_set_halign ((GtkWidget*) grid, GTK_ALIGN_START);
	gtk_widget_set_valign ((GtkWidget*) grid, GTK_ALIGN_START);
	gtk_widget_set_margin_top ((GtkWidget*) grid, 25);
	gtk_widget_set_margin_left ((GtkWidget*) grid, 25);
	gtk_grid_set_column_spacing (grid, (guint) 25);
	gtk_grid_set_row_spacing (grid, (guint) 5);
	gtk_grid_set_row_homogeneous (grid, TRUE);
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) grid);
	list_focus = NULL;
	_tmp20_ = (GtkLabel*) gtk_label_new ("");
	g_object_ref_sink (_tmp20_);
	header = _tmp20_;
	_tmp21_ = g_strdup_printf ("<b>%s</b>", _ ("Require my password when:"));
	_tmp22_ = _tmp21_;
	gtk_label_set_markup (header, _tmp22_);
	_g_free0 (_tmp22_);
	gtk_grid_attach (grid, (GtkWidget*) header, 0, 0, 1, 1);
	_tmp23_ = (GtkCheckButton*) gtk_check_button_new_with_mnemonic (_ ("_Waking from suspend"));
	g_object_ref_sink (_tmp23_);
	checkbox_suspend = _tmp23_;
	_tmp24_ = self->priv->screensaver_settings;
	g_settings_bind (_tmp24_, "ubuntu-lock-on-suspend", (GObject*) checkbox_suspend, "active", G_SETTINGS_BIND_DEFAULT);
	_tmp25_ = _g_object_ref0 ((GtkWidget*) checkbox_suspend);
	list_focus = g_list_append (list_focus, _tmp25_);
	gtk_grid_attach (grid, (GtkWidget*) checkbox_suspend, 0, 1, 1, 1);
	_tmp26_ = (GtkCheckButton*) gtk_check_button_new_with_mnemonic (_ ("_Returning from blank screen"));
	g_object_ref_sink (_tmp26_);
	checkbox_screensaver = _tmp26_;
	_tmp27_ = self->priv->screensaver_settings;
	g_settings_bind (_tmp27_, "lock-enabled", (GObject*) checkbox_screensaver, "active", G_SETTINGS_BIND_DEFAULT);
	_tmp28_ = _g_object_ref0 ((GtkWidget*) checkbox_screensaver);
	list_focus = g_list_append (list_focus, _tmp28_);
	gtk_grid_attach (grid, (GtkWidget*) checkbox_screensaver, 0, 2, 1, 1);
	_tmp29_ = (GtkLabel*) gtk_label_new (NULL);
	g_object_ref_sink (_tmp29_);
	label_combo_delay = _tmp29_;
	gtk_label_set_markup_with_mnemonic (label_combo_delay, _ ("_if screen has been blank for"));
	gtk_widget_set_margin_left ((GtkWidget*) label_combo_delay, 18);
	gtk_grid_attach (grid, (GtkWidget*) label_combo_delay, 0, 3, 1, 1);
	_tmp30_ = (GtkComboBox*) gtk_combo_box_new_with_model ((GtkTreeModel*) liststore_delay);
	g_object_ref_sink (_tmp30_);
	_data1_->combo_delay = _tmp30_;
	g_signal_connect_object (_data1_->combo_delay, "changed", (GCallback) _alm_security_widget_set_delay_cb_gtk_combo_box_changed, self, 0);
	gtk_label_set_mnemonic_widget (label_combo_delay, (GtkWidget*) _data1_->combo_delay);
	_tmp31_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
	g_object_ref_sink (_tmp31_);
	cell = _tmp31_;
	gtk_cell_layout_pack_start ((GtkCellLayout*) _data1_->combo_delay, (GtkCellRenderer*) cell, FALSE);
	gtk_cell_layout_add_attribute ((GtkCellLayout*) _data1_->combo_delay, (GtkCellRenderer*) cell, "text", 0);
	_tmp32_ = _g_object_ref0 ((GtkWidget*) _data1_->combo_delay);
	list_focus = g_list_append (list_focus, _tmp32_);
	_tmp33_ = self->priv->screensaver_settings;
	g_signal_connect_data (_tmp33_, "changed::lock-enabled", (GCallback) ___lambda4__g_settings_changed, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
	_tmp34_ = self->priv->screensaver_settings;
	gtk_widget_set_sensitive ((GtkWidget*) _data1_->combo_delay, g_settings_get_boolean (_tmp34_, "lock-enabled"));
	_tmp35_ = self->priv->screensaver_settings;
	g_signal_connect_data (_tmp35_, "changed::lock-delay", (GCallback) ___lambda5__g_settings_changed, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
	alm_security_widget_get_delay_cb (self, _data1_->combo_delay);
	gtk_grid_attach (grid, (GtkWidget*) _data1_->combo_delay, 1, 3, 1, 1);
	_tmp36_ = (GtkLinkButton*) gtk_link_button_new (_ ("Password Settings"));
	g_object_ref_sink (_tmp36_);
	link_password = _tmp36_;
	g_signal_connect_object (link_password, "activate-link", (GCallback) ___lambda6__gtk_link_button_activate_link, self, 0);
	gtk_widget_set_halign ((GtkWidget*) link_password, GTK_ALIGN_START);
	_tmp37_ = _g_object_ref0 ((GtkWidget*) link_password);
	list_focus = g_list_append (list_focus, _tmp37_);
	gtk_grid_attach (grid, (GtkWidget*) link_password, 2, 0, 1, 1);
	_tmp38_ = (GtkLinkButton*) gtk_link_button_new (_ ("Power Settings"));
	g_object_ref_sink (_tmp38_);
	link_power = _tmp38_;
	g_signal_connect_object (link_power, "activate-link", (GCallback) ___lambda7__gtk_link_button_activate_link, self, 0);
	gtk_widget_set_halign ((GtkWidget*) link_power, GTK_ALIGN_START);
	_tmp39_ = _g_object_ref0 ((GtkWidget*) link_power);
	list_focus = g_list_append (list_focus, _tmp39_);
	gtk_grid_attach (grid, (GtkWidget*) link_power, 2, 1, 1, 1);
	gtk_container_set_focus_chain ((GtkContainer*) grid, list_focus);
	_g_object_unref0 (link_power);
	_g_object_unref0 (link_password);
	_g_object_unref0 (cell);
	_g_object_unref0 (label_combo_delay);
	_g_object_unref0 (checkbox_screensaver);
	_g_object_unref0 (checkbox_suspend);
	_g_object_unref0 (header);
	(list_focus == NULL) ? NULL : (list_focus = (_g_list_free__g_object_unref0_ (list_focus), NULL));
	_g_object_unref0 (grid);
	_g_object_unref0 (liststore_delay);
	block1_data_unref (_data1_);
	_data1_ = NULL;
}

static void
alm_security_widget_set_delay_cb (AlmSecurityWidget* self,
                                  GtkComboBox* combo)
{
	guint seconds = 0U;
	GtkTreeIter iter = {0};
	GtkTreeIter _tmp0_ = {0};
	GtkTreeModel* _tmp1_;
	GtkTreeModel* _tmp2_;
	GtkTreeIter _tmp3_;
	guint _tmp4_ = 0U;
	GSettings* _tmp5_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (combo != NULL);
	gtk_combo_box_get_active_iter (combo, &_tmp0_);
	iter = _tmp0_;
	_tmp1_ = gtk_combo_box_get_model (combo);
	_tmp2_ = _tmp1_;
	_tmp3_ = iter;
	gtk_tree_model_get (_tmp2_, &_tmp3_, 1, &_tmp4_, -1);
	seconds = _tmp4_;
	_tmp5_ = self->priv->screensaver_settings;
	g_settings_set_uint (_tmp5_, "lock-delay", seconds);
}

static void
alm_security_widget_get_delay_cb (AlmSecurityWidget* self,
                                  GtkComboBox* combo)
{
	gint i = 0;
	gint value_prev = 0;
	gint value_tmp = 0;
	GtkTreeModel* model = NULL;
	GtkTreeModel* _tmp0_;
	GtkTreeModel* _tmp1_;
	GtkTreeIter iter = {0};
	GtkTreeModel* _tmp2_;
	GtkTreeIter _tmp3_ = {0};
	guint value = 0U;
	GSettings* _tmp4_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (combo != NULL);
	i = 0;
	value_prev = 0;
	value_tmp = 0;
	_tmp0_ = gtk_combo_box_get_model (combo);
	_tmp1_ = _g_object_ref0 (_tmp0_);
	model = _tmp1_;
	_tmp2_ = model;
	gtk_tree_model_get_iter_first (_tmp2_, &_tmp3_);
	iter = _tmp3_;
	_tmp4_ = self->priv->screensaver_settings;
	value = g_settings_get_uint (_tmp4_, "lock-delay");
	{
		gboolean _tmp5_ = FALSE;
		_tmp5_ = TRUE;
		while (TRUE) {
			GtkTreeModel* _tmp8_;
			GtkTreeIter _tmp9_;
			gint _tmp10_ = 0;
			gboolean _tmp11_ = FALSE;
			gint _tmp14_;
			if (!_tmp5_) {
				GtkTreeModel* _tmp6_;
				gboolean _tmp7_;
				_tmp6_ = model;
				_tmp7_ = gtk_tree_model_iter_next (_tmp6_, &iter);
				if (!_tmp7_) {
					break;
				}
			}
			_tmp5_ = FALSE;
			_tmp8_ = model;
			_tmp9_ = iter;
			gtk_tree_model_get (_tmp8_, &_tmp9_, 1, &_tmp10_, -1);
			value_tmp = _tmp10_;
			if (value == ((guint) value_tmp)) {
				_tmp11_ = TRUE;
			} else {
				gboolean _tmp12_ = FALSE;
				if (value_tmp > value_prev) {
					_tmp12_ = value < ((guint) value_tmp);
				} else {
					_tmp12_ = FALSE;
				}
				_tmp11_ = _tmp12_;
			}
			if (_tmp11_) {
				GtkTreeIter _tmp13_;
				_tmp13_ = iter;
				gtk_combo_box_set_active_iter (combo, &_tmp13_);
				_g_object_unref0 (model);
				return;
			}
			value_prev = value_tmp;
			_tmp14_ = i;
			i = _tmp14_ + 1;
		}
	}
	gtk_combo_box_set_active (combo, i - 1);
	_g_object_unref0 (model);
}

static void
alm_security_widget_class_init (AlmSecurityWidgetClass * klass,
                                gpointer klass_data)
{
	alm_security_widget_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &AlmSecurityWidget_private_offset);
	G_OBJECT_CLASS (klass)->finalize = alm_security_widget_finalize;
}

static void
alm_security_widget_instance_init (AlmSecurityWidget * self,
                                   gpointer klass)
{
	self->priv = alm_security_widget_get_instance_private (self);
}

static void
alm_security_widget_finalize (GObject * obj)
{
	AlmSecurityWidget * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, ALM_TYPE_SECURITY_WIDGET, AlmSecurityWidget);
	_g_object_unref0 (self->priv->power_settings);
	_g_object_unref0 (self->priv->screensaver_settings);
	G_OBJECT_CLASS (alm_security_widget_parent_class)->finalize (obj);
}

static GType
alm_security_widget_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (AlmSecurityWidgetClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) alm_security_widget_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (AlmSecurityWidget), 0, (GInstanceInitFunc) alm_security_widget_instance_init, NULL };
	GType alm_security_widget_type_id;
	alm_security_widget_type_id = g_type_register_static (gtk_box_get_type (), "AlmSecurityWidget", &g_define_type_info, 0);
	AlmSecurityWidget_private_offset = g_type_add_instance_private (alm_security_widget_type_id, sizeof (AlmSecurityWidgetPrivate));
	return alm_security_widget_type_id;
}

GType
alm_security_widget_get_type (void)
{
	static volatile gsize alm_security_widget_type_id__once = 0;
	if (g_once_init_enter (&alm_security_widget_type_id__once)) {
		GType alm_security_widget_type_id;
		alm_security_widget_type_id = alm_security_widget_get_type_once ();
		g_once_init_leave (&alm_security_widget_type_id__once, alm_security_widget_type_id);
	}
	return alm_security_widget_type_id__once;
}

