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

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

#include <handy.h>
#include <glib-object.h>
#include <glib.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>
#include <glib/gi18n-lib.h>
#include "common.h"

#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_SHARED_FOLDER_ROW (boxes_shared_folder_row_get_type ())
#define BOXES_SHARED_FOLDER_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_SHARED_FOLDER_ROW, BoxesSharedFolderRow))
#define BOXES_SHARED_FOLDER_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_SHARED_FOLDER_ROW, BoxesSharedFolderRowClass))
#define BOXES_IS_SHARED_FOLDER_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_SHARED_FOLDER_ROW))
#define BOXES_IS_SHARED_FOLDER_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_SHARED_FOLDER_ROW))
#define BOXES_SHARED_FOLDER_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_SHARED_FOLDER_ROW, BoxesSharedFolderRowClass))

typedef struct _BoxesSharedFolderRow BoxesSharedFolderRow;
typedef struct _BoxesSharedFolderRowClass BoxesSharedFolderRowClass;
typedef struct _BoxesSharedFolderRowPrivate BoxesSharedFolderRowPrivate;

#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_SHARED_FOLDER (boxes_shared_folder_get_type ())
#define BOXES_SHARED_FOLDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_SHARED_FOLDER, BoxesSharedFolder))
#define BOXES_SHARED_FOLDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_SHARED_FOLDER, BoxesSharedFolderClass))
#define BOXES_IS_SHARED_FOLDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_SHARED_FOLDER))
#define BOXES_IS_SHARED_FOLDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_SHARED_FOLDER))
#define BOXES_SHARED_FOLDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_SHARED_FOLDER, BoxesSharedFolderClass))

typedef struct _BoxesSharedFolder BoxesSharedFolder;
typedef struct _BoxesSharedFolderClass BoxesSharedFolderClass;
enum  {
	BOXES_SHARED_FOLDER_ROW_0_PROPERTY,
	BOXES_SHARED_FOLDER_ROW_FOLDER_PROPERTY,
	BOXES_SHARED_FOLDER_ROW_NUM_PROPERTIES
};
static GParamSpec* boxes_shared_folder_row_properties[BOXES_SHARED_FOLDER_ROW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
enum  {
	BOXES_SHARED_FOLDER_ROW_REMOVED_SIGNAL,
	BOXES_SHARED_FOLDER_ROW_NUM_SIGNALS
};
static guint boxes_shared_folder_row_signals[BOXES_SHARED_FOLDER_ROW_NUM_SIGNALS] = {0};

#define BOXES_TYPE_SHARED_FOLDERS_WIDGET (boxes_shared_folders_widget_get_type ())
#define BOXES_SHARED_FOLDERS_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_SHARED_FOLDERS_WIDGET, BoxesSharedFoldersWidget))
#define BOXES_SHARED_FOLDERS_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_SHARED_FOLDERS_WIDGET, BoxesSharedFoldersWidgetClass))
#define BOXES_IS_SHARED_FOLDERS_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_SHARED_FOLDERS_WIDGET))
#define BOXES_IS_SHARED_FOLDERS_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_SHARED_FOLDERS_WIDGET))
#define BOXES_SHARED_FOLDERS_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_SHARED_FOLDERS_WIDGET, BoxesSharedFoldersWidgetClass))

typedef struct _BoxesSharedFoldersWidget BoxesSharedFoldersWidget;
typedef struct _BoxesSharedFoldersWidgetClass BoxesSharedFoldersWidgetClass;
typedef struct _BoxesSharedFoldersWidgetPrivate BoxesSharedFoldersWidgetPrivate;

#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_SHARED_FOLDER_POPOVER (boxes_shared_folder_popover_get_type ())
#define BOXES_SHARED_FOLDER_POPOVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_SHARED_FOLDER_POPOVER, BoxesSharedFolderPopover))
#define BOXES_SHARED_FOLDER_POPOVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_SHARED_FOLDER_POPOVER, BoxesSharedFolderPopoverClass))
#define BOXES_IS_SHARED_FOLDER_POPOVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_SHARED_FOLDER_POPOVER))
#define BOXES_IS_SHARED_FOLDER_POPOVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_SHARED_FOLDER_POPOVER))
#define BOXES_SHARED_FOLDER_POPOVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_SHARED_FOLDER_POPOVER, BoxesSharedFolderPopoverClass))

typedef struct _BoxesSharedFolderPopover BoxesSharedFolderPopover;
typedef struct _BoxesSharedFolderPopoverClass BoxesSharedFolderPopoverClass;
enum  {
	BOXES_SHARED_FOLDERS_WIDGET_0_PROPERTY,
	BOXES_SHARED_FOLDERS_WIDGET_NUM_PROPERTIES
};
static GParamSpec* boxes_shared_folders_widget_properties[BOXES_SHARED_FOLDERS_WIDGET_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _BoxesSharedFolderPopoverPrivate BoxesSharedFolderPopoverPrivate;
enum  {
	BOXES_SHARED_FOLDER_POPOVER_0_PROPERTY,
	BOXES_SHARED_FOLDER_POPOVER_NUM_PROPERTIES
};
static GParamSpec* boxes_shared_folder_popover_properties[BOXES_SHARED_FOLDER_POPOVER_NUM_PROPERTIES];
enum  {
	BOXES_SHARED_FOLDER_POPOVER_SAVED_SIGNAL,
	BOXES_SHARED_FOLDER_POPOVER_NUM_SIGNALS
};
static guint boxes_shared_folder_popover_signals[BOXES_SHARED_FOLDER_POPOVER_NUM_SIGNALS] = {0};

struct _BoxesSharedFolderRow {
	HdyActionRow parent_instance;
	BoxesSharedFolderRowPrivate * priv;
};

struct _BoxesSharedFolderRowClass {
	HdyActionRowClass parent_class;
};

struct _BoxesSharedFolderRowPrivate {
	BoxesSharedFolder* _folder;
};

struct _BoxesSharedFoldersWidget {
	HdyPreferencesGroup parent_instance;
	BoxesSharedFoldersWidgetPrivate * priv;
};

struct _BoxesSharedFoldersWidgetClass {
	HdyPreferencesGroupClass parent_class;
};

struct _BoxesSharedFoldersWidgetPrivate {
	gchar* machine_uuid;
	BoxesSharedFoldersManager* manager;
	GListStore* list_model;
	BoxesSharedFolderPopover* popover;
	GtkListBox* listbox;
};

struct _BoxesSharedFolderPopover {
	GtkPopover parent_instance;
	BoxesSharedFolderPopoverPrivate * priv;
	GtkFileChooserButton* file_chooser_button;
	GtkEntry* name_entry;
};

struct _BoxesSharedFolderPopoverClass {
	GtkPopoverClass parent_class;
};

static gint BoxesSharedFolderRow_private_offset;
static gpointer boxes_shared_folder_row_parent_class = NULL;
static gint BoxesSharedFoldersWidget_private_offset;
static gpointer boxes_shared_folders_widget_parent_class = NULL;
static gpointer boxes_shared_folder_popover_parent_class = NULL;

VALA_EXTERN GType boxes_shared_folder_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesSharedFolderRow, g_object_unref)
VALA_EXTERN GType boxes_collection_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesCollectionItem, g_object_unref)
VALA_EXTERN GType boxes_shared_folder_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesSharedFolder, g_object_unref)
VALA_EXTERN BoxesSharedFolderRow* boxes_shared_folder_row_new (BoxesSharedFolder* folder);
VALA_EXTERN BoxesSharedFolderRow* boxes_shared_folder_row_construct (GType object_type,
                                                         BoxesSharedFolder* folder);
