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

/*
 * SPDX-License-Identifier: LGPL-2.1-or-later
 * SPDX-FileCopyrightText: 2015-2024 elementary, Inc. (https://elementary.io)
 * Authored by: Adam Bieńkowski <donadigos159@gmail.com>
 */

#include "network.h"
#include <gtk/gtk.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>
#include <glib/gi18n-lib.h>
#include <granite-7.h>
#include <glib-object.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  {
	NETWORK_WIDGETS_EXECEPIONS_PAGE_0_PROPERTY,
	NETWORK_WIDGETS_EXECEPIONS_PAGE_NUM_PROPERTIES
};
static GParamSpec* network_widgets_execepions_page_properties[NETWORK_WIDGETS_EXECEPIONS_PAGE_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))
typedef struct _Block13Data Block13Data;
typedef struct _Block14Data Block14Data;

struct _NetworkWidgetsExecepionsPagePrivate {
	GtkListBox* ignored_list;
	GtkListBoxRow** items;
	gint items_length1;
	gint _items_size_;
};

struct _Block13Data {
	int _ref_count_;
	NetworkWidgetsExecepionsPage* self;
	gchar* e;
};

struct _Block14Data {
	int _ref_count_;
	NetworkWidgetsExecepionsPage* self;
	GtkEntry* entry;
	GtkButton* add_btn;
};

static gint NetworkWidgetsExecepionsPage_private_offset;
static gpointer network_widgets_execepions_page_parent_class = NULL;

static void network_widgets_execepions_page_add_exception (NetworkWidgetsExecepionsPage* self,
                                                    GtkEntry* entry);
static void _vala_array_add1 (gchar** * array,
                       gint* length,
                       gint* size,
                       gchar* value);
static void network_widgets_execepions_page_update_list (NetworkWidgetsExecepionsPage* self);
static void network_widgets_execepions_page_list_exceptions (NetworkWidgetsExecepionsPage* self);
static Block13Data* block13_data_ref (Block13Data* _data13_);
static void block13_data_unref (void * _userdata_);
static void ____lambda42_ (Block13Data* _data13_);
static void network_widgets_execepions_page_remove_exception (NetworkWidgetsExecepionsPage* self,
                                                       const gchar* exception);
static void _____lambda42__gtk_button_clicked (GtkButton* _sender,
                                        gpointer self);
static void _vala_array_add2 (GtkListBoxRow** * array,
                       gint* length,
                       gint* size,
                       GtkListBoxRow* value);
static void _vala_array_add3 (gchar** * array,
                       gint* length,
                       gint* size,
                       gchar* value);
static GObject * network_widgets_execepions_page_constructor (GType type,
                                                       guint n_construct_properties,
                                                       GObjectConstructParam * construct_properties);
static Block14Data* block14_data_ref (Block14Data* _data14_);
static void block14_data_unref (void * _userdata_);
static void _network_widgets_execepions_page___lambda43_ (Block14Data* _data14_);
static void __network_widgets_execepions_page___lambda43__gtk_button_clicked (GtkButton* _sender,
                                                                       gpointer self);
static void _network_widgets_execepions_page___lambda44_ (Block14Data* _data14_);
static void __network_widgets_execepions_page___lambda44__gtk_entry_activate (GtkEntry* _sender,
                                                                       gpointer self);
static void _network_widgets_execepions_page___lambda45_ (Block14Data* _data14_);
static void __network_widgets_execepions_page___lambda45__gtk_editable_changed (GtkEditable* _sender,
                                                                         gpointer self);
static void network_widgets_execepions_page_finalize (GObject * obj);
static GType network_widgets_execepions_page_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);

static inline gpointer
network_widgets_execepions_page_get_instance_private (NetworkWidgetsExecepionsPage* self)
{
	return G_STRUCT_MEMBER_P (self, NetworkWidgetsExecepionsPage_private_offset);
}

static gchar*
string_strip (const gchar* self)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup (self);
	_result_ = _tmp0_;
	g_strstrip (_result_);
	result = _result_;
	return result;
}

