/* build_tool_dialog.c generated by valac 0.29.2.2-472d4, the Vala compiler
 * generated from build_tool_dialog.vala, do not modify */

/*
 * This file is part of LaTeXila.
 *
 * Copyright © 2010-2015 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/>.
 *
 * Author: Sébastien Wilmet
 */
/* The configuration of a single build tool.*/

#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <glib/gi18n-lib.h>
#include <latexila.h>
#include <stdlib.h>
#include <string.h>


#define TYPE_BUILD_TOOL_DIALOG (build_tool_dialog_get_type ())
#define BUILD_TOOL_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BUILD_TOOL_DIALOG, BuildToolDialog))
#define BUILD_TOOL_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BUILD_TOOL_DIALOG, BuildToolDialogClass))
#define IS_BUILD_TOOL_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BUILD_TOOL_DIALOG))
#define IS_BUILD_TOOL_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BUILD_TOOL_DIALOG))
#define BUILD_TOOL_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BUILD_TOOL_DIALOG, BuildToolDialogClass))

typedef struct _BuildToolDialog BuildToolDialog;
typedef struct _BuildToolDialogClass BuildToolDialogClass;
typedef struct _BuildToolDialogPrivate BuildToolDialogPrivate;

#define BUILD_TOOL_DIALOG_TYPE_ICON_COLUMN (build_tool_dialog_icon_column_get_type ())

#define BUILD_TOOL_DIALOG_TYPE_JOB_COLUMN (build_tool_dialog_job_column_get_type ())

#define BUILD_TOOL_DIALOG_TYPE_POST_PROCESSOR_COLUMN (build_tool_dialog_post_processor_column_get_type ())
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block1Data Block1Data;
typedef struct _Block2Data Block2Data;
#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 _Block3Data Block3Data;
#define _g_free0(var) (var = (g_free (var), NULL))

struct _BuildToolDialog {
	GObject parent_instance;
	BuildToolDialogPrivate * priv;
};

struct _BuildToolDialogClass {
	GObjectClass parent_class;
};

struct _BuildToolDialogPrivate {
	GtkDialog* _dialog;
	GtkEntry* _entry_label;
	GtkEntry* _entry_desc;
	GtkEntry* _entry_extensions;
	GtkEntry* _entry_files_to_open;
	GtkListStore* _icons_store;
	GtkComboBox* _icons_combobox;
	GtkListStore* _jobs_store;
	GtkTreeView* _jobs_view;
};

typedef enum  {
	BUILD_TOOL_DIALOG_ICON_COLUMN_ICON_NAME,
	BUILD_TOOL_DIALOG_ICON_COLUMN_LABEL,
	BUILD_TOOL_DIALOG_ICON_COLUMN_N_COLUMNS
} BuildToolDialogIconColumn;

typedef enum  {
	BUILD_TOOL_DIALOG_JOB_COLUMN_COMMAND,
	BUILD_TOOL_DIALOG_JOB_COLUMN_POST_PROCESSOR,
	BUILD_TOOL_DIALOG_JOB_COLUMN_N_COLUMNS
} BuildToolDialogJobColumn;

typedef enum  {
	BUILD_TOOL_DIALOG_POST_PROCESSOR_COLUMN_NAME,
	BUILD_TOOL_DIALOG_POST_PROCESSOR_COLUMN_N_COLUMNS
} BuildToolDialogPostProcessorColumn;

struct _Block1Data {
	int _ref_count_;
	BuildToolDialog* self;
	GtkToolButton* remove_button;
	GtkTreeSelection* select;
};

struct _Block2Data {
	int _ref_count_;
	BuildToolDialog* self;
	GtkToolButton* up_button;
	GtkTreeSelection* select;
};

struct _Block3Data {
	int _ref_count_;
	BuildToolDialog* self;
	GtkToolButton* down_button;
	GtkTreeSelection* select;
};


static gpointer build_tool_dialog_parent_class = NULL;

GType build_tool_dialog_get_type (void) G_GNUC_CONST;
#define BUILD_TOOL_DIALOG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_BUILD_TOOL_DIALOG, BuildToolDialogPrivate))
enum  {
	BUILD_TOOL_DIALOG_DUMMY_PROPERTY
};
static GType build_tool_dialog_icon_column_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
static GType build_tool_dialog_job_column_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
static GType build_tool_dialog_post_processor_column_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
BuildToolDialog* build_tool_dialog_new (GtkWindow* parent, gboolean editable);
BuildToolDialog* build_tool_dialog_construct (GType object_type, GtkWindow* parent, gboolean editable);
static void build_tool_dialog_init_text_entries (BuildToolDialog* self, gboolean editable);
static void build_tool_dialog_init_icons_store (BuildToolDialog* self);
static void build_tool_dialog_init_icons_combobox (BuildToolDialog* self);
static void build_tool_dialog_init_jobs (BuildToolDialog* self, gboolean editable);
static GtkGrid* build_tool_dialog_get_main_grid (BuildToolDialog* self, gboolean editable);
gboolean build_tool_dialog_open_build_tool (BuildToolDialog* self, LatexilaBuildTools* build_tools, gint build_tool_num);
static void build_tool_dialog_set_build_tool (BuildToolDialog* self, LatexilaBuildTool* build_tool);
static LatexilaBuildTool* build_tool_dialog_retrieve_build_tool (BuildToolDialog* self);
gboolean build_tool_dialog_create_personal_build_tool (BuildToolDialog* self);
static void build_tool_dialog_set_new_build_tool (BuildToolDialog* self);
static void build_tool_dialog_add_icon (BuildToolDialog* self, const gchar* icon_name, const gchar* label);
static void ___lambda46_ (BuildToolDialog* self, const gchar* path_string, const gchar* new_text);
static void ____lambda46__gtk_cell_renderer_text_edited (GtkCellRendererText* _sender, const gchar* path, const gchar* new_text, gpointer self);
static void __lambda47_ (BuildToolDialog* self, const gchar* path_string, const gchar* new_text);
static void ___lambda47__gtk_cell_renderer_text_edited (GtkCellRendererText* _sender, const gchar* path, const gchar* new_text, gpointer self);
static GtkToolButton* build_tool_dialog_get_add_button (BuildToolDialog* self);
static void __lambda48_ (BuildToolDialog* self);
static void build_tool_dialog_add_build_job (BuildToolDialog* self, LatexilaBuildJob* job);
static void ___lambda48__gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self);
static GtkToolButton* build_tool_dialog_get_remove_button (BuildToolDialog* self);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
static void __lambda49_ (Block1Data* _data1_);
static void ___lambda49__gtk_tree_selection_changed (GtkTreeSelection* _sender, gpointer self);
static void __lambda50_ (BuildToolDialog* self);
gint utils_get_selected_row (GtkTreeView* view, GtkTreeIter* iter);
static void ___lambda50__gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self);
static GtkToolButton* build_tool_dialog_get_up_button (BuildToolDialog* self);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (void * _userdata_);
static void __lambda51_ (Block2Data* _data2_);
static void _gtk_tree_path_free0_ (gpointer var);
static void _g_list_free__gtk_tree_path_free0_ (GList* self);
static void ___lambda51__gtk_tree_selection_changed (GtkTreeSelection* _sender, gpointer self);
static void __lambda52_ (Block2Data* _data2_);
gboolean utils_tree_model_iter_prev (GtkTreeModel* model, GtkTreeIter* iter);
static void ___lambda52__gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self);
static GtkToolButton* build_tool_dialog_get_down_button (BuildToolDialog* self);
static Block3Data* block3_data_ref (Block3Data* _data3_);
static void block3_data_unref (void * _userdata_);
static void __lambda53_ (Block3Data* _data3_);
static void ___lambda53__gtk_tree_selection_changed (GtkTreeSelection* _sender, gpointer self);
static void __lambda54_ (Block3Data* _data3_);
static void ___lambda54__gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self);
static GtkGrid* build_tool_dialog_get_label_grid (BuildToolDialog* self);
static GtkWidget* build_tool_dialog_get_desc_grid (BuildToolDialog* self);
static GtkWidget* build_tool_dialog_get_extensions_grid (BuildToolDialog* self);
static GtkWidget* build_tool_dialog_get_icons_grid (BuildToolDialog* self);
static GtkWidget* build_tool_dialog_get_jobs_grid (BuildToolDialog* self, gboolean editable);
static GtkWidget* build_tool_dialog_get_files_to_open_grid (BuildToolDialog* self);
GtkScrolledWindow* utils_add_scrollbar (GtkWidget* child);
static void build_tool_dialog_finalize (GObject* obj);


static GType build_tool_dialog_icon_column_get_type (void) {
	static volatile gsize build_tool_dialog_icon_column_type_id__volatile = 0;
	if (g_once_init_enter (&build_tool_dialog_icon_column_type_id__volatile)) {
		static const GEnumValue values[] = {{BUILD_TOOL_DIALOG_ICON_COLUMN_ICON_NAME, "BUILD_TOOL_DIALOG_ICON_COLUMN_ICON_NAME", "icon-name"}, {BUILD_TOOL_DIALOG_ICON_COLUMN_LABEL, "BUILD_TOOL_DIALOG_ICON_COLUMN_LABEL", "label"}, {BUILD_TOOL_DIALOG_ICON_COLUMN_N_COLUMNS, "BUILD_TOOL_DIALOG_ICON_COLUMN_N_COLUMNS", "n-columns"}, {0, NULL, NULL}};
		GType build_tool_dialog_icon_column_type_id;
		build_tool_dialog_icon_column_type_id = g_enum_register_static ("BuildToolDialogIconColumn", values);
		g_once_init_leave (&build_tool_dialog_icon_column_type_id__volatile, build_tool_dialog_icon_column_type_id);
	}
	return build_tool_dialog_icon_column_type_id__volatile;
}


static GType build_tool_dialog_job_column_get_type (void) {
	static volatile gsize build_tool_dialog_job_column_type_id__volatile = 0;
	if (g_once_init_enter (&build_tool_dialog_job_column_type_id__volatile)) {
		static const GEnumValue values[] = {{BUILD_TOOL_DIALOG_JOB_COLUMN_COMMAND, "BUILD_TOOL_DIALOG_JOB_COLUMN_COMMAND", "command"}, {BUILD_TOOL_DIALOG_JOB_COLUMN_POST_PROCESSOR, "BUILD_TOOL_DIALOG_JOB_COLUMN_POST_PROCESSOR", "post-processor"}, {BUILD_TOOL_DIALOG_JOB_COLUMN_N_COLUMNS, "BUILD_TOOL_DIALOG_JOB_COLUMN_N_COLUMNS", "n-columns"}, {0, NULL, NULL}};
		GType build_tool_dialog_job_column_type_id;
		build_tool_dialog_job_column_type_id = g_enum_register_static ("BuildToolDialogJobColumn", values);
		g_once_init_leave (&build_tool_dialog_job_column_type_id__volatile, build_tool_dialog_job_column_type_id);
	}
	return build_tool_dialog_job_column_type_id__volatile;
}


static GType build_tool_dialog_post_processor_column_get_type (void) {
	static volatile gsize build_tool_dialog_post_processor_column_type_id__volatile = 0;
	if (g_once_init_enter (&build_tool_dialog_post_processor_column_type_id__volatile)) {
		static const GEnumValue values[] = {{BUILD_TOOL_DIALOG_POST_PROCESSOR_COLUMN_NAME, "BUILD_TOOL_DIALOG_POST_PROCESSOR_COLUMN_NAME", "name"}, {BUILD_TOOL_DIALOG_POST_PROCESSOR_COLUMN_N_COLUMNS, "BUILD_TOOL_DIALOG_POST_PROCESSOR_COLUMN_N_COLUMNS", "n-columns"}, {0, NULL, NULL}};
		GType build_tool_dialog_post_processor_column_type_id;
		build_tool_dialog_post_processor_column_type_id = g_enum_register_static ("BuildToolDialogPostProcessorColumn", values);
		g_once_init_leave (&build_tool_dialog_post_processor_column_type_id__volatile, build_tool_dialog_post_processor_column_type_id);
	}
	return build_tool_dialog_post_processor_column_type_id__volatile;
}


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