static void boxes_shared_folder_row_set_folder (BoxesSharedFolderRow* self,
                                         BoxesSharedFolder* value);
static void boxes_shared_folder_row_on_delete_button_clicked (BoxesSharedFolderRow* self);
VALA_EXTERN BoxesSharedFolder* boxes_shared_folder_row_get_folder (BoxesSharedFolderRow* self);
static void _boxes_shared_folder_row_on_delete_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                           gpointer self);
static void boxes_shared_folder_row_finalize (GObject * obj);
static GType boxes_shared_folder_row_get_type_once (void);
static void _vala_boxes_shared_folder_row_get_property (GObject * object,
                                                 guint property_id,
                                                 GValue * value,
                                                 GParamSpec * pspec);
static void _vala_boxes_shared_folder_row_set_property (GObject * object,
                                                 guint property_id,
                                                 const GValue * value,
                                                 GParamSpec * pspec);
VALA_EXTERN GType boxes_shared_folders_widget_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesSharedFoldersWidget, 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 GType boxes_shared_folder_popover_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesSharedFolderPopover, g_object_unref)
VALA_EXTERN BoxesSharedFoldersManager* boxes_shared_folders_manager_get_default (void);
VALA_EXTERN void boxes_shared_folders_widget_setup (BoxesSharedFoldersWidget* self,
                                        const gchar* machine_uuid);
VALA_EXTERN GListStore* boxes_shared_folders_manager_get_folders (BoxesSharedFoldersManager* self,
                                                      const gchar* machine_uuid);
static void boxes_shared_folders_widget_on_list_updated (BoxesSharedFoldersWidget* self);
static void _boxes_shared_folders_widget_on_list_updated_g_list_model_items_changed (GListModel* _sender,
                                                                              guint position,
                                                                              guint removed,
                                                                              guint added,
                                                                              gpointer self);
static GtkWidget* boxes_shared_folders_widget_create_shared_folder_row (BoxesSharedFoldersWidget* self,
                                                                 GObject* item);
