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

/*
 * Copyright (c) 2018 elementary, Inc. (https://elementary.io)
 *
 * This program 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 3 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 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, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 */

#include "security-privacy.h"
#include <granite-7.h>
#include <gtk/gtk.h>
#include <glib-object.h>
#include <gio/gio.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include <switchboard.h>
#include <stdlib.h>
#include <string.h>
#include <float.h>
#include <math.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

enum  {
	SECURITY_PRIVACY_HOUSE_KEEPING_PANEL_0_PROPERTY,
	SECURITY_PRIVACY_HOUSE_KEEPING_PANEL_NUM_PROPERTIES
};
static GParamSpec* security_privacy_house_keeping_panel_properties[SECURITY_PRIVACY_HOUSE_KEEPING_PANEL_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 _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

struct _SecurityPrivacyHouseKeepingPanelPrivate {
	GraniteHeaderLabel* spin_header_label;
	GtkLabel* file_age_label;
	GtkSpinButton* file_age_spinbutton;
	GtkCheckButton* download_files_check;
	GtkCheckButton* screenshot_files_check;
	GtkCheckButton* temp_files_check;
	GtkCheckButton* trash_files_check;
};

static gint SecurityPrivacyHouseKeepingPanel_private_offset;
static gpointer security_privacy_house_keeping_panel_parent_class = NULL;

static void security_privacy_house_keeping_panel_update_days (SecurityPrivacyHouseKeepingPanel* self,
                                                       guint age);
static void security_privacy_house_keeping_panel_update_status (SecurityPrivacyHouseKeepingPanel* self);
static GObject * security_privacy_house_keeping_panel_constructor (GType type,
                                                            guint n_construct_properties,
                                                            GObjectConstructParam * construct_properties);
static void _security_privacy_house_keeping_panel_update_status_g_settings_changed (GSettings* _sender,
                                                                             const gchar* key,
                                                                             gpointer self);
static void _security_privacy_house_keeping_panel___lambda23_ (SecurityPrivacyHouseKeepingPanel* self);
static void __security_privacy_house_keeping_panel___lambda23__gtk_spin_button_value_changed (GtkSpinButton* _sender,
                                                                                       gpointer self);
static void _security_privacy_house_keeping_panel___lambda24_ (SecurityPrivacyHouseKeepingPanel* self);
static void __security_privacy_house_keeping_panel___lambda24__gtk_button_clicked (GtkButton* _sender,
                                                                            gpointer self);
static void security_privacy_house_keeping_panel_finalize (GObject * obj);
static GType security_privacy_house_keeping_panel_get_type_once (void);

static inline gpointer
security_privacy_house_keeping_panel_get_instance_private (SecurityPrivacyHouseKeepingPanel* self)
{
	return G_STRUCT_MEMBER_P (self, SecurityPrivacyHouseKeepingPanel_private_offset);
}

SecurityPrivacyHouseKeepingPanel*
security_privacy_house_keeping_panel_construct (GType object_type)
{
	SecurityPrivacyHouseKeepingPanel * self = NULL;
	GThemedIcon* _tmp0_;
	GThemedIcon* _tmp1_;
	_tmp0_ = (GThemedIcon*) g_themed_icon_new ("preferences-system-privacy-housekeeping");
	_tmp1_ = _tmp0_;
	self = (SecurityPrivacyHouseKeepingPanel*) g_object_new (object_type, "icon", _tmp1_, "title", _ ("Housekeeping"), NULL);
	_g_object_unref0 (_tmp1_);
	return self;
}

SecurityPrivacyHouseKeepingPanel*
security_privacy_house_keeping_panel_new (void)
{
	return security_privacy_house_keeping_panel_construct (SECURITY_PRIVACY_TYPE_HOUSE_KEEPING_PANEL);
}

static void
security_privacy_house_keeping_panel_update_days (SecurityPrivacyHouseKeepingPanel* self,
                                                  guint age)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	GtkLabel* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup_printf (g_dngettext (BUILD_GETTEXT_PACKAGE, "Old files can be automatically deleted after %u day to save space and " \
"help protect your privacy.", "Old files can be automatically deleted after %u days to save space and" \
" help protect your privacy.", (gulong) age), age);
	_tmp1_ = _tmp0_;
	switchboard_settings_page_set_description ((SwitchboardSettingsPage*) self, _tmp1_);
	_g_free0 (_tmp1_);
	_tmp2_ = self->priv->file_age_label;
	gtk_label_set_label (_tmp2_, g_dngettext (BUILD_GETTEXT_PACKAGE, "Day", "Days", (gulong) age));
}

