/* components-preferences-window.c generated by valac 0.56.3, the Vala compiler
 * generated from components-preferences-window.vala, do not modify */

/*
 * Copyright 2016 Software Freedom Conservancy Inc.
 * Copyright 2019 Michael Gratton <mike@vee.net>
 *
 * This software is licensed under the GNU Lesser General Public License
 * (version 2.1 or later). See the COPYING file in this distribution.
 */

#include "geary-client-43.0.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gio/gio.h>
#include <gtk/gtk.h>
#include <glib-object.h>
#include <handy.h>
#include <glib/gi18n-lib.h>
#include <gee.h>
#include <libpeas/peas.h>

#define COMPONENTS_PREFERENCES_WINDOW_ACTION_CLOSE "preferences-close"

enum  {
	COMPONENTS_PREFERENCES_WINDOW_0_PROPERTY,
	COMPONENTS_PREFERENCES_WINDOW_APPLICATION_PROPERTY,
	COMPONENTS_PREFERENCES_WINDOW_NUM_PROPERTIES
};
static GParamSpec* components_preferences_window_properties[COMPONENTS_PREFERENCES_WINDOW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define COMPONENTS_PREFERENCES_WINDOW_TYPE_PLUGIN_ROW (components_preferences_window_plugin_row_get_type ())
#define COMPONENTS_PREFERENCES_WINDOW_PLUGIN_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), COMPONENTS_PREFERENCES_WINDOW_TYPE_PLUGIN_ROW, ComponentsPreferencesWindowPluginRow))
#define COMPONENTS_PREFERENCES_WINDOW_PLUGIN_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), COMPONENTS_PREFERENCES_WINDOW_TYPE_PLUGIN_ROW, ComponentsPreferencesWindowPluginRowClass))
#define COMPONENTS_PREFERENCES_WINDOW_IS_PLUGIN_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), COMPONENTS_PREFERENCES_WINDOW_TYPE_PLUGIN_ROW))
#define COMPONENTS_PREFERENCES_WINDOW_IS_PLUGIN_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), COMPONENTS_PREFERENCES_WINDOW_TYPE_PLUGIN_ROW))
#define COMPONENTS_PREFERENCES_WINDOW_PLUGIN_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), COMPONENTS_PREFERENCES_WINDOW_TYPE_PLUGIN_ROW, ComponentsPreferencesWindowPluginRowClass))

typedef struct _ComponentsPreferencesWindowPluginRow ComponentsPreferencesWindowPluginRow;
typedef struct _ComponentsPreferencesWindowPluginRowClass ComponentsPreferencesWindowPluginRowClass;
#define __vala_PeasPluginInfo_free0(var) ((var == NULL) ? NULL : (var = (_vala_PeasPluginInfo_free (var), NULL)))
typedef struct _ComponentsPreferencesWindowPluginRowPrivate ComponentsPreferencesWindowPluginRowPrivate;
enum  {
	COMPONENTS_PREFERENCES_WINDOW_PLUGIN_ROW_0_PROPERTY,
	COMPONENTS_PREFERENCES_WINDOW_PLUGIN_ROW_NUM_PROPERTIES
};
static GParamSpec* components_preferences_window_plugin_row_properties[COMPONENTS_PREFERENCES_WINDOW_PLUGIN_ROW_NUM_PROPERTIES];
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

struct _ComponentsPreferencesWindowPrivate {
	ApplicationPluginManager* plugins;
};

struct _ComponentsPreferencesWindowPluginRow {
	HdyActionRow parent_instance;
	ComponentsPreferencesWindowPluginRowPrivate * priv;
};

struct _ComponentsPreferencesWindowPluginRowClass {
	HdyActionRowClass parent_class;
};

struct _ComponentsPreferencesWindowPluginRowPrivate {
	PeasPluginInfo* plugin;
	ApplicationPluginManager* plugins;
	GtkSwitch* sw;
};

static gint ComponentsPreferencesWindow_private_offset;
static gpointer components_preferences_window_parent_class = NULL;
static gint ComponentsPreferencesWindowPluginRow_private_offset;
static gpointer components_preferences_window_plugin_row_parent_class = NULL;

static void components_preferences_window_on_close (ComponentsPreferencesWindow* self);
static void _components_preferences_window_on_close_gsimple_action_activate_callback (GSimpleAction* action,
                                                                               GVariant* parameter,
                                                                               gpointer self);
static void components_preferences_window_add_general_pane (ComponentsPreferencesWindow* self);
static void components_preferences_window_add_plugin_pane (ComponentsPreferencesWindow* self);
static gboolean components_preferences_window_settings_trust_images_getter (GValue* value,
                                                                     GVariant* variant,
                                                                     void* user_data);
static GVariant* components_preferences_window_settings_trust_images_setter (GValue* value,
                                                                      const GVariantType* expected_type,
                                                                      void* user_data);
static ComponentsPreferencesWindowPluginRow* components_preferences_window_plugin_row_new (PeasPluginInfo* plugin,
                                                                                    ApplicationPluginManager* plugins);
static ComponentsPreferencesWindowPluginRow* components_preferences_window_plugin_row_construct (GType object_type,
                                                                                          PeasPluginInfo* plugin,
                                                                                          ApplicationPluginManager* plugins);
static GType components_preferences_window_plugin_row_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static void _vala_PeasPluginInfo_free (PeasPluginInfo* self);
static void _vala_array_add14 (gchar** * array,
                        gint* length,
                        gint* size,
                        gchar* value);
static PeasPluginInfo* _vala_PeasPluginInfo_copy (PeasPluginInfo* self);
static void __lambda178_ (ComponentsPreferencesWindowPluginRow* self);
static void components_preferences_window_plugin_row_update_plugin (ComponentsPreferencesWindowPluginRow* self);
static void ___lambda178__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static void __lambda179_ (ComponentsPreferencesWindowPluginRow* self,
                   PeasPluginInfo* info);
static void ___lambda179__application_plugin_manager_plugin_activated (ApplicationPluginManager* _sender,
                                                                PeasPluginInfo* info,
                                                                gpointer self);
static void __lambda180_ (ComponentsPreferencesWindowPluginRow* self,
                   PeasPluginInfo* info);
static void ___lambda180__application_plugin_manager_plugin_deactivated (ApplicationPluginManager* _sender,
                                                                  PeasPluginInfo* info,
                                                                  GError* _error_,
                                                                  gpointer self);
static void __lambda181_ (ComponentsPreferencesWindowPluginRow* self,
                   PeasPluginInfo* info);
static void ___lambda181__application_plugin_manager_plugin_error (ApplicationPluginManager* _sender,
                                                            PeasPluginInfo* info,
                                                            GError* _error_,
                                                            gpointer self);
static void components_preferences_window_plugin_row_finalize (GObject * obj);
static GType components_preferences_window_plugin_row_get_type_once (void);
static void components_preferences_window_finalize (GObject * obj);
static GType components_preferences_window_get_type_once (void);
static void _vala_components_preferences_window_get_property (GObject * object,
                                                       guint property_id,
                                                       GValue * value,
                                                       GParamSpec * pspec);
static void _vala_components_preferences_window_set_property (GObject * object,
                                                       guint property_id,
                                                       const GValue * value,
                                                       GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

static const GActionEntry COMPONENTS_PREFERENCES_WINDOW_WINDOW_ACTIONS[2] = {{ACTION_WINDOW_CLOSE, _components_preferences_window_on_close_gsimple_action_activate_callback}, {COMPONENTS_PREFERENCES_WINDOW_ACTION_CLOSE, _components_preferences_window_on_close_gsimple_action_activate_callback}};

static inline gpointer
components_preferences_window_get_instance_private (ComponentsPreferencesWindow* self)
{
	return G_STRUCT_MEMBER_P (self, ComponentsPreferencesWindow_private_offset);
}

static void
_components_preferences_window_on_close_gsimple_action_activate_callback (GSimpleAction* action,
                                                                          GVariant* parameter,
                                                                          gpointer self)
{
	components_preferences_window_on_close ((ComponentsPreferencesWindow*) self);
}

void
components_preferences_window_add_accelerators (ApplicationClient* app)
{
	gchar* _tmp0_;
	gchar** _tmp1_;
	gchar** _tmp2_;
	gint _tmp2__length1;
	g_return_if_fail (APPLICATION_IS_CLIENT (app));
	_tmp0_ = g_strdup ("Escape");
	_tmp1_ = g_new0 (gchar*, 1 + 1);
	_tmp1_[0] = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp2__length1 = 1;
	application_client_add_window_accelerators (app, COMPONENTS_PREFERENCES_WINDOW_ACTION_CLOSE, _tmp2_, (gint) 1, NULL);
	_tmp2_ = (_vala_array_free (_tmp2_, _tmp2__length1, (GDestroyNotify) g_free), NULL);
}

ApplicationClient*
components_preferences_window_get_application (ComponentsPreferencesWindow* self)
{
	ApplicationClient* result;
	GtkApplication* _tmp0_;
	g_return_val_if_fail (COMPONENTS_IS_PREFERENCES_WINDOW (self), NULL);
	_tmp0_ = gtk_window_get_application (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, hdy_preferences_window_get_type (), HdyPreferencesWindow), gtk_window_get_type (), GtkWindow));
	result = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, APPLICATION_TYPE_CLIENT, ApplicationClient);
	return result;
}