static void
_vala_array_add1 (gchar** * array,
                  gint* length,
                  gint* size,
                  gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
network_widgets_execepions_page_add_exception (NetworkWidgetsExecepionsPage* self,
                                               GtkEntry* entry)
{
	gchar** new_hosts = NULL;
	GSettings* _tmp0_;
	gchar** _tmp1_;
	gchar** _tmp2_;
	gint new_hosts_length1;
	gint _new_hosts_size_;
	const gchar* _tmp3_;
	gchar** _tmp4_;
	gchar** _tmp5_;
	GSettings* _tmp13_;
	gchar** _tmp14_;
	gint _tmp14__length1;
	g_return_if_fail (self != NULL);
	g_return_if_fail (entry != NULL);
	_tmp0_ = network_plug_proxy_settings;
	_tmp2_ = _tmp1_ = g_settings_get_strv (_tmp0_, "ignore-hosts");
	new_hosts = _tmp2_;
	new_hosts_length1 = _vala_array_length (_tmp1_);
	_new_hosts_size_ = new_hosts_length1;
	_tmp3_ = gtk_editable_get_text ((GtkEditable*) entry);
	_tmp5_ = _tmp4_ = g_strsplit (_tmp3_, ",", 0);
	{
		gchar** host_collection = NULL;
		gint host_collection_length1 = 0;
		gint _host_collection_size_ = 0;
		gint host_it = 0;
		host_collection = _tmp5_;
		host_collection_length1 = _vala_array_length (_tmp4_);
		for (host_it = 0; host_it < host_collection_length1; host_it = host_it + 1) {
			gchar* _tmp6_;
			gchar* host = NULL;
			_tmp6_ = g_strdup (host_collection[host_it]);
			host = _tmp6_;
			{
				const gchar* _tmp7_;
				gchar* _tmp8_;
				gchar* _tmp9_;
				gboolean _tmp10_;
				_tmp7_ = host;
				_tmp8_ = string_strip (_tmp7_);
				_tmp9_ = _tmp8_;
				_tmp10_ = g_strcmp0 (_tmp9_, "") != 0;
				_g_free0 (_tmp9_);
				if (_tmp10_) {
					const gchar* _tmp11_;
					gchar* _tmp12_;
					_tmp11_ = host;
					_tmp12_ = string_strip (_tmp11_);
					_vala_array_add1 (&new_hosts, &new_hosts_length1, &_new_hosts_size_, _tmp12_);
				}
				_g_free0 (host);
			}
		}
		host_collection = (_vala_array_free (host_collection, host_collection_length1, (GDestroyNotify) g_free), NULL);
	}
	_tmp13_ = network_plug_proxy_settings;
	_tmp14_ = new_hosts;
	_tmp14__length1 = new_hosts_length1;
	g_settings_set_strv (_tmp13_, "ignore-hosts", _tmp14_);
	gtk_editable_set_text ((GtkEditable*) entry, "");
	network_widgets_execepions_page_update_list (self);
	new_hosts = (_vala_array_free (new_hosts, new_hosts_length1, (GDestroyNotify) g_free), NULL);
}

static Block13Data*
block13_data_ref (Block13Data* _data13_)
{
	g_atomic_int_inc (&_data13_->_ref_count_);
	return _data13_;
}

static void
block13_data_unref (void * _userdata_)
{
	Block13Data* _data13_;
	_data13_ = (Block13Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data13_->_ref_count_)) {
		NetworkWidgetsExecepionsPage* self;
		self = _data13_->self;
		_g_free0 (_data13_->e);
		_g_object_unref0 (self);
		g_slice_free (Block13Data, _data13_);
	}
}

static void
____lambda42_ (Block13Data* _data13_)
{
	NetworkWidgetsExecepionsPage* self;
	const gchar* _tmp0_;
	self = _data13_->self;
	_tmp0_ = _data13_->e;
	network_widgets_execepions_page_remove_exception (self, _tmp0_);
}

static void
_____lambda42__gtk_button_clicked (GtkButton* _sender,
                                   gpointer self)
{
	____lambda42_ (self);
}

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