static GtkWidget* _boxes_shared_folders_widget_create_shared_folder_row_gtk_list_box_create_widget_func (GObject* item,
                                                                                                  gpointer self);
static gboolean boxes_shared_folders_widget_on_popover_saved (BoxesSharedFoldersWidget* self,
                                                       const gchar* path,
                                                       const gchar* name);
VALA_EXTERN gboolean boxes_shared_folders_manager_add_item (BoxesSharedFoldersManager* self,
                                                BoxesSharedFolder* folder);
VALA_EXTERN BoxesSharedFolder* boxes_shared_folder_new (const gchar* machine_uuid,
                                            const gchar* path,
                                            const gchar* name);
VALA_EXTERN BoxesSharedFolder* boxes_shared_folder_construct (GType object_type,
                                                  const gchar* machine_uuid,
                                                  const gchar* path,
                                                  const gchar* name);
VALA_EXTERN void boxes_shared_folders_manager_remove_item (BoxesSharedFoldersManager* self,
                                               BoxesSharedFolder* folder);
static void _boxes_shared_folders_manager_remove_item_boxes_shared_folder_row_removed (BoxesSharedFolderRow* _sender,
                                                                                BoxesSharedFolder* folder,
                                                                                gpointer self);
VALA_EXTERN BoxesSharedFoldersWidget* boxes_shared_folders_widget_new (void);
VALA_EXTERN BoxesSharedFoldersWidget* boxes_shared_folders_widget_construct (GType object_type);
static GObject * boxes_shared_folders_widget_constructor (GType type,
                                                   guint n_construct_properties,
                                                   GObjectConstructParam * construct_properties);
VALA_EXTERN BoxesSharedFolderPopover* boxes_shared_folder_popover_new (void);
VALA_EXTERN BoxesSharedFolderPopover* boxes_shared_folder_popover_construct (GType object_type);
static gboolean _boxes_shared_folders_widget_on_popover_saved_boxes_shared_folder_popover_saved (BoxesSharedFolderPopover* _sender,
                                                                                          const gchar* path,
                                                                                          const gchar* name,
                                                                                          gpointer self);
static void boxes_shared_folders_widget_finalize (GObject * obj);
static GType boxes_shared_folders_widget_get_type_once (void);
VALA_EXTERN void boxes_shared_folder_popover_on_cancel (BoxesSharedFolderPopover* self,
                                            GtkButton* cancel_button);
static void _boxes_shared_folder_popover_on_cancel_gtk_button_clicked (GtkButton* _sender,
                                                                gpointer self);
VALA_EXTERN void boxes_shared_folder_popover_on_save (BoxesSharedFolderPopover* self,
                                          GtkButton* save_button);
static void _boxes_shared_folder_popover_on_save_gtk_button_clicked (GtkButton* _sender,
                                                              gpointer self);
static void g_cclosure_user_marshal_BOOLEAN__STRING_STRING (GClosure * closure,
                                                     GValue * return_value,
                                                     guint n_param_values,
                                                     const GValue * param_values,
                                                     gpointer invocation_hint,
                                                     gpointer marshal_data);
static GObject * boxes_shared_folder_popover_constructor (GType type,
                                                   guint n_construct_properties,
                                                   GObjectConstructParam * construct_properties);
static void boxes_shared_folder_popover_finalize (GObject * obj);
static GType boxes_shared_folder_popover_get_type_once (void);

static inline gpointer
boxes_shared_folder_row_get_instance_private (BoxesSharedFolderRow* self)
{
	return G_STRUCT_MEMBER_P (self, BoxesSharedFolderRow_private_offset);
}

BoxesSharedFolderRow*
boxes_shared_folder_row_construct (GType object_type,
                                   BoxesSharedFolder* folder)
{
	BoxesSharedFolderRow * self = NULL;
	g_return_val_if_fail (folder != NULL, NULL);
	self = (BoxesSharedFolderRow*) g_object_new (object_type, NULL);
	boxes_shared_folder_row_set_folder (self, folder);
	g_object_bind_property_with_closures ((GObject*) folder, "path", (GObject*) self, "title", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	g_object_bind_property_with_closures ((GObject*) folder, "name", (GObject*) self, "subtitle", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	return self;
}

BoxesSharedFolderRow*
boxes_shared_folder_row_new (BoxesSharedFolder* folder)
{
	return boxes_shared_folder_row_construct (BOXES_TYPE_SHARED_FOLDER_ROW, folder);
}

static void
boxes_shared_folder_row_on_delete_button_clicked (BoxesSharedFolderRow* self)
{
	BoxesSharedFolder* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_folder;
	g_signal_emit (self, boxes_shared_folder_row_signals[BOXES_SHARED_FOLDER_ROW_REMOVED_SIGNAL], 0, _tmp0_);
}

static void
_boxes_shared_folder_row_on_delete_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                      gpointer self)
{
	boxes_shared_folder_row_on_delete_button_clicked ((BoxesSharedFolderRow*) self);
}

BoxesSharedFolder*
boxes_shared_folder_row_get_folder (BoxesSharedFolderRow* self)
{
	BoxesSharedFolder* result;
	BoxesSharedFolder* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_folder;
	result = _tmp0_;
	return result;
}

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

static void
boxes_shared_folder_row_set_folder (BoxesSharedFolderRow* self,
                                    BoxesSharedFolder* value)
{
	BoxesSharedFolder* old_value;
	g_return_if_fail (self != NULL);
	old_value = boxes_shared_folder_row_get_folder (self);
	if (old_value != value) {
		BoxesSharedFolder* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_folder);
		self->priv->_folder = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, boxes_shared_folder_row_properties[BOXES_SHARED_FOLDER_ROW_FOLDER_PROPERTY]);
	}
}

