/* preferences_dialog.c generated by valac 0.26.0.93-693b8, the Vala compiler
 * generated from preferences_dialog.vala, do not modify */

/*
 * This file is part of LaTeXila.
 *
 * Copyright © 2010-2012 Sébastien Wilmet
 *
 * LaTeXila is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * LaTeXila 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 LaTeXila.  If not, see <http://www.gnu.org/licenses/>.
 */

#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <glib/gi18n-lib.h>
#include <stdlib.h>
#include <string.h>
#include "config.h"
#include <gio/gio.h>
#include <float.h>
#include <math.h>
#include <gtksourceview/gtksource.h>


#define TYPE_PREFERENCES_DIALOG (preferences_dialog_get_type ())
#define PREFERENCES_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PREFERENCES_DIALOG, PreferencesDialog))
#define PREFERENCES_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PREFERENCES_DIALOG, PreferencesDialogClass))
#define IS_PREFERENCES_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PREFERENCES_DIALOG))
#define IS_PREFERENCES_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PREFERENCES_DIALOG))
#define PREFERENCES_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PREFERENCES_DIALOG, PreferencesDialogClass))

typedef struct _PreferencesDialog PreferencesDialog;
typedef struct _PreferencesDialogClass PreferencesDialogClass;
typedef struct _PreferencesDialogPrivate PreferencesDialogPrivate;

#define PREFERENCES_DIALOG_TYPE_STYLE_SCHEMES (preferences_dialog_style_schemes_get_type ())
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

#define TYPE_MAIN_WINDOW (main_window_get_type ())
#define MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MAIN_WINDOW, MainWindow))
#define MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MAIN_WINDOW, MainWindowClass))
#define IS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MAIN_WINDOW))
#define IS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MAIN_WINDOW))
#define MAIN_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MAIN_WINDOW, MainWindowClass))

typedef struct _MainWindow MainWindow;
typedef struct _MainWindowClass MainWindowClass;
typedef struct _Block23Data Block23Data;

#define TYPE_APP_SETTINGS (app_settings_get_type ())
#define APP_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_APP_SETTINGS, AppSettings))
#define APP_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_APP_SETTINGS, AppSettingsClass))
#define IS_APP_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_APP_SETTINGS))
#define IS_APP_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_APP_SETTINGS))
#define APP_SETTINGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_APP_SETTINGS, AppSettingsClass))

typedef struct _AppSettings AppSettings;
typedef struct _AppSettingsClass AppSettingsClass;
#define __g_list_free__gtk_tree_path_free0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__gtk_tree_path_free0_ (var), NULL)))
#define _gtk_tree_path_free0(var) ((var == NULL) ? NULL : (var = (gtk_tree_path_free (var), NULL)))
typedef struct _Block24Data Block24Data;
typedef struct _Block25Data Block25Data;
#define _g_settings_schema_key_unref0(var) ((var == NULL) ? NULL : (var = (g_settings_schema_key_unref (var), NULL)))
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
#define _g_settings_schema_unref0(var) ((var == NULL) ? NULL : (var = (g_settings_schema_unref (var), NULL)))

struct _PreferencesDialog {
	GtkDialog parent_instance;
	PreferencesDialogPrivate * priv;
};

struct _PreferencesDialogClass {
	GtkDialogClass parent_class;
};

typedef enum  {
	PREFERENCES_DIALOG_STYLE_SCHEMES_ID,
	PREFERENCES_DIALOG_STYLE_SCHEMES_DESC,
	PREFERENCES_DIALOG_STYLE_SCHEMES_N_COLUMNS
} PreferencesDialogStyleSchemes;

typedef const gchar* (*PreferencesDialogPlural) (gulong n, void* user_data);
struct _Block23Data {
	int _ref_count_;
	PreferencesDialog* self;
	GSettings* settings;
	GtkButton* default_font_checkbutton;
	GtkTreeView* schemes_treeview;
	GtkTreeSelection* schemes_select;
};

struct _Block24Data {
	int _ref_count_;
	PreferencesDialog* self;
	GtkWidget* widget;
	gboolean must_be_enabled;
};

struct _Block25Data {
	int _ref_count_;
	PreferencesDialog* self;
	GtkLabel* label;
	PreferencesDialogPlural plural;
	gpointer plural_target;
};


static gpointer preferences_dialog_parent_class = NULL;
static PreferencesDialog* preferences_dialog__instance;
static PreferencesDialog* preferences_dialog__instance = NULL;

GType preferences_dialog_get_type (void) G_GNUC_CONST;
enum  {
	PREFERENCES_DIALOG_DUMMY_PROPERTY
};
static GType preferences_dialog_style_schemes_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
static PreferencesDialog* preferences_dialog_new (void);
static PreferencesDialog* preferences_dialog_construct (GType object_type);
static void __lambda21_ (PreferencesDialog* self, gint response_id);
static void preferences_dialog_reset_all (PreferencesDialog* self);
static void ___lambda21__gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self);
static void preferences_dialog_init_editor_tab (PreferencesDialog* self, GtkBuilder* builder);
static void preferences_dialog_init_font_and_colors_tab (PreferencesDialog* self, GtkBuilder* builder);
static void preferences_dialog_init_interactive_completion_setting (PreferencesDialog* self, GtkBuilder* builder);
static void preferences_dialog_init_other_tab (PreferencesDialog* self, GtkBuilder* builder);
GType main_window_get_type (void) G_GNUC_CONST;
void preferences_dialog_show_me (MainWindow* parent);
static void ___lambda29_ (void);
static void ____lambda29__gtk_widget_destroy (GtkWidget* _sender, gpointer self);
static void preferences_dialog_set_spin_button_range (PreferencesDialog* self, GtkSpinButton* spin_button, GSettings* settings, const gchar* key);
static void preferences_dialog_set_sensitivity (PreferencesDialog* self, GSettings* settings, const gchar* key, GtkWidget* widget, gboolean must_be_enabled);
static void preferences_dialog_set_plural (PreferencesDialog* self, GtkLabel* label, GSettings* settings, const gchar* key, PreferencesDialogPlural plural, void* plural_target);
static const gchar* __lambda24_ (PreferencesDialog* self, gulong n);
static const gchar* ___lambda24__preferences_dialog_plural (gulong n, gpointer self);
static Block23Data* block23_data_ref (Block23Data* _data23_);
static void block23_data_unref (void * _userdata_);
static void preferences_dialog_set_system_font_label (PreferencesDialog* self, GtkButton* button);
GType app_settings_get_type (void) G_GNUC_CONST;
AppSettings* app_settings_get_default (void);
static void __lambda25_ (Block23Data* _data23_);
static void ___lambda25__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void preferences_dialog_init_schemes_treeview (PreferencesDialog* self, GtkTreeView* treeview, const gchar* current_id);
static void __lambda26_ (Block23Data* _data23_);
static void _gtk_tree_path_free0_ (gpointer var);
static void _g_list_free__gtk_tree_path_free0_ (GList* self);
static void ___lambda26__gtk_tree_selection_changed (GtkTreeSelection* _sender, gpointer self);
static void __lambda27_ (Block23Data* _data23_, GSettings* setting, const gchar* key);
static void ___lambda27__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self);
static const gchar* __lambda28_ (PreferencesDialog* self, gulong n);
static const gchar* ___lambda28__preferences_dialog_plural (gulong n, gpointer self);
static Block24Data* block24_data_ref (Block24Data* _data24_);
static void block24_data_unref (void * _userdata_);
static void __lambda22_ (Block24Data* _data24_, GSettings* setting, const gchar* k);
static void ___lambda22__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self);
const gchar* app_settings_get_system_font (AppSettings* self);
static Block25Data* block25_data_ref (Block25Data* _data25_);
static void block25_data_unref (void * _userdata_);
static void __lambda23_ (Block25Data* _data25_, GSettings* setting, const gchar* k);
static void ___lambda23__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self);
static void preferences_dialog_finalize (GObject* obj);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
static gint _vala_array_length (gpointer array);


static GType preferences_dialog_style_schemes_get_type (void) {
	static volatile gsize preferences_dialog_style_schemes_type_id__volatile = 0;
	if (g_once_init_enter (&preferences_dialog_style_schemes_type_id__volatile)) {
		static const GEnumValue values[] = {{PREFERENCES_DIALOG_STYLE_SCHEMES_ID, "PREFERENCES_DIALOG_STYLE_SCHEMES_ID", "id"}, {PREFERENCES_DIALOG_STYLE_SCHEMES_DESC, "PREFERENCES_DIALOG_STYLE_SCHEMES_DESC", "desc"}, {PREFERENCES_DIALOG_STYLE_SCHEMES_N_COLUMNS, "PREFERENCES_DIALOG_STYLE_SCHEMES_N_COLUMNS", "n-columns"}, {0, NULL, NULL}};
		GType preferences_dialog_style_schemes_type_id;
		preferences_dialog_style_schemes_type_id = g_enum_register_static ("PreferencesDialogStyleSchemes", values);
		g_once_init_leave (&preferences_dialog_style_schemes_type_id__volatile, preferences_dialog_style_schemes_type_id);
	}
	return preferences_dialog_style_schemes_type_id__volatile;
}


