/* app.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from app.vala, do not modify */

/* This file is part of GNOME Boxes. License: LGPLv2+*/

#include <glib-object.h>
#include <gio/gio.h>
#include "common.h"
#include <glib.h>
#include <gtk/gtk.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <handy.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.h>
#include "config.h"
#include <spice-client.h>
#include <webkit2/webkit2.h>
#include <gdk/gdk.h>
#include <libvirt-gobject/libvirt-gobject.h>
#include <libvirt-gconfig/libvirt-gconfig.h>

#define BOXES_APP_DEFAULT_SOURCE_NAME "QEMU Session"
#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 BOXES_TYPE_BROKER (boxes_broker_get_type ())
#define BOXES_BROKER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_BROKER, BoxesBroker))
#define BOXES_BROKER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_BROKER, BoxesBrokerClass))
#define BOXES_IS_BROKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_BROKER))
#define BOXES_IS_BROKER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_BROKER))
#define BOXES_BROKER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_BROKER, BoxesBrokerClass))

typedef struct _BoxesBroker BoxesBroker;
typedef struct _BoxesBrokerClass BoxesBrokerClass;
typedef struct _BoxesBrokerPrivate BoxesBrokerPrivate;
enum  {
	BOXES_BROKER_0_PROPERTY,
	BOXES_BROKER_NUM_PROPERTIES
};
static GParamSpec* boxes_broker_properties[BOXES_BROKER_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define BOXES_TYPE_APP (boxes_app_get_type ())
#define BOXES_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_APP, BoxesApp))
#define BOXES_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_APP, BoxesAppClass))
#define BOXES_IS_APP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_APP))
#define BOXES_IS_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_APP))
#define BOXES_APP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_APP, BoxesAppClass))

typedef struct _BoxesApp BoxesApp;
typedef struct _BoxesAppClass BoxesAppClass;
typedef struct _BoxesAppPrivate BoxesAppPrivate;

#define BOXES_TYPE_COLLECTION (boxes_collection_get_type ())
#define BOXES_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_COLLECTION, BoxesCollection))
#define BOXES_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_COLLECTION, BoxesCollectionClass))
#define BOXES_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_COLLECTION))
#define BOXES_IS_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_COLLECTION))
#define BOXES_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_COLLECTION, BoxesCollectionClass))

typedef struct _BoxesCollection BoxesCollection;
typedef struct _BoxesCollectionClass BoxesCollectionClass;

#define BOXES_TYPE_SHARED_FOLDERS_MANAGER (boxes_shared_folders_manager_get_type ())
#define BOXES_SHARED_FOLDERS_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_SHARED_FOLDERS_MANAGER, BoxesSharedFoldersManager))
#define BOXES_SHARED_FOLDERS_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_SHARED_FOLDERS_MANAGER, BoxesSharedFoldersManagerClass))
#define BOXES_IS_SHARED_FOLDERS_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_SHARED_FOLDERS_MANAGER))
#define BOXES_IS_SHARED_FOLDERS_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_SHARED_FOLDERS_MANAGER))
#define BOXES_SHARED_FOLDERS_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_SHARED_FOLDERS_MANAGER, BoxesSharedFoldersManagerClass))

typedef struct _BoxesSharedFoldersManager BoxesSharedFoldersManager;
typedef struct _BoxesSharedFoldersManagerClass BoxesSharedFoldersManagerClass;

#define BOXES_TYPE_COLLECTION_ITEM (boxes_collection_item_get_type ())
#define BOXES_COLLECTION_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_COLLECTION_ITEM, BoxesCollectionItem))
#define BOXES_COLLECTION_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_COLLECTION_ITEM, BoxesCollectionItemClass))
#define BOXES_IS_COLLECTION_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_COLLECTION_ITEM))
#define BOXES_IS_COLLECTION_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_COLLECTION_ITEM))
#define BOXES_COLLECTION_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_COLLECTION_ITEM, BoxesCollectionItemClass))

typedef struct _BoxesCollectionItem BoxesCollectionItem;
typedef struct _BoxesCollectionItemClass BoxesCollectionItemClass;

#define BOXES_TYPE_MACHINE (boxes_machine_get_type ())
#define BOXES_MACHINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_MACHINE, BoxesMachine))
#define BOXES_MACHINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_MACHINE, BoxesMachineClass))
#define BOXES_IS_MACHINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_MACHINE))
#define BOXES_IS_MACHINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_MACHINE))
#define BOXES_MACHINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_MACHINE, BoxesMachineClass))

typedef struct _BoxesMachine BoxesMachine;
typedef struct _BoxesMachineClass BoxesMachineClass;

#define BOXES_TYPE_UI (boxes_ui_get_type ())
#define BOXES_UI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_UI, BoxesUI))
#define BOXES_IS_UI(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_UI))
#define BOXES_UI_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), BOXES_TYPE_UI, BoxesUIIface))

typedef struct _BoxesUI BoxesUI;
typedef struct _BoxesUIIface BoxesUIIface;
typedef enum  {
	BOXES_UI_STATE_NONE,
	BOXES_UI_STATE_COLLECTION,
	BOXES_UI_STATE_CREDS,
	BOXES_UI_STATE_DISPLAY,
	BOXES_UI_STATE_WIZARD,
	BOXES_UI_STATE_PROPERTIES,
	BOXES_UI_STATE_TROUBLESHOOT
} BoxesUIState;

#define BOXES_TYPE_UI_STATE (boxes_ui_state_get_type ())
typedef struct _BoxesCollectionItemPrivate BoxesCollectionItemPrivate;
typedef struct _BoxesMachinePrivate BoxesMachinePrivate;
typedef enum  {
	BOXES_MACHINE_CONNECT_FLAGS_NONE = 0,
	BOXES_MACHINE_CONNECT_FLAGS_IGNORE_SAVED_STATE = 1 << 0
} BoxesMachineConnectFlags;

#define BOXES_MACHINE_TYPE_CONNECT_FLAGS (boxes_machine_connect_flags_get_type ())
typedef struct _BoxesBrokerAddSourceData BoxesBrokerAddSourceData;

#define BOXES_TYPE_APP_WINDOW (boxes_app_window_get_type ())
#define BOXES_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_APP_WINDOW, BoxesAppWindow))
#define BOXES_APP_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_APP_WINDOW, BoxesAppWindowClass))
#define BOXES_IS_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_APP_WINDOW))
#define BOXES_IS_APP_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_APP_WINDOW))
#define BOXES_APP_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_APP_WINDOW, BoxesAppWindowClass))

typedef struct _BoxesAppWindow BoxesAppWindow;
typedef struct _BoxesAppWindowClass BoxesAppWindowClass;
enum  {
	BOXES_APP_0_PROPERTY,
	BOXES_APP_MAIN_WINDOW_PROPERTY,
	BOXES_APP_URI_PROPERTY,
	BOXES_APP_RUN_IN_BG_PROPERTY,
	BOXES_APP_DEFAULT_CONNECTION_PROPERTY,
	BOXES_APP_DEFAULT_SOURCE_PROPERTY,
	BOXES_APP_NUM_PROPERTIES
};
static GParamSpec* boxes_app_properties[BOXES_APP_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
#define _boxes_async_launcher_unref0(var) ((var == NULL) ? NULL : (var = (boxes_async_launcher_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

#define BOXES_TYPE_LIBVIRT_BROKER (boxes_libvirt_broker_get_type ())
#define BOXES_LIBVIRT_BROKER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_LIBVIRT_BROKER, BoxesLibvirtBroker))
#define BOXES_LIBVIRT_BROKER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_LIBVIRT_BROKER, BoxesLibvirtBrokerClass))
#define BOXES_IS_LIBVIRT_BROKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_LIBVIRT_BROKER))
#define BOXES_IS_LIBVIRT_BROKER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_LIBVIRT_BROKER))
#define BOXES_LIBVIRT_BROKER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_LIBVIRT_BROKER, BoxesLibvirtBrokerClass))

typedef struct _BoxesLibvirtBroker BoxesLibvirtBroker;
typedef struct _BoxesLibvirtBrokerClass BoxesLibvirtBrokerClass;
typedef void (*BoxesAppCallReadyFunc) (gpointer user_data);
typedef struct _Block1Data Block1Data;
typedef struct _Block2Data Block2Data;
#define _g_variant_dict_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_dict_unref (var), NULL)))
typedef struct _Block3Data Block3Data;
typedef struct _Block4Data Block4Data;
typedef struct _BoxesAppWindowPrivate BoxesAppWindowPrivate;

#define BOXES_TYPE_SEARCHBAR (boxes_searchbar_get_type ())
#define BOXES_SEARCHBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_SEARCHBAR, BoxesSearchbar))
#define BOXES_SEARCHBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_SEARCHBAR, BoxesSearchbarClass))
#define BOXES_IS_SEARCHBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_SEARCHBAR))
#define BOXES_IS_SEARCHBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_SEARCHBAR))
#define BOXES_SEARCHBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_SEARCHBAR, BoxesSearchbarClass))

typedef struct _BoxesSearchbar BoxesSearchbar;
typedef struct _BoxesSearchbarClass BoxesSearchbarClass;

#define BOXES_TYPE_TOPBAR (boxes_topbar_get_type ())
#define BOXES_TOPBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_TOPBAR, BoxesTopbar))
#define BOXES_TOPBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_TOPBAR, BoxesTopbarClass))
#define BOXES_IS_TOPBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_TOPBAR))
#define BOXES_IS_TOPBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_TOPBAR))
#define BOXES_TOPBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_TOPBAR, BoxesTopbarClass))

typedef struct _BoxesTopbar BoxesTopbar;
typedef struct _BoxesTopbarClass BoxesTopbarClass;

#define BOXES_TYPE_TOAST_OVERLAY (boxes_toast_overlay_get_type ())
#define BOXES_TOAST_OVERLAY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_TOAST_OVERLAY, BoxesToastOverlay))
#define BOXES_TOAST_OVERLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_TOAST_OVERLAY, BoxesToastOverlayClass))
#define BOXES_IS_TOAST_OVERLAY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_TOAST_OVERLAY))
#define BOXES_IS_TOAST_OVERLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_TOAST_OVERLAY))
#define BOXES_TOAST_OVERLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_TOAST_OVERLAY, BoxesToastOverlayClass))

typedef struct _BoxesToastOverlay BoxesToastOverlay;
typedef struct _BoxesToastOverlayClass BoxesToastOverlayClass;

#define BOXES_TYPE_DISPLAY_PAGE (boxes_display_page_get_type ())
#define BOXES_DISPLAY_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_DISPLAY_PAGE, BoxesDisplayPage))
#define BOXES_DISPLAY_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_DISPLAY_PAGE, BoxesDisplayPageClass))
#define BOXES_IS_DISPLAY_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_DISPLAY_PAGE))
#define BOXES_IS_DISPLAY_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_DISPLAY_PAGE))
#define BOXES_DISPLAY_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_DISPLAY_PAGE, BoxesDisplayPageClass))

typedef struct _BoxesDisplayPage BoxesDisplayPage;
typedef struct _BoxesDisplayPageClass BoxesDisplayPageClass;

#define BOXES_TYPE_TROUBLESHOOT_VIEW (boxes_troubleshoot_view_get_type ())
#define BOXES_TROUBLESHOOT_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_TROUBLESHOOT_VIEW, BoxesTroubleshootView))
#define BOXES_TROUBLESHOOT_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_TROUBLESHOOT_VIEW, BoxesTroubleshootViewClass))
#define BOXES_IS_TROUBLESHOOT_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_TROUBLESHOOT_VIEW))
#define BOXES_IS_TROUBLESHOOT_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_TROUBLESHOOT_VIEW))
#define BOXES_TROUBLESHOOT_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_TROUBLESHOOT_VIEW, BoxesTroubleshootViewClass))

typedef struct _BoxesTroubleshootView BoxesTroubleshootView;
typedef struct _BoxesTroubleshootViewClass BoxesTroubleshootViewClass;
typedef struct _Block5Data Block5Data;
typedef struct _Block6Data Block6Data;
typedef struct _BoxesAppAddCollectionSourceData BoxesAppAddCollectionSourceData;
typedef struct _BoxesAppActivateAsyncData BoxesAppActivateAsyncData;
typedef struct _BoxesAppSetupDefaultSourceData BoxesAppSetupDefaultSourceData;
typedef struct _Block7Data Block7Data;
typedef struct _BoxesAppSetupSourcesData BoxesAppSetupSourcesData;

#define BOXES_TYPE_LIBVIRT_MACHINE (boxes_libvirt_machine_get_type ())
#define BOXES_LIBVIRT_MACHINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_LIBVIRT_MACHINE, BoxesLibvirtMachine))
#define BOXES_LIBVIRT_MACHINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_LIBVIRT_MACHINE, BoxesLibvirtMachineClass))
#define BOXES_IS_LIBVIRT_MACHINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_LIBVIRT_MACHINE))
#define BOXES_IS_LIBVIRT_MACHINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_LIBVIRT_MACHINE))
#define BOXES_LIBVIRT_MACHINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_LIBVIRT_MACHINE, BoxesLibvirtMachineClass))

typedef struct _BoxesLibvirtMachine BoxesLibvirtMachine;
typedef struct _BoxesLibvirtMachineClass BoxesLibvirtMachineClass;
typedef void (*BoxesCollectionCollectionForeachFunc) (BoxesCollectionItem* item, gpointer user_data);
typedef struct _Block8Data Block8Data;
typedef struct _Block9Data Block9Data;
#define _g_main_context_unref0(var) ((var == NULL) ? NULL : (var = (g_main_context_unref (var), NULL)))
typedef void (*BoxesAppUndoNotifyCallback) (gpointer user_data);
typedef struct _Block10Data Block10Data;
typedef void (*BoxesToastOKFunc) (gpointer user_data);
typedef void (*BoxesToastDismissFunc) (gpointer user_data);

#define BOXES_TYPE_TOAST (boxes_toast_get_type ())
#define BOXES_TOAST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_TOAST, BoxesToast))
#define BOXES_TOAST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_TOAST, BoxesToastClass))
#define BOXES_IS_TOAST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_TOAST))
#define BOXES_IS_TOAST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_TOAST))
#define BOXES_TOAST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_TOAST, BoxesToastClass))

typedef struct _BoxesToast BoxesToast;
typedef struct _BoxesToastClass BoxesToastClass;
typedef struct _BoxesToastPrivate BoxesToastPrivate;
enum  {
	BOXES_APP_READY_SIGNAL,
	BOXES_APP_NUM_SIGNALS
};
static guint boxes_app_signals[BOXES_APP_NUM_SIGNALS] = {0};
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _BoxesBroker {
	GObject parent_instance;
	BoxesBrokerPrivate * priv;
};

struct _BoxesBrokerClass {
	GObjectClass parent_class;
	void (*add_source) (BoxesBroker* self, BoxesCollectionSource* source, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*add_source_finish) (BoxesBroker* self, GAsyncResult* _res_, GError** error);
};

struct _BoxesApp {
	GtkApplication parent_instance;
	BoxesAppPrivate * priv;
	BoxesCollection* collection;
	BoxesAsyncLauncher* async_launcher;
	BoxesSharedFoldersManager* shared_folders_manager;
};

struct _BoxesAppClass {
	GtkApplicationClass parent_class;
};

struct _BoxesUIIface {
	GTypeInterface parent_iface;
	BoxesUIState (*get_previous_ui_state) (BoxesUI* self);
	void (*set_previous_ui_state) (BoxesUI* self, BoxesUIState value);
	BoxesUIState (*get_ui_state) (BoxesUI* self);
	void (*set_ui_state) (BoxesUI* self, BoxesUIState value);
};

struct _BoxesCollectionItem {
	GObject parent_instance;
	BoxesCollectionItemPrivate * priv;
};

struct _BoxesCollectionItemClass {
	GObjectClass parent_class;
	gint (*compare) (BoxesCollectionItem* self, BoxesCollectionItem* other);
};

struct _BoxesMachine {
	BoxesCollectionItem parent_instance;
	BoxesMachinePrivate * priv;
	BoxesCollectionSource* source;
	BoxesBoxConfig* config;
	gboolean stay_on_display;
};

struct _BoxesMachineClass {
	BoxesCollectionItemClass parent_class;
	void (*save_real) (BoxesMachine* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*save_real_finish) (BoxesMachine* self, GAsyncResult* _res_, GError** error);
	void (*take_screenshot) (BoxesMachine* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	GdkPixbuf* (*take_screenshot_finish) (BoxesMachine* self, GAsyncResult* _res_, GError** error);
	void (*connect_display) (BoxesMachine* self, BoxesMachineConnectFlags flags, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*connect_display_finish) (BoxesMachine* self, GAsyncResult* _res_, GError** error);
	void (*restart) (BoxesMachine* self);
	void (*clone) (BoxesMachine* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*clone_finish) (BoxesMachine* self, GAsyncResult* _res_);
	void (*disconnect_display) (BoxesMachine* self);
	void (*update_status) (BoxesMachine* self);
	void (*delete) (BoxesMachine* self, gboolean by_user);
	gboolean (*get_suspend_at_exit) (BoxesMachine* self);
	gboolean (*get_can_save) (BoxesMachine* self);
	gboolean (*get_can_restart) (BoxesMachine* self);
	gboolean (*get_can_clone) (BoxesMachine* self);
	gboolean (*get_should_autosave) (BoxesMachine* self);
	gboolean (*get_is_local) (BoxesMachine* self);
};

struct _BoxesBrokerAddSourceData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	BoxesBroker* self;
	BoxesCollectionSource* source;
	GList* used_configs;
	gint i;
	gboolean _tmp0_;
	gint _tmp1_;
	BoxesApp* _tmp2_;
	BoxesCollection* _tmp3_;
	guint _tmp4_;
	guint _tmp5_;
	BoxesCollectionItem* item;
	BoxesApp* _tmp6_;
	BoxesCollection* _tmp7_;
	BoxesCollectionItem* _tmp8_;
	BoxesCollectionItem* _tmp9_;
	BoxesMachine* machine;
	BoxesCollectionItem* _tmp10_;
	BoxesMachine* _tmp11_;
	BoxesMachine* _tmp12_;
	BoxesBoxConfig* _tmp13_;
	BoxesBoxConfig* _tmp14_;
	GList* _tmp15_;
};

struct _BoxesAppPrivate {
	GList* windows;
	GList* system_notifications;
	gchar* _uri;
	gboolean is_ready;
	gboolean _run_in_bg;
	GHashTable* brokers;
	GHashTable* sources;
	guint inhibit_cookie;
};

struct _Block1Data {
	int _ref_count_;
	BoxesApp* self;
	BoxesAppCallReadyFunc func;
	gpointer func_target;
	GDestroyNotify func_target_destroy_notify;
};

struct _Block2Data {
	int _ref_count_;
	BoxesApp* self;
	BoxesApp* app;
};

struct _Block3Data {
	int _ref_count_;
	Block2Data * _data2_;
	gchar* uuid;
};

struct _Block4Data {
	int _ref_count_;
	Block2Data * _data2_;
	gchar* arg;
};

struct _BoxesAppWindow {
	HdyApplicationWindow parent_instance;
	BoxesAppWindowPrivate * priv;
	BoxesSearchbar* searchbar;
	BoxesTopbar* topbar;
	BoxesToastOverlay* toast_overlay;
	BoxesDisplayPage* display_page;
	HdyStatusPage* empty_boxes;
	BoxesTroubleshootView* troubleshoot_view;
	GtkStack* below_bin;
	GSettings* settings;
};

struct _BoxesAppWindowClass {
	HdyApplicationWindowClass parent_class;
};

struct _Block5Data {
	int _ref_count_;
	BoxesApp* self;
	GFile** files;
	gint files_length1;
	gint _files_size_;
};

struct _Block6Data {
	int _ref_count_;
	BoxesApp* self;
	gchar* name;
};

struct _BoxesAppAddCollectionSourceData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	BoxesApp* self;
	BoxesCollectionSource* source;
	gboolean _tmp0_;
	gboolean _tmp1_;
	GHashTable* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gconstpointer _tmp6_;
	gboolean _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	BoxesBroker* broker;
	GHashTable* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	gconstpointer _tmp15_;
	BoxesBroker* _tmp16_;
	BoxesBroker* _tmp17_;
	BoxesBroker* _tmp18_;
	BoxesBroker* _tmp19_;
	GHashTable* _tmp20_;
	gchar* _tmp21_;
	gchar* _tmp22_;
	BoxesCollectionSource* _tmp23_;
	gchar* _tmp24_;
	gchar* _tmp25_;
	gchar* _tmp26_;
	gboolean _tmp27_;
	gchar* _tmp28_;
	gchar* _tmp29_;
	gchar* _tmp30_;
	GError* _inner_error0_;
};

struct _BoxesAppActivateAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	BoxesApp* self;
};