static void
boxes_shared_folder_row_class_init (BoxesSharedFolderRowClass * klass,
                                    gpointer klass_data)
{
	boxes_shared_folder_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &BoxesSharedFolderRow_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_boxes_shared_folder_row_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_boxes_shared_folder_row_set_property;
	G_OBJECT_CLASS (klass)->finalize = boxes_shared_folder_row_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_SHARED_FOLDER_ROW_FOLDER_PROPERTY, boxes_shared_folder_row_properties[BOXES_SHARED_FOLDER_ROW_FOLDER_PROPERTY] = g_param_spec_object ("folder", "folder", "folder", BOXES_TYPE_SHARED_FOLDER, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/Boxes/ui/preferences/shared-folder-row.ui");
	boxes_shared_folder_row_signals[BOXES_SHARED_FOLDER_ROW_REMOVED_SIGNAL] = g_signal_new ("removed", BOXES_TYPE_SHARED_FOLDER_ROW, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, BOXES_TYPE_SHARED_FOLDER);
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_delete_button_clicked", G_CALLBACK(_boxes_shared_folder_row_on_delete_button_clicked_gtk_button_clicked));
}

static void
boxes_shared_folder_row_instance_init (BoxesSharedFolderRow * self,
                                       gpointer klass)
{
	self->priv = boxes_shared_folder_row_get_instance_private (self);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
boxes_shared_folder_row_finalize (GObject * obj)
{
	BoxesSharedFolderRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_SHARED_FOLDER_ROW, BoxesSharedFolderRow);
	_g_object_unref0 (self->priv->_folder);
	G_OBJECT_CLASS (boxes_shared_folder_row_parent_class)->finalize (obj);
}

static GType
boxes_shared_folder_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BoxesSharedFolderRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_shared_folder_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesSharedFolderRow), 0, (GInstanceInitFunc) boxes_shared_folder_row_instance_init, NULL };
	GType boxes_shared_folder_row_type_id;
	boxes_shared_folder_row_type_id = g_type_register_static (hdy_action_row_get_type (), "BoxesSharedFolderRow", &g_define_type_info, 0);
	BoxesSharedFolderRow_private_offset = g_type_add_instance_private (boxes_shared_folder_row_type_id, sizeof (BoxesSharedFolderRowPrivate));
	return boxes_shared_folder_row_type_id;
}

GType
boxes_shared_folder_row_get_type (void)
{
	static volatile gsize boxes_shared_folder_row_type_id__once = 0;
	if (g_once_init_enter (&boxes_shared_folder_row_type_id__once)) {
		GType boxes_shared_folder_row_type_id;
		boxes_shared_folder_row_type_id = boxes_shared_folder_row_get_type_once ();
		g_once_init_leave (&boxes_shared_folder_row_type_id__once, boxes_shared_folder_row_type_id);
	}
	return boxes_shared_folder_row_type_id__once;
}