BuildToolDialog* build_tool_dialog_construct (GType object_type, GtkWindow* parent, gboolean editable) {
	BuildToolDialog * self = NULL;
	GObject* _tmp0_ = NULL;
	GObject* _tmp1_ = NULL;
	GtkDialog* _tmp2_ = NULL;
	GtkDialog* _tmp3_ = NULL;
	GtkDialog* _tmp4_ = NULL;
	GtkDialog* _tmp5_ = NULL;
	GtkWindow* _tmp6_ = NULL;
	gboolean _tmp7_ = FALSE;
	gboolean _tmp17_ = FALSE;
	gboolean _tmp18_ = FALSE;
	GtkBox* content_area = NULL;
	GtkDialog* _tmp19_ = NULL;
	GtkBox* _tmp20_ = NULL;
	GtkBox* _tmp21_ = NULL;
	gboolean _tmp22_ = FALSE;
	GtkGrid* _tmp23_ = NULL;
	GtkGrid* _tmp24_ = NULL;
	g_return_val_if_fail (parent != NULL, NULL);
	self = (BuildToolDialog*) g_object_new (object_type, NULL);
	_tmp0_ = g_object_new (gtk_dialog_get_type (), "use-header-bar", TRUE, NULL, NULL);
	_tmp1_ = G_IS_INITIALLY_UNOWNED (_tmp0_) ? g_object_ref_sink (_tmp0_) : _tmp0_;
	_tmp2_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, gtk_dialog_get_type ()) ? ((GtkDialog*) _tmp1_) : NULL;
	if (_tmp2_ == NULL) {
		_g_object_unref0 (_tmp1_);
	}
	_g_object_unref0 (self->priv->_dialog);
	self->priv->_dialog = _tmp2_;
	_tmp3_ = self->priv->_dialog;
	gtk_window_set_destroy_with_parent ((GtkWindow*) _tmp3_, TRUE);
	_tmp4_ = self->priv->_dialog;
	gtk_window_set_modal ((GtkWindow*) _tmp4_, TRUE);
	_tmp5_ = self->priv->_dialog;
	_tmp6_ = parent;
	gtk_window_set_transient_for ((GtkWindow*) _tmp5_, _tmp6_);
	_tmp7_ = editable;
	if (_tmp7_) {
		GtkDialog* _tmp8_ = NULL;
		const gchar* _tmp9_ = NULL;
		GtkDialog* _tmp10_ = NULL;
		const gchar* _tmp11_ = NULL;
		GtkDialog* _tmp12_ = NULL;
		const gchar* _tmp13_ = NULL;
		GtkDialog* _tmp14_ = NULL;
		_tmp8_ = self->priv->_dialog;
		_tmp9_ = _ ("Personal Build Tool");
		gtk_window_set_title ((GtkWindow*) _tmp8_, _tmp9_);
		_tmp10_ = self->priv->_dialog;
		_tmp11_ = _ ("_Cancel");
		gtk_dialog_add_button (_tmp10_, _tmp11_, (gint) GTK_RESPONSE_CANCEL);
		_tmp12_ = self->priv->_dialog;
		_tmp13_ = _ ("_Apply");
		gtk_dialog_add_button (_tmp12_, _tmp13_, (gint) GTK_RESPONSE_APPLY);
		_tmp14_ = self->priv->_dialog;
		gtk_dialog_set_default_response (_tmp14_, (gint) GTK_RESPONSE_APPLY);
	} else {
		GtkDialog* _tmp15_ = NULL;
		const gchar* _tmp16_ = NULL;
		_tmp15_ = self->priv->_dialog;
		_tmp16_ = _ ("Default Build Tool (read-only)");
		gtk_window_set_title ((GtkWindow*) _tmp15_, _tmp16_);
	}
	_tmp17_ = editable;
	build_tool_dialog_init_text_entries (self, _tmp17_);
	build_tool_dialog_init_icons_store (self);
	build_tool_dialog_init_icons_combobox (self);
	_tmp18_ = editable;
	build_tool_dialog_init_jobs (self, _tmp18_);
	_tmp19_ = self->priv->_dialog;
	_tmp20_ = (GtkBox*) gtk_dialog_get_content_area (_tmp19_);
	_tmp21_ = _g_object_ref0 (_tmp20_);
	content_area = _tmp21_;
	_tmp22_ = editable;
	_tmp23_ = build_tool_dialog_get_main_grid (self, _tmp22_);
	_tmp24_ = _tmp23_;
	gtk_box_pack_start (content_area, (GtkWidget*) _tmp24_, TRUE, TRUE, (guint) 0);
	_g_object_unref0 (_tmp24_);
	gtk_widget_show_all ((GtkWidget*) content_area);
	_g_object_unref0 (content_area);
	return self;
}


BuildToolDialog* build_tool_dialog_new (GtkWindow* parent, gboolean editable) {
	return build_tool_dialog_construct (TYPE_BUILD_TOOL_DIALOG, parent, editable);
}


gboolean build_tool_dialog_open_build_tool (BuildToolDialog* self, LatexilaBuildTools* build_tools, gint build_tool_num) {
	gboolean result = FALSE;
	LatexilaBuildTool* build_tool = NULL;
	LatexilaBuildTools* _tmp0_ = NULL;
	gint _tmp1_ = 0;
	LatexilaBuildTool* _tmp2_ = NULL;
	LatexilaBuildTool* _tmp3_ = NULL;
	LatexilaBuildTool* _tmp4_ = NULL;
	LatexilaBuildTool* _tmp5_ = NULL;
	gboolean apply = FALSE;
	GtkDialog* _tmp6_ = NULL;
	gint _tmp7_ = 0;
	gboolean _tmp8_ = FALSE;
	GtkDialog* _tmp19_ = NULL;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (build_tools != NULL, FALSE);
	_tmp0_ = build_tools;
	_tmp1_ = build_tool_num;
	_tmp2_ = latexila_build_tools_nth (_tmp0_, (guint) _tmp1_);
	_tmp3_ = _g_object_ref0 (_tmp2_);
	build_tool = _tmp3_;
	_tmp4_ = build_tool;
	g_return_val_if_fail (_tmp4_ != NULL, FALSE);
	_tmp5_ = build_tool;
	build_tool_dialog_set_build_tool (self, _tmp5_);
	_tmp6_ = self->priv->_dialog;
	_tmp7_ = gtk_dialog_run (_tmp6_);
	apply = _tmp7_ == ((gint) GTK_RESPONSE_APPLY);
	_tmp8_ = apply;
	if (_tmp8_) {
		LatexilaBuildTool* new_build_tool = NULL;
		LatexilaBuildTool* _tmp9_ = NULL;
		LatexilaBuildTool* _tmp10_ = NULL;
		LatexilaBuildTool* _tmp11_ = NULL;
		gboolean _tmp12_ = FALSE;
		gboolean _tmp13_ = FALSE;
		LatexilaBuildToolsPersonal* personal_build_tools = NULL;
		LatexilaBuildTools* _tmp14_ = NULL;
		LatexilaBuildToolsPersonal* _tmp15_ = NULL;
		LatexilaBuildToolsPersonal* _tmp16_ = NULL;
		LatexilaBuildTool* _tmp17_ = NULL;
		gint _tmp18_ = 0;
		_tmp9_ = build_tool_dialog_retrieve_build_tool (self);
		new_build_tool = _tmp9_;
		_tmp10_ = new_build_tool;
		_tmp11_ = build_tool;
		g_object_get (_tmp11_, "enabled", &_tmp12_, NULL);
		_tmp13_ = _tmp12_;
		g_object_set (_tmp10_, "enabled", _tmp13_, NULL);
		_tmp14_ = build_tools;
		_tmp15_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp14_, latexila_build_tools_personal_get_type ()) ? ((LatexilaBuildToolsPersonal*) _tmp14_) : NULL);
		personal_build_tools = _tmp15_;
		_tmp16_ = personal_build_tools;
		_tmp17_ = new_build_tool;
		_tmp18_ = build_tool_num;
		latexila_build_tools_personal_replace (_tmp16_, _tmp17_, (guint) _tmp18_);
		_g_object_unref0 (personal_build_tools);
		_g_object_unref0 (new_build_tool);
	}
	_tmp19_ = self->priv->_dialog;
	gtk_widget_destroy ((GtkWidget*) _tmp19_);
	result = apply;
	_g_object_unref0 (build_tool);
	return result;
}


gboolean build_tool_dialog_create_personal_build_tool (BuildToolDialog* self) {
	gboolean result = FALSE;
	gboolean apply = FALSE;
	GtkDialog* _tmp0_ = NULL;
	gint _tmp1_ = 0;
	gboolean _tmp2_ = FALSE;
	GtkDialog* _tmp9_ = NULL;
	g_return_val_if_fail (self != NULL, FALSE);
	build_tool_dialog_set_new_build_tool (self);
	_tmp0_ = self->priv->_dialog;
	_tmp1_ = gtk_dialog_run (_tmp0_);
	apply = _tmp1_ == ((gint) GTK_RESPONSE_APPLY);
	_tmp2_ = apply;
	if (_tmp2_) {
		LatexilaBuildTool* new_build_tool = NULL;
		LatexilaBuildTool* _tmp3_ = NULL;
		LatexilaBuildTool* _tmp4_ = NULL;
		LatexilaBuildToolsPersonal* build_tools = NULL;
		LatexilaBuildToolsPersonal* _tmp5_ = NULL;
		LatexilaBuildToolsPersonal* _tmp6_ = NULL;
		LatexilaBuildToolsPersonal* _tmp7_ = NULL;
		LatexilaBuildTool* _tmp8_ = NULL;
		_tmp3_ = build_tool_dialog_retrieve_build_tool (self);
		new_build_tool = _tmp3_;
		_tmp4_ = new_build_tool;
		g_object_set (_tmp4_, "enabled", TRUE, NULL);
		_tmp5_ = latexila_build_tools_personal_get_instance ();
		_tmp6_ = _g_object_ref0 (_tmp5_);
		build_tools = _tmp6_;
		_tmp7_ = build_tools;
		_tmp8_ = new_build_tool;
		latexila_build_tools_personal_add (_tmp7_, _tmp8_);
		_g_object_unref0 (build_tools);
		_g_object_unref0 (new_build_tool);
	}
	_tmp9_ = self->priv->_dialog;
	gtk_widget_destroy ((GtkWidget*) _tmp9_);
	result = apply;
	return result;
}


/*************************************************************************/
static void build_tool_dialog_init_text_entries (BuildToolDialog* self, gboolean editable) {
	GtkEntry* _tmp0_ = NULL;
	GtkEntry* _tmp1_ = NULL;
	GtkEntry* _tmp2_ = NULL;
	GtkEntry* _tmp3_ = NULL;
	GtkEntry* _tmp4_ = NULL;
	gboolean _tmp5_ = FALSE;
	GtkEntry* _tmp6_ = NULL;
	gboolean _tmp7_ = FALSE;
	GtkEntry* _tmp8_ = NULL;
	gboolean _tmp9_ = FALSE;
	GtkEntry* _tmp10_ = NULL;
	gboolean _tmp11_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = (GtkEntry*) gtk_entry_new ();
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->_entry_label);
	self->priv->_entry_label = _tmp0_;
	_tmp1_ = (GtkEntry*) gtk_entry_new ();
	g_object_ref_sink (_tmp1_);
	_g_object_unref0 (self->priv->_entry_desc);
	self->priv->_entry_desc = _tmp1_;
	_tmp2_ = (GtkEntry*) gtk_entry_new ();
	g_object_ref_sink (_tmp2_);
	_g_object_unref0 (self->priv->_entry_extensions);
	self->priv->_entry_extensions = _tmp2_;
	_tmp3_ = (GtkEntry*) gtk_entry_new ();
	g_object_ref_sink (_tmp3_);
	_g_object_unref0 (self->priv->_entry_files_to_open);
	self->priv->_entry_files_to_open = _tmp3_;
	_tmp4_ = self->priv->_entry_label;
	_tmp5_ = editable;
	gtk_editable_set_editable ((GtkEditable*) _tmp4_, _tmp5_);
	_tmp6_ = self->priv->_entry_desc;
	_tmp7_ = editable;
	gtk_editable_set_editable ((GtkEditable*) _tmp6_, _tmp7_);
	_tmp8_ = self->priv->_entry_extensions;
	_tmp9_ = editable;
	gtk_editable_set_editable ((GtkEditable*) _tmp8_, _tmp9_);
	_tmp10_ = self->priv->_entry_files_to_open;
	_tmp11_ = editable;
	gtk_editable_set_editable ((GtkEditable*) _tmp10_, _tmp11_);
}