void
components_preferences_window_set_application (ComponentsPreferencesWindow* self,
                                               ApplicationClient* value)
{
	g_return_if_fail (COMPONENTS_IS_PREFERENCES_WINDOW (self));
	gtk_window_set_application (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, hdy_preferences_window_get_type (), HdyPreferencesWindow), gtk_window_get_type (), GtkWindow), G_TYPE_CHECK_INSTANCE_CAST (value, gtk_application_get_type (), GtkApplication));
	g_object_notify_by_pspec ((GObject *) self, components_preferences_window_properties[COMPONENTS_PREFERENCES_WINDOW_APPLICATION_PROPERTY]);
}

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

ComponentsPreferencesWindow*
components_preferences_window_construct (GType object_type,
                                         ApplicationMainWindow* parent,
                                         ApplicationPluginManager* plugins)
{
	ComponentsPreferencesWindow * self = NULL;
	ApplicationClient* _tmp0_;
	ApplicationClient* _tmp1_;
	ApplicationPluginManager* _tmp2_;
	g_return_val_if_fail (APPLICATION_IS_MAIN_WINDOW (parent), NULL);
	g_return_val_if_fail (APPLICATION_IS_PLUGIN_MANAGER (plugins), NULL);
	_tmp0_ = application_main_window_get_application (parent);
	_tmp1_ = _tmp0_;
	self = (ComponentsPreferencesWindow*) g_object_new (object_type, "application", _tmp1_, "default-width", 540, "transient-for", parent, NULL);
	_tmp2_ = _g_object_ref0 (plugins);
	_g_object_unref0 (self->priv->plugins);
	self->priv->plugins = _tmp2_;
	components_preferences_window_add_general_pane (self);
	components_preferences_window_add_plugin_pane (self);
	return self;
}

ComponentsPreferencesWindow*
components_preferences_window_new (ApplicationMainWindow* parent,
                                   ApplicationPluginManager* plugins)
{
	return components_preferences_window_construct (COMPONENTS_TYPE_PREFERENCES_WINDOW, parent, plugins);
}