static void
_vala_boxes_shared_folder_row_get_property (GObject * object,
                                            guint property_id,
                                            GValue * value,
                                            GParamSpec * pspec)
{
	BoxesSharedFolderRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BOXES_TYPE_SHARED_FOLDER_ROW, BoxesSharedFolderRow);
	switch (property_id) {
		case BOXES_SHARED_FOLDER_ROW_FOLDER_PROPERTY:
		g_value_set_object (value, boxes_shared_folder_row_get_folder (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_boxes_shared_folder_row_set_property (GObject * object,
                                            guint property_id,
                                            const GValue * value,
                                            GParamSpec * pspec)
{
	BoxesSharedFolderRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BOXES_TYPE_SHARED_FOLDER_ROW, BoxesSharedFolderRow);
	switch (property_id) {
		case BOXES_SHARED_FOLDER_ROW_FOLDER_PROPERTY:
		boxes_shared_folder_row_set_folder (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
boxes_shared_folders_widget_get_instance_private (BoxesSharedFoldersWidget* self)
{
	return G_STRUCT_MEMBER_P (self, BoxesSharedFoldersWidget_private_offset);
}

static void
_boxes_shared_folders_widget_on_list_updated_g_list_model_items_changed (GListModel* _sender,
                                                                         guint position,
                                                                         guint removed,
                                                                         guint added,
                                                                         gpointer self)
{
	boxes_shared_folders_widget_on_list_updated ((BoxesSharedFoldersWidget*) self);
}

static GtkWidget*
_boxes_shared_folders_widget_create_shared_folder_row_gtk_list_box_create_widget_func (GObject* item,
                                                                                       gpointer self)
{
	GtkWidget* result;
	result = boxes_shared_folders_widget_create_shared_folder_row ((BoxesSharedFoldersWidget*) self, item);
	return result;
}

void
boxes_shared_folders_widget_setup (BoxesSharedFoldersWidget* self,
                                   const gchar* machine_uuid)
{
	gchar* _tmp0_;
	BoxesSharedFoldersManager* _tmp1_;
	GListStore* _tmp2_;
	GListStore* _tmp3_;
	GtkListBox* _tmp4_;
	GListStore* _tmp5_;
	GtkMenuButton* add_button = NULL;
	gchar* _tmp6_;
	GtkImage* _tmp7_ = NULL;
	BoxesSharedFolderPopover* _tmp8_;
	GtkPopover* _tmp9_;
	GtkMenuButton* _tmp10_ = NULL;
	GtkStyleContext* _tmp11_;
	GtkListBox* _tmp12_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (machine_uuid != NULL);
	_tmp0_ = g_strdup (machine_uuid);
	_g_free0 (self->priv->machine_uuid);
	self->priv->machine_uuid = _tmp0_;
	_tmp1_ = self->priv->manager;
	_tmp2_ = boxes_shared_folders_manager_get_folders (_tmp1_, machine_uuid);
	_g_object_unref0 (self->priv->list_model);
	self->priv->list_model = _tmp2_;
	_tmp3_ = self->priv->list_model;
	g_signal_connect_object ((GListModel*) _tmp3_, "items-changed", (GCallback) _boxes_shared_folders_widget_on_list_updated_g_list_model_items_changed, self, 0);
	_tmp4_ = self->priv->listbox;
	_tmp5_ = self->priv->list_model;
	gtk_list_box_bind_model (_tmp4_, (GListModel*) _tmp5_, _boxes_shared_folders_widget_create_shared_folder_row_gtk_list_box_create_widget_func, g_object_ref (self), g_object_unref);
	_tmp6_ = g_strdup ("list-add-symbolic");
	_tmp7_ = (GtkImage*) gtk_image_new ();
	g_object_set (_tmp7_, "icon-name", _tmp6_, NULL);
	_g_free0 (_tmp6_);
	g_object_ref_sink (_tmp7_);
	_tmp8_ = self->priv->popover;
	_tmp9_ = _g_object_ref0 ((GtkPopover*) _tmp8_);
	_tmp10_ = (GtkMenuButton*) gtk_menu_button_new ();
	gtk_widget_set_visible ((GtkWidget*) _tmp10_, TRUE);
	gtk_button_set_image ((GtkButton*) _tmp10_, (GtkWidget*) _tmp7_);
	_g_object_unref0 (_tmp7_);
	gtk_menu_button_set_popover (_tmp10_, _tmp9_);
	_g_object_unref0 (_tmp9_);
	g_object_ref_sink (_tmp10_);
	add_button = _tmp10_;
	_tmp11_ = gtk_widget_get_style_context ((GtkWidget*) add_button);
	gtk_style_context_add_class (_tmp11_, "flat");
	_tmp12_ = self->priv->listbox;
	gtk_container_add ((GtkContainer*) _tmp12_, (GtkWidget*) add_button);
	boxes_shared_folders_widget_on_list_updated (self);
	_g_object_unref0 (add_button);
}

static gboolean
boxes_shared_folders_widget_on_popover_saved (BoxesSharedFoldersWidget* self,
                                              const gchar* path,
                                              const gchar* name)
{
	BoxesSharedFoldersManager* _tmp0_;
	const gchar* _tmp1_;
	BoxesSharedFolder* _tmp2_;
	BoxesSharedFolder* _tmp3_;
	gboolean _tmp4_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (path != NULL, FALSE);
	_tmp0_ = self->priv->manager;
	_tmp1_ = self->priv->machine_uuid;
	_tmp2_ = boxes_shared_folder_new (_tmp1_, path, name);
	_tmp3_ = _tmp2_;
	_tmp4_ = boxes_shared_folders_manager_add_item (_tmp0_, _tmp3_);
	_g_object_unref0 (_tmp3_);
	result = _tmp4_;
	return result;
}

static void
_boxes_shared_folders_manager_remove_item_boxes_shared_folder_row_removed (BoxesSharedFolderRow* _sender,
                                                                           BoxesSharedFolder* folder,
                                                                           gpointer self)
{
	boxes_shared_folders_manager_remove_item ((BoxesSharedFoldersManager*) self, folder);
}

static GtkWidget*
boxes_shared_folders_widget_create_shared_folder_row (BoxesSharedFoldersWidget* self,
                                                      GObject* item)
{
	BoxesSharedFolder* folder = NULL;
	BoxesSharedFolder* _tmp0_;
	BoxesSharedFolderRow* row = NULL;
	BoxesSharedFolderRow* _tmp1_;
	BoxesSharedFoldersManager* _tmp2_;
	GtkWidget* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (item != NULL, NULL);
	_tmp0_ = _g_object_ref0 (BOXES_IS_SHARED_FOLDER (item) ? ((BoxesSharedFolder*) item) : NULL);
	folder = _tmp0_;
	_tmp1_ = boxes_shared_folder_row_new (folder);
	g_object_ref_sink (_tmp1_);
	row = _tmp1_;
	_tmp2_ = self->priv->manager;
	g_signal_connect_object (row, "removed", (GCallback) _boxes_shared_folders_manager_remove_item_boxes_shared_folder_row_removed, _tmp2_, 0);
	result = (GtkWidget*) row;
	_g_object_unref0 (folder);
	return result;
}

static void
boxes_shared_folders_widget_on_list_updated (BoxesSharedFoldersWidget* self)
{
	GListStore* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->list_model;
	if (g_list_model_get_n_items ((GListModel*) _tmp0_) == ((guint) 0)) {
		gchar* _tmp1_;
		gchar* _tmp2_;
		_tmp1_ = g_strdup_printf (_ ("Use the button below to add your first shared folder. For file sharing" \
" to work, the guest box needs to have <a href='%s'>spice-webdav</a> in" \
"stalled."), "https://www.spice-space.org/download.html");
		_tmp2_ = _tmp1_;
		hdy_preferences_group_set_description ((HdyPreferencesGroup*) self, _tmp2_);
		_g_free0 (_tmp2_);
	} else {
		hdy_preferences_group_set_description ((HdyPreferencesGroup*) self, NULL);
	}
}

BoxesSharedFoldersWidget*
boxes_shared_folders_widget_construct (GType object_type)
{
	BoxesSharedFoldersWidget * self = NULL;
	self = (BoxesSharedFoldersWidget*) g_object_new (object_type, NULL);
	return self;
}

BoxesSharedFoldersWidget*
boxes_shared_folders_widget_new (void)
{
	return boxes_shared_folders_widget_construct (BOXES_TYPE_SHARED_FOLDERS_WIDGET);
}

static gboolean
_boxes_shared_folders_widget_on_popover_saved_boxes_shared_folder_popover_saved (BoxesSharedFolderPopover* _sender,
                                                                                 const gchar* path,
                                                                                 const gchar* name,
                                                                                 gpointer self)
{
	gboolean result;
	result = boxes_shared_folders_widget_on_popover_saved ((BoxesSharedFoldersWidget*) self, path, name);
	return result;
}

static GObject *
boxes_shared_folders_widget_constructor (GType type,
                                         guint n_construct_properties,
                                         GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	BoxesSharedFoldersWidget * self;
	BoxesSharedFolderPopover* _tmp0_;
	BoxesSharedFolderPopover* _tmp1_;
	parent_class = G_OBJECT_CLASS (boxes_shared_folders_widget_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_SHARED_FOLDERS_WIDGET, BoxesSharedFoldersWidget);
	_tmp0_ = boxes_shared_folder_popover_new ();
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->popover);
	self->priv->popover = _tmp0_;
	_tmp1_ = self->priv->popover;
	g_signal_connect_object (_tmp1_, "saved", (GCallback) _boxes_shared_folders_widget_on_popover_saved_boxes_shared_folder_popover_saved, self, 0);
	return obj;
}

static void
boxes_shared_folders_widget_class_init (BoxesSharedFoldersWidgetClass * klass,
                                        gpointer klass_data)
{
	boxes_shared_folders_widget_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &BoxesSharedFoldersWidget_private_offset);
	G_OBJECT_CLASS (klass)->constructor = boxes_shared_folders_widget_constructor;
	G_OBJECT_CLASS (klass)->finalize = boxes_shared_folders_widget_finalize;
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/Boxes/ui/preferences/shared-folders-widget.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "listbox", FALSE, BoxesSharedFoldersWidget_private_offset + G_STRUCT_OFFSET (BoxesSharedFoldersWidgetPrivate, listbox));
}

static void
boxes_shared_folders_widget_instance_init (BoxesSharedFoldersWidget * self,
                                           gpointer klass)
{
	BoxesSharedFoldersManager* _tmp0_;
	self->priv = boxes_shared_folders_widget_get_instance_private (self);
	_tmp0_ = boxes_shared_folders_manager_get_default ();
	self->priv->manager = _tmp0_;
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
boxes_shared_folders_widget_finalize (GObject * obj)
{
	BoxesSharedFoldersWidget * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_SHARED_FOLDERS_WIDGET, BoxesSharedFoldersWidget);
	_g_free0 (self->priv->machine_uuid);
	_g_object_unref0 (self->priv->manager);
	_g_object_unref0 (self->priv->list_model);
	_g_object_unref0 (self->priv->popover);
	G_OBJECT_CLASS (boxes_shared_folders_widget_parent_class)->finalize (obj);
}

static GType
boxes_shared_folders_widget_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BoxesSharedFoldersWidgetClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_shared_folders_widget_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesSharedFoldersWidget), 0, (GInstanceInitFunc) boxes_shared_folders_widget_instance_init, NULL };
	GType boxes_shared_folders_widget_type_id;
	boxes_shared_folders_widget_type_id = g_type_register_static (hdy_preferences_group_get_type (), "BoxesSharedFoldersWidget", &g_define_type_info, 0);
	BoxesSharedFoldersWidget_private_offset = g_type_add_instance_private (boxes_shared_folders_widget_type_id, sizeof (BoxesSharedFoldersWidgetPrivate));
	return boxes_shared_folders_widget_type_id;
}

