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

/* Copyright 2015 Switchboard Locale Plug Developers
*
* 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 <glib/gi18n-lib.h>
#include <stdlib.h>
#include <string.h>
#include <gee.h>

enum  {
	SWITCHBOARD_PLUG_LOCALE_WIDGETS_LOCALE_VIEW_0_PROPERTY,
	SWITCHBOARD_PLUG_LOCALE_WIDGETS_LOCALE_VIEW_PLUG_PROPERTY,
	SWITCHBOARD_PLUG_LOCALE_WIDGETS_LOCALE_VIEW_NUM_PROPERTIES
};
static GParamSpec* switchboard_plug_locale_widgets_locale_view_properties[SWITCHBOARD_PLUG_LOCALE_WIDGETS_LOCALE_VIEW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block7Data Block7Data;
#define _g_free0(var) (var = (g_free (var), NULL))

struct _SwitchboardPlugLocaleWidgetsLocaleViewPrivate {
	GtkGrid* sidebar;
	SwitchboardPlugLocalePlug* _plug;
};

struct _Block7Data {
	int _ref_count_;
	SwitchboardPlugLocaleWidgetsLocaleView* self;
	SwitchboardPlugLocaleLocaleManager* locale_manager;
	GtkButton* remove_button;
	SwitchboardPlugLocaleInstallerUbuntuInstaller* installer;
};

static gint SwitchboardPlugLocaleWidgetsLocaleView_private_offset;
static gpointer switchboard_plug_locale_widgets_locale_view_parent_class = NULL;

static void switchboard_plug_locale_widgets_locale_view_make_sensitive (SwitchboardPlugLocaleWidgetsLocaleView* self,
                                                                 gboolean sensitive);
static GObject * switchboard_plug_locale_widgets_locale_view_constructor (GType type,
                                                                   guint n_construct_properties,
                                                                   GObjectConstructParam * construct_properties);
static Block7Data* block7_data_ref (Block7Data* _data7_);
static void block7_data_unref (void * _userdata_);
static void _switchboard_plug_locale_widgets_locale_view___lambda14_ (SwitchboardPlugLocaleWidgetsLocaleView* self);
static void __switchboard_plug_locale_widgets_locale_view___lambda14__switchboard_plug_locale_widgets_locale_setting_settings_changed (SwitchboardPlugLocaleWidgetsLocaleSetting* _sender,
                                                                                                                                gpointer self);
static void _switchboard_plug_locale_widgets_locale_view___lambda15_ (Block7Data* _data7_,
                                                               GtkListBoxRow* row);
static void __switchboard_plug_locale_widgets_locale_view___lambda15__gtk_list_box_row_selected (GtkListBox* _sender,
                                                                                          GtkListBoxRow* row,
                                                                                          gpointer self);
static void _switchboard_plug_locale_widgets_locale_view___lambda24_ (SwitchboardPlugLocaleWidgetsLocaleView* self);
static void __switchboard_plug_locale_widgets_locale_view___lambda24__switchboard_plug_locale_installer_ubuntu_installer_install_finished (SwitchboardPlugLocaleInstallerUbuntuInstaller* _sender,
                                                                                                                                    const gchar* langcode,
                                                                                                                                    gpointer self);
static void _switchboard_plug_locale_widgets_locale_view___lambda25_ (SwitchboardPlugLocaleWidgetsLocaleView* self);
static void __switchboard_plug_locale_widgets_locale_view___lambda25__switchboard_plug_locale_installer_ubuntu_installer_remove_finished (SwitchboardPlugLocaleInstallerUbuntuInstaller* _sender,
                                                                                                                                   const gchar* langcode,
                                                                                                                                   gpointer self);
static void _switchboard_plug_locale_widgets_locale_view___lambda26_ (Block7Data* _data7_);
static void __switchboard_plug_locale_widgets_locale_view___lambda26__gtk_button_clicked (GtkButton* _sender,
                                                                                   gpointer self);
static void _switchboard_plug_locale_widgets_locale_view___lambda27_ (Block7Data* _data7_,
                                                               const gchar* lang);
static void __switchboard_plug_locale_widgets_locale_view___lambda27__switchboard_plug_locale_widgets_install_popover_language_selected (SwitchboardPlugLocaleWidgetsInstallPopover* _sender,
                                                                                                                                  const gchar* lang,
                                                                                                                                  gpointer self);
static void switchboard_plug_locale_widgets_locale_view_finalize (GObject * obj);
static GType switchboard_plug_locale_widgets_locale_view_get_type_once (void);
static void _vala_switchboard_plug_locale_widgets_locale_view_get_property (GObject * object,
                                                                     guint property_id,
                                                                     GValue * value,
                                                                     GParamSpec * pspec);
static void _vala_switchboard_plug_locale_widgets_locale_view_set_property (GObject * object,
                                                                     guint property_id,
                                                                     const GValue * value,
                                                                     GParamSpec * pspec);

static inline gpointer
switchboard_plug_locale_widgets_locale_view_get_instance_private (SwitchboardPlugLocaleWidgetsLocaleView* self)
{
	return G_STRUCT_MEMBER_P (self, SwitchboardPlugLocaleWidgetsLocaleView_private_offset);
}

SwitchboardPlugLocaleWidgetsLocaleView*
switchboard_plug_locale_widgets_locale_view_construct (GType object_type,
                                                       SwitchboardPlugLocalePlug* plug)
{
	SwitchboardPlugLocaleWidgetsLocaleView * self = NULL;
	g_return_val_if_fail (plug != NULL, NULL);
	self = (SwitchboardPlugLocaleWidgetsLocaleView*) g_object_new (object_type, "plug", plug, "position", 200, NULL);
	return self;
}

SwitchboardPlugLocaleWidgetsLocaleView*
switchboard_plug_locale_widgets_locale_view_new (SwitchboardPlugLocalePlug* plug)
{
	return switchboard_plug_locale_widgets_locale_view_construct (SWITCHBOARD_PLUG_LOCALE_WIDGETS_TYPE_LOCALE_VIEW, plug);
}

static void
switchboard_plug_locale_widgets_locale_view_make_sensitive (SwitchboardPlugLocaleWidgetsLocaleView* self,
                                                            gboolean sensitive)
{
	GtkGrid* _tmp0_;
	SwitchboardPlugLocaleWidgetsLocaleSetting* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->sidebar;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp0_, sensitive);
	_tmp1_ = self->locale_setting;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp1_, sensitive);
}

SwitchboardPlugLocalePlug*
switchboard_plug_locale_widgets_locale_view_get_plug (SwitchboardPlugLocaleWidgetsLocaleView* self)
{
	SwitchboardPlugLocalePlug* result;
	SwitchboardPlugLocalePlug* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_plug;
	result = _tmp0_;
	return result;
}

static void
switchboard_plug_locale_widgets_locale_view_set_plug (SwitchboardPlugLocaleWidgetsLocaleView* self,
                                                      SwitchboardPlugLocalePlug* value)
{
	SwitchboardPlugLocalePlug* old_value;
	g_return_if_fail (self != NULL);
	old_value = switchboard_plug_locale_widgets_locale_view_get_plug (self);
	if (old_value != value) {
		self->priv->_plug = value;
		g_object_notify_by_pspec ((GObject *) self, switchboard_plug_locale_widgets_locale_view_properties[SWITCHBOARD_PLUG_LOCALE_WIDGETS_LOCALE_VIEW_PLUG_PROPERTY]);
	}
}

static Block7Data*
block7_data_ref (Block7Data* _data7_)
{
	g_atomic_int_inc (&_data7_->_ref_count_);
	return _data7_;
}

static void
block7_data_unref (void * _userdata_)
{
	Block7Data* _data7_;
	_data7_ = (Block7Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data7_->_ref_count_)) {
		SwitchboardPlugLocaleWidgetsLocaleView* self;
		self = _data7_->self;
		_g_object_unref0 (_data7_->remove_button);
		_g_object_unref0 (_data7_->locale_manager);
		_g_object_unref0 (self);
		g_slice_free (Block7Data, _data7_);
	}
}

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

static void
_switchboard_plug_locale_widgets_locale_view___lambda14_ (SwitchboardPlugLocaleWidgetsLocaleView* self)
{
	SwitchboardPlugLocalePlug* _tmp0_;
	GtkInfoBar* _tmp1_;
	SwitchboardPlugLocalePlug* _tmp2_;
	GtkInfoBar* _tmp3_;
	_tmp0_ = self->priv->_plug;
	_tmp1_ = _tmp0_->infobar;
	gtk_widget_show_all ((GtkWidget*) _tmp1_);
	_tmp2_ = self->priv->_plug;
	_tmp3_ = _tmp2_->infobar;
	gtk_info_bar_set_revealed (_tmp3_, TRUE);
}

static void
__switchboard_plug_locale_widgets_locale_view___lambda14__switchboard_plug_locale_widgets_locale_setting_settings_changed (SwitchboardPlugLocaleWidgetsLocaleSetting* _sender,
                                                                                                                           gpointer self)
{
	_switchboard_plug_locale_widgets_locale_view___lambda14_ ((SwitchboardPlugLocaleWidgetsLocaleView*) self);
}

static void
_switchboard_plug_locale_widgets_locale_view___lambda15_ (Block7Data* _data7_,
                                                          GtkListBoxRow* row)
{
	SwitchboardPlugLocaleWidgetsLocaleView* self;
	gchar* selected_language_code = NULL;
	SwitchboardPlugLocaleWidgetsLanguageListBox* _tmp0_;
	gchar* _tmp1_;
	GeeHashSet* locales = NULL;
	const gchar* _tmp2_;
	GeeHashSet* _tmp3_;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	SwitchboardPlugLocaleWidgetsLocaleSetting* _tmp7_;
	const gchar* _tmp8_;
	GeeHashSet* _tmp9_;
	SwitchboardPlugLocaleWidgetsLocaleSetting* _tmp10_;
	const gchar* _tmp11_;
	GeeHashSet* _tmp12_;
	SwitchboardPlugLocaleLocaleManager* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	gboolean _tmp16_;
	self = _data7_->self;
	if (row == NULL) {
		return;
	}
	_tmp0_ = self->list_box;
	_tmp1_ = switchboard_plug_locale_widgets_language_list_box_get_selected_language_code (_tmp0_);
	selected_language_code = _tmp1_;
	_tmp2_ = selected_language_code;
	_tmp3_ = switchboard_plug_locale_utils_get_locales_for_language_code (_tmp2_);
	locales = _tmp3_;
	_tmp4_ = selected_language_code;
	_tmp5_ = g_strdup_printf ("reloading Settings widget for language '%s'", _tmp4_);
	_tmp6_ = _tmp5_;
	g_debug ("LocaleView.vala:78: %s", _tmp6_);
	_g_free0 (_tmp6_);
	_tmp7_ = self->locale_setting;
	_tmp8_ = selected_language_code;
	_tmp9_ = locales;
	switchboard_plug_locale_widgets_locale_setting_reload_locales (_tmp7_, _tmp8_, _tmp9_, NULL, NULL);
	_tmp10_ = self->locale_setting;
	_tmp11_ = selected_language_code;
	switchboard_plug_locale_widgets_locale_setting_reload_labels (_tmp10_, _tmp11_);
	_tmp12_ = locales;
	_tmp13_ = _data7_->locale_manager;
	_tmp14_ = switchboard_plug_locale_locale_manager_get_user_language (_tmp13_);
	_tmp15_ = _tmp14_;
	_tmp16_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp12_, _tmp15_);
	_g_free0 (_tmp15_);
	if (_tmp16_) {
		GtkButton* _tmp17_;
		_tmp17_ = _data7_->remove_button;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp17_, FALSE);
	} else {
		GtkButton* _tmp18_;
		_tmp18_ = _data7_->remove_button;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp18_, TRUE);
	}
	_g_object_unref0 (locales);
	_g_free0 (selected_language_code);
}

static void
__switchboard_plug_locale_widgets_locale_view___lambda15__gtk_list_box_row_selected (GtkListBox* _sender,
                                                                                     GtkListBoxRow* row,
                                                                                     gpointer self)
{
	_switchboard_plug_locale_widgets_locale_view___lambda15_ (self, row);
}

static void
_switchboard_plug_locale_widgets_locale_view___lambda24_ (SwitchboardPlugLocaleWidgetsLocaleView* self)
{
	switchboard_plug_locale_widgets_locale_view_make_sensitive (self, TRUE);
}

static void
__switchboard_plug_locale_widgets_locale_view___lambda24__switchboard_plug_locale_installer_ubuntu_installer_install_finished (SwitchboardPlugLocaleInstallerUbuntuInstaller* _sender,
                                                                                                                               const gchar* langcode,
                                                                                                                               gpointer self)
{
	_switchboard_plug_locale_widgets_locale_view___lambda24_ ((SwitchboardPlugLocaleWidgetsLocaleView*) self);
}

static void
_switchboard_plug_locale_widgets_locale_view___lambda25_ (SwitchboardPlugLocaleWidgetsLocaleView* self)
{
	switchboard_plug_locale_widgets_locale_view_make_sensitive (self, TRUE);
}

static void
__switchboard_plug_locale_widgets_locale_view___lambda25__switchboard_plug_locale_installer_ubuntu_installer_remove_finished (SwitchboardPlugLocaleInstallerUbuntuInstaller* _sender,
                                                                                                                              const gchar* langcode,
                                                                                                                              gpointer self)
{
	_switchboard_plug_locale_widgets_locale_view___lambda25_ ((SwitchboardPlugLocaleWidgetsLocaleView*) self);
}

static void
_switchboard_plug_locale_widgets_locale_view___lambda26_ (Block7Data* _data7_)
{
	SwitchboardPlugLocaleWidgetsLocaleView* self;
	SwitchboardPlugLocaleInstallerUbuntuInstaller* _tmp0_;
	SwitchboardPlugLocaleWidgetsLanguageListBox* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	self = _data7_->self;
	if (!switchboard_plug_locale_utils_allowed_permission ()) {
		return;
	}
	switchboard_plug_locale_widgets_locale_view_make_sensitive (self, FALSE);
	_tmp0_ = _data7_->installer;
	_tmp1_ = self->list_box;
	_tmp2_ = switchboard_plug_locale_widgets_language_list_box_get_selected_language_code (_tmp1_);
	_tmp3_ = _tmp2_;
	switchboard_plug_locale_installer_ubuntu_installer_remove (_tmp0_, _tmp3_);
	_g_free0 (_tmp3_);
}

static void
__switchboard_plug_locale_widgets_locale_view___lambda26__gtk_button_clicked (GtkButton* _sender,
                                                                              gpointer self)
{
	_switchboard_plug_locale_widgets_locale_view___lambda26_ (self);
}

static void
_switchboard_plug_locale_widgets_locale_view___lambda27_ (Block7Data* _data7_,
                                                          const gchar* lang)
{
	SwitchboardPlugLocaleWidgetsLocaleView* self;
	SwitchboardPlugLocaleInstallerUbuntuInstaller* _tmp0_;
	self = _data7_->self;
	g_return_if_fail (lang != NULL);
	if (!switchboard_plug_locale_utils_allowed_permission ()) {
		return;
	}
	switchboard_plug_locale_widgets_locale_view_make_sensitive (self, FALSE);
	_tmp0_ = _data7_->installer;
	switchboard_plug_locale_installer_ubuntu_installer_install (_tmp0_, lang);
}

static void
__switchboard_plug_locale_widgets_locale_view___lambda27__switchboard_plug_locale_widgets_install_popover_language_selected (SwitchboardPlugLocaleWidgetsInstallPopover* _sender,
                                                                                                                             const gchar* lang,
                                                                                                                             gpointer self)
{
	_switchboard_plug_locale_widgets_locale_view___lambda27_ (self, lang);
}

static GObject *
switchboard_plug_locale_widgets_locale_view_constructor (GType type,
                                                         guint n_construct_properties,
                                                         GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	SwitchboardPlugLocaleWidgetsLocaleView * self;
	Block7Data* _data7_;
	SwitchboardPlugLocaleLocaleManager* _tmp0_;
	SwitchboardPlugLocaleLocaleManager* _tmp1_;
	SwitchboardPlugLocaleWidgetsLanguageListBox* _tmp2_;
	GtkScrolledWindow* scroll = NULL;
	GtkScrolledWindow* _tmp3_;
	GtkScrolledWindow* _tmp4_;
	SwitchboardPlugLocaleWidgetsLanguageListBox* _tmp5_;
	GtkScrolledWindow* _tmp6_;
	SwitchboardPlugLocaleWidgetsInstallPopover* popover = NULL;
	SwitchboardPlugLocaleWidgetsInstallPopover* _tmp7_;
	GtkMenuButton* add_button = NULL;
	GtkMenuButton* _tmp8_;
	GtkMenuButton* _tmp9_;
	GtkImage* _tmp10_;
	GtkImage* _tmp11_;
	GtkMenuButton* _tmp12_;
	SwitchboardPlugLocaleWidgetsInstallPopover* _tmp13_;
	GtkMenuButton* _tmp14_;
	GtkButton* _tmp15_;
	GtkButton* _tmp16_;
	GtkActionBar* action_bar = NULL;
	GtkActionBar* _tmp17_;
	GtkActionBar* _tmp18_;
	GtkStyleContext* _tmp19_;
	GtkActionBar* _tmp20_;
	GtkMenuButton* _tmp21_;
	GtkActionBar* _tmp22_;
	GtkButton* _tmp23_;
	GtkGrid* _tmp24_;
	GtkGrid* _tmp25_;
	GtkGrid* _tmp26_;
	GtkScrolledWindow* _tmp27_;
	GtkGrid* _tmp28_;
	GtkActionBar* _tmp29_;
	SwitchboardPlugLocaleWidgetsLocaleSetting* _tmp30_;
	SwitchboardPlugLocaleWidgetsLocaleSetting* _tmp31_;
	GtkGrid* _tmp32_;
	SwitchboardPlugLocaleWidgetsLocaleSetting* _tmp33_;
	SwitchboardPlugLocaleWidgetsLanguageListBox* _tmp34_;
	SwitchboardPlugLocaleInstallerUbuntuInstaller* _tmp35_;
	SwitchboardPlugLocaleInstallerUbuntuInstaller* _tmp36_;
	SwitchboardPlugLocaleInstallerUbuntuInstaller* _tmp37_;
	GtkButton* _tmp38_;
	SwitchboardPlugLocaleWidgetsInstallPopover* _tmp39_;
	parent_class = G_OBJECT_CLASS (switchboard_plug_locale_widgets_locale_view_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SWITCHBOARD_PLUG_LOCALE_WIDGETS_TYPE_LOCALE_VIEW, SwitchboardPlugLocaleWidgetsLocaleView);
	_data7_ = g_slice_new0 (Block7Data);
	_data7_->_ref_count_ = 1;
	_data7_->self = g_object_ref (self);
	_tmp0_ = switchboard_plug_locale_locale_manager_get_default ();
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_data7_->locale_manager = _tmp1_;
	_tmp2_ = switchboard_plug_locale_widgets_language_list_box_new ();
	g_object_ref_sink (_tmp2_);
	_g_object_unref0 (self->list_box);
	self->list_box = _tmp2_;
	_tmp3_ = (GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL);
	g_object_ref_sink (_tmp3_);
	scroll = _tmp3_;
	_tmp4_ = scroll;
	_tmp5_ = self->list_box;
	gtk_container_add ((GtkContainer*) _tmp4_, (GtkWidget*) _tmp5_);
	_tmp6_ = scroll;
	g_object_set ((GtkWidget*) _tmp6_, "expand", TRUE, NULL);
	_tmp7_ = switchboard_plug_locale_widgets_install_popover_new ();
	g_object_ref_sink (_tmp7_);
	popover = _tmp7_;
	_tmp8_ = (GtkMenuButton*) gtk_menu_button_new ();
	g_object_ref_sink (_tmp8_);
	add_button = _tmp8_;
	_tmp9_ = add_button;
	_tmp10_ = (GtkImage*) gtk_image_new_from_icon_name ("list-add-symbolic", (GtkIconSize) GTK_ICON_SIZE_BUTTON);
	g_object_ref_sink (_tmp10_);
	_tmp11_ = _tmp10_;
	gtk_button_set_image ((GtkButton*) _tmp9_, (GtkWidget*) _tmp11_);
	_g_object_unref0 (_tmp11_);
	_tmp12_ = add_button;
	_tmp13_ = popover;
	gtk_menu_button_set_popover (_tmp12_, (GtkPopover*) _tmp13_);
	_tmp14_ = add_button;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp14_, _ ("Install language"));
	_tmp15_ = (GtkButton*) gtk_button_new_from_icon_name ("list-remove-symbolic", (GtkIconSize) GTK_ICON_SIZE_BUTTON);
	g_object_ref_sink (_tmp15_);
	_data7_->remove_button = _tmp15_;
	_tmp16_ = _data7_->remove_button;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp16_, _ ("Remove language"));
	_tmp17_ = (GtkActionBar*) gtk_action_bar_new ();
	g_object_ref_sink (_tmp17_);
	action_bar = _tmp17_;
	_tmp18_ = action_bar;
	_tmp19_ = gtk_widget_get_style_context ((GtkWidget*) _tmp18_);
	gtk_style_context_add_class (_tmp19_, GTK_STYLE_CLASS_INLINE_TOOLBAR);
	_tmp20_ = action_bar;
	_tmp21_ = add_button;
	gtk_action_bar_pack_start (_tmp20_, (GtkWidget*) _tmp21_);
	_tmp22_ = action_bar;
	_tmp23_ = _data7_->remove_button;
	gtk_action_bar_pack_start (_tmp22_, (GtkWidget*) _tmp23_);
	_tmp24_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp24_);
	_g_object_unref0 (self->priv->sidebar);
	self->priv->sidebar = _tmp24_;
	_tmp25_ = self->priv->sidebar;
	gtk_orientable_set_orientation ((GtkOrientable*) _tmp25_, GTK_ORIENTATION_VERTICAL);
	_tmp26_ = self->priv->sidebar;
	_tmp27_ = scroll;
	gtk_container_add ((GtkContainer*) _tmp26_, (GtkWidget*) _tmp27_);
	_tmp28_ = self->priv->sidebar;
	_tmp29_ = action_bar;
	gtk_container_add ((GtkContainer*) _tmp28_, (GtkWidget*) _tmp29_);
	_tmp30_ = switchboard_plug_locale_widgets_locale_setting_new ();
	g_object_ref_sink (_tmp30_);
	_g_object_unref0 (self->locale_setting);
	self->locale_setting = _tmp30_;
	_tmp31_ = self->locale_setting;
	g_signal_connect_object (_tmp31_, "settings-changed", (GCallback) __switchboard_plug_locale_widgets_locale_view___lambda14__switchboard_plug_locale_widgets_locale_setting_settings_changed, self, 0);
	_tmp32_ = self->priv->sidebar;
	gtk_paned_pack1 ((GtkPaned*) self, (GtkWidget*) _tmp32_, TRUE, FALSE);
	_tmp33_ = self->locale_setting;
	gtk_paned_pack2 ((GtkPaned*) self, (GtkWidget*) _tmp33_, TRUE, FALSE);
	_tmp34_ = self->list_box;
	g_signal_connect_data ((GtkListBox*) _tmp34_, "row-selected", (GCallback) __switchboard_plug_locale_widgets_locale_view___lambda15__gtk_list_box_row_selected, block7_data_ref (_data7_), (GClosureNotify) block7_data_unref, 0);
	_tmp35_ = switchboard_plug_locale_installer_ubuntu_installer_get_default ();
	_data7_->installer = _tmp35_;
	_tmp36_ = _data7_->installer;
	g_signal_connect_object (_tmp36_, "install-finished", (GCallback) __switchboard_plug_locale_widgets_locale_view___lambda24__switchboard_plug_locale_installer_ubuntu_installer_install_finished, self, 0);
	_tmp37_ = _data7_->installer;
	g_signal_connect_object (_tmp37_, "remove-finished", (GCallback) __switchboard_plug_locale_widgets_locale_view___lambda25__switchboard_plug_locale_installer_ubuntu_installer_remove_finished, self, 0);
	_tmp38_ = _data7_->remove_button;
	g_signal_connect_data (_tmp38_, "clicked", (GCallback) __switchboard_plug_locale_widgets_locale_view___lambda26__gtk_button_clicked, block7_data_ref (_data7_), (GClosureNotify) block7_data_unref, 0);
	_tmp39_ = popover;
	g_signal_connect_data (_tmp39_, "language-selected", (GCallback) __switchboard_plug_locale_widgets_locale_view___lambda27__switchboard_plug_locale_widgets_install_popover_language_selected, block7_data_ref (_data7_), (GClosureNotify) block7_data_unref, 0);
	gtk_widget_show_all ((GtkWidget*) self);
	_g_object_unref0 (action_bar);
	_g_object_unref0 (add_button);
	_g_object_unref0 (popover);
	_g_object_unref0 (scroll);
	block7_data_unref (_data7_);
	_data7_ = NULL;
	return obj;
}

static void
switchboard_plug_locale_widgets_locale_view_class_init (SwitchboardPlugLocaleWidgetsLocaleViewClass * klass,
                                                        gpointer klass_data)
{
	switchboard_plug_locale_widgets_locale_view_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &SwitchboardPlugLocaleWidgetsLocaleView_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_switchboard_plug_locale_widgets_locale_view_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_switchboard_plug_locale_widgets_locale_view_set_property;
	G_OBJECT_CLASS (klass)->constructor = switchboard_plug_locale_widgets_locale_view_constructor;
	G_OBJECT_CLASS (klass)->finalize = switchboard_plug_locale_widgets_locale_view_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), SWITCHBOARD_PLUG_LOCALE_WIDGETS_LOCALE_VIEW_PLUG_PROPERTY, switchboard_plug_locale_widgets_locale_view_properties[SWITCHBOARD_PLUG_LOCALE_WIDGETS_LOCALE_VIEW_PLUG_PROPERTY] = g_param_spec_object ("plug", "plug", "plug", SWITCHBOARD_PLUG_LOCALE_TYPE_PLUG, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}

static void
switchboard_plug_locale_widgets_locale_view_instance_init (SwitchboardPlugLocaleWidgetsLocaleView * self,
                                                           gpointer klass)
{
	self->priv = switchboard_plug_locale_widgets_locale_view_get_instance_private (self);
}

static void
switchboard_plug_locale_widgets_locale_view_finalize (GObject * obj)
{
	SwitchboardPlugLocaleWidgetsLocaleView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SWITCHBOARD_PLUG_LOCALE_WIDGETS_TYPE_LOCALE_VIEW, SwitchboardPlugLocaleWidgetsLocaleView);
	_g_object_unref0 (self->priv->sidebar);
	_g_object_unref0 (self->list_box);
	_g_object_unref0 (self->locale_setting);
	G_OBJECT_CLASS (switchboard_plug_locale_widgets_locale_view_parent_class)->finalize (obj);
}

static GType
switchboard_plug_locale_widgets_locale_view_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SwitchboardPlugLocaleWidgetsLocaleViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) switchboard_plug_locale_widgets_locale_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SwitchboardPlugLocaleWidgetsLocaleView), 0, (GInstanceInitFunc) switchboard_plug_locale_widgets_locale_view_instance_init, NULL };
	GType switchboard_plug_locale_widgets_locale_view_type_id;
	switchboard_plug_locale_widgets_locale_view_type_id = g_type_register_static (gtk_paned_get_type (), "SwitchboardPlugLocaleWidgetsLocaleView", &g_define_type_info, 0);
	SwitchboardPlugLocaleWidgetsLocaleView_private_offset = g_type_add_instance_private (switchboard_plug_locale_widgets_locale_view_type_id, sizeof (SwitchboardPlugLocaleWidgetsLocaleViewPrivate));
	return switchboard_plug_locale_widgets_locale_view_type_id;
}

GType
switchboard_plug_locale_widgets_locale_view_get_type (void)
{
	static volatile gsize switchboard_plug_locale_widgets_locale_view_type_id__once = 0;
	if (g_once_init_enter (&switchboard_plug_locale_widgets_locale_view_type_id__once)) {
		GType switchboard_plug_locale_widgets_locale_view_type_id;
		switchboard_plug_locale_widgets_locale_view_type_id = switchboard_plug_locale_widgets_locale_view_get_type_once ();
		g_once_init_leave (&switchboard_plug_locale_widgets_locale_view_type_id__once, switchboard_plug_locale_widgets_locale_view_type_id);
	}
	return switchboard_plug_locale_widgets_locale_view_type_id__once;
}

static void
_vala_switchboard_plug_locale_widgets_locale_view_get_property (GObject * object,
                                                                guint property_id,
                                                                GValue * value,
                                                                GParamSpec * pspec)
{
	SwitchboardPlugLocaleWidgetsLocaleView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SWITCHBOARD_PLUG_LOCALE_WIDGETS_TYPE_LOCALE_VIEW, SwitchboardPlugLocaleWidgetsLocaleView);
	switch (property_id) {
		case SWITCHBOARD_PLUG_LOCALE_WIDGETS_LOCALE_VIEW_PLUG_PROPERTY:
		g_value_set_object (value, switchboard_plug_locale_widgets_locale_view_get_plug (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_switchboard_plug_locale_widgets_locale_view_set_property (GObject * object,
                                                                guint property_id,
                                                                const GValue * value,
                                                                GParamSpec * pspec)
{
	SwitchboardPlugLocaleWidgetsLocaleView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SWITCHBOARD_PLUG_LOCALE_WIDGETS_TYPE_LOCALE_VIEW, SwitchboardPlugLocaleWidgetsLocaleView);
	switch (property_id) {
		case SWITCHBOARD_PLUG_LOCALE_WIDGETS_LOCALE_VIEW_PLUG_PROPERTY:
		switchboard_plug_locale_widgets_locale_view_set_plug (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