static void __lambda21_ (PreferencesDialog* self, gint response_id) {
	gint _tmp0_ = 0;
	_tmp0_ = response_id;
	switch (_tmp0_) {
		case GTK_RESPONSE_CLOSE:
		{
			gtk_widget_hide ((GtkWidget*) self);
			return;
		}
		case GTK_RESPONSE_APPLY:
		{
			preferences_dialog_reset_all (self);
			return;
		}
		default:
		break;
	}
}


static void ___lambda21__gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self) {
	__lambda21_ ((PreferencesDialog*) self, response_id);
}


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


static PreferencesDialog* preferences_dialog_construct (GType object_type) {
	PreferencesDialog * self = NULL;
	const gchar* _tmp0_ = NULL;
	GtkButton* reset_button = NULL;
	const gchar* _tmp1_ = NULL;
	GtkButton* _tmp2_ = NULL;
	GtkButton* _tmp3_ = NULL;
	const gchar* _tmp4_ = NULL;
	GtkButton* _tmp5_ = NULL;
	GtkButton* _tmp6_ = NULL;
	const gchar* _tmp7_ = NULL;
	GtkBuilder* builder = NULL;
	GtkBuilder* _tmp8_ = NULL;
	GtkBuilder* _tmp24_ = NULL;
	GtkBuilder* _tmp25_ = NULL;
	GtkBuilder* _tmp26_ = NULL;
	GtkBuilder* _tmp27_ = NULL;
	GtkNotebook* notebook = NULL;
	GtkBuilder* _tmp28_ = NULL;
	GObject* _tmp29_ = NULL;
	GtkNotebook* _tmp30_ = NULL;
	GtkNotebook* _tmp31_ = NULL;
	GtkBox* content_area = NULL;
	GtkBox* _tmp32_ = NULL;
	GtkBox* _tmp33_ = NULL;
	GtkBox* _tmp34_ = NULL;
	GtkNotebook* _tmp35_ = NULL;
	GError * _inner_error_ = NULL;
	self = (PreferencesDialog*) g_object_new (object_type, NULL);
	_tmp0_ = _ ("Preferences");
	gtk_window_set_title ((GtkWindow*) self, _tmp0_);
	gtk_window_set_destroy_with_parent ((GtkWindow*) self, TRUE);
	gtk_container_set_border_width ((GtkContainer*) self, (guint) 5);
	_tmp1_ = _ ("_Reset All");
	_tmp2_ = (GtkButton*) gtk_button_new_with_mnemonic (_tmp1_);
	g_object_ref_sink (_tmp2_);
	reset_button = _tmp2_;
	_tmp3_ = reset_button;
	_tmp4_ = _ ("Reset all preferences");
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp3_, _tmp4_);
	_tmp5_ = reset_button;
	gtk_widget_show_all ((GtkWidget*) _tmp5_);
	_tmp6_ = reset_button;
	gtk_dialog_add_action_widget ((GtkDialog*) self, (GtkWidget*) _tmp6_, (gint) GTK_RESPONSE_APPLY);
	_tmp7_ = _ ("_Close");
	gtk_dialog_add_button ((GtkDialog*) self, _tmp7_, (gint) GTK_RESPONSE_CLOSE);
	g_signal_connect_object ((GtkDialog*) self, "response", (GCallback) ___lambda21__gtk_dialog_response, self, 0);
	_tmp8_ = gtk_builder_new ();
	builder = _tmp8_;
	{
		gchar* ui_path = NULL;
		gchar* _tmp9_ = NULL;
		GtkBuilder* _tmp10_ = NULL;
		const gchar* _tmp11_ = NULL;
		_tmp9_ = g_build_filename (DATA_DIR, "ui", "preferences_dialog.ui", NULL);
		ui_path = _tmp9_;
		_tmp10_ = builder;
		_tmp11_ = ui_path;
		gtk_builder_add_from_file (_tmp10_, _tmp11_, &_inner_error_);
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			_g_free0 (ui_path);
			goto __catch34_g_error;
		}
		_g_free0 (ui_path);
	}
	goto __finally34;
	__catch34_g_error:
	{
		GError* e = NULL;
		gchar* message = NULL;
		GError* _tmp12_ = NULL;
		const gchar* _tmp13_ = NULL;
		gchar* _tmp14_ = NULL;
		const gchar* _tmp15_ = NULL;
		GtkLabel* label_error = NULL;
		const gchar* _tmp16_ = NULL;
		GtkLabel* _tmp17_ = NULL;
		GtkLabel* _tmp18_ = NULL;
		GtkBox* content_area = NULL;
		GtkBox* _tmp19_ = NULL;
		GtkBox* _tmp20_ = NULL;
		GtkBox* _tmp21_ = NULL;
		GtkLabel* _tmp22_ = NULL;
		GtkBox* _tmp23_ = NULL;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp12_ = e;
		_tmp13_ = _tmp12_->message;
		_tmp14_ = g_strdup_printf ("Error: %s", _tmp13_);
		message = _tmp14_;
		_tmp15_ = message;
		g_warning ("preferences_dialog.vala:70: %s", _tmp15_);
		_tmp16_ = message;
		_tmp17_ = (GtkLabel*) gtk_label_new (_tmp16_);
		g_object_ref_sink (_tmp17_);
		label_error = _tmp17_;
		_tmp18_ = label_error;
		gtk_label_set_line_wrap (_tmp18_, TRUE);
		_tmp19_ = (GtkBox*) gtk_dialog_get_content_area ((GtkDialog*) self);
		_tmp20_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, gtk_box_get_type (), GtkBox));
		content_area = _tmp20_;
		_tmp21_ = content_area;
		_tmp22_ = label_error;
		gtk_box_pack_start (_tmp21_, (GtkWidget*) _tmp22_, TRUE, TRUE, (guint) 0);
		_tmp23_ = content_area;
		gtk_widget_show_all ((GtkWidget*) _tmp23_);
		_g_object_unref0 (content_area);
		_g_object_unref0 (label_error);
		_g_free0 (message);
		_g_error_free0 (e);
		_g_object_unref0 (builder);
		_g_object_unref0 (reset_button);
		return self;
	}
	__finally34:
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		_g_object_unref0 (builder);
		_g_object_unref0 (reset_button);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return NULL;
	}
	_tmp24_ = builder;
	preferences_dialog_init_editor_tab (self, _tmp24_);
	_tmp25_ = builder;
	preferences_dialog_init_font_and_colors_tab (self, _tmp25_);
	_tmp26_ = builder;
	preferences_dialog_init_interactive_completion_setting (self, _tmp26_);
	_tmp27_ = builder;
	preferences_dialog_init_other_tab (self, _tmp27_);
	_tmp28_ = builder;
	_tmp29_ = gtk_builder_get_object (_tmp28_, "notebook");
	_tmp30_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp29_, gtk_notebook_get_type ()) ? ((GtkNotebook*) _tmp29_) : NULL);
	notebook = _tmp30_;
	_tmp31_ = notebook;
	gtk_widget_unparent ((GtkWidget*) _tmp31_);
	_tmp32_ = (GtkBox*) gtk_dialog_get_content_area ((GtkDialog*) self);
	_tmp33_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp32_, gtk_box_get_type (), GtkBox));
	content_area = _tmp33_;
	_tmp34_ = content_area;
	_tmp35_ = notebook;
	gtk_box_pack_start (_tmp34_, (GtkWidget*) _tmp35_, TRUE, TRUE, (guint) 0);
	_g_object_unref0 (content_area);
	_g_object_unref0 (notebook);
	_g_object_unref0 (builder);
	_g_object_unref0 (reset_button);
	return self;
}


static PreferencesDialog* preferences_dialog_new (void) {
	return preferences_dialog_construct (TYPE_PREFERENCES_DIALOG);
}


static void ___lambda29_ (void) {
	PreferencesDialog* _tmp0_ = NULL;
	_tmp0_ = preferences_dialog__instance;
	if (_tmp0_ != NULL) {
		_g_object_unref0 (preferences_dialog__instance);
		preferences_dialog__instance = NULL;
	}
}


static void ____lambda29__gtk_widget_destroy (GtkWidget* _sender, gpointer self) {
	___lambda29_ ();
}