static void build_tool_dialog_init_icons_store (BuildToolDialog* self) {
	GtkListStore* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	const gchar* _tmp4_ = NULL;
	const gchar* _tmp5_ = NULL;
	const gchar* _tmp6_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = gtk_list_store_new ((gint) BUILD_TOOL_DIALOG_ICON_COLUMN_N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, -1);
	_g_object_unref0 (self->priv->_icons_store);
	self->priv->_icons_store = _tmp0_;
	_tmp1_ = _ ("Execute");
	build_tool_dialog_add_icon (self, "system-run", _tmp1_);
	build_tool_dialog_add_icon (self, "compile_dvi", "LaTeX → DVI");
	build_tool_dialog_add_icon (self, "compile_pdf", "LaTeX → PDF");
	build_tool_dialog_add_icon (self, "compile_ps", "LaTeX → PS");
	_tmp2_ = _ ("Convert");
	build_tool_dialog_add_icon (self, GTK_STOCK_CONVERT, _tmp2_);
	_tmp3_ = _ ("View File");
	build_tool_dialog_add_icon (self, "text-x-generic", _tmp3_);
	_tmp4_ = _ ("View DVI");
	build_tool_dialog_add_icon (self, "latexila-dvi", _tmp4_);
	_tmp5_ = _ ("View PDF");
	build_tool_dialog_add_icon (self, "latexila-pdf", _tmp5_);
	_tmp6_ = _ ("View PS");
	build_tool_dialog_add_icon (self, "latexila-ps", _tmp6_);
}


static void build_tool_dialog_add_icon (BuildToolDialog* self, const gchar* icon_name, const gchar* label) {
	GtkTreeIter iter = {0};
	GtkListStore* _tmp0_ = NULL;
	GtkTreeIter _tmp1_ = {0};
	GtkListStore* _tmp2_ = NULL;
	GtkTreeIter _tmp3_ = {0};
	const gchar* _tmp4_ = NULL;
	const gchar* _tmp5_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (icon_name != NULL);
	g_return_if_fail (label != NULL);
	_tmp0_ = self->priv->_icons_store;
	gtk_list_store_append (_tmp0_, &_tmp1_);
	iter = _tmp1_;
	_tmp2_ = self->priv->_icons_store;
	_tmp3_ = iter;
	_tmp4_ = icon_name;
	_tmp5_ = label;
	gtk_list_store_set (_tmp2_, &_tmp3_, BUILD_TOOL_DIALOG_ICON_COLUMN_ICON_NAME, _tmp4_, BUILD_TOOL_DIALOG_ICON_COLUMN_LABEL, _tmp5_, -1);
}


static void build_tool_dialog_init_icons_combobox (BuildToolDialog* self) {
	GtkListStore* _tmp0_ = NULL;
	GtkComboBox* _tmp1_ = NULL;
	GtkCellRendererPixbuf* pixbuf_renderer = NULL;
	GtkCellRendererPixbuf* _tmp2_ = NULL;
	GtkComboBox* _tmp3_ = NULL;
	GtkComboBox* _tmp4_ = NULL;
	GtkCellRendererText* text_renderer = NULL;
	GtkCellRendererText* _tmp5_ = NULL;
	GtkComboBox* _tmp6_ = NULL;
	GtkComboBox* _tmp7_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_icons_store;
	_tmp1_ = (GtkComboBox*) gtk_combo_box_new_with_model ((GtkTreeModel*) _tmp0_);
	g_object_ref_sink (_tmp1_);
	_g_object_unref0 (self->priv->_icons_combobox);
	self->priv->_icons_combobox = _tmp1_;
	_tmp2_ = (GtkCellRendererPixbuf*) gtk_cell_renderer_pixbuf_new ();
	g_object_ref_sink (_tmp2_);
	pixbuf_renderer = _tmp2_;
	_tmp3_ = self->priv->_icons_combobox;
	gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp3_, (GtkCellRenderer*) pixbuf_renderer, FALSE);
	_tmp4_ = self->priv->_icons_combobox;
	gtk_cell_layout_set_attributes ((GtkCellLayout*) _tmp4_, (GtkCellRenderer*) pixbuf_renderer, "icon-name", BUILD_TOOL_DIALOG_ICON_COLUMN_ICON_NAME, NULL);
	_tmp5_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
	g_object_ref_sink (_tmp5_);
	text_renderer = _tmp5_;
	_tmp6_ = self->priv->_icons_combobox;
	gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp6_, (GtkCellRenderer*) text_renderer, TRUE);
	_tmp7_ = self->priv->_icons_combobox;
	gtk_cell_layout_set_attributes ((GtkCellLayout*) _tmp7_, (GtkCellRenderer*) text_renderer, "text", BUILD_TOOL_DIALOG_ICON_COLUMN_LABEL, NULL);
	_g_object_unref0 (text_renderer);
	_g_object_unref0 (pixbuf_renderer);
}


static void ___lambda46_ (BuildToolDialog* self, const gchar* path_string, const gchar* new_text) {
	GtkTreeIter iter = {0};
	GtkListStore* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	GtkTreeIter _tmp2_ = {0};
	GtkListStore* _tmp3_ = NULL;
	GtkTreeIter _tmp4_ = {0};
	const gchar* _tmp5_ = NULL;
	g_return_if_fail (path_string != NULL);
	g_return_if_fail (new_text != NULL);
	_tmp0_ = self->priv->_jobs_store;
	_tmp1_ = path_string;
	gtk_tree_model_get_iter_from_string ((GtkTreeModel*) _tmp0_, &_tmp2_, _tmp1_);
	iter = _tmp2_;
	_tmp3_ = self->priv->_jobs_store;
	_tmp4_ = iter;
	_tmp5_ = new_text;
	gtk_list_store_set (_tmp3_, &_tmp4_, BUILD_TOOL_DIALOG_JOB_COLUMN_COMMAND, _tmp5_, -1);
}


static void ____lambda46__gtk_cell_renderer_text_edited (GtkCellRendererText* _sender, const gchar* path, const gchar* new_text, gpointer self) {
	___lambda46_ ((BuildToolDialog*) self, path, new_text);
}


static void __lambda47_ (BuildToolDialog* self, const gchar* path_string, const gchar* new_text) {
	GtkTreeIter iter = {0};
	GtkListStore* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	GtkTreeIter _tmp2_ = {0};
	GtkListStore* _tmp3_ = NULL;
	GtkTreeIter _tmp4_ = {0};
	const gchar* _tmp5_ = NULL;
	g_return_if_fail (path_string != NULL);
	g_return_if_fail (new_text != NULL);
	_tmp0_ = self->priv->_jobs_store;
	_tmp1_ = path_string;
	gtk_tree_model_get_iter_from_string ((GtkTreeModel*) _tmp0_, &_tmp2_, _tmp1_);
	iter = _tmp2_;
	_tmp3_ = self->priv->_jobs_store;
	_tmp4_ = iter;
	_tmp5_ = new_text;
	gtk_list_store_set (_tmp3_, &_tmp4_, BUILD_TOOL_DIALOG_JOB_COLUMN_POST_PROCESSOR, _tmp5_, -1);
}


static void ___lambda47__gtk_cell_renderer_text_edited (GtkCellRendererText* _sender, const gchar* path, const gchar* new_text, gpointer self) {
	__lambda47_ ((BuildToolDialog*) self, path, new_text);
}


static void build_tool_dialog_init_jobs (BuildToolDialog* self, gboolean editable) {
	GtkListStore* _tmp0_ = NULL;
	GtkListStore* _tmp1_ = NULL;
	GtkTreeView* _tmp2_ = NULL;
	GtkListStore* post_processor_store = NULL;
	GtkListStore* _tmp3_ = NULL;
	GtkListStore* _tmp14_ = NULL;
	GtkCellRendererText* text_renderer = NULL;
	GtkCellRendererText* _tmp15_ = NULL;
	GtkCellRendererText* _tmp16_ = NULL;
	GtkTreeViewColumn* column = NULL;
	const gchar* _tmp17_ = NULL;
	GtkCellRendererText* _tmp18_ = NULL;
	GtkTreeViewColumn* _tmp19_ = NULL;
	GtkTreeViewColumn* _tmp20_ = NULL;
	GtkTreeView* _tmp21_ = NULL;
	GtkTreeViewColumn* _tmp22_ = NULL;
	GtkCellRendererCombo* combo_renderer = NULL;
	GtkCellRendererCombo* _tmp23_ = NULL;
	GtkCellRendererCombo* _tmp24_ = NULL;
	gboolean _tmp25_ = FALSE;
	GtkCellRendererCombo* _tmp26_ = NULL;
	GtkListStore* _tmp27_ = NULL;
	GtkCellRendererCombo* _tmp28_ = NULL;
	GtkCellRendererCombo* _tmp29_ = NULL;
	GtkTreeView* _tmp30_ = NULL;
	const gchar* _tmp31_ = NULL;
	GtkCellRendererCombo* _tmp32_ = NULL;
	gboolean _tmp33_ = FALSE;
	GtkCellRendererCombo* _tmp35_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = gtk_list_store_new ((gint) BUILD_TOOL_DIALOG_JOB_COLUMN_N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, -1);
	_g_object_unref0 (self->priv->_jobs_store);
	self->priv->_jobs_store = _tmp0_;
	_tmp1_ = self->priv->_jobs_store;
	_tmp2_ = (GtkTreeView*) gtk_tree_view_new_with_model ((GtkTreeModel*) _tmp1_);
	g_object_ref_sink (_tmp2_);
	_g_object_unref0 (self->priv->_jobs_view);
	self->priv->_jobs_view = _tmp2_;
	_tmp3_ = gtk_list_store_new ((gint) BUILD_TOOL_DIALOG_POST_PROCESSOR_COLUMN_N_COLUMNS, G_TYPE_STRING, -1);
	post_processor_store = _tmp3_;
	{
		gint type = 0;
		type = 0;
		{
			gboolean _tmp4_ = FALSE;
			_tmp4_ = TRUE;
			while (TRUE) {
				gint _tmp6_ = 0;
				const gchar* name = NULL;
				gint _tmp7_ = 0;
				const gchar* _tmp8_ = NULL;
				GtkTreeIter iter = {0};
				GtkListStore* _tmp9_ = NULL;
				GtkTreeIter _tmp10_ = {0};
				GtkListStore* _tmp11_ = NULL;
				GtkTreeIter _tmp12_ = {0};
				const gchar* _tmp13_ = NULL;
				if (!_tmp4_) {
					gint _tmp5_ = 0;
					_tmp5_ = type;
					type = _tmp5_ + 1;
				}
				_tmp4_ = FALSE;
				_tmp6_ = type;
				if (!(_tmp6_ < ((gint) LATEXILA_POST_PROCESSOR_TYPE_NB_TYPES))) {
					break;
				}
				_tmp7_ = type;
				_tmp8_ = latexila_post_processor_get_name_from_type ((LatexilaPostProcessorType) _tmp7_);
				name = _tmp8_;
				_tmp9_ = post_processor_store;
				gtk_list_store_append (_tmp9_, &_tmp10_);
				iter = _tmp10_;
				_tmp11_ = post_processor_store;
				_tmp12_ = iter;
				_tmp13_ = name;
				gtk_list_store_set (_tmp11_, &_tmp12_, BUILD_TOOL_DIALOG_POST_PROCESSOR_COLUMN_NAME, _tmp13_, -1);
			}
		}
	}
	_tmp14_ = post_processor_store;
	gtk_tree_sortable_set_sort_column_id ((GtkTreeSortable*) _tmp14_, (gint) BUILD_TOOL_DIALOG_POST_PROCESSOR_COLUMN_NAME, GTK_SORT_ASCENDING);
	_tmp15_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
	g_object_ref_sink (_tmp15_);
	text_renderer = _tmp15_;
	_tmp16_ = text_renderer;
	g_object_set (_tmp16_, "editable", TRUE, NULL);
	_tmp17_ = _ ("Commands");
	_tmp18_ = text_renderer;
	_tmp19_ = gtk_tree_view_column_new_with_attributes (_tmp17_, (GtkCellRenderer*) _tmp18_, "text", BUILD_TOOL_DIALOG_JOB_COLUMN_COMMAND, NULL);
	g_object_ref_sink (_tmp19_);
	column = _tmp19_;
	_tmp20_ = column;
	gtk_tree_view_column_set_resizable (_tmp20_, TRUE);
	_tmp21_ = self->priv->_jobs_view;
	_tmp22_ = column;
	gtk_tree_view_append_column (_tmp21_, _tmp22_);
	_tmp23_ = (GtkCellRendererCombo*) gtk_cell_renderer_combo_new ();
	g_object_ref_sink (_tmp23_);
	combo_renderer = _tmp23_;
	_tmp24_ = combo_renderer;
	_tmp25_ = editable;
	g_object_set ((GtkCellRendererText*) _tmp24_, "editable", _tmp25_, NULL);
	_tmp26_ = combo_renderer;
	_tmp27_ = post_processor_store;
	g_object_set (_tmp26_, "model", (GtkTreeModel*) _tmp27_, NULL);
	_tmp28_ = combo_renderer;
	g_object_set (_tmp28_, "text-column", (gint) BUILD_TOOL_DIALOG_POST_PROCESSOR_COLUMN_NAME, NULL);
	_tmp29_ = combo_renderer;
	g_object_set (_tmp29_, "has-entry", FALSE, NULL);
	_tmp30_ = self->priv->_jobs_view;
	_tmp31_ = _ ("Post Processor");
	_tmp32_ = combo_renderer;
	gtk_tree_view_insert_column_with_attributes (_tmp30_, -1, _tmp31_, (GtkCellRenderer*) _tmp32_, "text", BUILD_TOOL_DIALOG_JOB_COLUMN_POST_PROCESSOR, NULL);
	_tmp33_ = editable;
	if (_tmp33_) {
		GtkCellRendererText* _tmp34_ = NULL;
		_tmp34_ = text_renderer;
		g_signal_connect_object (_tmp34_, "edited", (GCallback) ____lambda46__gtk_cell_renderer_text_edited, self, 0);
	}
	_tmp35_ = combo_renderer;
	g_signal_connect_object ((GtkCellRendererText*) _tmp35_, "edited", (GCallback) ___lambda47__gtk_cell_renderer_text_edited, self, 0);
	_g_object_unref0 (combo_renderer);
	_g_object_unref0 (column);
	_g_object_unref0 (text_renderer);
	_g_object_unref0 (post_processor_store);
}