static void
_vala_array_add2 (GtkListBoxRow** * array,
                  gint* length,
                  gint* size,
                  GtkListBoxRow* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkListBoxRow*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
network_widgets_execepions_page_list_exceptions (NetworkWidgetsExecepionsPage* self)
{
	GSettings* _tmp0_;
	gchar** _tmp1_;
	gchar** _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = network_plug_proxy_settings;
	_tmp2_ = _tmp1_ = g_settings_get_strv (_tmp0_, "ignore-hosts");
	{
		gchar** e_collection = NULL;
		gint e_collection_length1 = 0;
		gint _e_collection_size_ = 0;
		gint e_it = 0;
		e_collection = _tmp2_;
		e_collection_length1 = _vala_array_length (_tmp1_);
		for (e_it = 0; e_it < e_collection_length1; e_it = e_it + 1) {
			gchar* _tmp3_;
			gchar* e = NULL;
			_tmp3_ = g_strdup (e_collection[e_it]);
			e = _tmp3_;
			{
				Block13Data* _data13_;
				GtkLabel* e_label = NULL;
				const gchar* _tmp4_;
				GtkLabel* _tmp5_ = NULL;
				GtkButton* remove_btn = NULL;
				gchar* _tmp6_;
				GtkButton* _tmp7_ = NULL;
				GtkButton* _tmp8_;
				GtkButton* _tmp9_;
				GtkBox* e_box = NULL;
				GtkBox* _tmp10_ = NULL;
				GtkBox* _tmp11_;
				GtkLabel* _tmp12_;
				GtkBox* _tmp13_;
				GtkButton* _tmp14_;
				GtkListBoxRow* row = NULL;
				GtkBox* _tmp15_;
				GtkWidget* _tmp16_;
				GtkListBoxRow* _tmp17_ = NULL;
				GtkListBox* _tmp18_;
				GtkListBoxRow* _tmp19_;
				GtkListBoxRow* _tmp20_;
				GtkListBoxRow* _tmp21_;
				_data13_ = g_slice_new0 (Block13Data);
				_data13_->_ref_count_ = 1;
				_data13_->self = g_object_ref (self);
				_data13_->e = e;
				_tmp4_ = _data13_->e;
				_tmp5_ = (GtkLabel*) gtk_label_new (_tmp4_);
				gtk_widget_set_halign ((GtkWidget*) _tmp5_, GTK_ALIGN_START);
				gtk_widget_set_hexpand ((GtkWidget*) _tmp5_, TRUE);
				g_object_ref_sink (_tmp5_);
				e_label = _tmp5_;
				_tmp6_ = g_strdup (_ ("Remove exception"));
				_tmp7_ = (GtkButton*) gtk_button_new_from_icon_name ("edit-delete-symbolic");
				gtk_widget_set_tooltip_text ((GtkWidget*) _tmp7_, _tmp6_);
				_g_free0 (_tmp6_);
				g_object_ref_sink (_tmp7_);
				remove_btn = _tmp7_;
				_tmp8_ = remove_btn;
				gtk_widget_add_css_class ((GtkWidget*) _tmp8_, GRANITE_STYLE_CLASS_FLAT);
				_tmp9_ = remove_btn;
				g_signal_connect_data (_tmp9_, "clicked", (GCallback) _____lambda42__gtk_button_clicked, block13_data_ref (_data13_), (GClosureNotify) block13_data_unref, 0);
				_tmp10_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
				gtk_widget_set_margin_top ((GtkWidget*) _tmp10_, 3);
				gtk_widget_set_margin_end ((GtkWidget*) _tmp10_, 6);
				gtk_widget_set_margin_bottom ((GtkWidget*) _tmp10_, 3);
				gtk_widget_set_margin_start ((GtkWidget*) _tmp10_, 6);
				g_object_ref_sink (_tmp10_);
				e_box = _tmp10_;
				_tmp11_ = e_box;
				_tmp12_ = e_label;
				gtk_box_append (_tmp11_, (GtkWidget*) _tmp12_);
				_tmp13_ = e_box;
				_tmp14_ = remove_btn;
				gtk_box_append (_tmp13_, (GtkWidget*) _tmp14_);
				_tmp15_ = e_box;
				_tmp16_ = _g_object_ref0 ((GtkWidget*) _tmp15_);
				_tmp17_ = (GtkListBoxRow*) gtk_list_box_row_new ();
				gtk_list_box_row_set_child (_tmp17_, _tmp16_);
				_g_object_unref0 (_tmp16_);
				g_object_ref_sink (_tmp17_);
				row = _tmp17_;
				_tmp18_ = self->priv->ignored_list;
				_tmp19_ = row;
				gtk_list_box_append (_tmp18_, (GtkWidget*) _tmp19_);
				_tmp20_ = row;
				_tmp21_ = _g_object_ref0 (_tmp20_);
				_vala_array_add2 (&self->priv->items, &self->priv->items_length1, &self->priv->_items_size_, _tmp21_);
				_g_object_unref0 (row);
				_g_object_unref0 (e_box);
				_g_object_unref0 (remove_btn);
				_g_object_unref0 (e_label);
				block13_data_unref (_data13_);
				_data13_ = NULL;
			}
		}
		e_collection = (_vala_array_free (e_collection, e_collection_length1, (GDestroyNotify) g_free), NULL);
	}
}

static void
_vala_array_add3 (gchar** * array,
                  gint* length,
                  gint* size,
                  gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
network_widgets_execepions_page_remove_exception (NetworkWidgetsExecepionsPage* self,
                                                  const gchar* exception)
{
	gchar** new_hosts = NULL;
	gchar** _tmp0_;
	gint new_hosts_length1;
	gint _new_hosts_size_;
	GSettings* _tmp1_;
	gchar** _tmp2_;
	gchar** _tmp3_;
	GSettings* _tmp8_;
	gchar** _tmp9_;
	gint _tmp9__length1;
	g_return_if_fail (self != NULL);
	g_return_if_fail (exception != NULL);
	_tmp0_ = g_new0 (gchar*, 0 + 1);
	new_hosts = _tmp0_;
	new_hosts_length1 = 0;
	_new_hosts_size_ = new_hosts_length1;
	_tmp1_ = network_plug_proxy_settings;
	_tmp3_ = _tmp2_ = g_settings_get_strv (_tmp1_, "ignore-hosts");
	{
		gchar** host_collection = NULL;
		gint host_collection_length1 = 0;
		gint _host_collection_size_ = 0;
		gint host_it = 0;
		host_collection = _tmp3_;
		host_collection_length1 = _vala_array_length (_tmp2_);
		for (host_it = 0; host_it < host_collection_length1; host_it = host_it + 1) {
			gchar* _tmp4_;
			gchar* host = NULL;
			_tmp4_ = g_strdup (host_collection[host_it]);
			host = _tmp4_;
			{
				const gchar* _tmp5_;
				_tmp5_ = host;
				if (g_strcmp0 (_tmp5_, exception) != 0) {
					const gchar* _tmp6_;
					gchar* _tmp7_;
					_tmp6_ = host;
					_tmp7_ = g_strdup (_tmp6_);
					_vala_array_add3 (&new_hosts, &new_hosts_length1, &_new_hosts_size_, _tmp7_);
				}
				_g_free0 (host);
			}
		}
		host_collection = (_vala_array_free (host_collection, host_collection_length1, (GDestroyNotify) g_free), NULL);
	}
	_tmp8_ = network_plug_proxy_settings;
	_tmp9_ = new_hosts;
	_tmp9__length1 = new_hosts_length1;
	g_settings_set_strv (_tmp8_, "ignore-hosts", _tmp9_);
	network_widgets_execepions_page_update_list (self);
	new_hosts = (_vala_array_free (new_hosts, new_hosts_length1, (GDestroyNotify) g_free), NULL);
}

static void
network_widgets_execepions_page_update_list (NetworkWidgetsExecepionsPage* self)
{
	GtkListBoxRow** _tmp0_;
	gint _tmp0__length1;
	GtkListBoxRow** _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->items;
	_tmp0__length1 = self->priv->items_length1;
	{
		GtkListBoxRow** item_collection = NULL;
		gint item_collection_length1 = 0;
		gint _item_collection_size_ = 0;
		gint item_it = 0;
		item_collection = _tmp0_;
		item_collection_length1 = _tmp0__length1;
		for (item_it = 0; item_it < item_collection_length1; item_it = item_it + 1) {
			GtkListBoxRow* _tmp1_;
			GtkListBoxRow* item = NULL;
			_tmp1_ = _g_object_ref0 (item_collection[item_it]);
			item = _tmp1_;
			{
				GtkListBox* _tmp2_;
				GtkListBoxRow* _tmp3_;
				_tmp2_ = self->priv->ignored_list;
				_tmp3_ = item;
				gtk_list_box_remove (_tmp2_, (GtkWidget*) _tmp3_);
				_g_object_unref0 (item);
			}
		}
	}
	_tmp4_ = g_new0 (GtkListBoxRow*, 0 + 1);
	self->priv->items = (_vala_array_free (self->priv->items, self->priv->items_length1, (GDestroyNotify) g_object_unref), NULL);
	self->priv->items = _tmp4_;
	self->priv->items_length1 = 0;
	self->priv->_items_size_ = self->priv->items_length1;
	network_widgets_execepions_page_list_exceptions (self);
}

NetworkWidgetsExecepionsPage*
network_widgets_execepions_page_construct (GType object_type)
{
	NetworkWidgetsExecepionsPage * self = NULL;
	self = (NetworkWidgetsExecepionsPage*) g_object_new (object_type, NULL);
	return self;
}

NetworkWidgetsExecepionsPage*
network_widgets_execepions_page_new (void)
{
	return network_widgets_execepions_page_construct (NETWORK_WIDGETS_TYPE_EXECEPIONS_PAGE);
}

static Block14Data*
block14_data_ref (Block14Data* _data14_)
{
	g_atomic_int_inc (&_data14_->_ref_count_);
	return _data14_;
}

static void
block14_data_unref (void * _userdata_)
{
	Block14Data* _data14_;
	_data14_ = (Block14Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data14_->_ref_count_)) {
		NetworkWidgetsExecepionsPage* self;
		self = _data14_->self;
		_g_object_unref0 (_data14_->add_btn);
		_g_object_unref0 (_data14_->entry);
		_g_object_unref0 (self);
		g_slice_free (Block14Data, _data14_);
	}
}

static void
_network_widgets_execepions_page___lambda43_ (Block14Data* _data14_)
{
	NetworkWidgetsExecepionsPage* self;
	GtkEntry* _tmp0_;
	self = _data14_->self;
	_tmp0_ = _data14_->entry;
	network_widgets_execepions_page_add_exception (self, _tmp0_);
}

static void
__network_widgets_execepions_page___lambda43__gtk_button_clicked (GtkButton* _sender,
                                                                  gpointer self)
{
	_network_widgets_execepions_page___lambda43_ (self);
}

static void
_network_widgets_execepions_page___lambda44_ (Block14Data* _data14_)
{
	NetworkWidgetsExecepionsPage* self;
	GtkButton* _tmp0_;
	self = _data14_->self;
	_tmp0_ = _data14_->add_btn;
	g_signal_emit_by_name (_tmp0_, "clicked");
}

static void
__network_widgets_execepions_page___lambda44__gtk_entry_activate (GtkEntry* _sender,
                                                                  gpointer self)
{
	_network_widgets_execepions_page___lambda44_ (self);
}

static void
_network_widgets_execepions_page___lambda45_ (Block14Data* _data14_)
{
	NetworkWidgetsExecepionsPage* self;
	GtkButton* _tmp0_;
	GtkEntry* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	self = _data14_->self;
	_tmp0_ = _data14_->add_btn;
	_tmp1_ = _data14_->entry;
	_tmp2_ = gtk_editable_get_text ((GtkEditable*) _tmp1_);
	_tmp3_ = _tmp2_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp0_, g_strcmp0 (_tmp3_, "") != 0);
}