struct _BoxesAppSetupDefaultSourceData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	BoxesApp* self;
	gchar* path;
	gchar* _tmp0_;
	gboolean create_session_source;
	GFile* file;
	const gchar* _tmp1_;
	GFile* _tmp2_;
	GFileInfo* info;
	GFile* _tmp3_;
	GFileInfo* _tmp4_;
	GFileInfo* _tmp5_;
	GError* _error_;
	const gchar* _tmp6_;
	GError* _tmp7_;
	const gchar* _tmp8_;
	GFile* src;
	gchar* _tmp9_;
	gchar* _tmp10_;
	GFile* _tmp11_;
	GFile* _tmp12_;
	GFile* dst;
	const gchar* _tmp13_;
	GFile* _tmp14_;
	GFile* _tmp15_;
	GFile* _tmp16_;
	GError* _vala1__error_;
	GError* _tmp17_;
	const gchar* _tmp18_;
	BoxesCollectionSource* source;
	BoxesCollectionSource* _tmp19_;
	BoxesCollectionSource* _tmp20_;
	GError* _vala2__error_;
	GError* _tmp21_;
	const gchar* _tmp22_;
	BoxesAppWindow* _tmp23_;
	BoxesAppWindow* _tmp24_;
	GVirConnection* _tmp25_;
	GVirConnection* _tmp26_;
	GVirConnection* _tmp27_;
	GVirConnection* _tmp28_;
	GVirConnection* _tmp29_;
	GVirConnection* _tmp30_;
	GError* _inner_error0_;
};

struct _Block7Data {
	int _ref_count_;
	BoxesApp* self;
	GList* new_sources;
	gpointer _async_data_;
};

struct _BoxesAppSetupSourcesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	BoxesApp* self;
	Block7Data* _data7_;
	GFile* dir;
	gchar* _tmp0_;
	gchar* _tmp1_;
	GFile* _tmp2_;
	GFile* _tmp3_;
	GFile* _tmp4_;
	GList* _tmp5_;
	GList* source_collection;
	GList* source_it;
	BoxesCollectionSource* _tmp6_;
	BoxesCollectionSource* source;
	BoxesCollectionSource* _tmp7_;
	GError* _error_;
	BoxesCollectionSource* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	GError* _tmp12_;
	const gchar* _tmp13_;
	GError* _inner_error0_;
};

struct _Block8Data {
	int _ref_count_;
	BoxesApp* self;
	gint waiting_counter;
};

struct _Block9Data {
	int _ref_count_;
	Block8Data * _data8_;
	BoxesLibvirtMachine* machine;
};

struct _Block10Data {
	int _ref_count_;
	BoxesApp* self;
	GList* items;
	BoxesAppUndoNotifyCallback undo_notify_callback;
	gpointer undo_notify_callback_target;
	GDestroyNotify undo_notify_callback_target_destroy_notify;
};

struct _BoxesToast {
	GtkBox parent_instance;
	BoxesToastPrivate * priv;
	BoxesToastOKFunc undo_func;
	gpointer undo_func_target;
	GDestroyNotify undo_func_target_destroy_notify;
	BoxesToastDismissFunc dismiss_func;
	gpointer dismiss_func_target;
	GDestroyNotify dismiss_func_target_destroy_notify;
};

struct _BoxesToastClass {
	GtkBoxClass parent_class;
};

static gpointer boxes_broker_parent_class = NULL;
VALA_EXTERN BoxesApp* boxes_app_app;
static gint BoxesApp_private_offset;
static gpointer boxes_app_parent_class = NULL;
BoxesApp* boxes_app_app = NULL;
static gboolean* boxes_app_is_flatpak;
static gboolean* boxes_app_is_flatpak = NULL;
static gboolean boxes_app_opt_fullscreen;
static gboolean boxes_app_opt_fullscreen = FALSE;
static gchar* boxes_app_opt_open_uuid;
static gchar* boxes_app_opt_open_uuid = NULL;
static gchar** boxes_app_opt_uris;
static gint boxes_app_opt_uris_length1;
static gchar** boxes_app_opt_uris = NULL;
static gint boxes_app_opt_uris_length1 = 0;
static gint _boxes_app_opt_uris_size_ = 0;
static gchar** boxes_app_opt_search;
static gchar** boxes_app_opt_search = NULL;

VALA_EXTERN GType boxes_broker_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesBroker, g_object_unref)
VALA_EXTERN void boxes_broker_add_source (BoxesBroker* self,
                              BoxesCollectionSource* source,
                              GAsyncReadyCallback _callback_,
                              gpointer _user_data_);
VALA_EXTERN void boxes_broker_add_source_finish (BoxesBroker* self,
                                     GAsyncResult* _res_,
                                     GError** error);
static void boxes_broker_real_add_source_data_free (gpointer _data);
static void boxes_broker_real_add_source (BoxesBroker* self,
                                   BoxesCollectionSource* source,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_);
static gboolean boxes_broker_real_add_source_co (BoxesBrokerAddSourceData* _data_);
VALA_EXTERN GType boxes_app_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesApp, g_object_unref)
VALA_EXTERN GType boxes_collection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesCollection, g_object_unref)
VALA_EXTERN GType boxes_shared_folders_manager_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesSharedFoldersManager, g_object_unref)
VALA_EXTERN guint boxes_collection_get_length (BoxesCollection* self);
VALA_EXTERN GType boxes_collection_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesCollectionItem, g_object_unref)
VALA_EXTERN BoxesCollectionItem* boxes_collection_get_item (BoxesCollection* self,
                                                gint position);
VALA_EXTERN GType boxes_machine_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesMachine, g_object_unref)
VALA_EXTERN GType boxes_ui_state_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType boxes_ui_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesUI, g_object_unref)
VALA_EXTERN GType boxes_machine_connect_flags_get_type (void) G_GNUC_CONST ;
static void _g_object_unref0_ (gpointer var);
static inline void _g_list_free__g_object_unref0_ (GList* self);
VALA_EXTERN BoxesBroker* boxes_broker_construct (GType object_type);
static GType boxes_broker_get_type_once (void);
VALA_EXTERN GType boxes_app_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesAppWindow, g_object_unref)
static void _g_free0_ (gpointer var);
static inline void _g_list_free__g_free0_ (GList* self);
VALA_EXTERN BoxesSharedFoldersManager* boxes_shared_folders_manager_get_default (void);
VALA_EXTERN BoxesApp* boxes_app_new (void);
VALA_EXTERN BoxesApp* boxes_app_construct (GType object_type);
static void __lambda137_ (BoxesApp* self);
VALA_EXTERN gboolean boxes_app_quit_app (BoxesApp* self);
static void ___lambda137__g_simple_action_activate (GSimpleAction* _sender,
                                             GVariant* parameter,
                                             gpointer self);
static void __lambda138_ (BoxesApp* self);
VALA_EXTERN BoxesAppWindow* boxes_app_get_main_window (BoxesApp* self);
static void ___lambda138__g_simple_action_activate (GSimpleAction* _sender,
                                             GVariant* parameter,
                                             gpointer self);
static void __lambda139_ (BoxesApp* self,
                   GVariant* param);
VALA_EXTERN void boxes_app_open_name (BoxesApp* self,
                          const gchar* name);
static void ___lambda139__g_simple_action_activate (GSimpleAction* _sender,
                                             GVariant* parameter,
                                             gpointer self);
static void __lambda140_ (BoxesApp* self,
                   GVariant* param);
static void boxes_app_open_run_in_bg_vm (BoxesApp* self,
                                  const gchar* name);
static void ___lambda140__g_simple_action_activate (GSimpleAction* _sender,
                                             GVariant* parameter,
                                             gpointer self);
static void __lambda143_ (BoxesApp* self,
                   GVariant* param);
VALA_EXTERN void boxes_app_install (BoxesApp* self,
                        const gchar* path);
static void ___lambda143__g_simple_action_activate (GSimpleAction* _sender,
                                             GVariant* parameter,
                                             gpointer self);
static void __lambda144_ (BoxesApp* self);
static void ___lambda144__g_simple_action_activate (GSimpleAction* _sender,
                                             GVariant* parameter,
                                             gpointer self);
static void boxes_app_real_startup (GApplication* base);
VALA_EXTERN BoxesCollection* boxes_collection_new (void);
VALA_EXTERN BoxesCollection* boxes_collection_construct (GType object_type);
VALA_EXTERN GType boxes_libvirt_broker_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesLibvirtBroker, g_object_unref)
VALA_EXTERN BoxesLibvirtBroker* boxes_libvirt_broker_get_default (void);
VALA_EXTERN void boxes_check_cpu_vt_capability (GAsyncReadyCallback _callback_,
                                    gpointer _user_data_);
VALA_EXTERN gboolean boxes_check_cpu_vt_capability_finish (GAsyncResult* _res_);
VALA_EXTERN void boxes_check_module_kvm_loaded (GAsyncReadyCallback _callback_,
                                    gpointer _user_data_);
VALA_EXTERN gboolean boxes_check_module_kvm_loaded_finish (GAsyncResult* _res_);
VALA_EXTERN void boxes_app_call_when_ready (BoxesApp* self,
                                BoxesAppCallReadyFunc func,
                                gpointer func_target,
                                GDestroyNotify func_target_destroy_notify);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
static void __lambda65_ (Block1Data* _data1_);
static void ___lambda65__boxes_app_ready (BoxesApp* _sender,
                                   gpointer self);
static void boxes_app_real_activate (GApplication* base);
VALA_EXTERN BoxesAppWindow* boxes_app_add_new_window (BoxesApp* self);
VALA_EXTERN void boxes_ui_set_state (BoxesUI* self,
                         BoxesUIState new_state);
static void boxes_app_activate_async (BoxesApp* self,
                               GAsyncReadyCallback _callback_,
                               gpointer _user_data_);
static void boxes_app_activate_finish (BoxesApp* self,
                                GAsyncResult* _res_);
VALA_EXTERN void boxes_app_window_show_welcome_tutorial (BoxesAppWindow* self);
static gint boxes_app_real_command_line (GApplication* base,
                                  GApplicationCommandLine* cmdline);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (void * _userdata_);
static gchar** _vala_array_dup1 (gchar** self,
                          gssize length);
static Block3Data* block3_data_ref (Block3Data* _data3_);
static void block3_data_unref (void * _userdata_);
static void ___lambda145_ (Block3Data* _data3_);
VALA_EXTERN gboolean boxes_app_open_uuid (BoxesApp* self,
                              const gchar* uuid);
static void ____lambda145__boxes_app_call_ready_func (gpointer self);
static Block4Data* block4_data_ref (Block4Data* _data4_);
static void block4_data_unref (void * _userdata_);
static void ____lambda146_ (Block4Data* _data4_);
VALA_EXTERN void boxes_app_window_show_vm_assistant (BoxesAppWindow* self,
                                         const gchar* path);
static void _____lambda146__boxes_app_call_ready_func (gpointer self);
static void ___lambda147_ (BoxesApp* self);
VALA_EXTERN GType boxes_searchbar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesSearchbar, g_object_unref)
VALA_EXTERN GType boxes_topbar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesTopbar, g_object_unref)
VALA_EXTERN GType boxes_toast_overlay_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesToastOverlay, g_object_unref)
VALA_EXTERN GType boxes_display_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesDisplayPage, g_object_unref)
VALA_EXTERN GType boxes_troubleshoot_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesTroubleshootView, g_object_unref)
VALA_EXTERN void boxes_searchbar_set_text (BoxesSearchbar* self,
                               const gchar* value);
VALA_EXTERN BoxesUIState boxes_ui_get_ui_state (BoxesUI* self);
static void ____lambda147__boxes_app_call_ready_func (gpointer self);
VALA_EXTERN void boxes_app_window_set_fullscreened (BoxesAppWindow* self,
                                        gboolean value);
static void boxes_app_real_open (GApplication* base,
                          GFile** _files,
                          gint _files_length1,
                          const gchar* hint);
static Block5Data* block5_data_ref (Block5Data* _data5_);
static void block5_data_unref (void * _userdata_);
static GFile** _vala_array_dup2 (GFile** self,
                          gssize length);
static void __lambda148_ (Block5Data* _data5_);
static void ___lambda148__boxes_app_call_ready_func (gpointer self);
static void boxes_app_keep_on_running_on_background (BoxesApp* self);
VALA_EXTERN gboolean boxes_app_get_run_in_bg (BoxesApp* self);
static gboolean __lambda13_ (BoxesApp* self);
static gboolean ___lambda13__gsource_func (gpointer self);
static void boxes_app_real_shutdown (GApplication* base);
VALA_EXTERN void boxes_app_window_dismiss_toast (BoxesAppWindow* self);
static void boxes_app_suspend_machines (BoxesApp* self);
static Block6Data* block6_data_ref (Block6Data* _data6_);
static void block6_data_unref (void * _userdata_);
static void __lambda142_ (Block6Data* _data6_);
static void ___lambda142__boxes_app_call_ready_func (gpointer self);
VALA_EXTERN const gchar* boxes_collection_item_get_name (BoxesCollectionItem* self);
VALA_EXTERN void boxes_app_window_select_item (BoxesAppWindow* self,
                                   BoxesCollectionItem* item);
VALA_EXTERN void boxes_app_open_in_new_window (BoxesApp* self,
                                   BoxesMachine* machine);
VALA_EXTERN BoxesAppWindow* boxes_machine_get_window (BoxesMachine* self);
VALA_EXTERN void boxes_app_window_connect_to (BoxesAppWindow* self,
                                  BoxesMachine* machine);
VALA_EXTERN void boxes_app_delete_machine (BoxesApp* self,
                               BoxesMachine* machine,
                               gboolean by_user);
VALA_EXTERN void boxes_machine_delete (BoxesMachine* self,
                           gboolean by_user);
VALA_EXTERN void boxes_collection_remove_item (BoxesCollection* self,
                                   BoxesCollectionItem* item);
static void boxes_app_add_collection_source_data_free (gpointer _data);
VALA_EXTERN void boxes_app_add_collection_source (BoxesApp* self,
                                      BoxesCollectionSource* source,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_);
VALA_EXTERN void boxes_app_add_collection_source_finish (BoxesApp* self,
                                             GAsyncResult* _res_,
                                             GError** error);
static gboolean boxes_app_add_collection_source_co (BoxesAppAddCollectionSourceData* _data_);
static void boxes_app_add_collection_source_ready (GObject* source_object,
                                            GAsyncResult* _res_,
                                            gpointer _user_data_);
static void boxes_app_activate_async_data_free (gpointer _data);
static gboolean boxes_app_activate_async_co (BoxesAppActivateAsyncData* _data_);
VALA_EXTERN void boxes_move_configs_from_cache (GAsyncReadyCallback _callback_,
                                    gpointer _user_data_);
VALA_EXTERN void boxes_move_configs_from_cache_finish (GAsyncResult* _res_);
static void boxes_app_activate_async_ready (GObject* source_object,
                                     GAsyncResult* _res_,
                                     gpointer _user_data_);
static void boxes_app_setup_default_source (BoxesApp* self,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_);
static void boxes_app_setup_default_source_finish (BoxesApp* self,
                                            GAsyncResult* _res_);
static void boxes_app_setup_sources (BoxesApp* self,
                              GAsyncReadyCallback _callback_,
                              gpointer _user_data_);
static void boxes_app_setup_sources_finish (BoxesApp* self,
                                     GAsyncResult* _res_);
static void boxes_app_setup_default_source_data_free (gpointer _data);
static gboolean boxes_app_setup_default_source_co (BoxesAppSetupDefaultSourceData* _data_);
static void boxes_app_setup_default_source_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_);
VALA_EXTERN GVirConnection* boxes_app_get_default_connection (BoxesApp* self);
VALA_EXTERN void boxes_app_send_notification (BoxesApp* self,
                                  const gchar* notification_id,
                                  GNotification* notification);
VALA_EXTERN void boxes_app_notify_machine_installed (BoxesApp* self,
                                         BoxesMachine* machine);
static void boxes_app_setup_sources_data_free (gpointer _data);
static gboolean boxes_app_setup_sources_co (BoxesAppSetupSourcesData* _data_);
static Block7Data* block7_data_ref (Block7Data* _data7_);
static void block7_data_unref (void * _userdata_);
static gboolean __lambda141_ (Block7Data* _data7_,
                       const gchar* filename,
                       GError** error);
static gboolean ___lambda141__boxes_foreach_filename_from_dir_func (const gchar* filename,
                                                             gpointer self,
                                                             GError** error);
static void boxes_app_setup_sources_ready (GObject* source_object,
                                    GAsyncResult* _res_,
                                    gpointer _user_data_);
VALA_EXTERN GType boxes_libvirt_machine_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesLibvirtMachine, g_object_unref)
static void boxes_app_notify_vm_is_running_in_background (BoxesApp* self,
                                                   BoxesLibvirtMachine* machine);
VALA_EXTERN gboolean boxes_libvirt_machine_get_run_in_bg (BoxesLibvirtMachine* self);
VALA_EXTERN gboolean boxes_machine_get_is_running (BoxesMachine* self);
static void boxes_app_set_run_in_bg (BoxesApp* self,
                              gboolean value);
VALA_EXTERN void boxes_collection_foreach_item (BoxesCollection* self,
                                    BoxesCollectionCollectionForeachFunc foreach_func,
                                    gpointer foreach_func_target);
static void __lambda12_ (BoxesApp* self,
                  BoxesCollectionItem* item);
VALA_EXTERN gboolean boxes_app_is_running_in_flatpak (void);
static void ___lambda12__boxes_collection_collection_foreach_func (BoxesCollectionItem* item,
                                                            gpointer self);
static Block8Data* block8_data_ref (Block8Data* _data8_);
static void block8_data_unref (void * _userdata_);
static void __lambda149_ (Block8Data* _data8_,
                   BoxesCollectionItem* item);
static Block9Data* block9_data_ref (Block9Data* _data9_);
static void block9_data_unref (void * _userdata_);
VALA_EXTERN gboolean boxes_machine_get_suspend_at_exit (BoxesMachine* self);
VALA_EXTERN void boxes_libvirt_machine_suspend (BoxesLibvirtMachine* self,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_);
VALA_EXTERN void boxes_libvirt_machine_suspend_finish (BoxesLibvirtMachine* self,
                                           GAsyncResult* _res_,
                                           GError** error);
static void ____lambda150_ (Block9Data* _data9_);
static void _____lambda150__gasync_ready_callback (GObject* source_object,
                                            GAsyncResult* res,
                                            gpointer self);
static void ___lambda149__boxes_collection_collection_foreach_func (BoxesCollectionItem* item,
                                                             gpointer self);
VALA_EXTERN void boxes_app_delete_machines_undoable (BoxesApp* self,
                                         GList* items,
                                         const gchar* message,
                                         BoxesAppUndoNotifyCallback undo_notify_callback,
                                         gpointer undo_notify_callback_target,
                                         GDestroyNotify undo_notify_callback_target_destroy_notify);
static Block10Data* block10_data_ref (Block10Data* _data10_);
static void block10_data_unref (void * _userdata_);
static void __lambda67_ (Block10Data* _data10_);
VALA_EXTERN void boxes_collection_add_item (BoxesCollection* self,
                                BoxesCollectionItem* item);