static void
security_privacy_house_keeping_panel_update_status (SecurityPrivacyHouseKeepingPanel* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	GtkCheckButton* _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	gboolean all_active = FALSE;
	gboolean _tmp15_ = FALSE;
	gboolean _tmp16_ = FALSE;
	gboolean _tmp17_ = FALSE;
	GtkCheckButton* _tmp18_;
	gboolean _tmp19_;
	gboolean _tmp20_;
	gboolean any_active = FALSE;
	GtkLabel* _tmp30_;
	GtkSpinButton* _tmp31_;
	GraniteHeaderLabel* _tmp32_;
	g_return_if_fail (self != NULL);
	_tmp3_ = self->priv->temp_files_check;
	_tmp4_ = gtk_check_button_get_active (_tmp3_);
	_tmp5_ = _tmp4_;
	if (_tmp5_) {
		GtkCheckButton* _tmp6_;
		gboolean _tmp7_;
		gboolean _tmp8_;
		_tmp6_ = self->priv->trash_files_check;
		_tmp7_ = gtk_check_button_get_active (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp2_ = _tmp8_;
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		GtkCheckButton* _tmp9_;
		gboolean _tmp10_;
		gboolean _tmp11_;
		_tmp9_ = self->priv->download_files_check;
		_tmp10_ = gtk_check_button_get_active (_tmp9_);
		_tmp11_ = _tmp10_;
		_tmp1_ = _tmp11_;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		GtkCheckButton* _tmp12_;
		gboolean _tmp13_;
		gboolean _tmp14_;
		_tmp12_ = self->priv->screenshot_files_check;
		_tmp13_ = gtk_check_button_get_active (_tmp12_);
		_tmp14_ = _tmp13_;
		_tmp0_ = _tmp14_;
	} else {
		_tmp0_ = FALSE;
	}
	all_active = _tmp0_;
	_tmp18_ = self->priv->temp_files_check;
	_tmp19_ = gtk_check_button_get_active (_tmp18_);
	_tmp20_ = _tmp19_;
	if (_tmp20_) {
		_tmp17_ = TRUE;
	} else {
		GtkCheckButton* _tmp21_;
		gboolean _tmp22_;
		gboolean _tmp23_;
		_tmp21_ = self->priv->trash_files_check;
		_tmp22_ = gtk_check_button_get_active (_tmp21_);
		_tmp23_ = _tmp22_;
		_tmp17_ = _tmp23_;
	}
	if (_tmp17_) {
		_tmp16_ = TRUE;
	} else {
		GtkCheckButton* _tmp24_;
		gboolean _tmp25_;
		gboolean _tmp26_;
		_tmp24_ = self->priv->download_files_check;
		_tmp25_ = gtk_check_button_get_active (_tmp24_);
		_tmp26_ = _tmp25_;
		_tmp16_ = _tmp26_;
	}
	if (_tmp16_) {
		_tmp15_ = TRUE;
	} else {
		GtkCheckButton* _tmp27_;
		gboolean _tmp28_;
		gboolean _tmp29_;
		_tmp27_ = self->priv->screenshot_files_check;
		_tmp28_ = gtk_check_button_get_active (_tmp27_);
		_tmp29_ = _tmp28_;
		_tmp15_ = _tmp29_;
	}
	any_active = _tmp15_;
	if (all_active) {
		switchboard_settings_page_set_status_type ((SwitchboardSettingsPage*) self, SWITCHBOARD_SETTINGS_PAGE_STATUS_TYPE_SUCCESS);
		switchboard_settings_page_set_status ((SwitchboardSettingsPage*) self, _ ("Enabled"));
	} else {
		if (any_active) {
			switchboard_settings_page_set_status_type ((SwitchboardSettingsPage*) self, SWITCHBOARD_SETTINGS_PAGE_STATUS_TYPE_WARNING);
			switchboard_settings_page_set_status ((SwitchboardSettingsPage*) self, _ ("Partially Enabled"));
		} else {
			switchboard_settings_page_set_status_type ((SwitchboardSettingsPage*) self, SWITCHBOARD_SETTINGS_PAGE_STATUS_TYPE_OFFLINE);
			switchboard_settings_page_set_status ((SwitchboardSettingsPage*) self, _ ("Disabled"));
		}
	}
	_tmp30_ = self->priv->file_age_label;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp30_, any_active);
	_tmp31_ = self->priv->file_age_spinbutton;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp31_, any_active);
	_tmp32_ = self->priv->spin_header_label;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp32_, any_active);
}