static void
components_preferences_window_add_general_pane (ComponentsPreferencesWindow* self)
{
	GtkSwitch* autoselect = NULL;
	GtkSwitch* _tmp0_;
	GtkSwitch* _tmp1_;
	HdyActionRow* autoselect_row = NULL;
	HdyActionRow* _tmp2_;
	HdyActionRow* _tmp3_;
	HdyActionRow* _tmp4_;
	HdyActionRow* _tmp5_;
	GtkSwitch* _tmp6_;
	HdyActionRow* _tmp7_;
	GtkSwitch* _tmp8_;
	GtkSwitch* display_preview = NULL;
	GtkSwitch* _tmp9_;
	GtkSwitch* _tmp10_;
	HdyActionRow* display_preview_row = NULL;
	HdyActionRow* _tmp11_;
	HdyActionRow* _tmp12_;
	HdyActionRow* _tmp13_;
	HdyActionRow* _tmp14_;
	GtkSwitch* _tmp15_;
	HdyActionRow* _tmp16_;
	GtkSwitch* _tmp17_;
	GtkSwitch* single_key_shortucts = NULL;
	GtkSwitch* _tmp18_;
	GtkSwitch* _tmp19_;
	HdyActionRow* single_key_shortucts_row = NULL;
	HdyActionRow* _tmp20_;
	HdyActionRow* _tmp21_;
	HdyActionRow* _tmp22_;
	HdyActionRow* _tmp23_;
	HdyActionRow* _tmp24_;
	GtkSwitch* _tmp25_;
	HdyActionRow* _tmp26_;
	GtkSwitch* _tmp27_;
	GtkSwitch* startup_notifications = NULL;
	GtkSwitch* _tmp28_;
	GtkSwitch* _tmp29_;
	HdyActionRow* startup_notifications_row = NULL;
	HdyActionRow* _tmp30_;
	HdyActionRow* _tmp31_;
	HdyActionRow* _tmp32_;
	HdyActionRow* _tmp33_;
	HdyActionRow* _tmp34_;
	GtkSwitch* _tmp35_;
	HdyActionRow* _tmp36_;
	GtkSwitch* _tmp37_;
	GtkSwitch* trust_images = NULL;
	GtkSwitch* _tmp38_;
	GtkSwitch* _tmp39_;
	HdyActionRow* trust_images_row = NULL;
	HdyActionRow* _tmp40_;
	HdyActionRow* _tmp41_;
	HdyActionRow* _tmp42_;
	HdyActionRow* _tmp43_;
	GtkSwitch* _tmp44_;
	HdyActionRow* _tmp45_;
	GtkSwitch* _tmp46_;
	HdyPreferencesGroup* group = NULL;
	HdyPreferencesGroup* _tmp47_;
	HdyPreferencesGroup* _tmp48_;
	HdyActionRow* _tmp49_;
	HdyPreferencesGroup* _tmp50_;
	HdyActionRow* _tmp51_;
	HdyPreferencesGroup* _tmp52_;
	HdyActionRow* _tmp53_;
	HdyPreferencesGroup* _tmp54_;
	HdyActionRow* _tmp55_;
	HdyPreferencesGroup* _tmp56_;
	HdyActionRow* _tmp57_;
	HdyPreferencesPage* page = NULL;
	HdyPreferencesPage* _tmp58_;
	HdyPreferencesPage* _tmp59_;
	HdyPreferencesPage* _tmp60_;
	HdyPreferencesPage* _tmp61_;
	HdyPreferencesGroup* _tmp62_;
	HdyPreferencesPage* _tmp63_;
	HdyPreferencesPage* _tmp64_;
	GSimpleActionGroup* window_actions = NULL;
	GSimpleActionGroup* _tmp65_;
	GSimpleActionGroup* _tmp66_;
	GSimpleActionGroup* _tmp67_;
	ApplicationClient* application = NULL;
	ApplicationClient* _tmp68_;
	ApplicationClient* _tmp69_;
	ApplicationClient* _tmp70_;
	ApplicationClient* _tmp71_;
	g_return_if_fail (COMPONENTS_IS_PREFERENCES_WINDOW (self));
	_tmp0_ = (GtkSwitch*) gtk_switch_new ();
	g_object_ref_sink (_tmp0_);
	autoselect = _tmp0_;
	_tmp1_ = autoselect;
	gtk_widget_set_valign (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_CENTER);
	_tmp2_ = (HdyActionRow*) hdy_action_row_new ();
	g_object_ref_sink (_tmp2_);
	autoselect_row = _tmp2_;
	_tmp3_ = autoselect_row;
	hdy_preferences_row_set_title (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, hdy_preferences_row_get_type (), HdyPreferencesRow), _ ("_Automatically select next message"));
	_tmp4_ = autoselect_row;
	hdy_action_row_set_use_underline (_tmp4_, TRUE);
	_tmp5_ = autoselect_row;
	_tmp6_ = autoselect;
	hdy_action_row_set_activatable_widget (_tmp5_, G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, gtk_widget_get_type (), GtkWidget));
	_tmp7_ = autoselect_row;
	_tmp8_ = autoselect;
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, gtk_widget_get_type (), GtkWidget));
	_tmp9_ = (GtkSwitch*) gtk_switch_new ();
	g_object_ref_sink (_tmp9_);
	display_preview = _tmp9_;
	_tmp10_ = display_preview;
	gtk_widget_set_valign (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_CENTER);
	_tmp11_ = (HdyActionRow*) hdy_action_row_new ();
	g_object_ref_sink (_tmp11_);
	display_preview_row = _tmp11_;
	_tmp12_ = display_preview_row;
	hdy_preferences_row_set_title (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, hdy_preferences_row_get_type (), HdyPreferencesRow), _ ("_Display conversation preview"));
	_tmp13_ = display_preview_row;
	hdy_action_row_set_use_underline (_tmp13_, TRUE);
	_tmp14_ = display_preview_row;
	_tmp15_ = display_preview;
	hdy_action_row_set_activatable_widget (_tmp14_, G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, gtk_widget_get_type (), GtkWidget));
	_tmp16_ = display_preview_row;
	_tmp17_ = display_preview;
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, gtk_widget_get_type (), GtkWidget));
	_tmp18_ = (GtkSwitch*) gtk_switch_new ();
	g_object_ref_sink (_tmp18_);
	single_key_shortucts = _tmp18_;
	_tmp19_ = single_key_shortucts;
	gtk_widget_set_valign (G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_CENTER);
	_tmp20_ = (HdyActionRow*) hdy_action_row_new ();
	g_object_ref_sink (_tmp20_);
	single_key_shortucts_row = _tmp20_;
	_tmp21_ = single_key_shortucts_row;
	hdy_preferences_row_set_title (G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, hdy_preferences_row_get_type (), HdyPreferencesRow), _ ("Use _single key email shortcuts"));
	_tmp22_ = single_key_shortucts_row;
	gtk_widget_set_tooltip_text (G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, gtk_widget_get_type (), GtkWidget), _ ("Enable keyboard shortcuts for email actions that do not require pressi" \
"ng <Ctrl>"));
	_tmp23_ = single_key_shortucts_row;
	hdy_action_row_set_use_underline (_tmp23_, TRUE);
	_tmp24_ = single_key_shortucts_row;
	_tmp25_ = single_key_shortucts;
	hdy_action_row_set_activatable_widget (_tmp24_, G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, gtk_widget_get_type (), GtkWidget));
	_tmp26_ = single_key_shortucts_row;
	_tmp27_ = single_key_shortucts;
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp26_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp27_, gtk_widget_get_type (), GtkWidget));
	_tmp28_ = (GtkSwitch*) gtk_switch_new ();
	g_object_ref_sink (_tmp28_);
	startup_notifications = _tmp28_;
	_tmp29_ = startup_notifications;
	gtk_widget_set_valign (G_TYPE_CHECK_INSTANCE_CAST (_tmp29_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_CENTER);
	_tmp30_ = (HdyActionRow*) hdy_action_row_new ();
	g_object_ref_sink (_tmp30_);
	startup_notifications_row = _tmp30_;
	_tmp31_ = startup_notifications_row;
	hdy_preferences_row_set_title (G_TYPE_CHECK_INSTANCE_CAST (_tmp31_, hdy_preferences_row_get_type (), HdyPreferencesRow), _ ("_Watch for new mail when closed"));
	_tmp32_ = startup_notifications_row;
	hdy_action_row_set_use_underline (_tmp32_, TRUE);
	_tmp33_ = startup_notifications_row;
	gtk_widget_set_tooltip_text (G_TYPE_CHECK_INSTANCE_CAST (_tmp33_, gtk_widget_get_type (), GtkWidget), _ ("Geary will keep running after all windows are closed"));
	_tmp34_ = startup_notifications_row;
	_tmp35_ = startup_notifications;
	hdy_action_row_set_activatable_widget (_tmp34_, G_TYPE_CHECK_INSTANCE_CAST (_tmp35_, gtk_widget_get_type (), GtkWidget));
	_tmp36_ = startup_notifications_row;
	_tmp37_ = startup_notifications;
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp36_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp37_, gtk_widget_get_type (), GtkWidget));
	_tmp38_ = (GtkSwitch*) gtk_switch_new ();
	g_object_ref_sink (_tmp38_);
	trust_images = _tmp38_;
	_tmp39_ = trust_images;
	gtk_widget_set_valign (G_TYPE_CHECK_INSTANCE_CAST (_tmp39_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_CENTER);
	_tmp40_ = (HdyActionRow*) hdy_action_row_new ();
	g_object_ref_sink (_tmp40_);
	trust_images_row = _tmp40_;
	_tmp41_ = trust_images_row;
	hdy_preferences_row_set_title (G_TYPE_CHECK_INSTANCE_CAST (_tmp41_, hdy_preferences_row_get_type (), HdyPreferencesRow), _ ("_Always load images"));
	_tmp42_ = trust_images_row;
	hdy_action_row_set_use_underline (_tmp42_, TRUE);
	_tmp43_ = trust_images_row;
	_tmp44_ = autoselect;
	hdy_action_row_set_activatable_widget (_tmp43_, G_TYPE_CHECK_INSTANCE_CAST (_tmp44_, gtk_widget_get_type (), GtkWidget));
	_tmp45_ = trust_images_row;
	_tmp46_ = trust_images;
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp45_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp46_, gtk_widget_get_type (), GtkWidget));
	_tmp47_ = (HdyPreferencesGroup*) hdy_preferences_group_new ();
	g_object_ref_sink (_tmp47_);
	group = _tmp47_;
	_tmp48_ = group;
	_tmp49_ = autoselect_row;
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp48_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp49_, gtk_widget_get_type (), GtkWidget));
	_tmp50_ = group;
	_tmp51_ = display_preview_row;
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp50_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp51_, gtk_widget_get_type (), GtkWidget));
	_tmp52_ = group;
	_tmp53_ = single_key_shortucts_row;
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp52_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp53_, gtk_widget_get_type (), GtkWidget));
	_tmp54_ = group;
	_tmp55_ = startup_notifications_row;
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp54_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp55_, gtk_widget_get_type (), GtkWidget));
	_tmp56_ = group;
	_tmp57_ = trust_images_row;
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp56_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp57_, gtk_widget_get_type (), GtkWidget));
	_tmp58_ = (HdyPreferencesPage*) hdy_preferences_page_new ();
	g_object_ref_sink (_tmp58_);
	page = _tmp58_;
	_tmp59_ = page;
	hdy_preferences_page_set_title (_tmp59_, _ ("Preferences"));
	_tmp60_ = page;
	hdy_preferences_page_set_icon_name (_tmp60_, "preferences-other-symbolic");
	_tmp61_ = page;
	_tmp62_ = group;
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp61_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp62_, gtk_widget_get_type (), GtkWidget));
	_tmp63_ = page;
	gtk_widget_show_all (G_TYPE_CHECK_INSTANCE_CAST (_tmp63_, gtk_widget_get_type (), GtkWidget));
	_tmp64_ = page;
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp64_, gtk_widget_get_type (), GtkWidget));
	_tmp65_ = g_simple_action_group_new ();
	window_actions = _tmp65_;
	_tmp66_ = window_actions;
	g_action_map_add_action_entries (G_TYPE_CHECK_INSTANCE_CAST (_tmp66_, g_action_map_get_type (), GActionMap), COMPONENTS_PREFERENCES_WINDOW_WINDOW_ACTIONS, (gint) G_N_ELEMENTS (COMPONENTS_PREFERENCES_WINDOW_WINDOW_ACTIONS), self);
	_tmp67_ = window_actions;
	gtk_widget_insert_action_group (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), ACTION_WINDOW_GROUP_NAME, G_TYPE_CHECK_INSTANCE_CAST (_tmp67_, g_action_group_get_type (), GActionGroup));
	_tmp68_ = components_preferences_window_get_application (self);
	_tmp69_ = _tmp68_;
	_tmp70_ = _g_object_ref0 (_tmp69_);
	application = _tmp70_;
	_tmp71_ = application;
	if (_tmp71_ != NULL) {
		ApplicationConfiguration* config = NULL;
		ApplicationClient* _tmp72_;
		ApplicationConfiguration* _tmp73_;
		ApplicationConfiguration* _tmp74_;
		ApplicationConfiguration* _tmp75_;
		ApplicationConfiguration* _tmp76_;
		GtkSwitch* _tmp77_;
		ApplicationConfiguration* _tmp78_;
		GtkSwitch* _tmp79_;
		ApplicationConfiguration* _tmp80_;
		GtkSwitch* _tmp81_;
		ApplicationConfiguration* _tmp82_;
		GtkSwitch* _tmp83_;
		ApplicationConfiguration* _tmp84_;
		GtkSwitch* _tmp85_;
		_tmp72_ = application;
		_tmp73_ = application_client_get_config (_tmp72_);
		_tmp74_ = _tmp73_;
		_tmp75_ = _g_object_ref0 (_tmp74_);
		config = _tmp75_;
		_tmp76_ = config;
		_tmp77_ = autoselect;
		application_configuration_bind (_tmp76_, APPLICATION_CONFIGURATION_AUTOSELECT_KEY, G_TYPE_CHECK_INSTANCE_CAST (_tmp77_, G_TYPE_OBJECT, GObject), "state", G_SETTINGS_BIND_DEFAULT);
		_tmp78_ = config;
		_tmp79_ = display_preview;
		application_configuration_bind (_tmp78_, APPLICATION_CONFIGURATION_DISPLAY_PREVIEW_KEY, G_TYPE_CHECK_INSTANCE_CAST (_tmp79_, G_TYPE_OBJECT, GObject), "state", G_SETTINGS_BIND_DEFAULT);
		_tmp80_ = config;
		_tmp81_ = single_key_shortucts;
		application_configuration_bind (_tmp80_, APPLICATION_CONFIGURATION_SINGLE_KEY_SHORTCUTS, G_TYPE_CHECK_INSTANCE_CAST (_tmp81_, G_TYPE_OBJECT, GObject), "state", G_SETTINGS_BIND_DEFAULT);
		_tmp82_ = config;
		_tmp83_ = startup_notifications;
		application_configuration_bind (_tmp82_, APPLICATION_CONFIGURATION_RUN_IN_BACKGROUND_KEY, G_TYPE_CHECK_INSTANCE_CAST (_tmp83_, G_TYPE_OBJECT, GObject), "state", G_SETTINGS_BIND_DEFAULT);
		_tmp84_ = config;
		_tmp85_ = trust_images;
		application_configuration_bind_with_mapping (_tmp84_, APPLICATION_CONFIGURATION_IMAGES_TRUSTED_DOMAINS, G_TYPE_CHECK_INSTANCE_CAST (_tmp85_, G_TYPE_OBJECT, GObject), "state", (GSettingsBindGetMapping) components_preferences_window_settings_trust_images_getter, (GSettingsBindSetMapping) components_preferences_window_settings_trust_images_setter, G_SETTINGS_BIND_DEFAULT);
		_g_object_unref0 (config);
	}
	_g_object_unref0 (application);
	_g_object_unref0 (window_actions);
	_g_object_unref0 (page);
	_g_object_unref0 (group);
	_g_object_unref0 (trust_images_row);
	_g_object_unref0 (trust_images);
	_g_object_unref0 (startup_notifications_row);
	_g_object_unref0 (startup_notifications);
	_g_object_unref0 (single_key_shortucts_row);
	_g_object_unref0 (single_key_shortucts);
	_g_object_unref0 (display_preview_row);
	_g_object_unref0 (display_preview);
	_g_object_unref0 (autoselect_row);
	_g_object_unref0 (autoselect);
}