static void ___lambda67__boxes_toast_ok_func (gpointer self);
static void __lambda68_ (Block10Data* _data10_);
static void ___lambda68__boxes_toast_dismiss_func (gpointer self);
VALA_EXTERN GType boxes_toast_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesToast, g_object_unref)
VALA_EXTERN void boxes_app_window_display_toast (BoxesAppWindow* self,
                                     BoxesToast* toast);
VALA_EXTERN BoxesToast* boxes_toast_new (const gchar* message);
VALA_EXTERN BoxesToast* boxes_toast_construct (GType object_type,
                                   const gchar* message);
VALA_EXTERN void boxes_toast_set_message (BoxesToast* self,
                              const gchar* value);
VALA_EXTERN void boxes_toast_set_action (BoxesToast* self,
                             const gchar* value);
VALA_EXTERN BoxesAppWindow* boxes_app_window_new (GtkApplication* app);
VALA_EXTERN BoxesAppWindow* boxes_app_window_construct (GType object_type,
                                            GtkApplication* app);
VALA_EXTERN void boxes_app_window_setup_ui (BoxesAppWindow* self);
VALA_EXTERN gboolean boxes_app_remove_window (BoxesApp* self,
                                  BoxesAppWindow* window);
VALA_EXTERN BoxesCollectionItem* boxes_app_window_get_current_item (BoxesAppWindow* self);
VALA_EXTERN void boxes_machine_set_window (BoxesMachine* self,
                               BoxesAppWindow* value);
VALA_EXTERN void boxes_app_inhibit (BoxesApp* self,
                        GtkWindow* window,
                        GtkApplicationInhibitFlags* flags,
                        const gchar* reason);
VALA_EXTERN void boxes_app_uninhibit (BoxesApp* self);
static gboolean* _bool_dup (gboolean* self);
VALA_EXTERN gboolean boxes_app_supports_uefi_installs (BoxesApp* self);
VALA_EXTERN const gchar* boxes_app_get_uri (BoxesApp* self);
VALA_EXTERN void boxes_app_set_uri (BoxesApp* self,
                        const gchar* value);
VALA_EXTERN GVirConnection* boxes_libvirt_broker_get_connection (BoxesLibvirtBroker* self,
                                                     const gchar* name);
VALA_EXTERN BoxesCollectionSource* boxes_app_get_default_source (BoxesApp* self);
static void boxes_app_finalize (GObject * obj);
static GType boxes_app_get_type_once (void);
static void _vala_boxes_app_get_property (GObject * object,
                                   guint property_id,
                                   GValue * value,
                                   GParamSpec * pspec);
static void _vala_boxes_app_set_property (GObject * object,
                                   guint property_id,
                                   const GValue * value,
                                   GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);

static const GOptionEntry BOXES_APP_options[6] = {{"version", (gchar) 0, (gint) 0, G_OPTION_ARG_NONE, NULL, N_ ("Display version number"), NULL}, {"full-screen", 'f', (gint) 0, G_OPTION_ARG_NONE, NULL, N_ ("Open in full screen"), NULL}, {"checks", (gchar) 0, (gint) 0, G_OPTION_ARG_NONE, NULL, N_ ("Check virtualization capabilities"), NULL}, {"open-uuid", (gchar) 0, (gint) 0, G_OPTION_ARG_STRING, NULL, N_ ("Open box with UUID"), N_ ("UUID")}, {"search", (gchar) 0, (gint) 0, G_OPTION_ARG_STRING_ARRAY, NULL, N_ ("Search term"), N_ ("TEXT")}, {NULL}};

static void
boxes_broker_real_add_source_data_free (gpointer _data)
{
	BoxesBrokerAddSourceData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->source);
	_g_object_unref0 (_data_->self);
	g_slice_free (BoxesBrokerAddSourceData, _data_);
}

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

static void
boxes_broker_real_add_source (BoxesBroker* self,
                              BoxesCollectionSource* source,
                              GAsyncReadyCallback _callback_,
                              gpointer _user_data_)
{
	BoxesBrokerAddSourceData* _data_;
	BoxesBroker* _tmp0_;
	BoxesCollectionSource* _tmp1_;
	g_return_if_fail (source != NULL);
	_data_ = g_slice_new0 (BoxesBrokerAddSourceData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, boxes_broker_real_add_source_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (source);
	_g_object_unref0 (_data_->source);
	_data_->source = _tmp1_;
	boxes_broker_real_add_source_co (_data_);
}

static void
boxes_broker_real_add_source_finish (BoxesBroker* self,
                                     GAsyncResult* _res_,
                                     GError** error)
{
	BoxesBrokerAddSourceData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
_g_object_unref0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
}

static inline void
_g_list_free__g_object_unref0_ (GList* self)
{
	g_list_free_full (self, (GDestroyNotify) _g_object_unref0_);
}

static gboolean
boxes_broker_real_add_source_co (BoxesBrokerAddSourceData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->used_configs = NULL;
	{
		_data_->i = 0;
		{
			_data_->_tmp0_ = TRUE;
			while (TRUE) {
				if (!_data_->_tmp0_) {
					_data_->_tmp1_ = _data_->i;
					_data_->i = _data_->_tmp1_ + 1;
				}
				_data_->_tmp0_ = FALSE;
				_data_->_tmp2_ = boxes_app_app;
				_data_->_tmp3_ = _data_->_tmp2_->collection;
				_data_->_tmp4_ = boxes_collection_get_length (_data_->_tmp3_);
				_data_->_tmp5_ = _data_->_tmp4_;
				if (!(((guint) _data_->i) < _data_->_tmp5_)) {
					break;
				}
				_data_->_tmp6_ = boxes_app_app;
				_data_->_tmp7_ = _data_->_tmp6_->collection;
				_data_->_tmp8_ = boxes_collection_get_item (_data_->_tmp7_, _data_->i);
				_data_->item = _data_->_tmp8_;
				_data_->_tmp9_ = _data_->item;
				if (!BOXES_IS_MACHINE (_data_->_tmp9_)) {
					_g_object_unref0 (_data_->item);
					continue;
				}
				_data_->_tmp10_ = _data_->item;
				_data_->_tmp11_ = _g_object_ref0 (BOXES_IS_MACHINE (_data_->_tmp10_) ? ((BoxesMachine*) _data_->_tmp10_) : NULL);
				_data_->machine = _data_->_tmp11_;
				_data_->_tmp12_ = _data_->machine;
				_data_->_tmp13_ = _data_->_tmp12_->config;
				_data_->_tmp14_ = _g_object_ref0 (_data_->_tmp13_);
				_data_->used_configs = g_list_append (_data_->used_configs, _data_->_tmp14_);
				_g_object_unref0 (_data_->machine);
				_g_object_unref0 (_data_->item);
			}
		}
	}
	_data_->_tmp15_ = _data_->used_configs;
	boxes_collection_source_purge_stale_box_configs (_data_->source, _data_->_tmp15_);
	(_data_->used_configs == NULL) ? NULL : (_data_->used_configs = (_g_list_free__g_object_unref0_ (_data_->used_configs), NULL));
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

void
boxes_broker_add_source (BoxesBroker* self,
                         BoxesCollectionSource* source,
                         GAsyncReadyCallback _callback_,
                         gpointer _user_data_)
{
	BoxesBrokerClass* _klass_;
	_klass_ = BOXES_BROKER_GET_CLASS (self);
	if (_klass_->add_source) {
		_klass_->add_source (self, source, _callback_, _user_data_);
	}
}

void
boxes_broker_add_source_finish (BoxesBroker* self,
                                GAsyncResult* _res_,
                                GError** error)
{
	BoxesBrokerClass* _klass_;
	_klass_ = BOXES_BROKER_GET_CLASS (self);
	if (_klass_->add_source_finish) {
		_klass_->add_source_finish (self, _res_, error);
	}
}

BoxesBroker*
boxes_broker_construct (GType object_type)
{
	BoxesBroker * self = NULL;
	self = (BoxesBroker*) g_object_new (object_type, NULL);
	return self;
}

static void
boxes_broker_class_init (BoxesBrokerClass * klass,
                         gpointer klass_data)
{
	boxes_broker_parent_class = g_type_class_peek_parent (klass);
	((BoxesBrokerClass *) klass)->add_source = (void (*) (BoxesBroker*, BoxesCollectionSource*, GAsyncReadyCallback, gpointer)) boxes_broker_real_add_source;
	((BoxesBrokerClass *) klass)->add_source_finish = (void (*) (BoxesBroker*, GAsyncResult*, GError**)) boxes_broker_real_add_source_finish;
}

static void
boxes_broker_instance_init (BoxesBroker * self,
                            gpointer klass)
{
}

static GType
boxes_broker_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BoxesBrokerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_broker_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesBroker), 0, (GInstanceInitFunc) boxes_broker_instance_init, NULL };
	GType boxes_broker_type_id;
	boxes_broker_type_id = g_type_register_static (G_TYPE_OBJECT, "BoxesBroker", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	return boxes_broker_type_id;
}

GType
boxes_broker_get_type (void)
{
	static volatile gsize boxes_broker_type_id__once = 0;
	if (g_once_init_enter (&boxes_broker_type_id__once)) {
		GType boxes_broker_type_id;
		boxes_broker_type_id = boxes_broker_get_type_once ();
		g_once_init_leave (&boxes_broker_type_id__once, boxes_broker_type_id);
	}
	return boxes_broker_type_id__once;
}

static inline gpointer
boxes_app_get_instance_private (BoxesApp* self)
{
	return G_STRUCT_MEMBER_P (self, BoxesApp_private_offset);
}

static void
_g_free0_ (gpointer var)
{
	var = (g_free (var), NULL);
}

static inline void
_g_list_free__g_free0_ (GList* self)
{
	g_list_free_full (self, (GDestroyNotify) _g_free0_);
}

static void
__lambda137_ (BoxesApp* self)
{
	boxes_app_quit_app (self);
}

static void
___lambda137__g_simple_action_activate (GSimpleAction* _sender,
                                        GVariant* parameter,
                                        gpointer self)
{
	__lambda137_ ((BoxesApp*) self);
}

static void
__lambda138_ (BoxesApp* self)
{
	GError* _inner_error0_ = NULL;
	{
		BoxesAppWindow* _tmp0_;
		BoxesAppWindow* _tmp1_;
		_tmp0_ = boxes_app_get_main_window (self);
		_tmp1_ = _tmp0_;
		gtk_show_uri_on_window ((GtkWindow*) _tmp1_, "help:gnome-boxes", gtk_get_current_event_time (), &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp2_;
		const gchar* _tmp3_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp2_ = e;
		_tmp3_ = _tmp2_->message;
		g_warning ("app.vala:96: Failed to display help: %s", _tmp3_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
___lambda138__g_simple_action_activate (GSimpleAction* _sender,
                                        GVariant* parameter,
                                        gpointer self)
{
	__lambda138_ ((BoxesApp*) self);
}

static void
__lambda139_ (BoxesApp* self,
              GVariant* param)
{
	const gchar* _tmp0_;
	_tmp0_ = g_variant_get_string (param, NULL);
	boxes_app_open_name (self, _tmp0_);
}

static void
___lambda139__g_simple_action_activate (GSimpleAction* _sender,
                                        GVariant* parameter,
                                        gpointer self)
{
	__lambda139_ ((BoxesApp*) self, parameter);
}

static void
__lambda140_ (BoxesApp* self,
              GVariant* param)
{
	const gchar* _tmp0_;
	_tmp0_ = g_variant_get_string (param, NULL);
	boxes_app_open_run_in_bg_vm (self, _tmp0_);
}

static void
___lambda140__g_simple_action_activate (GSimpleAction* _sender,
                                        GVariant* parameter,
                                        gpointer self)
{
	__lambda140_ ((BoxesApp*) self, parameter);
}

static void
__lambda143_ (BoxesApp* self,
              GVariant* param)
{
	const gchar* _tmp0_;
	_tmp0_ = g_variant_get_string (param, NULL);
	boxes_app_install (self, _tmp0_);
}

static void
___lambda143__g_simple_action_activate (GSimpleAction* _sender,
                                        GVariant* parameter,
                                        gpointer self)
{
	__lambda143_ ((BoxesApp*) self, parameter);
}

static void
__lambda144_ (BoxesApp* self)
{
	gchar** authors = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar** _tmp4_;
	gint authors_length1;
	gint _authors_size_;
	gchar** artists = NULL;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar** _tmp9_;
	gint artists_length1;
	gint _artists_size_;
	BoxesAppWindow* _tmp10_;
	BoxesAppWindow* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	_tmp0_ = g_strdup ("Alexander Larsson <alexl@redhat.com>");
	_tmp1_ = g_strdup ("Christophe Fergeau <cfergeau@redhat.com>");
	_tmp2_ = g_strdup ("Marc-André Lureau <marcandre.lureau@gmail.com>");
	_tmp3_ = g_strdup ("Zeeshan Ali (Khattak) <zeeshanak@gnome.org>");
	_tmp4_ = g_new0 (gchar*, 4 + 1);
	_tmp4_[0] = _tmp0_;
	_tmp4_[1] = _tmp1_;
	_tmp4_[2] = _tmp2_;
	_tmp4_[3] = _tmp3_;
	authors = _tmp4_;
	authors_length1 = 4;
	_authors_size_ = authors_length1;
	_tmp5_ = g_strdup ("Allan Day <aday@gnome.org>");
	_tmp6_ = g_strdup ("Jon McCann <jmccann@redhat.com>");
	_tmp7_ = g_strdup ("Jakub Steiner <jsteiner@redhat.com>");
	_tmp8_ = g_strdup ("Dave Jones <eevblog@yahoo.com.au>");
	_tmp9_ = g_new0 (gchar*, 4 + 1);
	_tmp9_[0] = _tmp5_;
	_tmp9_[1] = _tmp6_;
	_tmp9_[2] = _tmp7_;
	_tmp9_[3] = _tmp8_;
	artists = _tmp9_;
	artists_length1 = 4;
	_artists_size_ = artists_length1;
	_tmp10_ = boxes_app_get_main_window (self);
	_tmp11_ = _tmp10_;
	_tmp12_ = g_strconcat (_ ("Boxes"), NAME_SUFFIX, NULL);
	_tmp13_ = _tmp12_;
	gtk_show_about_dialog ((GtkWindow*) _tmp11_, "artists", artists, "authors", authors, "translator-credits", _ ("translator-credits"), "comments", _ ("A simple GNOME application to access virtual systems"), "copyright", "\xc2\xa9 2011-2018 Red Hat, Inc.", "license-type", GTK_LICENSE_LGPL_2_1, "program-name", _tmp13_, "logo-icon-name", APPLICATION_ID, "version", VERSION, "website", PACKAGE_URL, "wrap-license", TRUE, NULL);
	_g_free0 (_tmp13_);
	artists = (_vala_array_free (artists, artists_length1, (GDestroyNotify) g_free), NULL);
	authors = (_vala_array_free (authors, authors_length1, (GDestroyNotify) g_free), NULL);
}

static void
___lambda144__g_simple_action_activate (GSimpleAction* _sender,
                                        GVariant* parameter,
                                        gpointer self)
{
	__lambda144_ ((BoxesApp*) self);
}

BoxesApp*
boxes_app_construct (GType object_type)
{
	BoxesApp * self = NULL;
	GApplicationFlags _tmp0_;
	GApplicationFlags _tmp1_;
	GOptionGroup* _tmp2_;
	BoxesApp* _tmp3_;
	BoxesAsyncLauncher* _tmp4_;
	GHashFunc _tmp5_;
	GEqualFunc _tmp6_;
	GHashTable* _tmp7_;
	GHashFunc _tmp8_;
	GEqualFunc _tmp9_;
	GHashTable* _tmp10_;
	GSimpleAction* action = NULL;
	GSimpleAction* _tmp11_;
	GSimpleAction* _tmp12_;
	GSimpleAction* _tmp13_;
	GSimpleAction* _tmp14_;
	GSimpleAction* _tmp15_;
	GSimpleAction* _tmp16_;
	const GVariantType* _tmp17_;
	GSimpleAction* _tmp18_;
	GSimpleAction* _tmp19_;
	GSimpleAction* _tmp20_;
	const GVariantType* _tmp21_;
	GSimpleAction* _tmp22_;
	GSimpleAction* _tmp23_;
	GSimpleAction* _tmp24_;
	const GVariantType* _tmp25_;
	GSimpleAction* _tmp26_;
	GSimpleAction* _tmp27_;
	GSimpleAction* _tmp28_;
	GSimpleAction* _tmp29_;
	GSimpleAction* _tmp30_;
	GSimpleAction* _tmp31_;
	WebKitWebContext* webkit_context = NULL;
	WebKitWebContext* _tmp32_;
	WebKitWebContext* _tmp33_;
	self = (BoxesApp*) g_object_new (object_type, NULL);
	g_application_set_application_id ((GApplication*) self, APPLICATION_ID);
	_tmp0_ = g_application_get_flags ((GApplication*) self);
	_tmp1_ = _tmp0_;
	g_application_set_flags ((GApplication*) self, _tmp1_ | (G_APPLICATION_HANDLES_COMMAND_LINE | G_APPLICATION_HANDLES_OPEN));
	g_application_set_resource_base_path ((GApplication*) self, "/org/gnome/Boxes");
	g_application_set_option_context_parameter_string ((GApplication*) self, _ ("— A simple application to access virtual machines"));
	g_application_add_main_option_entries ((GApplication*) self, BOXES_APP_options);
	_tmp2_ = spice_get_option_group ();
	g_application_add_option_group ((GApplication*) self, _tmp2_);
	_tmp3_ = _g_object_ref0 (self);
	_g_object_unref0 (boxes_app_app);
	boxes_app_app = _tmp3_;
	_tmp4_ = boxes_async_launcher_get_default ();
	_boxes_async_launcher_unref0 (self->async_launcher);
	self->async_launcher = _tmp4_;
	(self->priv->windows == NULL) ? NULL : (self->priv->windows = (_g_list_free__g_object_unref0_ (self->priv->windows), NULL));
	self->priv->windows = NULL;
	(self->priv->system_notifications == NULL) ? NULL : (self->priv->system_notifications = (_g_list_free__g_free0_ (self->priv->system_notifications), NULL));
	self->priv->system_notifications = NULL;
	_tmp5_ = g_str_hash;
	_tmp6_ = g_str_equal;
	_tmp7_ = g_hash_table_new_full (_tmp5_, _tmp6_, _g_free0_, _g_object_unref0_);
	_g_hash_table_unref0 (self->priv->sources);
	self->priv->sources = _tmp7_;
	_tmp8_ = g_str_hash;
	_tmp9_ = g_str_equal;
	_tmp10_ = g_hash_table_new_full (_tmp8_, _tmp9_, _g_free0_, _g_object_unref0_);
	_g_hash_table_unref0 (self->priv->brokers);
	self->priv->brokers = _tmp10_;
	_tmp11_ = g_simple_action_new ("quit", NULL);
	action = _tmp11_;
	_tmp12_ = action;
	g_signal_connect_object (_tmp12_, "activate", (GCallback) ___lambda137__g_simple_action_activate, self, 0);
	_tmp13_ = action;
	g_action_map_add_action ((GActionMap*) self, (GAction*) _tmp13_);
	_tmp14_ = g_simple_action_new ("help", NULL);
	_g_object_unref0 (action);
	action = _tmp14_;
	_tmp15_ = action;
	g_signal_connect_object (_tmp15_, "activate", (GCallback) ___lambda138__g_simple_action_activate, self, 0);
	_tmp16_ = action;
	g_action_map_add_action ((GActionMap*) self, (GAction*) _tmp16_);
	_tmp17_ = G_VARIANT_TYPE_STRING;
	_tmp18_ = g_simple_action_new ("launch-box", _tmp17_);
	_g_object_unref0 (action);
	action = _tmp18_;
	_tmp19_ = action;
	g_signal_connect_object (_tmp19_, "activate", (GCallback) ___lambda139__g_simple_action_activate, self, 0);
	_tmp20_ = action;
	g_action_map_add_action ((GActionMap*) self, (GAction*) _tmp20_);
	_tmp21_ = G_VARIANT_TYPE_STRING;
	_tmp22_ = g_simple_action_new ("launch-run-in-bg-box", _tmp21_);
	_g_object_unref0 (action);
	action = _tmp22_;
	_tmp23_ = action;
	g_signal_connect_object (_tmp23_, "activate", (GCallback) ___lambda140__g_simple_action_activate, self, 0);
	_tmp24_ = action;
	g_action_map_add_action ((GActionMap*) self, (GAction*) _tmp24_);
	_tmp25_ = G_VARIANT_TYPE_STRING;
	_tmp26_ = g_simple_action_new ("install", _tmp25_);
	_g_object_unref0 (action);
	action = _tmp26_;
	_tmp27_ = action;
	g_signal_connect_object (_tmp27_, "activate", (GCallback) ___lambda143__g_simple_action_activate, self, 0);
	_tmp28_ = action;
	g_action_map_add_action ((GActionMap*) self, (GAction*) _tmp28_);
	_tmp29_ = g_simple_action_new ("about", NULL);
	_g_object_unref0 (action);
	action = _tmp29_;
	_tmp30_ = action;
	g_signal_connect_object (_tmp30_, "activate", (GCallback) ___lambda144__g_simple_action_activate, self, 0);
	_tmp31_ = action;
	g_action_map_add_action ((GActionMap*) self, (GAction*) _tmp31_);
	_tmp32_ = webkit_web_context_get_default ();
	_tmp33_ = _g_object_ref0 (_tmp32_);
	webkit_context = _tmp33_;
	webkit_web_context_set_sandbox_enabled (webkit_context, TRUE);
	_g_object_unref0 (webkit_context);
	_g_object_unref0 (action);
	return self;
}

BoxesApp*
boxes_app_new (void)
{
	return boxes_app_construct (BOXES_TYPE_APP);
}

static void
boxes_app_real_startup (GApplication* base)
{
	BoxesApp * self;
	gchar** args = NULL;
	gchar** _tmp0_;
	gint args_length1;
	gint _args_size_;
	gchar** args2 = NULL;
	gint args2_length1;
	gint _args2_size_;
	BoxesCollection* _tmp1_;
	GHashTable* _tmp2_;
	gchar* _tmp3_;
	BoxesLibvirtBroker* _tmp4_;
	self = (BoxesApp*) base;
	G_APPLICATION_CLASS (boxes_app_parent_class)->startup ((GApplication*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_application_get_type (), GtkApplication));
	hdy_init ();
	_tmp0_ = g_new0 (gchar*, 0 + 1);
	args = _tmp0_;
	args_length1 = 0;
	_args_size_ = args_length1;
	args2 = args;
	args2_length1 = args_length1;
	_args2_size_ = args2_length1;
	gtk_init ((gint*) (&args2_length1), &args2);
	_args2_size_ = args2_length1;
	_tmp1_ = boxes_collection_new ();
	_g_object_unref0 (self->collection);
	self->collection = _tmp1_;
	_tmp2_ = self->priv->brokers;
	_tmp3_ = g_strdup ("libvirt");
	_tmp4_ = boxes_libvirt_broker_get_default ();
	g_hash_table_insert (_tmp2_, _tmp3_, (BoxesBroker*) _tmp4_);
	boxes_check_cpu_vt_capability (NULL, NULL);
	boxes_check_module_kvm_loaded (NULL, NULL);
	args = (_vala_array_free (args, args_length1, (GDestroyNotify) g_free), NULL);
}

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_)) {
		BoxesApp* self;
		self = _data1_->self;
		(_data1_->func_target_destroy_notify == NULL) ? NULL : (_data1_->func_target_destroy_notify (_data1_->func_target), NULL);
		_data1_->func = NULL;
		_data1_->func_target = NULL;
		_data1_->func_target_destroy_notify = NULL;
		_g_object_unref0 (self);
		g_slice_free (Block1Data, _data1_);
	}
}

static void
__lambda65_ (Block1Data* _data1_)
{
	BoxesApp* self;
	self = _data1_->self;
	_data1_->func (_data1_->func_target);
}

static void
___lambda65__boxes_app_ready (BoxesApp* _sender,
                              gpointer self)
{
	__lambda65_ (self);
}

void
boxes_app_call_when_ready (BoxesApp* self,
                           BoxesAppCallReadyFunc func,
                           gpointer func_target,
                           GDestroyNotify func_target_destroy_notify)
{
	Block1Data* _data1_;
	g_return_if_fail (self != NULL);
	_data1_ = g_slice_new0 (Block1Data);
	_data1_->_ref_count_ = 1;
	_data1_->self = g_object_ref (self);
	(_data1_->func_target_destroy_notify == NULL) ? NULL : (_data1_->func_target_destroy_notify (_data1_->func_target), NULL);
	_data1_->func = NULL;
	_data1_->func_target = NULL;
	_data1_->func_target_destroy_notify = NULL;
	_data1_->func = func;
	_data1_->func_target = func_target;
	_data1_->func_target_destroy_notify = func_target_destroy_notify;
	if (self->priv->is_ready) {
		_data1_->func (_data1_->func_target);
	}
	g_signal_connect_data (self, "ready", (GCallback) ___lambda65__boxes_app_ready, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
	block1_data_unref (_data1_);
	_data1_ = NULL;
}

static void
boxes_app_real_activate (GApplication* base)
{
	BoxesApp * self;
	BoxesAppWindow* _tmp0_;
	BoxesAppWindow* _tmp1_;
	BoxesAppWindow* window = NULL;
	BoxesAppWindow* _tmp4_;
	BoxesAppWindow* _tmp5_;
	BoxesAppWindow* _tmp6_;
	self = (BoxesApp*) base;
	G_APPLICATION_CLASS (boxes_app_parent_class)->activate ((GApplication*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_application_get_type (), GtkApplication));
	_tmp0_ = boxes_app_get_main_window (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ != NULL) {
		BoxesAppWindow* _tmp2_;
		BoxesAppWindow* _tmp3_;
		_tmp2_ = boxes_app_get_main_window (self);
		_tmp3_ = _tmp2_;
		gtk_window_present ((GtkWindow*) _tmp3_);
		return;
	}
	_tmp4_ = boxes_app_add_new_window (self);
	window = _tmp4_;
	_tmp5_ = window;
	boxes_ui_set_state ((BoxesUI*) _tmp5_, BOXES_UI_STATE_COLLECTION);
	boxes_app_activate_async (self, NULL, NULL);
	_tmp6_ = window;
	boxes_app_window_show_welcome_tutorial (_tmp6_);
	_g_object_unref0 (window);
}

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_)) {
		BoxesApp* self;
		self = _data2_->self;
		_g_object_unref0 (_data2_->app);
		_g_object_unref0 (self);
		g_slice_free (Block2Data, _data2_);
	}
}

