/* LocaleView.c generated by valac 0.56.18-dirty, 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 "io.elementary.settings.locale.h"
#include <gee.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gio/gio.h>
#include <gtk/gtk.h>
#include <granite-7.h>
#include <adwaita.h>
#include <glib/gi18n-lib.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

enum  {
	SWITCHBOARD_PLUG_LOCALE_WIDGETS_LOCALE_VIEW_0_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)))
#define _g_thread_unref0(var) ((var == NULL) ? NULL : (var = (g_thread_unref (var), NULL)))
typedef struct _SwitchboardPlugLocaleWidgetsLocaleViewReloadData SwitchboardPlugLocaleWidgetsLocaleViewReloadData;

#define SWITCHBOARD_PLUG_LOCALE_WIDGETS_LOCALE_VIEW_TYPE_SIDEBAR (switchboard_plug_locale_widgets_locale_view_sidebar_get_type ())
#define SWITCHBOARD_PLUG_LOCALE_WIDGETS_LOCALE_VIEW_SIDEBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWITCHBOARD_PLUG_LOCALE_WIDGETS_LOCALE_VIEW_TYPE_SIDEBAR, SwitchboardPlugLocaleWidgetsLocaleViewSidebar))
#define SWITCHBOARD_PLUG_LOCALE_WIDGETS_LOCALE_VIEW_SIDEBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWITCHBOARD_PLUG_LOCALE_WIDGETS_LOCALE_VIEW_TYPE_SIDEBAR, SwitchboardPlugLocaleWidgetsLocaleViewSidebarClass))
#define SWITCHBOARD_PLUG_LOCALE_WIDGETS_LOCALE_VIEW_IS_SIDEBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWITCHBOARD_PLUG_LOCALE_WIDGETS_LOCALE_VIEW_TYPE_SIDEBAR))
#define SWITCHBOARD_PLUG_LOCALE_WIDGETS_LOCALE_VIEW_IS_SIDEBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWITCHBOARD_PLUG_LOCALE_WIDGETS_LOCALE_VIEW_TYPE_SIDEBAR))
#define SWITCHBOARD_PLUG_LOCALE_WIDGETS_LOCALE_VIEW_SIDEBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWITCHBOARD_PLUG_LOCALE_WIDGETS_LOCALE_VIEW_TYPE_SIDEBAR, SwitchboardPlugLocaleWidgetsLocaleViewSidebarClass))

typedef struct _SwitchboardPlugLocaleWidgetsLocaleViewSidebar SwitchboardPlugLocaleWidgetsLocaleViewSidebar;
typedef struct _SwitchboardPlugLocaleWidgetsLocaleViewSidebarClass SwitchboardPlugLocaleWidgetsLocaleViewSidebarClass;
typedef struct _SwitchboardPlugLocaleWidgetsLocaleViewSidebarPrivate SwitchboardPlugLocaleWidgetsLocaleViewSidebarPrivate;
enum  {
	SWITCHBOARD_PLUG_LOCALE_WIDGETS_LOCALE_VIEW_SIDEBAR_0_PROPERTY,
	SWITCHBOARD_PLUG_LOCALE_WIDGETS_LOCALE_VIEW_SIDEBAR_NUM_PROPERTIES
};
static GParamSpec* switchboard_plug_locale_widgets_locale_view_sidebar_properties[SWITCHBOARD_PLUG_LOCALE_WIDGETS_LOCALE_VIEW_SIDEBAR_NUM_PROPERTIES];
typedef struct _Block5Data Block5Data;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_settings_schema_unref0(var) ((var == NULL) ? NULL : (var = (g_settings_schema_unref (var), NULL)))

struct _SwitchboardPlugLocaleWidgetsLocaleViewPrivate {
	GeeArrayList* langs;
	SwitchboardPlugLocaleInstallerUbuntuInstaller* installer;
	SwitchboardPlugLocaleWidgetsLanguageListBox* list_box;
	SwitchboardPlugLocaleWidgetsLocaleSetting* locale_setting;
	SwitchboardPlugLocaleProgressDialog* progress_dialog;
};

struct _SwitchboardPlugLocaleWidgetsLocaleViewReloadData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	SwitchboardPlugLocaleWidgetsLocaleView* self;
	GThread* _tmp0_;
	GThread* _tmp1_;
	SwitchboardPlugLocaleInstallerUbuntuInstaller* _tmp2_;
};

struct _SwitchboardPlugLocaleWidgetsLocaleViewSidebar {
	GtkBox parent_instance;
	SwitchboardPlugLocaleWidgetsLocaleViewSidebarPrivate * priv;
};

struct _SwitchboardPlugLocaleWidgetsLocaleViewSidebarClass {
	GtkBoxClass parent_class;
};

struct _Block5Data {
	int _ref_count_;
	SwitchboardPlugLocaleWidgetsLocaleView* self;
	SwitchboardPlugLocaleLocaleManager* locale_manager;
	GtkButton* remove_button;
};

static gint SwitchboardPlugLocaleWidgetsLocaleView_private_offset;
static gpointer switchboard_plug_locale_widgets_locale_view_parent_class = NULL;
static gpointer switchboard_plug_locale_widgets_locale_view_sidebar_parent_class = NULL;

static void switchboard_plug_locale_widgets_locale_view_reload_data_free (gpointer _data);
static void switchboard_plug_locale_widgets_locale_view_reload (SwitchboardPlugLocaleWidgetsLocaleView* self,
                                                         GAsyncReadyCallback _callback_,
                                                         gpointer _user_data_);
static void switchboard_plug_locale_widgets_locale_view_reload_finish (SwitchboardPlugLocaleWidgetsLocaleView* self,
                                                                GAsyncResult* _res_);
static gboolean switchboard_plug_locale_widgets_locale_view_reload_co (SwitchboardPlugLocaleWidgetsLocaleViewReloadData* _data_);
static void* __lambda21_ (SwitchboardPlugLocaleWidgetsLocaleView* self);
static gboolean __lambda22_ (SwitchboardPlugLocaleWidgetsLocaleView* self);
static gboolean ___lambda22__gsource_func (gpointer self);
static gpointer ___lambda21__gthread_func (gpointer self);
static void switchboard_plug_locale_widgets_locale_view_reload_ready (GObject* source_object,
                                                               GAsyncResult* _res_,
                                                               gpointer _user_data_);
static void switchboard_plug_locale_widgets_locale_view_on_progress_changed (SwitchboardPlugLocaleWidgetsLocaleView* self,
                                                                      gint progress);
static void __lambda23_ (SwitchboardPlugLocaleWidgetsLocaleView* self);
static void ___lambda23__gtk_dialog_response (GtkDialog* _sender,
                                       gint response_id,
                                       gpointer self);
static GType switchboard_plug_locale_widgets_locale_view_sidebar_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static SwitchboardPlugLocaleWidgetsLocaleViewSidebar* switchboard_plug_locale_widgets_locale_view_sidebar_new (void);
static SwitchboardPlugLocaleWidgetsLocaleViewSidebar* switchboard_plug_locale_widgets_locale_view_sidebar_construct (GType object_type);
static GObject * switchboard_plug_locale_widgets_locale_view_sidebar_constructor (GType type,
                                                                           guint n_construct_properties,
                                                                           GObjectConstructParam * construct_properties);
static GType switchboard_plug_locale_widgets_locale_view_sidebar_get_type_once (void);
static GObject * switchboard_plug_locale_widgets_locale_view_constructor (GType type,
                                                                   guint n_construct_properties,
                                                                   GObjectConstructParam * construct_properties);
static Block5Data* block5_data_ref (Block5Data* _data5_);
static void block5_data_unref (void * _userdata_);
static void _switchboard_plug_locale_widgets_locale_view___lambda24_ (Block5Data* _data5_,
                                                               GtkListBoxRow* row);
static void __switchboard_plug_locale_widgets_locale_view___lambda24__gtk_list_box_row_selected (GtkListBox* _sender,
                                                                                          GtkListBoxRow* row,
                                                                                          gpointer self);
static void _switchboard_plug_locale_widgets_locale_view_on_progress_changed_switchboard_plug_locale_installer_ubuntu_installer_progress_changed (SwitchboardPlugLocaleInstallerUbuntuInstaller* _sender,
                                                                                                                                           gint progress,
                                                                                                                                           gpointer self);
static void _switchboard_plug_locale_widgets_locale_view___lambda25_ (SwitchboardPlugLocaleWidgetsLocaleView* self,
                                                               const gchar* langcode);
static void __switchboard_plug_locale_widgets_locale_view___lambda25__switchboard_plug_locale_installer_ubuntu_installer_install_finished (SwitchboardPlugLocaleInstallerUbuntuInstaller* _sender,
                                                                                                                                    const gchar* langcode,
                                                                                                                                    gpointer self);
static void _switchboard_plug_locale_widgets_locale_view___lambda26_ (SwitchboardPlugLocaleWidgetsLocaleView* self,
                                                               const gchar* langcode);
static void __switchboard_plug_locale_widgets_locale_view___lambda26__switchboard_plug_locale_installer_ubuntu_installer_remove_finished (SwitchboardPlugLocaleInstallerUbuntuInstaller* _sender,
                                                                                                                                   const gchar* langcode,
                                                                                                                                   gpointer self);
static void _switchboard_plug_locale_widgets_locale_view___lambda27_ (SwitchboardPlugLocaleWidgetsLocaleView* self);
static void __lambda28_ (SwitchboardPlugLocaleWidgetsLocaleView* self,
                  GObject* obj,
                  GAsyncResult* res);
static void _gtk_window_destroy_gtk_dialog_response (GtkDialog* _sender,
                                              gint response_id,
                                              gpointer self);
static void ___lambda28__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static void __switchboard_plug_locale_widgets_locale_view___lambda27__gtk_button_clicked (GtkButton* _sender,
                                                                                   gpointer self);
static void _switchboard_plug_locale_widgets_locale_view___lambda29_ (SwitchboardPlugLocaleWidgetsLocaleView* self);
static void __switchboard_plug_locale_widgets_locale_view___lambda29__gtk_button_clicked (GtkButton* _sender,
                                                                                   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 inline gpointer
switchboard_plug_locale_widgets_locale_view_get_instance_private (SwitchboardPlugLocaleWidgetsLocaleView* self)
{
	return G_STRUCT_MEMBER_P (self, SwitchboardPlugLocaleWidgetsLocaleView_private_offset);
}

static void
switchboard_plug_locale_widgets_locale_view_reload_data_free (gpointer _data)
{
	SwitchboardPlugLocaleWidgetsLocaleViewReloadData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (SwitchboardPlugLocaleWidgetsLocaleViewReloadData, _data_);
}

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

static void
switchboard_plug_locale_widgets_locale_view_reload (SwitchboardPlugLocaleWidgetsLocaleView* self,
                                                    GAsyncReadyCallback _callback_,
                                                    gpointer _user_data_)
{
	SwitchboardPlugLocaleWidgetsLocaleViewReloadData* _data_;
	SwitchboardPlugLocaleWidgetsLocaleView* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (SwitchboardPlugLocaleWidgetsLocaleViewReloadData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, switchboard_plug_locale_widgets_locale_view_reload_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	switchboard_plug_locale_widgets_locale_view_reload_co (_data_);
}

static void
switchboard_plug_locale_widgets_locale_view_reload_finish (SwitchboardPlugLocaleWidgetsLocaleView* self,
                                                           GAsyncResult* _res_)
{
	SwitchboardPlugLocaleWidgetsLocaleViewReloadData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static gboolean
__lambda22_ (SwitchboardPlugLocaleWidgetsLocaleView* self)
{
	SwitchboardPlugLocaleWidgetsLanguageListBox* _tmp0_;
	GeeArrayList* _tmp1_;
	SwitchboardPlugLocaleWidgetsLocaleSetting* _tmp2_;
	GeeArrayList* _tmp3_;
	gboolean result;
	_tmp0_ = self->priv->list_box;
	_tmp1_ = self->priv->langs;
	switchboard_plug_locale_widgets_language_list_box_reload_languages (_tmp0_, _tmp1_);
	_tmp2_ = self->priv->locale_setting;
	_tmp3_ = self->priv->langs;
	switchboard_plug_locale_widgets_locale_setting_reload_formats (_tmp2_, _tmp3_);
	result = FALSE;
	return result;
}

static gboolean
___lambda22__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda22_ ((SwitchboardPlugLocaleWidgetsLocaleView*) self);
	return result;
}

static void*
__lambda21_ (SwitchboardPlugLocaleWidgetsLocaleView* self)
{
	GeeArrayList* _tmp0_;
	void* result;
	_tmp0_ = switchboard_plug_locale_utils_get_installed_languages ();
	_g_object_unref0 (self->priv->langs);
	self->priv->langs = _tmp0_;
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda22__gsource_func, g_object_ref (self), g_object_unref);
	result = NULL;
	return result;
}

static gpointer
___lambda21__gthread_func (gpointer self)
{
	gpointer result;
	result = __lambda21_ ((SwitchboardPlugLocaleWidgetsLocaleView*) self);
	g_object_unref (self);
	return result;
}

static void
switchboard_plug_locale_widgets_locale_view_reload_ready (GObject* source_object,
                                                          GAsyncResult* _res_,
                                                          gpointer _user_data_)
{
	SwitchboardPlugLocaleWidgetsLocaleViewReloadData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	switchboard_plug_locale_widgets_locale_view_reload_co (_data_);
}

static gboolean
switchboard_plug_locale_widgets_locale_view_reload_co (SwitchboardPlugLocaleWidgetsLocaleViewReloadData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = g_thread_new ("load-lang-data", ___lambda21__gthread_func, g_object_ref (_data_->self));
	_data_->_tmp1_ = _data_->_tmp0_;
	_g_thread_unref0 (_data_->_tmp1_);
	_data_->_tmp2_ = _data_->self->priv->installer;
	_data_->_state_ = 1;
	switchboard_plug_locale_installer_ubuntu_installer_check_missing_languages (_data_->_tmp2_, switchboard_plug_locale_widgets_locale_view_reload_ready, _data_);
	return FALSE;
	_state_1:
	switchboard_plug_locale_installer_ubuntu_installer_check_missing_languages_finish (_data_->_tmp2_, _data_->_res_);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
__lambda23_ (SwitchboardPlugLocaleWidgetsLocaleView* self)
{
	_g_object_unref0 (self->priv->progress_dialog);
	self->priv->progress_dialog = NULL;
}

static void
___lambda23__gtk_dialog_response (GtkDialog* _sender,
                                  gint response_id,
                                  gpointer self)
{
	__lambda23_ ((SwitchboardPlugLocaleWidgetsLocaleView*) self);
}

static void
switchboard_plug_locale_widgets_locale_view_on_progress_changed (SwitchboardPlugLocaleWidgetsLocaleView* self,
                                                                 gint progress)
{
	SwitchboardPlugLocaleProgressDialog* _tmp0_;
	GtkRoot* _tmp1_;
	GtkWindow* _tmp2_;
	SwitchboardPlugLocaleProgressDialog* _tmp3_ = NULL;
	SwitchboardPlugLocaleProgressDialog* _tmp4_;
	SwitchboardPlugLocaleProgressDialog* _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->progress_dialog;
	if (_tmp0_ != NULL) {
		return;
	}
	_tmp1_ = gtk_widget_get_root ((GtkWidget*) self);
	_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_window_get_type (), GtkWindow));
	_tmp3_ = switchboard_plug_locale_progress_dialog_new ();
	gtk_window_set_transient_for ((GtkWindow*) _tmp3_, _tmp2_);
	_g_object_unref0 (_tmp2_);
	g_object_ref_sink (_tmp3_);
	_g_object_unref0 (self->priv->progress_dialog);
	self->priv->progress_dialog = _tmp3_;
	_tmp4_ = self->priv->progress_dialog;
	gtk_window_present ((GtkWindow*) _tmp4_);
	_tmp5_ = self->priv->progress_dialog;
	g_signal_connect_object ((GtkDialog*) _tmp5_, "response", (GCallback) ___lambda23__gtk_dialog_response, self, 0);
}

SwitchboardPlugLocaleWidgetsLocaleView*
switchboard_plug_locale_widgets_locale_view_construct (GType object_type)
{
	SwitchboardPlugLocaleWidgetsLocaleView * self = NULL;
	self = (SwitchboardPlugLocaleWidgetsLocaleView*) g_object_new (object_type, NULL);
	return self;
}

SwitchboardPlugLocaleWidgetsLocaleView*
switchboard_plug_locale_widgets_locale_view_new (void)
{
	return switchboard_plug_locale_widgets_locale_view_construct (SWITCHBOARD_PLUG_LOCALE_WIDGETS_TYPE_LOCALE_VIEW);
}

static SwitchboardPlugLocaleWidgetsLocaleViewSidebar*
switchboard_plug_locale_widgets_locale_view_sidebar_construct (GType object_type)
{
	SwitchboardPlugLocaleWidgetsLocaleViewSidebar * self = NULL;
	self = (SwitchboardPlugLocaleWidgetsLocaleViewSidebar*) g_object_new (object_type, NULL);
	return self;
}

static SwitchboardPlugLocaleWidgetsLocaleViewSidebar*
switchboard_plug_locale_widgets_locale_view_sidebar_new (void)
{
	return switchboard_plug_locale_widgets_locale_view_sidebar_construct (SWITCHBOARD_PLUG_LOCALE_WIDGETS_LOCALE_VIEW_TYPE_SIDEBAR);
}

static GObject *
switchboard_plug_locale_widgets_locale_view_sidebar_constructor (GType type,
                                                                 guint n_construct_properties,
                                                                 GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	SwitchboardPlugLocaleWidgetsLocaleViewSidebar * self;
	parent_class = G_OBJECT_CLASS (switchboard_plug_locale_widgets_locale_view_sidebar_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SWITCHBOARD_PLUG_LOCALE_WIDGETS_LOCALE_VIEW_TYPE_SIDEBAR, SwitchboardPlugLocaleWidgetsLocaleViewSidebar);
	gtk_widget_add_css_class ((GtkWidget*) self, GRANITE_STYLE_CLASS_SIDEBAR);
	return obj;
}

static void
switchboard_plug_locale_widgets_locale_view_sidebar_base_init (SwitchboardPlugLocaleWidgetsLocaleViewSidebarClass * klass)
{
	gtk_widget_class_set_css_name (GTK_WIDGET_CLASS (klass), "settingssidebar");
}

static void
switchboard_plug_locale_widgets_locale_view_sidebar_class_init (SwitchboardPlugLocaleWidgetsLocaleViewSidebarClass * klass,
                                                                gpointer klass_data)
{
	switchboard_plug_locale_widgets_locale_view_sidebar_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->constructor = switchboard_plug_locale_widgets_locale_view_sidebar_constructor;
}

static void
switchboard_plug_locale_widgets_locale_view_sidebar_instance_init (SwitchboardPlugLocaleWidgetsLocaleViewSidebar * self,
                                                                   gpointer klass)
{
}

 G_GNUC_NO_INLINE static GType
switchboard_plug_locale_widgets_locale_view_sidebar_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SwitchboardPlugLocaleWidgetsLocaleViewSidebarClass), (GBaseInitFunc) switchboard_plug_locale_widgets_locale_view_sidebar_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) switchboard_plug_locale_widgets_locale_view_sidebar_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SwitchboardPlugLocaleWidgetsLocaleViewSidebar), 0, (GInstanceInitFunc) switchboard_plug_locale_widgets_locale_view_sidebar_instance_init, NULL };
	GType switchboard_plug_locale_widgets_locale_view_sidebar_type_id;
	switchboard_plug_locale_widgets_locale_view_sidebar_type_id = g_type_register_static (gtk_box_get_type (), "SwitchboardPlugLocaleWidgetsLocaleViewSidebar", &g_define_type_info, 0);
	return switchboard_plug_locale_widgets_locale_view_sidebar_type_id;
}

static GType
switchboard_plug_locale_widgets_locale_view_sidebar_get_type (void)
{
	static gsize switchboard_plug_locale_widgets_locale_view_sidebar_type_id__once = 0;
	if (g_once_init_enter (&switchboard_plug_locale_widgets_locale_view_sidebar_type_id__once)) {
		GType switchboard_plug_locale_widgets_locale_view_sidebar_type_id;
		switchboard_plug_locale_widgets_locale_view_sidebar_type_id = switchboard_plug_locale_widgets_locale_view_sidebar_get_type_once ();
		g_once_init_leave (&switchboard_plug_locale_widgets_locale_view_sidebar_type_id__once, switchboard_plug_locale_widgets_locale_view_sidebar_type_id);
	}
	return switchboard_plug_locale_widgets_locale_view_sidebar_type_id__once;
}

static Block5Data*
block5_data_ref (Block5Data* _data5_)
{
	g_atomic_int_inc (&_data5_->_ref_count_);
	return _data5_;
}

static void
block5_data_unref (void * _userdata_)
{
	Block5Data* _data5_;
	_data5_ = (Block5Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data5_->_ref_count_)) {
		SwitchboardPlugLocaleWidgetsLocaleView* self;
		self = _data5_->self;
		_g_object_unref0 (_data5_->remove_button);
		_g_object_unref0 (_data5_->locale_manager);
		_g_object_unref0 (self);
		g_slice_free (Block5Data, _data5_);
	}
}

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

static void
__switchboard_plug_locale_widgets_locale_view___lambda24__gtk_list_box_row_selected (GtkListBox* _sender,
                                                                                     GtkListBoxRow* row,
                                                                                     gpointer self)
{
	_switchboard_plug_locale_widgets_locale_view___lambda24_ (self, row);
}

static void
_switchboard_plug_locale_widgets_locale_view_on_progress_changed_switchboard_plug_locale_installer_ubuntu_installer_progress_changed (SwitchboardPlugLocaleInstallerUbuntuInstaller* _sender,
                                                                                                                                      gint progress,
                                                                                                                                      gpointer self)
{
	switchboard_plug_locale_widgets_locale_view_on_progress_changed ((SwitchboardPlugLocaleWidgetsLocaleView*) self, progress);
}

static void
_switchboard_plug_locale_widgets_locale_view___lambda25_ (SwitchboardPlugLocaleWidgetsLocaleView* self,
                                                          const gchar* langcode)
{
	g_return_if_fail (langcode != NULL);
	switchboard_plug_locale_widgets_locale_view_reload (self, NULL, NULL);
}

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

static void
_switchboard_plug_locale_widgets_locale_view___lambda26_ (SwitchboardPlugLocaleWidgetsLocaleView* self,
                                                          const gchar* langcode)
{
	g_return_if_fail (langcode != NULL);
	switchboard_plug_locale_widgets_locale_view_reload (self, NULL, NULL);
}

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

static void
_gtk_window_destroy_gtk_dialog_response (GtkDialog* _sender,
                                         gint response_id,
                                         gpointer self)
{
	gtk_window_destroy ((GtkWindow*) self);
}

static void
__lambda28_ (SwitchboardPlugLocaleWidgetsLocaleView* self,
             GObject* obj,
             GAsyncResult* res)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (res != NULL);
	{
		SwitchboardPlugLocaleInstallerUbuntuInstaller* _tmp0_;
		_tmp0_ = self->priv->installer;
		switchboard_plug_locale_installer_ubuntu_installer_remove_finish (_tmp0_, res, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp1_;
		GraniteMessageDialog* dialog = NULL;
		GError* _tmp2_;
		const gchar* _tmp3_;
		GThemedIcon* _tmp4_;
		GThemedIcon* _tmp5_;
		GThemedIcon* _tmp6_;
		GApplication* _tmp7_;
		GtkWindow* _tmp8_;
		GtkWindow* _tmp9_;
		GtkWindow* _tmp10_;
		GraniteMessageDialog* _tmp11_ = NULL;
		GraniteMessageDialog* _tmp12_;
		GraniteMessageDialog* _tmp13_;
		GraniteMessageDialog* _tmp14_;
		GraniteMessageDialog* _tmp15_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp1_ = e;
		if (g_error_matches (_tmp1_, g_dbus_error_quark (), G_DBUS_ERROR_ACCESS_DENIED)) {
			_g_error_free0 (e);
			return;
		}
		_tmp2_ = e;
		_tmp3_ = _tmp2_->message;
		_tmp4_ = (GThemedIcon*) g_themed_icon_new ("preferences-desktop-locale");
		_tmp5_ = _tmp4_;
		_tmp6_ = (GThemedIcon*) g_themed_icon_new ("dialog-error");
		_tmp7_ = g_application_get_default ();
		_tmp8_ = gtk_application_get_active_window (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, gtk_application_get_type (), GtkApplication));
		_tmp9_ = _tmp8_;
		_tmp10_ = _g_object_ref0 (_tmp9_);
		_tmp11_ = granite_message_dialog_new (_ ("Couldn't remove language pack"), _tmp3_, (GIcon*) _tmp5_, GTK_BUTTONS_CLOSE);
		granite_message_dialog_set_badge_icon (_tmp11_, (GIcon*) _tmp6_);
		_g_object_unref0 (_tmp6_);
		gtk_window_set_modal ((GtkWindow*) _tmp11_, TRUE);
		gtk_window_set_transient_for ((GtkWindow*) _tmp11_, _tmp10_);
		_g_object_unref0 (_tmp10_);
		g_object_ref_sink (_tmp11_);
		_tmp12_ = _tmp11_;
		_g_object_unref0 (_tmp5_);
		dialog = _tmp12_;
		_tmp13_ = dialog;
		gtk_window_present ((GtkWindow*) _tmp13_);
		_tmp14_ = dialog;
		_tmp15_ = dialog;
		g_signal_connect_object ((GtkDialog*) _tmp14_, "response", (GCallback) _gtk_window_destroy_gtk_dialog_response, (GtkWindow*) _tmp15_, 0);
		_g_object_unref0 (dialog);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
___lambda28__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda28_ ((SwitchboardPlugLocaleWidgetsLocaleView*) self, source_object, res);
	g_object_unref (self);
}

static void
_switchboard_plug_locale_widgets_locale_view___lambda27_ (SwitchboardPlugLocaleWidgetsLocaleView* self)
{
	SwitchboardPlugLocaleInstallerUbuntuInstaller* _tmp0_;
	SwitchboardPlugLocaleWidgetsLanguageListBox* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	_tmp0_ = self->priv->installer;
	_tmp1_ = self->priv->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_, ___lambda28__gasync_ready_callback, g_object_ref (self));
	_g_free0 (_tmp3_);
}

static void
__switchboard_plug_locale_widgets_locale_view___lambda27__gtk_button_clicked (GtkButton* _sender,
                                                                              gpointer self)
{
	_switchboard_plug_locale_widgets_locale_view___lambda27_ ((SwitchboardPlugLocaleWidgetsLocaleView*) self);
}

static void
_switchboard_plug_locale_widgets_locale_view___lambda29_ (SwitchboardPlugLocaleWidgetsLocaleView* self)
{
	SwitchboardPlugLocaleWidgetsInstallDialog* install_dialog = NULL;
	GtkRoot* _tmp0_;
	GtkWindow* _tmp1_;
	SwitchboardPlugLocaleWidgetsInstallDialog* _tmp2_ = NULL;
	SwitchboardPlugLocaleWidgetsInstallDialog* _tmp3_;
	_tmp0_ = gtk_widget_get_root ((GtkWidget*) self);
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_window_get_type (), GtkWindow));
	_tmp2_ = switchboard_plug_locale_widgets_install_dialog_new ();
	gtk_window_set_transient_for ((GtkWindow*) _tmp2_, _tmp1_);
	_g_object_unref0 (_tmp1_);
	g_object_ref_sink (_tmp2_);
	install_dialog = _tmp2_;
	_tmp3_ = install_dialog;
	gtk_window_present ((GtkWindow*) _tmp3_);
	_g_object_unref0 (install_dialog);
}

static void
__switchboard_plug_locale_widgets_locale_view___lambda29__gtk_button_clicked (GtkButton* _sender,
                                                                              gpointer self)
{
	_switchboard_plug_locale_widgets_locale_view___lambda29_ ((SwitchboardPlugLocaleWidgetsLocaleView*) self);
}

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;
	Block5Data* _data5_;
	SwitchboardPlugLocaleLocaleManager* _tmp0_;
	SwitchboardPlugLocaleLocaleManager* _tmp1_;
	SwitchboardPlugLocaleWidgetsLanguageListBox* _tmp2_;
	GtkScrolledWindow* scroll = NULL;
	SwitchboardPlugLocaleWidgetsLanguageListBox* _tmp3_;
	GtkWidget* _tmp4_;
	GtkScrolledWindow* _tmp5_ = NULL;
	AdwHeaderBar* headerbar = NULL;
	AdwHeaderBar* _tmp6_ = NULL;
	GtkLabel* install_label = NULL;
	GtkLabel* _tmp7_;
	GtkBox* add_box = NULL;
	GtkBox* _tmp8_;
	GtkBox* _tmp9_;
	GtkImage* _tmp10_;
	GtkImage* _tmp11_;
	GtkBox* _tmp12_;
	GtkLabel* _tmp13_;
	GtkButton* add_button = NULL;
	GtkBox* _tmp14_;
	GtkWidget* _tmp15_;
	GtkButton* _tmp16_ = NULL;
	GtkLabel* _tmp17_;
	GtkButton* _tmp18_;
	gchar* _tmp19_;
	GtkButton* _tmp20_ = NULL;
	GtkActionBar* action_bar = NULL;
	GtkActionBar* _tmp21_;
	GtkActionBar* _tmp22_;
	GtkButton* _tmp23_;
	GtkActionBar* _tmp24_;
	GtkButton* _tmp25_;
	AdwToolbarView* toolbarview = NULL;
	GtkScrolledWindow* _tmp26_;
	GtkWidget* _tmp27_;
	AdwToolbarView* _tmp28_ = NULL;
	AdwToolbarView* _tmp29_;
	AdwHeaderBar* _tmp30_;
	AdwToolbarView* _tmp31_;
	GtkActionBar* _tmp32_;
	SwitchboardPlugLocaleWidgetsLocaleViewSidebar* sidebar = NULL;
	SwitchboardPlugLocaleWidgetsLocaleViewSidebar* _tmp33_;
	SwitchboardPlugLocaleWidgetsLocaleViewSidebar* _tmp34_;
	AdwToolbarView* _tmp35_;
	SwitchboardPlugLocaleWidgetsLocaleSetting* _tmp36_;
	GtkPaned* paned = NULL;
	SwitchboardPlugLocaleWidgetsLocaleViewSidebar* _tmp37_;
	GtkWidget* _tmp38_;
	SwitchboardPlugLocaleWidgetsLocaleSetting* _tmp39_;
	GtkWidget* _tmp40_;
	GtkPaned* _tmp41_ = NULL;
	GSettingsSchema* sss = NULL;
	GSettingsSchemaSource* _tmp42_;
	GSettingsSchema* _tmp43_;
	gboolean _tmp44_ = FALSE;
	GSettingsSchema* _tmp45_;
	GtkPaned* _tmp50_;
	SwitchboardPlugLocaleWidgetsLanguageListBox* _tmp51_;
	GtkListBox* _tmp52_;
	GtkListBox* _tmp53_;
	SwitchboardPlugLocaleInstallerUbuntuInstaller* _tmp54_;
	SwitchboardPlugLocaleInstallerUbuntuInstaller* _tmp55_;
	SwitchboardPlugLocaleLocaleManager* lm = NULL;
	SwitchboardPlugLocaleLocaleManager* _tmp56_;
	SwitchboardPlugLocaleLocaleManager* _tmp57_;
	gboolean _tmp58_;
	gboolean _tmp59_;
	SwitchboardPlugLocaleInstallerUbuntuInstaller* _tmp60_;
	SwitchboardPlugLocaleInstallerUbuntuInstaller* _tmp61_;
	SwitchboardPlugLocaleInstallerUbuntuInstaller* _tmp62_;
	GtkButton* _tmp63_;
	GtkButton* _tmp64_;
	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);
	_data5_ = g_slice_new0 (Block5Data);
	_data5_->_ref_count_ = 1;
	_data5_->self = g_object_ref (self);
	_tmp0_ = switchboard_plug_locale_locale_manager_get_default ();
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_data5_->locale_manager = _tmp1_;
	_tmp2_ = switchboard_plug_locale_widgets_language_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;
	_tmp4_ = _g_object_ref0 ((GtkWidget*) _tmp3_);
	_tmp5_ = (GtkScrolledWindow*) gtk_scrolled_window_new ();
	gtk_scrolled_window_set_child (_tmp5_, _tmp4_);
	_g_object_unref0 (_tmp4_);
	g_object_set (_tmp5_, "hscrollbar-policy", GTK_POLICY_NEVER, NULL);
	g_object_ref_sink (_tmp5_);
	scroll = _tmp5_;
	_tmp6_ = (AdwHeaderBar*) adw_header_bar_new ();
	adw_header_bar_set_show_end_title_buttons (_tmp6_, FALSE);
	adw_header_bar_set_show_title (_tmp6_, FALSE);
	g_object_ref_sink (_tmp6_);
	headerbar = _tmp6_;
	_tmp7_ = (GtkLabel*) gtk_label_new (_ ("Install Language"));
	g_object_ref_sink (_tmp7_);
	install_label = _tmp7_;
	_tmp8_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	g_object_ref_sink (_tmp8_);
	add_box = _tmp8_;
	_tmp9_ = add_box;
	_tmp10_ = (GtkImage*) gtk_image_new_from_icon_name ("list-add-symbolic");
	g_object_ref_sink (_tmp10_);
	_tmp11_ = _tmp10_;
	gtk_box_append (_tmp9_, (GtkWidget*) _tmp11_);
	_g_object_unref0 (_tmp11_);
	_tmp12_ = add_box;
	_tmp13_ = install_label;
	gtk_box_append (_tmp12_, (GtkWidget*) _tmp13_);
	_tmp14_ = add_box;
	_tmp15_ = _g_object_ref0 ((GtkWidget*) _tmp14_);
	_tmp16_ = (GtkButton*) gtk_button_new ();
	gtk_button_set_child (_tmp16_, _tmp15_);
	_g_object_unref0 (_tmp15_);
	gtk_button_set_has_frame (_tmp16_, FALSE);
	g_object_ref_sink (_tmp16_);
	add_button = _tmp16_;
	_tmp17_ = install_label;
	_tmp18_ = add_button;
	gtk_label_set_mnemonic_widget (_tmp17_, (GtkWidget*) _tmp18_);
	_tmp19_ = g_strdup (_ ("Remove language"));
	_tmp20_ = (GtkButton*) gtk_button_new_from_icon_name ("list-remove-symbolic");
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp20_, _tmp19_);
	_g_free0 (_tmp19_);
	g_object_ref_sink (_tmp20_);
	_data5_->remove_button = _tmp20_;
	_tmp21_ = (GtkActionBar*) gtk_action_bar_new ();
	g_object_ref_sink (_tmp21_);
	action_bar = _tmp21_;
	_tmp22_ = action_bar;
	_tmp23_ = add_button;
	gtk_action_bar_pack_start (_tmp22_, (GtkWidget*) _tmp23_);
	_tmp24_ = action_bar;
	_tmp25_ = _data5_->remove_button;
	gtk_action_bar_pack_start (_tmp24_, (GtkWidget*) _tmp25_);
	_tmp26_ = scroll;
	_tmp27_ = _g_object_ref0 ((GtkWidget*) _tmp26_);
	_tmp28_ = (AdwToolbarView*) adw_toolbar_view_new ();
	adw_toolbar_view_set_content (_tmp28_, _tmp27_);
	_g_object_unref0 (_tmp27_);
	adw_toolbar_view_set_bottom_bar_style (_tmp28_, ADW_TOOLBAR_RAISED);
	g_object_ref_sink (_tmp28_);
	toolbarview = _tmp28_;
	_tmp29_ = toolbarview;
	_tmp30_ = headerbar;
	adw_toolbar_view_add_top_bar (_tmp29_, (GtkWidget*) _tmp30_);
	_tmp31_ = toolbarview;
	_tmp32_ = action_bar;
	adw_toolbar_view_add_bottom_bar (_tmp31_, (GtkWidget*) _tmp32_);
	_tmp33_ = switchboard_plug_locale_widgets_locale_view_sidebar_new ();
	g_object_ref_sink (_tmp33_);
	sidebar = _tmp33_;
	_tmp34_ = sidebar;
	_tmp35_ = toolbarview;
	gtk_box_append ((GtkBox*) _tmp34_, (GtkWidget*) _tmp35_);
	_tmp36_ = switchboard_plug_locale_widgets_locale_setting_new ();
	g_object_ref_sink (_tmp36_);
	_g_object_unref0 (self->priv->locale_setting);
	self->priv->locale_setting = _tmp36_;
	_tmp37_ = sidebar;
	_tmp38_ = _g_object_ref0 ((GtkWidget*) _tmp37_);
	_tmp39_ = self->priv->locale_setting;
	_tmp40_ = _g_object_ref0 ((GtkWidget*) _tmp39_);
	_tmp41_ = (GtkPaned*) gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
	gtk_paned_set_start_child (_tmp41_, _tmp38_);
	_g_object_unref0 (_tmp38_);
	gtk_paned_set_shrink_start_child (_tmp41_, FALSE);
	gtk_paned_set_resize_start_child (_tmp41_, FALSE);
	gtk_paned_set_end_child (_tmp41_, _tmp40_);
	_g_object_unref0 (_tmp40_);
	gtk_paned_set_shrink_end_child (_tmp41_, FALSE);
	g_object_ref_sink (_tmp41_);
	paned = _tmp41_;
	_tmp42_ = g_settings_schema_source_get_default ();
	_tmp43_ = g_settings_schema_source_lookup (_tmp42_, "io.elementary.settings", TRUE);
	sss = _tmp43_;
	_tmp45_ = sss;
	if (_tmp45_ != NULL) {
		GSettingsSchema* _tmp46_;
		_tmp46_ = sss;
		_tmp44_ = g_settings_schema_has_key (_tmp46_, "sidebar-position");
	} else {
		_tmp44_ = FALSE;
	}
	if (_tmp44_) {
		GSettings* settings = NULL;
		GSettings* _tmp47_;
		GSettings* _tmp48_;
		GtkPaned* _tmp49_;
		_tmp47_ = g_settings_new ("io.elementary.settings");
		settings = _tmp47_;
		_tmp48_ = settings;
		_tmp49_ = paned;
		g_settings_bind (_tmp48_, "sidebar-position", (GObject*) _tmp49_, "position", G_SETTINGS_BIND_DEFAULT);
		_g_object_unref0 (settings);
	}
	_tmp50_ = paned;
	gtk_box_append ((GtkBox*) self, (GtkWidget*) _tmp50_);
	_tmp51_ = self->priv->list_box;
	_tmp52_ = switchboard_plug_locale_widgets_language_list_box_get_listbox (_tmp51_);
	_tmp53_ = _tmp52_;
	g_signal_connect_data (_tmp53_, "row-selected", (GCallback) __switchboard_plug_locale_widgets_locale_view___lambda24__gtk_list_box_row_selected, block5_data_ref (_data5_), (GClosureNotify) block5_data_unref, 0);
	_tmp54_ = switchboard_plug_locale_installer_ubuntu_installer_get_default ();
	_tmp55_ = _g_object_ref0 (_tmp54_);
	_g_object_unref0 (self->priv->installer);
	self->priv->installer = _tmp55_;
	_tmp56_ = switchboard_plug_locale_locale_manager_get_default ();
	lm = _tmp56_;
	_tmp57_ = lm;
	_tmp58_ = switchboard_plug_locale_locale_manager_get_is_connected (_tmp57_);
	_tmp59_ = _tmp58_;
	if (_tmp59_) {
		switchboard_plug_locale_widgets_locale_view_reload (self, NULL, NULL);
	}
	_tmp60_ = self->priv->installer;
	g_signal_connect_object (_tmp60_, "progress-changed", (GCallback) _switchboard_plug_locale_widgets_locale_view_on_progress_changed_switchboard_plug_locale_installer_ubuntu_installer_progress_changed, self, 0);
	_tmp61_ = self->priv->installer;
	g_signal_connect_object (_tmp61_, "install-finished", (GCallback) __switchboard_plug_locale_widgets_locale_view___lambda25__switchboard_plug_locale_installer_ubuntu_installer_install_finished, self, 0);
	_tmp62_ = self->priv->installer;
	g_signal_connect_object (_tmp62_, "remove-finished", (GCallback) __switchboard_plug_locale_widgets_locale_view___lambda26__switchboard_plug_locale_installer_ubuntu_installer_remove_finished, self, 0);
	_tmp63_ = _data5_->remove_button;
	g_signal_connect_object (_tmp63_, "clicked", (GCallback) __switchboard_plug_locale_widgets_locale_view___lambda27__gtk_button_clicked, self, 0);
	_tmp64_ = add_button;
	g_signal_connect_object (_tmp64_, "clicked", (GCallback) __switchboard_plug_locale_widgets_locale_view___lambda29__gtk_button_clicked, self, 0);
	_g_settings_schema_unref0 (sss);
	_g_object_unref0 (paned);
	_g_object_unref0 (sidebar);
	_g_object_unref0 (toolbarview);
	_g_object_unref0 (action_bar);
	_g_object_unref0 (add_button);
	_g_object_unref0 (add_box);
	_g_object_unref0 (install_label);
	_g_object_unref0 (headerbar);
	_g_object_unref0 (scroll);
	block5_data_unref (_data5_);
	_data5_ = 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)->constructor = switchboard_plug_locale_widgets_locale_view_constructor;
	G_OBJECT_CLASS (klass)->finalize = switchboard_plug_locale_widgets_locale_view_finalize;
}

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);
	self->priv->progress_dialog = NULL;
}

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->langs);
	_g_object_unref0 (self->priv->installer);
	_g_object_unref0 (self->priv->list_box);
	_g_object_unref0 (self->priv->locale_setting);
	_g_object_unref0 (self->priv->progress_dialog);
	G_OBJECT_CLASS (switchboard_plug_locale_widgets_locale_view_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE 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_box_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 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;
}