void preferences_dialog_show_me (MainWindow* parent) {
	PreferencesDialog* _tmp0_ = NULL;
	MainWindow* _tmp3_ = NULL;
	PreferencesDialog* _tmp4_ = NULL;
	GtkWindow* _tmp5_ = NULL;
	PreferencesDialog* _tmp8_ = NULL;
	g_return_if_fail (parent != NULL);
	_tmp0_ = preferences_dialog__instance;
	if (_tmp0_ == NULL) {
		PreferencesDialog* _tmp1_ = NULL;
		PreferencesDialog* _tmp2_ = NULL;
		_tmp1_ = preferences_dialog_new ();
		g_object_ref_sink (_tmp1_);
		_g_object_unref0 (preferences_dialog__instance);
		preferences_dialog__instance = _tmp1_;
		_tmp2_ = preferences_dialog__instance;
		g_signal_connect ((GtkWidget*) _tmp2_, "destroy", (GCallback) ____lambda29__gtk_widget_destroy, NULL);
	}
	_tmp3_ = parent;
	_tmp4_ = preferences_dialog__instance;
	_tmp5_ = gtk_window_get_transient_for ((GtkWindow*) _tmp4_);
	if (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_window_get_type (), GtkWindow) != _tmp5_) {
		PreferencesDialog* _tmp6_ = NULL;
		MainWindow* _tmp7_ = NULL;
		_tmp6_ = preferences_dialog__instance;
		_tmp7_ = parent;
		gtk_window_set_transient_for ((GtkWindow*) _tmp6_, (GtkWindow*) _tmp7_);
	}
	_tmp8_ = preferences_dialog__instance;
	gtk_window_present ((GtkWindow*) _tmp8_);
}


static void preferences_dialog_reset_all (PreferencesDialog* self) {
	GtkDialog* dialog = NULL;
	const gchar* _tmp0_ = NULL;
	GtkMessageDialog* _tmp1_ = NULL;
	GtkDialog* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	GtkDialog* _tmp4_ = NULL;
	const gchar* _tmp5_ = NULL;
	gint resp = 0;
	GtkDialog* _tmp6_ = NULL;
	gint _tmp7_ = 0;
	GtkDialog* _tmp8_ = NULL;
	gint _tmp9_ = 0;
	gchar** settings_str = NULL;
	gchar* _tmp10_ = NULL;
	gchar* _tmp11_ = NULL;
	gchar** _tmp12_ = NULL;
	gint settings_str_length1 = 0;
	gint _settings_str_size_ = 0;
	gchar** _tmp13_ = NULL;
	gint _tmp13__length1 = 0;
	g_return_if_fail (self != NULL);
	_tmp0_ = _ ("Do you really want to reset all preferences?");
	_tmp1_ = (GtkMessageDialog*) gtk_message_dialog_new ((GtkWindow*) self, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, "%s", _tmp0_);
	g_object_ref_sink (_tmp1_);
	dialog = (GtkDialog*) _tmp1_;
	_tmp2_ = dialog;
	_tmp3_ = _ ("_Cancel");
	gtk_dialog_add_button (_tmp2_, _tmp3_, (gint) GTK_RESPONSE_CANCEL);
	_tmp4_ = dialog;
	_tmp5_ = _ ("_Reset All");
	gtk_dialog_add_button (_tmp4_, _tmp5_, (gint) GTK_RESPONSE_YES);
	_tmp6_ = dialog;
	_tmp7_ = gtk_dialog_run (_tmp6_);
	resp = _tmp7_;
	_tmp8_ = dialog;
	gtk_widget_destroy ((GtkWidget*) _tmp8_);
	_tmp9_ = resp;
	if (_tmp9_ != ((gint) GTK_RESPONSE_YES)) {
		_g_object_unref0 (dialog);
		return;
	}
	_tmp10_ = g_strdup ("org.gnome.latexila.preferences.editor");
	_tmp11_ = g_strdup ("org.gnome.latexila.preferences.latex");
	_tmp12_ = g_new0 (gchar*, 2 + 1);
	_tmp12_[0] = _tmp10_;
	_tmp12_[1] = _tmp11_;
	settings_str = _tmp12_;
	settings_str_length1 = 2;
	_settings_str_size_ = settings_str_length1;
	_tmp13_ = settings_str;
	_tmp13__length1 = settings_str_length1;
	{
		gchar** setting_str_collection = NULL;
		gint setting_str_collection_length1 = 0;
		gint _setting_str_collection_size_ = 0;
		gint setting_str_it = 0;
		setting_str_collection = _tmp13_;
		setting_str_collection_length1 = _tmp13__length1;
		for (setting_str_it = 0; setting_str_it < _tmp13__length1; setting_str_it = setting_str_it + 1) {
			gchar* _tmp14_ = NULL;
			gchar* setting_str = NULL;
			_tmp14_ = g_strdup (setting_str_collection[setting_str_it]);
			setting_str = _tmp14_;
			{
				GSettings* settings = NULL;
				const gchar* _tmp15_ = NULL;
				GSettings* _tmp16_ = NULL;
				gchar** keys = NULL;
				GSettings* _tmp17_ = NULL;
				gchar** _tmp18_ = NULL;
				gchar** _tmp19_ = NULL;
				gint keys_length1 = 0;
				gint _keys_size_ = 0;
				gchar** _tmp20_ = NULL;
				gint _tmp20__length1 = 0;
				_tmp15_ = setting_str;
				_tmp16_ = g_settings_new (_tmp15_);
				settings = _tmp16_;
				_tmp17_ = settings;
				_tmp19_ = _tmp18_ = g_settings_list_keys (_tmp17_);
				keys = _tmp19_;
				keys_length1 = _vala_array_length (_tmp18_);
				_keys_size_ = keys_length1;
				_tmp20_ = keys;
				_tmp20__length1 = keys_length1;
				{
					gchar** key_collection = NULL;
					gint key_collection_length1 = 0;
					gint _key_collection_size_ = 0;
					gint key_it = 0;
					key_collection = _tmp20_;
					key_collection_length1 = _tmp20__length1;
					for (key_it = 0; key_it < _tmp20__length1; key_it = key_it + 1) {
						gchar* _tmp21_ = NULL;
						gchar* key = NULL;
						_tmp21_ = g_strdup (key_collection[key_it]);
						key = _tmp21_;
						{
							GSettings* _tmp22_ = NULL;
							const gchar* _tmp23_ = NULL;
							_tmp22_ = settings;
							_tmp23_ = key;
							g_settings_reset (_tmp22_, _tmp23_);
							_g_free0 (key);
						}
					}
				}
				keys = (_vala_array_free (keys, keys_length1, (GDestroyNotify) g_free), NULL);
				_g_object_unref0 (settings);
				_g_free0 (setting_str);
			}
		}
	}
	settings_str = (_vala_array_free (settings_str, settings_str_length1, (GDestroyNotify) g_free), NULL);
	_g_object_unref0 (dialog);
}


static const gchar* __lambda24_ (PreferencesDialog* self, gulong n) {
	const gchar* result = NULL;
	gulong _tmp0_ = 0UL;
	const gchar* _tmp1_ = NULL;
	_tmp0_ = n;
	_tmp1_ = ngettext ("minute", "minutes", _tmp0_);
	result = _tmp1_;
	return result;
}


static const gchar* ___lambda24__preferences_dialog_plural (gulong n, gpointer self) {
	const gchar* result;
	result = __lambda24_ ((PreferencesDialog*) self, n);
	return result;
}