static gpointer
_g_variant_dict_ref0 (gpointer self)
{
	return self ? g_variant_dict_ref (self) : NULL;
}

static gchar**
_vala_array_dup1 (gchar** self,
                  gssize length)
{
	if (length >= 0) {
		gchar** result;
		gssize i;
		result = g_new0 (gchar*, length + 1);
		for (i = 0; i < length; i++) {
			gchar* _tmp0_;
			_tmp0_ = g_strdup (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

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_)) {
		BoxesApp* self;
		self = _data3_->_data2_->self;
		_g_free0 (_data3_->uuid);
		block2_data_unref (_data3_->_data2_);
		_data3_->_data2_ = NULL;
		g_slice_free (Block3Data, _data3_);
	}
}

static void
___lambda145_ (Block3Data* _data3_)
{
	Block2Data* _data2_;
	BoxesApp* self;
	BoxesApp* _tmp0_;
	const gchar* _tmp1_;
	_data2_ = _data3_->_data2_;
	self = _data2_->self;
	_tmp0_ = _data2_->app;
	_tmp1_ = _data3_->uuid;
	boxes_app_open_uuid (_tmp0_, _tmp1_);
}

static void
____lambda145__boxes_app_call_ready_func (gpointer self)
{
	___lambda145_ (self);
}

static Block4Data*
block4_data_ref (Block4Data* _data4_)
{
	g_atomic_int_inc (&_data4_->_ref_count_);
	return _data4_;
}

static void
block4_data_unref (void * _userdata_)
{
	Block4Data* _data4_;
	_data4_ = (Block4Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data4_->_ref_count_)) {
		BoxesApp* self;
		self = _data4_->_data2_->self;
		_g_free0 (_data4_->arg);
		block2_data_unref (_data4_->_data2_);
		_data4_->_data2_ = NULL;
		g_slice_free (Block4Data, _data4_);
	}
}

static void
____lambda146_ (Block4Data* _data4_)
{
	Block2Data* _data2_;
	BoxesApp* self;
	GFile* file = NULL;
	const gchar* _tmp0_;
	GFile* _tmp1_;
	GFile* _tmp2_;
	_data2_ = _data4_->_data2_;
	self = _data2_->self;
	_tmp0_ = _data4_->arg;
	_tmp1_ = g_file_new_for_commandline_arg (_tmp0_);
	file = _tmp1_;
	_tmp2_ = file;
	if (g_file_query_exists (_tmp2_, NULL)) {
		BoxesAppWindow* _tmp3_;
		BoxesAppWindow* _tmp4_;
		GFile* _tmp5_;
		gchar* _tmp6_;
		gchar* _tmp7_;
		_tmp3_ = boxes_app_get_main_window (self);
		_tmp4_ = _tmp3_;
		_tmp5_ = file;
		_tmp6_ = g_file_get_path (_tmp5_);
		_tmp7_ = _tmp6_;
		boxes_app_window_show_vm_assistant (_tmp4_, _tmp7_);
		_g_free0 (_tmp7_);
	} else {
		const gchar* _tmp8_;
		_tmp8_ = _data4_->arg;
		boxes_app_open_name (self, _tmp8_);
	}
	_g_object_unref0 (file);
}

static void
_____lambda146__boxes_app_call_ready_func (gpointer self)
{
	____lambda146_ (self);
}

static gchar*
_vala_g_strjoinv (const gchar* separator,
                  gchar** str_array,
                  gint str_array_length1)
{
	gboolean _tmp0_ = FALSE;
	gchar* result;
	if (separator == NULL) {
		separator = "";
	}
	if (str_array != NULL) {
		gboolean _tmp1_ = FALSE;
		if (str_array_length1 > 0) {
			_tmp1_ = TRUE;
		} else {
			gboolean _tmp2_ = FALSE;
			if (str_array_length1 == -1) {
				const gchar* _tmp3_;
				_tmp3_ = str_array[0];
				_tmp2_ = _tmp3_ != NULL;
			} else {
				_tmp2_ = FALSE;
			}
			_tmp1_ = _tmp2_;
		}
		_tmp0_ = _tmp1_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		gint i = 0;
		gsize len = 0UL;
		gint _tmp16_;
		gint _tmp17_;
		const gchar* res = NULL;
		void* _tmp18_;
		const gchar* _tmp19_ = NULL;
		const gchar* _tmp20_;
		void* ptr = NULL;
		const gchar* _tmp22_;
		void* _tmp23_;
		const gchar* _tmp33_;
		len = (gsize) 1;
		{
			gboolean _tmp4_ = FALSE;
			i = 0;
			_tmp4_ = TRUE;
			while (TRUE) {
				gboolean _tmp6_ = FALSE;
				gboolean _tmp7_ = FALSE;
				gint _tmp10_ = 0;
				const gchar* _tmp11_;
				if (!_tmp4_) {
					gint _tmp5_;
					_tmp5_ = i;
					i = _tmp5_ + 1;
				}
				_tmp4_ = FALSE;
				if (str_array_length1 != -1) {
					_tmp7_ = i < str_array_length1;
				} else {
					_tmp7_ = FALSE;
				}
				if (_tmp7_) {
					_tmp6_ = TRUE;
				} else {
					gboolean _tmp8_ = FALSE;
					if (str_array_length1 == -1) {
						const gchar* _tmp9_;
						_tmp9_ = str_array[i];
						_tmp8_ = _tmp9_ != NULL;
					} else {
						_tmp8_ = FALSE;
					}
					_tmp6_ = _tmp8_;
				}
				if (!_tmp6_) {
					break;
				}
				_tmp11_ = str_array[i];
				if (_tmp11_ != NULL) {
					const gchar* _tmp12_;
					gint _tmp13_;
					gint _tmp14_;
					_tmp12_ = str_array[i];
					_tmp13_ = strlen ((const gchar*) _tmp12_);
					_tmp14_ = _tmp13_;
					_tmp10_ = _tmp14_;
				} else {
					_tmp10_ = 0;
				}
				len += (gsize) _tmp10_;
			}
		}
		if (i == 0) {
			gchar* _tmp15_;
			_tmp15_ = g_strdup ("");
			result = _tmp15_;
			return result;
		}
		str_array_length1 = i;
		_tmp16_ = strlen ((const gchar*) separator);
		_tmp17_ = _tmp16_;
		len += (gsize) (_tmp17_ * (i - 1));
		_tmp18_ = g_malloc (len);
		res = _tmp18_;
		_tmp20_ = str_array[0];
		if (_tmp20_ != NULL) {
			const gchar* _tmp21_;
			_tmp21_ = str_array[0];
			_tmp19_ = (const gchar*) _tmp21_;
		} else {
			_tmp19_ = "";
		}
		_tmp22_ = res;
		_tmp23_ = g_stpcpy ((void*) _tmp22_, _tmp19_);
		ptr = _tmp23_;
		{
			gboolean _tmp24_ = FALSE;
			i = 1;
			_tmp24_ = TRUE;
			while (TRUE) {
				void* _tmp26_;
				void* _tmp27_;
				const gchar* _tmp28_ = NULL;
				const gchar* _tmp29_;
				void* _tmp31_;
				void* _tmp32_;
				if (!_tmp24_) {
					gint _tmp25_;
					_tmp25_ = i;
					i = _tmp25_ + 1;
				}
				_tmp24_ = FALSE;
				if (!(i < str_array_length1)) {
					break;
				}
				_tmp26_ = ptr;
				_tmp27_ = g_stpcpy (_tmp26_, (const gchar*) separator);
				ptr = _tmp27_;
				_tmp29_ = str_array[i];
				if (_tmp29_ != NULL) {
					const gchar* _tmp30_;
					_tmp30_ = str_array[i];
					_tmp28_ = (const gchar*) _tmp30_;
				} else {
					_tmp28_ = "";
				}
				_tmp31_ = ptr;
				_tmp32_ = g_stpcpy (_tmp31_, _tmp28_);
				ptr = _tmp32_;
			}
		}
		_tmp33_ = res;
		res = NULL;
		result = (gchar*) _tmp33_;
		return result;
	} else {
		gchar* _tmp34_;
		_tmp34_ = g_strdup ("");
		result = _tmp34_;
		return result;
	}
}

static void
___lambda147_ (BoxesApp* self)
{
	BoxesAppWindow* _tmp0_;
	BoxesAppWindow* _tmp1_;
	BoxesSearchbar* _tmp2_;
	gchar** _tmp3_;
	gint _tmp3__length1;
	gchar* _tmp4_;
	gchar* _tmp5_;
	BoxesAppWindow* _tmp6_;
	BoxesAppWindow* _tmp7_;
	BoxesUIState _tmp8_;
	BoxesUIState _tmp9_;
	_tmp0_ = boxes_app_get_main_window (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_->searchbar;
	_tmp3_ = boxes_app_opt_search;
	_tmp3__length1 = _vala_array_length (boxes_app_opt_search);
	_tmp4_ = _vala_g_strjoinv (" ", _tmp3_, (gint) _tmp3__length1);
	_tmp5_ = _tmp4_;
	boxes_searchbar_set_text (_tmp2_, _tmp5_);
	_g_free0 (_tmp5_);
	_tmp6_ = boxes_app_get_main_window (self);
	_tmp7_ = _tmp6_;
	_tmp8_ = boxes_ui_get_ui_state ((BoxesUI*) _tmp7_);
	_tmp9_ = _tmp8_;
	if (_tmp9_ == BOXES_UI_STATE_COLLECTION) {
		BoxesAppWindow* _tmp10_;
		BoxesAppWindow* _tmp11_;
		BoxesSearchbar* _tmp12_;
		_tmp10_ = boxes_app_get_main_window (self);
		_tmp11_ = _tmp10_;
		_tmp12_ = _tmp11_->searchbar;
		g_object_set ((GtkSearchBar*) _tmp12_, "search-mode-enabled", TRUE, NULL);
	}
}

static void
____lambda147__boxes_app_call_ready_func (gpointer self)
{
	___lambda147_ ((BoxesApp*) self);
}

static gint
boxes_app_real_command_line (GApplication* base,
                             GApplicationCommandLine* cmdline)
{
	BoxesApp * self;
	Block2Data* _data2_;
	GVariantDict* options = NULL;
	GVariantDict* _tmp0_;
	GVariantDict* _tmp1_;
	GVariantDict* _tmp2_;
	gboolean _tmp3_ = FALSE;
	GVariantDict* _tmp4_;
	gchar* _tmp5_ = NULL;
	GVariantDict* _tmp6_;
	gchar** _tmp7_ = NULL;
	gint _tmp8_ = 0;
	gchar** _tmp9_;
	gchar** _tmp10_;
	gint _tmp10__length1;
	gint _tmp11_ = 0;
	gchar** _tmp12_;
	gchar** _tmp13_;
	gint _tmp13__length1;
	gchar** _tmp14_;
	gint _tmp14__length1;
	gboolean _tmp15_ = FALSE;
	gchar** _tmp16_;
	gint _tmp16__length1;
	BoxesApp* _tmp21_;
	const gchar* _tmp22_;
	gchar** _tmp30_;
	gint _tmp30__length1;
	gint result;
	self = (BoxesApp*) base;
	g_return_val_if_fail (cmdline != NULL, 0);
	_data2_ = g_slice_new0 (Block2Data);
	_data2_->_ref_count_ = 1;
	_data2_->self = g_object_ref (self);
	_tmp0_ = g_application_command_line_get_options_dict (cmdline);
	_tmp1_ = _g_variant_dict_ref0 (_tmp0_);
	options = _tmp1_;
	_tmp2_ = options;
	g_variant_dict_lookup (_tmp2_, "full-screen", "b", &_tmp3_, NULL);
	boxes_app_opt_fullscreen = _tmp3_;
	_tmp4_ = options;
	g_variant_dict_lookup (_tmp4_, "open-uuid", "s", &_tmp5_, NULL);
	_g_free0 (boxes_app_opt_open_uuid);
	boxes_app_opt_open_uuid = _tmp5_;
	_tmp6_ = options;
	g_variant_dict_lookup (_tmp6_, "search", "^as", &_tmp7_, NULL);
	boxes_app_opt_search = (_vala_array_free (boxes_app_opt_search, _vala_array_length (boxes_app_opt_search), (GDestroyNotify) g_free), NULL);
	boxes_app_opt_search = _tmp7_;
	_tmp9_ = g_application_command_line_get_arguments (cmdline, &_tmp8_);
	_tmp10_ = _tmp9_;
	_tmp10__length1 = _tmp8_;
	_tmp12_ = g_application_command_line_get_arguments (cmdline, &_tmp11_);
	_tmp13_ = _tmp12_;
	_tmp13__length1 = _tmp8_;
	_tmp14_ = (_tmp13_ != NULL) ? _vala_array_dup1 (_tmp13_ + 1, _tmp8_ - 1) : _tmp13_;
	_tmp14__length1 = _tmp8_ - 1;
	boxes_app_opt_uris = (_vala_array_free (boxes_app_opt_uris, boxes_app_opt_uris_length1, (GDestroyNotify) g_free), NULL);
	boxes_app_opt_uris = _tmp14_;
	boxes_app_opt_uris_length1 = _tmp14__length1;
	_boxes_app_opt_uris_size_ = boxes_app_opt_uris_length1;
	_tmp13_ = (_vala_array_free (_tmp13_, _tmp13__length1, (GDestroyNotify) g_free), NULL);
	_tmp10_ = (_vala_array_free (_tmp10_, _tmp10__length1, (GDestroyNotify) g_free), NULL);
	_tmp16_ = boxes_app_opt_uris;
	_tmp16__length1 = boxes_app_opt_uris_length1;
	if (_tmp16__length1 > 1) {
		_tmp15_ = TRUE;
	} else {
		gboolean _tmp17_ = FALSE;
		const gchar* _tmp18_;
		_tmp18_ = boxes_app_opt_open_uuid;
		if (_tmp18_ != NULL) {
			gchar** _tmp19_;
			gint _tmp19__length1;
			const gchar* _tmp20_;
			_tmp19_ = boxes_app_opt_uris;
			_tmp19__length1 = boxes_app_opt_uris_length1;
			_tmp20_ = _tmp19_[0];
			_tmp17_ = _tmp20_ != NULL;
		} else {
			_tmp17_ = FALSE;
		}
		_tmp15_ = _tmp17_;
	}
	if (_tmp15_) {
		g_application_command_line_printerr (cmdline, "%s", _ ("Too many command line arguments specified.\n"));
		result = 1;
		_g_variant_dict_unref0 (options);
		block2_data_unref (_data2_);
		_data2_ = NULL;
		return result;
	}
	g_application_activate ((GApplication*) self);
	_tmp21_ = _g_object_ref0 (self);
	_data2_->app = _tmp21_;
	_tmp22_ = boxes_app_opt_open_uuid;
	if (_tmp22_ != NULL) {
		Block3Data* _data3_;
		const gchar* _tmp23_;
		gchar* _tmp24_;
		_data3_ = g_slice_new0 (Block3Data);
		_data3_->_ref_count_ = 1;
		_data3_->_data2_ = block2_data_ref (_data2_);
		_tmp23_ = boxes_app_opt_open_uuid;
		_tmp24_ = g_strdup (_tmp23_);
		_data3_->uuid = _tmp24_;
		boxes_app_call_when_ready (self, ____lambda145__boxes_app_call_ready_func, block3_data_ref (_data3_), block3_data_unref);
		block3_data_unref (_data3_);
		_data3_ = NULL;
	} else {
		gchar** _tmp25_;
		gint _tmp25__length1;
		const gchar* _tmp26_;
		_tmp25_ = boxes_app_opt_uris;
		_tmp25__length1 = boxes_app_opt_uris_length1;
		_tmp26_ = _tmp25_[0];
		if (_tmp26_ != NULL) {
			Block4Data* _data4_;
			gchar** _tmp27_;
			gint _tmp27__length1;
			const gchar* _tmp28_;
			gchar* _tmp29_;
			_data4_ = g_slice_new0 (Block4Data);
			_data4_->_ref_count_ = 1;
			_data4_->_data2_ = block2_data_ref (_data2_);
			_tmp27_ = boxes_app_opt_uris;
			_tmp27__length1 = boxes_app_opt_uris_length1;
			_tmp28_ = _tmp27_[0];
			_tmp29_ = g_strdup (_tmp28_);
			_data4_->arg = _tmp29_;
			boxes_app_call_when_ready (self, _____lambda146__boxes_app_call_ready_func, block4_data_ref (_data4_), block4_data_unref);
			block4_data_unref (_data4_);
			_data4_ = NULL;
		}
	}
	_tmp30_ = boxes_app_opt_search;
	_tmp30__length1 = _vala_array_length (boxes_app_opt_search);
	if (_tmp30_ != NULL) {
		boxes_app_call_when_ready (self, ____lambda147__boxes_app_call_ready_func, g_object_ref (self), g_object_unref);
	}
	if (boxes_app_opt_fullscreen) {
		BoxesAppWindow* _tmp31_;
		BoxesAppWindow* _tmp32_;
		_tmp31_ = boxes_app_get_main_window (self);
		_tmp32_ = _tmp31_;
		boxes_app_window_set_fullscreened (_tmp32_, TRUE);
	}
	result = 0;
	_g_variant_dict_unref0 (options);
	block2_data_unref (_data2_);
	_data2_ = NULL;
	return result;
}

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

static void
block5_data_unref (void * _userdata_)
{
	Block5Data* _data5_;
	_data5_ = (Block5Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data5_->_ref_count_)) {
		BoxesApp* self;
		self = _data5_->self;
		_data5_->files = (_vala_array_free (_data5_->files, _data5_->files_length1, (GDestroyNotify) g_object_unref), NULL);
		_g_object_unref0 (self);
		g_slice_free (Block5Data, _data5_);
	}
}