/*************************************************************************/
static void __lambda48_ (BuildToolDialog* self) {
	LatexilaBuildJob* new_job = NULL;
	LatexilaBuildJob* _tmp0_ = NULL;
	_tmp0_ = latexila_build_job_new ();
	new_job = _tmp0_;
	g_object_set (new_job, "command", "", NULL);
	g_object_set (new_job, "post-processor-type", LATEXILA_POST_PROCESSOR_TYPE_ALL_OUTPUT, NULL);
	build_tool_dialog_add_build_job (self, new_job);
	_g_object_unref0 (new_job);
}


static void ___lambda48__gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self) {
	__lambda48_ ((BuildToolDialog*) self);
}


static GtkToolButton* build_tool_dialog_get_add_button (BuildToolDialog* self) {
	GtkToolButton* result = NULL;
	GtkToolButton* add_button = NULL;
	GtkToolButton* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = (GtkToolButton*) gtk_tool_button_new (NULL, NULL);
	g_object_ref_sink (_tmp0_);
	add_button = _tmp0_;
	gtk_tool_button_set_icon_name (add_button, "list-add-symbolic");
	_tmp1_ = _ ("Add...");
	gtk_tool_item_set_tooltip_text ((GtkToolItem*) add_button, _tmp1_);
	g_signal_connect_object (add_button, "clicked", (GCallback) ___lambda48__gtk_tool_button_clicked, self, 0);
	result = add_button;
	return result;
}


static Block1Data* block1_data_ref (Block1Data* _data1_) {
	g_atomic_int_inc (&_data1_->_ref_count_);
	return _data1_;
}


static void block1_data_unref (void * _userdata_) {
	Block1Data* _data1_;
	_data1_ = (Block1Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
		BuildToolDialog* self;
		self = _data1_->self;
		_g_object_unref0 (_data1_->remove_button);
		_g_object_unref0 (self);
		g_slice_free (Block1Data, _data1_);
	}
}


static void __lambda49_ (Block1Data* _data1_) {
	BuildToolDialog* self;
	gboolean row_selected = FALSE;
	gint _tmp0_ = 0;
	self = _data1_->self;
	_tmp0_ = gtk_tree_selection_count_selected_rows (_data1_->select);
	row_selected = _tmp0_ > 0;
	gtk_widget_set_sensitive ((GtkWidget*) _data1_->remove_button, row_selected);
}


static void ___lambda49__gtk_tree_selection_changed (GtkTreeSelection* _sender, gpointer self) {
	__lambda49_ (self);
}


static void __lambda50_ (BuildToolDialog* self) {
	GtkTreeIter iter = {0};
	gint selected_row = 0;
	GtkTreeView* _tmp0_ = NULL;
	GtkTreeIter _tmp1_ = {0};
	gint _tmp2_ = 0;
	gint _tmp3_ = 0;
	_tmp0_ = self->priv->_jobs_view;
	_tmp2_ = utils_get_selected_row (_tmp0_, &_tmp1_);
	iter = _tmp1_;
	selected_row = _tmp2_;
	_tmp3_ = selected_row;
	if (_tmp3_ >= 0) {
		GtkListStore* _tmp4_ = NULL;
		GtkTreeIter _tmp5_ = {0};
		_tmp4_ = self->priv->_jobs_store;
		_tmp5_ = iter;
		gtk_list_store_remove (_tmp4_, &_tmp5_);
	}
}


static void ___lambda50__gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self) {
	__lambda50_ ((BuildToolDialog*) self);
}


static GtkToolButton* build_tool_dialog_get_remove_button (BuildToolDialog* self) {
	GtkToolButton* result = NULL;
	Block1Data* _data1_;
	GtkToolButton* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	GtkTreeView* _tmp2_ = NULL;
	GtkTreeSelection* _tmp3_ = NULL;
	GtkToolButton* _tmp4_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_data1_ = g_slice_new0 (Block1Data);
	_data1_->_ref_count_ = 1;
	_data1_->self = g_object_ref (self);
	_tmp0_ = (GtkToolButton*) gtk_tool_button_new (NULL, NULL);
	g_object_ref_sink (_tmp0_);
	_data1_->remove_button = _tmp0_;
	gtk_tool_button_set_icon_name (_data1_->remove_button, "list-remove-symbolic");
	_tmp1_ = _ ("Remove");
	gtk_tool_item_set_tooltip_text ((GtkToolItem*) _data1_->remove_button, _tmp1_);
	gtk_widget_set_sensitive ((GtkWidget*) _data1_->remove_button, FALSE);
	_tmp2_ = self->priv->_jobs_view;
	_tmp3_ = gtk_tree_view_get_selection (_tmp2_);
	_data1_->select = _tmp3_;
	g_signal_connect_data (_data1_->select, "changed", (GCallback) ___lambda49__gtk_tree_selection_changed, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
	g_signal_connect_object (_data1_->remove_button, "clicked", (GCallback) ___lambda50__gtk_tool_button_clicked, self, 0);
	_tmp4_ = _g_object_ref0 (_data1_->remove_button);
	result = _tmp4_;
	block1_data_unref (_data1_);
	_data1_ = NULL;
	return result;
}


static Block2Data* block2_data_ref (Block2Data* _data2_) {
	g_atomic_int_inc (&_data2_->_ref_count_);
	return _data2_;
}


static void block2_data_unref (void * _userdata_) {
	Block2Data* _data2_;
	_data2_ = (Block2Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
		BuildToolDialog* self;
		self = _data2_->self;
		_g_object_unref0 (_data2_->up_button);
		_g_object_unref0 (self);
		g_slice_free (Block2Data, _data2_);
	}
}


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 __lambda51_ (Block2Data* _data2_) {
	BuildToolDialog* self;
	GList* selected_rows = NULL;
	GList* _tmp0_ = NULL;
	GList* _tmp1_ = NULL;
	guint _tmp2_ = 0U;
	GtkTreePath* path_selected = NULL;
	GList* _tmp3_ = NULL;
	gconstpointer _tmp4_ = NULL;
	GtkTreePath* _tmp5_ = NULL;
	gint row_num = 0;
	GtkTreePath* _tmp6_ = NULL;
	gint _tmp7_ = 0;
	gint* _tmp8_ = NULL;
	gint _tmp9_ = 0;
	gint _tmp10_ = 0;
	self = _data2_->self;
	_tmp0_ = gtk_tree_selection_get_selected_rows (_data2_->select, NULL);
	selected_rows = _tmp0_;
	_tmp1_ = selected_rows;
	_tmp2_ = g_list_length (_tmp1_);
	if (_tmp2_ == ((guint) 0)) {
		gtk_widget_set_sensitive ((GtkWidget*) _data2_->up_button, FALSE);
		__g_list_free__gtk_tree_path_free0_0 (selected_rows);
		return;
	}
	_tmp3_ = selected_rows;
	_tmp4_ = g_list_nth_data (_tmp3_, (guint) 0);
	_tmp5_ = _gtk_tree_path_copy0 ((GtkTreePath*) _tmp4_);
	path_selected = _tmp5_;
	_tmp6_ = path_selected;
	_tmp8_ = gtk_tree_path_get_indices_with_depth (_tmp6_, &_tmp7_);
	_tmp9_ = _tmp8_[0];
	row_num = _tmp9_;
	_tmp10_ = row_num;
	gtk_widget_set_sensitive ((GtkWidget*) _data2_->up_button, _tmp10_ > 0);
	_gtk_tree_path_free0 (path_selected);
	__g_list_free__gtk_tree_path_free0_0 (selected_rows);
}


static void ___lambda51__gtk_tree_selection_changed (GtkTreeSelection* _sender, gpointer self) {
	__lambda51_ (self);
}


static void __lambda52_ (Block2Data* _data2_) {
	BuildToolDialog* self;
	GtkTreeIter iter_selected = {0};
	gint selected_row = 0;
	GtkTreeView* _tmp0_ = NULL;
	GtkTreeIter _tmp1_ = {0};
	gint _tmp2_ = 0;
	gint _tmp3_ = 0;
	self = _data2_->self;
	_tmp0_ = self->priv->_jobs_view;
	_tmp2_ = utils_get_selected_row (_tmp0_, &_tmp1_);
	iter_selected = _tmp1_;
	selected_row = _tmp2_;
	_tmp3_ = selected_row;
	if (_tmp3_ > 0) {
		GtkTreeIter iter_up = {0};
		GtkTreeIter _tmp4_ = {0};
		GtkListStore* _tmp5_ = NULL;
		gboolean _tmp6_ = FALSE;
		_tmp4_ = iter_selected;
		iter_up = _tmp4_;
		_tmp5_ = self->priv->_jobs_store;
		_tmp6_ = utils_tree_model_iter_prev ((GtkTreeModel*) _tmp5_, &iter_up);
		if (_tmp6_) {
			GtkListStore* _tmp7_ = NULL;
			GtkTreeIter _tmp8_ = {0};
			GtkTreeIter _tmp9_ = {0};
			_tmp7_ = self->priv->_jobs_store;
			_tmp8_ = iter_selected;
			_tmp9_ = iter_up;
			gtk_list_store_swap (_tmp7_, &_tmp8_, &_tmp9_);
			g_signal_emit_by_name (_data2_->select, "changed");
		}
	}
}


static void ___lambda52__gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self) {
	__lambda52_ (self);
}