static void preferences_dialog_init_editor_tab (PreferencesDialog* self, GtkBuilder* builder) {
	GSettings* settings = NULL;
	GSettings* _tmp0_ = NULL;
	GObject* display_line_nb_checkbutton = NULL;
	GtkBuilder* _tmp1_ = NULL;
	GObject* _tmp2_ = NULL;
	GObject* _tmp3_ = NULL;
	GtkSpinButton* tab_width_spinbutton = NULL;
	GtkBuilder* _tmp4_ = NULL;
	GObject* _tmp5_ = NULL;
	GtkSpinButton* _tmp6_ = NULL;
	GObject* insert_spaces_checkbutton = NULL;
	GtkBuilder* _tmp7_ = NULL;
	GObject* _tmp8_ = NULL;
	GObject* _tmp9_ = NULL;
	GtkWidget* forget_no_tabs = NULL;
	GtkBuilder* _tmp10_ = NULL;
	GObject* _tmp11_ = NULL;
	GtkWidget* _tmp12_ = NULL;
	GObject* hl_current_line_checkbutton = NULL;
	GtkBuilder* _tmp13_ = NULL;
	GObject* _tmp14_ = NULL;
	GObject* _tmp15_ = NULL;
	GObject* bracket_matching_checkbutton = NULL;
	GtkBuilder* _tmp16_ = NULL;
	GObject* _tmp17_ = NULL;
	GObject* _tmp18_ = NULL;
	GObject* backup_checkbutton = NULL;
	GtkBuilder* _tmp19_ = NULL;
	GObject* _tmp20_ = NULL;
	GObject* _tmp21_ = NULL;
	GObject* autosave_checkbutton = NULL;
	GtkBuilder* _tmp22_ = NULL;
	GObject* _tmp23_ = NULL;
	GObject* _tmp24_ = NULL;
	GtkSpinButton* autosave_spinbutton = NULL;
	GtkBuilder* _tmp25_ = NULL;
	GObject* _tmp26_ = NULL;
	GtkSpinButton* _tmp27_ = NULL;
	GtkLabel* autosave_label = NULL;
	GtkBuilder* _tmp28_ = NULL;
	GObject* _tmp29_ = NULL;
	GtkLabel* _tmp30_ = NULL;
	GObject* reopen_checkbutton = NULL;
	GtkBuilder* _tmp31_ = NULL;
	GObject* _tmp32_ = NULL;
	GObject* _tmp33_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (builder != NULL);
	_tmp0_ = g_settings_new ("org.gnome.latexila.preferences.editor");
	settings = _tmp0_;
	_tmp1_ = builder;
	_tmp2_ = gtk_builder_get_object (_tmp1_, "display_line_nb_checkbutton");
	_tmp3_ = _g_object_ref0 (_tmp2_);
	display_line_nb_checkbutton = _tmp3_;
	g_settings_bind (settings, "display-line-numbers", display_line_nb_checkbutton, "active", G_SETTINGS_BIND_DEFAULT);
	_tmp4_ = builder;
	_tmp5_ = gtk_builder_get_object (_tmp4_, "tab_width_spinbutton");
	_tmp6_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, gtk_spin_button_get_type ()) ? ((GtkSpinButton*) _tmp5_) : NULL);
	tab_width_spinbutton = _tmp6_;
	preferences_dialog_set_spin_button_range (self, tab_width_spinbutton, settings, "tabs-size");
	g_settings_bind (settings, "tabs-size", (GObject*) tab_width_spinbutton, "value", G_SETTINGS_BIND_DEFAULT);
	_tmp7_ = builder;
	_tmp8_ = gtk_builder_get_object (_tmp7_, "insert_spaces_checkbutton");
	_tmp9_ = _g_object_ref0 (_tmp8_);
	insert_spaces_checkbutton = _tmp9_;
	g_settings_bind (settings, "insert-spaces", insert_spaces_checkbutton, "active", G_SETTINGS_BIND_DEFAULT);
	_tmp10_ = builder;
	_tmp11_ = gtk_builder_get_object (_tmp10_, "forget_no_tabs");
	_tmp12_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp11_, gtk_widget_get_type ()) ? ((GtkWidget*) _tmp11_) : NULL);
	forget_no_tabs = _tmp12_;
	g_settings_bind (settings, "forget-no-tabs", (GObject*) forget_no_tabs, "active", G_SETTINGS_BIND_DEFAULT);
	preferences_dialog_set_sensitivity (self, settings, "insert-spaces", forget_no_tabs, TRUE);
	_tmp13_ = builder;
	_tmp14_ = gtk_builder_get_object (_tmp13_, "hl_current_line_checkbutton");
	_tmp15_ = _g_object_ref0 (_tmp14_);
	hl_current_line_checkbutton = _tmp15_;
	g_settings_bind (settings, "highlight-current-line", hl_current_line_checkbutton, "active", G_SETTINGS_BIND_DEFAULT);
	_tmp16_ = builder;
	_tmp17_ = gtk_builder_get_object (_tmp16_, "bracket_matching_checkbutton");
	_tmp18_ = _g_object_ref0 (_tmp17_);
	bracket_matching_checkbutton = _tmp18_;
	g_settings_bind (settings, "bracket-matching", bracket_matching_checkbutton, "active", G_SETTINGS_BIND_DEFAULT);
	_tmp19_ = builder;
	_tmp20_ = gtk_builder_get_object (_tmp19_, "backup_checkbutton");
	_tmp21_ = _g_object_ref0 (_tmp20_);
	backup_checkbutton = _tmp21_;
	g_settings_bind (settings, "create-backup-copy", backup_checkbutton, "active", G_SETTINGS_BIND_DEFAULT);
	_tmp22_ = builder;
	_tmp23_ = gtk_builder_get_object (_tmp22_, "autosave_checkbutton");
	_tmp24_ = _g_object_ref0 (_tmp23_);
	autosave_checkbutton = _tmp24_;
	g_settings_bind (settings, "auto-save", autosave_checkbutton, "active", G_SETTINGS_BIND_DEFAULT);
	_tmp25_ = builder;
	_tmp26_ = gtk_builder_get_object (_tmp25_, "autosave_spinbutton");
	_tmp27_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp26_, gtk_spin_button_get_type ()) ? ((GtkSpinButton*) _tmp26_) : NULL);
	autosave_spinbutton = _tmp27_;
	preferences_dialog_set_spin_button_range (self, autosave_spinbutton, settings, "auto-save-interval");
	g_settings_bind (settings, "auto-save-interval", (GObject*) autosave_spinbutton, "value", G_SETTINGS_BIND_DEFAULT);
	preferences_dialog_set_sensitivity (self, settings, "auto-save", (GtkWidget*) autosave_spinbutton, TRUE);
	_tmp28_ = builder;
	_tmp29_ = gtk_builder_get_object (_tmp28_, "autosave_label");
	_tmp30_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp29_, gtk_label_get_type ()) ? ((GtkLabel*) _tmp29_) : NULL);
	autosave_label = _tmp30_;
	preferences_dialog_set_plural (self, autosave_label, settings, "auto-save-interval", ___lambda24__preferences_dialog_plural, self);
	_tmp31_ = builder;
	_tmp32_ = gtk_builder_get_object (_tmp31_, "reopen_checkbutton");
	_tmp33_ = _g_object_ref0 (_tmp32_);
	reopen_checkbutton = _tmp33_;
	g_settings_bind (settings, "reopen-files", reopen_checkbutton, "active", G_SETTINGS_BIND_DEFAULT);
	_g_object_unref0 (reopen_checkbutton);
	_g_object_unref0 (autosave_label);
	_g_object_unref0 (autosave_spinbutton);
	_g_object_unref0 (autosave_checkbutton);
	_g_object_unref0 (backup_checkbutton);
	_g_object_unref0 (bracket_matching_checkbutton);
	_g_object_unref0 (hl_current_line_checkbutton);
	_g_object_unref0 (forget_no_tabs);
	_g_object_unref0 (insert_spaces_checkbutton);
	_g_object_unref0 (tab_width_spinbutton);
	_g_object_unref0 (display_line_nb_checkbutton);
	_g_object_unref0 (settings);
}


static Block23Data* block23_data_ref (Block23Data* _data23_) {
	g_atomic_int_inc (&_data23_->_ref_count_);
	return _data23_;
}


static void block23_data_unref (void * _userdata_) {
	Block23Data* _data23_;
	_data23_ = (Block23Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data23_->_ref_count_)) {
		PreferencesDialog* self;
		self = _data23_->self;
		_g_object_unref0 (_data23_->schemes_select);
		_g_object_unref0 (_data23_->schemes_treeview);
		_g_object_unref0 (_data23_->default_font_checkbutton);
		_g_object_unref0 (_data23_->settings);
		_g_object_unref0 (self);
		g_slice_free (Block23Data, _data23_);
	}
}


static void __lambda25_ (Block23Data* _data23_) {
	PreferencesDialog* self;
	self = _data23_->self;
	preferences_dialog_set_system_font_label (self, _data23_->default_font_checkbutton);
}


static void ___lambda25__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	__lambda25_ (self);
}


static void _gtk_tree_path_free0_ (gpointer var) {
	(var == NULL) ? NULL : (var = (gtk_tree_path_free (var), NULL));
}


static void _g_list_free__gtk_tree_path_free0_ (GList* self) {
	g_list_foreach (self, (GFunc) _gtk_tree_path_free0_, NULL);
	g_list_free (self);
}


static gpointer _gtk_tree_path_copy0 (gpointer self) {
	return self ? gtk_tree_path_copy (self) : NULL;
}