static GFile**
_vala_array_dup2 (GFile** self,
                  gssize length)
{
	if (length >= 0) {
		GFile** result;
		gssize i;
		result = g_new0 (GFile*, length + 1);
		for (i = 0; i < length; i++) {
			GFile* _tmp0_;
			_tmp0_ = _g_object_ref0 (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

static void
__lambda148_ (Block5Data* _data5_)
{
	BoxesApp* self;
	self = _data5_->self;
	{
		GFile** file_collection = NULL;
		gint file_collection_length1 = 0;
		gint _file_collection_size_ = 0;
		gint file_it = 0;
		file_collection = _data5_->files;
		file_collection_length1 = _data5_->files_length1;
		for (file_it = 0; file_it < file_collection_length1; file_it = file_it + 1) {
			GFile* _tmp0_;
			GFile* file = NULL;
			_tmp0_ = _g_object_ref0 (file_collection[file_it]);
			file = _tmp0_;
			{
				BoxesAppWindow* _tmp1_;
				BoxesAppWindow* _tmp2_;
				GFile* _tmp3_;
				gchar* _tmp4_;
				gchar* _tmp5_;
				_tmp1_ = boxes_app_get_main_window (self);
				_tmp2_ = _tmp1_;
				_tmp3_ = file;
				_tmp4_ = g_file_get_path (_tmp3_);
				_tmp5_ = _tmp4_;
				boxes_app_window_show_vm_assistant (_tmp2_, _tmp5_);
				_g_free0 (_tmp5_);
				_g_object_unref0 (file);
			}
		}
	}
}

static void
___lambda148__boxes_app_call_ready_func (gpointer self)
{
	__lambda148_ (self);
}

static void
boxes_app_real_open (GApplication* base,
                     GFile** _files,
                     gint _files_length1,
                     const gchar* hint)
{
	BoxesApp * self;
	Block5Data* _data5_;
	GFile** _tmp0_;
	gint _tmp0__length1;
	self = (BoxesApp*) base;
	g_return_if_fail (hint != NULL);
	_data5_ = g_slice_new0 (Block5Data);
	_data5_->_ref_count_ = 1;
	_data5_->self = g_object_ref (self);
	g_application_activate ((GApplication*) self);
	_tmp0_ = (_files != NULL) ? _vala_array_dup2 (_files, _files_length1) : _files;
	_tmp0__length1 = _files_length1;
	_data5_->files = _tmp0_;
	_data5_->files_length1 = _tmp0__length1;
	_data5_->_files_size_ = _data5_->files_length1;
	boxes_app_call_when_ready (self, ___lambda148__boxes_app_call_ready_func, block5_data_ref (_data5_), block5_data_unref);
	block5_data_unref (_data5_);
	_data5_ = NULL;
}

static gboolean
__lambda13_ (BoxesApp* self)
{
	gboolean result;
	g_application_quit ((GApplication*) self);
	result = FALSE;
	return result;
}

static gboolean
___lambda13__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda13_ ((BoxesApp*) self);
	return result;
}

gboolean
boxes_app_quit_app (BoxesApp* self)
{
	GList* _tmp0_;
	GdkDisplay* display = NULL;
	GdkDisplay* _tmp3_;
	GdkDisplay* _tmp4_;
	GdkDisplay* _tmp5_;
	gboolean _tmp6_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->windows;
	{
		GList* window_collection = NULL;
		GList* window_it = NULL;
		window_collection = _tmp0_;
		for (window_it = window_collection; window_it != NULL; window_it = window_it->next) {
			BoxesAppWindow* _tmp1_;
			BoxesAppWindow* window = NULL;
			_tmp1_ = _g_object_ref0 ((BoxesAppWindow*) window_it->data);
			window = _tmp1_;
			{
				BoxesAppWindow* _tmp2_;
				_tmp2_ = window;
				gtk_widget_hide ((GtkWidget*) _tmp2_);
				_g_object_unref0 (window);
			}
		}
	}
	_tmp3_ = gdk_display_get_default ();
	_tmp4_ = _g_object_ref0 (_tmp3_);
	display = _tmp4_;
	_tmp5_ = display;
	gdk_display_flush (_tmp5_);
	boxes_app_keep_on_running_on_background (self);
	_tmp6_ = self->priv->_run_in_bg;
	if (_tmp6_) {
		result = TRUE;
		_g_object_unref0 (display);
		return result;
	}
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda13__gsource_func, g_object_ref (self), g_object_unref);
	result = TRUE;
	_g_object_unref0 (display);
	return result;
}

static void
boxes_app_real_shutdown (GApplication* base)
{
	BoxesApp * self;
	gboolean _tmp0_;
	BoxesAppWindow* _tmp4_;
	BoxesAppWindow* _tmp5_;
	BoxesAsyncLauncher* _tmp8_;
	self = (BoxesApp*) base;
	_tmp0_ = self->priv->_run_in_bg;
	if (!_tmp0_) {
		GList* _tmp1_;
		G_APPLICATION_CLASS (boxes_app_parent_class)->shutdown ((GApplication*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_application_get_type (), GtkApplication));
		_tmp1_ = self->priv->system_notifications;
		{
			GList* notification_collection = NULL;
			GList* notification_it = NULL;
			notification_collection = _tmp1_;
			for (notification_it = notification_collection; notification_it != NULL; notification_it = notification_it->next) {
				gchar* _tmp2_;
				gchar* notification = NULL;
				_tmp2_ = g_strdup ((const gchar*) notification_it->data);
				notification = _tmp2_;
				{
					const gchar* _tmp3_;
					_tmp3_ = notification;
					g_application_withdraw_notification ((GApplication*) self, _tmp3_);
					_g_free0 (notification);
				}
			}
		}
	} else {
		g_application_hold ((GApplication*) self);
	}
	_tmp4_ = boxes_app_get_main_window (self);
	_tmp5_ = _tmp4_;
	if (_tmp5_ != NULL) {
		BoxesAppWindow* _tmp6_;
		BoxesAppWindow* _tmp7_;
		_tmp6_ = boxes_app_get_main_window (self);
		_tmp7_ = _tmp6_;
		boxes_app_window_dismiss_toast (_tmp7_);
	}
	_tmp8_ = self->async_launcher;
	boxes_async_launcher_await_all (_tmp8_);
	boxes_app_suspend_machines (self);
}

static Block6Data*
block6_data_ref (Block6Data* _data6_)
{
	g_atomic_int_inc (&_data6_->_ref_count_);
	return _data6_;
}

static void
block6_data_unref (void * _userdata_)
{
	Block6Data* _data6_;
	_data6_ = (Block6Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data6_->_ref_count_)) {
		BoxesApp* self;
		self = _data6_->self;
		_g_free0 (_data6_->name);
		_g_object_unref0 (self);
		g_slice_free (Block6Data, _data6_);
	}
}

static void
__lambda142_ (Block6Data* _data6_)
{
	BoxesApp* self;
	self = _data6_->self;
	boxes_app_open_name (self, _data6_->name);
}

static void
___lambda142__boxes_app_call_ready_func (gpointer self)
{
	__lambda142_ (self);
}

static void
boxes_app_open_run_in_bg_vm (BoxesApp* self,
                             const gchar* name)
{
	Block6Data* _data6_;
	gchar* _tmp0_;
	BoxesAppWindow* _tmp1_;
	BoxesAppWindow* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (name != NULL);
	_data6_ = g_slice_new0 (Block6Data);
	_data6_->_ref_count_ = 1;
	_data6_->self = g_object_ref (self);
	_tmp0_ = g_strdup (name);
	_g_free0 (_data6_->name);
	_data6_->name = _tmp0_;
	g_application_activate ((GApplication*) self);
	_tmp1_ = boxes_app_get_main_window (self);
	_tmp2_ = _tmp1_;
	gtk_window_present ((GtkWindow*) _tmp2_);
	boxes_app_call_when_ready (self, ___lambda142__boxes_app_call_ready_func, block6_data_ref (_data6_), block6_data_unref);
	block6_data_unref (_data6_);
	_data6_ = NULL;
}

void
boxes_app_open_name (BoxesApp* self,
                     const gchar* name)
{
	BoxesAppWindow* _tmp0_;
	BoxesAppWindow* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (name != NULL);
	_tmp0_ = boxes_app_get_main_window (self);
	_tmp1_ = _tmp0_;
	boxes_ui_set_state ((BoxesUI*) _tmp1_, BOXES_UI_STATE_COLLECTION);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				BoxesCollection* _tmp4_;
				guint _tmp5_;
				guint _tmp6_;
				BoxesCollectionItem* item = NULL;
				BoxesCollection* _tmp7_;
				BoxesCollectionItem* _tmp8_;
				BoxesCollectionItem* _tmp9_;
				const gchar* _tmp10_;
				const gchar* _tmp11_;
				if (!_tmp2_) {
					gint _tmp3_;
					_tmp3_ = i;
					i = _tmp3_ + 1;
				}
				_tmp2_ = FALSE;
				_tmp4_ = self->collection;
				_tmp5_ = boxes_collection_get_length (_tmp4_);
				_tmp6_ = _tmp5_;
				if (!(((guint) i) < _tmp6_)) {
					break;
				}
				_tmp7_ = self->collection;
				_tmp8_ = boxes_collection_get_item (_tmp7_, i);
				item = _tmp8_;
				_tmp9_ = item;
				_tmp10_ = boxes_collection_item_get_name (_tmp9_);
				_tmp11_ = _tmp10_;
				if (g_strcmp0 (_tmp11_, name) == 0) {
					BoxesAppWindow* _tmp12_;
					BoxesAppWindow* _tmp13_;
					BoxesCollectionItem* _tmp14_;
					_tmp12_ = boxes_app_get_main_window (self);
					_tmp13_ = _tmp12_;
					_tmp14_ = item;
					boxes_app_window_select_item (_tmp13_, _tmp14_);
					_g_object_unref0 (item);
					break;
				}
				_g_object_unref0 (item);
			}
		}
	}
}

void
boxes_app_install (BoxesApp* self,
                   const gchar* path)
{
	BoxesAppWindow* _tmp0_;
	BoxesAppWindow* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (path != NULL);
	_tmp0_ = boxes_app_get_main_window (self);
	_tmp1_ = _tmp0_;
	boxes_app_window_show_vm_assistant (_tmp1_, path);
}

gboolean
boxes_app_open_uuid (BoxesApp* self,
                     const gchar* uuid)
{
	BoxesAppWindow* _tmp0_;
	BoxesAppWindow* _tmp1_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (uuid != NULL, FALSE);
	_tmp0_ = boxes_app_get_main_window (self);
	_tmp1_ = _tmp0_;
	boxes_ui_set_state ((BoxesUI*) _tmp1_, BOXES_UI_STATE_COLLECTION);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				BoxesCollection* _tmp4_;
				guint _tmp5_;
				guint _tmp6_;
				BoxesCollectionItem* item = NULL;
				BoxesCollection* _tmp7_;
				BoxesCollectionItem* _tmp8_;
				BoxesCollectionItem* _tmp9_;
				BoxesMachine* machine = NULL;
				BoxesCollectionItem* _tmp10_;
				BoxesMachine* _tmp11_;
				BoxesMachine* _tmp12_;
				BoxesBoxConfig* _tmp13_;
				gchar* _tmp14_;
				gchar* _tmp15_;
				gchar* _tmp16_;
				gboolean _tmp17_;
				BoxesAppWindow* _tmp18_;
				BoxesAppWindow* _tmp19_;
				BoxesCollectionItem* _tmp20_;
				if (!_tmp2_) {
					gint _tmp3_;
					_tmp3_ = i;
					i = _tmp3_ + 1;
				}
				_tmp2_ = FALSE;
				_tmp4_ = self->collection;
				_tmp5_ = boxes_collection_get_length (_tmp4_);
				_tmp6_ = _tmp5_;
				if (!(((guint) i) < _tmp6_)) {
					break;
				}
				_tmp7_ = self->collection;
				_tmp8_ = boxes_collection_get_item (_tmp7_, i);
				item = _tmp8_;
				_tmp9_ = item;
				if (!BOXES_IS_MACHINE (_tmp9_)) {
					_g_object_unref0 (item);
					continue;
				}
				_tmp10_ = item;
				_tmp11_ = _g_object_ref0 (BOXES_IS_MACHINE (_tmp10_) ? ((BoxesMachine*) _tmp10_) : NULL);
				machine = _tmp11_;
				_tmp12_ = machine;
				_tmp13_ = _tmp12_->config;
				_tmp14_ = boxes_box_config_get_uuid (_tmp13_);
				_tmp15_ = _tmp14_;
				_tmp16_ = _tmp15_;
				_tmp17_ = g_strcmp0 (_tmp16_, uuid) != 0;
				_g_free0 (_tmp16_);
				if (_tmp17_) {
					_g_object_unref0 (machine);
					_g_object_unref0 (item);
					continue;
				}
				_tmp18_ = boxes_app_get_main_window (self);
				_tmp19_ = _tmp18_;
				_tmp20_ = item;
				boxes_app_window_select_item (_tmp19_, _tmp20_);
				result = TRUE;
				_g_object_unref0 (machine);
				_g_object_unref0 (item);
				return result;
			}
		}
	}
	result = FALSE;
	return result;
}

void
boxes_app_open_in_new_window (BoxesApp* self,
                              BoxesMachine* machine)
{
	BoxesAppWindow* _tmp0_;
	BoxesAppWindow* _tmp1_;
	BoxesAppWindow* _tmp2_;
	BoxesAppWindow* _tmp3_;
	BoxesUIState _tmp6_;
	BoxesUIState _tmp7_;
	BoxesAppWindow* window = NULL;
	BoxesAppWindow* _tmp10_;
	BoxesAppWindow* _tmp11_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (machine != NULL);
	_tmp0_ = boxes_machine_get_window (machine);
	_tmp1_ = _tmp0_;
	_tmp2_ = boxes_app_get_main_window (self);
	_tmp3_ = _tmp2_;
	if (_tmp1_ != _tmp3_) {
		BoxesAppWindow* _tmp4_;
		BoxesAppWindow* _tmp5_;
		_tmp4_ = boxes_machine_get_window (machine);
		_tmp5_ = _tmp4_;
		gtk_window_present ((GtkWindow*) _tmp5_);
		return;
	}
	_tmp6_ = boxes_ui_get_ui_state ((BoxesUI*) machine);
	_tmp7_ = _tmp6_;
	if (_tmp7_ == BOXES_UI_STATE_DISPLAY) {
		BoxesAppWindow* _tmp8_;
		BoxesAppWindow* _tmp9_;
		_tmp8_ = boxes_machine_get_window (machine);
		_tmp9_ = _tmp8_;
		boxes_ui_set_state ((BoxesUI*) _tmp9_, BOXES_UI_STATE_COLLECTION);
	}
	_tmp10_ = boxes_app_add_new_window (self);
	window = _tmp10_;
	_tmp11_ = window;
	boxes_app_window_connect_to (_tmp11_, machine);
	_g_object_unref0 (window);
}

void
boxes_app_delete_machine (BoxesApp* self,
                          BoxesMachine* machine,
                          gboolean by_user)
{
	BoxesCollection* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (machine != NULL);
	boxes_machine_delete (machine, by_user);
	_tmp0_ = self->collection;
	boxes_collection_remove_item (_tmp0_, (BoxesCollectionItem*) machine);
}