GType
boxes_shared_folders_widget_get_type (void)
{
	static volatile gsize boxes_shared_folders_widget_type_id__once = 0;
	if (g_once_init_enter (&boxes_shared_folders_widget_type_id__once)) {
		GType boxes_shared_folders_widget_type_id;
		boxes_shared_folders_widget_type_id = boxes_shared_folders_widget_get_type_once ();
		g_once_init_leave (&boxes_shared_folders_widget_type_id__once, boxes_shared_folders_widget_type_id);
	}
	return boxes_shared_folders_widget_type_id__once;
}

void
boxes_shared_folder_popover_on_cancel (BoxesSharedFolderPopover* self,
                                       GtkButton* cancel_button)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (cancel_button != NULL);
	gtk_popover_popdown ((GtkPopover*) self);
}

static void
_boxes_shared_folder_popover_on_cancel_gtk_button_clicked (GtkButton* _sender,
                                                           gpointer self)
{
	boxes_shared_folder_popover_on_cancel ((BoxesSharedFolderPopover*) self, _sender);
}

void
boxes_shared_folder_popover_on_save (BoxesSharedFolderPopover* self,
                                     GtkButton* save_button)
{
	gchar* uri = NULL;
	GtkFileChooserButton* _tmp0_;
	gchar* _tmp1_;
	GFile* file = NULL;
	const gchar* _tmp2_;
	GFile* _tmp3_;
	gchar* name = NULL;
	GtkEntry* _tmp4_;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	const gchar* _tmp7_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (save_button != NULL);
	_tmp0_ = self->file_chooser_button;
	_tmp1_ = gtk_file_chooser_get_uri ((GtkFileChooser*) _tmp0_);
	uri = _tmp1_;
	_tmp2_ = uri;
	_tmp3_ = g_file_new_for_uri (_tmp2_);
	file = _tmp3_;
	_tmp4_ = self->name_entry;
	_tmp5_ = gtk_entry_get_text (_tmp4_);
	_tmp6_ = g_strdup (_tmp5_);
	name = _tmp6_;
	_tmp7_ = uri;
	if (_tmp7_ != NULL) {
		const gchar* _tmp8_;
		GFile* _tmp11_;
		gchar* _tmp12_;
		gchar* _tmp13_;
		const gchar* _tmp14_;
		gboolean _tmp15_ = FALSE;
		_tmp8_ = name;
		if (g_strcmp0 (_tmp8_, "") == 0) {
			GFile* _tmp9_;
			gchar* _tmp10_;
			_tmp9_ = file;
			_tmp10_ = g_file_get_basename (_tmp9_);
			_g_free0 (name);
			name = _tmp10_;
		}
		_tmp11_ = file;
		_tmp12_ = g_file_get_path (_tmp11_);
		_tmp13_ = _tmp12_;
		_tmp14_ = name;
		g_signal_emit (self, boxes_shared_folder_popover_signals[BOXES_SHARED_FOLDER_POPOVER_SAVED_SIGNAL], 0, _tmp13_, _tmp14_, &_tmp15_);
		_g_free0 (_tmp13_);
	}
	gtk_popover_popdown ((GtkPopover*) self);
	_g_free0 (name);
	_g_object_unref0 (file);
	_g_free0 (uri);
}