static void __lambda26_ (Block23Data* _data23_) {
	PreferencesDialog* self;
	GtkTreeModel* model = NULL;
	GList* rows = NULL;
	GtkTreeModel* _tmp0_ = NULL;
	GList* _tmp1_ = NULL;
	GList* _tmp2_ = NULL;
	guint _tmp3_ = 0U;
	GtkTreePath* path = NULL;
	GList* _tmp4_ = NULL;
	gconstpointer _tmp5_ = NULL;
	GtkTreePath* _tmp6_ = NULL;
	GtkTreeIter iter = {0};
	GtkTreeModel* _tmp7_ = NULL;
	GtkTreePath* _tmp8_ = NULL;
	GtkTreeIter _tmp9_ = {0};
	gchar* id = NULL;
	GtkTreeModel* _tmp10_ = NULL;
	GtkTreeIter _tmp11_ = {0};
	const gchar* _tmp12_ = NULL;
	self = _data23_->self;
	_tmp1_ = gtk_tree_selection_get_selected_rows (_data23_->schemes_select, &_tmp0_);
	model = _tmp0_;
	rows = _tmp1_;
	_tmp2_ = rows;
	_tmp3_ = g_list_length (_tmp2_);
	if (_tmp3_ != ((guint) 1)) {
		__g_list_free__gtk_tree_path_free0_0 (rows);
		return;
	}
	_tmp4_ = rows;
	_tmp5_ = g_list_nth_data (_tmp4_, (guint) 0);
	_tmp6_ = _gtk_tree_path_copy0 ((GtkTreePath*) _tmp5_);
	path = _tmp6_;
	_tmp7_ = model;
	_tmp8_ = path;
	gtk_tree_model_get_iter (_tmp7_, &_tmp9_, _tmp8_);
	iter = _tmp9_;
	_tmp10_ = model;
	_tmp11_ = iter;
	gtk_tree_model_get (_tmp10_, &_tmp11_, PREFERENCES_DIALOG_STYLE_SCHEMES_ID, &id, -1);
	_tmp12_ = id;
	g_settings_set_string (_data23_->settings, "scheme", _tmp12_);
	_g_free0 (id);
	_gtk_tree_path_free0 (path);
	__g_list_free__gtk_tree_path_free0_0 (rows);
}


static void ___lambda26__gtk_tree_selection_changed (GtkTreeSelection* _sender, gpointer self) {
	__lambda26_ (self);
}


static void __lambda27_ (Block23Data* _data23_, GSettings* setting, const gchar* key) {
	PreferencesDialog* self;
	gchar* val = NULL;
	GSettings* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	GtkTreeModel* model = NULL;
	GtkTreeModel* _tmp3_ = NULL;
	GtkTreeModel* _tmp4_ = NULL;
	GtkTreeModel* _tmp5_ = NULL;
	GtkTreeIter iter = {0};
	gboolean valid = FALSE;
	GtkTreeModel* _tmp6_ = NULL;
	GtkTreeIter _tmp7_ = {0};
	gboolean _tmp8_ = FALSE;
	self = _data23_->self;
	g_return_if_fail (setting != NULL);
	g_return_if_fail (key != NULL);
	_tmp0_ = setting;
	_tmp1_ = key;
	_tmp2_ = g_settings_get_string (_tmp0_, _tmp1_);
	val = _tmp2_;
	_tmp3_ = gtk_tree_view_get_model (_data23_->schemes_treeview);
	_tmp4_ = _tmp3_;
	_tmp5_ = _g_object_ref0 (_tmp4_);
	model = _tmp5_;
	_tmp6_ = model;
	_tmp8_ = gtk_tree_model_get_iter_first (_tmp6_, &_tmp7_);
	iter = _tmp7_;
	valid = _tmp8_;
	while (TRUE) {
		gboolean _tmp9_ = FALSE;
		gchar* scheme = NULL;
		GtkTreeModel* _tmp10_ = NULL;
		GtkTreeIter _tmp11_ = {0};
		const gchar* _tmp12_ = NULL;
		const gchar* _tmp13_ = NULL;
		GtkTreeModel* _tmp18_ = NULL;
		gboolean _tmp19_ = FALSE;
		_tmp9_ = valid;
		if (!_tmp9_) {
			break;
		}
		_tmp10_ = model;
		_tmp11_ = iter;
		gtk_tree_model_get (_tmp10_, &_tmp11_, PREFERENCES_DIALOG_STYLE_SCHEMES_ID, &scheme, -1, -1);
		_tmp12_ = scheme;
		_tmp13_ = val;
		if (g_strcmp0 (_tmp12_, _tmp13_) == 0) {
			GtkTreeSelection* select = NULL;
			GtkTreeSelection* _tmp14_ = NULL;
			GtkTreeSelection* _tmp15_ = NULL;
			GtkTreeSelection* _tmp16_ = NULL;
			GtkTreeIter _tmp17_ = {0};
			_tmp14_ = gtk_tree_view_get_selection (_data23_->schemes_treeview);
			_tmp15_ = _g_object_ref0 (_tmp14_);
			select = _tmp15_;
			_tmp16_ = select;
			_tmp17_ = iter;
			gtk_tree_selection_select_iter (_tmp16_, &_tmp17_);
			_g_object_unref0 (select);
			_g_free0 (scheme);
			_g_object_unref0 (model);
			_g_free0 (val);
			return;
		}
		_tmp18_ = model;
		_tmp19_ = gtk_tree_model_iter_next (_tmp18_, &iter);
		valid = _tmp19_;
		_g_free0 (scheme);
	}
	_g_object_unref0 (model);
	_g_free0 (val);
}


static void ___lambda27__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self) {
	__lambda27_ (self, _sender, key);
}


static void preferences_dialog_init_font_and_colors_tab (PreferencesDialog* self, GtkBuilder* builder) {
	Block23Data* _data23_;
	GSettings* _tmp0_ = NULL;
	GtkBuilder* _tmp1_ = NULL;
	GObject* _tmp2_ = NULL;
	GtkButton* _tmp3_ = NULL;
	AppSettings* app_settings = NULL;
	AppSettings* _tmp4_ = NULL;
	GObject* font_button = NULL;
	GtkBuilder* _tmp5_ = NULL;
	GObject* _tmp6_ = NULL;
	GObject* _tmp7_ = NULL;
	GtkWidget* font_hbox = NULL;
	GtkBuilder* _tmp8_ = NULL;
	GObject* _tmp9_ = NULL;
	GtkWidget* _tmp10_ = NULL;
	GtkBuilder* _tmp11_ = NULL;
	GObject* _tmp12_ = NULL;
	GtkTreeView* _tmp13_ = NULL;
	gchar* current_scheme_id = NULL;
	gchar* _tmp14_ = NULL;
	GtkTreeSelection* _tmp15_ = NULL;
	GtkTreeSelection* _tmp16_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (builder != NULL);
	_data23_ = g_slice_new0 (Block23Data);
	_data23_->_ref_count_ = 1;
	_data23_->self = g_object_ref (self);
	_tmp0_ = g_settings_new ("org.gnome.latexila.preferences.editor");
	_data23_->settings = _tmp0_;
	_tmp1_ = builder;
	_tmp2_ = gtk_builder_get_object (_tmp1_, "default_font_checkbutton");
	_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, gtk_button_get_type ()) ? ((GtkButton*) _tmp2_) : NULL);
	_data23_->default_font_checkbutton = _tmp3_;
	g_settings_bind (_data23_->settings, "use-default-font", (GObject*) _data23_->default_font_checkbutton, "active", G_SETTINGS_BIND_DEFAULT);
	preferences_dialog_set_system_font_label (self, _data23_->default_font_checkbutton);
	_tmp4_ = app_settings_get_default ();
	app_settings = _tmp4_;
	g_signal_connect_data ((GObject*) app_settings, "notify::system-font", (GCallback) ___lambda25__g_object_notify, block23_data_ref (_data23_), (GClosureNotify) block23_data_unref, 0);
	_tmp5_ = builder;
	_tmp6_ = gtk_builder_get_object (_tmp5_, "font_button");
	_tmp7_ = _g_object_ref0 (_tmp6_);
	font_button = _tmp7_;
	g_settings_bind (_data23_->settings, "editor-font", font_button, "font-name", G_SETTINGS_BIND_DEFAULT);
	_tmp8_ = builder;
	_tmp9_ = gtk_builder_get_object (_tmp8_, "font_hbox");
	_tmp10_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp9_, gtk_widget_get_type ()) ? ((GtkWidget*) _tmp9_) : NULL);
	font_hbox = _tmp10_;
	preferences_dialog_set_sensitivity (self, _data23_->settings, "use-default-font", font_hbox, FALSE);
	_tmp11_ = builder;
	_tmp12_ = gtk_builder_get_object (_tmp11_, "schemes_treeview");
	_tmp13_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp12_, gtk_tree_view_get_type ()) ? ((GtkTreeView*) _tmp12_) : NULL);
	_data23_->schemes_treeview = _tmp13_;
	_tmp14_ = g_settings_get_string (_data23_->settings, "scheme");
	current_scheme_id = _tmp14_;
	preferences_dialog_init_schemes_treeview (self, _data23_->schemes_treeview, current_scheme_id);
	_tmp15_ = gtk_tree_view_get_selection (_data23_->schemes_treeview);
	_tmp16_ = _g_object_ref0 (_tmp15_);
	_data23_->schemes_select = _tmp16_;
	g_signal_connect_data (_data23_->schemes_select, "changed", (GCallback) ___lambda26__gtk_tree_selection_changed, block23_data_ref (_data23_), (GClosureNotify) block23_data_unref, 0);
	g_signal_connect_data (_data23_->settings, "changed::scheme", (GCallback) ___lambda27__g_settings_changed, block23_data_ref (_data23_), (GClosureNotify) block23_data_unref, 0);
	_g_free0 (current_scheme_id);
	_g_object_unref0 (font_hbox);
	_g_object_unref0 (font_button);
	_g_object_unref0 (app_settings);
	block23_data_unref (_data23_);
	_data23_ = NULL;
}