static void
_security_privacy_house_keeping_panel_update_status_g_settings_changed (GSettings* _sender,
                                                                        const gchar* key,
                                                                        gpointer self)
{
	security_privacy_house_keeping_panel_update_status ((SecurityPrivacyHouseKeepingPanel*) self);
}

static void
_security_privacy_house_keeping_panel___lambda23_ (SecurityPrivacyHouseKeepingPanel* self)
{
	GtkSpinButton* _tmp0_;
	gdouble _tmp1_;
	gdouble _tmp2_;
	_tmp0_ = self->priv->file_age_spinbutton;
	_tmp1_ = gtk_spin_button_get_value (_tmp0_);
	_tmp2_ = _tmp1_;
	security_privacy_house_keeping_panel_update_days (self, (guint) _tmp2_);
}

static void
__security_privacy_house_keeping_panel___lambda23__gtk_spin_button_value_changed (GtkSpinButton* _sender,
                                                                                  gpointer self)
{
	_security_privacy_house_keeping_panel___lambda23_ ((SecurityPrivacyHouseKeepingPanel*) self);
}

static void
_security_privacy_house_keeping_panel___lambda24_ (SecurityPrivacyHouseKeepingPanel* self)
{
	GError* _inner_error0_ = NULL;
	{
		g_app_info_launch_default_for_uri ("trash:///", NULL, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp0_;
		const gchar* _tmp1_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp0_ = e;
		_tmp1_ = _tmp0_->message;
		g_warning ("HouseKeepingPanel.vala:138: Failed to open trash: %s", _tmp1_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		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;
	}
}

static void
__security_privacy_house_keeping_panel___lambda24__gtk_button_clicked (GtkButton* _sender,
                                                                       gpointer self)
{
	_security_privacy_house_keeping_panel___lambda24_ ((SecurityPrivacyHouseKeepingPanel*) self);
}

static GObject *
security_privacy_house_keeping_panel_constructor (GType type,
                                                  guint n_construct_properties,
                                                  GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	SecurityPrivacyHouseKeepingPanel * self;
	GraniteHeaderLabel* switch_header_label = NULL;
	GraniteHeaderLabel* _tmp0_;
	GtkCheckButton* _tmp1_ = NULL;
	GtkBox* temp_files_grid = NULL;
	GtkBox* _tmp2_;
	GtkBox* _tmp3_;
	GtkImage* _tmp4_ = NULL;
	GtkImage* _tmp5_;
	GtkBox* _tmp6_;
	GtkLabel* _tmp7_;
	GtkLabel* _tmp8_;
	GtkBox* _tmp9_;
	GtkCheckButton* _tmp10_;
	GtkCheckButton* _tmp11_ = NULL;
	GtkBox* download_files_box = NULL;
	GtkBox* _tmp12_;
	GtkBox* _tmp13_;
	GtkImage* _tmp14_ = NULL;
	GtkImage* _tmp15_;
	GtkBox* _tmp16_;
	GtkLabel* _tmp17_;
	GtkLabel* _tmp18_;
	GtkBox* _tmp19_;
	GtkCheckButton* _tmp20_;
	GtkBox* screenshot_files_grid = NULL;
	GtkBox* _tmp21_;
	GtkBox* _tmp22_;
	GtkImage* _tmp23_ = NULL;
	GtkImage* _tmp24_;
	GtkBox* _tmp25_;
	GtkLabel* _tmp26_;
	GtkLabel* _tmp27_;
	GtkCheckButton* _tmp28_ = NULL;
	GtkBox* _tmp29_;
	GtkCheckButton* _tmp30_;
	GtkCheckButton* _tmp31_ = NULL;
	GtkBox* trash_files_grid = NULL;
	GtkBox* _tmp32_;
	GtkBox* _tmp33_;
	GtkImage* _tmp34_ = NULL;
	GtkImage* _tmp35_;
	GtkBox* _tmp36_;
	GtkLabel* _tmp37_;
	GtkLabel* _tmp38_;
	GtkBox* _tmp39_;
	GtkCheckButton* _tmp40_;
	GraniteHeaderLabel* _tmp41_;
	GtkSpinButton* _tmp42_;
	GtkSpinButton* _tmp43_;
	GtkSpinButton* _tmp44_;
	GtkSpinButton* _tmp45_;
	GtkLabel* _tmp46_;
	GtkLabel* _tmp47_;
	GtkLabel* _tmp48_;
	GtkGrid* grid = NULL;
	GtkGrid* _tmp49_ = NULL;
	GtkGrid* _tmp50_;
	GraniteHeaderLabel* _tmp51_;
	GtkGrid* _tmp52_;
	GtkCheckButton* _tmp53_;
	GtkGrid* _tmp54_;
	GtkCheckButton* _tmp55_;
	GtkGrid* _tmp56_;
	GtkCheckButton* _tmp57_;
	GtkGrid* _tmp58_;
	GtkCheckButton* _tmp59_;
	GtkGrid* _tmp60_;
	GraniteHeaderLabel* _tmp61_;
	GtkGrid* _tmp62_;
	GtkSpinButton* _tmp63_;
	GtkGrid* _tmp64_;
	GtkLabel* _tmp65_;
	GtkGrid* _tmp66_;
	GtkButton* view_trash_button = NULL;
	GtkButton* _tmp67_;
	GSettings* housekeeping_settings = NULL;
	GSettings* _tmp68_;
	GSettings* _tmp69_;
	GtkCheckButton* _tmp70_;
	GSettings* _tmp71_;
	GtkCheckButton* _tmp72_;
	GSettings* _tmp73_;
	GtkCheckButton* _tmp74_;
	GSettings* _tmp75_;
	GtkCheckButton* _tmp76_;
	GSettings* _tmp77_;
	GtkSpinButton* _tmp78_;
	GSettings* _tmp79_;
	GtkSpinButton* _tmp80_;
	gdouble _tmp81_;
	gdouble _tmp82_;
	GtkSpinButton* _tmp83_;
	GtkButton* _tmp84_;
	parent_class = G_OBJECT_CLASS (security_privacy_house_keeping_panel_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SECURITY_PRIVACY_TYPE_HOUSE_KEEPING_PANEL, SecurityPrivacyHouseKeepingPanel);
	_tmp0_ = granite_header_label_new (_ ("Automatically Delete:"));
	g_object_ref_sink (_tmp0_);
	switch_header_label = _tmp0_;
	_tmp1_ = (GtkCheckButton*) gtk_check_button_new ();
	gtk_widget_set_halign ((GtkWidget*) _tmp1_, GTK_ALIGN_START);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp1_, 12);
	g_object_ref_sink (_tmp1_);
	_g_object_unref0 (self->priv->temp_files_check);
	self->priv->temp_files_check = _tmp1_;
	_tmp2_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	g_object_ref_sink (_tmp2_);
	temp_files_grid = _tmp2_;
	_tmp3_ = temp_files_grid;
	_tmp4_ = (GtkImage*) gtk_image_new_from_icon_name ("folder");
	gtk_widget_set_margin_end ((GtkWidget*) _tmp4_, 6);
	gtk_image_set_pixel_size (_tmp4_, 24);
	g_object_ref_sink (_tmp4_);
	_tmp5_ = _tmp4_;
	gtk_box_append (_tmp3_, (GtkWidget*) _tmp5_);
	_g_object_unref0 (_tmp5_);
	_tmp6_ = temp_files_grid;
	_tmp7_ = (GtkLabel*) gtk_label_new (_ ("Old temporary files"));
	g_object_ref_sink (_tmp7_);
	_tmp8_ = _tmp7_;
	gtk_box_append (_tmp6_, (GtkWidget*) _tmp8_);
	_g_object_unref0 (_tmp8_);
	_tmp9_ = temp_files_grid;
	_tmp10_ = self->priv->temp_files_check;
	gtk_widget_set_parent ((GtkWidget*) _tmp9_, (GtkWidget*) _tmp10_);
	_tmp11_ = (GtkCheckButton*) gtk_check_button_new ();
	gtk_widget_set_halign ((GtkWidget*) _tmp11_, GTK_ALIGN_START);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp11_, 12);
	g_object_ref_sink (_tmp11_);
	_g_object_unref0 (self->priv->download_files_check);
	self->priv->download_files_check = _tmp11_;
	_tmp12_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	g_object_ref_sink (_tmp12_);
	download_files_box = _tmp12_;
	_tmp13_ = download_files_box;
	_tmp14_ = (GtkImage*) gtk_image_new_from_icon_name ("folder-download");
	gtk_widget_set_margin_end ((GtkWidget*) _tmp14_, 6);
	gtk_image_set_pixel_size (_tmp14_, 24);
	g_object_ref_sink (_tmp14_);
	_tmp15_ = _tmp14_;
	gtk_box_append (_tmp13_, (GtkWidget*) _tmp15_);
	_g_object_unref0 (_tmp15_);
	_tmp16_ = download_files_box;
	_tmp17_ = (GtkLabel*) gtk_label_new (_ ("Downloaded files"));
	g_object_ref_sink (_tmp17_);
	_tmp18_ = _tmp17_;
	gtk_box_append (_tmp16_, (GtkWidget*) _tmp18_);
	_g_object_unref0 (_tmp18_);
	_tmp19_ = download_files_box;
	_tmp20_ = self->priv->download_files_check;
	gtk_widget_set_parent ((GtkWidget*) _tmp19_, (GtkWidget*) _tmp20_);
	_tmp21_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	g_object_ref_sink (_tmp21_);
	screenshot_files_grid = _tmp21_;
	_tmp22_ = screenshot_files_grid;
	_tmp23_ = (GtkImage*) gtk_image_new_from_icon_name ("folder-screenshots-icon");
	gtk_widget_set_margin_end ((GtkWidget*) _tmp23_, 6);
	gtk_image_set_pixel_size (_tmp23_, 24);
	g_object_ref_sink (_tmp23_);
	_tmp24_ = _tmp23_;
	gtk_box_append (_tmp22_, (GtkWidget*) _tmp24_);
	_g_object_unref0 (_tmp24_);
	_tmp25_ = screenshot_files_grid;
	_tmp26_ = (GtkLabel*) gtk_label_new (_ ("Screenshot files"));
	g_object_ref_sink (_tmp26_);
	_tmp27_ = _tmp26_;
	gtk_box_append (_tmp25_, (GtkWidget*) _tmp27_);
	_g_object_unref0 (_tmp27_);
	_tmp28_ = (GtkCheckButton*) gtk_check_button_new ();
	gtk_widget_set_halign ((GtkWidget*) _tmp28_, GTK_ALIGN_START);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp28_, 12);
	g_object_ref_sink (_tmp28_);
	_g_object_unref0 (self->priv->screenshot_files_check);
	self->priv->screenshot_files_check = _tmp28_;
	_tmp29_ = screenshot_files_grid;
	_tmp30_ = self->priv->screenshot_files_check;
	gtk_widget_set_parent ((GtkWidget*) _tmp29_, (GtkWidget*) _tmp30_);
	_tmp31_ = (GtkCheckButton*) gtk_check_button_new ();
	gtk_widget_set_halign ((GtkWidget*) _tmp31_, GTK_ALIGN_START);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp31_, 12);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp31_, 18);
	g_object_ref_sink (_tmp31_);
	_g_object_unref0 (self->priv->trash_files_check);
	self->priv->trash_files_check = _tmp31_;
	_tmp32_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	g_object_ref_sink (_tmp32_);
	trash_files_grid = _tmp32_;
	_tmp33_ = trash_files_grid;
	_tmp34_ = (GtkImage*) gtk_image_new_from_icon_name ("user-trash-full");
	gtk_widget_set_margin_end ((GtkWidget*) _tmp34_, 6);
	gtk_image_set_pixel_size (_tmp34_, 24);
	g_object_ref_sink (_tmp34_);
	_tmp35_ = _tmp34_;
	gtk_box_append (_tmp33_, (GtkWidget*) _tmp35_);
	_g_object_unref0 (_tmp35_);
	_tmp36_ = trash_files_grid;
	_tmp37_ = (GtkLabel*) gtk_label_new (_ ("Trashed files"));
	g_object_ref_sink (_tmp37_);
	_tmp38_ = _tmp37_;
	gtk_box_append (_tmp36_, (GtkWidget*) _tmp38_);
	_g_object_unref0 (_tmp38_);
	_tmp39_ = trash_files_grid;
	_tmp40_ = self->priv->trash_files_check;
	gtk_widget_set_parent ((GtkWidget*) _tmp39_, (GtkWidget*) _tmp40_);
	_tmp41_ = granite_header_label_new (_ ("Delete Old Files After:"));
	g_object_ref_sink (_tmp41_);
	_g_object_unref0 (self->priv->spin_header_label);
	self->priv->spin_header_label = _tmp41_;
	_tmp42_ = (GtkSpinButton*) gtk_spin_button_new_with_range ((gdouble) 0, (gdouble) 90, (gdouble) 5);
	g_object_ref_sink (_tmp42_);
	_g_object_unref0 (self->priv->file_age_spinbutton);
	self->priv->file_age_spinbutton = _tmp42_;
	_tmp43_ = self->priv->file_age_spinbutton;
	gtk_widget_set_margin_start ((GtkWidget*) _tmp43_, 12);
	_tmp44_ = self->priv->file_age_spinbutton;
	gtk_editable_set_max_width_chars ((GtkEditable*) _tmp44_, 2);
	_tmp45_ = self->priv->file_age_spinbutton;
	g_object_set ((GtkEditable*) _tmp45_, "xalign", (gfloat) 1, NULL);
	_tmp46_ = (GtkLabel*) gtk_label_new (NULL);
	g_object_ref_sink (_tmp46_);
	_g_object_unref0 (self->priv->file_age_label);
	self->priv->file_age_label = _tmp46_;
	_tmp47_ = self->priv->file_age_label;
	gtk_widget_set_halign ((GtkWidget*) _tmp47_, GTK_ALIGN_START);
	_tmp48_ = self->priv->file_age_label;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp48_, TRUE);
	_tmp49_ = (GtkGrid*) gtk_grid_new ();
	gtk_grid_set_column_spacing (_tmp49_, 6);
	gtk_grid_set_row_spacing (_tmp49_, 6);
	g_object_ref_sink (_tmp49_);
	grid = _tmp49_;
	_tmp50_ = grid;
	_tmp51_ = switch_header_label;
	gtk_grid_attach (_tmp50_, (GtkWidget*) _tmp51_, 0, 0, 2, 1);
	_tmp52_ = grid;
	_tmp53_ = self->priv->download_files_check;
	gtk_grid_attach (_tmp52_, (GtkWidget*) _tmp53_, 0, 1, 2, 1);
	_tmp54_ = grid;
	_tmp55_ = self->priv->temp_files_check;
	gtk_grid_attach (_tmp54_, (GtkWidget*) _tmp55_, 0, 2, 2, 1);
	_tmp56_ = grid;
	_tmp57_ = self->priv->screenshot_files_check;
	gtk_grid_attach (_tmp56_, (GtkWidget*) _tmp57_, 0, 3, 2, 1);
	_tmp58_ = grid;
	_tmp59_ = self->priv->trash_files_check;
	gtk_grid_attach (_tmp58_, (GtkWidget*) _tmp59_, 0, 4, 2, 1);
	_tmp60_ = grid;
	_tmp61_ = self->priv->spin_header_label;
	gtk_grid_attach (_tmp60_, (GtkWidget*) _tmp61_, 0, 5, 2, 1);
	_tmp62_ = grid;
	_tmp63_ = self->priv->file_age_spinbutton;
	gtk_grid_attach (_tmp62_, (GtkWidget*) _tmp63_, 0, 6, 1, 1);
	_tmp64_ = grid;
	_tmp65_ = self->priv->file_age_label;
	gtk_grid_attach (_tmp64_, (GtkWidget*) _tmp65_, 1, 6, 1, 1);
	_tmp66_ = grid;
	switchboard_settings_page_set_child ((SwitchboardSettingsPage*) self, (GtkWidget*) _tmp66_);
	switchboard_settings_page_set_show_end_title_buttons ((SwitchboardSettingsPage*) self, TRUE);
	_tmp67_ = switchboard_settings_page_add_button ((SwitchboardSettingsPage*) self, _ ("Open Trash…"));
	view_trash_button = _tmp67_;
	_tmp68_ = g_settings_new ("io.elementary.settings-daemon.housekeeping");
	housekeeping_settings = _tmp68_;
	_tmp69_ = housekeeping_settings;
	_tmp70_ = self->priv->download_files_check;
	g_settings_bind (_tmp69_, "cleanup-downloads-folder", (GObject*) _tmp70_, "active", G_SETTINGS_BIND_DEFAULT);
	_tmp71_ = housekeeping_settings;
	_tmp72_ = self->priv->screenshot_files_check;
	g_settings_bind (_tmp71_, "cleanup-screenshots-folder", (GObject*) _tmp72_, "active", G_SETTINGS_BIND_DEFAULT);
	_tmp73_ = housekeeping_settings;
	_tmp74_ = self->priv->temp_files_check;
	g_settings_bind (_tmp73_, "cleanup-temp-folder", (GObject*) _tmp74_, "active", G_SETTINGS_BIND_DEFAULT);
	_tmp75_ = housekeeping_settings;
	_tmp76_ = self->priv->trash_files_check;
	g_settings_bind (_tmp75_, "cleanup-trash-folder", (GObject*) _tmp76_, "active", G_SETTINGS_BIND_DEFAULT);
	_tmp77_ = housekeeping_settings;
	_tmp78_ = self->priv->file_age_spinbutton;
	g_settings_bind (_tmp77_, "old-files-age", (GObject*) _tmp78_, "value", G_SETTINGS_BIND_DEFAULT);
	_tmp79_ = housekeeping_settings;
	g_signal_connect_object (_tmp79_, "changed", (GCallback) _security_privacy_house_keeping_panel_update_status_g_settings_changed, self, 0);
	_tmp80_ = self->priv->file_age_spinbutton;
	_tmp81_ = gtk_spin_button_get_value (_tmp80_);
	_tmp82_ = _tmp81_;
	security_privacy_house_keeping_panel_update_days (self, (guint) _tmp82_);
	_tmp83_ = self->priv->file_age_spinbutton;
	g_signal_connect_object (_tmp83_, "value-changed", (GCallback) __security_privacy_house_keeping_panel___lambda23__gtk_spin_button_value_changed, self, 0);
	_tmp84_ = view_trash_button;
	g_signal_connect_object (_tmp84_, "clicked", (GCallback) __security_privacy_house_keeping_panel___lambda24__gtk_button_clicked, self, 0);
	security_privacy_house_keeping_panel_update_status (self);
	_g_object_unref0 (housekeeping_settings);
	_g_object_unref0 (view_trash_button);
	_g_object_unref0 (grid);
	_g_object_unref0 (trash_files_grid);
	_g_object_unref0 (screenshot_files_grid);
	_g_object_unref0 (download_files_box);
	_g_object_unref0 (temp_files_grid);
	_g_object_unref0 (switch_header_label);
	return obj;
}

