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

/* Copyright 2011-2017 elementary LLC. (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 General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see http://www.gnu.org/licenses/.
*/

#include "locale-plug.h"
#include <gtk/gtk.h>
#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>
#include <float.h>
#include <math.h>
#include <glib/gi18n-lib.h>

enum  {
	SWITCHBOARD_PLUG_LOCALE_WIDGETS_INSTALL_POPOVER_0_PROPERTY,
	SWITCHBOARD_PLUG_LOCALE_WIDGETS_INSTALL_POPOVER_NUM_PROPERTIES
};
static GParamSpec* switchboard_plug_locale_widgets_install_popover_properties[SWITCHBOARD_PLUG_LOCALE_WIDGETS_INSTALL_POPOVER_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define SWITCHBOARD_PLUG_LOCALE_WIDGETS_INSTALL_POPOVER_TYPE_LANG_ROW (switchboard_plug_locale_widgets_install_popover_lang_row_get_type ())
#define SWITCHBOARD_PLUG_LOCALE_WIDGETS_INSTALL_POPOVER_LANG_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWITCHBOARD_PLUG_LOCALE_WIDGETS_INSTALL_POPOVER_TYPE_LANG_ROW, SwitchboardPlugLocaleWidgetsInstallPopoverLangRow))
#define SWITCHBOARD_PLUG_LOCALE_WIDGETS_INSTALL_POPOVER_LANG_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWITCHBOARD_PLUG_LOCALE_WIDGETS_INSTALL_POPOVER_TYPE_LANG_ROW, SwitchboardPlugLocaleWidgetsInstallPopoverLangRowClass))
#define SWITCHBOARD_PLUG_LOCALE_WIDGETS_INSTALL_POPOVER_IS_LANG_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWITCHBOARD_PLUG_LOCALE_WIDGETS_INSTALL_POPOVER_TYPE_LANG_ROW))
#define SWITCHBOARD_PLUG_LOCALE_WIDGETS_INSTALL_POPOVER_IS_LANG_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWITCHBOARD_PLUG_LOCALE_WIDGETS_INSTALL_POPOVER_TYPE_LANG_ROW))
#define SWITCHBOARD_PLUG_LOCALE_WIDGETS_INSTALL_POPOVER_LANG_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWITCHBOARD_PLUG_LOCALE_WIDGETS_INSTALL_POPOVER_TYPE_LANG_ROW, SwitchboardPlugLocaleWidgetsInstallPopoverLangRowClass))

typedef struct _SwitchboardPlugLocaleWidgetsInstallPopoverLangRow SwitchboardPlugLocaleWidgetsInstallPopoverLangRow;
typedef struct _SwitchboardPlugLocaleWidgetsInstallPopoverLangRowClass SwitchboardPlugLocaleWidgetsInstallPopoverLangRowClass;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _SwitchboardPlugLocaleWidgetsInstallPopoverLangRowPrivate SwitchboardPlugLocaleWidgetsInstallPopoverLangRowPrivate;
enum  {
	SWITCHBOARD_PLUG_LOCALE_WIDGETS_INSTALL_POPOVER_LANG_ROW_0_PROPERTY,
	SWITCHBOARD_PLUG_LOCALE_WIDGETS_INSTALL_POPOVER_LANG_ROW_LANG_PROPERTY,
	SWITCHBOARD_PLUG_LOCALE_WIDGETS_INSTALL_POPOVER_LANG_ROW_NUM_PROPERTIES
};
static GParamSpec* switchboard_plug_locale_widgets_install_popover_lang_row_properties[SWITCHBOARD_PLUG_LOCALE_WIDGETS_INSTALL_POPOVER_LANG_ROW_NUM_PROPERTIES];
typedef struct _Block6Data Block6Data;
enum  {
	SWITCHBOARD_PLUG_LOCALE_WIDGETS_INSTALL_POPOVER_LANGUAGE_SELECTED_SIGNAL,
	SWITCHBOARD_PLUG_LOCALE_WIDGETS_INSTALL_POPOVER_NUM_SIGNALS
};
static guint switchboard_plug_locale_widgets_install_popover_signals[SWITCHBOARD_PLUG_LOCALE_WIDGETS_INSTALL_POPOVER_NUM_SIGNALS] = {0};

struct _SwitchboardPlugLocaleWidgetsInstallPopoverPrivate {
	GtkSearchEntry* search_entry;
	GtkListBox* list_box;
};

struct _SwitchboardPlugLocaleWidgetsInstallPopoverLangRow {
	GtkListBoxRow parent_instance;
	SwitchboardPlugLocaleWidgetsInstallPopoverLangRowPrivate * priv;
};

struct _SwitchboardPlugLocaleWidgetsInstallPopoverLangRowClass {
	GtkListBoxRowClass parent_class;
};

struct _SwitchboardPlugLocaleWidgetsInstallPopoverLangRowPrivate {
	gchar* _lang;
};

struct _Block6Data {
	int _ref_count_;
	SwitchboardPlugLocaleWidgetsInstallPopover* self;
	GtkButton* button_add;
};

static gint SwitchboardPlugLocaleWidgetsInstallPopover_private_offset;
static gpointer switchboard_plug_locale_widgets_install_popover_parent_class = NULL;
static gint SwitchboardPlugLocaleWidgetsInstallPopoverLangRow_private_offset;
static gpointer switchboard_plug_locale_widgets_install_popover_lang_row_parent_class = NULL;

static void switchboard_plug_locale_widgets_install_popover_install_selected (SwitchboardPlugLocaleWidgetsInstallPopover* self);
static GType switchboard_plug_locale_widgets_install_popover_lang_row_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static const gchar* switchboard_plug_locale_widgets_install_popover_lang_row_get_lang (SwitchboardPlugLocaleWidgetsInstallPopoverLangRow* self);
static gint switchboard_plug_locale_widgets_install_popover_sort_function (SwitchboardPlugLocaleWidgetsInstallPopoverLangRow* row1,
                                                                    SwitchboardPlugLocaleWidgetsInstallPopoverLangRow* row2,
                                                                    SwitchboardPlugLocaleWidgetsInstallPopover* self);
static gboolean switchboard_plug_locale_widgets_install_popover_filter_function (SwitchboardPlugLocaleWidgetsInstallPopoverLangRow* row,
                                                                          SwitchboardPlugLocaleWidgetsInstallPopover* self);
static void switchboard_plug_locale_widgets_install_popover_load_languagelist (SwitchboardPlugLocaleWidgetsInstallPopover* self);
static void _g_free0_ (gpointer var);
static inline void _g_list_free__g_free0_ (GList* self);
static SwitchboardPlugLocaleWidgetsInstallPopoverLangRow* switchboard_plug_locale_widgets_install_popover_lang_row_new (const gchar* lang);
static SwitchboardPlugLocaleWidgetsInstallPopoverLangRow* switchboard_plug_locale_widgets_install_popover_lang_row_construct (GType object_type,
                                                                                                                       const gchar* lang);
static void switchboard_plug_locale_widgets_install_popover_lang_row_set_lang (SwitchboardPlugLocaleWidgetsInstallPopoverLangRow* self,
                                                                        const gchar* value);
static GObject * switchboard_plug_locale_widgets_install_popover_lang_row_constructor (GType type,
                                                                                guint n_construct_properties,
                                                                                GObjectConstructParam * construct_properties);
static void switchboard_plug_locale_widgets_install_popover_lang_row_finalize (GObject * obj);
static GType switchboard_plug_locale_widgets_install_popover_lang_row_get_type_once (void);
static void _vala_switchboard_plug_locale_widgets_install_popover_lang_row_get_property (GObject * object,
                                                                                  guint property_id,
                                                                                  GValue * value,
                                                                                  GParamSpec * pspec);
static void _vala_switchboard_plug_locale_widgets_install_popover_lang_row_set_property (GObject * object,
                                                                                  guint property_id,
                                                                                  const GValue * value,
                                                                                  GParamSpec * pspec);
static GObject * switchboard_plug_locale_widgets_install_popover_constructor (GType type,
                                                                       guint n_construct_properties,
                                                                       GObjectConstructParam * construct_properties);
static Block6Data* block6_data_ref (Block6Data* _data6_);
static void block6_data_unref (void * _userdata_);
static void _switchboard_plug_locale_widgets_install_popover___lambda10_ (Block6Data* _data6_,
                                                                   GtkListBoxRow* row);
static void __switchboard_plug_locale_widgets_install_popover___lambda10__gtk_list_box_row_selected (GtkListBox* _sender,
                                                                                              GtkListBoxRow* row,
                                                                                              gpointer self);
static void _switchboard_plug_locale_widgets_install_popover_install_selected_gtk_list_box_row_activated (GtkListBox* _sender,
                                                                                                   GtkListBoxRow* row,
                                                                                                   gpointer self);
static void _switchboard_plug_locale_widgets_install_popover_install_selected_gtk_button_clicked (GtkButton* _sender,
                                                                                           gpointer self);
static void _switchboard_plug_locale_widgets_install_popover___lambda11_ (SwitchboardPlugLocaleWidgetsInstallPopover* self);
static void __switchboard_plug_locale_widgets_install_popover___lambda11__gtk_button_clicked (GtkButton* _sender,
                                                                                       gpointer self);
static void _switchboard_plug_locale_widgets_install_popover___lambda12_ (SwitchboardPlugLocaleWidgetsInstallPopover* self);
static void __switchboard_plug_locale_widgets_install_popover___lambda12__gtk_entry_activate (GtkEntry* _sender,
                                                                                       gpointer self);
static void _switchboard_plug_locale_widgets_install_popover___lambda13_ (SwitchboardPlugLocaleWidgetsInstallPopover* self);
static void __switchboard_plug_locale_widgets_install_popover___lambda13__gtk_search_entry_search_changed (GtkSearchEntry* _sender,
                                                                                                    gpointer self);
static void switchboard_plug_locale_widgets_install_popover_finalize (GObject * obj);
static GType switchboard_plug_locale_widgets_install_popover_get_type_once (void);

static inline gpointer
switchboard_plug_locale_widgets_install_popover_get_instance_private (SwitchboardPlugLocaleWidgetsInstallPopover* self)
{
	return G_STRUCT_MEMBER_P (self, SwitchboardPlugLocaleWidgetsInstallPopover_private_offset);
}

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

static void
switchboard_plug_locale_widgets_install_popover_install_selected (SwitchboardPlugLocaleWidgetsInstallPopover* self)
{
	SwitchboardPlugLocaleWidgetsInstallPopoverLangRow* langrow = NULL;
	GtkListBox* _tmp0_;
	GtkListBoxRow* _tmp1_;
	SwitchboardPlugLocaleWidgetsInstallPopoverLangRow* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	g_return_if_fail (self != NULL);
	gtk_popover_popdown ((GtkPopover*) self);
	_tmp0_ = self->priv->list_box;
	_tmp1_ = gtk_list_box_get_selected_row (_tmp0_);
	_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, SWITCHBOARD_PLUG_LOCALE_WIDGETS_INSTALL_POPOVER_TYPE_LANG_ROW, SwitchboardPlugLocaleWidgetsInstallPopoverLangRow));
	langrow = _tmp2_;
	_tmp3_ = switchboard_plug_locale_widgets_install_popover_lang_row_get_lang (langrow);
	_tmp4_ = _tmp3_;
	g_signal_emit (self, switchboard_plug_locale_widgets_install_popover_signals[SWITCHBOARD_PLUG_LOCALE_WIDGETS_INSTALL_POPOVER_LANGUAGE_SELECTED_SIGNAL], 0, _tmp4_);
	_g_object_unref0 (langrow);
}