static const gchar* __lambda28_ (PreferencesDialog* self, gulong n) {
	const gchar* result = NULL;
	gulong _tmp0_ = 0UL;
	const gchar* _tmp1_ = NULL;
	_tmp0_ = n;
	_tmp1_ = ngettext ("character", "characters", _tmp0_);
	result = _tmp1_;
	return result;
}


static const gchar* ___lambda28__preferences_dialog_plural (gulong n, gpointer self) {
	const gchar* result;
	result = __lambda28_ ((PreferencesDialog*) self, n);
	return result;
}


static void preferences_dialog_init_interactive_completion_setting (PreferencesDialog* self, GtkBuilder* builder) {
	GSettings* settings = NULL;
	GSettings* _tmp0_ = NULL;
	GObject* interactive_comp_checkbutton = NULL;
	GtkBuilder* _tmp1_ = NULL;
	GObject* _tmp2_ = NULL;
	GObject* _tmp3_ = NULL;
	GtkSpinButton* interactive_comp_spinbutton = NULL;
	GtkBuilder* _tmp4_ = NULL;
	GObject* _tmp5_ = NULL;
	GtkSpinButton* _tmp6_ = NULL;
	GtkLabel* interactive_comp_label = NULL;
	GtkBuilder* _tmp7_ = NULL;
	GObject* _tmp8_ = NULL;
	GtkLabel* _tmp9_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (builder != NULL);
	_tmp0_ = g_settings_new ("org.gnome.latexila.preferences.latex");
	settings = _tmp0_;
	_tmp1_ = builder;
	_tmp2_ = gtk_builder_get_object (_tmp1_, "interactive_comp_checkbutton");
	_tmp3_ = _g_object_ref0 (_tmp2_);
	interactive_comp_checkbutton = _tmp3_;
	g_settings_bind (settings, "interactive-completion", interactive_comp_checkbutton, "active", G_SETTINGS_BIND_DEFAULT);
	_tmp4_ = builder;
	_tmp5_ = gtk_builder_get_object (_tmp4_, "interactive_comp_spinbutton");
	_tmp6_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, gtk_spin_button_get_type ()) ? ((GtkSpinButton*) _tmp5_) : NULL);
	interactive_comp_spinbutton = _tmp6_;
	preferences_dialog_set_spin_button_range (self, interactive_comp_spinbutton, settings, "interactive-completion-num");
	g_settings_bind (settings, "interactive-completion-num", (GObject*) interactive_comp_spinbutton, "value", G_SETTINGS_BIND_DEFAULT);
	preferences_dialog_set_sensitivity (self, settings, "interactive-completion", (GtkWidget*) interactive_comp_spinbutton, TRUE);
	_tmp7_ = builder;
	_tmp8_ = gtk_builder_get_object (_tmp7_, "interactive_comp_label");
	_tmp9_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp8_, gtk_label_get_type ()) ? ((GtkLabel*) _tmp8_) : NULL);
	interactive_comp_label = _tmp9_;
	preferences_dialog_set_plural (self, interactive_comp_label, settings, "interactive-completion-num", ___lambda28__preferences_dialog_plural, self);
	_g_object_unref0 (interactive_comp_label);
	_g_object_unref0 (interactive_comp_spinbutton);
	_g_object_unref0 (interactive_comp_checkbutton);
	_g_object_unref0 (settings);
}


static void preferences_dialog_init_other_tab (PreferencesDialog* self, GtkBuilder* builder) {
	GSettings* latex_settings = NULL;
	GSettings* _tmp0_ = NULL;
	GObject* confirm_clean_up_checkbutton = NULL;
	GtkBuilder* _tmp1_ = NULL;
	GObject* _tmp2_ = NULL;
	GObject* _tmp3_ = NULL;
	GtkWidget* auto_clean_up_checkbutton = NULL;
	GtkBuilder* _tmp4_ = NULL;
	GObject* _tmp5_ = NULL;
	GtkWidget* _tmp6_ = NULL;
	GObject* clean_up_entry = NULL;
	GtkBuilder* _tmp7_ = NULL;
	GObject* _tmp8_ = NULL;
	GObject* _tmp9_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (builder != NULL);
	_tmp0_ = g_settings_new ("org.gnome.latexila.preferences.latex");
	latex_settings = _tmp0_;
	_tmp1_ = builder;
	_tmp2_ = gtk_builder_get_object (_tmp1_, "confirm_clean_up_checkbutton");
	_tmp3_ = _g_object_ref0 (_tmp2_);
	confirm_clean_up_checkbutton = _tmp3_;
	g_settings_bind (latex_settings, "no-confirm-clean", confirm_clean_up_checkbutton, "active", G_SETTINGS_BIND_DEFAULT);
	_tmp4_ = builder;
	_tmp5_ = gtk_builder_get_object (_tmp4_, "auto_clean_up_checkbutton");
	_tmp6_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, gtk_widget_get_type ()) ? ((GtkWidget*) _tmp5_) : NULL);
	auto_clean_up_checkbutton = _tmp6_;
	g_settings_bind (latex_settings, "automatic-clean", (GObject*) auto_clean_up_checkbutton, "active", G_SETTINGS_BIND_DEFAULT);
	preferences_dialog_set_sensitivity (self, latex_settings, "no-confirm-clean", auto_clean_up_checkbutton, TRUE);
	_tmp7_ = builder;
	_tmp8_ = gtk_builder_get_object (_tmp7_, "clean_up_entry");
	_tmp9_ = _g_object_ref0 (_tmp8_);
	clean_up_entry = _tmp9_;
	g_settings_bind (latex_settings, "clean-extensions", clean_up_entry, "text", G_SETTINGS_BIND_DEFAULT);
	_g_object_unref0 (clean_up_entry);
	_g_object_unref0 (auto_clean_up_checkbutton);
	_g_object_unref0 (confirm_clean_up_checkbutton);
	_g_object_unref0 (latex_settings);
}


static Block24Data* block24_data_ref (Block24Data* _data24_) {
	g_atomic_int_inc (&_data24_->_ref_count_);
	return _data24_;
}


static void block24_data_unref (void * _userdata_) {
	Block24Data* _data24_;
	_data24_ = (Block24Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data24_->_ref_count_)) {
		PreferencesDialog* self;
		self = _data24_->self;
		_g_object_unref0 (_data24_->widget);
		_g_object_unref0 (self);
		g_slice_free (Block24Data, _data24_);
	}
}


static void __lambda22_ (Block24Data* _data24_, GSettings* setting, const gchar* k) {
	PreferencesDialog* self;
	gboolean v = FALSE;
	GSettings* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	gboolean _tmp4_ = FALSE;
	GtkWidget* _tmp7_ = NULL;
	self = _data24_->self;
	g_return_if_fail (setting != NULL);
	g_return_if_fail (k != NULL);
	_tmp0_ = setting;
	_tmp1_ = k;
	_tmp2_ = g_settings_get_boolean (_tmp0_, _tmp1_);
	v = _tmp2_;
	_tmp4_ = _data24_->must_be_enabled;
	if (_tmp4_) {
		gboolean _tmp5_ = FALSE;
		_tmp5_ = v;
		_tmp3_ = _tmp5_;
	} else {
		gboolean _tmp6_ = FALSE;
		_tmp6_ = v;
		_tmp3_ = !_tmp6_;
	}
	_tmp7_ = _data24_->widget;
	gtk_widget_set_sensitive (_tmp7_, _tmp3_);
}


static void ___lambda22__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self) {
	__lambda22_ (self, _sender, key);
}