static void
__network_widgets_execepions_page___lambda45__gtk_editable_changed (GtkEditable* _sender,
                                                                    gpointer self)
{
	_network_widgets_execepions_page___lambda45_ (self);
}

static GObject *
network_widgets_execepions_page_constructor (GType type,
                                             guint n_construct_properties,
                                             GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	NetworkWidgetsExecepionsPage * self;
	Block14Data* _data14_;
	GtkListBox* _tmp0_ = NULL;
	GtkFrame* frame = NULL;
	GtkListBox* _tmp1_;
	GtkWidget* _tmp2_;
	GtkFrame* _tmp3_ = NULL;
	GraniteHeaderLabel* ign_label = NULL;
	GtkListBox* _tmp4_;
	GtkWidget* _tmp5_;
	GraniteHeaderLabel* _tmp6_ = NULL;
	gchar* _tmp7_;
	GtkEntry* _tmp8_ = NULL;
	GtkButton* _tmp9_ = NULL;
	GtkButton* _tmp10_;
	GtkBox* box_btn = NULL;
	GtkBox* _tmp11_ = NULL;
	GtkBox* _tmp12_;
	GtkEntry* _tmp13_;
	GtkBox* _tmp14_;
	GtkButton* _tmp15_;
	GraniteHeaderLabel* _tmp16_;
	GtkFrame* _tmp17_;
	GtkBox* _tmp18_;
	GtkButton* _tmp19_;
	GtkEntry* _tmp20_;
	GtkEntry* _tmp21_;
	parent_class = G_OBJECT_CLASS (network_widgets_execepions_page_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, NETWORK_WIDGETS_TYPE_EXECEPIONS_PAGE, NetworkWidgetsExecepionsPage);
	_data14_ = g_slice_new0 (Block14Data);
	_data14_->_ref_count_ = 1;
	_data14_->self = g_object_ref (self);
	_tmp0_ = (GtkListBox*) gtk_list_box_new ();
	gtk_widget_set_vexpand ((GtkWidget*) _tmp0_, TRUE);
	gtk_list_box_set_selection_mode (_tmp0_, GTK_SELECTION_SINGLE);
	gtk_list_box_set_activate_on_single_click (_tmp0_, FALSE);
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->ignored_list);
	self->priv->ignored_list = _tmp0_;
	_tmp1_ = self->priv->ignored_list;
	_tmp2_ = _g_object_ref0 ((GtkWidget*) _tmp1_);
	_tmp3_ = (GtkFrame*) gtk_frame_new (NULL);
	gtk_frame_set_child (_tmp3_, _tmp2_);
	_g_object_unref0 (_tmp2_);
	g_object_ref_sink (_tmp3_);
	frame = _tmp3_;
	_tmp4_ = self->priv->ignored_list;
	_tmp5_ = _g_object_ref0 ((GtkWidget*) _tmp4_);
	_tmp6_ = granite_header_label_new (_ ("Ignored hosts"));
	granite_header_label_set_mnemonic_widget (_tmp6_, _tmp5_);
	_g_object_unref0 (_tmp5_);
	g_object_ref_sink (_tmp6_);
	ign_label = _tmp6_;
	_tmp7_ = g_strdup (_ ("Exception to add (separate with commas to add multiple)"));
	_tmp8_ = (GtkEntry*) gtk_entry_new ();
	gtk_widget_set_hexpand ((GtkWidget*) _tmp8_, TRUE);
	gtk_entry_set_placeholder_text (_tmp8_, _tmp7_);
	_g_free0 (_tmp7_);
	g_object_ref_sink (_tmp8_);
	_data14_->entry = _tmp8_;
	_tmp9_ = (GtkButton*) gtk_button_new_with_label (_ ("Add Exception"));
	gtk_widget_set_sensitive ((GtkWidget*) _tmp9_, FALSE);
	g_object_ref_sink (_tmp9_);
	_data14_->add_btn = _tmp9_;
	_tmp10_ = _data14_->add_btn;
	gtk_widget_add_css_class ((GtkWidget*) _tmp10_, GRANITE_STYLE_CLASS_SUGGESTED_ACTION);
	_tmp11_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp11_, 12);
	g_object_ref_sink (_tmp11_);
	box_btn = _tmp11_;
	_tmp12_ = box_btn;
	_tmp13_ = _data14_->entry;
	gtk_box_append (_tmp12_, (GtkWidget*) _tmp13_);
	_tmp14_ = box_btn;
	_tmp15_ = _data14_->add_btn;
	gtk_box_append (_tmp14_, (GtkWidget*) _tmp15_);
	network_widgets_execepions_page_list_exceptions (self);
	gtk_orientable_set_orientation ((GtkOrientable*) self, GTK_ORIENTATION_VERTICAL);
	_tmp16_ = ign_label;
	gtk_box_append ((GtkBox*) self, (GtkWidget*) _tmp16_);
	_tmp17_ = frame;
	gtk_box_append ((GtkBox*) self, (GtkWidget*) _tmp17_);
	_tmp18_ = box_btn;
	gtk_box_append ((GtkBox*) self, (GtkWidget*) _tmp18_);
	_tmp19_ = _data14_->add_btn;
	g_signal_connect_data (_tmp19_, "clicked", (GCallback) __network_widgets_execepions_page___lambda43__gtk_button_clicked, block14_data_ref (_data14_), (GClosureNotify) block14_data_unref, 0);
	_tmp20_ = _data14_->entry;
	g_signal_connect_data (_tmp20_, "activate", (GCallback) __network_widgets_execepions_page___lambda44__gtk_entry_activate, block14_data_ref (_data14_), (GClosureNotify) block14_data_unref, 0);
	_tmp21_ = _data14_->entry;
	g_signal_connect_data ((GtkEditable*) _tmp21_, "changed", (GCallback) __network_widgets_execepions_page___lambda45__gtk_editable_changed, block14_data_ref (_data14_), (GClosureNotify) block14_data_unref, 0);
	_g_object_unref0 (box_btn);
	_g_object_unref0 (ign_label);
	_g_object_unref0 (frame);
	block14_data_unref (_data14_);
	_data14_ = NULL;
	return obj;
}