static GtkToolButton* build_tool_dialog_get_up_button (BuildToolDialog* self) {
	GtkToolButton* result = NULL;
	Block2Data* _data2_;
	GtkToolButton* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	GtkTreeView* _tmp2_ = NULL;
	GtkTreeSelection* _tmp3_ = NULL;
	GtkToolButton* _tmp4_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_data2_ = g_slice_new0 (Block2Data);
	_data2_->_ref_count_ = 1;
	_data2_->self = g_object_ref (self);
	_tmp0_ = (GtkToolButton*) gtk_tool_button_new (NULL, NULL);
	g_object_ref_sink (_tmp0_);
	_data2_->up_button = _tmp0_;
	gtk_tool_button_set_icon_name (_data2_->up_button, "go-up-symbolic");
	_tmp1_ = _ ("Move up");
	gtk_tool_item_set_tooltip_text ((GtkToolItem*) _data2_->up_button, _tmp1_);
	gtk_widget_set_sensitive ((GtkWidget*) _data2_->up_button, FALSE);
	_tmp2_ = self->priv->_jobs_view;
	_tmp3_ = gtk_tree_view_get_selection (_tmp2_);
	_data2_->select = _tmp3_;
	g_signal_connect_data (_data2_->select, "changed", (GCallback) ___lambda51__gtk_tree_selection_changed, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
	g_signal_connect_data (_data2_->up_button, "clicked", (GCallback) ___lambda52__gtk_tool_button_clicked, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
	_tmp4_ = _g_object_ref0 (_data2_->up_button);
	result = _tmp4_;
	block2_data_unref (_data2_);
	_data2_ = NULL;
	return result;
}


static Block3Data* block3_data_ref (Block3Data* _data3_) {
	g_atomic_int_inc (&_data3_->_ref_count_);
	return _data3_;
}


static void block3_data_unref (void * _userdata_) {
	Block3Data* _data3_;
	_data3_ = (Block3Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data3_->_ref_count_)) {
		BuildToolDialog* self;
		self = _data3_->self;
		_g_object_unref0 (_data3_->down_button);
		_g_object_unref0 (self);
		g_slice_free (Block3Data, _data3_);
	}
}


static void __lambda53_ (Block3Data* _data3_) {
	BuildToolDialog* self;
	GList* selected_rows = NULL;
	GList* _tmp0_ = NULL;
	GList* _tmp1_ = NULL;
	guint _tmp2_ = 0U;
	GtkTreePath* path_selected = NULL;
	GList* _tmp3_ = NULL;
	gconstpointer _tmp4_ = NULL;
	GtkTreePath* _tmp5_ = NULL;
	gint row_num = 0;
	GtkTreePath* _tmp6_ = NULL;
	gint _tmp7_ = 0;
	gint* _tmp8_ = NULL;
	gint _tmp9_ = 0;
	GtkTreeModel* model = NULL;
	GtkListStore* _tmp10_ = NULL;
	GtkTreeModel* _tmp11_ = NULL;
	gint nb_rows = 0;
	GtkTreeModel* _tmp12_ = NULL;
	gint _tmp13_ = 0;
	gint _tmp14_ = 0;
	gint _tmp15_ = 0;
	self = _data3_->self;
	_tmp0_ = gtk_tree_selection_get_selected_rows (_data3_->select, NULL);
	selected_rows = _tmp0_;
	_tmp1_ = selected_rows;
	_tmp2_ = g_list_length (_tmp1_);
	if (_tmp2_ == ((guint) 0)) {
		gtk_widget_set_sensitive ((GtkWidget*) _data3_->down_button, FALSE);
		__g_list_free__gtk_tree_path_free0_0 (selected_rows);
		return;
	}
	_tmp3_ = selected_rows;
	_tmp4_ = g_list_nth_data (_tmp3_, (guint) 0);
	_tmp5_ = _gtk_tree_path_copy0 ((GtkTreePath*) _tmp4_);
	path_selected = _tmp5_;
	_tmp6_ = path_selected;
	_tmp8_ = gtk_tree_path_get_indices_with_depth (_tmp6_, &_tmp7_);
	_tmp9_ = _tmp8_[0];
	row_num = _tmp9_;
	_tmp10_ = self->priv->_jobs_store;
	_tmp11_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp10_, GTK_TYPE_TREE_MODEL) ? ((GtkTreeModel*) _tmp10_) : NULL);
	model = _tmp11_;
	_tmp12_ = model;
	_tmp13_ = gtk_tree_model_iter_n_children (_tmp12_, NULL);
	nb_rows = _tmp13_;
	_tmp14_ = row_num;
	_tmp15_ = nb_rows;
	gtk_widget_set_sensitive ((GtkWidget*) _data3_->down_button, _tmp14_ < (_tmp15_ - 1));
	_g_object_unref0 (model);
	_gtk_tree_path_free0 (path_selected);
	__g_list_free__gtk_tree_path_free0_0 (selected_rows);
}


static void ___lambda53__gtk_tree_selection_changed (GtkTreeSelection* _sender, gpointer self) {
	__lambda53_ (self);
}


static void __lambda54_ (Block3Data* _data3_) {
	BuildToolDialog* self;
	GtkTreeIter iter_selected = {0};
	gint selected_row = 0;
	GtkTreeView* _tmp0_ = NULL;
	GtkTreeIter _tmp1_ = {0};
	gint _tmp2_ = 0;
	gint _tmp3_ = 0;
	self = _data3_->self;
	_tmp0_ = self->priv->_jobs_view;
	_tmp2_ = utils_get_selected_row (_tmp0_, &_tmp1_);
	iter_selected = _tmp1_;
	selected_row = _tmp2_;
	_tmp3_ = selected_row;
	if (_tmp3_ >= 0) {
		GtkTreeIter iter_down = {0};
		GtkTreeIter _tmp4_ = {0};
		GtkListStore* _tmp5_ = NULL;
		gboolean _tmp6_ = FALSE;
		_tmp4_ = iter_selected;
		iter_down = _tmp4_;
		_tmp5_ = self->priv->_jobs_store;
		_tmp6_ = gtk_tree_model_iter_next ((GtkTreeModel*) _tmp5_, &iter_down);
		if (_tmp6_) {
			GtkListStore* _tmp7_ = NULL;
			GtkTreeIter _tmp8_ = {0};
			GtkTreeIter _tmp9_ = {0};
			_tmp7_ = self->priv->_jobs_store;
			_tmp8_ = iter_selected;
			_tmp9_ = iter_down;
			gtk_list_store_swap (_tmp7_, &_tmp8_, &_tmp9_);
			g_signal_emit_by_name (_data3_->select, "changed");
		}
	}
}


static void ___lambda54__gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self) {
	__lambda54_ (self);
}


static GtkToolButton* build_tool_dialog_get_down_button (BuildToolDialog* self) {
	GtkToolButton* result = NULL;
	Block3Data* _data3_;
	GtkToolButton* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	GtkTreeView* _tmp2_ = NULL;
	GtkTreeSelection* _tmp3_ = NULL;
	GtkToolButton* _tmp4_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_data3_ = g_slice_new0 (Block3Data);
	_data3_->_ref_count_ = 1;
	_data3_->self = g_object_ref (self);
	_tmp0_ = (GtkToolButton*) gtk_tool_button_new (NULL, NULL);
	g_object_ref_sink (_tmp0_);
	_data3_->down_button = _tmp0_;
	gtk_tool_button_set_icon_name (_data3_->down_button, "go-down-symbolic");
	_tmp1_ = _ ("Move down");
	gtk_tool_item_set_tooltip_text ((GtkToolItem*) _data3_->down_button, _tmp1_);
	gtk_widget_set_sensitive ((GtkWidget*) _data3_->down_button, FALSE);
	_tmp2_ = self->priv->_jobs_view;
	_tmp3_ = gtk_tree_view_get_selection (_tmp2_);
	_data3_->select = _tmp3_;
	g_signal_connect_data (_data3_->select, "changed", (GCallback) ___lambda53__gtk_tree_selection_changed, block3_data_ref (_data3_), (GClosureNotify) block3_data_unref, 0);
	g_signal_connect_data (_data3_->down_button, "clicked", (GCallback) ___lambda54__gtk_tool_button_clicked, block3_data_ref (_data3_), (GClosureNotify) block3_data_unref, 0);
	_tmp4_ = _g_object_ref0 (_data3_->down_button);
	result = _tmp4_;
	block3_data_unref (_data3_);
	_data3_ = NULL;
	return result;
}


/*************************************************************************/
static void build_tool_dialog_set_new_build_tool (BuildToolDialog* self) {
	GtkEntry* _tmp0_ = NULL;
	GtkEntry* _tmp1_ = NULL;
	GtkEntry* _tmp2_ = NULL;
	GtkEntry* _tmp3_ = NULL;
	GtkComboBox* _tmp4_ = NULL;
	GtkListStore* _tmp5_ = NULL;
	GtkTreeView* _tmp6_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_entry_label;
	gtk_entry_set_text (_tmp0_, "");
	_tmp1_ = self->priv->_entry_desc;
	gtk_entry_set_text (_tmp1_, "");
	_tmp2_ = self->priv->_entry_extensions;
	gtk_entry_set_text (_tmp2_, "");
	_tmp3_ = self->priv->_entry_files_to_open;
	gtk_entry_set_text (_tmp3_, "");
	_tmp4_ = self->priv->_icons_combobox;
	gtk_combo_box_set_active (_tmp4_, 0);
	_tmp5_ = self->priv->_jobs_store;
	gtk_list_store_clear (_tmp5_);
	_tmp6_ = self->priv->_jobs_view;
	gtk_tree_view_columns_autosize (_tmp6_);
}


static void build_tool_dialog_set_build_tool (BuildToolDialog* self, LatexilaBuildTool* build_tool) {
	gchar* _tmp0_ = NULL;
	LatexilaBuildTool* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	GtkEntry* _tmp5_ = NULL;
	const gchar* _tmp6_ = NULL;
	LatexilaBuildTool* _tmp7_ = NULL;
	const gchar* _tmp8_ = NULL;
	GtkEntry* _tmp9_ = NULL;
	gchar* _tmp10_ = NULL;
	LatexilaBuildTool* _tmp11_ = NULL;
	gchar* _tmp12_ = NULL;
	gchar* _tmp13_ = NULL;
	GtkEntry* _tmp15_ = NULL;
	gchar* _tmp16_ = NULL;
	LatexilaBuildTool* _tmp17_ = NULL;
	gchar* _tmp18_ = NULL;
	gchar* _tmp19_ = NULL;
	GtkEntry* _tmp21_ = NULL;
	GtkComboBox* _tmp22_ = NULL;
	GtkTreeIter iter = {0};
	gboolean ok = FALSE;
	GtkListStore* _tmp23_ = NULL;
	GtkTreeIter _tmp24_ = {0};
	gboolean _tmp25_ = FALSE;
	gboolean _tmp26_ = FALSE;
	GtkTreeModel* model = NULL;
	GtkListStore* _tmp27_ = NULL;
	GtkTreeModel* _tmp28_ = NULL;
	GtkListStore* _tmp42_ = NULL;
	LatexilaBuildTool* _tmp43_ = NULL;
	GList* _tmp44_ = NULL;
	GtkTreeView* _tmp47_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (build_tool != NULL);
	_tmp1_ = build_tool;
	g_object_get (_tmp1_, "label", &_tmp2_, NULL);
	_tmp3_ = _tmp2_;
	_tmp0_ = _tmp3_;
	if (_tmp0_ == NULL) {
		gchar* _tmp4_ = NULL;
		_tmp4_ = g_strdup ("");
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp4_;
	}
	_tmp5_ = self->priv->_entry_label;
	gtk_entry_set_text (_tmp5_, _tmp0_);
	_tmp7_ = build_tool;
	_tmp8_ = latexila_build_tool_get_description (_tmp7_);
	_tmp6_ = _tmp8_;
	if (_tmp6_ == NULL) {
		_tmp6_ = "";
	}
	_tmp9_ = self->priv->_entry_desc;
	gtk_entry_set_text (_tmp9_, _tmp6_);
	_tmp11_ = build_tool;
	g_object_get (_tmp11_, "extensions", &_tmp12_, NULL);
	_tmp13_ = _tmp12_;
	_tmp10_ = _tmp13_;
	if (_tmp10_ == NULL) {
		gchar* _tmp14_ = NULL;
		_tmp14_ = g_strdup ("");
		_g_free0 (_tmp10_);
		_tmp10_ = _tmp14_;
	}
	_tmp15_ = self->priv->_entry_extensions;
	gtk_entry_set_text (_tmp15_, _tmp10_);
	_tmp17_ = build_tool;
	g_object_get (_tmp17_, "files-to-open", &_tmp18_, NULL);
	_tmp19_ = _tmp18_;
	_tmp16_ = _tmp19_;
	if (_tmp16_ == NULL) {
		gchar* _tmp20_ = NULL;
		_tmp20_ = g_strdup ("");
		_g_free0 (_tmp16_);
		_tmp16_ = _tmp20_;
	}
	_tmp21_ = self->priv->_entry_files_to_open;
	gtk_entry_set_text (_tmp21_, _tmp16_);
	_tmp22_ = self->priv->_icons_combobox;
	gtk_combo_box_set_active (_tmp22_, 0);
	_tmp23_ = self->priv->_icons_store;
	_tmp25_ = gtk_tree_model_get_iter_first ((GtkTreeModel*) _tmp23_, &_tmp24_);
	iter = _tmp24_;
	ok = _tmp25_;
	_tmp26_ = ok;
	g_return_if_fail (_tmp26_);
	_tmp27_ = self->priv->_icons_store;
	_tmp28_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp27_, GTK_TYPE_TREE_MODEL) ? ((GtkTreeModel*) _tmp27_) : NULL);
	model = _tmp28_;
	{
		gboolean _tmp29_ = FALSE;
		_tmp29_ = TRUE;
		while (TRUE) {
			gchar* icon_name = NULL;
			GtkTreeModel* _tmp32_ = NULL;
			GtkTreeIter _tmp33_ = {0};
			const gchar* _tmp34_ = NULL;
			LatexilaBuildTool* _tmp35_ = NULL;
			gchar* _tmp36_ = NULL;
			gchar* _tmp37_ = NULL;
			gchar* _tmp38_ = NULL;
			gboolean _tmp39_ = FALSE;
			if (!_tmp29_) {
				GtkListStore* _tmp30_ = NULL;
				gboolean _tmp31_ = FALSE;
				_tmp30_ = self->priv->_icons_store;
				_tmp31_ = gtk_tree_model_iter_next ((GtkTreeModel*) _tmp30_, &iter);
				if (!_tmp31_) {
					break;
				}
			}
			_tmp29_ = FALSE;
			_tmp32_ = model;
			_tmp33_ = iter;
			gtk_tree_model_get (_tmp32_, &_tmp33_, BUILD_TOOL_DIALOG_ICON_COLUMN_ICON_NAME, &icon_name, -1);
			_tmp34_ = icon_name;
			_tmp35_ = build_tool;
			g_object_get (_tmp35_, "icon", &_tmp36_, NULL);
			_tmp37_ = _tmp36_;
			_tmp38_ = _tmp37_;
			_tmp39_ = g_strcmp0 (_tmp34_, _tmp38_) == 0;
			_g_free0 (_tmp38_);
			if (_tmp39_) {
				GtkComboBox* _tmp40_ = NULL;
				GtkTreeIter _tmp41_ = {0};
				_tmp40_ = self->priv->_icons_combobox;
				_tmp41_ = iter;
				gtk_combo_box_set_active_iter (_tmp40_, &_tmp41_);
				_g_free0 (icon_name);
				break;
			}
			_g_free0 (icon_name);
		}
	}
	_tmp42_ = self->priv->_jobs_store;
	gtk_list_store_clear (_tmp42_);
	_tmp43_ = build_tool;
	_tmp44_ = latexila_build_tool_get_jobs (_tmp43_);
	{
		GList* build_job_collection = NULL;
		GList* build_job_it = NULL;
		build_job_collection = _tmp44_;
		for (build_job_it = build_job_collection; build_job_it != NULL; build_job_it = build_job_it->next) {
			LatexilaBuildJob* _tmp45_ = NULL;
			LatexilaBuildJob* build_job = NULL;
			_tmp45_ = _g_object_ref0 ((LatexilaBuildJob*) build_job_it->data);
			build_job = _tmp45_;
			{
				LatexilaBuildJob* _tmp46_ = NULL;
				_tmp46_ = build_job;
				build_tool_dialog_add_build_job (self, _tmp46_);
				_g_object_unref0 (build_job);
			}
		}
	}
	_tmp47_ = self->priv->_jobs_view;
	gtk_tree_view_columns_autosize (_tmp47_);
	_g_object_unref0 (model);
	_g_free0 (_tmp16_);
	_g_free0 (_tmp10_);
	_g_free0 (_tmp0_);
}