static gint
switchboard_plug_locale_widgets_install_popover_sort_function (SwitchboardPlugLocaleWidgetsInstallPopoverLangRow* row1,
                                                               SwitchboardPlugLocaleWidgetsInstallPopoverLangRow* row2,
                                                               SwitchboardPlugLocaleWidgetsInstallPopover* self)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gint result;
	g_return_val_if_fail (self != NULL, 0);
	g_return_val_if_fail (row1 != NULL, 0);
	g_return_val_if_fail (row2 != NULL, 0);
	_tmp0_ = switchboard_plug_locale_widgets_install_popover_lang_row_get_lang (row1);
	_tmp1_ = _tmp0_;
	_tmp2_ = switchboard_plug_locale_widgets_install_popover_lang_row_get_lang (row2);
	_tmp3_ = _tmp2_;
	result = g_utf8_collate (_tmp1_, _tmp3_);
	return result;
}

static gboolean
string_contains (const gchar* self,
                 const gchar* needle)
{
	gchar* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (needle != NULL, FALSE);
	_tmp0_ = strstr ((gchar*) self, (gchar*) needle);
	result = _tmp0_ != NULL;
	return result;
}

static gboolean
switchboard_plug_locale_widgets_install_popover_filter_function (SwitchboardPlugLocaleWidgetsInstallPopoverLangRow* row,
                                                                 SwitchboardPlugLocaleWidgetsInstallPopover* self)
{
	GtkSearchEntry* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* search_term = NULL;
	GtkSearchEntry* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* english_lang = NULL;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* translated_lang = NULL;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	gboolean _tmp19_ = FALSE;
	const gchar* _tmp20_;
	const gchar* _tmp21_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (row != NULL, FALSE);
	_tmp0_ = self->priv->search_entry;
	_tmp1_ = gtk_entry_get_text ((GtkEntry*) _tmp0_);
	_tmp2_ = _tmp1_;
	if (g_strcmp0 (_tmp2_, "") == 0) {
		result = TRUE;
		return result;
	}
	_tmp3_ = self->priv->search_entry;
	_tmp4_ = gtk_entry_get_text ((GtkEntry*) _tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = g_utf8_strdown (_tmp5_, (gssize) -1);
	search_term = _tmp6_;
	_tmp7_ = switchboard_plug_locale_widgets_install_popover_lang_row_get_lang (row);
	_tmp8_ = _tmp7_;
	_tmp9_ = switchboard_plug_locale_utils_translate (_tmp8_, "C");
	_tmp10_ = _tmp9_;
	_tmp11_ = g_utf8_strdown (_tmp10_, (gssize) -1);
	_tmp12_ = _tmp11_;
	_g_free0 (_tmp10_);
	english_lang = _tmp12_;
	_tmp13_ = switchboard_plug_locale_widgets_install_popover_lang_row_get_lang (row);
	_tmp14_ = _tmp13_;
	_tmp15_ = switchboard_plug_locale_utils_translate (_tmp14_, NULL);
	_tmp16_ = _tmp15_;
	_tmp17_ = g_utf8_strdown (_tmp16_, (gssize) -1);
	_tmp18_ = _tmp17_;
	_g_free0 (_tmp16_);
	translated_lang = _tmp18_;
	_tmp20_ = english_lang;
	_tmp21_ = search_term;
	if (string_contains (_tmp20_, _tmp21_)) {
		_tmp19_ = TRUE;
	} else {
		const gchar* _tmp22_;
		const gchar* _tmp23_;
		_tmp22_ = translated_lang;
		_tmp23_ = search_term;
		_tmp19_ = string_contains (_tmp22_, _tmp23_);
	}
	if (_tmp19_) {
		result = TRUE;
		_g_free0 (translated_lang);
		_g_free0 (english_lang);
		_g_free0 (search_term);
		return result;
	}
	result = FALSE;
	_g_free0 (translated_lang);
	_g_free0 (english_lang);
	_g_free0 (search_term);
	return result;
}

static void
_g_free0_ (gpointer var)
{
	var = (g_free (var), NULL);
}

static inline void
_g_list_free__g_free0_ (GList* self)
{
	g_list_free_full (self, (GDestroyNotify) _g_free0_);
}

static glong
string_strnlen (gchar* str,
                glong maxlen)
{
	gchar* end = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	glong result;
	_tmp0_ = memchr (str, 0, (gsize) maxlen);
	end = _tmp0_;
	_tmp1_ = end;
	if (_tmp1_ == NULL) {
		result = maxlen;
		return result;
	} else {
		gchar* _tmp2_;
		_tmp2_ = end;
		result = (glong) (_tmp2_ - str);
		return result;
	}
}

static gchar*
string_substring (const gchar* self,
                  glong offset,
                  glong len)
{
	glong string_length = 0L;
	gboolean _tmp0_ = FALSE;
	gchar* _tmp3_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	if (offset >= ((glong) 0)) {
		_tmp0_ = len >= ((glong) 0);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		string_length = string_strnlen ((gchar*) self, offset + len);
	} else {
		gint _tmp1_;
		gint _tmp2_;
		_tmp1_ = strlen (self);
		_tmp2_ = _tmp1_;
		string_length = (glong) _tmp2_;
	}
	if (offset < ((glong) 0)) {
		offset = string_length + offset;
		g_return_val_if_fail (offset >= ((glong) 0), NULL);
	} else {
		g_return_val_if_fail (offset <= string_length, NULL);
	}
	if (len < ((glong) 0)) {
		len = string_length - offset;
	}
	g_return_val_if_fail ((offset + len) <= string_length, NULL);
	_tmp3_ = g_strndup (((gchar*) self) + offset, (gsize) len);
	result = _tmp3_;
	return result;
}

static void
switchboard_plug_locale_widgets_install_popover_load_languagelist (SwitchboardPlugLocaleWidgetsInstallPopover* self)
{
	GFile* file = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	GFile* _tmp2_;
	GFile* _tmp3_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_build_path ("/", CONSTANTS_PKGDATADIR, "languagelist", NULL);
	_tmp1_ = _tmp0_;
	_tmp2_ = g_file_new_for_path (_tmp1_);
	_tmp3_ = _tmp2_;
	_g_free0 (_tmp1_);
	file = _tmp3_;
	{
		GFileInputStream* _tmp4_ = NULL;
		GFile* _tmp5_;
		GFileInputStream* _tmp6_;
		GDataInputStream* dis = NULL;
		GDataInputStream* _tmp7_;
		gchar* line = NULL;
		GList* langs = NULL;
		GtkListBox* _tmp30_;
		_tmp5_ = file;
		_tmp6_ = g_file_read (_tmp5_, NULL, &_inner_error0_);
		_tmp4_ = _tmp6_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp7_ = g_data_input_stream_new ((GInputStream*) _tmp4_);
		dis = _tmp7_;
		langs = NULL;
		while (TRUE) {
			gchar* _tmp8_ = NULL;
			GDataInputStream* _tmp9_;
			gchar* _tmp10_;
			gchar* _tmp11_;
			const gchar* _tmp12_;
			gboolean _tmp13_ = FALSE;
			const gchar* _tmp14_;
			gchar* _tmp15_;
			gchar* _tmp16_;
			gboolean _tmp17_;
			_tmp9_ = dis;
			_tmp10_ = g_data_input_stream_read_line (_tmp9_, NULL, NULL, &_inner_error0_);
			_tmp8_ = _tmp10_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				(langs == NULL) ? NULL : (langs = (_g_list_free__g_free0_ (langs), NULL));
				_g_free0 (line);
				_g_object_unref0 (dis);
				_g_object_unref0 (_tmp4_);
				goto __catch0_g_error;
			}
			_tmp11_ = _tmp8_;
			_tmp8_ = NULL;
			_g_free0 (line);
			line = _tmp11_;
			_tmp12_ = line;
			if (!(_tmp12_ != NULL)) {
				_g_free0 (_tmp8_);
				break;
			}
			_tmp14_ = line;
			_tmp15_ = string_substring (_tmp14_, (glong) 0, (glong) 1);
			_tmp16_ = _tmp15_;
			_tmp17_ = g_strcmp0 (_tmp16_, "#") != 0;
			_g_free0 (_tmp16_);
			if (_tmp17_) {
				const gchar* _tmp18_;
				_tmp18_ = line;
				_tmp13_ = g_strcmp0 (_tmp18_, "") != 0;
			} else {
				_tmp13_ = FALSE;
			}
			if (_tmp13_) {
				const gchar* _tmp19_;
				GList* _tmp20_;
				const gchar* _tmp21_;
				GCompareFunc _tmp22_;
				GList* _tmp23_;
				_tmp19_ = line;
				if (g_strcmp0 (_tmp19_, "ia") == 0) {
					_g_free0 (_tmp8_);
					continue;
				}
				_tmp20_ = langs;
				_tmp21_ = line;
				_tmp22_ = ((GCompareFunc) g_strcmp0);
				_tmp23_ = g_list_find_custom (_tmp20_, _tmp21_, _tmp22_);
				if (g_list_length (_tmp23_) == ((guint) 0)) {
					SwitchboardPlugLocaleWidgetsInstallPopoverLangRow* langrow = NULL;
					const gchar* _tmp24_;
					SwitchboardPlugLocaleWidgetsInstallPopoverLangRow* _tmp25_;
					GtkListBox* _tmp26_;
					SwitchboardPlugLocaleWidgetsInstallPopoverLangRow* _tmp27_;
					const gchar* _tmp28_;
					gchar* _tmp29_;
					_tmp24_ = line;
					_tmp25_ = switchboard_plug_locale_widgets_install_popover_lang_row_new (_tmp24_);
					g_object_ref_sink (_tmp25_);
					langrow = _tmp25_;
					_tmp26_ = self->priv->list_box;
					_tmp27_ = langrow;
					gtk_container_add ((GtkContainer*) _tmp26_, (GtkWidget*) _tmp27_);
					_tmp28_ = line;
					_tmp29_ = g_strdup (_tmp28_);
					langs = g_list_append (langs, _tmp29_);
					_g_object_unref0 (langrow);
				}
			}
			_g_free0 (_tmp8_);
		}
		_tmp30_ = self->priv->list_box;
		gtk_widget_show_all ((GtkWidget*) _tmp30_);
		(langs == NULL) ? NULL : (langs = (_g_list_free__g_free0_ (langs), NULL));
		_g_free0 (line);
		_g_object_unref0 (dis);
		_g_object_unref0 (_tmp4_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp31_;
		const gchar* _tmp32_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp31_ = e;
		_tmp32_ = _tmp31_->message;
		g_critical ("InstallPopover.vala:141: %s", _tmp32_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (file);
		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;
	}
	_g_object_unref0 (file);
}

SwitchboardPlugLocaleWidgetsInstallPopover*
switchboard_plug_locale_widgets_install_popover_construct (GType object_type)
{
	SwitchboardPlugLocaleWidgetsInstallPopover * self = NULL;
	self = (SwitchboardPlugLocaleWidgetsInstallPopover*) g_object_new (object_type, NULL);
	return self;
}

SwitchboardPlugLocaleWidgetsInstallPopover*
switchboard_plug_locale_widgets_install_popover_new (void)
{
	return switchboard_plug_locale_widgets_install_popover_construct (SWITCHBOARD_PLUG_LOCALE_WIDGETS_TYPE_INSTALL_POPOVER);
}

static inline gpointer
switchboard_plug_locale_widgets_install_popover_lang_row_get_instance_private (SwitchboardPlugLocaleWidgetsInstallPopoverLangRow* self)
{
	return G_STRUCT_MEMBER_P (self, SwitchboardPlugLocaleWidgetsInstallPopoverLangRow_private_offset);
}

static SwitchboardPlugLocaleWidgetsInstallPopoverLangRow*
switchboard_plug_locale_widgets_install_popover_lang_row_construct (GType object_type,
                                                                    const gchar* lang)
{
	SwitchboardPlugLocaleWidgetsInstallPopoverLangRow * self = NULL;
	g_return_val_if_fail (lang != NULL, NULL);
	self = (SwitchboardPlugLocaleWidgetsInstallPopoverLangRow*) g_object_new (object_type, "lang", lang, NULL);
	return self;
}

static SwitchboardPlugLocaleWidgetsInstallPopoverLangRow*
switchboard_plug_locale_widgets_install_popover_lang_row_new (const gchar* lang)
{
	return switchboard_plug_locale_widgets_install_popover_lang_row_construct (SWITCHBOARD_PLUG_LOCALE_WIDGETS_INSTALL_POPOVER_TYPE_LANG_ROW, lang);
}

static const gchar*
switchboard_plug_locale_widgets_install_popover_lang_row_get_lang (SwitchboardPlugLocaleWidgetsInstallPopoverLangRow* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_lang;
	result = _tmp0_;
	return result;
}

static void
switchboard_plug_locale_widgets_install_popover_lang_row_set_lang (SwitchboardPlugLocaleWidgetsInstallPopoverLangRow* self,
                                                                   const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = switchboard_plug_locale_widgets_install_popover_lang_row_get_lang (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_lang);
		self->priv->_lang = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, switchboard_plug_locale_widgets_install_popover_lang_row_properties[SWITCHBOARD_PLUG_LOCALE_WIDGETS_INSTALL_POPOVER_LANG_ROW_LANG_PROPERTY]);
	}
}