static void
_vala_PeasPluginInfo_free (PeasPluginInfo* self)
{
	g_boxed_free (peas_plugin_info_get_type (), self);
}

static void
components_preferences_window_add_plugin_pane (ComponentsPreferencesWindow* self)
{
	HdyPreferencesGroup* group = NULL;
	HdyPreferencesGroup* _tmp0_;
	ApplicationClient* application = NULL;
	ApplicationClient* _tmp1_;
	ApplicationClient* _tmp2_;
	ApplicationClient* _tmp3_;
	ApplicationClient* _tmp4_;
	HdyPreferencesPage* page = NULL;
	HdyPreferencesPage* _tmp18_;
	HdyPreferencesGroup* _tmp19_;
	g_return_if_fail (COMPONENTS_IS_PREFERENCES_WINDOW (self));
	_tmp0_ = (HdyPreferencesGroup*) hdy_preferences_group_new ();
	g_object_ref_sink (_tmp0_);
	group = _tmp0_;
	_tmp1_ = components_preferences_window_get_application (self);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	application = _tmp3_;
	_tmp4_ = application;
	if (_tmp4_ != NULL) {
		{
			GeeIterator* _plugin_it = NULL;
			ApplicationPluginManager* _tmp5_;
			GeeCollection* _tmp6_;
			GeeCollection* _tmp7_;
			GeeIterator* _tmp8_;
			GeeIterator* _tmp9_;
			_tmp5_ = self->priv->plugins;
			_tmp6_ = application_plugin_manager_get_optional_plugins (_tmp5_);
			_tmp7_ = _tmp6_;
			_tmp8_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, GEE_TYPE_ITERABLE, GeeIterable));
			_tmp9_ = _tmp8_;
			_g_object_unref0 (_tmp7_);
			_plugin_it = _tmp9_;
			while (TRUE) {
				GeeIterator* _tmp10_;
				PeasPluginInfo* plugin = NULL;
				GeeIterator* _tmp11_;
				gpointer _tmp12_;
				HdyPreferencesGroup* _tmp13_;
				PeasPluginInfo* _tmp14_;
				ApplicationPluginManager* _tmp15_;
				ComponentsPreferencesWindowPluginRow* _tmp16_;
				ComponentsPreferencesWindowPluginRow* _tmp17_;
				_tmp10_ = _plugin_it;
				if (!gee_iterator_next (_tmp10_)) {
					break;
				}
				_tmp11_ = _plugin_it;
				_tmp12_ = gee_iterator_get (_tmp11_);
				plugin = (PeasPluginInfo*) _tmp12_;
				_tmp13_ = group;
				_tmp14_ = plugin;
				_tmp15_ = self->priv->plugins;
				_tmp16_ = components_preferences_window_plugin_row_new (_tmp14_, _tmp15_);
				g_object_ref_sink (_tmp16_);
				_tmp17_ = _tmp16_;
				gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, gtk_widget_get_type (), GtkWidget));
				_g_object_unref0 (_tmp17_);
				__vala_PeasPluginInfo_free0 (plugin);
			}
			_g_object_unref0 (_plugin_it);
		}
	}
	_tmp18_ = (HdyPreferencesPage*) hdy_preferences_page_new ();
	g_object_ref_sink (_tmp18_);
	page = _tmp18_;
	hdy_preferences_page_set_title (page, _ ("Plugins"));
	hdy_preferences_page_set_icon_name (page, "application-x-addon-symbolic");
	_tmp19_ = group;
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (page, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, gtk_widget_get_type (), GtkWidget));
	gtk_widget_show_all (G_TYPE_CHECK_INSTANCE_CAST (page, gtk_widget_get_type (), GtkWidget));
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (page, gtk_widget_get_type (), GtkWidget));
	_g_object_unref0 (page);
	_g_object_unref0 (application);
	_g_object_unref0 (group);
}