static void
boxes_app_add_collection_source_data_free (gpointer _data)
{
	BoxesAppAddCollectionSourceData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->source);
	_g_object_unref0 (_data_->self);
	g_slice_free (BoxesAppAddCollectionSourceData, _data_);
}

void
boxes_app_add_collection_source (BoxesApp* self,
                                 BoxesCollectionSource* source,
                                 GAsyncReadyCallback _callback_,
                                 gpointer _user_data_)
{
	BoxesAppAddCollectionSourceData* _data_;
	BoxesApp* _tmp0_;
	BoxesCollectionSource* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (source != NULL);
	_data_ = g_slice_new0 (BoxesAppAddCollectionSourceData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, boxes_app_add_collection_source_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (source);
	_g_object_unref0 (_data_->source);
	_data_->source = _tmp1_;
	boxes_app_add_collection_source_co (_data_);
}

void
boxes_app_add_collection_source_finish (BoxesApp* self,
                                        GAsyncResult* _res_,
                                        GError** error)
{
	BoxesAppAddCollectionSourceData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
boxes_app_add_collection_source_ready (GObject* source_object,
                                       GAsyncResult* _res_,
                                       gpointer _user_data_)
{
	BoxesAppAddCollectionSourceData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	boxes_app_add_collection_source_co (_data_);
}

static gboolean
boxes_app_add_collection_source_co (BoxesAppAddCollectionSourceData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = boxes_collection_source_get_enabled (_data_->source);
	_data_->_tmp1_ = _data_->_tmp0_;
	if (!_data_->_tmp1_) {
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp2_ = _data_->self->priv->sources;
	_data_->_tmp3_ = boxes_collection_source_get_name (_data_->source);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = g_hash_table_lookup (_data_->_tmp2_, _data_->_tmp5_);
	_data_->_tmp7_ = ((BoxesCollectionSource*) _data_->_tmp6_) != NULL;
	_g_free0 (_data_->_tmp5_);
	if (_data_->_tmp7_) {
		_data_->_tmp8_ = boxes_collection_source_get_name (_data_->source);
		_data_->_tmp9_ = _data_->_tmp8_;
		_data_->_tmp10_ = _data_->_tmp9_;
		g_debug ("app.vala:362: Attempt to add duplicate collection source '%s', ignorin" \
"g..", _data_->_tmp10_);
		_g_free0 (_data_->_tmp10_);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp11_ = _data_->self->priv->brokers;
	_data_->_tmp12_ = boxes_collection_source_get_source_type (_data_->source);
	_data_->_tmp13_ = _data_->_tmp12_;
	_data_->_tmp14_ = _data_->_tmp13_;
	_data_->_tmp15_ = g_hash_table_lookup (_data_->_tmp11_, _data_->_tmp14_);
	_data_->_tmp16_ = _g_object_ref0 ((BoxesBroker*) _data_->_tmp15_);
	_data_->_tmp17_ = _data_->_tmp16_;
	_g_free0 (_data_->_tmp14_);
	_data_->broker = _data_->_tmp17_;
	_data_->_tmp18_ = _data_->broker;
	if (_data_->_tmp18_ != NULL) {
		_data_->_tmp19_ = _data_->broker;
		_data_->_state_ = 1;
		boxes_broker_add_source (_data_->_tmp19_, _data_->source, boxes_app_add_collection_source_ready, _data_);
		return FALSE;
		_state_1:
		boxes_broker_add_source_finish (_data_->_tmp19_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->broker);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp20_ = _data_->self->priv->sources;
		_data_->_tmp21_ = boxes_collection_source_get_name (_data_->source);
		_data_->_tmp22_ = _data_->_tmp21_;
		_data_->_tmp23_ = _g_object_ref0 (_data_->source);
		g_hash_table_insert (_data_->_tmp20_, _data_->_tmp22_, _data_->_tmp23_);
		_data_->_tmp24_ = boxes_collection_source_get_name (_data_->source);
		_data_->_tmp25_ = _data_->_tmp24_;
		_data_->_tmp26_ = _data_->_tmp25_;
		_data_->_tmp27_ = g_strcmp0 (_data_->_tmp26_, BOXES_APP_DEFAULT_SOURCE_NAME) == 0;
		_g_free0 (_data_->_tmp26_);
		if (_data_->_tmp27_) {
			g_object_notify ((GObject*) _data_->self, "default-connection");
			g_object_notify ((GObject*) _data_->self, "default-source");
		}
	} else {
		_data_->_tmp28_ = boxes_collection_source_get_source_type (_data_->source);
		_data_->_tmp29_ = _data_->_tmp28_;
		_data_->_tmp30_ = _data_->_tmp29_;
		g_warning ("app.vala:375: Unsupported source type %s", _data_->_tmp30_);
		_g_free0 (_data_->_tmp30_);
	}
	_g_object_unref0 (_data_->broker);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

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

static void
boxes_app_activate_async (BoxesApp* self,
                          GAsyncReadyCallback _callback_,
                          gpointer _user_data_)
{
	BoxesAppActivateAsyncData* _data_;
	BoxesApp* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (BoxesAppActivateAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, boxes_app_activate_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	boxes_app_activate_async_co (_data_);
}

static void
boxes_app_activate_finish (BoxesApp* self,
                           GAsyncResult* _res_)
{
	BoxesAppActivateAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
boxes_app_activate_async_ready (GObject* source_object,
                                GAsyncResult* _res_,
                                gpointer _user_data_)
{
	BoxesAppActivateAsyncData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	boxes_app_activate_async_co (_data_);
}

static gboolean
boxes_app_activate_async_co (BoxesAppActivateAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_state_ = 1;
	boxes_move_configs_from_cache (boxes_app_activate_async_ready, _data_);
	return FALSE;
	_state_1:
	boxes_move_configs_from_cache_finish (_data_->_res_);
	_data_->_state_ = 2;
	boxes_app_setup_default_source (_data_->self, boxes_app_activate_async_ready, _data_);
	return FALSE;
	_state_2:
	boxes_app_setup_default_source_finish (_data_->self, _data_->_res_);
	_data_->self->priv->is_ready = TRUE;
	g_signal_emit (_data_->self, boxes_app_signals[BOXES_APP_READY_SIGNAL], 0);
	boxes_app_setup_sources (_data_->self, NULL, NULL);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

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

static void
boxes_app_setup_default_source (BoxesApp* self,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_)
{
	BoxesAppSetupDefaultSourceData* _data_;
	BoxesApp* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (BoxesAppSetupDefaultSourceData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, boxes_app_setup_default_source_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	boxes_app_setup_default_source_co (_data_);
}

static void
boxes_app_setup_default_source_finish (BoxesApp* self,
                                       GAsyncResult* _res_)
{
	BoxesAppSetupDefaultSourceData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
boxes_app_setup_default_source_ready (GObject* source_object,
                                      GAsyncResult* _res_,
                                      gpointer _user_data_)
{
	BoxesAppSetupDefaultSourceData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	boxes_app_setup_default_source_co (_data_);
}

static gboolean
boxes_app_setup_default_source_co (BoxesAppSetupDefaultSourceData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = boxes_get_user_pkgconfig_source (BOXES_APP_DEFAULT_SOURCE_NAME);
	_data_->path = _data_->_tmp0_;
	_data_->create_session_source = TRUE;
	{
		_data_->_tmp1_ = _data_->path;
		_data_->_tmp2_ = g_file_new_for_path (_data_->_tmp1_);
		_data_->file = _data_->_tmp2_;
		_data_->_tmp3_ = _data_->file;
		_data_->_state_ = 1;
		g_file_query_info_async (_data_->_tmp3_, G_FILE_ATTRIBUTE_STANDARD_SIZE, G_FILE_QUERY_INFO_NONE, G_PRIORITY_DEFAULT, NULL, boxes_app_setup_default_source_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp4_ = g_file_query_info_finish (_data_->_tmp3_, _data_->_res_, &_data_->_inner_error0_);
		_data_->info = _data_->_tmp4_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->file);
			goto __catch0_g_error;
		}
		_data_->_tmp5_ = _data_->info;
		_data_->create_session_source = g_file_info_get_attribute_uint64 (_data_->_tmp5_, G_FILE_ATTRIBUTE_STANDARD_SIZE) <= ((guint64) 0);
		_g_object_unref0 (_data_->info);
		_g_object_unref0 (_data_->file);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->_error_ = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp6_ = _data_->path;
		_data_->_tmp7_ = _data_->_error_;
		_data_->_tmp8_ = _data_->_tmp7_->message;
		g_debug ("app.vala:401: Failed to query '%s': %s. Assuming it doesn't exist.", _data_->_tmp6_, _data_->_tmp8_);
		_g_error_free0 (_data_->_error_);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_free0 (_data_->path);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	if (_data_->create_session_source) {
		_data_->_tmp9_ = boxes_get_pkgdata_source ("QEMU_Session");
		_data_->_tmp10_ = _data_->_tmp9_;
		_data_->_tmp11_ = g_file_new_for_path (_data_->_tmp10_);
		_data_->_tmp12_ = _data_->_tmp11_;
		_g_free0 (_data_->_tmp10_);
		_data_->src = _data_->_tmp12_;
		_data_->_tmp13_ = _data_->path;
		_data_->_tmp14_ = g_file_new_for_path (_data_->_tmp13_);
		_data_->dst = _data_->_tmp14_;
		{
			_data_->_tmp15_ = _data_->src;
			_data_->_tmp16_ = _data_->dst;
			_data_->_state_ = 2;
			g_file_copy_async (_data_->_tmp15_, _data_->_tmp16_, G_FILE_COPY_OVERWRITE | G_FILE_COPY_TARGET_DEFAULT_PERMS, G_PRIORITY_DEFAULT, NULL, NULL, NULL, boxes_app_setup_default_source_ready, _data_);
			return FALSE;
			_state_2:
			g_file_copy_finish (_data_->_tmp15_, _data_->_res_, &_data_->_inner_error0_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				goto __catch1_g_error;
			}
		}
		goto __finally1;
		__catch1_g_error:
		{
			_data_->_vala1__error_ = _data_->_inner_error0_;
			_data_->_inner_error0_ = NULL;
			_data_->_tmp17_ = _data_->_vala1__error_;
			_data_->_tmp18_ = _data_->_tmp17_->message;
			g_critical ("app.vala:410: Can't setup default sources: %s", _data_->_tmp18_);
			_g_error_free0 (_data_->_vala1__error_);
		}
		__finally1:
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->dst);
			_g_object_unref0 (_data_->src);
			_g_free0 (_data_->path);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_g_object_unref0 (_data_->dst);
		_g_object_unref0 (_data_->src);
	}
	{
		_data_->_tmp19_ = boxes_collection_source_new_with_file (BOXES_APP_DEFAULT_SOURCE_NAME, &_data_->_inner_error0_);
		_data_->source = _data_->_tmp19_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch2_g_error;
		}
		_data_->_tmp20_ = _data_->source;
		_data_->_state_ = 3;
		boxes_app_add_collection_source (_data_->self, _data_->_tmp20_, boxes_app_setup_default_source_ready, _data_);
		return FALSE;
		_state_3:
		boxes_app_add_collection_source_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->source);
			goto __catch2_g_error;
		}
		_g_object_unref0 (_data_->source);
	}
	goto __finally2;
	__catch2_g_error:
	{
		_data_->_vala2__error_ = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp21_ = _data_->_vala2__error_;
		_data_->_tmp22_ = _data_->_tmp21_->message;
		g_printerr ("Error setting up default broker: %s\n", _data_->_tmp22_);
		_data_->_tmp23_ = boxes_app_get_main_window (_data_->self);
		_data_->_tmp24_ = _data_->_tmp23_;
		boxes_ui_set_state ((BoxesUI*) _data_->_tmp24_, BOXES_UI_STATE_TROUBLESHOOT);
		_data_->_tmp25_ = boxes_app_get_default_connection (_data_->self);
		_data_->_tmp26_ = _data_->_tmp25_;
		_data_->_tmp27_ = _data_->_tmp26_;
		_vala_warn_if_fail (_data_->_tmp27_ != NULL, "default_connection != null");
		_g_object_unref0 (_data_->_tmp27_);
		_g_error_free0 (_data_->_vala2__error_);
		_g_free0 (_data_->path);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	__finally2:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_free0 (_data_->path);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp28_ = boxes_app_get_default_connection (_data_->self);
	_data_->_tmp29_ = _data_->_tmp28_;
	_data_->_tmp30_ = _data_->_tmp29_;
	_vala_warn_if_fail (_data_->_tmp30_ != NULL, "default_connection != null");
	_g_object_unref0 (_data_->_tmp30_);
	_g_free0 (_data_->path);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

void
boxes_app_send_notification (BoxesApp* self,
                             const gchar* notification_id,
                             GNotification* notification)
{
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (notification_id != NULL);
	g_return_if_fail (notification != NULL);
	g_application_send_notification ((GApplication*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_application_get_type (), GtkApplication), notification_id, notification);
	_tmp0_ = g_strdup (notification_id);
	self->priv->system_notifications = g_list_append (self->priv->system_notifications, _tmp0_);
}

void
boxes_app_notify_machine_installed (BoxesApp* self,
                                    BoxesMachine* machine)
{
	BoxesAppWindow* _tmp0_;
	BoxesAppWindow* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	gchar* msg = NULL;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	GNotification* notification = NULL;
	const gchar* _tmp7_;
	GNotification* _tmp8_;
	GNotification* _tmp9_;
	const gchar* _tmp10_;
	const gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	const gchar* _tmp14_;
	const gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	GNotification* _tmp18_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (machine != NULL);
	_tmp0_ = boxes_machine_get_window (machine);
	_tmp1_ = _tmp0_;
	g_object_get ((GtkWindow*) _tmp1_, "is-active", &_tmp2_, NULL);
	_tmp3_ = _tmp2_;
	if (_tmp3_) {
		g_debug ("app.vala:434: Window is focused, no need for system notification");
		return;
	}
	_tmp4_ = boxes_collection_item_get_name ((BoxesCollectionItem*) machine);
	_tmp5_ = _tmp4_;
	_tmp6_ = g_strdup_printf (_ ("Box “%s” installed and ready to use"), _tmp5_);
	msg = _tmp6_;
	_tmp7_ = msg;
	_tmp8_ = g_notification_new (_tmp7_);
	notification = _tmp8_;
	_tmp9_ = notification;
	_tmp10_ = boxes_collection_item_get_name ((BoxesCollectionItem*) machine);
	_tmp11_ = _tmp10_;
	_tmp12_ = g_strconcat ("app.launch-box::", _tmp11_, NULL);
	_tmp13_ = _tmp12_;
	g_notification_add_button (_tmp9_, _ ("Launch"), _tmp13_);
	_g_free0 (_tmp13_);
	_tmp14_ = boxes_collection_item_get_name ((BoxesCollectionItem*) machine);
	_tmp15_ = _tmp14_;
	_tmp16_ = g_strconcat ("installed-", _tmp15_, NULL);
	_tmp17_ = _tmp16_;
	_tmp18_ = notification;
	boxes_app_send_notification (self, _tmp17_, _tmp18_);
	_g_free0 (_tmp17_);
	_g_object_unref0 (notification);
	_g_free0 (msg);
}

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

static void
boxes_app_setup_sources (BoxesApp* self,
                         GAsyncReadyCallback _callback_,
                         gpointer _user_data_)
{
	BoxesAppSetupSourcesData* _data_;
	BoxesApp* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (BoxesAppSetupSourcesData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, boxes_app_setup_sources_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	boxes_app_setup_sources_co (_data_);
}

static void
boxes_app_setup_sources_finish (BoxesApp* self,
                                GAsyncResult* _res_)
{
	BoxesAppSetupSourcesData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static Block7Data*
block7_data_ref (Block7Data* _data7_)
{
	g_atomic_int_inc (&_data7_->_ref_count_);
	return _data7_;
}

static void
block7_data_unref (void * _userdata_)
{
	Block7Data* _data7_;
	_data7_ = (Block7Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data7_->_ref_count_)) {
		BoxesApp* self;
		self = _data7_->self;
		(_data7_->new_sources == NULL) ? NULL : (_data7_->new_sources = (_g_list_free__g_object_unref0_ (_data7_->new_sources), NULL));
		_g_object_unref0 (self);
		g_slice_free (Block7Data, _data7_);
	}
}

static gboolean
__lambda141_ (Block7Data* _data7_,
              const gchar* filename,
              GError** error)
{
	BoxesApp* self;
	BoxesCollectionSource* source = NULL;
	BoxesCollectionSource* _tmp0_;
	BoxesCollectionSource* _tmp2_;
	BoxesCollectionSource* _tmp3_;
	GError* _inner_error0_ = NULL;
	gboolean result;
	self = _data7_->self;
	g_return_val_if_fail (filename != NULL, FALSE);
	if (g_strcmp0 (filename, BOXES_APP_DEFAULT_SOURCE_NAME) == 0) {
		result = FALSE;
		return result;
	}
	_tmp0_ = boxes_collection_source_new_with_file (filename, &_inner_error0_);
	source = _tmp0_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp1_ = FALSE;
		g_propagate_error (error, _inner_error0_);
		return _tmp1_;
	}
	_tmp2_ = source;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	_data7_->new_sources = g_list_append (_data7_->new_sources, _tmp3_);
	result = FALSE;
	_g_object_unref0 (source);
	return result;
}

static gboolean
___lambda141__boxes_foreach_filename_from_dir_func (const gchar* filename,
                                                    gpointer self,
                                                    GError** error)
{
	gboolean result;
	result = __lambda141_ (self, filename, error);
	return result;
}

static void
boxes_app_setup_sources_ready (GObject* source_object,
                               GAsyncResult* _res_,
                               gpointer _user_data_)
{
	BoxesAppSetupSourcesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	boxes_app_setup_sources_co (_data_);
}

static gboolean
boxes_app_setup_sources_co (BoxesAppSetupSourcesData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data7_ = g_slice_new0 (Block7Data);
	_data_->_data7_->_ref_count_ = 1;
	_data_->_data7_->self = g_object_ref (_data_->self);
	_data_->_data7_->_async_data_ = _data_;
	_data_->_tmp0_ = boxes_get_user_pkgconfig_source (NULL);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = g_file_new_for_path (_data_->_tmp1_);
	_data_->_tmp3_ = _data_->_tmp2_;
	_g_free0 (_data_->_tmp1_);
	_data_->dir = _data_->_tmp3_;
	_data_->_data7_->new_sources = NULL;
	_data_->_tmp4_ = _data_->dir;
	_data_->_state_ = 1;
	boxes_foreach_filename_from_dir (_data_->_tmp4_, ___lambda141__boxes_foreach_filename_from_dir_func, _data_->_data7_, boxes_app_setup_sources_ready, _data_);
	return FALSE;
	_state_1:
	boxes_foreach_filename_from_dir_finish (_data_->_res_);
	_data_->_tmp5_ = _data_->_data7_->new_sources;
	{
		_data_->source_collection = _data_->_tmp5_;
		for (_data_->source_it = _data_->source_collection; _data_->source_it != NULL; _data_->source_it = _data_->source_it->next) {
			_data_->_tmp6_ = _g_object_ref0 ((BoxesCollectionSource*) _data_->source_it->data);
			_data_->source = _data_->_tmp6_;
			{
				{
					_data_->_tmp7_ = _data_->source;
					_data_->_state_ = 2;
					boxes_app_add_collection_source (_data_->self, _data_->_tmp7_, boxes_app_setup_sources_ready, _data_);
					return FALSE;
					_state_2:
					boxes_app_add_collection_source_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
					if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
						goto __catch0_g_error;
					}
				}
				goto __finally0;
				__catch0_g_error:
				{
					_data_->_error_ = _data_->_inner_error0_;
					_data_->_inner_error0_ = NULL;
					_data_->_tmp8_ = _data_->source;
					_data_->_tmp9_ = boxes_collection_source_get_name (_data_->_tmp8_);
					_data_->_tmp10_ = _data_->_tmp9_;
					_data_->_tmp11_ = _data_->_tmp10_;
					_data_->_tmp12_ = _data_->_error_;
					_data_->_tmp13_ = _data_->_tmp12_->message;
					g_warning ("app.vala:462: Failed to add '%s': %s", _data_->_tmp11_, _data_->_tmp13_);
					_g_free0 (_data_->_tmp11_);
					_g_error_free0 (_data_->_error_);
				}
				__finally0:
				if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
					_g_object_unref0 (_data_->source);
					_g_object_unref0 (_data_->dir);
					block7_data_unref (_data_->_data7_);
					_data_->_data7_ = NULL;
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
					g_clear_error (&_data_->_inner_error0_);
					g_object_unref (_data_->_async_result);
					return FALSE;
				}
				_g_object_unref0 (_data_->source);
			}
		}
	}
	_g_object_unref0 (_data_->dir);
	block7_data_unref (_data_->_data7_);
	_data_->_data7_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
boxes_app_notify_vm_is_running_in_background (BoxesApp* self,
                                              BoxesLibvirtMachine* machine)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	gboolean _tmp2_;
	gchar* msg = NULL;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	GNotification* notification = NULL;
	const gchar* _tmp8_;
	GNotification* _tmp9_;
	GNotification* _tmp10_;
	const gchar* _tmp11_;
	const gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	const gchar* _tmp15_;
	const gchar* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	GNotification* _tmp19_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (machine != NULL);
	_tmp1_ = boxes_libvirt_machine_get_run_in_bg (machine);
	_tmp2_ = _tmp1_;
	if (!_tmp2_) {
		gboolean _tmp3_;
		gboolean _tmp4_;
		_tmp3_ = boxes_machine_get_is_running ((BoxesMachine*) machine);
		_tmp4_ = _tmp3_;
		_tmp0_ = !_tmp4_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		return;
	}
	_tmp5_ = boxes_collection_item_get_name ((BoxesCollectionItem*) machine);
	_tmp6_ = _tmp5_;
	_tmp7_ = g_strdup_printf (_ ("“%s“ is running in the background"), _tmp6_);
	msg = _tmp7_;
	_tmp8_ = msg;
	_tmp9_ = g_notification_new (_tmp8_);
	notification = _tmp9_;
	_tmp10_ = notification;
	_tmp11_ = boxes_collection_item_get_name ((BoxesCollectionItem*) machine);
	_tmp12_ = _tmp11_;
	_tmp13_ = g_strconcat ("app.launch-run-in-bg-box::", _tmp12_, NULL);
	_tmp14_ = _tmp13_;
	g_notification_set_default_action (_tmp10_, _tmp14_);
	_g_free0 (_tmp14_);
	_tmp15_ = boxes_collection_item_get_name ((BoxesCollectionItem*) machine);
	_tmp16_ = _tmp15_;
	_tmp17_ = g_strconcat ("gnome-boxes-run-in-bg-%s", _tmp16_, NULL);
	_tmp18_ = _tmp17_;
	_tmp19_ = notification;
	boxes_app_send_notification (self, _tmp18_, _tmp19_);
	_g_free0 (_tmp18_);
	_g_object_unref0 (notification);
	_g_free0 (msg);
}

static void
__lambda12_ (BoxesApp* self,
             BoxesCollectionItem* item)
{
	BoxesLibvirtMachine* machine = NULL;
	BoxesLibvirtMachine* _tmp0_;
	gboolean _tmp1_ = FALSE;
	BoxesLibvirtMachine* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	gboolean keep_vm_running = FALSE;
	g_return_if_fail (item != NULL);
	_tmp0_ = _g_object_ref0 (BOXES_IS_LIBVIRT_MACHINE (item) ? ((BoxesLibvirtMachine*) item) : NULL);
	machine = _tmp0_;
	_tmp2_ = machine;
	_tmp3_ = boxes_libvirt_machine_get_run_in_bg (_tmp2_);
	_tmp4_ = _tmp3_;
	if (_tmp4_) {
		BoxesLibvirtMachine* _tmp5_;
		gboolean _tmp6_;
		gboolean _tmp7_;
		_tmp5_ = machine;
		_tmp6_ = boxes_machine_get_is_running ((BoxesMachine*) _tmp5_);
		_tmp7_ = _tmp6_;
		_tmp1_ = _tmp7_;
	} else {
		_tmp1_ = FALSE;
	}
	keep_vm_running = _tmp1_;
	if (keep_vm_running) {
		BoxesLibvirtMachine* _tmp8_;
		BoxesLibvirtMachine* _tmp9_;
		const gchar* _tmp10_;
		const gchar* _tmp11_;
		boxes_app_set_run_in_bg (self, boxes_app_is_running_in_flatpak ());
		_tmp8_ = machine;
		boxes_app_notify_vm_is_running_in_background (self, _tmp8_);
		_tmp9_ = machine;
		_tmp10_ = boxes_collection_item_get_name ((BoxesCollectionItem*) _tmp9_);
		_tmp11_ = _tmp10_;
		g_debug ("app.vala:491: Keep running %s in the background", _tmp11_);
	}
	_g_object_unref0 (machine);
}

static void
___lambda12__boxes_collection_collection_foreach_func (BoxesCollectionItem* item,
                                                       gpointer self)
{
	__lambda12_ ((BoxesApp*) self, item);
}

static void
boxes_app_keep_on_running_on_background (BoxesApp* self)
{
	BoxesCollection* _tmp0_;
	BoxesCollection* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->collection;
	if (_tmp0_ == NULL) {
		return;
	}
	boxes_app_set_run_in_bg (self, FALSE);
	_tmp1_ = self->collection;
	boxes_collection_foreach_item (_tmp1_, ___lambda12__boxes_collection_collection_foreach_func, self);
}

static Block8Data*
block8_data_ref (Block8Data* _data8_)
{
	g_atomic_int_inc (&_data8_->_ref_count_);
	return _data8_;
}

static void
block8_data_unref (void * _userdata_)
{
	Block8Data* _data8_;
	_data8_ = (Block8Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data8_->_ref_count_)) {
		BoxesApp* self;
		self = _data8_->self;
		_g_object_unref0 (self);
		g_slice_free (Block8Data, _data8_);
	}
}

static Block9Data*
block9_data_ref (Block9Data* _data9_)
{
	g_atomic_int_inc (&_data9_->_ref_count_);
	return _data9_;
}

static void
block9_data_unref (void * _userdata_)
{
	Block9Data* _data9_;
	_data9_ = (Block9Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data9_->_ref_count_)) {
		BoxesApp* self;
		self = _data9_->_data8_->self;
		_g_object_unref0 (_data9_->machine);
		block8_data_unref (_data9_->_data8_);
		_data9_->_data8_ = NULL;
		g_slice_free (Block9Data, _data9_);
	}
}

static void
____lambda150_ (Block9Data* _data9_)
{
	Block8Data* _data8_;
	BoxesApp* self;
	BoxesLibvirtMachine* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gint _tmp3_;
	_data8_ = _data9_->_data8_;
	self = _data8_->self;
	_tmp0_ = _data9_->machine;
	_tmp1_ = boxes_collection_item_get_name ((BoxesCollectionItem*) _tmp0_);
	_tmp2_ = _tmp1_;
	g_debug ("app.vala:518: %s suspended", _tmp2_);
	_tmp3_ = _data8_->waiting_counter;
	_data8_->waiting_counter = _tmp3_ - 1;
}

static void
_____lambda150__gasync_ready_callback (GObject* source_object,
                                       GAsyncResult* res,
                                       gpointer self)
{
	____lambda150_ (self);
	block9_data_unref (self);
}

static void
__lambda149_ (Block8Data* _data8_,
              BoxesCollectionItem* item)
{
	BoxesApp* self;
	self = _data8_->self;
	g_return_if_fail (item != NULL);
	if (BOXES_IS_LIBVIRT_MACHINE (item)) {
		Block9Data* _data9_;
		BoxesLibvirtMachine* _tmp0_;
		BoxesLibvirtMachine* _tmp1_;
		gboolean _tmp2_;
		gboolean _tmp3_;
		_data9_ = g_slice_new0 (Block9Data);
		_data9_->_ref_count_ = 1;
		_data9_->_data8_ = block8_data_ref (_data8_);
		_tmp0_ = _g_object_ref0 (BOXES_IS_LIBVIRT_MACHINE (item) ? ((BoxesLibvirtMachine*) item) : NULL);
		_data9_->machine = _tmp0_;
		_tmp1_ = _data9_->machine;
		_tmp2_ = boxes_machine_get_suspend_at_exit ((BoxesMachine*) _tmp1_);
		_tmp3_ = _tmp2_;
		if (_tmp3_) {
			gint _tmp4_;
			BoxesLibvirtMachine* _tmp5_;
			_tmp4_ = _data8_->waiting_counter;
			_data8_->waiting_counter = _tmp4_ + 1;
			_tmp5_ = _data9_->machine;
			boxes_libvirt_machine_suspend (_tmp5_, _____lambda150__gasync_ready_callback, block9_data_ref (_data9_));
		}
		block9_data_unref (_data9_);
		_data9_ = NULL;
	}
}

static void
___lambda149__boxes_collection_collection_foreach_func (BoxesCollectionItem* item,
                                                        gpointer self)
{
	__lambda149_ (self, item);
}

static void
boxes_app_suspend_machines (BoxesApp* self)
{
	Block8Data* _data8_;
	BoxesCollection* _tmp0_;
	GMainContext* context = NULL;
	GMainContext* _tmp1_;
	GMainContext* _tmp2_;
	BoxesCollection* _tmp3_;
	GMainContext* _tmp4_;
	g_return_if_fail (self != NULL);
	_data8_ = g_slice_new0 (Block8Data);
	_data8_->_ref_count_ = 1;
	_data8_->self = g_object_ref (self);
	_tmp0_ = self->collection;
	if (_tmp0_ == NULL) {
		block8_data_unref (_data8_);
		_data8_ = NULL;
		return;
	}
	g_debug ("app.vala:502: Suspending running boxes");
	_data8_->waiting_counter = 0;
	_tmp1_ = g_main_context_new ();
	context = _tmp1_;
	_tmp2_ = context;
	g_main_context_push_thread_default (_tmp2_);
	_tmp3_ = self->collection;
	boxes_collection_foreach_item (_tmp3_, ___lambda149__boxes_collection_collection_foreach_func, _data8_);
	_tmp4_ = context;
	g_main_context_pop_thread_default (_tmp4_);
	while (TRUE) {
		GMainContext* _tmp5_;
		if (!(_data8_->waiting_counter > 0)) {
			break;
		}
		_tmp5_ = context;
		g_main_context_iteration (_tmp5_, TRUE);
	}
	g_debug ("app.vala:530: Running boxes suspended");
	_g_main_context_unref0 (context);
	block8_data_unref (_data8_);
	_data8_ = NULL;
}

/**
     * Deletes specified items, while allowing user to undo it.
     *
     * @param items the list of machines
     * @param message optional message to be shown together with the undo button. If not provided, an appropriate
     *                messsage is created.
     * @param callback optional function that, if provided, is called after the undo operation
     *
     * @attention the ownership for items is required since GLib.List is a compact class.
     */
static Block10Data*
block10_data_ref (Block10Data* _data10_)
{
	g_atomic_int_inc (&_data10_->_ref_count_);
	return _data10_;
}

static void
block10_data_unref (void * _userdata_)
{
	Block10Data* _data10_;
	_data10_ = (Block10Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data10_->_ref_count_)) {
		BoxesApp* self;
		self = _data10_->self;
		(_data10_->items == NULL) ? NULL : (_data10_->items = (_g_list_free__g_object_unref0_ (_data10_->items), NULL));
		(_data10_->undo_notify_callback_target_destroy_notify == NULL) ? NULL : (_data10_->undo_notify_callback_target_destroy_notify (_data10_->undo_notify_callback_target), NULL);
		_data10_->undo_notify_callback = NULL;
		_data10_->undo_notify_callback_target = NULL;
		_data10_->undo_notify_callback_target_destroy_notify = NULL;
		_g_object_unref0 (self);
		g_slice_free (Block10Data, _data10_);
	}
}

static void
__lambda67_ (Block10Data* _data10_)
{
	BoxesApp* self;
	self = _data10_->self;
	g_debug ("app.vala:560: Box deletion cancelled by user. Re-adding to view");
	{
		GList* item_collection = NULL;
		GList* item_it = NULL;
		item_collection = _data10_->items;
		for (item_it = item_collection; item_it != NULL; item_it = item_it->next) {
			BoxesCollectionItem* _tmp0_;
			BoxesCollectionItem* item = NULL;
			_tmp0_ = _g_object_ref0 ((BoxesCollectionItem*) item_it->data);
			item = _tmp0_;
			{
				BoxesMachine* machine = NULL;
				BoxesCollectionItem* _tmp1_;
				BoxesMachine* _tmp2_;
				BoxesCollection* _tmp3_;
				BoxesMachine* _tmp4_;
				_tmp1_ = item;
				_tmp2_ = _g_object_ref0 (BOXES_IS_MACHINE (_tmp1_) ? ((BoxesMachine*) _tmp1_) : NULL);
				machine = _tmp2_;
				_tmp3_ = self->collection;
				_tmp4_ = machine;
				boxes_collection_add_item (_tmp3_, (BoxesCollectionItem*) _tmp4_);
				_g_object_unref0 (machine);
				_g_object_unref0 (item);
			}
		}
	}
	if (_data10_->undo_notify_callback != NULL) {
		_data10_->undo_notify_callback (_data10_->undo_notify_callback_target);
	}
}

static void
___lambda67__boxes_toast_ok_func (gpointer self)
{
	__lambda67_ (self);
}

static void
__lambda68_ (Block10Data* _data10_)
{
	BoxesApp* self;
	self = _data10_->self;
	g_debug ("app.vala:570: User did not cancel deletion. Deleting now...");
	{
		GList* item_collection = NULL;
		GList* item_it = NULL;
		item_collection = _data10_->items;
		for (item_it = item_collection; item_it != NULL; item_it = item_it->next) {
			BoxesCollectionItem* _tmp0_;
			BoxesCollectionItem* item = NULL;
			_tmp0_ = _g_object_ref0 ((BoxesCollectionItem*) item_it->data);
			item = _tmp0_;
			{
				BoxesCollectionItem* _tmp1_;
				BoxesMachine* machine = NULL;
				BoxesCollectionItem* _tmp2_;
				BoxesMachine* _tmp3_;
				BoxesMachine* _tmp4_;
				_tmp1_ = item;
				if (!BOXES_IS_MACHINE (_tmp1_)) {
					_g_object_unref0 (item);
					continue;
				}
				_tmp2_ = item;
				_tmp3_ = _g_object_ref0 (BOXES_IS_MACHINE (_tmp2_) ? ((BoxesMachine*) _tmp2_) : NULL);
				machine = _tmp3_;
				_tmp4_ = machine;
				boxes_machine_delete (_tmp4_, TRUE);
				_g_object_unref0 (machine);
				_g_object_unref0 (item);
			}
		}
	}
}

static void
___lambda68__boxes_toast_dismiss_func (gpointer self)
{
	__lambda68_ (self);
}

void
boxes_app_delete_machines_undoable (BoxesApp* self,
                                    GList* items,
                                    const gchar* message,
                                    BoxesAppUndoNotifyCallback undo_notify_callback,
                                    gpointer undo_notify_callback_target,
                                    GDestroyNotify undo_notify_callback_target_destroy_notify)
{
	Block10Data* _data10_;
	guint num_items = 0U;
	gchar* msg = NULL;
	gchar* _tmp0_;
	const gchar* _tmp1_;
	BoxesToastOKFunc undo = NULL;
	gpointer undo_target;
	GDestroyNotify undo_target_destroy_notify;
	BoxesToastDismissFunc really_remove = NULL;
	gpointer really_remove_target;
	GDestroyNotify really_remove_target_destroy_notify;
	BoxesAppWindow* _tmp12_;
	BoxesAppWindow* _tmp13_;
	const gchar* _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	BoxesToastOKFunc _tmp17_;
	gpointer _tmp17__target;
	GDestroyNotify _tmp17__target_destroy_notify;
	BoxesToastDismissFunc _tmp18_;
	gpointer _tmp18__target;
	GDestroyNotify _tmp18__target_destroy_notify;
	BoxesToast* _tmp19_ = NULL;
	BoxesToast* _tmp20_;
	g_return_if_fail (self != NULL);
	_data10_ = g_slice_new0 (Block10Data);
	_data10_->_ref_count_ = 1;
	_data10_->self = g_object_ref (self);
	(_data10_->items == NULL) ? NULL : (_data10_->items = (_g_list_free__g_object_unref0_ (_data10_->items), NULL));
	_data10_->items = items;
	(_data10_->undo_notify_callback_target_destroy_notify == NULL) ? NULL : (_data10_->undo_notify_callback_target_destroy_notify (_data10_->undo_notify_callback_target), NULL);
	_data10_->undo_notify_callback = NULL;
	_data10_->undo_notify_callback_target = NULL;
	_data10_->undo_notify_callback_target_destroy_notify = NULL;
	_data10_->undo_notify_callback = undo_notify_callback;
	_data10_->undo_notify_callback_target = undo_notify_callback_target;
	_data10_->undo_notify_callback_target_destroy_notify = undo_notify_callback_target_destroy_notify;
	num_items = g_list_length (_data10_->items);
	if (num_items == ((guint) 0)) {
		block10_data_unref (_data10_);
		_data10_ = NULL;
		return;
	}
	_tmp0_ = g_strdup (message);
	msg = _tmp0_;
	_tmp1_ = msg;
	if (_tmp1_ == NULL) {
		gchar* _tmp2_ = NULL;
		gchar* _tmp8_;
		if (num_items == ((guint) 1)) {
			gconstpointer _tmp3_;
			const gchar* _tmp4_;
			const gchar* _tmp5_;
			gchar* _tmp6_;
			_tmp3_ = _data10_->items->data;
			_tmp4_ = boxes_collection_item_get_name ((BoxesCollectionItem*) _tmp3_);
			_tmp5_ = _tmp4_;
			_tmp6_ = g_strdup_printf (_ ("Box “%s” has been deleted"), _tmp5_);
			_g_free0 (_tmp2_);
			_tmp2_ = _tmp6_;
		} else {
			gchar* _tmp7_;
			_tmp7_ = g_strdup_printf (ngettext ("%u box has been deleted", "%u boxes have been deleted", (gulong) num_items), num_items);
			_g_free0 (_tmp2_);
			_tmp2_ = _tmp7_;
		}
		_tmp8_ = g_strdup (_tmp2_);
		_g_free0 (msg);
		msg = _tmp8_;
		_g_free0 (_tmp2_);
	}
	{
		GList* item_collection = NULL;
		GList* item_it = NULL;
		item_collection = _data10_->items;
		for (item_it = item_collection; item_it != NULL; item_it = item_it->next) {
			BoxesCollectionItem* _tmp9_;
			BoxesCollectionItem* item = NULL;
			_tmp9_ = _g_object_ref0 ((BoxesCollectionItem*) item_it->data);
			item = _tmp9_;
			{
				BoxesCollection* _tmp10_;
				BoxesCollectionItem* _tmp11_;
				_tmp10_ = self->collection;
				_tmp11_ = item;
				boxes_collection_remove_item (_tmp10_, _tmp11_);
				_g_object_unref0 (item);
			}
		}
	}
	undo = ___lambda67__boxes_toast_ok_func;
	undo_target = block10_data_ref (_data10_);
	undo_target_destroy_notify = block10_data_unref;
	really_remove = ___lambda68__boxes_toast_dismiss_func;
	really_remove_target = block10_data_ref (_data10_);
	really_remove_target_destroy_notify = block10_data_unref;
	_tmp12_ = boxes_app_get_main_window (self);
	_tmp13_ = _tmp12_;
	_tmp14_ = msg;
	_tmp15_ = g_strdup (_tmp14_);
	_tmp16_ = g_strdup (_ ("Undo"));
	_tmp17_ = undo;
	_tmp17__target = undo_target;
	_tmp17__target_destroy_notify = undo_target_destroy_notify;
	undo = NULL;
	undo_target = NULL;
	undo_target_destroy_notify = NULL;
	_tmp18_ = really_remove;
	_tmp18__target = really_remove_target;
	_tmp18__target_destroy_notify = really_remove_target_destroy_notify;
	really_remove = NULL;
	really_remove_target = NULL;
	really_remove_target_destroy_notify = NULL;
	_tmp19_ = boxes_toast_new (NULL);
	boxes_toast_set_message (_tmp19_, _tmp15_);
	_g_free0 (_tmp15_);
	boxes_toast_set_action (_tmp19_, _tmp16_);
	_g_free0 (_tmp16_);
	(_tmp19_->undo_func_target_destroy_notify == NULL) ? NULL : (_tmp19_->undo_func_target_destroy_notify (_tmp19_->undo_func_target), NULL);
	_tmp19_->undo_func = NULL;
	_tmp19_->undo_func_target = NULL;
	_tmp19_->undo_func_target_destroy_notify = NULL;
	_tmp19_->undo_func = _tmp17_;
	_tmp19_->undo_func_target = _tmp17__target;
	_tmp19_->undo_func_target_destroy_notify = _tmp17__target_destroy_notify;
	(_tmp19_->dismiss_func_target_destroy_notify == NULL) ? NULL : (_tmp19_->dismiss_func_target_destroy_notify (_tmp19_->dismiss_func_target), NULL);
	_tmp19_->dismiss_func = NULL;
	_tmp19_->dismiss_func_target = NULL;
	_tmp19_->dismiss_func_target_destroy_notify = NULL;
	_tmp19_->dismiss_func = _tmp18_;
	_tmp19_->dismiss_func_target = _tmp18__target;
	_tmp19_->dismiss_func_target_destroy_notify = _tmp18__target_destroy_notify;
	g_object_ref_sink (_tmp19_);
	_tmp20_ = _tmp19_;
	boxes_app_window_display_toast (_tmp13_, _tmp20_);
	_g_object_unref0 (_tmp20_);
	(really_remove_target_destroy_notify == NULL) ? NULL : (really_remove_target_destroy_notify (really_remove_target), NULL);
	really_remove = NULL;
	really_remove_target = NULL;
	really_remove_target_destroy_notify = NULL;
	(undo_target_destroy_notify == NULL) ? NULL : (undo_target_destroy_notify (undo_target), NULL);
	undo = NULL;
	undo_target = NULL;
	undo_target_destroy_notify = NULL;
	_g_free0 (msg);
	block10_data_unref (_data10_);
	_data10_ = NULL;
}

BoxesAppWindow*
boxes_app_add_new_window (BoxesApp* self)
{
	BoxesAppWindow* window = NULL;
	BoxesAppWindow* _tmp0_;
	BoxesAppWindow* _tmp1_;
	BoxesAppWindow* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = boxes_app_window_new ((GtkApplication*) self);
	g_object_ref_sink (_tmp0_);
	window = _tmp0_;
	_tmp1_ = _g_object_ref0 (window);
	self->priv->windows = g_list_append (self->priv->windows, _tmp1_);
	boxes_app_window_setup_ui (window);
	gtk_window_present ((GtkWindow*) window);
	g_object_notify ((GObject*) self, "main-window");
	result = window;
	return result;
}

static GList*
vala_g_list_remove_full (GList* self,
                         gconstpointer data,
                         GFreeFunc func)
{
	GList* l = NULL;
	GList* result;
	l = self;
	while (TRUE) {
		GList* _tmp0_;
		GList* _tmp1_;
		gconstpointer _tmp2_;
		_tmp0_ = l;
		if (!(_tmp0_ != NULL)) {
			break;
		}
		_tmp1_ = l;
		_tmp2_ = ((GList*) _tmp1_)->data;
		if (_tmp2_ != data) {
			GList* _tmp3_;
			GList* _tmp4_;
			_tmp3_ = l;
			_tmp4_ = ((GList*) _tmp3_)->next;
			l = _tmp4_;
		} else {
			GList* _tmp5_;
			gconstpointer _tmp6_;
			GList* _tmp7_;
			_tmp5_ = l;
			_tmp6_ = ((GList*) _tmp5_)->data;
			func (_tmp6_);
			_tmp7_ = l;
			self = g_list_delete_link (self, (GList*) _tmp7_);
			break;
		}
	}
	result = self;
	return result;
}

gboolean
boxes_app_remove_window (BoxesApp* self,
                         BoxesAppWindow* window)
{
	GList* _tmp0_;
	guint initial_windows_count = 0U;
	GList* _tmp1_;
	BoxesCollectionItem* _tmp2_;
	BoxesCollectionItem* _tmp3_;
	GList* _tmp8_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (window != NULL, FALSE);
	_tmp0_ = self->priv->windows;
	if (g_list_length (_tmp0_) == ((guint) 1)) {
		result = boxes_app_quit_app (self);
		return result;
	}
	_tmp1_ = self->priv->windows;
	initial_windows_count = g_list_length (_tmp1_);
	_tmp2_ = boxes_app_window_get_current_item (window);
	_tmp3_ = _tmp2_;
	if (_tmp3_ != NULL) {
		BoxesMachine* current_machine = NULL;
		BoxesCollectionItem* _tmp4_;
		BoxesCollectionItem* _tmp5_;
		BoxesMachine* _tmp6_;
		BoxesMachine* _tmp7_;
		_tmp4_ = boxes_app_window_get_current_item (window);
		_tmp5_ = _tmp4_;
		_tmp6_ = _g_object_ref0 (BOXES_IS_MACHINE (_tmp5_) ? ((BoxesMachine*) _tmp5_) : NULL);
		current_machine = _tmp6_;
		_tmp7_ = current_machine;
		boxes_machine_set_window (_tmp7_, NULL);
		_g_object_unref0 (current_machine);
	}
	gtk_widget_hide ((GtkWidget*) window);
	self->priv->windows = vala_g_list_remove_full (self->priv->windows, window, _g_object_unref0_);
	gtk_application_remove_window (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_application_get_type (), GtkApplication), (GtkWindow*) window);
	g_object_notify ((GObject*) self, "main-window");
	_tmp8_ = self->priv->windows;
	result = initial_windows_count != g_list_length (_tmp8_);
	return result;
}

void
boxes_app_inhibit (BoxesApp* self,
                   GtkWindow* window,
                   GtkApplicationInhibitFlags* flags,
                   const gchar* reason)
{
	guint new_cookie = 0U;
	g_return_if_fail (self != NULL);
	if (reason == NULL) {
		reason = _ ("Boxes is doing something");
	}
	if (flags == NULL) {
		GtkApplicationInhibitFlags _tmp0_;
		_tmp0_ = GTK_APPLICATION_INHIBIT_IDLE | GTK_APPLICATION_INHIBIT_SUSPEND;
		flags = &_tmp0_;
	}
	new_cookie = gtk_application_inhibit (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_application_get_type (), GtkApplication), window, *flags, reason);
	if (self->priv->inhibit_cookie != ((guint) 0)) {
		gtk_application_uninhibit (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_application_get_type (), GtkApplication), self->priv->inhibit_cookie);
	}
	self->priv->inhibit_cookie = new_cookie;
}