static GObject *
switchboard_plug_locale_widgets_install_popover_lang_row_constructor (GType type,
                                                                      guint n_construct_properties,
                                                                      GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	SwitchboardPlugLocaleWidgetsInstallPopoverLangRow * self;
	GtkLabel* label = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	GtkLabel* _tmp3_;
	GtkLabel* _tmp4_;
	GtkLabel* _tmp5_;
	GtkLabel* _tmp6_;
	GtkLabel* _tmp7_;
	GtkLabel* _tmp8_;
	GtkLabel* _tmp9_;
	parent_class = G_OBJECT_CLASS (switchboard_plug_locale_widgets_install_popover_lang_row_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SWITCHBOARD_PLUG_LOCALE_WIDGETS_INSTALL_POPOVER_TYPE_LANG_ROW, SwitchboardPlugLocaleWidgetsInstallPopoverLangRow);
	_tmp0_ = self->priv->_lang;
	_tmp1_ = switchboard_plug_locale_utils_translate (_tmp0_, NULL);
	_tmp2_ = _tmp1_;
	_tmp3_ = (GtkLabel*) gtk_label_new (_tmp2_);
	g_object_ref_sink (_tmp3_);
	_tmp4_ = _tmp3_;
	_g_free0 (_tmp2_);
	label = _tmp4_;
	_tmp5_ = label;
	g_object_set ((GtkWidget*) _tmp5_, "margin", 6, NULL);
	_tmp6_ = label;
	_tmp7_ = label;
	gtk_widget_set_margin_end ((GtkWidget*) _tmp7_, 12);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp6_, 12);
	_tmp8_ = label;
	gtk_label_set_xalign (_tmp8_, (gfloat) 0);
	_tmp9_ = label;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp9_);
	_g_object_unref0 (label);
	return obj;
}