static void
components_preferences_window_on_close (ComponentsPreferencesWindow* self)
{
	g_return_if_fail (COMPONENTS_IS_PREFERENCES_WINDOW (self));
	gtk_window_close (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow));
}

static gboolean
components_preferences_window_settings_trust_images_getter (GValue* value,
                                                            GVariant* variant,
                                                            void* user_data)
{
	const gchar** domains = NULL;
	gsize _tmp0_ = 0;
	const gchar** _tmp1_;
	gint domains_length1;
	gint _domains_size_;
	gboolean _tmp2_ = FALSE;
	const gchar** _tmp3_;
	gint _tmp3__length1;
	gboolean result;
	g_return_val_if_fail (value != NULL, FALSE);
	g_return_val_if_fail (variant != NULL, FALSE);
	_tmp1_ = g_variant_get_strv (variant, &_tmp0_);
	domains = _tmp1_;
	domains_length1 = _tmp0_;
	_domains_size_ = domains_length1;
	_tmp3_ = domains;
	_tmp3__length1 = domains_length1;
	if (_tmp3__length1 > 0) {
		const gchar** _tmp4_;
		gint _tmp4__length1;
		const gchar* _tmp5_;
		_tmp4_ = domains;
		_tmp4__length1 = domains_length1;
		_tmp5_ = _tmp4_[0];
		_tmp2_ = g_strcmp0 (_tmp5_, "*") == 0;
	} else {
		_tmp2_ = FALSE;
	}
	g_value_set_boolean (value, _tmp2_);
	result = TRUE;
	domains = (g_free (domains), NULL);
	return result;
}

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