static void
security_privacy_house_keeping_panel_class_init (SecurityPrivacyHouseKeepingPanelClass * klass,
                                                 gpointer klass_data)
{
	security_privacy_house_keeping_panel_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &SecurityPrivacyHouseKeepingPanel_private_offset);
	G_OBJECT_CLASS (klass)->constructor = security_privacy_house_keeping_panel_constructor;
	G_OBJECT_CLASS (klass)->finalize = security_privacy_house_keeping_panel_finalize;
}

static void
security_privacy_house_keeping_panel_instance_init (SecurityPrivacyHouseKeepingPanel * self,
                                                    gpointer klass)
{
	self->priv = security_privacy_house_keeping_panel_get_instance_private (self);
}

static void
security_privacy_house_keeping_panel_finalize (GObject * obj)
{
	SecurityPrivacyHouseKeepingPanel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SECURITY_PRIVACY_TYPE_HOUSE_KEEPING_PANEL, SecurityPrivacyHouseKeepingPanel);
	_g_object_unref0 (self->priv->spin_header_label);
	_g_object_unref0 (self->priv->file_age_label);
	_g_object_unref0 (self->priv->file_age_spinbutton);
	_g_object_unref0 (self->priv->download_files_check);
	_g_object_unref0 (self->priv->screenshot_files_check);
	_g_object_unref0 (self->priv->temp_files_check);
	_g_object_unref0 (self->priv->trash_files_check);
	G_OBJECT_CLASS (security_privacy_house_keeping_panel_parent_class)->finalize (obj);
}