static void
switchboard_plug_locale_widgets_install_popover_lang_row_class_init (SwitchboardPlugLocaleWidgetsInstallPopoverLangRowClass * klass,
                                                                     gpointer klass_data)
{
	switchboard_plug_locale_widgets_install_popover_lang_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &SwitchboardPlugLocaleWidgetsInstallPopoverLangRow_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_switchboard_plug_locale_widgets_install_popover_lang_row_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_switchboard_plug_locale_widgets_install_popover_lang_row_set_property;
	G_OBJECT_CLASS (klass)->constructor = switchboard_plug_locale_widgets_install_popover_lang_row_constructor;
	G_OBJECT_CLASS (klass)->finalize = switchboard_plug_locale_widgets_install_popover_lang_row_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), SWITCHBOARD_PLUG_LOCALE_WIDGETS_INSTALL_POPOVER_LANG_ROW_LANG_PROPERTY, switchboard_plug_locale_widgets_install_popover_lang_row_properties[SWITCHBOARD_PLUG_LOCALE_WIDGETS_INSTALL_POPOVER_LANG_ROW_LANG_PROPERTY] = g_param_spec_string ("lang", "lang", "lang", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}

static void
switchboard_plug_locale_widgets_install_popover_lang_row_instance_init (SwitchboardPlugLocaleWidgetsInstallPopoverLangRow * self,
                                                                        gpointer klass)
{
	self->priv = switchboard_plug_locale_widgets_install_popover_lang_row_get_instance_private (self);
}