static GVariant*
components_preferences_window_settings_trust_images_setter (GValue* value,
                                                            const GVariantType* expected_type,
                                                            void* user_data)
{
	gboolean trusted = FALSE;
	gchar** values = NULL;
	gchar** _tmp0_;
	gint values_length1;
	gint _values_size_;
	gchar** _tmp2_;
	gint _tmp2__length1;
	GVariant* _tmp3_;
	GVariant* result;
	g_return_val_if_fail (value != NULL, NULL);
	g_return_val_if_fail (expected_type != NULL, NULL);
	trusted = g_value_get_boolean (value);
	_tmp0_ = g_new0 (gchar*, 0 + 1);
	values = _tmp0_;
	values_length1 = 0;
	_values_size_ = values_length1;
	if (trusted) {
		gchar* _tmp1_;
		_tmp1_ = g_strdup ("*");
		_vala_array_add14 (&values, &values_length1, &_values_size_, _tmp1_);
	}
	_tmp2_ = values;
	_tmp2__length1 = values_length1;
	_tmp3_ = g_variant_new_strv (_tmp2_, _tmp2__length1);
	g_variant_ref_sink (_tmp3_);
	result = _tmp3_;
	values = (_vala_array_free (values, values_length1, (GDestroyNotify) g_free), NULL);
	return result;
}

static inline gpointer
components_preferences_window_plugin_row_get_instance_private (ComponentsPreferencesWindowPluginRow* self)
{
	return G_STRUCT_MEMBER_P (self, ComponentsPreferencesWindowPluginRow_private_offset);
}

static PeasPluginInfo*
_vala_PeasPluginInfo_copy (PeasPluginInfo* self)
{
	return g_boxed_copy (peas_plugin_info_get_type (), self);
}

static gpointer
__vala_PeasPluginInfo_copy0 (gpointer self)
{
	return self ? _vala_PeasPluginInfo_copy (self) : NULL;
}

static void
__lambda178_ (ComponentsPreferencesWindowPluginRow* self)
{
	components_preferences_window_plugin_row_update_plugin (self);
}

static void
___lambda178__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda178_ ((ComponentsPreferencesWindowPluginRow*) self);
}

static void
__lambda179_ (ComponentsPreferencesWindowPluginRow* self,
              PeasPluginInfo* info)
{
	PeasPluginInfo* _tmp0_;
	g_return_if_fail (info != NULL);
	_tmp0_ = self->priv->plugin;
	if (_tmp0_ == info) {
		GtkSwitch* _tmp1_;
		_tmp1_ = self->priv->sw;
		gtk_switch_set_active (_tmp1_, TRUE);
	}
}

static void
___lambda179__application_plugin_manager_plugin_activated (ApplicationPluginManager* _sender,
                                                           PeasPluginInfo* info,
                                                           gpointer self)
{
	__lambda179_ ((ComponentsPreferencesWindowPluginRow*) self, info);
}

static void
__lambda180_ (ComponentsPreferencesWindowPluginRow* self,
              PeasPluginInfo* info)
{
	PeasPluginInfo* _tmp0_;
	g_return_if_fail (info != NULL);
	_tmp0_ = self->priv->plugin;
	if (_tmp0_ == info) {
		GtkSwitch* _tmp1_;
		_tmp1_ = self->priv->sw;
		gtk_switch_set_active (_tmp1_, FALSE);
	}
}

static void
___lambda180__application_plugin_manager_plugin_deactivated (ApplicationPluginManager* _sender,
                                                             PeasPluginInfo* info,
                                                             GError* _error_,
                                                             gpointer self)
{
	__lambda180_ ((ComponentsPreferencesWindowPluginRow*) self, info);
}

static void
__lambda181_ (ComponentsPreferencesWindowPluginRow* self,
              PeasPluginInfo* info)
{
	PeasPluginInfo* _tmp0_;
	g_return_if_fail (info != NULL);
	_tmp0_ = self->priv->plugin;
	if (_tmp0_ == info) {
		GtkSwitch* _tmp1_;
		GtkSwitch* _tmp2_;
		_tmp1_ = self->priv->sw;
		gtk_switch_set_active (_tmp1_, FALSE);
		_tmp2_ = self->priv->sw;
		gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_widget_get_type (), GtkWidget), FALSE);
	}
}

static void
___lambda181__application_plugin_manager_plugin_error (ApplicationPluginManager* _sender,
                                                       PeasPluginInfo* info,
                                                       GError* _error_,
                                                       gpointer self)
{
	__lambda181_ ((ComponentsPreferencesWindowPluginRow*) self, info);
}

