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

/*
    MainWindow.vala
    Copyright (C) 2010-2011 Maia Kozheva <sikon@ubuntu.com>

    This program 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.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include <gtk/gtk.h>
#include <glib-object.h>
#include <gdk/gdk.h>
#include <gee.h>
#include "config.h"
#include <cairo-gobject.h>

#define STEADYFLOW_LICENSE "\n" \
"This program is free software: you can redistribute it and/or modify\n" \
"it under the terms of the GNU General Public License as published by\n" \
"the Free Software Foundation, either version 3 of the License, or\n" \
"(at your option) any later version.\n" \
"\n" \
"This program is distributed in the hope that it will be useful,\n" \
"but WITHOUT ANY WARRANTY; without even the implied warranty of\n" \
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n" \
"GNU General Public License for more details.\n" \
"\n" \
"You should have received a copy of the GNU General Public License\n" \
"along with this program.  If not, see <http://www.gnu.org/licenses/>.\n"
#define STEADYFLOW_X_GNOME_FULL_NAME _ ("Steadyflow Download Manager")
#define STEADYFLOW_UI_UI_UTIL_MESSAGE_FORMAT "<span weight='bold' size='larger'>%s</span>\n\n%s\n"
#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define STEADYFLOW_UI_TYPE_IGTK_BUILDER_CONTAINER (steadyflow_ui_igtk_builder_container_get_type ())
#define STEADYFLOW_UI_IGTK_BUILDER_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), STEADYFLOW_UI_TYPE_IGTK_BUILDER_CONTAINER, SteadyflowUIIGtkBuilderContainer))
#define STEADYFLOW_UI_IS_IGTK_BUILDER_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), STEADYFLOW_UI_TYPE_IGTK_BUILDER_CONTAINER))
#define STEADYFLOW_UI_IGTK_BUILDER_CONTAINER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), STEADYFLOW_UI_TYPE_IGTK_BUILDER_CONTAINER, SteadyflowUIIGtkBuilderContainerIface))

typedef struct _SteadyflowUIIGtkBuilderContainer SteadyflowUIIGtkBuilderContainer;
typedef struct _SteadyflowUIIGtkBuilderContainerIface SteadyflowUIIGtkBuilderContainerIface;

#define STEADYFLOW_UI_TYPE_GTK_BUILDER_WINDOW (steadyflow_ui_gtk_builder_window_get_type ())
#define STEADYFLOW_UI_GTK_BUILDER_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), STEADYFLOW_UI_TYPE_GTK_BUILDER_WINDOW, SteadyflowUIGtkBuilderWindow))
#define STEADYFLOW_UI_GTK_BUILDER_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), STEADYFLOW_UI_TYPE_GTK_BUILDER_WINDOW, SteadyflowUIGtkBuilderWindowClass))
#define STEADYFLOW_UI_IS_GTK_BUILDER_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), STEADYFLOW_UI_TYPE_GTK_BUILDER_WINDOW))
#define STEADYFLOW_UI_IS_GTK_BUILDER_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), STEADYFLOW_UI_TYPE_GTK_BUILDER_WINDOW))
#define STEADYFLOW_UI_GTK_BUILDER_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), STEADYFLOW_UI_TYPE_GTK_BUILDER_WINDOW, SteadyflowUIGtkBuilderWindowClass))

typedef struct _SteadyflowUIGtkBuilderWindow SteadyflowUIGtkBuilderWindow;
typedef struct _SteadyflowUIGtkBuilderWindowClass SteadyflowUIGtkBuilderWindowClass;
typedef struct _SteadyflowUIGtkBuilderWindowPrivate SteadyflowUIGtkBuilderWindowPrivate;

#define STEADYFLOW_TYPE_MAIN_WINDOW (steadyflow_main_window_get_type ())
#define STEADYFLOW_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), STEADYFLOW_TYPE_MAIN_WINDOW, SteadyflowMainWindow))
#define STEADYFLOW_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), STEADYFLOW_TYPE_MAIN_WINDOW, SteadyflowMainWindowClass))
#define STEADYFLOW_IS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), STEADYFLOW_TYPE_MAIN_WINDOW))
#define STEADYFLOW_IS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), STEADYFLOW_TYPE_MAIN_WINDOW))
#define STEADYFLOW_MAIN_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), STEADYFLOW_TYPE_MAIN_WINDOW, SteadyflowMainWindowClass))

typedef struct _SteadyflowMainWindow SteadyflowMainWindow;
typedef struct _SteadyflowMainWindowClass SteadyflowMainWindowClass;
typedef struct _SteadyflowMainWindowPrivate SteadyflowMainWindowPrivate;

#define STEADYFLOW_TYPE_INDICATOR_CONTROLLER (steadyflow_indicator_controller_get_type ())
#define STEADYFLOW_INDICATOR_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), STEADYFLOW_TYPE_INDICATOR_CONTROLLER, SteadyflowIndicatorController))
#define STEADYFLOW_INDICATOR_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), STEADYFLOW_TYPE_INDICATOR_CONTROLLER, SteadyflowIndicatorControllerClass))
#define STEADYFLOW_IS_INDICATOR_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), STEADYFLOW_TYPE_INDICATOR_CONTROLLER))
#define STEADYFLOW_IS_INDICATOR_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), STEADYFLOW_TYPE_INDICATOR_CONTROLLER))
#define STEADYFLOW_INDICATOR_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), STEADYFLOW_TYPE_INDICATOR_CONTROLLER, SteadyflowIndicatorControllerClass))

typedef struct _SteadyflowIndicatorController SteadyflowIndicatorController;
typedef struct _SteadyflowIndicatorControllerClass SteadyflowIndicatorControllerClass;

#define STEADYFLOW_TYPE_FILE_LIST_CONTROLLER (steadyflow_file_list_controller_get_type ())
#define STEADYFLOW_FILE_LIST_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), STEADYFLOW_TYPE_FILE_LIST_CONTROLLER, SteadyflowFileListController))
#define STEADYFLOW_FILE_LIST_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), STEADYFLOW_TYPE_FILE_LIST_CONTROLLER, SteadyflowFileListControllerClass))
#define STEADYFLOW_IS_FILE_LIST_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), STEADYFLOW_TYPE_FILE_LIST_CONTROLLER))
#define STEADYFLOW_IS_FILE_LIST_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), STEADYFLOW_TYPE_FILE_LIST_CONTROLLER))
#define STEADYFLOW_FILE_LIST_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), STEADYFLOW_TYPE_FILE_LIST_CONTROLLER, SteadyflowFileListControllerClass))

typedef struct _SteadyflowFileListController SteadyflowFileListController;
typedef struct _SteadyflowFileListControllerClass SteadyflowFileListControllerClass;
enum  {
	STEADYFLOW_MAIN_WINDOW_0_PROPERTY,
	STEADYFLOW_MAIN_WINDOW_NUM_PROPERTIES
};
static GParamSpec* steadyflow_main_window_properties[STEADYFLOW_MAIN_WINDOW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define STEADYFLOW_CORE_TYPE_ISETTINGS_SERVICE (steadyflow_core_isettings_service_get_type ())
#define STEADYFLOW_CORE_ISETTINGS_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), STEADYFLOW_CORE_TYPE_ISETTINGS_SERVICE, SteadyflowCoreISettingsService))
#define STEADYFLOW_CORE_IS_ISETTINGS_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), STEADYFLOW_CORE_TYPE_ISETTINGS_SERVICE))
#define STEADYFLOW_CORE_ISETTINGS_SERVICE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), STEADYFLOW_CORE_TYPE_ISETTINGS_SERVICE, SteadyflowCoreISettingsServiceIface))

typedef struct _SteadyflowCoreISettingsService SteadyflowCoreISettingsService;
typedef struct _SteadyflowCoreISettingsServiceIface SteadyflowCoreISettingsServiceIface;

#define STEADYFLOW_UI_TYPE_IINDICATOR_SERVICE (steadyflow_ui_iindicator_service_get_type ())
#define STEADYFLOW_UI_IINDICATOR_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), STEADYFLOW_UI_TYPE_IINDICATOR_SERVICE, SteadyflowUIIIndicatorService))
#define STEADYFLOW_UI_IS_IINDICATOR_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), STEADYFLOW_UI_TYPE_IINDICATOR_SERVICE))
#define STEADYFLOW_UI_IINDICATOR_SERVICE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), STEADYFLOW_UI_TYPE_IINDICATOR_SERVICE, SteadyflowUIIIndicatorServiceIface))

typedef struct _SteadyflowUIIIndicatorService SteadyflowUIIIndicatorService;
typedef struct _SteadyflowUIIIndicatorServiceIface SteadyflowUIIIndicatorServiceIface;

#define STEADYFLOW_CORE_TYPE_IDOWNLOAD_FILE (steadyflow_core_idownload_file_get_type ())
#define STEADYFLOW_CORE_IDOWNLOAD_FILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), STEADYFLOW_CORE_TYPE_IDOWNLOAD_FILE, SteadyflowCoreIDownloadFile))
#define STEADYFLOW_CORE_IS_IDOWNLOAD_FILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), STEADYFLOW_CORE_TYPE_IDOWNLOAD_FILE))
#define STEADYFLOW_CORE_IDOWNLOAD_FILE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), STEADYFLOW_CORE_TYPE_IDOWNLOAD_FILE, SteadyflowCoreIDownloadFileIface))

typedef struct _SteadyflowCoreIDownloadFile SteadyflowCoreIDownloadFile;
typedef struct _SteadyflowCoreIDownloadFileIface SteadyflowCoreIDownloadFileIface;
typedef enum  {
	STEADYFLOW_CORE_IDOWNLOAD_FILE_STATUS_CONNECTING = 0,
	STEADYFLOW_CORE_IDOWNLOAD_FILE_STATUS_DOWNLOADING,
	STEADYFLOW_CORE_IDOWNLOAD_FILE_STATUS_PAUSED,
	STEADYFLOW_CORE_IDOWNLOAD_FILE_STATUS_FINISHED,
	STEADYFLOW_CORE_IDOWNLOAD_FILE_STATUS_NETWORK_ERROR
} SteadyflowCoreIDownloadFileStatus;

#define STEADYFLOW_CORE_IDOWNLOAD_FILE_TYPE_STATUS (steadyflow_core_idownload_file_status_get_type ())
typedef enum  {
	STEADYFLOW_CORE_IDOWNLOAD_FILE_FINISH_ACTION_DO_NOTHING = 0,
	STEADYFLOW_CORE_IDOWNLOAD_FILE_FINISH_ACTION_OPEN_FILE,
	STEADYFLOW_CORE_IDOWNLOAD_FILE_FINISH_ACTION_OPEN_FOLDER,
	STEADYFLOW_CORE_IDOWNLOAD_FILE_FINISH_ACTION_RUN_COMMAND
} SteadyflowCoreIDownloadFileFinishAction;

#define STEADYFLOW_CORE_IDOWNLOAD_FILE_TYPE_FINISH_ACTION (steadyflow_core_idownload_file_finish_action_get_type ())

#define STEADYFLOW_UI_TYPE_GTK_BUILDER_DIALOG (steadyflow_ui_gtk_builder_dialog_get_type ())
#define STEADYFLOW_UI_GTK_BUILDER_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), STEADYFLOW_UI_TYPE_GTK_BUILDER_DIALOG, SteadyflowUIGtkBuilderDialog))
#define STEADYFLOW_UI_GTK_BUILDER_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), STEADYFLOW_UI_TYPE_GTK_BUILDER_DIALOG, SteadyflowUIGtkBuilderDialogClass))
#define STEADYFLOW_UI_IS_GTK_BUILDER_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), STEADYFLOW_UI_TYPE_GTK_BUILDER_DIALOG))
#define STEADYFLOW_UI_IS_GTK_BUILDER_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), STEADYFLOW_UI_TYPE_GTK_BUILDER_DIALOG))
#define STEADYFLOW_UI_GTK_BUILDER_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), STEADYFLOW_UI_TYPE_GTK_BUILDER_DIALOG, SteadyflowUIGtkBuilderDialogClass))

typedef struct _SteadyflowUIGtkBuilderDialog SteadyflowUIGtkBuilderDialog;
typedef struct _SteadyflowUIGtkBuilderDialogClass SteadyflowUIGtkBuilderDialogClass;

#define STEADYFLOW_TYPE_ADD_FILE_DIALOG (steadyflow_add_file_dialog_get_type ())
#define STEADYFLOW_ADD_FILE_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), STEADYFLOW_TYPE_ADD_FILE_DIALOG, SteadyflowAddFileDialog))
#define STEADYFLOW_ADD_FILE_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), STEADYFLOW_TYPE_ADD_FILE_DIALOG, SteadyflowAddFileDialogClass))
#define STEADYFLOW_IS_ADD_FILE_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), STEADYFLOW_TYPE_ADD_FILE_DIALOG))
#define STEADYFLOW_IS_ADD_FILE_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), STEADYFLOW_TYPE_ADD_FILE_DIALOG))
#define STEADYFLOW_ADD_FILE_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), STEADYFLOW_TYPE_ADD_FILE_DIALOG, SteadyflowAddFileDialogClass))

typedef struct _SteadyflowAddFileDialog SteadyflowAddFileDialog;
typedef struct _SteadyflowAddFileDialogClass SteadyflowAddFileDialogClass;
#define _g_free0(var) (var = (g_free (var), NULL))

#define STEADYFLOW_CORE_TYPE_IDOWNLOAD_SERVICE (steadyflow_core_idownload_service_get_type ())
#define STEADYFLOW_CORE_IDOWNLOAD_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), STEADYFLOW_CORE_TYPE_IDOWNLOAD_SERVICE, SteadyflowCoreIDownloadService))
#define STEADYFLOW_CORE_IS_IDOWNLOAD_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), STEADYFLOW_CORE_TYPE_IDOWNLOAD_SERVICE))
#define STEADYFLOW_CORE_IDOWNLOAD_SERVICE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), STEADYFLOW_CORE_TYPE_IDOWNLOAD_SERVICE, SteadyflowCoreIDownloadServiceIface))

typedef struct _SteadyflowCoreIDownloadService SteadyflowCoreIDownloadService;
typedef struct _SteadyflowCoreIDownloadServiceIface SteadyflowCoreIDownloadServiceIface;

#define STEADYFLOW_TYPE_PREFERENCES_DIALOG (steadyflow_preferences_dialog_get_type ())
#define STEADYFLOW_PREFERENCES_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), STEADYFLOW_TYPE_PREFERENCES_DIALOG, SteadyflowPreferencesDialog))
#define STEADYFLOW_PREFERENCES_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), STEADYFLOW_TYPE_PREFERENCES_DIALOG, SteadyflowPreferencesDialogClass))
#define STEADYFLOW_IS_PREFERENCES_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), STEADYFLOW_TYPE_PREFERENCES_DIALOG))
#define STEADYFLOW_IS_PREFERENCES_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), STEADYFLOW_TYPE_PREFERENCES_DIALOG))
#define STEADYFLOW_PREFERENCES_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), STEADYFLOW_TYPE_PREFERENCES_DIALOG, SteadyflowPreferencesDialogClass))

typedef struct _SteadyflowPreferencesDialog SteadyflowPreferencesDialog;
typedef struct _SteadyflowPreferencesDialogClass SteadyflowPreferencesDialogClass;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

struct _SteadyflowUIIGtkBuilderContainerIface {
	GTypeInterface parent_iface;
	GtkBuilder* (*get_builder) (SteadyflowUIIGtkBuilderContainer* self);
};

struct _SteadyflowUIGtkBuilderWindow {
	GtkWindow parent_instance;
	SteadyflowUIGtkBuilderWindowPrivate * priv;
};

struct _SteadyflowUIGtkBuilderWindowClass {
	GtkWindowClass parent_class;
};

struct _SteadyflowMainWindow {
	SteadyflowUIGtkBuilderWindow parent_instance;
	SteadyflowMainWindowPrivate * priv;
};

struct _SteadyflowMainWindowClass {
	SteadyflowUIGtkBuilderWindowClass parent_class;
};

struct _SteadyflowMainWindowPrivate {
	GtkToolbar* toolbar;
	GtkContainer* statuspanel;
	GtkContainer* filestatuspanel;
	GtkLabel* url_label;
	GtkLabel* local_label;
	GtkLabel* status_label;
	GtkMenu* m_item_popup;
	GtkEntry* searchbox;
	GtkToggleToolButton* t_edit;
	GtkAction* a_start;
	GtkAction* a_pause;
	GtkAction* a_remove;
	GtkAction* a_open_file;
	GtkAction* a_open_folder;
	GtkAction* a_copy_link;
	GtkToggleAction* a_view_statuspanel;
	SteadyflowIndicatorController* indicator_controller;
	SteadyflowFileListController* file_list_controller;
};

struct _SteadyflowCoreISettingsServiceIface {
	GTypeInterface parent_iface;
	gboolean (*get_boolean) (SteadyflowCoreISettingsService* self, const gchar* key);
	gint (*get_int) (SteadyflowCoreISettingsService* self, const gchar* key);
	gint (*get_enum) (SteadyflowCoreISettingsService* self, const gchar* key);
	gchar* (*get_string) (SteadyflowCoreISettingsService* self, const gchar* key);
	void (*set_boolean) (SteadyflowCoreISettingsService* self, const gchar* key, gboolean value);
	void (*set_int) (SteadyflowCoreISettingsService* self, const gchar* key, gint value);
	void (*set_enum) (SteadyflowCoreISettingsService* self, const gchar* key, gint value);
	void (*set_string) (SteadyflowCoreISettingsService* self, const gchar* key, const gchar* value);
	void (*save) (SteadyflowCoreISettingsService* self);
};

struct _SteadyflowUIIIndicatorServiceIface {
	GTypeInterface parent_iface;
	void (*set_menu) (SteadyflowUIIIndicatorService* self, GtkMenu* menu);
	gchar* (*get_icon_name) (SteadyflowUIIIndicatorService* self);
	void (*set_icon_name) (SteadyflowUIIIndicatorService* self, const gchar* value);
	gboolean (*get_visible) (SteadyflowUIIIndicatorService* self);
	void (*set_visible) (SteadyflowUIIIndicatorService* self, gboolean value);
};

struct _SteadyflowCoreIDownloadFileIface {
	GTypeInterface parent_iface;
	void (*start) (SteadyflowCoreIDownloadFile* self, gboolean resume);
	void (*pause) (SteadyflowCoreIDownloadFile* self);
	void (*serialize) (SteadyflowCoreIDownloadFile* self, GKeyFile* file);
	SteadyflowCoreIDownloadFileStatus (*get_status) (SteadyflowCoreIDownloadFile* self);
	gint (*get_uid) (SteadyflowCoreIDownloadFile* self);
	const gchar* (*get_url) (SteadyflowCoreIDownloadFile* self);
	const gchar* (*get_local_name) (SteadyflowCoreIDownloadFile* self);
	const gchar* (*get_local_basename) (SteadyflowCoreIDownloadFile* self);
	gint64 (*get_size) (SteadyflowCoreIDownloadFile* self);
	gint64 (*get_downloaded_size) (SteadyflowCoreIDownloadFile* self);
	gint (*get_speed) (SteadyflowCoreIDownloadFile* self);
	const gchar* (*get_icon_name) (SteadyflowCoreIDownloadFile* self);
	SteadyflowCoreIDownloadFileFinishAction (*get_finish_action) (SteadyflowCoreIDownloadFile* self);
	const gchar* (*get_finish_command) (SteadyflowCoreIDownloadFile* self);
	GError* (*get_error) (SteadyflowCoreIDownloadFile* self);
};

struct _SteadyflowCoreIDownloadServiceIface {
	GTypeInterface parent_iface;
	SteadyflowCoreIDownloadFile* (*get_file_by_uid) (SteadyflowCoreIDownloadService* self, gint uid);
	SteadyflowCoreIDownloadFile* (*add_file) (SteadyflowCoreIDownloadService* self, const gchar* url, const gchar* local_name, SteadyflowCoreIDownloadFileFinishAction finish_action, const gchar* finish_command, GError** error);
	void (*remove_file) (SteadyflowCoreIDownloadService* self, SteadyflowCoreIDownloadFile* file);
	GeeList* (*get_files) (SteadyflowCoreIDownloadService* self);
};

static gint SteadyflowMainWindow_private_offset;
static gpointer steadyflow_main_window_parent_class = NULL;

VALA_EXTERN GType steadyflow_ui_igtk_builder_container_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType steadyflow_ui_gtk_builder_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SteadyflowUIGtkBuilderWindow, g_object_unref)
VALA_EXTERN GType steadyflow_main_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SteadyflowMainWindow, g_object_unref)
VALA_EXTERN GType steadyflow_indicator_controller_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SteadyflowIndicatorController, g_object_unref)
VALA_EXTERN GType steadyflow_file_list_controller_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SteadyflowFileListController, g_object_unref)
VALA_EXTERN SteadyflowMainWindow* steadyflow_main_window_new (GError** error);
VALA_EXTERN SteadyflowMainWindow* steadyflow_main_window_construct (GType object_type,
                                                        GError** error);
VALA_EXTERN SteadyflowUIGtkBuilderWindow* steadyflow_ui_gtk_builder_window_construct (GType object_type,
                                                                          const gchar* file_id,
                                                                          GError** error);
VALA_EXTERN SteadyflowIndicatorController* steadyflow_indicator_controller_new (void);
VALA_EXTERN SteadyflowIndicatorController* steadyflow_indicator_controller_construct (GType object_type);
VALA_EXTERN GObject* steadyflow_ui_igtk_builder_container_get_object (SteadyflowUIIGtkBuilderContainer* self,
                                                          const gchar* id);
VALA_EXTERN SteadyflowFileListController* steadyflow_file_list_controller_new (GtkTreeView* tree);
VALA_EXTERN SteadyflowFileListController* steadyflow_file_list_controller_construct (GType object_type,
                                                                         GtkTreeView* tree);
static void steadyflow_main_window_set_statuspanel_visible (SteadyflowMainWindow* self,
                                                     gboolean visible);
VALA_EXTERN GType steadyflow_core_isettings_service_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SteadyflowCoreISettingsService, g_object_unref)
VALA_EXTERN SteadyflowCoreISettingsService* steadyflow_services_get_settings (void);
VALA_EXTERN gboolean steadyflow_core_isettings_service_get_boolean (SteadyflowCoreISettingsService* self,
                                                        const gchar* key);
VALA_EXTERN gint steadyflow_core_isettings_service_get_int (SteadyflowCoreISettingsService* self,
                                                const gchar* key);
static void __lambda31_ (SteadyflowMainWindow* self);
static void ___lambda31__steadyflow_core_isettings_service_changed (SteadyflowCoreISettingsService* _sender,
                                                             gpointer self);
static void __lambda32_ (SteadyflowMainWindow* self,
                  gboolean value);
static void ___lambda32__steadyflow_indicator_controller_show_hide_toggled (SteadyflowIndicatorController* _sender,
                                                                     gboolean visible,
                                                                     gpointer self);
static void __lambda33_ (SteadyflowMainWindow* self);
VALA_EXTERN void steadyflow_main_window_add_download (SteadyflowMainWindow* self,
                                          const gchar* starting_url);
static void ___lambda33__steadyflow_indicator_controller_add_download_clicked (SteadyflowIndicatorController* _sender,
                                                                        gpointer self);
static void __lambda34_ (SteadyflowMainWindow* self);
static void ___lambda34__steadyflow_indicator_controller_quit_clicked (SteadyflowIndicatorController* _sender,
                                                                gpointer self);
static void steadyflow_main_window_on_selection_changed (SteadyflowMainWindow* self);
static void _steadyflow_main_window_on_selection_changed_steadyflow_file_list_controller_selection_changed (SteadyflowFileListController* _sender,
                                                                                                     gpointer self);
static void steadyflow_main_window_update_searchbox_and_file_counts (SteadyflowMainWindow* self);
static void _steadyflow_main_window_update_searchbox_and_file_counts_steadyflow_file_list_controller_filelist_changed (SteadyflowFileListController* _sender,
                                                                                                                gpointer self);
VALA_EXTERN void steadyflow_ui_ui_util_install_clear_handler (GtkEntry* entry);
static gboolean steadyflow_main_window_on_resize (SteadyflowMainWindow* self,
                                           GdkEventConfigure* event);
static gboolean _steadyflow_main_window_on_resize_gtk_widget_configure_event (GtkWidget* _sender,
                                                                       GdkEventConfigure* event,
                                                                       gpointer self);
static void _gtk_main_quit_gtk_widget_destroy (GtkWidget* _sender,
                                        gpointer self);
static gboolean __lambda35_ (SteadyflowMainWindow* self);
static gboolean steadyflow_main_window_on_close (SteadyflowMainWindow* self);
static gboolean ___lambda35__gtk_widget_delete_event (GtkWidget* _sender,
                                               GdkEventAny* event,
                                               gpointer self);
VALA_EXTERN void steadyflow_ui_igtk_builder_container_autoconnect (SteadyflowUIIGtkBuilderContainer* self);
VALA_EXTERN void steadyflow_core_isettings_service_set_int (SteadyflowCoreISettingsService* self,
                                                const gchar* key,
                                                gint value);
VALA_EXTERN void steadyflow_core_isettings_service_save (SteadyflowCoreISettingsService* self);
VALA_EXTERN GType steadyflow_ui_iindicator_service_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SteadyflowUIIIndicatorService, g_object_unref)
VALA_EXTERN SteadyflowUIIIndicatorService* steadyflow_services_get_indicator (void);
VALA_EXTERN gboolean steadyflow_ui_iindicator_service_get_visible (SteadyflowUIIIndicatorService* self);
VALA_EXTERN void steadyflow_indicator_controller_set_main_window_visible (SteadyflowIndicatorController* self,
                                                              gboolean visible);
VALA_EXTERN void steadyflow_main_window_on_quit (GtkMenuItem* sender,
                                     SteadyflowMainWindow* self);
VALA_EXTERN GType steadyflow_core_idownload_file_status_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType steadyflow_core_idownload_file_finish_action_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType steadyflow_core_idownload_file_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SteadyflowCoreIDownloadFile, g_object_unref)
VALA_EXTERN GeeList* steadyflow_file_list_controller_get_selected_files (SteadyflowFileListController* self);
VALA_EXTERN const gchar* steadyflow_core_idownload_file_get_url (SteadyflowCoreIDownloadFile* self);
VALA_EXTERN const gchar* steadyflow_core_idownload_file_get_local_name (SteadyflowCoreIDownloadFile* self);
VALA_EXTERN gboolean steadyflow_core_idownload_file_can_start (SteadyflowCoreIDownloadFile* self);
VALA_EXTERN gboolean steadyflow_core_idownload_file_can_pause (SteadyflowCoreIDownloadFile* self);
VALA_EXTERN void steadyflow_main_window_on_view_statuspanel (GtkToggleAction* sender,
                                                 SteadyflowMainWindow* self);
VALA_EXTERN void steadyflow_core_isettings_service_set_boolean (SteadyflowCoreISettingsService* self,
                                                    const gchar* key,
                                                    gboolean value);
VALA_EXTERN void steadyflow_main_window_on_file_add (GtkAction* sender,
                                         SteadyflowMainWindow* self);
VALA_EXTERN GType steadyflow_ui_gtk_builder_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SteadyflowUIGtkBuilderDialog, g_object_unref)
VALA_EXTERN GType steadyflow_add_file_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SteadyflowAddFileDialog, g_object_unref)
VALA_EXTERN SteadyflowAddFileDialog* steadyflow_add_file_dialog_new (const gchar* url);
VALA_EXTERN SteadyflowAddFileDialog* steadyflow_add_file_dialog_construct (GType object_type,
                                                               const gchar* url);
VALA_EXTERN void steadyflow_file_list_controller_on_file_add_request (SteadyflowFileListController* self,
                                                          SteadyflowAddFileDialog* dlg);
static void _steadyflow_file_list_controller_on_file_add_request_steadyflow_add_file_dialog_file_add_request (SteadyflowAddFileDialog* _sender,
                                                                                                       gpointer self);
VALA_EXTERN void steadyflow_main_window_on_file_start (GtkAction* sender,
                                           SteadyflowMainWindow* self);
VALA_EXTERN void steadyflow_core_idownload_file_start (SteadyflowCoreIDownloadFile* self,
                                           gboolean resume);
VALA_EXTERN void steadyflow_main_window_on_file_pause (GtkAction* sender,
                                           SteadyflowMainWindow* self);
VALA_EXTERN void steadyflow_core_idownload_file_pause (SteadyflowCoreIDownloadFile* self);
VALA_EXTERN void steadyflow_main_window_on_file_remove (GtkAction* sender,
                                            SteadyflowMainWindow* self);
VALA_EXTERN SteadyflowCoreIDownloadFileStatus steadyflow_core_idownload_file_get_status (SteadyflowCoreIDownloadFile* self);
VALA_EXTERN const gchar* steadyflow_core_idownload_file_get_local_basename (SteadyflowCoreIDownloadFile* self);
VALA_EXTERN GType steadyflow_core_idownload_service_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SteadyflowCoreIDownloadService, g_object_unref)
VALA_EXTERN SteadyflowCoreIDownloadService* steadyflow_services_get_download (void);
VALA_EXTERN void steadyflow_core_idownload_service_remove_file (SteadyflowCoreIDownloadService* self,
                                                    SteadyflowCoreIDownloadFile* file);
VALA_EXTERN void steadyflow_main_window_on_open_file (GtkAction* sender,
                                          SteadyflowMainWindow* self);
static void steadyflow_main_window_open_selected_file (SteadyflowMainWindow* self);
VALA_EXTERN SteadyflowCoreIDownloadFile* steadyflow_file_list_controller_get_selected_file (SteadyflowFileListController* self);
VALA_EXTERN void steadyflow_ui_ui_util_open_file (SteadyflowCoreIDownloadFile* file);
VALA_EXTERN void steadyflow_main_window_on_open_folder (GtkAction* sender,
                                            SteadyflowMainWindow* self);
VALA_EXTERN void steadyflow_ui_ui_util_open_folder (SteadyflowCoreIDownloadFile* file);
VALA_EXTERN void steadyflow_main_window_on_copy_link (GtkAction* sender,
                                          SteadyflowMainWindow* self);
VALA_EXTERN void steadyflow_main_window_on_edit_preferences (GtkMenuItem* sender,
                                                 SteadyflowMainWindow* self);
VALA_EXTERN GType steadyflow_preferences_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SteadyflowPreferencesDialog, g_object_unref)
VALA_EXTERN SteadyflowPreferencesDialog* steadyflow_preferences_dialog_new (GtkWindow* parent);
VALA_EXTERN SteadyflowPreferencesDialog* steadyflow_preferences_dialog_construct (GType object_type,
                                                                      GtkWindow* parent);
static void steadyflow_main_window_show_uri (const gchar* uri);
VALA_EXTERN void steadyflow_core_util_fatal_error (GError* e,
                                       const gchar* message);
VALA_EXTERN void steadyflow_main_window_on_help_reportbug (GtkMenuItem* sender,
                                               SteadyflowMainWindow* self);
VALA_EXTERN void steadyflow_main_window_on_help_translate (GtkMenuItem* sender,
                                               SteadyflowMainWindow* self);
VALA_EXTERN void steadyflow_main_window_on_help_about (GtkMenuItem* sender,
                                           SteadyflowMainWindow* self);
static void steadyflow_main_window_on_menu_position (SteadyflowMainWindow* self,
                                              GtkMenu* menu,
                                              gint* x,
                                              gint* y,
                                              gboolean* push_in);
VALA_EXTERN void steadyflow_main_window_on_menu_edit (GtkToolButton* sender,
                                          SteadyflowMainWindow* self);
static void _steadyflow_main_window_on_menu_position_gtk_menu_position_func (GtkMenu* menu,
                                                                      gint* x,
                                                                      gint* y,
                                                                      gboolean* push_in,
                                                                      gpointer self);
VALA_EXTERN void steadyflow_main_window_on_app_menu_deactivate (GtkMenu* sender,
                                                    SteadyflowMainWindow* self);
VALA_EXTERN void steadyflow_main_window_on_searchbox_changed (GtkEntry* sender,
                                                  SteadyflowMainWindow* self);
VALA_EXTERN void steadyflow_file_list_controller_set_filter (SteadyflowFileListController* self,
                                                 const gchar* filter);
VALA_EXTERN gboolean steadyflow_main_window_on_tree_key_press (GtkTreeView* sender,
                                                   GdkEventKey* e,
                                                   SteadyflowMainWindow* self);
VALA_EXTERN gboolean steadyflow_main_window_on_tree_button_press (GtkTreeView* sender,
                                                      GdkEventButton* e,
                                                      SteadyflowMainWindow* self);
VALA_EXTERN SteadyflowCoreIDownloadFile* steadyflow_file_list_controller_get_file_at_widget_pos (SteadyflowFileListController* self,
                                                                                     gint x,
                                                                                     gint y);
VALA_EXTERN gboolean steadyflow_main_window_on_tree_button_release (GtkTreeView* sender,
                                                        GdkEventButton* e,
                                                        SteadyflowMainWindow* self);
static void steadyflow_main_window_tree_popup_menu (SteadyflowMainWindow* self,
                                             guint button,
                                             guint time);
VALA_EXTERN gboolean steadyflow_main_window_on_tree_popup_menu (GtkTreeView* sender,
                                                    SteadyflowMainWindow* self);
VALA_EXTERN gint steadyflow_file_list_controller_get_selection_count (SteadyflowFileListController* self);
VALA_EXTERN GeeList* steadyflow_core_idownload_service_get_files (SteadyflowCoreIDownloadService* self);
VALA_EXTERN void steadyflow_main_window_on_deploy_surprise (GtkWidget* sender,
                                                GdkEventButton* e,
                                                SteadyflowMainWindow* self);
static void steadyflow_main_window_finalize (GObject * obj);
static GType steadyflow_main_window_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);

static inline gpointer
steadyflow_main_window_get_instance_private (SteadyflowMainWindow* self)
{
	return G_STRUCT_MEMBER_P (self, SteadyflowMainWindow_private_offset);
}

static void
__lambda31_ (SteadyflowMainWindow* self)
{
	SteadyflowCoreISettingsService* _tmp0_;
	SteadyflowCoreISettingsService* _tmp1_;
	_tmp0_ = steadyflow_services_get_settings ();
	_tmp1_ = _tmp0_;
	steadyflow_main_window_set_statuspanel_visible (self, steadyflow_core_isettings_service_get_boolean (_tmp1_, "show-statuspanel"));
}

static void
___lambda31__steadyflow_core_isettings_service_changed (SteadyflowCoreISettingsService* _sender,
                                                        gpointer self)
{
	__lambda31_ ((SteadyflowMainWindow*) self);
}

static void
__lambda32_ (SteadyflowMainWindow* self,
             gboolean value)
{
	gtk_widget_set_visible ((GtkWidget*) self, value);
}

static void
___lambda32__steadyflow_indicator_controller_show_hide_toggled (SteadyflowIndicatorController* _sender,
                                                                gboolean visible,
                                                                gpointer self)
{
	__lambda32_ ((SteadyflowMainWindow*) self, visible);
}

static void
__lambda33_ (SteadyflowMainWindow* self)
{
	steadyflow_main_window_add_download (self, "");
}

static void
___lambda33__steadyflow_indicator_controller_add_download_clicked (SteadyflowIndicatorController* _sender,
                                                                   gpointer self)
{
	__lambda33_ ((SteadyflowMainWindow*) self);
}

static void
__lambda34_ (SteadyflowMainWindow* self)
{
	gtk_widget_destroy ((GtkWidget*) self);
}

static void
___lambda34__steadyflow_indicator_controller_quit_clicked (SteadyflowIndicatorController* _sender,
                                                           gpointer self)
{
	__lambda34_ ((SteadyflowMainWindow*) self);
}

static void
_steadyflow_main_window_on_selection_changed_steadyflow_file_list_controller_selection_changed (SteadyflowFileListController* _sender,
                                                                                                gpointer self)
{
	steadyflow_main_window_on_selection_changed ((SteadyflowMainWindow*) self);
}

static void
_steadyflow_main_window_update_searchbox_and_file_counts_steadyflow_file_list_controller_filelist_changed (SteadyflowFileListController* _sender,
                                                                                                           gpointer self)
{
	steadyflow_main_window_update_searchbox_and_file_counts ((SteadyflowMainWindow*) self);
}

static gboolean
_steadyflow_main_window_on_resize_gtk_widget_configure_event (GtkWidget* _sender,
                                                              GdkEventConfigure* event,
                                                              gpointer self)
{
	gboolean result;
	result = steadyflow_main_window_on_resize ((SteadyflowMainWindow*) self, event);
	return result;
}

static void
_gtk_main_quit_gtk_widget_destroy (GtkWidget* _sender,
                                   gpointer self)
{
	gtk_main_quit ();
}

static gboolean
__lambda35_ (SteadyflowMainWindow* self)
{
	gboolean result;
	result = steadyflow_main_window_on_close (self);
	return result;
}

static gboolean
___lambda35__gtk_widget_delete_event (GtkWidget* _sender,
                                      GdkEventAny* event,
                                      gpointer self)
{
	gboolean result;
	result = __lambda35_ ((SteadyflowMainWindow*) self);
	return result;
}

SteadyflowMainWindow*
steadyflow_main_window_construct (GType object_type,
                                  GError** error)
{
	SteadyflowMainWindow * self = NULL;
	SteadyflowIndicatorController* _tmp0_;
	GObject* _tmp1_;
	GtkTreeView* _tmp2_;
	SteadyflowFileListController* _tmp3_;
	GObject* _tmp4_;
	GObject* _tmp5_;
	GObject* _tmp6_;
	GObject* _tmp7_;
	GObject* _tmp8_;
	GObject* _tmp9_;
	GObject* _tmp10_;
	GObject* _tmp11_;
	GObject* _tmp12_;
	GObject* _tmp13_;
	GObject* _tmp14_;
	GObject* _tmp15_;
	GObject* _tmp16_;
	GObject* _tmp17_;
	GObject* _tmp18_;
	GObject* _tmp19_;
	SteadyflowCoreISettingsService* _tmp20_;
	SteadyflowCoreISettingsService* _tmp21_;
	SteadyflowCoreISettingsService* _tmp22_;
	SteadyflowCoreISettingsService* _tmp23_;
	SteadyflowCoreISettingsService* _tmp24_;
	SteadyflowCoreISettingsService* _tmp25_;
	SteadyflowCoreISettingsService* _tmp26_;
	SteadyflowCoreISettingsService* _tmp27_;
	SteadyflowIndicatorController* _tmp28_;
	SteadyflowIndicatorController* _tmp29_;
	SteadyflowIndicatorController* _tmp30_;
	SteadyflowFileListController* _tmp31_;
	SteadyflowFileListController* _tmp32_;
	GtkEntry* _tmp33_;
	GError* _inner_error0_ = NULL;
	self = (SteadyflowMainWindow*) steadyflow_ui_gtk_builder_window_construct (object_type, "MainWindow", &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		_g_object_unref0 (self);
		return NULL;
	}
	gtk_window_set_title ((GtkWindow*) self, _ ("Download Manager"));
	gtk_window_set_icon_name ((GtkWindow*) self, "steadyflow");
	_tmp0_ = steadyflow_indicator_controller_new ();
	_g_object_unref0 (self->priv->indicator_controller);
	self->priv->indicator_controller = _tmp0_;
	_tmp1_ = steadyflow_ui_igtk_builder_container_get_object ((SteadyflowUIIGtkBuilderContainer*) self, "tree");
	_tmp2_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_tree_view_get_type (), GtkTreeView);
	_tmp3_ = steadyflow_file_list_controller_new (_tmp2_);
	_g_object_unref0 (self->priv->file_list_controller);
	self->priv->file_list_controller = _tmp3_;
	_g_object_unref0 (_tmp2_);
	_tmp4_ = steadyflow_ui_igtk_builder_container_get_object ((SteadyflowUIIGtkBuilderContainer*) self, "toolbar");
	_g_object_unref0 (self->priv->toolbar);
	self->priv->toolbar = G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_toolbar_get_type (), GtkToolbar);
	_tmp5_ = steadyflow_ui_igtk_builder_container_get_object ((SteadyflowUIIGtkBuilderContainer*) self, "t_edit");
	_g_object_unref0 (self->priv->t_edit);
	self->priv->t_edit = G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, gtk_toggle_tool_button_get_type (), GtkToggleToolButton);
	_tmp6_ = steadyflow_ui_igtk_builder_container_get_object ((SteadyflowUIIGtkBuilderContainer*) self, "statuspanel");
	_g_object_unref0 (self->priv->statuspanel);
	self->priv->statuspanel = G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, gtk_container_get_type (), GtkContainer);
	_tmp7_ = steadyflow_ui_igtk_builder_container_get_object ((SteadyflowUIIGtkBuilderContainer*) self, "filestatuspanel");
	_g_object_unref0 (self->priv->filestatuspanel);
	self->priv->filestatuspanel = G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, gtk_container_get_type (), GtkContainer);
	_tmp8_ = steadyflow_ui_igtk_builder_container_get_object ((SteadyflowUIIGtkBuilderContainer*) self, "url_label");
	_g_object_unref0 (self->priv->url_label);
	self->priv->url_label = G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, gtk_label_get_type (), GtkLabel);
	_tmp9_ = steadyflow_ui_igtk_builder_container_get_object ((SteadyflowUIIGtkBuilderContainer*) self, "local_label");
	_g_object_unref0 (self->priv->local_label);
	self->priv->local_label = G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, gtk_label_get_type (), GtkLabel);
	_tmp10_ = steadyflow_ui_igtk_builder_container_get_object ((SteadyflowUIIGtkBuilderContainer*) self, "status_label");
	_g_object_unref0 (self->priv->status_label);
	self->priv->status_label = G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, gtk_label_get_type (), GtkLabel);
	_tmp11_ = steadyflow_ui_igtk_builder_container_get_object ((SteadyflowUIIGtkBuilderContainer*) self, "m_item_popup");
	_g_object_unref0 (self->priv->m_item_popup);
	self->priv->m_item_popup = G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, gtk_menu_get_type (), GtkMenu);
	_tmp12_ = steadyflow_ui_igtk_builder_container_get_object ((SteadyflowUIIGtkBuilderContainer*) self, "searchbox");
	_g_object_unref0 (self->priv->searchbox);
	self->priv->searchbox = G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, gtk_entry_get_type (), GtkEntry);
	_tmp13_ = steadyflow_ui_igtk_builder_container_get_object ((SteadyflowUIIGtkBuilderContainer*) self, "a_start");
	_g_object_unref0 (self->priv->a_start);
	self->priv->a_start = G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, gtk_action_get_type (), GtkAction);
	_tmp14_ = steadyflow_ui_igtk_builder_container_get_object ((SteadyflowUIIGtkBuilderContainer*) self, "a_pause");
	_g_object_unref0 (self->priv->a_pause);
	self->priv->a_pause = G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, gtk_action_get_type (), GtkAction);
	_tmp15_ = steadyflow_ui_igtk_builder_container_get_object ((SteadyflowUIIGtkBuilderContainer*) self, "a_remove");
	_g_object_unref0 (self->priv->a_remove);
	self->priv->a_remove = G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, gtk_action_get_type (), GtkAction);
	_tmp16_ = steadyflow_ui_igtk_builder_container_get_object ((SteadyflowUIIGtkBuilderContainer*) self, "a_view_statuspanel");
	_g_object_unref0 (self->priv->a_view_statuspanel);
	self->priv->a_view_statuspanel = G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, gtk_toggle_action_get_type (), GtkToggleAction);
	_tmp17_ = steadyflow_ui_igtk_builder_container_get_object ((SteadyflowUIIGtkBuilderContainer*) self, "a_open_file");
	_g_object_unref0 (self->priv->a_open_file);
	self->priv->a_open_file = G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, gtk_action_get_type (), GtkAction);
	_tmp18_ = steadyflow_ui_igtk_builder_container_get_object ((SteadyflowUIIGtkBuilderContainer*) self, "a_open_folder");
	_g_object_unref0 (self->priv->a_open_folder);
	self->priv->a_open_folder = G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, gtk_action_get_type (), GtkAction);
	_tmp19_ = steadyflow_ui_igtk_builder_container_get_object ((SteadyflowUIIGtkBuilderContainer*) self, "a_copy_link");
	_g_object_unref0 (self->priv->a_copy_link);
	self->priv->a_copy_link = G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, gtk_action_get_type (), GtkAction);
	_tmp20_ = steadyflow_services_get_settings ();
	_tmp21_ = _tmp20_;
	steadyflow_main_window_set_statuspanel_visible (self, steadyflow_core_isettings_service_get_boolean (_tmp21_, "show-statuspanel"));
	_tmp22_ = steadyflow_services_get_settings ();
	_tmp23_ = _tmp22_;
	_tmp24_ = steadyflow_services_get_settings ();
	_tmp25_ = _tmp24_;
	gtk_window_set_default_size ((GtkWindow*) self, steadyflow_core_isettings_service_get_int (_tmp23_, "window-width"), steadyflow_core_isettings_service_get_int (_tmp25_, "window-height"));
	gtk_window_set_position ((GtkWindow*) self, GTK_WIN_POS_CENTER);
	_tmp26_ = steadyflow_services_get_settings ();
	_tmp27_ = _tmp26_;
	g_signal_connect_object (_tmp27_, "changed::show-statuspanel", (GCallback) ___lambda31__steadyflow_core_isettings_service_changed, self, 0);
	_tmp28_ = self->priv->indicator_controller;
	g_signal_connect_object (_tmp28_, "show-hide-toggled", (GCallback) ___lambda32__steadyflow_indicator_controller_show_hide_toggled, self, 0);
	_tmp29_ = self->priv->indicator_controller;
	g_signal_connect_object (_tmp29_, "add-download-clicked", (GCallback) ___lambda33__steadyflow_indicator_controller_add_download_clicked, self, 0);
	_tmp30_ = self->priv->indicator_controller;
	g_signal_connect_object (_tmp30_, "quit-clicked", (GCallback) ___lambda34__steadyflow_indicator_controller_quit_clicked, self, 0);
	_tmp31_ = self->priv->file_list_controller;
	g_signal_connect_object (_tmp31_, "selection-changed", (GCallback) _steadyflow_main_window_on_selection_changed_steadyflow_file_list_controller_selection_changed, self, 0);
	_tmp32_ = self->priv->file_list_controller;
	g_signal_connect_object (_tmp32_, "filelist-changed", (GCallback) _steadyflow_main_window_update_searchbox_and_file_counts_steadyflow_file_list_controller_filelist_changed, self, 0);
	_tmp33_ = self->priv->searchbox;
	steadyflow_ui_ui_util_install_clear_handler (_tmp33_);
	g_signal_connect_object ((GtkWidget*) self, "configure-event", (GCallback) _steadyflow_main_window_on_resize_gtk_widget_configure_event, self, 0);
	g_signal_connect ((GtkWidget*) self, "destroy", (GCallback) _gtk_main_quit_gtk_widget_destroy, NULL);
	g_signal_connect_object ((GtkWidget*) self, "delete-event", (GCallback) ___lambda35__gtk_widget_delete_event, self, 0);
	steadyflow_ui_igtk_builder_container_autoconnect ((SteadyflowUIIGtkBuilderContainer*) self);
	steadyflow_main_window_update_searchbox_and_file_counts (self);
	return self;
}

SteadyflowMainWindow*
steadyflow_main_window_new (GError** error)
{
	return steadyflow_main_window_construct (STEADYFLOW_TYPE_MAIN_WINDOW, error);
}

static gboolean
steadyflow_main_window_on_resize (SteadyflowMainWindow* self,
                                  GdkEventConfigure* event)
{
	SteadyflowCoreISettingsService* _tmp0_;
	SteadyflowCoreISettingsService* _tmp1_;
	SteadyflowCoreISettingsService* _tmp2_;
	SteadyflowCoreISettingsService* _tmp3_;
	SteadyflowCoreISettingsService* _tmp4_;
	SteadyflowCoreISettingsService* _tmp5_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp0_ = steadyflow_services_get_settings ();
	_tmp1_ = _tmp0_;
	steadyflow_core_isettings_service_set_int (_tmp1_, "window-width", event->width);
	_tmp2_ = steadyflow_services_get_settings ();
	_tmp3_ = _tmp2_;
	steadyflow_core_isettings_service_set_int (_tmp3_, "window-height", event->height);
	_tmp4_ = steadyflow_services_get_settings ();
	_tmp5_ = _tmp4_;
	steadyflow_core_isettings_service_save (_tmp5_);
	result = FALSE;
	return result;
}

static gboolean
steadyflow_main_window_on_close (SteadyflowMainWindow* self)
{
	gboolean _tmp0_ = FALSE;
	SteadyflowUIIIndicatorService* _tmp1_;
	SteadyflowUIIIndicatorService* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp1_ = steadyflow_services_get_indicator ();
	_tmp2_ = _tmp1_;
	_tmp3_ = steadyflow_ui_iindicator_service_get_visible (_tmp2_);
	_tmp4_ = _tmp3_;
	if (_tmp4_) {
		SteadyflowCoreISettingsService* _tmp5_;
		SteadyflowCoreISettingsService* _tmp6_;
		_tmp5_ = steadyflow_services_get_settings ();
		_tmp6_ = _tmp5_;
		_tmp0_ = steadyflow_core_isettings_service_get_boolean (_tmp6_, "minimize-to-indicator");
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		SteadyflowIndicatorController* _tmp7_;
		gtk_widget_hide ((GtkWidget*) self);
		_tmp7_ = self->priv->indicator_controller;
		steadyflow_indicator_controller_set_main_window_visible (_tmp7_, FALSE);
		result = TRUE;
		return result;
	}
	result = FALSE;
	return result;
}

void
steadyflow_main_window_on_quit (GtkMenuItem* sender,
                                SteadyflowMainWindow* self)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (sender != NULL);
	gtk_widget_destroy ((GtkWidget*) self);
}

static void
steadyflow_main_window_on_selection_changed (SteadyflowMainWindow* self)
{
	GeeList* selection = NULL;
	SteadyflowFileListController* _tmp0_;
	GeeList* _tmp1_;
	GtkAction* _tmp2_;
	GeeList* _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	GeeList* _tmp6_;
	gint _tmp7_;
	gint _tmp8_;
	gboolean can_start = FALSE;
	gboolean can_pause = FALSE;
	GtkAction* _tmp34_;
	GtkAction* _tmp35_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->file_list_controller;
	_tmp1_ = steadyflow_file_list_controller_get_selected_files (_tmp0_);
	selection = _tmp1_;
	_tmp2_ = self->priv->a_remove;
	_tmp3_ = selection;
	_tmp4_ = gee_collection_get_is_empty ((GeeCollection*) _tmp3_);
	_tmp5_ = _tmp4_;
	gtk_action_set_sensitive (_tmp2_, !_tmp5_);
	_tmp6_ = selection;
	_tmp7_ = gee_collection_get_size ((GeeCollection*) _tmp6_);
	_tmp8_ = _tmp7_;
	if (_tmp8_ == 1) {
		GtkContainer* _tmp9_;
		SteadyflowCoreIDownloadFile* file = NULL;
		GeeList* _tmp10_;
		gpointer _tmp11_;
		GtkLabel* _tmp12_;
		SteadyflowCoreIDownloadFile* _tmp13_;
		const gchar* _tmp14_;
		const gchar* _tmp15_;
		GtkLabel* _tmp16_;
		SteadyflowCoreIDownloadFile* _tmp17_;
		const gchar* _tmp18_;
		const gchar* _tmp19_;
		_tmp9_ = self->priv->filestatuspanel;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp9_, TRUE);
		_tmp10_ = selection;
		_tmp11_ = gee_list_get (_tmp10_, 0);
		file = (SteadyflowCoreIDownloadFile*) _tmp11_;
		_tmp12_ = self->priv->url_label;
		_tmp13_ = file;
		_tmp14_ = steadyflow_core_idownload_file_get_url (_tmp13_);
		_tmp15_ = _tmp14_;
		gtk_label_set_text (_tmp12_, _tmp15_);
		_tmp16_ = self->priv->local_label;
		_tmp17_ = file;
		_tmp18_ = steadyflow_core_idownload_file_get_local_name (_tmp17_);
		_tmp19_ = _tmp18_;
		gtk_label_set_text (_tmp16_, _tmp19_);
		_g_object_unref0 (file);
	} else {
		GtkContainer* _tmp20_;
		GtkLabel* _tmp21_;
		GtkLabel* _tmp22_;
		_tmp20_ = self->priv->filestatuspanel;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp20_, FALSE);
		_tmp21_ = self->priv->url_label;
		gtk_label_set_text (_tmp21_, "");
		_tmp22_ = self->priv->local_label;
		gtk_label_set_text (_tmp22_, "");
	}
	can_start = FALSE;
	can_pause = FALSE;
	{
		GeeList* _file_list = NULL;
		GeeList* _tmp23_;
		gint _file_size = 0;
		GeeList* _tmp24_;
		gint _tmp25_;
		gint _tmp26_;
		gint _file_index = 0;
		_tmp23_ = selection;
		_file_list = _tmp23_;
		_tmp24_ = _file_list;
		_tmp25_ = gee_collection_get_size ((GeeCollection*) _tmp24_);
		_tmp26_ = _tmp25_;
		_file_size = _tmp26_;
		_file_index = -1;
		while (TRUE) {
			gint _tmp27_;
			gint _tmp28_;
			SteadyflowCoreIDownloadFile* file = NULL;
			GeeList* _tmp29_;
			gpointer _tmp30_;
			SteadyflowCoreIDownloadFile* _tmp31_;
			SteadyflowCoreIDownloadFile* _tmp32_;
			gboolean _tmp33_ = FALSE;
			_file_index = _file_index + 1;
			_tmp27_ = _file_index;
			_tmp28_ = _file_size;
			if (!(_tmp27_ < _tmp28_)) {
				break;
			}
			_tmp29_ = _file_list;
			_tmp30_ = gee_list_get (_tmp29_, _file_index);
			file = (SteadyflowCoreIDownloadFile*) _tmp30_;
			_tmp31_ = file;
			if (steadyflow_core_idownload_file_can_start (_tmp31_)) {
				can_start = TRUE;
			}
			_tmp32_ = file;
			if (steadyflow_core_idownload_file_can_pause (_tmp32_)) {
				can_pause = TRUE;
			}
			if (can_start) {
				_tmp33_ = can_pause;
			} else {
				_tmp33_ = FALSE;
			}
			if (_tmp33_) {
				_g_object_unref0 (file);
				break;
			}
			_g_object_unref0 (file);
		}
	}
	_tmp34_ = self->priv->a_start;
	gtk_action_set_sensitive (_tmp34_, can_start);
	_tmp35_ = self->priv->a_pause;
	gtk_action_set_sensitive (_tmp35_, can_pause);
	_g_object_unref0 (selection);
}

static void
steadyflow_main_window_set_statuspanel_visible (SteadyflowMainWindow* self,
                                                gboolean visible)
{
	GtkContainer* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	GtkToggleAction* _tmp4_;
	gboolean _tmp5_;
	gboolean _tmp6_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->statuspanel;
	_tmp1_ = gtk_widget_get_visible ((GtkWidget*) _tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ != visible) {
		GtkContainer* _tmp3_;
		_tmp3_ = self->priv->statuspanel;
		gtk_widget_set_visible ((GtkWidget*) _tmp3_, visible);
	}
	_tmp4_ = self->priv->a_view_statuspanel;
	_tmp5_ = gtk_toggle_action_get_active (_tmp4_);
	_tmp6_ = _tmp5_;
	if (_tmp6_ != visible) {
		GtkToggleAction* _tmp7_;
		_tmp7_ = self->priv->a_view_statuspanel;
		gtk_toggle_action_set_active (_tmp7_, visible);
	}
}

void
steadyflow_main_window_on_view_statuspanel (GtkToggleAction* sender,
                                            SteadyflowMainWindow* self)
{
	SteadyflowCoreISettingsService* _tmp0_;
	SteadyflowCoreISettingsService* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (sender != NULL);
	_tmp0_ = steadyflow_services_get_settings ();
	_tmp1_ = _tmp0_;
	_tmp2_ = gtk_toggle_action_get_active (sender);
	_tmp3_ = _tmp2_;
	steadyflow_core_isettings_service_set_boolean (_tmp1_, "show-statuspanel", _tmp3_);
}

void
steadyflow_main_window_on_file_add (GtkAction* sender,
                                    SteadyflowMainWindow* self)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (sender != NULL);
	steadyflow_main_window_add_download (self, "");
}

static void
_steadyflow_file_list_controller_on_file_add_request_steadyflow_add_file_dialog_file_add_request (SteadyflowAddFileDialog* _sender,
                                                                                                  gpointer self)
{
	steadyflow_file_list_controller_on_file_add_request ((SteadyflowFileListController*) self, _sender);
}

void
steadyflow_main_window_add_download (SteadyflowMainWindow* self,
                                     const gchar* starting_url)
{
	SteadyflowAddFileDialog* dlg = NULL;
	SteadyflowAddFileDialog* _tmp0_;
	SteadyflowFileListController* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (starting_url != NULL);
	_tmp0_ = steadyflow_add_file_dialog_new (starting_url);
	g_object_ref_sink (_tmp0_);
	dlg = _tmp0_;
	_tmp1_ = self->priv->file_list_controller;
	g_signal_connect_object (dlg, "file-add-request", (GCallback) _steadyflow_file_list_controller_on_file_add_request_steadyflow_add_file_dialog_file_add_request, _tmp1_, 0);
	gtk_widget_show ((GtkWidget*) dlg);
	_g_object_unref0 (dlg);
}

void
steadyflow_main_window_on_file_start (GtkAction* sender,
                                      SteadyflowMainWindow* self)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (sender != NULL);
	{
		GeeList* _file_list = NULL;
		SteadyflowFileListController* _tmp0_;
		GeeList* _tmp1_;
		gint _file_size = 0;
		GeeList* _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		gint _file_index = 0;
		_tmp0_ = self->priv->file_list_controller;
		_tmp1_ = steadyflow_file_list_controller_get_selected_files (_tmp0_);
		_file_list = _tmp1_;
		_tmp2_ = _file_list;
		_tmp3_ = gee_collection_get_size ((GeeCollection*) _tmp2_);
		_tmp4_ = _tmp3_;
		_file_size = _tmp4_;
		_file_index = -1;
		while (TRUE) {
			gint _tmp5_;
			gint _tmp6_;
			SteadyflowCoreIDownloadFile* file = NULL;
			GeeList* _tmp7_;
			gpointer _tmp8_;
			SteadyflowCoreIDownloadFile* _tmp9_;
			_file_index = _file_index + 1;
			_tmp5_ = _file_index;
			_tmp6_ = _file_size;
			if (!(_tmp5_ < _tmp6_)) {
				break;
			}
			_tmp7_ = _file_list;
			_tmp8_ = gee_list_get (_tmp7_, _file_index);
			file = (SteadyflowCoreIDownloadFile*) _tmp8_;
			_tmp9_ = file;
			steadyflow_core_idownload_file_start (_tmp9_, TRUE);
			_g_object_unref0 (file);
		}
		_g_object_unref0 (_file_list);
	}
}

void
steadyflow_main_window_on_file_pause (GtkAction* sender,
                                      SteadyflowMainWindow* self)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (sender != NULL);
	{
		GeeList* _file_list = NULL;
		SteadyflowFileListController* _tmp0_;
		GeeList* _tmp1_;
		gint _file_size = 0;
		GeeList* _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		gint _file_index = 0;
		_tmp0_ = self->priv->file_list_controller;
		_tmp1_ = steadyflow_file_list_controller_get_selected_files (_tmp0_);
		_file_list = _tmp1_;
		_tmp2_ = _file_list;
		_tmp3_ = gee_collection_get_size ((GeeCollection*) _tmp2_);
		_tmp4_ = _tmp3_;
		_file_size = _tmp4_;
		_file_index = -1;
		while (TRUE) {
			gint _tmp5_;
			gint _tmp6_;
			SteadyflowCoreIDownloadFile* file = NULL;
			GeeList* _tmp7_;
			gpointer _tmp8_;
			SteadyflowCoreIDownloadFile* _tmp9_;
			_file_index = _file_index + 1;
			_tmp5_ = _file_index;
			_tmp6_ = _file_size;
			if (!(_tmp5_ < _tmp6_)) {
				break;
			}
			_tmp7_ = _file_list;
			_tmp8_ = gee_list_get (_tmp7_, _file_index);
			file = (SteadyflowCoreIDownloadFile*) _tmp8_;
			_tmp9_ = file;
			steadyflow_core_idownload_file_pause (_tmp9_);
			_g_object_unref0 (file);
		}
		_g_object_unref0 (_file_list);
	}
}

void
steadyflow_main_window_on_file_remove (GtkAction* sender,
                                       SteadyflowMainWindow* self)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (sender != NULL);
	{
		GeeList* _file_list = NULL;
		SteadyflowFileListController* _tmp0_;
		GeeList* _tmp1_;
		gint _file_size = 0;
		GeeList* _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		gint _file_index = 0;
		_tmp0_ = self->priv->file_list_controller;
		_tmp1_ = steadyflow_file_list_controller_get_selected_files (_tmp0_);
		_file_list = _tmp1_;
		_tmp2_ = _file_list;
		_tmp3_ = gee_collection_get_size ((GeeCollection*) _tmp2_);
		_tmp4_ = _tmp3_;
		_file_size = _tmp4_;
		_file_index = -1;
		while (TRUE) {
			gint _tmp5_;
			gint _tmp6_;
			SteadyflowCoreIDownloadFile* file = NULL;
			GeeList* _tmp7_;
			gpointer _tmp8_;
			SteadyflowCoreIDownloadFile* _tmp9_;
			SteadyflowCoreIDownloadFileStatus _tmp10_;
			SteadyflowCoreIDownloadFileStatus _tmp11_;
			SteadyflowCoreIDownloadFile* _tmp23_;
			SteadyflowCoreIDownloadService* _tmp24_;
			SteadyflowCoreIDownloadService* _tmp25_;
			SteadyflowCoreIDownloadFile* _tmp26_;
			_file_index = _file_index + 1;
			_tmp5_ = _file_index;
			_tmp6_ = _file_size;
			if (!(_tmp5_ < _tmp6_)) {
				break;
			}
			_tmp7_ = _file_list;
			_tmp8_ = gee_list_get (_tmp7_, _file_index);
			file = (SteadyflowCoreIDownloadFile*) _tmp8_;
			_tmp9_ = file;
			_tmp10_ = steadyflow_core_idownload_file_get_status (_tmp9_);
			_tmp11_ = _tmp10_;
			if (_tmp11_ != STEADYFLOW_CORE_IDOWNLOAD_FILE_STATUS_FINISHED) {
				GtkMessageDialog* md = NULL;
				SteadyflowCoreIDownloadFile* _tmp12_;
				const gchar* _tmp13_;
				const gchar* _tmp14_;
				gchar* _tmp15_;
				gchar* _tmp16_;
				GtkMessageDialog* _tmp17_;
				GtkMessageDialog* _tmp18_;
				GtkMessageDialog* _tmp19_;
				GtkMessageDialog* _tmp20_;
				gint response = 0;
				GtkMessageDialog* _tmp21_;
				GtkMessageDialog* _tmp22_;
				_tmp12_ = file;
				_tmp13_ = steadyflow_core_idownload_file_get_local_basename (_tmp12_);
				_tmp14_ = _tmp13_;
				_tmp15_ = g_strdup_printf (_ ("The file \"%s\" is not downloaded yet"), _tmp14_);
				_tmp16_ = _tmp15_;
				_tmp17_ = (GtkMessageDialog*) gtk_message_dialog_new_with_markup ((GtkWindow*) self, GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_NONE, STEADYFLOW_UI_UI_UTIL_MESSAGE_FORMAT, _tmp16_, _ ("The file you request to be removed from the download list is not yet f" \
"ully downloaded. " "Are you sure you want to remove it?"));
				g_object_ref_sink (_tmp17_);
				_tmp18_ = _tmp17_;
				_g_free0 (_tmp16_);
				md = _tmp18_;
				_tmp19_ = md;
				gtk_dialog_add_button ((GtkDialog*) _tmp19_, GTK_STOCK_CANCEL, (gint) GTK_RESPONSE_CANCEL);
				_tmp20_ = md;
				gtk_dialog_add_button ((GtkDialog*) _tmp20_, GTK_STOCK_REMOVE, (gint) GTK_RESPONSE_OK);
				_tmp21_ = md;
				response = gtk_dialog_run ((GtkDialog*) _tmp21_);
				_tmp22_ = md;
				gtk_widget_destroy ((GtkWidget*) _tmp22_);
				if (response != ((gint) GTK_RESPONSE_OK)) {
					_g_object_unref0 (md);
					_g_object_unref0 (file);
					_g_object_unref0 (_file_list);
					return;
				}
				_g_object_unref0 (md);
			}
			_tmp23_ = file;
			steadyflow_core_idownload_file_pause (_tmp23_);
			_tmp24_ = steadyflow_services_get_download ();
			_tmp25_ = _tmp24_;
			_tmp26_ = file;
			steadyflow_core_idownload_service_remove_file (_tmp25_, _tmp26_);
			_g_object_unref0 (file);
		}
		_g_object_unref0 (_file_list);
	}
	steadyflow_main_window_on_selection_changed (self);
}

void
steadyflow_main_window_on_open_file (GtkAction* sender,
                                     SteadyflowMainWindow* self)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (sender != NULL);
	steadyflow_main_window_open_selected_file (self);
}

static void
steadyflow_main_window_open_selected_file (SteadyflowMainWindow* self)
{
	SteadyflowCoreIDownloadFile* file = NULL;
	SteadyflowFileListController* _tmp0_;
	SteadyflowCoreIDownloadFile* _tmp1_;
	SteadyflowCoreIDownloadFile* _tmp2_;
	SteadyflowCoreIDownloadFile* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->file_list_controller;
	_tmp1_ = steadyflow_file_list_controller_get_selected_file (_tmp0_);
	file = _tmp1_;
	_tmp2_ = file;
	if (_tmp2_ == NULL) {
		_g_object_unref0 (file);
		return;
	}
	_tmp3_ = file;
	steadyflow_ui_ui_util_open_file (_tmp3_);
	_g_object_unref0 (file);
}

void
steadyflow_main_window_on_open_folder (GtkAction* sender,
                                       SteadyflowMainWindow* self)
{
	SteadyflowCoreIDownloadFile* file = NULL;
	SteadyflowFileListController* _tmp0_;
	SteadyflowCoreIDownloadFile* _tmp1_;
	SteadyflowCoreIDownloadFile* _tmp2_;
	SteadyflowCoreIDownloadFile* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (sender != NULL);
	_tmp0_ = self->priv->file_list_controller;
	_tmp1_ = steadyflow_file_list_controller_get_selected_file (_tmp0_);
	file = _tmp1_;
	_tmp2_ = file;
	if (_tmp2_ == NULL) {
		_g_object_unref0 (file);
		return;
	}
	_tmp3_ = file;
	steadyflow_ui_ui_util_open_folder (_tmp3_);
	_g_object_unref0 (file);
}

void
steadyflow_main_window_on_copy_link (GtkAction* sender,
                                     SteadyflowMainWindow* self)
{
	SteadyflowCoreIDownloadFile* file = NULL;
	SteadyflowFileListController* _tmp0_;
	SteadyflowCoreIDownloadFile* _tmp1_;
	SteadyflowCoreIDownloadFile* _tmp2_;
	GtkClipboard* _tmp3_;
	SteadyflowCoreIDownloadFile* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	SteadyflowCoreIDownloadFile* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	gint _tmp10_;
	gint _tmp11_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (sender != NULL);
	_tmp0_ = self->priv->file_list_controller;
	_tmp1_ = steadyflow_file_list_controller_get_selected_file (_tmp0_);
	file = _tmp1_;
	_tmp2_ = file;
	if (_tmp2_ == NULL) {
		_g_object_unref0 (file);
		return;
	}
	_tmp3_ = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD);
	_tmp4_ = file;
	_tmp5_ = steadyflow_core_idownload_file_get_url (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = file;
	_tmp8_ = steadyflow_core_idownload_file_get_url (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = strlen (_tmp9_);
	_tmp11_ = _tmp10_;
	gtk_clipboard_set_text (_tmp3_, _tmp6_, _tmp11_);
	_g_object_unref0 (file);
}

void
steadyflow_main_window_on_edit_preferences (GtkMenuItem* sender,
                                            SteadyflowMainWindow* self)
{
	SteadyflowPreferencesDialog* dlg = NULL;
	SteadyflowPreferencesDialog* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (sender != NULL);
	_tmp0_ = steadyflow_preferences_dialog_new ((GtkWindow*) self);
	g_object_ref_sink (_tmp0_);
	dlg = _tmp0_;
	gtk_dialog_run ((GtkDialog*) dlg);
	gtk_widget_destroy ((GtkWidget*) dlg);
	_g_object_unref0 (dlg);
}

static void
steadyflow_main_window_show_uri (const gchar* uri)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (uri != NULL);
	{
		gtk_show_uri (NULL, uri, (guint32) GDK_CURRENT_TIME, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		gchar* _tmp0_;
		gchar* _tmp1_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp0_ = g_strdup_printf (_ ("Could not launch web browser for URL %s"), uri);
		_tmp1_ = _tmp0_;
		steadyflow_core_util_fatal_error (e, _tmp1_);
		_g_free0 (_tmp1_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

void
steadyflow_main_window_on_help_reportbug (GtkMenuItem* sender,
                                          SteadyflowMainWindow* self)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (sender != NULL);
	steadyflow_main_window_show_uri ("https://bugs.launchpad.net/steadyflow");
}

void
steadyflow_main_window_on_help_translate (GtkMenuItem* sender,
                                          SteadyflowMainWindow* self)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (sender != NULL);
	steadyflow_main_window_show_uri ("https://translations.launchpad.net/steadyflow");
}

void
steadyflow_main_window_on_help_about (GtkMenuItem* sender,
                                      SteadyflowMainWindow* self)
{
	GtkAboutDialog* dlg = NULL;
	GtkAboutDialog* _tmp0_;
	gchar** _tmp1_;
	gchar** _tmp2_;
	gchar** _tmp3_;
	gint _tmp3__length1;
	g_return_if_fail (self != NULL);
	g_return_if_fail (sender != NULL);
	_tmp0_ = (GtkAboutDialog*) gtk_about_dialog_new ();
	g_object_ref_sink (_tmp0_);
	dlg = _tmp0_;
	_tmp2_ = _tmp1_ = g_strsplit (CMAKE_APP_AUTHORS, "\n", 0);
	_tmp3_ = _tmp2_;
	_tmp3__length1 = _vala_array_length (_tmp1_);
	gtk_about_dialog_set_authors (dlg, _tmp3_);
	_tmp3_ = (_vala_array_free (_tmp3_, _tmp3__length1, (GDestroyNotify) g_free), NULL);
	gtk_about_dialog_set_copyright (dlg, "Copyright © 2010-2012 Maia Kozheva <sikon@ubuntu.com>");
	gtk_about_dialog_set_license (dlg, STEADYFLOW_LICENSE);
	gtk_about_dialog_set_logo_icon_name (dlg, "steadyflow");
	gtk_about_dialog_set_program_name (dlg, "Steadyflow");
	gtk_about_dialog_set_comments (dlg, _ ("Simple download manager for GNOME"));
	gtk_about_dialog_set_version (dlg, CMAKE_APP_VERSION);
	gtk_about_dialog_set_website (dlg, "https://launchpad.net/steadyflow");
	gtk_about_dialog_set_website_label (dlg, _ ("Website"));
	gtk_about_dialog_set_translator_credits (dlg, _ ("translator-credits"));
	gtk_dialog_run ((GtkDialog*) dlg);
	gtk_widget_destroy ((GtkWidget*) dlg);
	_g_object_unref0 (dlg);
}

static void
steadyflow_main_window_on_menu_position (SteadyflowMainWindow* self,
                                         GtkMenu* menu,
                                         gint* x,
                                         gint* y,
                                         gboolean* push_in)
{
	gint _vala_x = 0;
	gint _vala_y = 0;
	gboolean _vala_push_in = FALSE;
	GtkAllocation alloc = {0};
	gint win_x = 0;
	gint win_y = 0;
	GtkToggleToolButton* _tmp0_;
	GtkAllocation _tmp1_ = {0};
	GtkToggleToolButton* _tmp2_;
	GdkWindow* _tmp3_;
	gint _tmp4_ = 0;
	gint _tmp5_ = 0;
	GtkAllocation _tmp6_;
	GtkAllocation _tmp7_;
	GtkAllocation _tmp8_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (menu != NULL);
	_tmp0_ = self->priv->t_edit;
	gtk_widget_get_allocation ((GtkWidget*) _tmp0_, &_tmp1_);
	alloc = _tmp1_;
	_tmp2_ = self->priv->t_edit;
	_tmp3_ = gtk_widget_get_window ((GtkWidget*) _tmp2_);
	gdk_window_get_origin (_tmp3_, &_tmp4_, &_tmp5_);
	win_x = _tmp4_;
	win_y = _tmp5_;
	_tmp6_ = alloc;
	_vala_x = win_x + _tmp6_.x;
	_tmp7_ = alloc;
	_tmp8_ = alloc;
	_vala_y = (win_y + _tmp7_.y) + _tmp8_.height;
	_vala_push_in = TRUE;
	if (x) {
		*x = _vala_x;
	}
	if (y) {
		*y = _vala_y;
	}
	if (push_in) {
		*push_in = _vala_push_in;
	}
}

static void
_steadyflow_main_window_on_menu_position_gtk_menu_position_func (GtkMenu* menu,
                                                                 gint* x,
                                                                 gint* y,
                                                                 gboolean* push_in,
                                                                 gpointer self)
{
	steadyflow_main_window_on_menu_position ((SteadyflowMainWindow*) self, menu, x, y, push_in);
	g_object_unref (self);
}

void
steadyflow_main_window_on_menu_edit (GtkToolButton* sender,
                                     SteadyflowMainWindow* self)
{
	GtkToggleToolButton* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (sender != NULL);
	_tmp0_ = self->priv->t_edit;
	_tmp1_ = gtk_toggle_tool_button_get_active (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		GtkMenu* menu = NULL;
		GObject* _tmp3_;
		GtkMenu* _tmp4_;
		_tmp3_ = steadyflow_ui_igtk_builder_container_get_object ((SteadyflowUIIGtkBuilderContainer*) self, "m_edit_s");
		menu = G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_menu_get_type (), GtkMenu);
		_tmp4_ = menu;
		gtk_menu_popup (_tmp4_, NULL, NULL, _steadyflow_main_window_on_menu_position_gtk_menu_position_func, g_object_ref (self), (guint) 1, (guint32) GDK_CURRENT_TIME);
		_g_object_unref0 (menu);
	}
}

void
steadyflow_main_window_on_app_menu_deactivate (GtkMenu* sender,
                                               SteadyflowMainWindow* self)
{
	GtkToggleToolButton* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (sender != NULL);
	_tmp0_ = self->priv->t_edit;
	gtk_toggle_tool_button_set_active (_tmp0_, FALSE);
}

void
steadyflow_main_window_on_searchbox_changed (GtkEntry* sender,
                                             SteadyflowMainWindow* self)
{
	SteadyflowFileListController* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (sender != NULL);
	_tmp0_ = self->priv->file_list_controller;
	_tmp1_ = gtk_entry_get_text (sender);
	_tmp2_ = _tmp1_;
	steadyflow_file_list_controller_set_filter (_tmp0_, _tmp2_);
}

gboolean
steadyflow_main_window_on_tree_key_press (GtkTreeView* sender,
                                          GdkEventKey* e,
                                          SteadyflowMainWindow* self)
{
	const gchar* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (sender != NULL, FALSE);
	g_return_val_if_fail (e != NULL, FALSE);
	_tmp0_ = gdk_keyval_name (e->keyval);
	if (g_strcmp0 (_tmp0_, "Delete") == 0) {
		GtkAction* _tmp1_;
		_tmp1_ = self->priv->a_remove;
		steadyflow_main_window_on_file_remove (_tmp1_, self);
	}
	result = FALSE;
	return result;
}

gboolean
steadyflow_main_window_on_tree_button_press (GtkTreeView* sender,
                                             GdkEventButton* e,
                                             SteadyflowMainWindow* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (sender != NULL, FALSE);
	g_return_val_if_fail (e != NULL, FALSE);
	if (e->button == ((guint) 1)) {
		_tmp0_ = e->type == GDK_2BUTTON_PRESS;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		steadyflow_main_window_open_selected_file (self);
	} else {
		gboolean _tmp1_ = FALSE;
		if (e->button == ((guint) 3)) {
			SteadyflowFileListController* _tmp2_;
			GeeList* _tmp3_;
			GeeList* _tmp4_;
			SteadyflowFileListController* _tmp5_;
			SteadyflowCoreIDownloadFile* _tmp6_;
			SteadyflowCoreIDownloadFile* _tmp7_;
			_tmp2_ = self->priv->file_list_controller;
			_tmp3_ = steadyflow_file_list_controller_get_selected_files (_tmp2_);
			_tmp4_ = _tmp3_;
			_tmp5_ = self->priv->file_list_controller;
			_tmp6_ = steadyflow_file_list_controller_get_file_at_widget_pos (_tmp5_, (gint) e->x, (gint) e->y);
			_tmp7_ = _tmp6_;
			_tmp1_ = gee_collection_contains ((GeeCollection*) _tmp4_, _tmp7_);
			_g_object_unref0 (_tmp7_);
			_g_object_unref0 (_tmp4_);
		} else {
			_tmp1_ = FALSE;
		}
		if (_tmp1_) {
			result = TRUE;
			return result;
		}
	}
	result = FALSE;
	return result;
}

gboolean
steadyflow_main_window_on_tree_button_release (GtkTreeView* sender,
                                               GdkEventButton* e,
                                               SteadyflowMainWindow* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (sender != NULL, FALSE);
	g_return_val_if_fail (e != NULL, FALSE);
	if (e->button == ((guint) 3)) {
		steadyflow_main_window_tree_popup_menu (self, e->button, (guint) e->time);
		result = TRUE;
		return result;
	}
	result = FALSE;
	return result;
}

gboolean
steadyflow_main_window_on_tree_popup_menu (GtkTreeView* sender,
                                           SteadyflowMainWindow* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (sender != NULL, FALSE);
	steadyflow_main_window_tree_popup_menu (self, (guint) 3, (guint) GDK_CURRENT_TIME);
	result = TRUE;
	return result;
}

static void
steadyflow_main_window_tree_popup_menu (SteadyflowMainWindow* self,
                                        guint button,
                                        guint time)
{
	gint file_count = 0;
	SteadyflowFileListController* _tmp0_;
	GtkMenu* _tmp12_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->file_list_controller;
	file_count = steadyflow_file_list_controller_get_selection_count (_tmp0_);
	if (file_count == 0) {
		return;
	} else {
		if (file_count == 1) {
			SteadyflowCoreIDownloadFile* file = NULL;
			SteadyflowFileListController* _tmp1_;
			SteadyflowCoreIDownloadFile* _tmp2_;
			GtkAction* _tmp3_;
			SteadyflowCoreIDownloadFile* _tmp4_;
			SteadyflowCoreIDownloadFileStatus _tmp5_;
			SteadyflowCoreIDownloadFileStatus _tmp6_;
			GtkAction* _tmp7_;
			GtkAction* _tmp8_;
			_tmp1_ = self->priv->file_list_controller;
			_tmp2_ = steadyflow_file_list_controller_get_selected_file (_tmp1_);
			file = _tmp2_;
			_tmp3_ = self->priv->a_open_file;
			_tmp4_ = file;
			_tmp5_ = steadyflow_core_idownload_file_get_status (_tmp4_);
			_tmp6_ = _tmp5_;
			gtk_action_set_sensitive (_tmp3_, _tmp6_ == STEADYFLOW_CORE_IDOWNLOAD_FILE_STATUS_FINISHED);
			_tmp7_ = self->priv->a_open_folder;
			gtk_action_set_sensitive (_tmp7_, TRUE);
			_tmp8_ = self->priv->a_copy_link;
			gtk_action_set_sensitive (_tmp8_, TRUE);
			_g_object_unref0 (file);
		} else {
			GtkAction* _tmp9_;
			GtkAction* _tmp10_;
			GtkAction* _tmp11_;
			_tmp9_ = self->priv->a_open_file;
			gtk_action_set_sensitive (_tmp9_, FALSE);
			_tmp10_ = self->priv->a_open_folder;
			gtk_action_set_sensitive (_tmp10_, FALSE);
			_tmp11_ = self->priv->a_copy_link;
			gtk_action_set_sensitive (_tmp11_, FALSE);
		}
	}
	_tmp12_ = self->priv->m_item_popup;
	gtk_menu_popup (_tmp12_, NULL, NULL, NULL, NULL, button, (guint32) time);
}

static void
steadyflow_main_window_update_searchbox_and_file_counts (SteadyflowMainWindow* self)
{
	GtkEntry* _tmp0_;
	SteadyflowCoreIDownloadService* _tmp1_;
	SteadyflowCoreIDownloadService* _tmp2_;
	GeeList* _tmp3_;
	GeeList* _tmp4_;
	GeeList* _tmp5_;
	gboolean _tmp6_;
	gboolean _tmp7_;
	gint downloading = 0;
	gint paused = 0;
	gint finished = 0;
	GtkLabel* _tmp25_;
	gchar* _tmp26_;
	gchar* _tmp27_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->searchbox;
	_tmp1_ = steadyflow_services_get_download ();
	_tmp2_ = _tmp1_;
	_tmp3_ = steadyflow_core_idownload_service_get_files (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = _tmp4_;
	_tmp6_ = gee_collection_get_is_empty ((GeeCollection*) _tmp5_);
	_tmp7_ = _tmp6_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp0_, !_tmp7_);
	_g_object_unref0 (_tmp5_);
	downloading = 0;
	paused = 0;
	finished = 0;
	{
		GeeList* _file_list = NULL;
		SteadyflowCoreIDownloadService* _tmp8_;
		SteadyflowCoreIDownloadService* _tmp9_;
		GeeList* _tmp10_;
		GeeList* _tmp11_;
		gint _file_size = 0;
		GeeList* _tmp12_;
		gint _tmp13_;
		gint _tmp14_;
		gint _file_index = 0;
		_tmp8_ = steadyflow_services_get_download ();
		_tmp9_ = _tmp8_;
		_tmp10_ = steadyflow_core_idownload_service_get_files (_tmp9_);
		_tmp11_ = _tmp10_;
		_file_list = _tmp11_;
		_tmp12_ = _file_list;
		_tmp13_ = gee_collection_get_size ((GeeCollection*) _tmp12_);
		_tmp14_ = _tmp13_;
		_file_size = _tmp14_;
		_file_index = -1;
		while (TRUE) {
			gint _tmp15_;
			gint _tmp16_;
			SteadyflowCoreIDownloadFile* file = NULL;
			GeeList* _tmp17_;
			gpointer _tmp18_;
			SteadyflowCoreIDownloadFile* _tmp19_;
			SteadyflowCoreIDownloadFileStatus _tmp20_;
			SteadyflowCoreIDownloadFileStatus _tmp21_;
			_file_index = _file_index + 1;
			_tmp15_ = _file_index;
			_tmp16_ = _file_size;
			if (!(_tmp15_ < _tmp16_)) {
				break;
			}
			_tmp17_ = _file_list;
			_tmp18_ = gee_list_get (_tmp17_, _file_index);
			file = (SteadyflowCoreIDownloadFile*) _tmp18_;
			_tmp19_ = file;
			_tmp20_ = steadyflow_core_idownload_file_get_status (_tmp19_);
			_tmp21_ = _tmp20_;
			switch (_tmp21_) {
				case STEADYFLOW_CORE_IDOWNLOAD_FILE_STATUS_DOWNLOADING:
				{
					gint _tmp22_;
					_tmp22_ = downloading;
					downloading = _tmp22_ + 1;
					break;
				}
				case STEADYFLOW_CORE_IDOWNLOAD_FILE_STATUS_FINISHED:
				{
					gint _tmp23_;
					_tmp23_ = finished;
					finished = _tmp23_ + 1;
					break;
				}
				default:
				{
					gint _tmp24_;
					_tmp24_ = paused;
					paused = _tmp24_ + 1;
					break;
				}
			}
			_g_object_unref0 (file);
		}
		_g_object_unref0 (_file_list);
	}
	_tmp25_ = self->priv->status_label;
	_tmp26_ = g_strdup_printf (_ ("%d downloading, %d paused, %d finished"), downloading, paused, finished);
	_tmp27_ = _tmp26_;
	gtk_label_set_text (_tmp25_, _tmp27_);
	_g_free0 (_tmp27_);
}

void
steadyflow_main_window_on_deploy_surprise (GtkWidget* sender,
                                           GdkEventButton* e,
                                           SteadyflowMainWindow* self)
{
	gboolean _tmp0_ = FALSE;
	g_return_if_fail (self != NULL);
	g_return_if_fail (sender != NULL);
	g_return_if_fail (e != NULL);
	if ((e->state & GDK_SHIFT_MASK) != 0) {
		_tmp0_ = e->button == ((guint) 2);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GtkMessageDialog* md = NULL;
		GtkMessageDialog* _tmp1_;
		GtkMessageDialog* _tmp2_;
		GtkMessageDialog* _tmp3_;
		_tmp1_ = (GtkMessageDialog*) gtk_message_dialog_new_with_markup ((GtkWindow*) self, GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE, STEADYFLOW_UI_UI_UTIL_MESSAGE_FORMAT, "♥", "Surprise deployed!");
		g_object_ref_sink (_tmp1_);
		md = _tmp1_;
		_tmp2_ = md;
		gtk_dialog_run ((GtkDialog*) _tmp2_);
		_tmp3_ = md;
		gtk_widget_destroy ((GtkWidget*) _tmp3_);
		_g_object_unref0 (md);
	}
}

static void
steadyflow_main_window_class_init (SteadyflowMainWindowClass * klass,
                                   gpointer klass_data)
{
	steadyflow_main_window_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &SteadyflowMainWindow_private_offset);
	G_OBJECT_CLASS (klass)->finalize = steadyflow_main_window_finalize;
}

static void
steadyflow_main_window_instance_init (SteadyflowMainWindow * self,
                                      gpointer klass)
{
	self->priv = steadyflow_main_window_get_instance_private (self);
}

static void
steadyflow_main_window_finalize (GObject * obj)
{
	SteadyflowMainWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, STEADYFLOW_TYPE_MAIN_WINDOW, SteadyflowMainWindow);
	_g_object_unref0 (self->priv->toolbar);
	_g_object_unref0 (self->priv->statuspanel);
	_g_object_unref0 (self->priv->filestatuspanel);
	_g_object_unref0 (self->priv->url_label);
	_g_object_unref0 (self->priv->local_label);
	_g_object_unref0 (self->priv->status_label);
	_g_object_unref0 (self->priv->m_item_popup);
	_g_object_unref0 (self->priv->searchbox);
	_g_object_unref0 (self->priv->t_edit);
	_g_object_unref0 (self->priv->a_start);
	_g_object_unref0 (self->priv->a_pause);
	_g_object_unref0 (self->priv->a_remove);
	_g_object_unref0 (self->priv->a_open_file);
	_g_object_unref0 (self->priv->a_open_folder);
	_g_object_unref0 (self->priv->a_copy_link);
	_g_object_unref0 (self->priv->a_view_statuspanel);
	_g_object_unref0 (self->priv->indicator_controller);
	_g_object_unref0 (self->priv->file_list_controller);
	G_OBJECT_CLASS (steadyflow_main_window_parent_class)->finalize (obj);
}

static GType
steadyflow_main_window_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SteadyflowMainWindowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) steadyflow_main_window_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SteadyflowMainWindow), 0, (GInstanceInitFunc) steadyflow_main_window_instance_init, NULL };
	GType steadyflow_main_window_type_id;
	steadyflow_main_window_type_id = g_type_register_static (STEADYFLOW_UI_TYPE_GTK_BUILDER_WINDOW, "SteadyflowMainWindow", &g_define_type_info, 0);
	SteadyflowMainWindow_private_offset = g_type_add_instance_private (steadyflow_main_window_type_id, sizeof (SteadyflowMainWindowPrivate));
	return steadyflow_main_window_type_id;
}

GType
steadyflow_main_window_get_type (void)
{
	static volatile gsize steadyflow_main_window_type_id__once = 0;
	if (g_once_init_enter (&steadyflow_main_window_type_id__once)) {
		GType steadyflow_main_window_type_id;
		steadyflow_main_window_type_id = steadyflow_main_window_get_type_once ();
		g_once_init_leave (&steadyflow_main_window_type_id__once, steadyflow_main_window_type_id);
	}
	return steadyflow_main_window_type_id__once;
}

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

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

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