static void
switchboard_plug_locale_widgets_install_popover_lang_row_finalize (GObject * obj)
{
	SwitchboardPlugLocaleWidgetsInstallPopoverLangRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SWITCHBOARD_PLUG_LOCALE_WIDGETS_INSTALL_POPOVER_TYPE_LANG_ROW, SwitchboardPlugLocaleWidgetsInstallPopoverLangRow);
	_g_free0 (self->priv->_lang);
	G_OBJECT_CLASS (switchboard_plug_locale_widgets_install_popover_lang_row_parent_class)->finalize (obj);
}

static GType
switchboard_plug_locale_widgets_install_popover_lang_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SwitchboardPlugLocaleWidgetsInstallPopoverLangRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) switchboard_plug_locale_widgets_install_popover_lang_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SwitchboardPlugLocaleWidgetsInstallPopoverLangRow), 0, (GInstanceInitFunc) switchboard_plug_locale_widgets_install_popover_lang_row_instance_init, NULL };
	GType switchboard_plug_locale_widgets_install_popover_lang_row_type_id;
	switchboard_plug_locale_widgets_install_popover_lang_row_type_id = g_type_register_static (gtk_list_box_row_get_type (), "SwitchboardPlugLocaleWidgetsInstallPopoverLangRow", &g_define_type_info, 0);
	SwitchboardPlugLocaleWidgetsInstallPopoverLangRow_private_offset = g_type_add_instance_private (switchboard_plug_locale_widgets_install_popover_lang_row_type_id, sizeof (SwitchboardPlugLocaleWidgetsInstallPopoverLangRowPrivate));
	return switchboard_plug_locale_widgets_install_popover_lang_row_type_id;
}

static GType
switchboard_plug_locale_widgets_install_popover_lang_row_get_type (void)
{
	static volatile gsize switchboard_plug_locale_widgets_install_popover_lang_row_type_id__once = 0;
	if (g_once_init_enter (&switchboard_plug_locale_widgets_install_popover_lang_row_type_id__once)) {
		GType switchboard_plug_locale_widgets_install_popover_lang_row_type_id;
		switchboard_plug_locale_widgets_install_popover_lang_row_type_id = switchboard_plug_locale_widgets_install_popover_lang_row_get_type_once ();
		g_once_init_leave (&switchboard_plug_locale_widgets_install_popover_lang_row_type_id__once, switchboard_plug_locale_widgets_install_popover_lang_row_type_id);
	}
	return switchboard_plug_locale_widgets_install_popover_lang_row_type_id__once;
}