void
boxes_app_uninhibit (BoxesApp* self)
{
	g_return_if_fail (self != NULL);
	if (self->priv->inhibit_cookie != ((guint) 0)) {
		gtk_application_uninhibit (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_application_get_type (), GtkApplication), self->priv->inhibit_cookie);
	}
}

static gboolean*
_bool_dup (gboolean* self)
{
	gboolean* dup;
	dup = g_new0 (gboolean, 1);
	memcpy (dup, self, sizeof (gboolean));
	return dup;
}

static gpointer
__bool_dup0 (gpointer self)
{
	return self ? _bool_dup (self) : NULL;
}

gboolean
boxes_app_is_running_in_flatpak (void)
{
	gboolean* _tmp0_;
	GFile* file = NULL;
	GFile* _tmp2_;
	GFile* _tmp3_;
	gboolean _tmp4_;
	gboolean* _tmp5_;
	gboolean* _tmp6_;
	gboolean result;
	_tmp0_ = boxes_app_is_flatpak;
	if (_tmp0_ != NULL) {
		gboolean* _tmp1_;
		_tmp1_ = boxes_app_is_flatpak;
		result = *_tmp1_;
		return result;
	}
	_tmp2_ = g_file_new_for_path ("/.flatpak-info");
	file = _tmp2_;
	_tmp3_ = file;
	_tmp4_ = g_file_query_exists (_tmp3_, NULL);
	_tmp5_ = __bool_dup0 (&_tmp4_);
	_g_free0 (boxes_app_is_flatpak);
	boxes_app_is_flatpak = _tmp5_;
	_tmp6_ = boxes_app_is_flatpak;
	result = *_tmp6_;
	_g_object_unref0 (file);
	return result;
}