static GType
security_privacy_house_keeping_panel_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SecurityPrivacyHouseKeepingPanelClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) security_privacy_house_keeping_panel_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SecurityPrivacyHouseKeepingPanel), 0, (GInstanceInitFunc) security_privacy_house_keeping_panel_instance_init, NULL };
	GType security_privacy_house_keeping_panel_type_id;
	security_privacy_house_keeping_panel_type_id = g_type_register_static (SWITCHBOARD_TYPE_SETTINGS_PAGE, "SecurityPrivacyHouseKeepingPanel", &g_define_type_info, 0);
	SecurityPrivacyHouseKeepingPanel_private_offset = g_type_add_instance_private (security_privacy_house_keeping_panel_type_id, sizeof (SecurityPrivacyHouseKeepingPanelPrivate));
	return security_privacy_house_keeping_panel_type_id;
}

GType
security_privacy_house_keeping_panel_get_type (void)
{
	static volatile gsize security_privacy_house_keeping_panel_type_id__once = 0;
	if (g_once_init_enter (&security_privacy_house_keeping_panel_type_id__once)) {
		GType security_privacy_house_keeping_panel_type_id;
		security_privacy_house_keeping_panel_type_id = security_privacy_house_keeping_panel_get_type_once ();
		g_once_init_leave (&security_privacy_house_keeping_panel_type_id__once, security_privacy_house_keeping_panel_type_id);
	}
	return security_privacy_house_keeping_panel_type_id__once;
}