static ComponentsPreferencesWindowPluginRow*
components_preferences_window_plugin_row_construct (GType object_type,
                                                    PeasPluginInfo* plugin,
                                                    ApplicationPluginManager* plugins)
{
	ComponentsPreferencesWindowPluginRow * self = NULL;
	PeasPluginInfo* _tmp0_;
	ApplicationPluginManager* _tmp1_;
	GtkSwitch* _tmp2_;
	GtkSwitch* _tmp3_;
	GtkSwitch* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	GtkSwitch* _tmp7_;
	GtkSwitch* _tmp8_;
	g_return_val_if_fail (plugin != NULL, NULL);
	g_return_val_if_fail (APPLICATION_IS_PLUGIN_MANAGER (plugins), NULL);
	self = (ComponentsPreferencesWindowPluginRow*) g_object_new (object_type, NULL);
	_tmp0_ = __vala_PeasPluginInfo_copy0 (plugin);
	__vala_PeasPluginInfo_free0 (self->priv->plugin);
	self->priv->plugin = _tmp0_;
	_tmp1_ = _g_object_ref0 (plugins);
	_g_object_unref0 (self->priv->plugins);
	self->priv->plugins = _tmp1_;
	_tmp2_ = self->priv->sw;
	gtk_switch_set_active (_tmp2_, peas_plugin_info_is_loaded (plugin));
	_tmp3_ = self->priv->sw;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, G_TYPE_OBJECT, GObject), "notify::active", (GCallback) ___lambda178__g_object_notify, self, G_CONNECT_AFTER);
	_tmp4_ = self->priv->sw;
	gtk_widget_set_valign (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_CENTER);
	_tmp5_ = peas_plugin_info_get_name (plugin);
	hdy_preferences_row_set_title (G_TYPE_CHECK_INSTANCE_CAST (self, hdy_preferences_row_get_type (), HdyPreferencesRow), _tmp5_);
	_tmp6_ = peas_plugin_info_get_description (plugin);
	hdy_action_row_set_subtitle (G_TYPE_CHECK_INSTANCE_CAST (self, hdy_action_row_get_type (), HdyActionRow), _tmp6_);
	_tmp7_ = self->priv->sw;
	hdy_action_row_set_activatable_widget (G_TYPE_CHECK_INSTANCE_CAST (self, hdy_action_row_get_type (), HdyActionRow), G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, gtk_widget_get_type (), GtkWidget));
	_tmp8_ = self->priv->sw;
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, gtk_widget_get_type (), GtkWidget));
	g_signal_connect_object (plugins, "plugin-activated", (GCallback) ___lambda179__application_plugin_manager_plugin_activated, self, 0);
	g_signal_connect_object (plugins, "plugin-deactivated", (GCallback) ___lambda180__application_plugin_manager_plugin_deactivated, self, 0);
	g_signal_connect_object (plugins, "plugin-error", (GCallback) ___lambda181__application_plugin_manager_plugin_error, self, 0);
	return self;
}

static ComponentsPreferencesWindowPluginRow*
components_preferences_window_plugin_row_new (PeasPluginInfo* plugin,
                                              ApplicationPluginManager* plugins)
{
	return components_preferences_window_plugin_row_construct (COMPONENTS_PREFERENCES_WINDOW_TYPE_PLUGIN_ROW, plugin, plugins);
}

static void
components_preferences_window_plugin_row_update_plugin (ComponentsPreferencesWindowPluginRow* self)
{
	gboolean _tmp0_ = FALSE;
	GtkSwitch* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (COMPONENTS_PREFERENCES_WINDOW_IS_PLUGIN_ROW (self));
	_tmp1_ = self->priv->sw;
	_tmp2_ = gtk_switch_get_active (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_) {
		PeasPluginInfo* _tmp4_;
		_tmp4_ = self->priv->plugin;
		_tmp0_ = !peas_plugin_info_is_loaded (_tmp4_);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		gboolean loaded = FALSE;
		loaded = FALSE;
		{
			gboolean _tmp5_ = FALSE;
			ApplicationPluginManager* _tmp6_;
			PeasPluginInfo* _tmp7_;
			_tmp6_ = self->priv->plugins;
			_tmp7_ = self->priv->plugin;
			_tmp5_ = application_plugin_manager_load_optional (_tmp6_, _tmp7_, &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			loaded = _tmp5_;
		}
		goto __finally0;
		__catch0_g_error:
		{
			GError* err = NULL;
			PeasPluginInfo* _tmp8_;
			const gchar* _tmp9_;
			GError* _tmp10_;
			const gchar* _tmp11_;
			err = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp8_ = self->priv->plugin;
			_tmp9_ = peas_plugin_info_get_name (_tmp8_);
			_tmp10_ = err;
			_tmp11_ = _tmp10_->message;
			g_warning ("components-preferences-window.vala:64: Plugin %s not able to be loaded" \
": %s", _tmp9_, _tmp11_);
			_g_error_free0 (err);
		}
		__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;
		}
		if (!loaded) {
			GtkSwitch* _tmp12_;
			_tmp12_ = self->priv->sw;
			gtk_switch_set_active (_tmp12_, FALSE);
		}
	} else {
		gboolean _tmp13_ = FALSE;
		GtkSwitch* _tmp14_;
		gboolean _tmp15_;
		gboolean _tmp16_;
		_tmp14_ = self->priv->sw;
		_tmp15_ = gtk_switch_get_active (_tmp14_);
		_tmp16_ = _tmp15_;
		if (!_tmp16_) {
			PeasPluginInfo* _tmp17_;
			_tmp17_ = self->priv->plugin;
			_tmp13_ = peas_plugin_info_is_loaded (_tmp17_);
		} else {
			_tmp13_ = FALSE;
		}
		if (_tmp13_) {
			gboolean unloaded = FALSE;
			unloaded = FALSE;
			{
				gboolean _tmp18_ = FALSE;
				ApplicationPluginManager* _tmp19_;
				PeasPluginInfo* _tmp20_;
				_tmp19_ = self->priv->plugins;
				_tmp20_ = self->priv->plugin;
				_tmp18_ = application_plugin_manager_unload_optional (_tmp19_, _tmp20_, &_inner_error0_);
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					goto __catch1_g_error;
				}
				unloaded = _tmp18_;
			}
			goto __finally1;
			__catch1_g_error:
			{
				GError* err = NULL;
				PeasPluginInfo* _tmp21_;
				const gchar* _tmp22_;
				GError* _tmp23_;
				const gchar* _tmp24_;
				err = _inner_error0_;
				_inner_error0_ = NULL;
				_tmp21_ = self->priv->plugin;
				_tmp22_ = peas_plugin_info_get_name (_tmp21_);
				_tmp23_ = err;
				_tmp24_ = _tmp23_->message;
				g_warning ("components-preferences-window.vala:77: Plugin %s not able to be loaded" \
": %s", _tmp22_, _tmp24_);
				_g_error_free0 (err);
			}
			__finally1:
			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;
			}
			if (!unloaded) {
				GtkSwitch* _tmp25_;
				_tmp25_ = self->priv->sw;
				gtk_switch_set_active (_tmp25_, TRUE);
			}
		}
	}
}