static void preferences_dialog_set_sensitivity (PreferencesDialog* self, GSettings* settings, const gchar* key, GtkWidget* widget, gboolean must_be_enabled) {
	Block24Data* _data24_;
	GtkWidget* _tmp0_ = NULL;
	GtkWidget* _tmp1_ = NULL;
	gboolean _tmp2_ = FALSE;
	gboolean val = FALSE;
	GSettings* _tmp3_ = NULL;
	const gchar* _tmp4_ = NULL;
	gboolean _tmp5_ = FALSE;
	gboolean _tmp6_ = FALSE;
	gboolean _tmp7_ = FALSE;
	GtkWidget* _tmp10_ = NULL;
	GSettings* _tmp11_ = NULL;
	const gchar* _tmp12_ = NULL;
	gchar* _tmp13_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (settings != NULL);
	g_return_if_fail (key != NULL);
	g_return_if_fail (widget != NULL);
	_data24_ = g_slice_new0 (Block24Data);
	_data24_->_ref_count_ = 1;
	_data24_->self = g_object_ref (self);
	_tmp0_ = widget;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (_data24_->widget);
	_data24_->widget = _tmp1_;
	_tmp2_ = must_be_enabled;
	_data24_->must_be_enabled = _tmp2_;
	_tmp3_ = settings;
	_tmp4_ = key;
	_tmp5_ = g_settings_get_boolean (_tmp3_, _tmp4_);
	val = _tmp5_;
	_tmp7_ = _data24_->must_be_enabled;
	if (_tmp7_) {
		gboolean _tmp8_ = FALSE;
		_tmp8_ = val;
		_tmp6_ = _tmp8_;
	} else {
		gboolean _tmp9_ = FALSE;
		_tmp9_ = val;
		_tmp6_ = !_tmp9_;
	}
	_tmp10_ = _data24_->widget;
	gtk_widget_set_sensitive (_tmp10_, _tmp6_);
	_tmp11_ = settings;
	_tmp12_ = key;
	_tmp13_ = g_strconcat ("changed::", _tmp12_, NULL);
	g_signal_connect_data (_tmp11_, _tmp13_, (GCallback) ___lambda22__g_settings_changed, block24_data_ref (_data24_), (GClosureNotify) block24_data_unref, 0);
	_g_free0 (_tmp13_);
	block24_data_unref (_data24_);
	_data24_ = NULL;
}


static void preferences_dialog_set_system_font_label (PreferencesDialog* self, GtkButton* button) {
	AppSettings* app_settings = NULL;
	AppSettings* _tmp0_ = NULL;
	gchar* label = NULL;
	const gchar* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	gchar* _tmp4_ = NULL;
	GtkButton* _tmp5_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (button != NULL);
	_tmp0_ = app_settings_get_default ();
	app_settings = _tmp0_;
	_tmp1_ = _ ("Use the system fixed width font (%s)");
	_tmp2_ = app_settings_get_system_font (app_settings);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_strdup_printf (_tmp1_, _tmp3_);
	label = _tmp4_;
	_tmp5_ = button;
	gtk_button_set_label (_tmp5_, label);
	_g_free0 (label);
	_g_object_unref0 (app_settings);
}


static Block25Data* block25_data_ref (Block25Data* _data25_) {
	g_atomic_int_inc (&_data25_->_ref_count_);
	return _data25_;
}


static void block25_data_unref (void * _userdata_) {
	Block25Data* _data25_;
	_data25_ = (Block25Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data25_->_ref_count_)) {
		PreferencesDialog* self;
		self = _data25_->self;
		_g_object_unref0 (_data25_->label);
		_g_object_unref0 (self);
		g_slice_free (Block25Data, _data25_);
	}
}


static void __lambda23_ (Block25Data* _data25_, GSettings* setting, const gchar* k) {
	PreferencesDialog* self;
	guint v = 0U;
	GSettings* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	GtkLabel* _tmp2_ = NULL;
	PreferencesDialogPlural _tmp3_ = NULL;
	void* _tmp3__target = NULL;
	const gchar* _tmp4_ = NULL;
	self = _data25_->self;
	g_return_if_fail (setting != NULL);
	g_return_if_fail (k != NULL);
	_tmp0_ = setting;
	_tmp1_ = k;
	g_settings_get (_tmp0_, _tmp1_, "u", &v);
	_tmp2_ = _data25_->label;
	_tmp3_ = _data25_->plural;
	_tmp3__target = _data25_->plural_target;
	_tmp4_ = _tmp3_ ((gulong) v, _tmp3__target);
	gtk_label_set_label (_tmp2_, _tmp4_);
}


static void ___lambda23__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self) {
	__lambda23_ (self, _sender, key);
}


static void preferences_dialog_set_plural (PreferencesDialog* self, GtkLabel* label, GSettings* settings, const gchar* key, PreferencesDialogPlural plural, void* plural_target) {
	Block25Data* _data25_;
	GtkLabel* _tmp0_ = NULL;
	GtkLabel* _tmp1_ = NULL;
	PreferencesDialogPlural _tmp2_ = NULL;
	void* _tmp2__target = NULL;
	guint val = 0U;
	GSettings* _tmp3_ = NULL;
	const gchar* _tmp4_ = NULL;
	GtkLabel* _tmp5_ = NULL;
	PreferencesDialogPlural _tmp6_ = NULL;
	void* _tmp6__target = NULL;
	const gchar* _tmp7_ = NULL;
	GSettings* _tmp8_ = NULL;
	const gchar* _tmp9_ = NULL;
	gchar* _tmp10_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (label != NULL);
	g_return_if_fail (settings != NULL);
	g_return_if_fail (key != NULL);
	_data25_ = g_slice_new0 (Block25Data);
	_data25_->_ref_count_ = 1;
	_data25_->self = g_object_ref (self);
	_tmp0_ = label;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (_data25_->label);
	_data25_->label = _tmp1_;
	_tmp2_ = plural;
	_tmp2__target = plural_target;
	_data25_->plural = _tmp2_;
	_data25_->plural_target = _tmp2__target;
	_tmp3_ = settings;
	_tmp4_ = key;
	g_settings_get (_tmp3_, _tmp4_, "u", &val);
	_tmp5_ = _data25_->label;
	_tmp6_ = _data25_->plural;
	_tmp6__target = _data25_->plural_target;
	_tmp7_ = _tmp6_ ((gulong) val, _tmp6__target);
	gtk_label_set_label (_tmp5_, _tmp7_);
	_tmp8_ = settings;
	_tmp9_ = key;
	_tmp10_ = g_strconcat ("changed::", _tmp9_, NULL);
	g_signal_connect_data (_tmp8_, _tmp10_, (GCallback) ___lambda23__g_settings_changed, block25_data_ref (_data25_), (GClosureNotify) block25_data_unref, 0);
	_g_free0 (_tmp10_);
	block25_data_unref (_data25_);
	_data25_ = NULL;
}