static void
network_widgets_execepions_page_class_init (NetworkWidgetsExecepionsPageClass * klass,
                                            gpointer klass_data)
{
	network_widgets_execepions_page_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &NetworkWidgetsExecepionsPage_private_offset);
	G_OBJECT_CLASS (klass)->constructor = network_widgets_execepions_page_constructor;
	G_OBJECT_CLASS (klass)->finalize = network_widgets_execepions_page_finalize;
}

static void
network_widgets_execepions_page_instance_init (NetworkWidgetsExecepionsPage * self,
                                               gpointer klass)
{
	GtkListBoxRow** _tmp0_;
	self->priv = network_widgets_execepions_page_get_instance_private (self);
	_tmp0_ = g_new0 (GtkListBoxRow*, 0 + 1);
	self->priv->items = _tmp0_;
	self->priv->items_length1 = 0;
	self->priv->_items_size_ = self->priv->items_length1;
}

static void
network_widgets_execepions_page_finalize (GObject * obj)
{
	NetworkWidgetsExecepionsPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, NETWORK_WIDGETS_TYPE_EXECEPIONS_PAGE, NetworkWidgetsExecepionsPage);
	_g_object_unref0 (self->priv->ignored_list);
	self->priv->items = (_vala_array_free (self->priv->items, self->priv->items_length1, (GDestroyNotify) g_object_unref), NULL);
	G_OBJECT_CLASS (network_widgets_execepions_page_parent_class)->finalize (obj);
}