static void
components_preferences_window_plugin_row_class_init (ComponentsPreferencesWindowPluginRowClass * klass,
                                                     gpointer klass_data)
{
	components_preferences_window_plugin_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ComponentsPreferencesWindowPluginRow_private_offset);
	G_OBJECT_CLASS (klass)->finalize = components_preferences_window_plugin_row_finalize;
}

static void
components_preferences_window_plugin_row_instance_init (ComponentsPreferencesWindowPluginRow * self,
                                                        gpointer klass)
{
	GtkSwitch* _tmp0_;
	self->priv = components_preferences_window_plugin_row_get_instance_private (self);
	_tmp0_ = (GtkSwitch*) gtk_switch_new ();
	g_object_ref_sink (_tmp0_);
	self->priv->sw = _tmp0_;
}

static void
components_preferences_window_plugin_row_finalize (GObject * obj)
{
	ComponentsPreferencesWindowPluginRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, COMPONENTS_PREFERENCES_WINDOW_TYPE_PLUGIN_ROW, ComponentsPreferencesWindowPluginRow);
	__vala_PeasPluginInfo_free0 (self->priv->plugin);
	_g_object_unref0 (self->priv->plugins);
	_g_object_unref0 (self->priv->sw);
	G_OBJECT_CLASS (components_preferences_window_plugin_row_parent_class)->finalize (obj);
}

static GType
components_preferences_window_plugin_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ComponentsPreferencesWindowPluginRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) components_preferences_window_plugin_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ComponentsPreferencesWindowPluginRow), 0, (GInstanceInitFunc) components_preferences_window_plugin_row_instance_init, NULL };
	GType components_preferences_window_plugin_row_type_id;
	components_preferences_window_plugin_row_type_id = g_type_register_static (hdy_action_row_get_type (), "ComponentsPreferencesWindowPluginRow", &g_define_type_info, 0);
	ComponentsPreferencesWindowPluginRow_private_offset = g_type_add_instance_private (components_preferences_window_plugin_row_type_id, sizeof (ComponentsPreferencesWindowPluginRowPrivate));
	return components_preferences_window_plugin_row_type_id;
}

static GType
components_preferences_window_plugin_row_get_type (void)
{
	static volatile gsize components_preferences_window_plugin_row_type_id__once = 0;
	if (g_once_init_enter (&components_preferences_window_plugin_row_type_id__once)) {
		GType components_preferences_window_plugin_row_type_id;
		components_preferences_window_plugin_row_type_id = components_preferences_window_plugin_row_get_type_once ();
		g_once_init_leave (&components_preferences_window_plugin_row_type_id__once, components_preferences_window_plugin_row_type_id);
	}
	return components_preferences_window_plugin_row_type_id__once;
}

static void
components_preferences_window_class_init (ComponentsPreferencesWindowClass * klass,
                                          gpointer klass_data)
{
	components_preferences_window_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ComponentsPreferencesWindow_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_components_preferences_window_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_components_preferences_window_set_property;
	G_OBJECT_CLASS (klass)->finalize = components_preferences_window_finalize;
	/** Returns the window's associated client application instance. */
	g_object_class_install_property (G_OBJECT_CLASS (klass), COMPONENTS_PREFERENCES_WINDOW_APPLICATION_PROPERTY, components_preferences_window_properties[COMPONENTS_PREFERENCES_WINDOW_APPLICATION_PROPERTY] = g_param_spec_object ("application", "application", "application", APPLICATION_TYPE_CLIENT, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
components_preferences_window_instance_init (ComponentsPreferencesWindow * self,
                                             gpointer klass)
{
	self->priv = components_preferences_window_get_instance_private (self);
}

static void
components_preferences_window_finalize (GObject * obj)
{
	ComponentsPreferencesWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, COMPONENTS_TYPE_PREFERENCES_WINDOW, ComponentsPreferencesWindow);
	_g_object_unref0 (self->priv->plugins);
	G_OBJECT_CLASS (components_preferences_window_parent_class)->finalize (obj);
}

static GType
components_preferences_window_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ComponentsPreferencesWindowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) components_preferences_window_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ComponentsPreferencesWindow), 0, (GInstanceInitFunc) components_preferences_window_instance_init, NULL };
	GType components_preferences_window_type_id;
	components_preferences_window_type_id = g_type_register_static (hdy_preferences_window_get_type (), "ComponentsPreferencesWindow", &g_define_type_info, 0);
	ComponentsPreferencesWindow_private_offset = g_type_add_instance_private (components_preferences_window_type_id, sizeof (ComponentsPreferencesWindowPrivate));
	return components_preferences_window_type_id;
}

GType
components_preferences_window_get_type (void)
{
	static volatile gsize components_preferences_window_type_id__once = 0;
	if (g_once_init_enter (&components_preferences_window_type_id__once)) {
		GType components_preferences_window_type_id;
		components_preferences_window_type_id = components_preferences_window_get_type_once ();
		g_once_init_leave (&components_preferences_window_type_id__once, components_preferences_window_type_id);
	}
	return components_preferences_window_type_id__once;
}

static void
_vala_components_preferences_window_get_property (GObject * object,
                                                  guint property_id,
                                                  GValue * value,
                                                  GParamSpec * pspec)
{
	ComponentsPreferencesWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, COMPONENTS_TYPE_PREFERENCES_WINDOW, ComponentsPreferencesWindow);
	switch (property_id) {
		case COMPONENTS_PREFERENCES_WINDOW_APPLICATION_PROPERTY:
		g_value_set_object (value, components_preferences_window_get_application (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_components_preferences_window_set_property (GObject * object,
                                                  guint property_id,
                                                  const GValue * value,
                                                  GParamSpec * pspec)
{
	ComponentsPreferencesWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, COMPONENTS_TYPE_PREFERENCES_WINDOW, ComponentsPreferencesWindow);
	switch (property_id) {
		case COMPONENTS_PREFERENCES_WINDOW_APPLICATION_PROPERTY:
		components_preferences_window_set_application (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

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