static gchar* string_strip (const gchar* self) {
	gchar* result = NULL;
	gchar* _result_ = NULL;
	gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup (self);
	_result_ = _tmp0_;
	_tmp1_ = _result_;
	g_strstrip (_tmp1_);
	result = _result_;
	return result;
}


static LatexilaBuildTool* build_tool_dialog_retrieve_build_tool (BuildToolDialog* self) {
	LatexilaBuildTool* result = NULL;
	LatexilaBuildTool* tool = NULL;
	LatexilaBuildTool* _tmp0_ = NULL;
	LatexilaBuildTool* _tmp1_ = NULL;
	GtkEntry* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	const gchar* _tmp4_ = NULL;
	gchar* _tmp5_ = NULL;
	gchar* _tmp6_ = NULL;
	LatexilaBuildTool* _tmp7_ = NULL;
	GtkEntry* _tmp8_ = NULL;
	const gchar* _tmp9_ = NULL;
	const gchar* _tmp10_ = NULL;
	gchar* _tmp11_ = NULL;
	gchar* _tmp12_ = NULL;
	LatexilaBuildTool* _tmp13_ = NULL;
	GtkEntry* _tmp14_ = NULL;
	const gchar* _tmp15_ = NULL;
	const gchar* _tmp16_ = NULL;
	gchar* _tmp17_ = NULL;
	gchar* _tmp18_ = NULL;
	LatexilaBuildTool* _tmp19_ = NULL;
	GtkEntry* _tmp20_ = NULL;
	const gchar* _tmp21_ = NULL;
	const gchar* _tmp22_ = NULL;
	gchar* _tmp23_ = NULL;
	gchar* _tmp24_ = NULL;
	GtkTreeIter iter = {0};
	GtkComboBox* _tmp25_ = NULL;
	GtkTreeIter _tmp26_ = {0};
	GtkTreeModel* model = NULL;
	GtkListStore* _tmp27_ = NULL;
	GtkTreeModel* _tmp28_ = NULL;
	gchar* icon_name = NULL;
	GtkTreeModel* _tmp29_ = NULL;
	GtkTreeIter _tmp30_ = {0};
	LatexilaBuildTool* _tmp31_ = NULL;
	const gchar* _tmp32_ = NULL;
	GtkListStore* _tmp33_ = NULL;
	GtkTreeModel* _tmp34_ = NULL;
	gboolean valid = FALSE;
	GtkListStore* _tmp35_ = NULL;
	GtkTreeIter _tmp36_ = {0};
	gboolean _tmp37_ = FALSE;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = latexila_build_tool_new ();
	tool = _tmp0_;
	_tmp1_ = tool;
	_tmp2_ = self->priv->_entry_label;
	_tmp3_ = gtk_entry_get_text (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = string_strip (_tmp4_);
	_tmp6_ = _tmp5_;
	g_object_set (_tmp1_, "label", _tmp6_, NULL);
	_g_free0 (_tmp6_);
	_tmp7_ = tool;
	_tmp8_ = self->priv->_entry_desc;
	_tmp9_ = gtk_entry_get_text (_tmp8_);
	_tmp10_ = _tmp9_;
	_tmp11_ = string_strip (_tmp10_);
	_tmp12_ = _tmp11_;
	g_object_set (_tmp7_, "description", _tmp12_, NULL);
	_g_free0 (_tmp12_);
	_tmp13_ = tool;
	_tmp14_ = self->priv->_entry_extensions;
	_tmp15_ = gtk_entry_get_text (_tmp14_);
	_tmp16_ = _tmp15_;
	_tmp17_ = string_strip (_tmp16_);
	_tmp18_ = _tmp17_;
	g_object_set (_tmp13_, "extensions", _tmp18_, NULL);
	_g_free0 (_tmp18_);
	_tmp19_ = tool;
	_tmp20_ = self->priv->_entry_files_to_open;
	_tmp21_ = gtk_entry_get_text (_tmp20_);
	_tmp22_ = _tmp21_;
	_tmp23_ = string_strip (_tmp22_);
	_tmp24_ = _tmp23_;
	g_object_set (_tmp19_, "files-to-open", _tmp24_, NULL);
	_g_free0 (_tmp24_);
	_tmp25_ = self->priv->_icons_combobox;
	gtk_combo_box_get_active_iter (_tmp25_, &_tmp26_);
	iter = _tmp26_;
	_tmp27_ = self->priv->_icons_store;
	_tmp28_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp27_, GTK_TYPE_TREE_MODEL) ? ((GtkTreeModel*) _tmp27_) : NULL);
	model = _tmp28_;
	_tmp29_ = model;
	_tmp30_ = iter;
	gtk_tree_model_get (_tmp29_, &_tmp30_, BUILD_TOOL_DIALOG_ICON_COLUMN_ICON_NAME, &icon_name, -1);
	_tmp31_ = tool;
	_tmp32_ = icon_name;
	g_object_set (_tmp31_, "icon", _tmp32_, NULL);
	_tmp33_ = self->priv->_jobs_store;
	_tmp34_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp33_, GTK_TYPE_TREE_MODEL) ? ((GtkTreeModel*) _tmp33_) : NULL);
	_g_object_unref0 (model);
	model = _tmp34_;
	_tmp35_ = self->priv->_jobs_store;
	_tmp37_ = gtk_tree_model_get_iter_first ((GtkTreeModel*) _tmp35_, &_tmp36_);
	iter = _tmp36_;
	valid = _tmp37_;
	while (TRUE) {
		gboolean _tmp38_ = FALSE;
		LatexilaBuildJob* job = NULL;
		LatexilaBuildJob* _tmp39_ = NULL;
		gchar* command = NULL;
		gchar* post_processor_name = NULL;
		GtkTreeModel* _tmp40_ = NULL;
		GtkTreeIter _tmp41_ = {0};
		LatexilaBuildJob* _tmp42_ = NULL;
		const gchar* _tmp43_ = NULL;
		gchar* _tmp44_ = NULL;
		gchar* _tmp45_ = NULL;
		LatexilaPostProcessorType type = 0;
		const gchar* _tmp46_ = NULL;
		LatexilaPostProcessorType _tmp47_ = 0;
		gboolean _tmp48_ = FALSE;
		LatexilaBuildTool* _tmp51_ = NULL;
		LatexilaBuildJob* _tmp52_ = NULL;
		GtkListStore* _tmp53_ = NULL;
		gboolean _tmp54_ = FALSE;
		_tmp38_ = valid;
		if (!_tmp38_) {
			break;
		}
		_tmp39_ = latexila_build_job_new ();
		job = _tmp39_;
		_tmp40_ = model;
		_tmp41_ = iter;
		gtk_tree_model_get (_tmp40_, &_tmp41_, BUILD_TOOL_DIALOG_JOB_COLUMN_COMMAND, &command, BUILD_TOOL_DIALOG_JOB_COLUMN_POST_PROCESSOR, &post_processor_name, -1);
		_tmp42_ = job;
		_tmp43_ = command;
		_tmp44_ = string_strip (_tmp43_);
		_tmp45_ = _tmp44_;
		g_object_set (_tmp42_, "command", _tmp45_, NULL);
		_g_free0 (_tmp45_);
		_tmp46_ = post_processor_name;
		_tmp48_ = latexila_post_processor_get_type_from_name (_tmp46_, &_tmp47_);
		type = _tmp47_;
		if (_tmp48_) {
			LatexilaBuildJob* _tmp49_ = NULL;
			LatexilaPostProcessorType _tmp50_ = 0;
			_tmp49_ = job;
			_tmp50_ = type;
			g_object_set (_tmp49_, "post-processor-type", _tmp50_, NULL);
		}
		_tmp51_ = tool;
		_tmp52_ = job;
		latexila_build_tool_add_job (_tmp51_, _tmp52_);
		_tmp53_ = self->priv->_jobs_store;
		_tmp54_ = gtk_tree_model_iter_next ((GtkTreeModel*) _tmp53_, &iter);
		valid = _tmp54_;
		_g_free0 (post_processor_name);
		_g_free0 (command);
		_g_object_unref0 (job);
	}
	result = tool;
	_g_free0 (icon_name);
	_g_object_unref0 (model);
	return result;
}


/*************************************************************************/
static void build_tool_dialog_add_build_job (BuildToolDialog* self, LatexilaBuildJob* job) {
	gchar* post_processor_name = NULL;
	LatexilaBuildJob* _tmp0_ = NULL;
	LatexilaPostProcessorType _tmp1_ = 0;
	LatexilaPostProcessorType _tmp2_ = 0;
	const gchar* _tmp3_ = NULL;
	gchar* _tmp4_ = NULL;
	GtkTreeIter iter = {0};
	GtkListStore* _tmp5_ = NULL;
	GtkTreeIter _tmp6_ = {0};
	GtkListStore* _tmp7_ = NULL;
	GtkTreeIter _tmp8_ = {0};
	LatexilaBuildJob* _tmp9_ = NULL;
	gchar* _tmp10_ = NULL;
	gchar* _tmp11_ = NULL;
	gchar* _tmp12_ = NULL;
	GtkTreeSelection* select = NULL;
	GtkTreeView* _tmp13_ = NULL;
	GtkTreeSelection* _tmp14_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (job != NULL);
	_tmp0_ = job;
	g_object_get (_tmp0_, "post-processor-type", &_tmp1_, NULL);
	_tmp2_ = _tmp1_;
	_tmp3_ = latexila_post_processor_get_name_from_type (_tmp2_);
	_tmp4_ = g_strdup (_tmp3_);
	post_processor_name = _tmp4_;
	_tmp5_ = self->priv->_jobs_store;
	gtk_list_store_append (_tmp5_, &_tmp6_);
	iter = _tmp6_;
	_tmp7_ = self->priv->_jobs_store;
	_tmp8_ = iter;
	_tmp9_ = job;
	g_object_get (_tmp9_, "command", &_tmp10_, NULL);
	_tmp11_ = _tmp10_;
	_tmp12_ = _tmp11_;
	gtk_list_store_set (_tmp7_, &_tmp8_, BUILD_TOOL_DIALOG_JOB_COLUMN_COMMAND, _tmp12_, BUILD_TOOL_DIALOG_JOB_COLUMN_POST_PROCESSOR, post_processor_name, -1);
	_g_free0 (_tmp12_);
	_tmp13_ = self->priv->_jobs_view;
	_tmp14_ = gtk_tree_view_get_selection (_tmp13_);
	select = _tmp14_;
	g_signal_emit_by_name (select, "changed");
	_g_free0 (post_processor_name);
}