gboolean
boxes_app_supports_uefi_installs (BoxesApp* self)
{
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	if (!UEFI_INSTALLS_SUPPORTED) {
		result = FALSE;
		return result;
	}
	{
		GVirConfigDomainCapabilities* domain_capabilities = NULL;
		GVirConnection* _tmp0_;
		GVirConnection* _tmp1_;
		GVirConnection* _tmp2_;
		GVirConfigDomainCapabilities* _tmp3_;
		GVirConfigDomainCapabilities* _tmp4_;
		GVirConfigDomainCapabilities* _tmp5_;
		GVirConfigDomainCapabilitiesOs* _tmp6_;
		GVirConfigDomainCapabilitiesOs* _tmp7_;
		GList* _tmp8_;
		GList* _tmp9_;
		_tmp0_ = boxes_app_get_default_connection (self);
		_tmp1_ = _tmp0_;
		_tmp2_ = _tmp1_;
		_tmp3_ = gvir_connection_get_domain_capabilities (_tmp2_, NULL, NULL, NULL, NULL, (guint) 0, &_inner_error0_);
		_tmp4_ = _tmp3_;
		_g_object_unref0 (_tmp2_);
		domain_capabilities = _tmp4_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp5_ = domain_capabilities;
		_tmp6_ = gvir_config_domain_capabilities_get_os (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp8_ = gvir_config_domain_capabilities_os_get_firmwares (_tmp7_);
		_tmp9_ = _tmp8_;
		_g_object_unref0 (_tmp7_);
		{
			GList* firmware_collection = NULL;
			GList* firmware_it = NULL;
			firmware_collection = _tmp9_;
			for (firmware_it = firmware_collection; firmware_it != NULL; firmware_it = firmware_it->next) {
				GVirConfigDomainOsFirmware firmware = 0;
				firmware = (GVirConfigDomainOsFirmware) ((gintptr) firmware_it->data);
				{
					if (firmware == GVIR_CONFIG_DOMAIN_OS_FIRMWARE_EFI) {
						result = TRUE;
						(firmware_collection == NULL) ? NULL : (firmware_collection = (g_list_free (firmware_collection), NULL));
						_g_object_unref0 (domain_capabilities);
						return result;
					}
				}
			}
			(firmware_collection == NULL) ? NULL : (firmware_collection = (g_list_free (firmware_collection), NULL));
		}
		_g_object_unref0 (domain_capabilities);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* _error_ = NULL;
		GError* _tmp10_;
		const gchar* _tmp11_;
		_error_ = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp10_ = _error_;
		_tmp11_ = _tmp10_->message;
		g_warning ("app.vala:667: Failed to obtain domain capabilities: %s", _tmp11_);
		_g_error_free0 (_error_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp12_ = FALSE;
		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 _tmp12_;
	}
	result = FALSE;
	return result;
}

BoxesAppWindow*
boxes_app_get_main_window (BoxesApp* self)
{
	BoxesAppWindow* result;
	BoxesAppWindow* _tmp0_ = NULL;
	GList* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp1_ = self->priv->windows;
	if (g_list_length (_tmp1_) > ((guint) 0)) {
		GList* _tmp2_;
		gconstpointer _tmp3_;
		_tmp2_ = self->priv->windows;
		_tmp3_ = _tmp2_->data;
		_tmp0_ = (BoxesAppWindow*) _tmp3_;
	} else {
		_tmp0_ = NULL;
	}
	result = _tmp0_;
	return result;
}

const gchar*
boxes_app_get_uri (BoxesApp* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_uri;
	result = _tmp0_;
	return result;
}

void
boxes_app_set_uri (BoxesApp* self,
                   const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = boxes_app_get_uri (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_uri);
		self->priv->_uri = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, boxes_app_properties[BOXES_APP_URI_PROPERTY]);
	}
}

gboolean
boxes_app_get_run_in_bg (BoxesApp* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_run_in_bg;
	return result;
}

static void
boxes_app_set_run_in_bg (BoxesApp* self,
                         gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = boxes_app_get_run_in_bg (self);
	if (old_value != value) {
		self->priv->_run_in_bg = value;
		g_object_notify_by_pspec ((GObject *) self, boxes_app_properties[BOXES_APP_RUN_IN_BG_PROPERTY]);
	}
}

GVirConnection*
boxes_app_get_default_connection (BoxesApp* self)
{
	GVirConnection* result;
	BoxesLibvirtBroker* _tmp0_;
	BoxesLibvirtBroker* _tmp1_;
	GVirConnection* _tmp2_;
	GVirConnection* _tmp3_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = boxes_libvirt_broker_get_default ();
	_tmp1_ = _tmp0_;
	_tmp2_ = boxes_libvirt_broker_get_connection (_tmp1_, "QEMU Session");
	_tmp3_ = _tmp2_;
	_g_object_unref0 (_tmp1_);
	result = _tmp3_;
	return result;
}

BoxesCollectionSource*
boxes_app_get_default_source (BoxesApp* self)
{
	BoxesCollectionSource* result;
	GHashTable* _tmp0_;
	gconstpointer _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->sources;
	_tmp1_ = g_hash_table_lookup (_tmp0_, BOXES_APP_DEFAULT_SOURCE_NAME);
	result = (BoxesCollectionSource*) _tmp1_;
	return result;
}

static void
boxes_app_class_init (BoxesAppClass * klass,
                      gpointer klass_data)
{
	boxes_app_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &BoxesApp_private_offset);
	((GApplicationClass *) klass)->startup = (void (*) (GApplication*)) boxes_app_real_startup;
	((GApplicationClass *) klass)->activate = (void (*) (GApplication*)) boxes_app_real_activate;
	((GApplicationClass *) klass)->command_line = (gint (*) (GApplication*, GApplicationCommandLine*)) boxes_app_real_command_line;
	((GApplicationClass *) klass)->open = (void (*) (GApplication*, GFile**, gint, const gchar*)) boxes_app_real_open;
	((GApplicationClass *) klass)->shutdown = (void (*) (GApplication*)) boxes_app_real_shutdown;
	G_OBJECT_CLASS (klass)->get_property = _vala_boxes_app_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_boxes_app_set_property;
	G_OBJECT_CLASS (klass)->finalize = boxes_app_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_APP_MAIN_WINDOW_PROPERTY, boxes_app_properties[BOXES_APP_MAIN_WINDOW_PROPERTY] = g_param_spec_object ("main-window", "main-window", "main-window", BOXES_TYPE_APP_WINDOW, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_APP_URI_PROPERTY, boxes_app_properties[BOXES_APP_URI_PROPERTY] = g_param_spec_string ("uri", "uri", "uri", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_APP_RUN_IN_BG_PROPERTY, boxes_app_properties[BOXES_APP_RUN_IN_BG_PROPERTY] = g_param_spec_boolean ("run-in-bg", "run-in-bg", "run-in-bg", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_APP_DEFAULT_CONNECTION_PROPERTY, boxes_app_properties[BOXES_APP_DEFAULT_CONNECTION_PROPERTY] = g_param_spec_object ("default-connection", "default-connection", "default-connection", gvir_connection_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_APP_DEFAULT_SOURCE_PROPERTY, boxes_app_properties[BOXES_APP_DEFAULT_SOURCE_PROPERTY] = g_param_spec_object ("default-source", "default-source", "default-source", BOXES_TYPE_COLLECTION_SOURCE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	boxes_app_signals[BOXES_APP_READY_SIGNAL] = g_signal_new ("ready", BOXES_TYPE_APP, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
boxes_app_instance_init (BoxesApp * self,
                         gpointer klass)
{
	BoxesSharedFoldersManager* _tmp0_;
	self->priv = boxes_app_get_instance_private (self);
	_tmp0_ = boxes_shared_folders_manager_get_default ();
	self->shared_folders_manager = _tmp0_;
	self->priv->inhibit_cookie = (guint) 0;
}

static void
boxes_app_finalize (GObject * obj)
{
	BoxesApp * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_APP, BoxesApp);
	(self->priv->windows == NULL) ? NULL : (self->priv->windows = (_g_list_free__g_object_unref0_ (self->priv->windows), NULL));
	(self->priv->system_notifications == NULL) ? NULL : (self->priv->system_notifications = (_g_list_free__g_free0_ (self->priv->system_notifications), NULL));
	_g_free0 (self->priv->_uri);
	_g_object_unref0 (self->collection);
	_g_hash_table_unref0 (self->priv->brokers);
	_g_hash_table_unref0 (self->priv->sources);
	_boxes_async_launcher_unref0 (self->async_launcher);
	_g_object_unref0 (self->shared_folders_manager);
	G_OBJECT_CLASS (boxes_app_parent_class)->finalize (obj);
}

static GType
boxes_app_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BoxesAppClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_app_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesApp), 0, (GInstanceInitFunc) boxes_app_instance_init, NULL };
	GType boxes_app_type_id;
	boxes_app_type_id = g_type_register_static (gtk_application_get_type (), "BoxesApp", &g_define_type_info, 0);
	BoxesApp_private_offset = g_type_add_instance_private (boxes_app_type_id, sizeof (BoxesAppPrivate));
	return boxes_app_type_id;
}

GType
boxes_app_get_type (void)
{
	static volatile gsize boxes_app_type_id__once = 0;
	if (g_once_init_enter (&boxes_app_type_id__once)) {
		GType boxes_app_type_id;
		boxes_app_type_id = boxes_app_get_type_once ();
		g_once_init_leave (&boxes_app_type_id__once, boxes_app_type_id);
	}
	return boxes_app_type_id__once;
}

static void
_vala_boxes_app_get_property (GObject * object,
                              guint property_id,
                              GValue * value,
                              GParamSpec * pspec)
{
	BoxesApp * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BOXES_TYPE_APP, BoxesApp);
	switch (property_id) {
		case BOXES_APP_MAIN_WINDOW_PROPERTY:
		g_value_set_object (value, boxes_app_get_main_window (self));
		break;
		case BOXES_APP_URI_PROPERTY:
		g_value_set_string (value, boxes_app_get_uri (self));
		break;
		case BOXES_APP_RUN_IN_BG_PROPERTY:
		g_value_set_boolean (value, boxes_app_get_run_in_bg (self));
		break;
		case BOXES_APP_DEFAULT_CONNECTION_PROPERTY:
		g_value_take_object (value, boxes_app_get_default_connection (self));
		break;
		case BOXES_APP_DEFAULT_SOURCE_PROPERTY:
		g_value_set_object (value, boxes_app_get_default_source (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_boxes_app_set_property (GObject * object,
                              guint property_id,
                              const GValue * value,
                              GParamSpec * pspec)
{
	BoxesApp * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BOXES_TYPE_APP, BoxesApp);
	switch (property_id) {
		case BOXES_APP_URI_PROPERTY:
		boxes_app_set_uri (self, g_value_get_string (value));
		break;
		case BOXES_APP_RUN_IN_BG_PROPERTY:
		boxes_app_set_run_in_bg (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

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

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