static void
_vala_switchboard_plug_locale_widgets_install_popover_lang_row_get_property (GObject * object,
                                                                             guint property_id,
                                                                             GValue * value,
                                                                             GParamSpec * pspec)
{
	SwitchboardPlugLocaleWidgetsInstallPopoverLangRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SWITCHBOARD_PLUG_LOCALE_WIDGETS_INSTALL_POPOVER_TYPE_LANG_ROW, SwitchboardPlugLocaleWidgetsInstallPopoverLangRow);
	switch (property_id) {
		case SWITCHBOARD_PLUG_LOCALE_WIDGETS_INSTALL_POPOVER_LANG_ROW_LANG_PROPERTY:
		g_value_set_string (value, switchboard_plug_locale_widgets_install_popover_lang_row_get_lang (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_switchboard_plug_locale_widgets_install_popover_lang_row_set_property (GObject * object,
                                                                             guint property_id,
                                                                             const GValue * value,
                                                                             GParamSpec * pspec)
{
	SwitchboardPlugLocaleWidgetsInstallPopoverLangRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SWITCHBOARD_PLUG_LOCALE_WIDGETS_INSTALL_POPOVER_TYPE_LANG_ROW, SwitchboardPlugLocaleWidgetsInstallPopoverLangRow);
	switch (property_id) {
		case SWITCHBOARD_PLUG_LOCALE_WIDGETS_INSTALL_POPOVER_LANG_ROW_LANG_PROPERTY:
		switchboard_plug_locale_widgets_install_popover_lang_row_set_lang (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static Block6Data*
block6_data_ref (Block6Data* _data6_)
{
	g_atomic_int_inc (&_data6_->_ref_count_);
	return _data6_;
}

static void
block6_data_unref (void * _userdata_)
{
	Block6Data* _data6_;
	_data6_ = (Block6Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data6_->_ref_count_)) {
		SwitchboardPlugLocaleWidgetsInstallPopover* self;
		self = _data6_->self;
		_g_object_unref0 (_data6_->button_add);
		_g_object_unref0 (self);
		g_slice_free (Block6Data, _data6_);
	}
}

static void
_switchboard_plug_locale_widgets_install_popover___lambda10_ (Block6Data* _data6_,
                                                              GtkListBoxRow* row)
{
	SwitchboardPlugLocaleWidgetsInstallPopover* self;
	SwitchboardPlugLocaleWidgetsInstallPopoverLangRow* langrow = NULL;
	GtkListBox* _tmp0_;
	GtkListBoxRow* _tmp1_;
	SwitchboardPlugLocaleWidgetsInstallPopoverLangRow* _tmp2_;
	GtkButton* _tmp3_;
	GtkButton* _tmp4_;
	SwitchboardPlugLocaleWidgetsInstallPopoverLangRow* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	self = _data6_->self;
	_tmp0_ = self->priv->list_box;
	_tmp1_ = gtk_list_box_get_selected_row (_tmp0_);
	_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, SWITCHBOARD_PLUG_LOCALE_WIDGETS_INSTALL_POPOVER_TYPE_LANG_ROW, SwitchboardPlugLocaleWidgetsInstallPopoverLangRow));
	langrow = _tmp2_;
	_tmp3_ = _data6_->button_add;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp3_, row != NULL);
	_tmp4_ = _data6_->button_add;
	_tmp5_ = langrow;
	_tmp6_ = switchboard_plug_locale_widgets_install_popover_lang_row_get_lang (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = switchboard_plug_locale_utils_translate (_tmp7_, "C");
	_tmp9_ = _tmp8_;
	_tmp10_ = g_strdup_printf (_ ("Install %s"), _tmp9_);
	_tmp11_ = _tmp10_;
	gtk_button_set_label (_tmp4_, _tmp11_);
	_g_free0 (_tmp11_);
	_g_free0 (_tmp9_);
	_g_object_unref0 (langrow);
}

static void
__switchboard_plug_locale_widgets_install_popover___lambda10__gtk_list_box_row_selected (GtkListBox* _sender,
                                                                                         GtkListBoxRow* row,
                                                                                         gpointer self)
{
	_switchboard_plug_locale_widgets_install_popover___lambda10_ (self, row);
}

static void
_switchboard_plug_locale_widgets_install_popover_install_selected_gtk_list_box_row_activated (GtkListBox* _sender,
                                                                                              GtkListBoxRow* row,
                                                                                              gpointer self)
{
	switchboard_plug_locale_widgets_install_popover_install_selected ((SwitchboardPlugLocaleWidgetsInstallPopover*) self);
}

static void
_switchboard_plug_locale_widgets_install_popover_install_selected_gtk_button_clicked (GtkButton* _sender,
                                                                                      gpointer self)
{
	switchboard_plug_locale_widgets_install_popover_install_selected ((SwitchboardPlugLocaleWidgetsInstallPopover*) self);
}

static void
_switchboard_plug_locale_widgets_install_popover___lambda11_ (SwitchboardPlugLocaleWidgetsInstallPopover* self)
{
	gtk_popover_popdown ((GtkPopover*) self);
}

static void
__switchboard_plug_locale_widgets_install_popover___lambda11__gtk_button_clicked (GtkButton* _sender,
                                                                                  gpointer self)
{
	_switchboard_plug_locale_widgets_install_popover___lambda11_ ((SwitchboardPlugLocaleWidgetsInstallPopover*) self);
}

static void
_switchboard_plug_locale_widgets_install_popover___lambda12_ (SwitchboardPlugLocaleWidgetsInstallPopover* self)
{
	GtkListBox* _tmp0_;
	GtkListBoxRow* _tmp1_;
	_tmp0_ = self->priv->list_box;
	_tmp1_ = gtk_list_box_get_row_at_y (_tmp0_, 0);
	g_signal_emit_by_name (_tmp1_, "activate");
}

static void
__switchboard_plug_locale_widgets_install_popover___lambda12__gtk_entry_activate (GtkEntry* _sender,
                                                                                  gpointer self)
{
	_switchboard_plug_locale_widgets_install_popover___lambda12_ ((SwitchboardPlugLocaleWidgetsInstallPopover*) self);
}

static void
_switchboard_plug_locale_widgets_install_popover___lambda13_ (SwitchboardPlugLocaleWidgetsInstallPopover* self)
{
	GtkListBox* _tmp0_;
	_tmp0_ = self->priv->list_box;
	gtk_list_box_invalidate_filter (_tmp0_);
}

static void
__switchboard_plug_locale_widgets_install_popover___lambda13__gtk_search_entry_search_changed (GtkSearchEntry* _sender,
                                                                                               gpointer self)
{
	_switchboard_plug_locale_widgets_install_popover___lambda13_ ((SwitchboardPlugLocaleWidgetsInstallPopover*) self);
}

static GObject *
switchboard_plug_locale_widgets_install_popover_constructor (GType type,
                                                             guint n_construct_properties,
                                                             GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	SwitchboardPlugLocaleWidgetsInstallPopover * self;
	Block6Data* _data6_;
	GtkSearchEntry* _tmp0_;
	GtkSearchEntry* _tmp1_;
	GtkListBox* _tmp2_;
	GtkListBox* _tmp3_;
	GtkListBox* _tmp4_;
	GtkListBox* _tmp5_;
	GtkListBox* _tmp6_;
	GtkScrolledWindow* scrolled = NULL;
	GtkScrolledWindow* _tmp7_;
	GtkScrolledWindow* _tmp8_;
	GtkListBox* _tmp9_;
	GtkButton* _tmp10_;
	GtkButton* _tmp11_;
	GtkButton* _tmp12_;
	GtkStyleContext* _tmp13_;
	GtkButton* button_cancel = NULL;
	GtkButton* _tmp14_;
	GtkButtonBox* button_box = NULL;
	GtkButtonBox* _tmp15_;
	GtkButtonBox* _tmp16_;
	GtkButtonBox* _tmp17_;
	GtkButtonBox* _tmp18_;
	GtkButtonBox* _tmp19_;
	GtkButton* _tmp20_;
	GtkButtonBox* _tmp21_;
	GtkButton* _tmp22_;
	GtkGrid* grid = NULL;
	GtkGrid* _tmp23_;
	GtkGrid* _tmp24_;
	GtkGrid* _tmp25_;
	GtkSearchEntry* _tmp26_;
	GtkGrid* _tmp27_;
	GtkScrolledWindow* _tmp28_;
	GtkGrid* _tmp29_;
	GtkSeparator* _tmp30_;
	GtkSeparator* _tmp31_;
	GtkGrid* _tmp32_;
	GtkButtonBox* _tmp33_;
	GtkGrid* _tmp34_;
	GtkGrid* _tmp35_;
	GtkSearchEntry* _tmp36_;
	GtkListBox* _tmp37_;
	GtkListBox* _tmp38_;
	GtkButton* _tmp39_;
	GtkButton* _tmp40_;
	GtkSearchEntry* _tmp41_;
	GtkSearchEntry* _tmp42_;
	parent_class = G_OBJECT_CLASS (switchboard_plug_locale_widgets_install_popover_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SWITCHBOARD_PLUG_LOCALE_WIDGETS_TYPE_INSTALL_POPOVER, SwitchboardPlugLocaleWidgetsInstallPopover);
	_data6_ = g_slice_new0 (Block6Data);
	_data6_->_ref_count_ = 1;
	_data6_->self = g_object_ref (self);
	g_object_set ((GtkWidget*) self, "height-request", 400, NULL);
	g_object_set ((GtkWidget*) self, "width-request", 400, NULL);
	_tmp0_ = (GtkSearchEntry*) gtk_search_entry_new ();
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->search_entry);
	self->priv->search_entry = _tmp0_;
	_tmp1_ = self->priv->search_entry;
	g_object_set ((GtkWidget*) _tmp1_, "margin", 12, NULL);
	_tmp2_ = (GtkListBox*) gtk_list_box_new ();
	g_object_ref_sink (_tmp2_);
	_g_object_unref0 (self->priv->list_box);
	self->priv->list_box = _tmp2_;
	_tmp3_ = self->priv->list_box;
	gtk_list_box_set_activate_on_single_click (_tmp3_, FALSE);
	_tmp4_ = self->priv->list_box;
	g_object_set ((GtkWidget*) _tmp4_, "expand", TRUE, NULL);
	_tmp5_ = self->priv->list_box;
	gtk_list_box_set_filter_func (_tmp5_, (GtkListBoxFilterFunc) switchboard_plug_locale_widgets_install_popover_filter_function, g_object_ref (self), g_object_unref);
	_tmp6_ = self->priv->list_box;
	gtk_list_box_set_sort_func (_tmp6_, (GtkListBoxSortFunc) switchboard_plug_locale_widgets_install_popover_sort_function, g_object_ref (self), g_object_unref);
	_tmp7_ = (GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL);
	g_object_ref_sink (_tmp7_);
	scrolled = _tmp7_;
	_tmp8_ = scrolled;
	_tmp9_ = self->priv->list_box;
	gtk_container_add ((GtkContainer*) _tmp8_, (GtkWidget*) _tmp9_);
	_tmp10_ = (GtkButton*) gtk_button_new_with_label (_ ("Install Language"));
	g_object_ref_sink (_tmp10_);
	_data6_->button_add = _tmp10_;
	_tmp11_ = _data6_->button_add;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp11_, FALSE);
	_tmp12_ = _data6_->button_add;
	_tmp13_ = gtk_widget_get_style_context ((GtkWidget*) _tmp12_);
	gtk_style_context_add_class (_tmp13_, GTK_STYLE_CLASS_SUGGESTED_ACTION);
	_tmp14_ = (GtkButton*) gtk_button_new_with_label (_ ("Cancel"));
	g_object_ref_sink (_tmp14_);
	button_cancel = _tmp14_;
	_tmp15_ = (GtkButtonBox*) gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
	g_object_ref_sink (_tmp15_);
	button_box = _tmp15_;
	_tmp16_ = button_box;
	g_object_set (_tmp16_, "layout-style", GTK_BUTTONBOX_END, NULL);
	_tmp17_ = button_box;
	g_object_set ((GtkWidget*) _tmp17_, "margin", 12, NULL);
	_tmp18_ = button_box;
	gtk_box_set_spacing ((GtkBox*) _tmp18_, 6);
	_tmp19_ = button_box;
	_tmp20_ = button_cancel;
	gtk_container_add ((GtkContainer*) _tmp19_, (GtkWidget*) _tmp20_);
	_tmp21_ = button_box;
	_tmp22_ = _data6_->button_add;
	gtk_container_add ((GtkContainer*) _tmp21_, (GtkWidget*) _tmp22_);
	_tmp23_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp23_);
	grid = _tmp23_;
	_tmp24_ = grid;
	gtk_orientable_set_orientation ((GtkOrientable*) _tmp24_, GTK_ORIENTATION_VERTICAL);
	_tmp25_ = grid;
	_tmp26_ = self->priv->search_entry;
	gtk_container_add ((GtkContainer*) _tmp25_, (GtkWidget*) _tmp26_);
	_tmp27_ = grid;
	_tmp28_ = scrolled;
	gtk_container_add ((GtkContainer*) _tmp27_, (GtkWidget*) _tmp28_);
	_tmp29_ = grid;
	_tmp30_ = (GtkSeparator*) gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
	g_object_ref_sink (_tmp30_);
	_tmp31_ = _tmp30_;
	gtk_container_add ((GtkContainer*) _tmp29_, (GtkWidget*) _tmp31_);
	_g_object_unref0 (_tmp31_);
	_tmp32_ = grid;
	_tmp33_ = button_box;
	gtk_container_add ((GtkContainer*) _tmp32_, (GtkWidget*) _tmp33_);
	_tmp34_ = grid;
	gtk_widget_show_all ((GtkWidget*) _tmp34_);
	_tmp35_ = grid;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp35_);
	switchboard_plug_locale_widgets_install_popover_load_languagelist (self);
	_tmp36_ = self->priv->search_entry;
	gtk_widget_grab_focus ((GtkWidget*) _tmp36_);
	_tmp37_ = self->priv->list_box;
	g_signal_connect_data (_tmp37_, "row-selected", (GCallback) __switchboard_plug_locale_widgets_install_popover___lambda10__gtk_list_box_row_selected, block6_data_ref (_data6_), (GClosureNotify) block6_data_unref, 0);
	_tmp38_ = self->priv->list_box;
	g_signal_connect_object (_tmp38_, "row-activated", (GCallback) _switchboard_plug_locale_widgets_install_popover_install_selected_gtk_list_box_row_activated, self, 0);
	_tmp39_ = _data6_->button_add;
	g_signal_connect_object (_tmp39_, "clicked", (GCallback) _switchboard_plug_locale_widgets_install_popover_install_selected_gtk_button_clicked, self, 0);
	_tmp40_ = button_cancel;
	g_signal_connect_object (_tmp40_, "clicked", (GCallback) __switchboard_plug_locale_widgets_install_popover___lambda11__gtk_button_clicked, self, 0);
	_tmp41_ = self->priv->search_entry;
	g_signal_connect_object ((GtkEntry*) _tmp41_, "activate", (GCallback) __switchboard_plug_locale_widgets_install_popover___lambda12__gtk_entry_activate, self, 0);
	_tmp42_ = self->priv->search_entry;
	g_signal_connect_object (_tmp42_, "search-changed", (GCallback) __switchboard_plug_locale_widgets_install_popover___lambda13__gtk_search_entry_search_changed, self, 0);
	_g_object_unref0 (grid);
	_g_object_unref0 (button_box);
	_g_object_unref0 (button_cancel);
	_g_object_unref0 (scrolled);
	block6_data_unref (_data6_);
	_data6_ = NULL;
	return obj;
}