static void
_boxes_shared_folder_popover_on_save_gtk_button_clicked (GtkButton* _sender,
                                                         gpointer self)
{
	boxes_shared_folder_popover_on_save ((BoxesSharedFolderPopover*) self, _sender);
}

BoxesSharedFolderPopover*
boxes_shared_folder_popover_construct (GType object_type)
{
	BoxesSharedFolderPopover * self = NULL;
	self = (BoxesSharedFolderPopover*) g_object_new (object_type, NULL);
	return self;
}

BoxesSharedFolderPopover*
boxes_shared_folder_popover_new (void)
{
	return boxes_shared_folder_popover_construct (BOXES_TYPE_SHARED_FOLDER_POPOVER);
}

static void
g_cclosure_user_marshal_BOOLEAN__STRING_STRING (GClosure * closure,
                                                GValue * return_value,
                                                guint n_param_values,
                                                const GValue * param_values,
                                                gpointer invocation_hint,
                                                gpointer marshal_data)
{
	typedef gboolean (*GMarshalFunc_BOOLEAN__STRING_STRING) (gpointer data1, const char* arg_1, const char* arg_2, gpointer data2);
	register GMarshalFunc_BOOLEAN__STRING_STRING callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	gboolean v_return;
	cc = (GCClosure *) closure;
	g_return_if_fail (return_value != NULL);
	g_return_if_fail (n_param_values == 3);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_BOOLEAN__STRING_STRING) (marshal_data ? marshal_data : cc->callback);
	v_return = callback (data1, g_value_get_string (param_values + 1), g_value_get_string (param_values + 2), data2);
	g_value_set_boolean (return_value, v_return);
}