/*************************************************************************/
static GtkGrid* build_tool_dialog_get_main_grid (BuildToolDialog* self, gboolean editable) {
	GtkGrid* result = NULL;
	GtkGrid* main_grid = NULL;
	GtkGrid* _tmp0_ = NULL;
	GtkGrid* _tmp1_ = NULL;
	GtkGrid* _tmp2_ = NULL;
	GtkWidget* _tmp3_ = NULL;
	GtkWidget* _tmp4_ = NULL;
	GtkWidget* _tmp5_ = NULL;
	GtkWidget* _tmp6_ = NULL;
	GtkWidget* _tmp7_ = NULL;
	GtkWidget* _tmp8_ = NULL;
	gboolean _tmp9_ = FALSE;
	GtkWidget* _tmp10_ = NULL;
	GtkWidget* _tmp11_ = NULL;
	GtkWidget* _tmp12_ = NULL;
	GtkWidget* _tmp13_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp0_);
	main_grid = _tmp0_;
	gtk_grid_set_row_spacing (main_grid, (guint) 5);
	gtk_grid_set_column_spacing (main_grid, (guint) 5);
	_tmp1_ = build_tool_dialog_get_label_grid (self);
	_tmp2_ = _tmp1_;
	gtk_grid_attach (main_grid, (GtkWidget*) _tmp2_, 0, 0, 1, 1);
	_g_object_unref0 (_tmp2_);
	_tmp3_ = build_tool_dialog_get_desc_grid (self);
	_tmp4_ = _tmp3_;
	gtk_grid_attach (main_grid, _tmp4_, 1, 0, 1, 1);
	_g_object_unref0 (_tmp4_);
	_tmp5_ = build_tool_dialog_get_extensions_grid (self);
	_tmp6_ = _tmp5_;
	gtk_grid_attach (main_grid, _tmp6_, 0, 1, 1, 1);
	_g_object_unref0 (_tmp6_);
	_tmp7_ = build_tool_dialog_get_icons_grid (self);
	_tmp8_ = _tmp7_;
	gtk_grid_attach (main_grid, _tmp8_, 1, 1, 1, 1);
	_g_object_unref0 (_tmp8_);
	_tmp9_ = editable;
	_tmp10_ = build_tool_dialog_get_jobs_grid (self, _tmp9_);
	_tmp11_ = _tmp10_;
	gtk_grid_attach (main_grid, _tmp11_, 0, 2, 2, 1);
	_g_object_unref0 (_tmp11_);
	_tmp12_ = build_tool_dialog_get_files_to_open_grid (self);
	_tmp13_ = _tmp12_;
	gtk_grid_attach (main_grid, _tmp13_, 0, 3, 2, 1);
	_g_object_unref0 (_tmp13_);
	result = main_grid;
	return result;
}


static GtkGrid* build_tool_dialog_get_label_grid (BuildToolDialog* self) {
	GtkGrid* result = NULL;
	GtkGrid* grid = NULL;
	GtkGrid* _tmp0_ = NULL;
	GtkLabel* title = NULL;
	GtkLabel* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	gchar* _tmp4_ = NULL;
	gchar* _tmp5_ = NULL;
	gchar* _tmp6_ = NULL;
	GtkLabel* arrow = NULL;
	GtkLabel* _tmp7_ = NULL;
	const gchar* _tmp8_ = NULL;
	GtkEntry* _tmp9_ = NULL;
	GtkEntry* _tmp10_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp0_);
	grid = _tmp0_;
	gtk_grid_set_row_spacing (grid, (guint) 6);
	gtk_container_set_border_width ((GtkContainer*) grid, (guint) 6);
	_tmp1_ = (GtkLabel*) gtk_label_new (NULL);
	g_object_ref_sink (_tmp1_);
	title = _tmp1_;
	_tmp2_ = _ ("Label");
	_tmp3_ = g_strconcat ("<b>", _tmp2_, NULL);
	_tmp4_ = _tmp3_;
	_tmp5_ = g_strconcat (_tmp4_, "</b>", NULL);
	_tmp6_ = _tmp5_;
	gtk_label_set_markup (title, _tmp6_);
	_g_free0 (_tmp6_);
	_g_free0 (_tmp4_);
	gtk_widget_set_halign ((GtkWidget*) title, GTK_ALIGN_START);
	gtk_grid_attach (grid, (GtkWidget*) title, 0, 0, 1, 1);
	_tmp7_ = (GtkLabel*) gtk_label_new ("→");
	g_object_ref_sink (_tmp7_);
	arrow = _tmp7_;
	_tmp8_ = _ ("You can select this arrow and copy/paste it!");
	gtk_widget_set_tooltip_text ((GtkWidget*) arrow, _tmp8_);
	gtk_widget_set_halign ((GtkWidget*) arrow, GTK_ALIGN_CENTER);
	gtk_widget_set_hexpand ((GtkWidget*) arrow, TRUE);
	gtk_label_set_selectable (arrow, TRUE);
	gtk_grid_attach (grid, (GtkWidget*) arrow, 1, 0, 1, 1);
	gtk_widget_set_hexpand ((GtkWidget*) grid, FALSE);
	_tmp9_ = self->priv->_entry_label;
	gtk_widget_set_margin_start ((GtkWidget*) _tmp9_, 12);
	_tmp10_ = self->priv->_entry_label;
	gtk_grid_attach (grid, (GtkWidget*) _tmp10_, 0, 1, 2, 1);
	result = grid;
	_g_object_unref0 (arrow);
	_g_object_unref0 (title);
	return result;
}


static GtkWidget* build_tool_dialog_get_desc_grid (BuildToolDialog* self) {
	GtkWidget* result = NULL;
	GtkEntry* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	GtkEntry* _tmp2_ = NULL;
	GtkWidget* _tmp3_ = NULL;
	GtkWidget* _tmp4_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_entry_desc;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp0_, TRUE);
	_tmp1_ = _ ("Description");
	_tmp2_ = self->priv->_entry_desc;
	_tmp3_ = latexila_utils_get_dialog_component (_tmp1_, (GtkWidget*) _tmp2_);
	_tmp4_ = _g_object_ref0 (_tmp3_);
	result = _tmp4_;
	return result;
}


static GtkWidget* build_tool_dialog_get_extensions_grid (BuildToolDialog* self) {
	GtkWidget* result = NULL;
	GtkEntry* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	const gchar* _tmp4_ = NULL;
	gchar* _tmp5_ = NULL;
	gchar* _tmp6_ = NULL;
	gchar* _tmp7_ = NULL;
	gchar* _tmp8_ = NULL;
	const gchar* _tmp9_ = NULL;
	gchar* _tmp10_ = NULL;
	gchar* _tmp11_ = NULL;
	const gchar* _tmp12_ = NULL;
	GtkEntry* _tmp13_ = NULL;
	GtkWidget* _tmp14_ = NULL;
	GtkWidget* _tmp15_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_entry_extensions;
	_tmp1_ = _ ("File extensions for which the build tool can be executed.");
	_tmp2_ = g_strconcat (_tmp1_, "\n", NULL);
	_tmp3_ = _tmp2_;
	_tmp4_ = _ ("The extensions are separated by spaces.");
	_tmp5_ = g_strconcat (_tmp3_, _tmp4_, NULL);
	_tmp6_ = _tmp5_;
	_tmp7_ = g_strconcat (_tmp6_, "\n", NULL);
	_tmp8_ = _tmp7_;
	_tmp9_ = _ ("If it is empty, all extensions are allowed.");
	_tmp10_ = g_strconcat (_tmp8_, _tmp9_, NULL);
	_tmp11_ = _tmp10_;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp0_, _tmp11_);
	_g_free0 (_tmp11_);
	_g_free0 (_tmp8_);
	_g_free0 (_tmp6_);
	_g_free0 (_tmp3_);
	_tmp12_ = _ ("Extensions");
	_tmp13_ = self->priv->_entry_extensions;
	_tmp14_ = latexila_utils_get_dialog_component (_tmp12_, (GtkWidget*) _tmp13_);
	_tmp15_ = _g_object_ref0 (_tmp14_);
	result = _tmp15_;
	return result;
}


static GtkWidget* build_tool_dialog_get_icons_grid (BuildToolDialog* self) {
	GtkWidget* result = NULL;
	const gchar* _tmp0_ = NULL;
	GtkComboBox* _tmp1_ = NULL;
	GtkWidget* _tmp2_ = NULL;
	GtkWidget* _tmp3_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = _ ("Icon");
	_tmp1_ = self->priv->_icons_combobox;
	_tmp2_ = latexila_utils_get_dialog_component (_tmp0_, (GtkWidget*) _tmp1_);
	_tmp3_ = _g_object_ref0 (_tmp2_);
	result = _tmp3_;
	return result;
}