static void
switchboard_plug_locale_widgets_install_popover_class_init (SwitchboardPlugLocaleWidgetsInstallPopoverClass * klass,
                                                            gpointer klass_data)
{
	switchboard_plug_locale_widgets_install_popover_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &SwitchboardPlugLocaleWidgetsInstallPopover_private_offset);
	G_OBJECT_CLASS (klass)->constructor = switchboard_plug_locale_widgets_install_popover_constructor;
	G_OBJECT_CLASS (klass)->finalize = switchboard_plug_locale_widgets_install_popover_finalize;
	switchboard_plug_locale_widgets_install_popover_signals[SWITCHBOARD_PLUG_LOCALE_WIDGETS_INSTALL_POPOVER_LANGUAGE_SELECTED_SIGNAL] = g_signal_new ("language-selected", SWITCHBOARD_PLUG_LOCALE_WIDGETS_TYPE_INSTALL_POPOVER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING);
}

static void
switchboard_plug_locale_widgets_install_popover_instance_init (SwitchboardPlugLocaleWidgetsInstallPopover * self,
                                                               gpointer klass)
{
	self->priv = switchboard_plug_locale_widgets_install_popover_get_instance_private (self);
}

static void
switchboard_plug_locale_widgets_install_popover_finalize (GObject * obj)
{
	SwitchboardPlugLocaleWidgetsInstallPopover * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SWITCHBOARD_PLUG_LOCALE_WIDGETS_TYPE_INSTALL_POPOVER, SwitchboardPlugLocaleWidgetsInstallPopover);
	_g_object_unref0 (self->priv->search_entry);
	_g_object_unref0 (self->priv->list_box);
	G_OBJECT_CLASS (switchboard_plug_locale_widgets_install_popover_parent_class)->finalize (obj);
}