static GObject *
boxes_shared_folder_popover_constructor (GType type,
                                         guint n_construct_properties,
                                         GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	BoxesSharedFolderPopover * self;
	gchar* default_path = NULL;
	gchar* _tmp0_;
	GtkFileChooserButton* _tmp1_;
	const gchar* _tmp2_;
	parent_class = G_OBJECT_CLASS (boxes_shared_folder_popover_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_SHARED_FOLDER_POPOVER, BoxesSharedFolderPopover);
	_tmp0_ = boxes_get_user_special_dir_with_fallback (G_USER_DIRECTORY_PUBLIC_SHARE);
	default_path = _tmp0_;
	_tmp1_ = self->file_chooser_button;
	_tmp2_ = default_path;
	gtk_file_chooser_set_current_folder ((GtkFileChooser*) _tmp1_, _tmp2_);
	_g_free0 (default_path);
	return obj;
}

static void
boxes_shared_folder_popover_class_init (BoxesSharedFolderPopoverClass * klass,
                                        gpointer klass_data)
{
	boxes_shared_folder_popover_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->constructor = boxes_shared_folder_popover_constructor;
	G_OBJECT_CLASS (klass)->finalize = boxes_shared_folder_popover_finalize;
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/Boxes/ui/preferences/shared-folder-popover.ui");
	boxes_shared_folder_popover_signals[BOXES_SHARED_FOLDER_POPOVER_SAVED_SIGNAL] = g_signal_new ("saved", BOXES_TYPE_SHARED_FOLDER_POPOVER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_BOOLEAN__STRING_STRING, G_TYPE_BOOLEAN, 2, G_TYPE_STRING, G_TYPE_STRING);
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "file_chooser_button", FALSE, G_STRUCT_OFFSET (BoxesSharedFolderPopover, file_chooser_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "name_entry", FALSE, G_STRUCT_OFFSET (BoxesSharedFolderPopover, name_entry));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_cancel", G_CALLBACK(_boxes_shared_folder_popover_on_cancel_gtk_button_clicked));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_save", G_CALLBACK(_boxes_shared_folder_popover_on_save_gtk_button_clicked));
}

static void
boxes_shared_folder_popover_instance_init (BoxesSharedFolderPopover * self,
                                           gpointer klass)
{
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
boxes_shared_folder_popover_finalize (GObject * obj)
{
	BoxesSharedFolderPopover * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_SHARED_FOLDER_POPOVER, BoxesSharedFolderPopover);
	G_OBJECT_CLASS (boxes_shared_folder_popover_parent_class)->finalize (obj);
}

static GType
boxes_shared_folder_popover_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BoxesSharedFolderPopoverClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_shared_folder_popover_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesSharedFolderPopover), 0, (GInstanceInitFunc) boxes_shared_folder_popover_instance_init, NULL };
	GType boxes_shared_folder_popover_type_id;
	boxes_shared_folder_popover_type_id = g_type_register_static (gtk_popover_get_type (), "BoxesSharedFolderPopover", &g_define_type_info, 0);
	return boxes_shared_folder_popover_type_id;
}

GType
boxes_shared_folder_popover_get_type (void)
{
	static volatile gsize boxes_shared_folder_popover_type_id__once = 0;
	if (g_once_init_enter (&boxes_shared_folder_popover_type_id__once)) {
		GType boxes_shared_folder_popover_type_id;
		boxes_shared_folder_popover_type_id = boxes_shared_folder_popover_get_type_once ();
		g_once_init_leave (&boxes_shared_folder_popover_type_id__once, boxes_shared_folder_popover_type_id);
	}
	return boxes_shared_folder_popover_type_id__once;
}