static GType
network_widgets_execepions_page_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (NetworkWidgetsExecepionsPageClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) network_widgets_execepions_page_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (NetworkWidgetsExecepionsPage), 0, (GInstanceInitFunc) network_widgets_execepions_page_instance_init, NULL };
	GType network_widgets_execepions_page_type_id;
	network_widgets_execepions_page_type_id = g_type_register_static (gtk_box_get_type (), "NetworkWidgetsExecepionsPage", &g_define_type_info, 0);
	NetworkWidgetsExecepionsPage_private_offset = g_type_add_instance_private (network_widgets_execepions_page_type_id, sizeof (NetworkWidgetsExecepionsPagePrivate));
	return network_widgets_execepions_page_type_id;
}

GType
network_widgets_execepions_page_get_type (void)
{
	static volatile gsize network_widgets_execepions_page_type_id__once = 0;
	if (g_once_init_enter (&network_widgets_execepions_page_type_id__once)) {
		GType network_widgets_execepions_page_type_id;
		network_widgets_execepions_page_type_id = network_widgets_execepions_page_get_type_once ();
		g_once_init_leave (&network_widgets_execepions_page_type_id__once, network_widgets_execepions_page_type_id);
	}
	return network_widgets_execepions_page_type_id__once;
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

static gssize
_vala_array_length (gpointer array)
{
	gssize length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}