static GtkWidget* build_tool_dialog_get_jobs_grid (BuildToolDialog* self, gboolean editable) {
	GtkWidget* result = NULL;
	GtkLabel* placeholders = NULL;
	const gchar* _tmp0_ = NULL;
	GtkLabel* _tmp1_ = NULL;
	GtkLabel* placeholder_filename = NULL;
	GtkLabel* _tmp2_ = NULL;
	GtkLabel* _tmp3_ = NULL;
	const gchar* _tmp4_ = NULL;
	gchar* _tmp5_ = NULL;
	gchar* _tmp6_ = NULL;
	const gchar* _tmp7_ = NULL;
	gchar* _tmp8_ = NULL;
	gchar* _tmp9_ = NULL;
	GtkLabel* placeholder_shortname = NULL;
	GtkLabel* _tmp10_ = NULL;
	GtkLabel* _tmp11_ = NULL;
	const gchar* _tmp12_ = NULL;
	gchar* _tmp13_ = NULL;
	gchar* _tmp14_ = NULL;
	const gchar* _tmp15_ = NULL;
	gchar* _tmp16_ = NULL;
	gchar* _tmp17_ = NULL;
	GtkGrid* placeholders_grid = NULL;
	GtkGrid* _tmp18_ = NULL;
	GtkGrid* _tmp19_ = NULL;
	GtkGrid* _tmp20_ = NULL;
	GtkGrid* _tmp21_ = NULL;
	GtkLabel* _tmp22_ = NULL;
	GtkGrid* _tmp23_ = NULL;
	GtkLabel* _tmp24_ = NULL;
	GtkGrid* _tmp25_ = NULL;
	GtkLabel* _tmp26_ = NULL;
	GtkTreeView* _tmp27_ = NULL;
	GtkScrolledWindow* scrolled_window = NULL;
	GtkTreeView* _tmp28_ = NULL;
	GtkScrolledWindow* _tmp29_ = NULL;
	GtkScrolledWindow* _tmp30_ = NULL;
	GtkScrolledWindow* _tmp31_ = NULL;
	GtkBox* jobs_box = NULL;
	GtkBox* _tmp32_ = NULL;
	GtkGrid* _tmp33_ = NULL;
	GtkBox* _tmp34_ = NULL;
	GtkGrid* _tmp35_ = NULL;
	GtkBox* _tmp36_ = NULL;
	GtkScrolledWindow* _tmp37_ = NULL;
	gboolean _tmp38_ = FALSE;
	const gchar* _tmp65_ = NULL;
	GtkBox* _tmp66_ = NULL;
	GtkWidget* _tmp67_ = NULL;
	GtkWidget* _tmp68_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = _ ("Placeholders:");
	_tmp1_ = (GtkLabel*) gtk_label_new (_tmp0_);
	g_object_ref_sink (_tmp1_);
	placeholders = _tmp1_;
	_tmp2_ = (GtkLabel*) gtk_label_new ("$filename");
	g_object_ref_sink (_tmp2_);
	placeholder_filename = _tmp2_;
	_tmp3_ = placeholder_filename;
	_tmp4_ = _ ("The active document's filename.");
	_tmp5_ = g_strconcat (_tmp4_, "\n", NULL);
	_tmp6_ = _tmp5_;
	_tmp7_ = _ ("If the active document belongs to a project, the main file is chosen.");
	_tmp8_ = g_strconcat (_tmp6_, _tmp7_, NULL);
	_tmp9_ = _tmp8_;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp3_, _tmp9_);
	_g_free0 (_tmp9_);
	_g_free0 (_tmp6_);
	_tmp10_ = (GtkLabel*) gtk_label_new ("$shortname");
	g_object_ref_sink (_tmp10_);
	placeholder_shortname = _tmp10_;
	_tmp11_ = placeholder_shortname;
	_tmp12_ = _ ("The active document's filename without its extension.");
	_tmp13_ = g_strconcat (_tmp12_, "\n", NULL);
	_tmp14_ = _tmp13_;
	_tmp15_ = _ ("If the active document belongs to a project, the main file is chosen.");
	_tmp16_ = g_strconcat (_tmp14_, _tmp15_, NULL);
	_tmp17_ = _tmp16_;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp11_, _tmp17_);
	_g_free0 (_tmp17_);
	_g_free0 (_tmp14_);
	_tmp18_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp18_);
	placeholders_grid = _tmp18_;
	_tmp19_ = placeholders_grid;
	gtk_orientable_set_orientation ((GtkOrientable*) _tmp19_, GTK_ORIENTATION_HORIZONTAL);
	_tmp20_ = placeholders_grid;
	gtk_grid_set_column_spacing (_tmp20_, (guint) 10);
	_tmp21_ = placeholders_grid;
	_tmp22_ = placeholders;
	gtk_container_add ((GtkContainer*) _tmp21_, (GtkWidget*) _tmp22_);
	_tmp23_ = placeholders_grid;
	_tmp24_ = placeholder_filename;
	gtk_container_add ((GtkContainer*) _tmp23_, (GtkWidget*) _tmp24_);
	_tmp25_ = placeholders_grid;
	_tmp26_ = placeholder_shortname;
	gtk_container_add ((GtkContainer*) _tmp25_, (GtkWidget*) _tmp26_);
	_tmp27_ = self->priv->_jobs_view;
	g_object_set ((GtkWidget*) _tmp27_, "expand", TRUE, NULL);
	_tmp28_ = self->priv->_jobs_view;
	_tmp29_ = utils_add_scrollbar ((GtkWidget*) _tmp28_);
	scrolled_window = _tmp29_;
	_tmp30_ = scrolled_window;
	gtk_widget_set_size_request ((GtkWidget*) _tmp30_, 600, 120);
	_tmp31_ = scrolled_window;
	gtk_scrolled_window_set_shadow_type (_tmp31_, GTK_SHADOW_IN);
	_tmp32_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	g_object_ref_sink (_tmp32_);
	jobs_box = _tmp32_;
	_tmp33_ = placeholders_grid;
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp33_, 8);
	_tmp34_ = jobs_box;
	_tmp35_ = placeholders_grid;
	gtk_box_pack_start (_tmp34_, (GtkWidget*) _tmp35_, FALSE, TRUE, (guint) 0);
	_tmp36_ = jobs_box;
	_tmp37_ = scrolled_window;
	gtk_box_pack_start (_tmp36_, (GtkWidget*) _tmp37_, TRUE, TRUE, (guint) 0);
	_tmp38_ = editable;
	if (_tmp38_) {
		GtkToolbar* toolbar = NULL;
		GtkToolbar* _tmp39_ = NULL;
		GtkToolbar* _tmp40_ = NULL;
		GtkToolButton* _tmp41_ = NULL;
		GtkToolButton* _tmp42_ = NULL;
		GtkToolbar* _tmp43_ = NULL;
		GtkToolButton* _tmp44_ = NULL;
		GtkToolButton* _tmp45_ = NULL;
		GtkToolbar* _tmp46_ = NULL;
		GtkToolButton* _tmp47_ = NULL;
		GtkToolButton* _tmp48_ = NULL;
		GtkToolbar* _tmp49_ = NULL;
		GtkToolButton* _tmp50_ = NULL;
		GtkToolButton* _tmp51_ = NULL;
		GtkToolbar* _tmp52_ = NULL;
		GtkToolbar* _tmp53_ = NULL;
		GtkBox* _tmp54_ = NULL;
		GtkToolbar* _tmp55_ = NULL;
		GtkStyleContext* context = NULL;
		GtkScrolledWindow* _tmp56_ = NULL;
		GtkStyleContext* _tmp57_ = NULL;
		GtkStyleContext* _tmp58_ = NULL;
		GtkStyleContext* _tmp59_ = NULL;
		GtkToolbar* _tmp60_ = NULL;
		GtkStyleContext* _tmp61_ = NULL;
		GtkStyleContext* _tmp62_ = NULL;
		GtkStyleContext* _tmp63_ = NULL;
		GtkStyleContext* _tmp64_ = NULL;
		_tmp39_ = (GtkToolbar*) gtk_toolbar_new ();
		g_object_ref_sink (_tmp39_);
		toolbar = _tmp39_;
		_tmp40_ = toolbar;
		_tmp41_ = build_tool_dialog_get_add_button (self);
		_tmp42_ = _tmp41_;
		gtk_toolbar_insert (_tmp40_, (GtkToolItem*) _tmp42_, -1);
		_g_object_unref0 (_tmp42_);
		_tmp43_ = toolbar;
		_tmp44_ = build_tool_dialog_get_remove_button (self);
		_tmp45_ = _tmp44_;
		gtk_toolbar_insert (_tmp43_, (GtkToolItem*) _tmp45_, -1);
		_g_object_unref0 (_tmp45_);
		_tmp46_ = toolbar;
		_tmp47_ = build_tool_dialog_get_up_button (self);
		_tmp48_ = _tmp47_;
		gtk_toolbar_insert (_tmp46_, (GtkToolItem*) _tmp48_, -1);
		_g_object_unref0 (_tmp48_);
		_tmp49_ = toolbar;
		_tmp50_ = build_tool_dialog_get_down_button (self);
		_tmp51_ = _tmp50_;
		gtk_toolbar_insert (_tmp49_, (GtkToolItem*) _tmp51_, -1);
		_g_object_unref0 (_tmp51_);
		_tmp52_ = toolbar;
		gtk_toolbar_set_icon_size (_tmp52_, GTK_ICON_SIZE_MENU);
		_tmp53_ = toolbar;
		gtk_toolbar_set_style (_tmp53_, GTK_TOOLBAR_ICONS);
		_tmp54_ = jobs_box;
		_tmp55_ = toolbar;
		gtk_box_pack_start (_tmp54_, (GtkWidget*) _tmp55_, FALSE, TRUE, (guint) 0);
		_tmp56_ = scrolled_window;
		_tmp57_ = gtk_widget_get_style_context ((GtkWidget*) _tmp56_);
		_tmp58_ = _g_object_ref0 (_tmp57_);
		context = _tmp58_;
		_tmp59_ = context;
		gtk_style_context_set_junction_sides (_tmp59_, GTK_JUNCTION_BOTTOM);
		_tmp60_ = toolbar;
		_tmp61_ = gtk_widget_get_style_context ((GtkWidget*) _tmp60_);
		_tmp62_ = _g_object_ref0 (_tmp61_);
		_g_object_unref0 (context);
		context = _tmp62_;
		_tmp63_ = context;
		gtk_style_context_add_class (_tmp63_, GTK_STYLE_CLASS_INLINE_TOOLBAR);
		_tmp64_ = context;
		gtk_style_context_set_junction_sides (_tmp64_, GTK_JUNCTION_TOP);
		_g_object_unref0 (context);
		_g_object_unref0 (toolbar);
	}
	_tmp65_ = _ ("Jobs");
	_tmp66_ = jobs_box;
	_tmp67_ = latexila_utils_get_dialog_component (_tmp65_, (GtkWidget*) _tmp66_);
	_tmp68_ = _g_object_ref0 (_tmp67_);
	result = _tmp68_;
	_g_object_unref0 (jobs_box);
	_g_object_unref0 (scrolled_window);
	_g_object_unref0 (placeholders_grid);
	_g_object_unref0 (placeholder_shortname);
	_g_object_unref0 (placeholder_filename);
	_g_object_unref0 (placeholders);
	return result;
}


static GtkWidget* build_tool_dialog_get_files_to_open_grid (BuildToolDialog* self) {
	GtkWidget* result = NULL;
	GtkEntry* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	const gchar* _tmp4_ = NULL;
	gchar* _tmp5_ = NULL;
	gchar* _tmp6_ = NULL;
	gchar* _tmp7_ = NULL;
	gchar* _tmp8_ = NULL;
	const gchar* _tmp9_ = NULL;
	gchar* _tmp10_ = NULL;
	gchar* _tmp11_ = NULL;
	GtkEntry* _tmp12_ = NULL;
	const gchar* _tmp13_ = NULL;
	GtkEntry* _tmp14_ = NULL;
	GtkWidget* _tmp15_ = NULL;
	GtkWidget* _tmp16_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_entry_files_to_open;
	_tmp1_ = _ ("List of files to open after executing the build jobs.");
	_tmp2_ = g_strconcat (_tmp1_, "\n", NULL);
	_tmp3_ = _tmp2_;
	_tmp4_ = _ ("The files are separated by spaces.");
	_tmp5_ = g_strconcat (_tmp3_, _tmp4_, NULL);
	_tmp6_ = _tmp5_;
	_tmp7_ = g_strconcat (_tmp6_, "\n", NULL);
	_tmp8_ = _tmp7_;
	_tmp9_ = _ ("You should use the placeholders to specify the files.");
	_tmp10_ = g_strconcat (_tmp8_, _tmp9_, NULL);
	_tmp11_ = _tmp10_;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp0_, _tmp11_);
	_g_free0 (_tmp11_);
	_g_free0 (_tmp8_);
	_g_free0 (_tmp6_);
	_g_free0 (_tmp3_);
	_tmp12_ = self->priv->_entry_files_to_open;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp12_, TRUE);
	_tmp13_ = _ ("Files to open");
	_tmp14_ = self->priv->_entry_files_to_open;
	_tmp15_ = latexila_utils_get_dialog_component (_tmp13_, (GtkWidget*) _tmp14_);
	_tmp16_ = _g_object_ref0 (_tmp15_);
	result = _tmp16_;
	return result;
}


static void build_tool_dialog_class_init (BuildToolDialogClass * klass) {
	build_tool_dialog_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (BuildToolDialogPrivate));
	G_OBJECT_CLASS (klass)->finalize = build_tool_dialog_finalize;
}


static void build_tool_dialog_instance_init (BuildToolDialog * self) {
	self->priv = BUILD_TOOL_DIALOG_GET_PRIVATE (self);
}


static void build_tool_dialog_finalize (GObject* obj) {
	BuildToolDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_BUILD_TOOL_DIALOG, BuildToolDialog);
	_g_object_unref0 (self->priv->_dialog);
	_g_object_unref0 (self->priv->_entry_label);
	_g_object_unref0 (self->priv->_entry_desc);
	_g_object_unref0 (self->priv->_entry_extensions);
	_g_object_unref0 (self->priv->_entry_files_to_open);
	_g_object_unref0 (self->priv->_icons_store);
	_g_object_unref0 (self->priv->_icons_combobox);
	_g_object_unref0 (self->priv->_jobs_store);
	_g_object_unref0 (self->priv->_jobs_view);
	G_OBJECT_CLASS (build_tool_dialog_parent_class)->finalize (obj);
}


GType build_tool_dialog_get_type (void) {
	static volatile gsize build_tool_dialog_type_id__volatile = 0;
	if (g_once_init_enter (&build_tool_dialog_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (BuildToolDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) build_tool_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BuildToolDialog), 0, (GInstanceInitFunc) build_tool_dialog_instance_init, NULL };
		GType build_tool_dialog_type_id;
		build_tool_dialog_type_id = g_type_register_static (G_TYPE_OBJECT, "BuildToolDialog", &g_define_type_info, 0);
		g_once_init_leave (&build_tool_dialog_type_id__volatile, build_tool_dialog_type_id);
	}
	return build_tool_dialog_type_id__volatile;
}