static GType
switchboard_plug_locale_widgets_install_popover_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SwitchboardPlugLocaleWidgetsInstallPopoverClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) switchboard_plug_locale_widgets_install_popover_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SwitchboardPlugLocaleWidgetsInstallPopover), 0, (GInstanceInitFunc) switchboard_plug_locale_widgets_install_popover_instance_init, NULL };
	GType switchboard_plug_locale_widgets_install_popover_type_id;
	switchboard_plug_locale_widgets_install_popover_type_id = g_type_register_static (gtk_popover_get_type (), "SwitchboardPlugLocaleWidgetsInstallPopover", &g_define_type_info, 0);
	SwitchboardPlugLocaleWidgetsInstallPopover_private_offset = g_type_add_instance_private (switchboard_plug_locale_widgets_install_popover_type_id, sizeof (SwitchboardPlugLocaleWidgetsInstallPopoverPrivate));
	return switchboard_plug_locale_widgets_install_popover_type_id;
}

GType
switchboard_plug_locale_widgets_install_popover_get_type (void)
{
	static volatile gsize switchboard_plug_locale_widgets_install_popover_type_id__once = 0;
	if (g_once_init_enter (&switchboard_plug_locale_widgets_install_popover_type_id__once)) {
		GType switchboard_plug_locale_widgets_install_popover_type_id;
		switchboard_plug_locale_widgets_install_popover_type_id = switchboard_plug_locale_widgets_install_popover_get_type_once ();
		g_once_init_leave (&switchboard_plug_locale_widgets_install_popover_type_id__once, switchboard_plug_locale_widgets_install_popover_type_id);
	}
	return switchboard_plug_locale_widgets_install_popover_type_id__once;
}