static void preferences_dialog_set_spin_button_range (PreferencesDialog* self, GtkSpinButton* spin_button, GSettings* settings, const gchar* key) {
	GSettingsSchema* schema = NULL;
	GSettings* _tmp0_ = NULL;
	GSettingsSchema* _tmp1_ = NULL;
	GSettingsSchema* _tmp2_ = NULL;
	GVariant* range = NULL;
	const gchar* _tmp3_ = NULL;
	GSettingsSchemaKey* _tmp4_ = NULL;
	GSettingsSchemaKey* _tmp5_ = NULL;
	GVariant* _tmp6_ = NULL;
	GVariant* _tmp7_ = NULL;
	gchar* range_type = NULL;
	GVariant* range_contents = NULL;
	guint min = 0U;
	guint max = 0U;
	guint cur_value = 0U;
	GSettings* _tmp8_ = NULL;
	const gchar* _tmp9_ = NULL;
	GtkAdjustment* adjustment = NULL;
	GtkAdjustment* _tmp10_ = NULL;
	GtkSpinButton* _tmp11_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (spin_button != NULL);
	g_return_if_fail (settings != NULL);
	g_return_if_fail (key != NULL);
	_tmp0_ = settings;
	g_object_get (_tmp0_, "settings-schema", &_tmp1_, NULL);
	_tmp2_ = _tmp1_;
	schema = _tmp2_;
	_tmp3_ = key;
	_tmp4_ = g_settings_schema_get_key (schema, _tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = g_settings_schema_key_get_range (_tmp5_);
	_tmp7_ = _tmp6_;
	_g_settings_schema_key_unref0 (_tmp5_);
	range = _tmp7_;
	g_variant_get (range, "(sv)", &range_type, &range_contents, NULL);
	g_return_if_fail (g_strcmp0 (range_type, "range") == 0);
	g_variant_get (range_contents, "(uu)", &min, &max, NULL);
	_tmp8_ = settings;
	_tmp9_ = key;
	g_settings_get (_tmp8_, _tmp9_, "u", &cur_value);
	_tmp10_ = gtk_adjustment_new ((gdouble) cur_value, (gdouble) min, (gdouble) max, 1.0, (gdouble) 0, (gdouble) 0);
	g_object_ref_sink (_tmp10_);
	adjustment = _tmp10_;
	_tmp11_ = spin_button;
	gtk_spin_button_set_adjustment (_tmp11_, adjustment);
	_g_object_unref0 (adjustment);
	_g_variant_unref0 (range_contents);
	_g_free0 (range_type);
	_g_variant_unref0 (range);
	_g_settings_schema_unref0 (schema);
}


static void preferences_dialog_init_schemes_treeview (PreferencesDialog* self, GtkTreeView* treeview, const gchar* current_id) {
	GtkListStore* list_store = NULL;
	GtkListStore* _tmp0_ = NULL;
	GtkListStore* _tmp1_ = NULL;
	GtkTreeView* _tmp2_ = NULL;
	GtkListStore* _tmp3_ = NULL;
	GtkCellRendererText* renderer = NULL;
	GtkCellRendererText* _tmp4_ = NULL;
	GtkTreeViewColumn* column = NULL;
	GtkCellRendererText* _tmp5_ = NULL;
	GtkTreeViewColumn* _tmp6_ = NULL;
	GtkTreeView* _tmp7_ = NULL;
	GtkTreeViewColumn* _tmp8_ = NULL;
	GtkTreeSelection* select = NULL;
	GtkTreeView* _tmp9_ = NULL;
	GtkTreeSelection* _tmp10_ = NULL;
	GtkTreeSelection* _tmp11_ = NULL;
	GtkTreeSelection* _tmp12_ = NULL;
	GtkSourceStyleSchemeManager* manager = NULL;
	GtkSourceStyleSchemeManager* _tmp13_ = NULL;
	GtkSourceStyleSchemeManager* _tmp14_ = NULL;
	GtkSourceStyleSchemeManager* _tmp15_ = NULL;
	gchar** _tmp16_ = NULL;
	gchar** _tmp17_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (treeview != NULL);
	g_return_if_fail (current_id != NULL);
	_tmp0_ = gtk_list_store_new ((gint) PREFERENCES_DIALOG_STYLE_SCHEMES_N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, -1);
	list_store = _tmp0_;
	_tmp1_ = list_store;
	gtk_tree_sortable_set_sort_column_id ((GtkTreeSortable*) _tmp1_, (gint) PREFERENCES_DIALOG_STYLE_SCHEMES_ID, GTK_SORT_ASCENDING);
	_tmp2_ = treeview;
	_tmp3_ = list_store;
	gtk_tree_view_set_model (_tmp2_, (GtkTreeModel*) _tmp3_);
	_tmp4_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
	g_object_ref_sink (_tmp4_);
	renderer = _tmp4_;
	_tmp5_ = renderer;
	_tmp6_ = gtk_tree_view_column_new_with_attributes ("Name and description", (GtkCellRenderer*) _tmp5_, "markup", PREFERENCES_DIALOG_STYLE_SCHEMES_DESC, NULL, NULL);
	g_object_ref_sink (_tmp6_);
	column = _tmp6_;
	_tmp7_ = treeview;
	_tmp8_ = column;
	gtk_tree_view_append_column (_tmp7_, _tmp8_);
	_tmp9_ = treeview;
	_tmp10_ = gtk_tree_view_get_selection (_tmp9_);
	_tmp11_ = _g_object_ref0 (_tmp10_);
	select = _tmp11_;
	_tmp12_ = select;
	gtk_tree_selection_set_mode (_tmp12_, GTK_SELECTION_SINGLE);
	_tmp13_ = gtk_source_style_scheme_manager_get_default ();
	_tmp14_ = _g_object_ref0 (_tmp13_);
	manager = _tmp14_;
	_tmp15_ = manager;
	_tmp17_ = _tmp16_ = gtk_source_style_scheme_manager_get_scheme_ids (_tmp15_);
	{
		gchar** id_collection = NULL;
		gint id_collection_length1 = 0;
		gint _id_collection_size_ = 0;
		gint id_it = 0;
		id_collection = _tmp17_;
		id_collection_length1 = _vala_array_length (_tmp16_);
		for (id_it = 0; id_it < _vala_array_length (_tmp16_); id_it = id_it + 1) {
			gchar* _tmp18_ = NULL;
			gchar* id = NULL;
			_tmp18_ = g_strdup (id_collection[id_it]);
			id = _tmp18_;
			{
				GtkSourceStyleScheme* scheme = NULL;
				GtkSourceStyleSchemeManager* _tmp19_ = NULL;
				const gchar* _tmp20_ = NULL;
				GtkSourceStyleScheme* _tmp21_ = NULL;
				GtkSourceStyleScheme* _tmp22_ = NULL;
				gchar* desc = NULL;
				GtkSourceStyleScheme* _tmp23_ = NULL;
				const gchar* _tmp24_ = NULL;
				const gchar* _tmp25_ = NULL;
				GtkSourceStyleScheme* _tmp26_ = NULL;
				const gchar* _tmp27_ = NULL;
				const gchar* _tmp28_ = NULL;
				gchar* _tmp29_ = NULL;
				GtkTreeIter iter = {0};
				GtkListStore* _tmp30_ = NULL;
				GtkTreeIter _tmp31_ = {0};
				GtkListStore* _tmp32_ = NULL;
				GtkTreeIter _tmp33_ = {0};
				GtkSourceStyleScheme* _tmp34_ = NULL;
				const gchar* _tmp35_ = NULL;
				const gchar* _tmp36_ = NULL;
				const gchar* _tmp37_ = NULL;
				const gchar* _tmp38_ = NULL;
				const gchar* _tmp39_ = NULL;
				_tmp19_ = manager;
				_tmp20_ = id;
				_tmp21_ = gtk_source_style_scheme_manager_get_scheme (_tmp19_, _tmp20_);
				_tmp22_ = _g_object_ref0 (_tmp21_);
				scheme = _tmp22_;
				_tmp23_ = scheme;
				_tmp24_ = gtk_source_style_scheme_get_name (_tmp23_);
				_tmp25_ = _tmp24_;
				_tmp26_ = scheme;
				_tmp27_ = gtk_source_style_scheme_get_description (_tmp26_);
				_tmp28_ = _tmp27_;
				_tmp29_ = g_strdup_printf ("<b>%s</b> - %s", _tmp25_, _tmp28_);
				desc = _tmp29_;
				_tmp30_ = list_store;
				gtk_list_store_append (_tmp30_, &_tmp31_);
				iter = _tmp31_;
				_tmp32_ = list_store;
				_tmp33_ = iter;
				_tmp34_ = scheme;
				_tmp35_ = gtk_source_style_scheme_get_id (_tmp34_);
				_tmp36_ = _tmp35_;
				_tmp37_ = desc;
				gtk_list_store_set (_tmp32_, &_tmp33_, PREFERENCES_DIALOG_STYLE_SCHEMES_ID, _tmp36_, PREFERENCES_DIALOG_STYLE_SCHEMES_DESC, _tmp37_, -1, -1);
				_tmp38_ = id;
				_tmp39_ = current_id;
				if (g_strcmp0 (_tmp38_, _tmp39_) == 0) {
					GtkTreeSelection* _tmp40_ = NULL;
					GtkTreeIter _tmp41_ = {0};
					_tmp40_ = select;
					_tmp41_ = iter;
					gtk_tree_selection_select_iter (_tmp40_, &_tmp41_);
				}
				_g_free0 (desc);
				_g_object_unref0 (scheme);
				_g_free0 (id);
			}
		}
	}
	_g_object_unref0 (manager);
	_g_object_unref0 (select);
	_g_object_unref0 (column);
	_g_object_unref0 (renderer);
	_g_object_unref0 (list_store);
}


static void preferences_dialog_class_init (PreferencesDialogClass * klass) {
	preferences_dialog_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->finalize = preferences_dialog_finalize;
}


static void preferences_dialog_instance_init (PreferencesDialog * self) {
}


static void preferences_dialog_finalize (GObject* obj) {
	PreferencesDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_PREFERENCES_DIALOG, PreferencesDialog);
	G_OBJECT_CLASS (preferences_dialog_parent_class)->finalize (obj);
}


GType preferences_dialog_get_type (void) {
	static volatile gsize preferences_dialog_type_id__volatile = 0;
	if (g_once_init_enter (&preferences_dialog_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (PreferencesDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) preferences_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PreferencesDialog), 0, (GInstanceInitFunc) preferences_dialog_instance_init, NULL };
		GType preferences_dialog_type_id;
		preferences_dialog_type_id = g_type_register_static (gtk_dialog_get_type (), "PreferencesDialog", &g_define_type_info, 0);
		g_once_init_leave (&preferences_dialog_type_id__volatile, preferences_dialog_type_id);
	}
	return preferences_dialog_type_id__volatile;
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int 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, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}


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



