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

/* SPDX-FileCopyrightText: Jens Georg <mail@jensge.org>*/
/* SPDX-License-Identifier: LGPL-2.1-or-later*/

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

#define SHOTWELL_PROFILE_SYSTEM "__shotwell_default_system"
#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 SHOTWELL_TYPE_PROFILE_EDITOR (shotwell_profile_editor_get_type ())
#define SHOTWELL_PROFILE_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SHOTWELL_TYPE_PROFILE_EDITOR, ShotwellProfileEditor))
#define SHOTWELL_PROFILE_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SHOTWELL_TYPE_PROFILE_EDITOR, ShotwellProfileEditorClass))
#define SHOTWELL_IS_PROFILE_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SHOTWELL_TYPE_PROFILE_EDITOR))
#define SHOTWELL_IS_PROFILE_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SHOTWELL_TYPE_PROFILE_EDITOR))
#define SHOTWELL_PROFILE_EDITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SHOTWELL_TYPE_PROFILE_EDITOR, ShotwellProfileEditorClass))

typedef struct _ShotwellProfileEditor ShotwellProfileEditor;
typedef struct _ShotwellProfileEditorClass ShotwellProfileEditorClass;
typedef struct _ShotwellProfileEditorPrivate ShotwellProfileEditorPrivate;
enum  {
	SHOTWELL_PROFILE_EDITOR_0_PROPERTY,
	SHOTWELL_PROFILE_EDITOR_PROFILE_NAME_PROPERTY,
	SHOTWELL_PROFILE_EDITOR_ID_PROPERTY,
	SHOTWELL_PROFILE_EDITOR_LIBRARY_FOLDER_PROPERTY,
	SHOTWELL_PROFILE_EDITOR_DATA_FOLDER_PROPERTY,
	SHOTWELL_PROFILE_EDITOR_NUM_PROPERTIES
};
static GParamSpec* shotwell_profile_editor_properties[SHOTWELL_PROFILE_EDITOR_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define SHOTWELL_TYPE_PROFILE_ROW (shotwell_profile_row_get_type ())
#define SHOTWELL_PROFILE_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SHOTWELL_TYPE_PROFILE_ROW, ShotwellProfileRow))
#define SHOTWELL_PROFILE_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SHOTWELL_TYPE_PROFILE_ROW, ShotwellProfileRowClass))
#define SHOTWELL_IS_PROFILE_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SHOTWELL_TYPE_PROFILE_ROW))
#define SHOTWELL_IS_PROFILE_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SHOTWELL_TYPE_PROFILE_ROW))
#define SHOTWELL_PROFILE_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SHOTWELL_TYPE_PROFILE_ROW, ShotwellProfileRowClass))

typedef struct _ShotwellProfileRow ShotwellProfileRow;
typedef struct _ShotwellProfileRowClass ShotwellProfileRowClass;
typedef struct _ShotwellProfileRowPrivate ShotwellProfileRowPrivate;

#define SHOTWELL_TYPE_PROFILE (shotwell_profile_get_type ())
#define SHOTWELL_PROFILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SHOTWELL_TYPE_PROFILE, ShotwellProfile))
#define SHOTWELL_PROFILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SHOTWELL_TYPE_PROFILE, ShotwellProfileClass))
#define SHOTWELL_IS_PROFILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SHOTWELL_TYPE_PROFILE))
#define SHOTWELL_IS_PROFILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SHOTWELL_TYPE_PROFILE))
#define SHOTWELL_PROFILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SHOTWELL_TYPE_PROFILE, ShotwellProfileClass))

typedef struct _ShotwellProfile ShotwellProfile;
typedef struct _ShotwellProfileClass ShotwellProfileClass;
enum  {
	SHOTWELL_PROFILE_ROW_0_PROPERTY,
	SHOTWELL_PROFILE_ROW_PROFILE_PROPERTY,
	SHOTWELL_PROFILE_ROW_NUM_PROPERTIES
};
static GParamSpec* shotwell_profile_row_properties[SHOTWELL_PROFILE_ROW_NUM_PROPERTIES];

#define SHOTWELL_TYPE_PROFILE_MANAGER (shotwell_profile_manager_get_type ())
#define SHOTWELL_PROFILE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SHOTWELL_TYPE_PROFILE_MANAGER, ShotwellProfileManager))
#define SHOTWELL_PROFILE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SHOTWELL_TYPE_PROFILE_MANAGER, ShotwellProfileManagerClass))
#define SHOTWELL_IS_PROFILE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SHOTWELL_TYPE_PROFILE_MANAGER))
#define SHOTWELL_IS_PROFILE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SHOTWELL_TYPE_PROFILE_MANAGER))
#define SHOTWELL_PROFILE_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SHOTWELL_TYPE_PROFILE_MANAGER, ShotwellProfileManagerClass))

typedef struct _ShotwellProfileManager ShotwellProfileManager;
typedef struct _ShotwellProfileManagerClass ShotwellProfileManagerClass;

#define SHOTWELL_TYPE_PROFILE_BROWSER (shotwell_profile_browser_get_type ())
#define SHOTWELL_PROFILE_BROWSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SHOTWELL_TYPE_PROFILE_BROWSER, ShotwellProfileBrowser))
#define SHOTWELL_PROFILE_BROWSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SHOTWELL_TYPE_PROFILE_BROWSER, ShotwellProfileBrowserClass))
#define SHOTWELL_IS_PROFILE_BROWSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SHOTWELL_TYPE_PROFILE_BROWSER))
#define SHOTWELL_IS_PROFILE_BROWSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SHOTWELL_TYPE_PROFILE_BROWSER))
#define SHOTWELL_PROFILE_BROWSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SHOTWELL_TYPE_PROFILE_BROWSER, ShotwellProfileBrowserClass))

typedef struct _ShotwellProfileBrowser ShotwellProfileBrowser;
typedef struct _ShotwellProfileBrowserClass ShotwellProfileBrowserClass;
typedef struct _ShotwellProfileBrowserPrivate ShotwellProfileBrowserPrivate;
enum  {
	SHOTWELL_PROFILE_BROWSER_0_PROPERTY,
	SHOTWELL_PROFILE_BROWSER_NUM_PROPERTIES
};
static GParamSpec* shotwell_profile_browser_properties[SHOTWELL_PROFILE_BROWSER_NUM_PROPERTIES];
enum  {
	SHOTWELL_PROFILE_BROWSER_PROFILE_ACTIVATED_SIGNAL,
	SHOTWELL_PROFILE_BROWSER_NUM_SIGNALS
};
static guint shotwell_profile_browser_signals[SHOTWELL_PROFILE_BROWSER_NUM_SIGNALS] = {0};

struct _ShotwellProfileEditor {
	GtkDialog parent_instance;
	ShotwellProfileEditorPrivate * priv;
};

struct _ShotwellProfileEditorClass {
	GtkDialogClass parent_class;
};

struct _ShotwellProfileEditorPrivate {
	gchar* _profile_name;
	gchar* _id;
	gchar* _library_folder;
	gchar* _data_folder;
};

struct _ShotwellProfileRow {
	GtkBox parent_instance;
	ShotwellProfileRowPrivate * priv;
};

struct _ShotwellProfileRowClass {
	GtkBoxClass parent_class;
};

struct _ShotwellProfileRowPrivate {
	ShotwellProfile* _profile;
};

struct _ShotwellProfileBrowser {
	GtkBox parent_instance;
	ShotwellProfileBrowserPrivate * priv;
};

struct _ShotwellProfileBrowserClass {
	GtkBoxClass parent_class;
};

static gint ShotwellProfileEditor_private_offset;
static gpointer shotwell_profile_editor_parent_class = NULL;
static gint ShotwellProfileRow_private_offset;
static gpointer shotwell_profile_row_parent_class = NULL;
static gpointer shotwell_profile_browser_parent_class = NULL;

VALA_EXTERN GType shotwell_profile_editor_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ShotwellProfileEditor, g_object_unref)
VALA_EXTERN ShotwellProfileEditor* shotwell_profile_editor_new (void);
VALA_EXTERN ShotwellProfileEditor* shotwell_profile_editor_construct (GType object_type);
VALA_EXTERN gint resources_use_header_bar (void);
static void shotwell_profile_editor_real_constructed (GObject* base);
VALA_EXTERN const gchar* shotwell_profile_editor_get_id (ShotwellProfileEditor* self);
VALA_EXTERN void shotwell_profile_editor_set_data_folder (ShotwellProfileEditor* self,
                                              const gchar* value);
VALA_EXTERN void shotwell_profile_editor_set_library_folder (ShotwellProfileEditor* self,
                                                 const gchar* value);
static gboolean __lambda35_ (ShotwellProfileEditor* self,
                      GBinding* binding,
                      GValue* from,
                      GValue* to);
static gboolean ___lambda35__gbinding_transform_func (GBinding* binding,
                                               GValue* from_value,
                                               GValue* to_value,
                                               gpointer self);
static gboolean __lambda36_ (ShotwellProfileEditor* self,
                      GBinding* binding,
                      GValue* from,
                      GValue* to);
static gboolean ___lambda36__gbinding_transform_func (GBinding* binding,
                                               GValue* from_value,
                                               GValue* to_value,
                                               gpointer self);
static void __lambda37_ (ShotwellProfileEditor* self);
VALA_EXTERN const gchar* shotwell_profile_editor_get_library_folder (ShotwellProfileEditor* self);
static void ___lambda37__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);
static gboolean __lambda38_ (ShotwellProfileEditor* self,
                      GBinding* binding,
                      GValue* from,
                      GValue* to);
static gboolean ___lambda38__gbinding_transform_func (GBinding* binding,
                                               GValue* from_value,
                                               GValue* to_value,
                                               gpointer self);
static void __lambda39_ (ShotwellProfileEditor* self);
VALA_EXTERN const gchar* shotwell_profile_editor_get_data_folder (ShotwellProfileEditor* self);
static void ___lambda39__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);
VALA_EXTERN const gchar* shotwell_profile_editor_get_profile_name (ShotwellProfileEditor* self);
VALA_EXTERN void shotwell_profile_editor_set_profile_name (ShotwellProfileEditor* self,
                                               const gchar* value);
static void shotwell_profile_editor_finalize (GObject * obj);
static GType shotwell_profile_editor_get_type_once (void);
static void _vala_shotwell_profile_editor_get_property (GObject * object,
                                                 guint property_id,
                                                 GValue * value,
                                                 GParamSpec * pspec);
static void _vala_shotwell_profile_editor_set_property (GObject * object,
                                                 guint property_id,
                                                 const GValue * value,
                                                 GParamSpec * pspec);
VALA_EXTERN GType shotwell_profile_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ShotwellProfileRow, g_object_unref)
VALA_EXTERN GType shotwell_profile_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ShotwellProfile, g_object_unref)
VALA_EXTERN ShotwellProfileRow* shotwell_profile_row_new (ShotwellProfile* profile);
VALA_EXTERN ShotwellProfileRow* shotwell_profile_row_construct (GType object_type,
                                                    ShotwellProfile* profile);
static void shotwell_profile_row_real_constructed (GObject* base);
VALA_EXTERN ShotwellProfile* shotwell_profile_row_get_profile (ShotwellProfileRow* self);
VALA_EXTERN const gchar* shotwell_profile_get_name (ShotwellProfile* self);
VALA_EXTERN gboolean shotwell_profile_get_active (ShotwellProfile* self);
VALA_EXTERN const gchar* shotwell_profile_get_id (ShotwellProfile* self);
VALA_EXTERN const gchar* shotwell_profile_get_data_dir (ShotwellProfile* self);
static void ___lambda33_ (ShotwellProfileRow* self);
VALA_EXTERN GType shotwell_profile_manager_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ShotwellProfileManager, g_object_unref)
VALA_EXTERN ShotwellProfileManager* shotwell_profile_manager_get_instance (void);
VALA_EXTERN void shotwell_profile_manager_remove (ShotwellProfileManager* self,
                                      const gchar* id,
                                      gboolean remove_all);
static void ____lambda33__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void shotwell_profile_row_set_profile (ShotwellProfileRow* self,
                                       ShotwellProfile* value);
static void shotwell_profile_row_finalize (GObject * obj);
static GType shotwell_profile_row_get_type_once (void);
static void _vala_shotwell_profile_row_get_property (GObject * object,
                                              guint property_id,
                                              GValue * value,
                                              GParamSpec * pspec);
static void _vala_shotwell_profile_row_set_property (GObject * object,
                                              guint property_id,
                                              const GValue * value,
                                              GParamSpec * pspec);
VALA_EXTERN GType shotwell_profile_browser_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ShotwellProfileBrowser, g_object_unref)
VALA_EXTERN ShotwellProfileBrowser* shotwell_profile_browser_new (void);
VALA_EXTERN ShotwellProfileBrowser* shotwell_profile_browser_construct (GType object_type);
static void shotwell_profile_browser_real_constructed (GObject* base);
static void __lambda32_ (ShotwellProfileBrowser* self,
                  GtkListBox* list_box,
                  GtkListBoxRow* row);
static void ___lambda32__gtk_list_box_row_activated (GtkListBox* _sender,
                                              GtkListBoxRow* row,
                                              gpointer self);
static GtkWidget* shotwell_profile_browser_on_widget_create (ShotwellProfileBrowser* self,
                                                      GObject* item);
static GtkWidget* _shotwell_profile_browser_on_widget_create_gtk_list_box_create_widget_func (GObject* item,
                                                                                       gpointer self);
static void shotwell_profile_browser_on_header (ShotwellProfileBrowser* self,
                                         GtkListBoxRow* row,
                                         GtkListBoxRow* before);
static void _shotwell_profile_browser_on_header_gtk_list_box_update_header_func (GtkListBoxRow* row,
                                                                          GtkListBoxRow* before,
                                                                          gpointer self);
static void __lambda34_ (ShotwellProfileBrowser* self);
VALA_EXTERN void shotwell_profile_manager_add_profile (ShotwellProfileManager* self,
                                           const gchar* id,
                                           const gchar* name,
                                           const gchar* library_folder,
                                           const gchar* data_folder);
static void ___lambda34__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);
static GType shotwell_profile_browser_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
shotwell_profile_editor_get_instance_private (ShotwellProfileEditor* self)
{
	return G_STRUCT_MEMBER_P (self, ShotwellProfileEditor_private_offset);
}

ShotwellProfileEditor*
shotwell_profile_editor_construct (GType object_type)
{
	ShotwellProfileEditor * self = NULL;
	self = (ShotwellProfileEditor*) g_object_new (object_type, "use-header-bar", resources_use_header_bar (), NULL);
	return self;
}

ShotwellProfileEditor*
shotwell_profile_editor_new (void)
{
	return shotwell_profile_editor_construct (SHOTWELL_TYPE_PROFILE_EDITOR);
}

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

static gboolean
__lambda35_ (ShotwellProfileEditor* self,
             GBinding* binding,
             GValue* from,
             GValue* to)
{
	const gchar* _tmp0_;
	GValue _tmp1_ = {0};
	gboolean result;
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (binding, G_TYPE_BINDING), FALSE);
	g_return_val_if_fail (from != NULL, FALSE);
	g_return_val_if_fail (to != NULL, FALSE);
	_tmp0_ = g_value_get_string (from);
	g_value_init (&_tmp1_, G_TYPE_BOOLEAN);
	g_value_set_boolean (&_tmp1_, g_strcmp0 (_tmp0_, "") != 0);
	G_IS_VALUE (to) ? (g_value_unset (to), NULL) : NULL;
	*to = _tmp1_;
	result = TRUE;
	return result;
}

static gboolean
___lambda35__gbinding_transform_func (GBinding* binding,
                                      GValue* from_value,
                                      GValue* to_value,
                                      gpointer self)
{
	gboolean result;
	result = __lambda35_ ((ShotwellProfileEditor*) self, binding, from_value, to_value);
	return result;
}

static gboolean
__lambda36_ (ShotwellProfileEditor* self,
             GBinding* binding,
             GValue* from,
             GValue* to)
{
	const gchar* _tmp0_;
	GValue _tmp1_ = {0};
	gboolean result;
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (binding, G_TYPE_BINDING), FALSE);
	g_return_val_if_fail (from != NULL, FALSE);
	g_return_val_if_fail (to != NULL, FALSE);
	_tmp0_ = g_value_get_string (from);
	g_value_init (&_tmp1_, G_TYPE_BOOLEAN);
	g_value_set_boolean (&_tmp1_, g_strcmp0 (_tmp0_, "") != 0);
	G_IS_VALUE (to) ? (g_value_unset (to), NULL) : NULL;
	*to = _tmp1_;
	result = TRUE;
	return result;
}

static gboolean
___lambda36__gbinding_transform_func (GBinding* binding,
                                      GValue* from_value,
                                      GValue* to_value,
                                      gpointer self)
{
	gboolean result;
	result = __lambda36_ ((ShotwellProfileEditor*) self, binding, from_value, to_value);
	return result;
}

static void
__lambda37_ (ShotwellProfileEditor* self)
{
	GtkFileChooserNative* dialog = NULL;
	GtkFileChooserNative* _tmp0_;
	GtkFileChooserNative* _tmp1_;
	const gchar* _tmp2_;
	gint _result_ = 0;
	GtkFileChooserNative* _tmp3_;
	GtkFileChooserNative* _tmp4_;
	GtkFileChooserNative* _tmp10_;
	_tmp0_ = gtk_file_chooser_native_new (_ ("Choose Library Folder"), G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, _ ("_OK"), _ ("_Cancel"));
	dialog = _tmp0_;
	_tmp1_ = dialog;
	_tmp2_ = self->priv->_library_folder;
	gtk_file_chooser_set_current_folder (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_file_chooser_get_type (), GtkFileChooser), _tmp2_);
	_tmp3_ = dialog;
	_result_ = gtk_native_dialog_run (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_native_dialog_get_type (), GtkNativeDialog));
	_tmp4_ = dialog;
	gtk_native_dialog_hide (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_native_dialog_get_type (), GtkNativeDialog));
	if (_result_ == ((gint) GTK_RESPONSE_ACCEPT)) {
		GtkFileChooserNative* _tmp5_;
		GFile* _tmp6_;
		GFile* _tmp7_;
		gchar* _tmp8_;
		gchar* _tmp9_;
		_tmp5_ = dialog;
		_tmp6_ = gtk_file_chooser_get_current_folder_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, gtk_file_chooser_get_type (), GtkFileChooser));
		_tmp7_ = _tmp6_;
		_tmp8_ = g_file_get_path (_tmp7_);
		_tmp9_ = _tmp8_;
		shotwell_profile_editor_set_library_folder (self, _tmp9_);
		_g_free0 (_tmp9_);
		_g_object_unref0 (_tmp7_);
	}
	_tmp10_ = dialog;
	gtk_native_dialog_destroy (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, gtk_native_dialog_get_type (), GtkNativeDialog));
	_g_object_unref0 (dialog);
}

static void
___lambda37__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
	__lambda37_ ((ShotwellProfileEditor*) self);
}

static gboolean
__lambda38_ (ShotwellProfileEditor* self,
             GBinding* binding,
             GValue* from,
             GValue* to)
{
	const gchar* _tmp0_;
	GValue _tmp1_ = {0};
	gboolean result;
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (binding, G_TYPE_BINDING), FALSE);
	g_return_val_if_fail (from != NULL, FALSE);
	g_return_val_if_fail (to != NULL, FALSE);
	_tmp0_ = g_value_get_string (from);
	g_value_init (&_tmp1_, G_TYPE_BOOLEAN);
	g_value_set_boolean (&_tmp1_, g_strcmp0 (_tmp0_, "") != 0);
	G_IS_VALUE (to) ? (g_value_unset (to), NULL) : NULL;
	*to = _tmp1_;
	result = TRUE;
	return result;
}

static gboolean
___lambda38__gbinding_transform_func (GBinding* binding,
                                      GValue* from_value,
                                      GValue* to_value,
                                      gpointer self)
{
	gboolean result;
	result = __lambda38_ ((ShotwellProfileEditor*) self, binding, from_value, to_value);
	return result;
}

static void
__lambda39_ (ShotwellProfileEditor* self)
{
	GtkFileChooserNative* dialog = NULL;
	GtkFileChooserNative* _tmp0_;
	GtkFileChooserNative* _tmp1_;
	const gchar* _tmp2_;
	gint _result_ = 0;
	GtkFileChooserNative* _tmp3_;
	GtkFileChooserNative* _tmp4_;
	GtkFileChooserNative* _tmp10_;
	_tmp0_ = gtk_file_chooser_native_new (_ ("Choose Data Folder"), G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, _ ("_OK"), _ ("_Cancel"));
	dialog = _tmp0_;
	_tmp1_ = dialog;
	_tmp2_ = self->priv->_data_folder;
	gtk_file_chooser_set_current_folder (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_file_chooser_get_type (), GtkFileChooser), _tmp2_);
	_tmp3_ = dialog;
	_result_ = gtk_native_dialog_run (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_native_dialog_get_type (), GtkNativeDialog));
	_tmp4_ = dialog;
	gtk_native_dialog_hide (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_native_dialog_get_type (), GtkNativeDialog));
	if (_result_ == ((gint) GTK_RESPONSE_ACCEPT)) {
		GtkFileChooserNative* _tmp5_;
		GFile* _tmp6_;
		GFile* _tmp7_;
		gchar* _tmp8_;
		gchar* _tmp9_;
		_tmp5_ = dialog;
		_tmp6_ = gtk_file_chooser_get_current_folder_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, gtk_file_chooser_get_type (), GtkFileChooser));
		_tmp7_ = _tmp6_;
		_tmp8_ = g_file_get_path (_tmp7_);
		_tmp9_ = _tmp8_;
		shotwell_profile_editor_set_data_folder (self, _tmp9_);
		_g_free0 (_tmp9_);
		_g_object_unref0 (_tmp7_);
	}
	_tmp10_ = dialog;
	gtk_native_dialog_destroy (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, gtk_native_dialog_get_type (), GtkNativeDialog));
	_g_object_unref0 (dialog);
}

static void
___lambda39__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
	__lambda39_ ((ShotwellProfileEditor*) self);
}

static void
shotwell_profile_editor_real_constructed (GObject* base)
{
	ShotwellProfileEditor * self;
	GtkWidget* create_button = NULL;
	GtkWidget* _tmp0_;
	GtkWidget* _tmp1_;
	GtkStyleContext* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	const gchar* _tmp7_;
	GtkGrid* grid = NULL;
	GtkGrid* _tmp8_;
	GtkLabel* label = NULL;
	GtkLabel* _tmp9_;
	GtkLabel* _tmp10_;
	GtkStyleContext* _tmp11_;
	GtkLabel* _tmp12_;
	GtkLabel* _tmp13_;
	GtkEntry* entry = NULL;
	GtkEntry* _tmp14_;
	GtkEntry* _tmp15_;
	GtkEntry* _tmp16_;
	GtkEntry* _tmp17_;
	GtkEntry* _tmp18_;
	GtkLabel* _tmp19_;
	GtkLabel* _tmp20_;
	GtkStyleContext* _tmp21_;
	GtkLabel* _tmp22_;
	GtkLabel* _tmp23_;
	GtkEntry* _tmp24_;
	GtkEntry* _tmp25_;
	GtkEntry* _tmp26_;
	GtkEntry* _tmp27_;
	GtkEntry* _tmp28_;
	GtkButton* button = NULL;
	GtkButton* _tmp29_;
	GtkButton* _tmp30_;
	GtkButton* _tmp31_;
	GtkButton* _tmp32_;
	GtkButton* _tmp33_;
	GtkButton* _tmp34_;
	GtkLabel* _tmp35_;
	GtkLabel* _tmp36_;
	GtkStyleContext* _tmp37_;
	GtkLabel* _tmp38_;
	GtkLabel* _tmp39_;
	GtkEntry* _tmp40_;
	GtkEntry* _tmp41_;
	const gchar* _tmp42_;
	GtkEntry* _tmp43_;
	GtkEntry* _tmp44_;
	GtkEntry* _tmp45_;
	GtkEntry* _tmp46_;
	GtkButton* _tmp47_;
	GtkButton* _tmp48_;
	GtkButton* _tmp49_;
	GtkButton* _tmp50_;
	GtkButton* _tmp51_;
	GtkButton* _tmp52_;
	GtkBox* _tmp53_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, SHOTWELL_TYPE_PROFILE_EDITOR, ShotwellProfileEditor);
	G_OBJECT_CLASS (shotwell_profile_editor_parent_class)->constructed (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_dialog_get_type (), GtkDialog), G_TYPE_OBJECT, GObject));
	gtk_widget_set_size_request (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), 640, -1);
	gtk_dialog_add_buttons (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_dialog_get_type (), GtkDialog), _ ("Create"), GTK_RESPONSE_OK, _ ("Cancel"), GTK_RESPONSE_CANCEL, NULL, NULL);
	_tmp0_ = gtk_dialog_get_widget_for_response (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_dialog_get_type (), GtkDialog), (gint) GTK_RESPONSE_OK);
	_tmp1_ = _g_object_ref0 (_tmp0_);
	create_button = _tmp1_;
	_tmp2_ = gtk_widget_get_style_context (create_button);
	gtk_style_context_add_class (_tmp2_, "suggested-action");
	gtk_widget_set_sensitive (create_button, FALSE);
	gtk_window_set_title (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), _ ("Create new Profile"));
	_tmp3_ = g_get_user_data_dir ();
	_tmp4_ = self->priv->_id;
	_tmp5_ = g_build_filename (_tmp3_, "shotwell", "profiles", _tmp4_, NULL);
	_tmp6_ = _tmp5_;
	shotwell_profile_editor_set_data_folder (self, _tmp6_);
	_g_free0 (_tmp6_);
	_tmp7_ = g_get_user_special_dir (G_USER_DIRECTORY_PICTURES);
	shotwell_profile_editor_set_library_folder (self, _tmp7_);
	_tmp8_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp8_);
	grid = _tmp8_;
	gtk_widget_set_hexpand (G_TYPE_CHECK_INSTANCE_CAST (grid, gtk_widget_get_type (), GtkWidget), TRUE);
	gtk_widget_set_vexpand (G_TYPE_CHECK_INSTANCE_CAST (grid, gtk_widget_get_type (), GtkWidget), TRUE);
	g_object_set (G_TYPE_CHECK_INSTANCE_CAST (grid, gtk_widget_get_type (), GtkWidget), "margin", 6, NULL);
	gtk_grid_set_row_spacing (grid, (guint) 12);
	gtk_grid_set_column_spacing (grid, (guint) 12);
	_tmp9_ = (GtkLabel*) gtk_label_new (_ ("Name"));
	g_object_ref_sink (_tmp9_);
	label = _tmp9_;
	_tmp10_ = label;
	_tmp11_ = gtk_widget_get_style_context (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, gtk_widget_get_type (), GtkWidget));
	gtk_style_context_add_class (_tmp11_, "dim-label");
	_tmp12_ = label;
	gtk_widget_set_halign (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_END);
	_tmp13_ = label;
	gtk_grid_attach (grid, G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, gtk_widget_get_type (), GtkWidget), 0, 0, 1, 1);
	_tmp14_ = (GtkEntry*) gtk_entry_new ();
	g_object_ref_sink (_tmp14_);
	entry = _tmp14_;
	_tmp15_ = entry;
	gtk_widget_set_hexpand (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, gtk_widget_get_type (), GtkWidget), TRUE);
	_tmp16_ = entry;
	g_object_bind_property_with_closures (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, G_TYPE_OBJECT, GObject), "text", G_TYPE_CHECK_INSTANCE_CAST (self, G_TYPE_OBJECT, GObject), "profile-name", G_BINDING_DEFAULT, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp17_ = entry;
	g_object_bind_property_with_closures (G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, G_TYPE_OBJECT, GObject), "text", G_TYPE_CHECK_INSTANCE_CAST (create_button, G_TYPE_OBJECT, GObject), "sensitive", G_BINDING_DEFAULT, (GClosure*) ((___lambda35__gbinding_transform_func == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda35__gbinding_transform_func, g_object_ref (self), (GClosureNotify) g_object_unref)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp18_ = entry;
	gtk_grid_attach (grid, G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, gtk_widget_get_type (), GtkWidget), 1, 0, 2, 1);
	_tmp19_ = (GtkLabel*) gtk_label_new (_ ("Library Folder"));
	g_object_ref_sink (_tmp19_);
	_g_object_unref0 (label);
	label = _tmp19_;
	_tmp20_ = label;
	_tmp21_ = gtk_widget_get_style_context (G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, gtk_widget_get_type (), GtkWidget));
	gtk_style_context_add_class (_tmp21_, "dim-label");
	_tmp22_ = label;
	gtk_widget_set_halign (G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_END);
	_tmp23_ = label;
	gtk_grid_attach (grid, G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, gtk_widget_get_type (), GtkWidget), 0, 1, 1, 1);
	_tmp24_ = (GtkEntry*) gtk_entry_new ();
	g_object_ref_sink (_tmp24_);
	_g_object_unref0 (entry);
	entry = _tmp24_;
	_tmp25_ = entry;
	gtk_widget_set_hexpand (G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, gtk_widget_get_type (), GtkWidget), TRUE);
	_tmp26_ = entry;
	gtk_grid_attach (grid, G_TYPE_CHECK_INSTANCE_CAST (_tmp26_, gtk_widget_get_type (), GtkWidget), 1, 1, 1, 1);
	_tmp27_ = entry;
	g_object_bind_property_with_closures (G_TYPE_CHECK_INSTANCE_CAST (self, G_TYPE_OBJECT, GObject), "library-folder", G_TYPE_CHECK_INSTANCE_CAST (_tmp27_, G_TYPE_OBJECT, GObject), "text", G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp28_ = entry;
	g_object_bind_property_with_closures (G_TYPE_CHECK_INSTANCE_CAST (_tmp28_, G_TYPE_OBJECT, GObject), "text", G_TYPE_CHECK_INSTANCE_CAST (create_button, G_TYPE_OBJECT, GObject), "sensitive", G_BINDING_DEFAULT, (GClosure*) ((___lambda36__gbinding_transform_func == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda36__gbinding_transform_func, g_object_ref (self), (GClosureNotify) g_object_unref)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp29_ = (GtkButton*) gtk_button_new_from_icon_name ("folder-symbolic", (GtkIconSize) GTK_ICON_SIZE_BUTTON);
	g_object_ref_sink (_tmp29_);
	button = _tmp29_;
	_tmp30_ = button;
	gtk_widget_set_hexpand (G_TYPE_CHECK_INSTANCE_CAST (_tmp30_, gtk_widget_get_type (), GtkWidget), FALSE);
	_tmp31_ = button;
	gtk_widget_set_vexpand (G_TYPE_CHECK_INSTANCE_CAST (_tmp31_, gtk_widget_get_type (), GtkWidget), FALSE);
	_tmp32_ = button;
	gtk_widget_set_halign (G_TYPE_CHECK_INSTANCE_CAST (_tmp32_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_FILL);
	_tmp33_ = button;
	g_signal_connect_object (_tmp33_, "clicked", (GCallback) ___lambda37__gtk_button_clicked, self, 0);
	_tmp34_ = button;
	gtk_grid_attach (grid, G_TYPE_CHECK_INSTANCE_CAST (_tmp34_, gtk_widget_get_type (), GtkWidget), 2, 1, 1, 1);
	_tmp35_ = (GtkLabel*) gtk_label_new (_ ("Data Folder"));
	g_object_ref_sink (_tmp35_);
	_g_object_unref0 (label);
	label = _tmp35_;
	_tmp36_ = label;
	_tmp37_ = gtk_widget_get_style_context (G_TYPE_CHECK_INSTANCE_CAST (_tmp36_, gtk_widget_get_type (), GtkWidget));
	gtk_style_context_add_class (_tmp37_, "dim-label");
	_tmp38_ = label;
	gtk_widget_set_halign (G_TYPE_CHECK_INSTANCE_CAST (_tmp38_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_END);
	_tmp39_ = label;
	gtk_grid_attach (grid, G_TYPE_CHECK_INSTANCE_CAST (_tmp39_, gtk_widget_get_type (), GtkWidget), 0, 2, 1, 1);
	_tmp40_ = (GtkEntry*) gtk_entry_new ();
	g_object_ref_sink (_tmp40_);
	_g_object_unref0 (entry);
	entry = _tmp40_;
	_tmp41_ = entry;
	_tmp42_ = g_get_user_special_dir (G_USER_DIRECTORY_PICTURES);
	gtk_entry_set_text (_tmp41_, _tmp42_);
	_tmp43_ = entry;
	gtk_widget_set_hexpand (G_TYPE_CHECK_INSTANCE_CAST (_tmp43_, gtk_widget_get_type (), GtkWidget), TRUE);
	_tmp44_ = entry;
	g_object_bind_property_with_closures (G_TYPE_CHECK_INSTANCE_CAST (self, G_TYPE_OBJECT, GObject), "data-folder", G_TYPE_CHECK_INSTANCE_CAST (_tmp44_, G_TYPE_OBJECT, GObject), "text", G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp45_ = entry;
	g_object_bind_property_with_closures (G_TYPE_CHECK_INSTANCE_CAST (_tmp45_, G_TYPE_OBJECT, GObject), "text", G_TYPE_CHECK_INSTANCE_CAST (create_button, G_TYPE_OBJECT, GObject), "sensitive", G_BINDING_DEFAULT, (GClosure*) ((___lambda38__gbinding_transform_func == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda38__gbinding_transform_func, g_object_ref (self), (GClosureNotify) g_object_unref)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp46_ = entry;
	gtk_grid_attach (grid, G_TYPE_CHECK_INSTANCE_CAST (_tmp46_, gtk_widget_get_type (), GtkWidget), 1, 2, 1, 1);
	_tmp47_ = (GtkButton*) gtk_button_new_from_icon_name ("folder-symbolic", (GtkIconSize) GTK_ICON_SIZE_BUTTON);
	g_object_ref_sink (_tmp47_);
	_g_object_unref0 (button);
	button = _tmp47_;
	_tmp48_ = button;
	gtk_widget_set_hexpand (G_TYPE_CHECK_INSTANCE_CAST (_tmp48_, gtk_widget_get_type (), GtkWidget), FALSE);
	_tmp49_ = button;
	gtk_widget_set_vexpand (G_TYPE_CHECK_INSTANCE_CAST (_tmp49_, gtk_widget_get_type (), GtkWidget), FALSE);
	_tmp50_ = button;
	gtk_widget_set_halign (G_TYPE_CHECK_INSTANCE_CAST (_tmp50_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_FILL);
	_tmp51_ = button;
	g_signal_connect_object (_tmp51_, "clicked", (GCallback) ___lambda39__gtk_button_clicked, self, 0);
	_tmp52_ = button;
	gtk_grid_attach (grid, G_TYPE_CHECK_INSTANCE_CAST (_tmp52_, gtk_widget_get_type (), GtkWidget), 2, 2, 1, 1);
	_tmp53_ = gtk_dialog_get_content_area (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_dialog_get_type (), GtkDialog));
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp53_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (grid, gtk_widget_get_type (), GtkWidget));
	gtk_widget_show_all (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
	_g_object_unref0 (button);
	_g_object_unref0 (entry);
	_g_object_unref0 (label);
	_g_object_unref0 (grid);
	_g_object_unref0 (create_button);
}

const gchar*
shotwell_profile_editor_get_profile_name (ShotwellProfileEditor* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (SHOTWELL_IS_PROFILE_EDITOR (self), NULL);
	_tmp0_ = self->priv->_profile_name;
	result = _tmp0_;
	return result;
}

void
shotwell_profile_editor_set_profile_name (ShotwellProfileEditor* self,
                                          const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (SHOTWELL_IS_PROFILE_EDITOR (self));
	old_value = shotwell_profile_editor_get_profile_name (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_profile_name);
		self->priv->_profile_name = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, shotwell_profile_editor_properties[SHOTWELL_PROFILE_EDITOR_PROFILE_NAME_PROPERTY]);
	}
}

const gchar*
shotwell_profile_editor_get_id (ShotwellProfileEditor* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (SHOTWELL_IS_PROFILE_EDITOR (self), NULL);
	_tmp0_ = self->priv->_id;
	result = _tmp0_;
	return result;
}

const gchar*
shotwell_profile_editor_get_library_folder (ShotwellProfileEditor* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (SHOTWELL_IS_PROFILE_EDITOR (self), NULL);
	_tmp0_ = self->priv->_library_folder;
	result = _tmp0_;
	return result;
}

void
shotwell_profile_editor_set_library_folder (ShotwellProfileEditor* self,
                                            const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (SHOTWELL_IS_PROFILE_EDITOR (self));
	old_value = shotwell_profile_editor_get_library_folder (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_library_folder);
		self->priv->_library_folder = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, shotwell_profile_editor_properties[SHOTWELL_PROFILE_EDITOR_LIBRARY_FOLDER_PROPERTY]);
	}
}

const gchar*
shotwell_profile_editor_get_data_folder (ShotwellProfileEditor* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (SHOTWELL_IS_PROFILE_EDITOR (self), NULL);
	_tmp0_ = self->priv->_data_folder;
	result = _tmp0_;
	return result;
}

void
shotwell_profile_editor_set_data_folder (ShotwellProfileEditor* self,
                                         const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (SHOTWELL_IS_PROFILE_EDITOR (self));
	old_value = shotwell_profile_editor_get_data_folder (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_data_folder);
		self->priv->_data_folder = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, shotwell_profile_editor_properties[SHOTWELL_PROFILE_EDITOR_DATA_FOLDER_PROPERTY]);
	}
}

static void
shotwell_profile_editor_class_init (ShotwellProfileEditorClass * klass,
                                    gpointer klass_data)
{
	shotwell_profile_editor_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ShotwellProfileEditor_private_offset);
	((GObjectClass *) klass)->constructed = (void (*) (GObject*)) shotwell_profile_editor_real_constructed;
	G_OBJECT_CLASS (klass)->get_property = _vala_shotwell_profile_editor_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_shotwell_profile_editor_set_property;
	G_OBJECT_CLASS (klass)->finalize = shotwell_profile_editor_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), SHOTWELL_PROFILE_EDITOR_PROFILE_NAME_PROPERTY, shotwell_profile_editor_properties[SHOTWELL_PROFILE_EDITOR_PROFILE_NAME_PROPERTY] = g_param_spec_string ("profile-name", "profile-name", "profile-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SHOTWELL_PROFILE_EDITOR_ID_PROPERTY, shotwell_profile_editor_properties[SHOTWELL_PROFILE_EDITOR_ID_PROPERTY] = g_param_spec_string ("id", "id", "id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SHOTWELL_PROFILE_EDITOR_LIBRARY_FOLDER_PROPERTY, shotwell_profile_editor_properties[SHOTWELL_PROFILE_EDITOR_LIBRARY_FOLDER_PROPERTY] = g_param_spec_string ("library-folder", "library-folder", "library-folder", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SHOTWELL_PROFILE_EDITOR_DATA_FOLDER_PROPERTY, shotwell_profile_editor_properties[SHOTWELL_PROFILE_EDITOR_DATA_FOLDER_PROPERTY] = g_param_spec_string ("data-folder", "data-folder", "data-folder", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
shotwell_profile_editor_instance_init (ShotwellProfileEditor * self,
                                       gpointer klass)
{
	gchar* _tmp0_;
	self->priv = shotwell_profile_editor_get_instance_private (self);
	_tmp0_ = g_uuid_string_random ();
	self->priv->_id = _tmp0_;
}

static void
shotwell_profile_editor_finalize (GObject * obj)
{
	ShotwellProfileEditor * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SHOTWELL_TYPE_PROFILE_EDITOR, ShotwellProfileEditor);
	_g_free0 (self->priv->_profile_name);
	_g_free0 (self->priv->_id);
	_g_free0 (self->priv->_library_folder);
	_g_free0 (self->priv->_data_folder);
	G_OBJECT_CLASS (shotwell_profile_editor_parent_class)->finalize (obj);
}

static GType
shotwell_profile_editor_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ShotwellProfileEditorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) shotwell_profile_editor_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ShotwellProfileEditor), 0, (GInstanceInitFunc) shotwell_profile_editor_instance_init, NULL };
	GType shotwell_profile_editor_type_id;
	shotwell_profile_editor_type_id = g_type_register_static (gtk_dialog_get_type (), "ShotwellProfileEditor", &g_define_type_info, 0);
	ShotwellProfileEditor_private_offset = g_type_add_instance_private (shotwell_profile_editor_type_id, sizeof (ShotwellProfileEditorPrivate));
	return shotwell_profile_editor_type_id;
}

GType
shotwell_profile_editor_get_type (void)
{
	static volatile gsize shotwell_profile_editor_type_id__once = 0;
	if (g_once_init_enter (&shotwell_profile_editor_type_id__once)) {
		GType shotwell_profile_editor_type_id;
		shotwell_profile_editor_type_id = shotwell_profile_editor_get_type_once ();
		g_once_init_leave (&shotwell_profile_editor_type_id__once, shotwell_profile_editor_type_id);
	}
	return shotwell_profile_editor_type_id__once;
}

static void
_vala_shotwell_profile_editor_get_property (GObject * object,
                                            guint property_id,
                                            GValue * value,
                                            GParamSpec * pspec)
{
	ShotwellProfileEditor * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SHOTWELL_TYPE_PROFILE_EDITOR, ShotwellProfileEditor);
	switch (property_id) {
		case SHOTWELL_PROFILE_EDITOR_PROFILE_NAME_PROPERTY:
		g_value_set_string (value, shotwell_profile_editor_get_profile_name (self));
		break;
		case SHOTWELL_PROFILE_EDITOR_ID_PROPERTY:
		g_value_set_string (value, shotwell_profile_editor_get_id (self));
		break;
		case SHOTWELL_PROFILE_EDITOR_LIBRARY_FOLDER_PROPERTY:
		g_value_set_string (value, shotwell_profile_editor_get_library_folder (self));
		break;
		case SHOTWELL_PROFILE_EDITOR_DATA_FOLDER_PROPERTY:
		g_value_set_string (value, shotwell_profile_editor_get_data_folder (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_shotwell_profile_editor_set_property (GObject * object,
                                            guint property_id,
                                            const GValue * value,
                                            GParamSpec * pspec)
{
	ShotwellProfileEditor * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SHOTWELL_TYPE_PROFILE_EDITOR, ShotwellProfileEditor);
	switch (property_id) {
		case SHOTWELL_PROFILE_EDITOR_PROFILE_NAME_PROPERTY:
		shotwell_profile_editor_set_profile_name (self, g_value_get_string (value));
		break;
		case SHOTWELL_PROFILE_EDITOR_LIBRARY_FOLDER_PROPERTY:
		shotwell_profile_editor_set_library_folder (self, g_value_get_string (value));
		break;
		case SHOTWELL_PROFILE_EDITOR_DATA_FOLDER_PROPERTY:
		shotwell_profile_editor_set_data_folder (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
shotwell_profile_row_get_instance_private (ShotwellProfileRow* self)
{
	return G_STRUCT_MEMBER_P (self, ShotwellProfileRow_private_offset);
}

ShotwellProfileRow*
shotwell_profile_row_construct (GType object_type,
                                ShotwellProfile* profile)
{
	ShotwellProfileRow * self = NULL;
	g_return_val_if_fail (SHOTWELL_IS_PROFILE (profile), NULL);
	self = (ShotwellProfileRow*) g_object_new (object_type, "orientation", GTK_ORIENTATION_VERTICAL, "profile", profile, "margin-top", 6, "margin-bottom", 6, "margin-start", 6, "margin-end", 6, NULL);
	return self;
}

ShotwellProfileRow*
shotwell_profile_row_new (ShotwellProfile* profile)
{
	return shotwell_profile_row_construct (SHOTWELL_TYPE_PROFILE_ROW, profile);
}

static void
___lambda33_ (ShotwellProfileRow* self)
{
	GtkDialogFlags flags = 0U;
	GtkMessageDialog* d = NULL;
	GtkWidget* _tmp0_;
	GtkMessageDialog* _tmp1_;
	gchar* title = NULL;
	ShotwellProfile* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* subtitle = NULL;
	gchar* _tmp6_;
	GtkMessageDialog* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	GtkMessageDialog* _tmp12_;
	GtkMessageDialog* _tmp13_;
	GtkWidget* _tmp14_;
	GtkStyleContext* _tmp15_;
	gint response = 0;
	GtkMessageDialog* _tmp16_;
	GtkMessageDialog* _tmp17_;
	gboolean _tmp18_ = FALSE;
	flags = GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL;
	if (resources_use_header_bar () == 1) {
		flags |= GTK_DIALOG_USE_HEADER_BAR;
	}
	_tmp0_ = gtk_widget_get_toplevel (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
	_tmp1_ = (GtkMessageDialog*) gtk_message_dialog_new (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_window_get_type (), GtkWindow), flags, GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, NULL);
	g_object_ref_sink (_tmp1_);
	d = _tmp1_;
	_tmp2_ = self->priv->_profile;
	_tmp3_ = shotwell_profile_get_name (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = g_strdup_printf (_ ("Remove profile “%s”"), _tmp4_);
	title = _tmp5_;
	_tmp6_ = g_strdup (_ ("None of the options will remove any of the images associated with this" \
" profile"));
	subtitle = _tmp6_;
	_tmp7_ = d;
	_tmp8_ = title;
	_tmp9_ = subtitle;
	_tmp10_ = g_strdup_printf (_ ("<b><span size=\"larger\">%s</span></b>\n" \
"<span weight=\"light\">%s</span>"), _tmp8_, _tmp9_);
	_tmp11_ = _tmp10_;
	gtk_message_dialog_set_markup (_tmp7_, _tmp11_);
	_g_free0 (_tmp11_);
	_tmp12_ = d;
	gtk_dialog_add_buttons (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, gtk_dialog_get_type (), GtkDialog), _ ("Remove profile and files"), GTK_RESPONSE_OK, _ ("Remove profile only"), GTK_RESPONSE_ACCEPT, _ ("Cancel"), GTK_RESPONSE_CANCEL, NULL);
	_tmp13_ = d;
	_tmp14_ = gtk_dialog_get_widget_for_response (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, gtk_dialog_get_type (), GtkDialog), (gint) GTK_RESPONSE_OK);
	_tmp15_ = gtk_widget_get_style_context (_tmp14_);
	gtk_style_context_add_class (_tmp15_, "destructive-action");
	_tmp16_ = d;
	response = gtk_dialog_run (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, gtk_dialog_get_type (), GtkDialog));
	_tmp17_ = d;
	gtk_widget_destroy (G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, gtk_widget_get_type (), GtkWidget));
	if (response == ((gint) GTK_RESPONSE_OK)) {
		_tmp18_ = TRUE;
	} else {
		_tmp18_ = response == ((gint) GTK_RESPONSE_ACCEPT);
	}
	if (_tmp18_) {
		ShotwellProfileManager* _tmp19_;
		ShotwellProfileManager* _tmp20_;
		ShotwellProfile* _tmp21_;
		const gchar* _tmp22_;
		const gchar* _tmp23_;
		_tmp19_ = shotwell_profile_manager_get_instance ();
		_tmp20_ = _tmp19_;
		_tmp21_ = self->priv->_profile;
		_tmp22_ = shotwell_profile_get_id (_tmp21_);
		_tmp23_ = _tmp22_;
		shotwell_profile_manager_remove (_tmp20_, _tmp23_, response == ((gint) GTK_RESPONSE_OK));
		_g_object_unref0 (_tmp20_);
	}
	_g_free0 (subtitle);
	_g_free0 (title);
	_g_object_unref0 (d);
}

static void
____lambda33__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	___lambda33_ ((ShotwellProfileRow*) self);
}

static void
shotwell_profile_row_real_constructed (GObject* base)
{
	ShotwellProfileRow * self;
	GtkBox* content = NULL;
	GtkBox* _tmp0_;
	GtkBox* _tmp1_;
	GtkRevealer* revealer = NULL;
	GtkRevealer* _tmp2_;
	GtkRevealer* _tmp3_;
	GtkRevealer* _tmp4_;
	GtkLabel* label = NULL;
	GtkLabel* _tmp5_;
	GtkLabel* _tmp6_;
	ShotwellProfile* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	GtkLabel* _tmp14_;
	GtkBox* _tmp15_;
	GtkLabel* _tmp16_;
	GtkImage* image = NULL;
	ShotwellProfile* _tmp17_;
	gboolean _tmp18_;
	gboolean _tmp19_;
	GtkBox* _tmp23_;
	GtkImage* _tmp24_;
	GtkToggleButton* button = NULL;
	GtkToggleButton* _tmp25_;
	GtkToggleButton* _tmp26_;
	GtkStyleContext* _tmp27_;
	GtkBox* _tmp28_;
	GtkToggleButton* _tmp29_;
	GtkToggleButton* _tmp30_;
	GtkRevealer* _tmp31_;
	GtkImage* _tmp32_;
	GtkToggleButton* _tmp33_;
	GtkImage* _tmp34_;
	gchar* settings_path = NULL;
	ShotwellProfile* _tmp35_;
	const gchar* _tmp36_;
	const gchar* _tmp37_;
	GSettings* settings = NULL;
	const gchar* _tmp45_;
	GSettings* _tmp46_;
	gchar* import_dir = NULL;
	GSettings* _tmp47_;
	gchar* _tmp48_;
	const gchar* _tmp49_;
	GtkGrid* grid = NULL;
	GtkGrid* _tmp52_;
	GtkGrid* _tmp53_;
	GtkStyleContext* _tmp54_;
	GtkGrid* _tmp55_;
	GtkGrid* _tmp56_;
	GtkRevealer* _tmp57_;
	GtkGrid* _tmp58_;
	GtkLabel* _tmp59_;
	GtkLabel* _tmp60_;
	GtkStyleContext* _tmp61_;
	GtkLabel* _tmp62_;
	GtkLabel* _tmp63_;
	GtkGrid* _tmp64_;
	GtkLabel* _tmp65_;
	const gchar* _tmp66_;
	GtkLabel* _tmp67_;
	GtkLabel* _tmp68_;
	GtkLabel* _tmp69_;
	GtkLabel* _tmp70_;
	const gchar* _tmp71_;
	GtkLabel* _tmp72_;
	GtkGrid* _tmp73_;
	GtkLabel* _tmp74_;
	GtkLabel* _tmp75_;
	GtkLabel* _tmp76_;
	GtkStyleContext* _tmp77_;
	GtkLabel* _tmp78_;
	GtkLabel* _tmp79_;
	GtkGrid* _tmp80_;
	GtkLabel* _tmp81_;
	ShotwellProfile* _tmp82_;
	const gchar* _tmp83_;
	const gchar* _tmp84_;
	GtkLabel* _tmp85_;
	GtkLabel* _tmp86_;
	GtkLabel* _tmp87_;
	GtkLabel* _tmp88_;
	GtkLabel* _tmp89_;
	ShotwellProfile* _tmp90_;
	const gchar* _tmp91_;
	const gchar* _tmp92_;
	GtkLabel* _tmp93_;
	GtkGrid* _tmp94_;
	GtkLabel* _tmp95_;
	gboolean _tmp96_ = FALSE;
	ShotwellProfile* _tmp97_;
	const gchar* _tmp98_;
	const gchar* _tmp99_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, SHOTWELL_TYPE_PROFILE_ROW, ShotwellProfileRow);
	G_OBJECT_CLASS (shotwell_profile_row_parent_class)->constructed (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_box_get_type (), GtkBox), G_TYPE_OBJECT, GObject));
	_tmp0_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
	g_object_ref_sink (_tmp0_);
	content = _tmp0_;
	_tmp1_ = content;
	gtk_box_pack_start (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_box_get_type (), GtkBox), G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_widget_get_type (), GtkWidget), TRUE, TRUE, (guint) 0);
	_tmp2_ = (GtkRevealer*) gtk_revealer_new ();
	g_object_ref_sink (_tmp2_);
	revealer = _tmp2_;
	_tmp3_ = revealer;
	gtk_widget_set_margin_top (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_widget_get_type (), GtkWidget), 6);
	_tmp4_ = revealer;
	gtk_box_pack_end (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_box_get_type (), GtkBox), G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_widget_get_type (), GtkWidget), TRUE, TRUE, (guint) 0);
	_tmp5_ = (GtkLabel*) gtk_label_new (NULL);
	g_object_ref_sink (_tmp5_);
	label = _tmp5_;
	_tmp6_ = label;
	_tmp7_ = self->priv->_profile;
	_tmp8_ = shotwell_profile_get_name (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = g_markup_escape_text (_tmp9_, (gssize) -1);
	_tmp11_ = _tmp10_;
	_tmp12_ = g_strdup_printf ("<span weight=\"bold\">%s</span>", _tmp11_);
	_tmp13_ = _tmp12_;
	gtk_label_set_markup (_tmp6_, _tmp13_);
	_g_free0 (_tmp13_);
	_g_free0 (_tmp11_);
	_tmp14_ = label;
	gtk_widget_set_halign (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_START);
	_tmp15_ = content;
	_tmp16_ = label;
	gtk_box_pack_start (_tmp15_, G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, gtk_widget_get_type (), GtkWidget), TRUE, TRUE, (guint) 6);
	_tmp17_ = self->priv->_profile;
	_tmp18_ = shotwell_profile_get_active (_tmp17_);
	_tmp19_ = _tmp18_;
	if (_tmp19_) {
		GtkImage* _tmp20_;
		GtkImage* _tmp21_;
		_tmp20_ = (GtkImage*) gtk_image_new_from_icon_name ("emblem-default-symbolic", (GtkIconSize) GTK_ICON_SIZE_SMALL_TOOLBAR);
		g_object_ref_sink (_tmp20_);
		_g_object_unref0 (image);
		image = _tmp20_;
		_tmp21_ = image;
		gtk_widget_set_tooltip_text (G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, gtk_widget_get_type (), GtkWidget), _ ("This is the currently active profile"));
	} else {
		GtkImage* _tmp22_;
		_tmp22_ = (GtkImage*) gtk_image_new ();
		g_object_ref_sink (_tmp22_);
		_g_object_unref0 (image);
		image = _tmp22_;
	}
	_tmp23_ = content;
	_tmp24_ = image;
	gtk_box_pack_start (_tmp23_, G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, gtk_widget_get_type (), GtkWidget), FALSE, FALSE, (guint) 6);
	_tmp25_ = (GtkToggleButton*) gtk_toggle_button_new ();
	g_object_ref_sink (_tmp25_);
	button = _tmp25_;
	_tmp26_ = button;
	_tmp27_ = gtk_widget_get_style_context (G_TYPE_CHECK_INSTANCE_CAST (_tmp26_, gtk_widget_get_type (), GtkWidget));
	gtk_style_context_add_class (_tmp27_, "flat");
	_tmp28_ = content;
	_tmp29_ = button;
	gtk_box_pack_start (_tmp28_, G_TYPE_CHECK_INSTANCE_CAST (_tmp29_, gtk_widget_get_type (), GtkWidget), FALSE, FALSE, (guint) 6);
	_tmp30_ = button;
	_tmp31_ = revealer;
	g_object_bind_property_with_closures (G_TYPE_CHECK_INSTANCE_CAST (_tmp30_, G_TYPE_OBJECT, GObject), "active", G_TYPE_CHECK_INSTANCE_CAST (_tmp31_, G_TYPE_OBJECT, GObject), "reveal-child", G_BINDING_DEFAULT, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp32_ = (GtkImage*) gtk_image_new_from_icon_name ("go-down-symbolic", (GtkIconSize) GTK_ICON_SIZE_SMALL_TOOLBAR);
	g_object_ref_sink (_tmp32_);
	_g_object_unref0 (image);
	image = _tmp32_;
	_tmp33_ = button;
	_tmp34_ = image;
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp33_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp34_, gtk_widget_get_type (), GtkWidget));
	_tmp35_ = self->priv->_profile;
	_tmp36_ = shotwell_profile_get_id (_tmp35_);
	_tmp37_ = _tmp36_;
	if (g_strcmp0 (_tmp37_, SHOTWELL_PROFILE_SYSTEM) == 0) {
		gchar* _tmp38_;
		_tmp38_ = g_strdup ("/org/gnome/shotwell/preferences/files/");
		_g_free0 (settings_path);
		settings_path = _tmp38_;
	} else {
		ShotwellProfile* _tmp39_;
		const gchar* _tmp40_;
		const gchar* _tmp41_;
		gchar* _tmp42_;
		gchar* _tmp43_;
		gchar* _tmp44_;
		_tmp39_ = self->priv->_profile;
		_tmp40_ = shotwell_profile_get_id (_tmp39_);
		_tmp41_ = _tmp40_;
		_tmp42_ = g_strconcat ("/org/gnome/shotwell/profiles/", _tmp41_, NULL);
		_tmp43_ = _tmp42_;
		_tmp44_ = g_strconcat (_tmp43_, "/preferences/files/", NULL);
		_g_free0 (settings_path);
		settings_path = _tmp44_;
		_g_free0 (_tmp43_);
	}
	_tmp45_ = settings_path;
	_tmp46_ = g_settings_new_with_path ("org.gnome.shotwell.preferences.files", _tmp45_);
	settings = _tmp46_;
	_tmp47_ = settings;
	_tmp48_ = g_settings_get_string (_tmp47_, "import-dir");
	import_dir = _tmp48_;
	_tmp49_ = import_dir;
	if (g_strcmp0 (_tmp49_, "") == 0) {
		const gchar* _tmp50_;
		gchar* _tmp51_;
		_tmp50_ = g_get_user_special_dir (G_USER_DIRECTORY_PICTURES);
		_tmp51_ = g_strdup (_tmp50_);
		_g_free0 (import_dir);
		import_dir = _tmp51_;
	}
	_tmp52_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp52_);
	grid = _tmp52_;
	_tmp53_ = grid;
	_tmp54_ = gtk_widget_get_style_context (G_TYPE_CHECK_INSTANCE_CAST (_tmp53_, gtk_widget_get_type (), GtkWidget));
	gtk_style_context_add_class (_tmp54_, "content");
	_tmp55_ = grid;
	gtk_grid_set_row_spacing (_tmp55_, (guint) 12);
	_tmp56_ = grid;
	gtk_grid_set_column_spacing (_tmp56_, (guint) 6);
	_tmp57_ = revealer;
	_tmp58_ = grid;
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp57_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp58_, gtk_widget_get_type (), GtkWidget));
	_tmp59_ = (GtkLabel*) gtk_label_new (_ ("Library Folder"));
	g_object_ref_sink (_tmp59_);
	_g_object_unref0 (label);
	label = _tmp59_;
	_tmp60_ = label;
	_tmp61_ = gtk_widget_get_style_context (G_TYPE_CHECK_INSTANCE_CAST (_tmp60_, gtk_widget_get_type (), GtkWidget));
	gtk_style_context_add_class (_tmp61_, "dim-label");
	_tmp62_ = label;
	gtk_widget_set_halign (G_TYPE_CHECK_INSTANCE_CAST (_tmp62_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_END);
	_tmp63_ = label;
	gtk_widget_set_margin_start (G_TYPE_CHECK_INSTANCE_CAST (_tmp63_, gtk_widget_get_type (), GtkWidget), 12);
	_tmp64_ = grid;
	_tmp65_ = label;
	gtk_grid_attach (_tmp64_, G_TYPE_CHECK_INSTANCE_CAST (_tmp65_, gtk_widget_get_type (), GtkWidget), 0, 0, 1, 1);
	_tmp66_ = import_dir;
	_tmp67_ = (GtkLabel*) gtk_label_new (_tmp66_);
	g_object_ref_sink (_tmp67_);
	_g_object_unref0 (label);
	label = _tmp67_;
	_tmp68_ = label;
	gtk_widget_set_halign (G_TYPE_CHECK_INSTANCE_CAST (_tmp68_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_START);
	_tmp69_ = label;
	gtk_label_set_ellipsize (_tmp69_, PANGO_ELLIPSIZE_END);
	_tmp70_ = label;
	_tmp71_ = import_dir;
	gtk_widget_set_tooltip_text (G_TYPE_CHECK_INSTANCE_CAST (_tmp70_, gtk_widget_get_type (), GtkWidget), _tmp71_);
	_tmp72_ = label;
	gtk_label_set_selectable (_tmp72_, TRUE);
	_tmp73_ = grid;
	_tmp74_ = label;
	gtk_grid_attach (_tmp73_, G_TYPE_CHECK_INSTANCE_CAST (_tmp74_, gtk_widget_get_type (), GtkWidget), 1, 0, 1, 1);
	_tmp75_ = (GtkLabel*) gtk_label_new (_ ("Data Folder"));
	g_object_ref_sink (_tmp75_);
	_g_object_unref0 (label);
	label = _tmp75_;
	_tmp76_ = label;
	_tmp77_ = gtk_widget_get_style_context (G_TYPE_CHECK_INSTANCE_CAST (_tmp76_, gtk_widget_get_type (), GtkWidget));
	gtk_style_context_add_class (_tmp77_, "dim-label");
	_tmp78_ = label;
	gtk_widget_set_halign (G_TYPE_CHECK_INSTANCE_CAST (_tmp78_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_END);
	_tmp79_ = label;
	gtk_widget_set_margin_start (G_TYPE_CHECK_INSTANCE_CAST (_tmp79_, gtk_widget_get_type (), GtkWidget), 12);
	_tmp80_ = grid;
	_tmp81_ = label;
	gtk_grid_attach (_tmp80_, G_TYPE_CHECK_INSTANCE_CAST (_tmp81_, gtk_widget_get_type (), GtkWidget), 0, 1, 1, 1);
	_tmp82_ = self->priv->_profile;
	_tmp83_ = shotwell_profile_get_data_dir (_tmp82_);
	_tmp84_ = _tmp83_;
	_tmp85_ = (GtkLabel*) gtk_label_new (_tmp84_);
	g_object_ref_sink (_tmp85_);
	_g_object_unref0 (label);
	label = _tmp85_;
	_tmp86_ = label;
	gtk_widget_set_halign (G_TYPE_CHECK_INSTANCE_CAST (_tmp86_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_START);
	_tmp87_ = label;
	gtk_widget_set_hexpand (G_TYPE_CHECK_INSTANCE_CAST (_tmp87_, gtk_widget_get_type (), GtkWidget), TRUE);
	_tmp88_ = label;
	gtk_label_set_ellipsize (_tmp88_, PANGO_ELLIPSIZE_END);
	_tmp89_ = label;
	_tmp90_ = self->priv->_profile;
	_tmp91_ = shotwell_profile_get_data_dir (_tmp90_);
	_tmp92_ = _tmp91_;
	gtk_widget_set_tooltip_text (G_TYPE_CHECK_INSTANCE_CAST (_tmp89_, gtk_widget_get_type (), GtkWidget), _tmp92_);
	_tmp93_ = label;
	gtk_label_set_selectable (_tmp93_, TRUE);
	_tmp94_ = grid;
	_tmp95_ = label;
	gtk_grid_attach (_tmp94_, G_TYPE_CHECK_INSTANCE_CAST (_tmp95_, gtk_widget_get_type (), GtkWidget), 1, 1, 1, 1);
	_tmp97_ = self->priv->_profile;
	_tmp98_ = shotwell_profile_get_id (_tmp97_);
	_tmp99_ = _tmp98_;
	if (g_strcmp0 (_tmp99_, SHOTWELL_PROFILE_SYSTEM) != 0) {
		ShotwellProfile* _tmp100_;
		gboolean _tmp101_;
		gboolean _tmp102_;
		_tmp100_ = self->priv->_profile;
		_tmp101_ = shotwell_profile_get_active (_tmp100_);
		_tmp102_ = _tmp101_;
		_tmp96_ = !_tmp102_;
	} else {
		_tmp96_ = FALSE;
	}
	if (_tmp96_) {
		GtkButton* remove_button = NULL;
		GtkButton* _tmp103_;
		GtkButton* _tmp104_;
		GtkStyleContext* _tmp105_;
		GtkButton* _tmp106_;
		GtkButton* _tmp107_;
		GtkButton* _tmp108_;
		GtkGrid* _tmp109_;
		GtkButton* _tmp110_;
		GtkButton* _tmp111_;
		_tmp103_ = (GtkButton*) gtk_button_new_with_label (_ ("Remove Profile"));
		g_object_ref_sink (_tmp103_);
		remove_button = _tmp103_;
		_tmp104_ = remove_button;
		_tmp105_ = gtk_widget_get_style_context (G_TYPE_CHECK_INSTANCE_CAST (_tmp104_, gtk_widget_get_type (), GtkWidget));
		gtk_style_context_add_class (_tmp105_, "destructive-action");
		_tmp106_ = remove_button;
		gtk_widget_set_tooltip_text (G_TYPE_CHECK_INSTANCE_CAST (_tmp106_, gtk_widget_get_type (), GtkWidget), _ ("Remove this profile"));
		_tmp107_ = remove_button;
		gtk_widget_set_hexpand (G_TYPE_CHECK_INSTANCE_CAST (_tmp107_, gtk_widget_get_type (), GtkWidget), FALSE);
		_tmp108_ = remove_button;
		gtk_widget_set_halign (G_TYPE_CHECK_INSTANCE_CAST (_tmp108_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_END);
		_tmp109_ = grid;
		_tmp110_ = remove_button;
		gtk_grid_attach (_tmp109_, G_TYPE_CHECK_INSTANCE_CAST (_tmp110_, gtk_widget_get_type (), GtkWidget), 1, 2, 1, 1);
		_tmp111_ = remove_button;
		g_signal_connect_object (_tmp111_, "clicked", (GCallback) ____lambda33__gtk_button_clicked, self, 0);
		_g_object_unref0 (remove_button);
	}
	_g_object_unref0 (grid);
	_g_free0 (import_dir);
	_g_object_unref0 (settings);
	_g_free0 (settings_path);
	_g_object_unref0 (button);
	_g_object_unref0 (image);
	_g_object_unref0 (label);
	_g_object_unref0 (revealer);
	_g_object_unref0 (content);
}

ShotwellProfile*
shotwell_profile_row_get_profile (ShotwellProfileRow* self)
{
	ShotwellProfile* result;
	ShotwellProfile* _tmp0_;
	g_return_val_if_fail (SHOTWELL_IS_PROFILE_ROW (self), NULL);
	_tmp0_ = self->priv->_profile;
	result = _tmp0_;
	return result;
}

static void
shotwell_profile_row_set_profile (ShotwellProfileRow* self,
                                  ShotwellProfile* value)
{
	ShotwellProfile* old_value;
	g_return_if_fail (SHOTWELL_IS_PROFILE_ROW (self));
	old_value = shotwell_profile_row_get_profile (self);
	if (old_value != value) {
		ShotwellProfile* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_profile);
		self->priv->_profile = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, shotwell_profile_row_properties[SHOTWELL_PROFILE_ROW_PROFILE_PROPERTY]);
	}
}

static void
shotwell_profile_row_class_init (ShotwellProfileRowClass * klass,
                                 gpointer klass_data)
{
	shotwell_profile_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ShotwellProfileRow_private_offset);
	((GObjectClass *) klass)->constructed = (void (*) (GObject*)) shotwell_profile_row_real_constructed;
	G_OBJECT_CLASS (klass)->get_property = _vala_shotwell_profile_row_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_shotwell_profile_row_set_property;
	G_OBJECT_CLASS (klass)->finalize = shotwell_profile_row_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), SHOTWELL_PROFILE_ROW_PROFILE_PROPERTY, shotwell_profile_row_properties[SHOTWELL_PROFILE_ROW_PROFILE_PROPERTY] = g_param_spec_object ("profile", "profile", "profile", SHOTWELL_TYPE_PROFILE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}

static void
shotwell_profile_row_instance_init (ShotwellProfileRow * self,
                                    gpointer klass)
{
	self->priv = shotwell_profile_row_get_instance_private (self);
}

static void
shotwell_profile_row_finalize (GObject * obj)
{
	ShotwellProfileRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SHOTWELL_TYPE_PROFILE_ROW, ShotwellProfileRow);
	_g_object_unref0 (self->priv->_profile);
	G_OBJECT_CLASS (shotwell_profile_row_parent_class)->finalize (obj);
}

static GType
shotwell_profile_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ShotwellProfileRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) shotwell_profile_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ShotwellProfileRow), 0, (GInstanceInitFunc) shotwell_profile_row_instance_init, NULL };
	GType shotwell_profile_row_type_id;
	shotwell_profile_row_type_id = g_type_register_static (gtk_box_get_type (), "ShotwellProfileRow", &g_define_type_info, 0);
	ShotwellProfileRow_private_offset = g_type_add_instance_private (shotwell_profile_row_type_id, sizeof (ShotwellProfileRowPrivate));
	return shotwell_profile_row_type_id;
}

GType
shotwell_profile_row_get_type (void)
{
	static volatile gsize shotwell_profile_row_type_id__once = 0;
	if (g_once_init_enter (&shotwell_profile_row_type_id__once)) {
		GType shotwell_profile_row_type_id;
		shotwell_profile_row_type_id = shotwell_profile_row_get_type_once ();
		g_once_init_leave (&shotwell_profile_row_type_id__once, shotwell_profile_row_type_id);
	}
	return shotwell_profile_row_type_id__once;
}

static void
_vala_shotwell_profile_row_get_property (GObject * object,
                                         guint property_id,
                                         GValue * value,
                                         GParamSpec * pspec)
{
	ShotwellProfileRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SHOTWELL_TYPE_PROFILE_ROW, ShotwellProfileRow);
	switch (property_id) {
		case SHOTWELL_PROFILE_ROW_PROFILE_PROPERTY:
		g_value_set_object (value, shotwell_profile_row_get_profile (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_shotwell_profile_row_set_property (GObject * object,
                                         guint property_id,
                                         const GValue * value,
                                         GParamSpec * pspec)
{
	ShotwellProfileRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SHOTWELL_TYPE_PROFILE_ROW, ShotwellProfileRow);
	switch (property_id) {
		case SHOTWELL_PROFILE_ROW_PROFILE_PROPERTY:
		shotwell_profile_row_set_profile (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

ShotwellProfileBrowser*
shotwell_profile_browser_construct (GType object_type)
{
	ShotwellProfileBrowser * self = NULL;
	self = (ShotwellProfileBrowser*) g_object_new (object_type, "orientation", GTK_ORIENTATION_VERTICAL, "vexpand", TRUE, "hexpand", TRUE, NULL);
	return self;
}

ShotwellProfileBrowser*
shotwell_profile_browser_new (void)
{
	return shotwell_profile_browser_construct (SHOTWELL_TYPE_PROFILE_BROWSER);
}

static void
__lambda32_ (ShotwellProfileBrowser* self,
             GtkListBox* list_box,
             GtkListBoxRow* row)
{
	gint index = 0;
	ShotwellProfile* profile = NULL;
	ShotwellProfileManager* _tmp0_;
	ShotwellProfileManager* _tmp1_;
	GObject* _tmp2_;
	ShotwellProfile* _tmp3_;
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (list_box, gtk_list_box_get_type ()));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (row, gtk_list_box_row_get_type ()));
	index = gtk_list_box_row_get_index (row);
	_tmp0_ = shotwell_profile_manager_get_instance ();
	_tmp1_ = _tmp0_;
	_tmp2_ = g_list_model_get_item (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, g_list_model_get_type (), GListModel), (guint) index);
	_tmp3_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, SHOTWELL_TYPE_PROFILE, ShotwellProfile);
	_g_object_unref0 (_tmp1_);
	profile = _tmp3_;
	g_signal_emit (self, shotwell_profile_browser_signals[SHOTWELL_PROFILE_BROWSER_PROFILE_ACTIVATED_SIGNAL], 0, profile);
	_g_object_unref0 (profile);
}

static void
___lambda32__gtk_list_box_row_activated (GtkListBox* _sender,
                                         GtkListBoxRow* row,
                                         gpointer self)
{
	__lambda32_ ((ShotwellProfileBrowser*) self, _sender, row);
}

static GtkWidget*
_shotwell_profile_browser_on_widget_create_gtk_list_box_create_widget_func (GObject* item,
                                                                            gpointer self)
{
	GtkWidget* result;
	result = shotwell_profile_browser_on_widget_create ((ShotwellProfileBrowser*) self, item);
	return result;
}

static void
_shotwell_profile_browser_on_header_gtk_list_box_update_header_func (GtkListBoxRow* row,
                                                                     GtkListBoxRow* before,
                                                                     gpointer self)
{
	shotwell_profile_browser_on_header ((ShotwellProfileBrowser*) self, row, before);
}

static void
__lambda34_ (ShotwellProfileBrowser* self)
{
	ShotwellProfileEditor* editor = NULL;
	ShotwellProfileEditor* _tmp0_;
	ShotwellProfileEditor* _tmp1_;
	GtkWidget* _tmp2_;
	gint _result_ = 0;
	ShotwellProfileEditor* _tmp3_;
	ShotwellProfileEditor* _tmp4_;
	ShotwellProfileEditor* _tmp31_;
	_tmp0_ = shotwell_profile_editor_new ();
	g_object_ref_sink (_tmp0_);
	editor = _tmp0_;
	_tmp1_ = editor;
	_tmp2_ = gtk_widget_get_ancestor (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), gtk_window_get_type ());
	gtk_window_set_transient_for (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_window_get_type (), GtkWindow), G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_window_get_type (), GtkWindow));
	_tmp3_ = editor;
	_result_ = gtk_dialog_run (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_dialog_get_type (), GtkDialog));
	_tmp4_ = editor;
	gtk_widget_hide (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_widget_get_type (), GtkWidget));
	if (_result_ == ((gint) GTK_RESPONSE_OK)) {
		ShotwellProfileEditor* _tmp5_;
		const gchar* _tmp6_;
		const gchar* _tmp7_;
		ShotwellProfileEditor* _tmp8_;
		const gchar* _tmp9_;
		const gchar* _tmp10_;
		ShotwellProfileEditor* _tmp11_;
		const gchar* _tmp12_;
		const gchar* _tmp13_;
		ShotwellProfileEditor* _tmp14_;
		const gchar* _tmp15_;
		const gchar* _tmp16_;
		ShotwellProfileManager* _tmp17_;
		ShotwellProfileManager* _tmp18_;
		ShotwellProfileEditor* _tmp19_;
		const gchar* _tmp20_;
		const gchar* _tmp21_;
		ShotwellProfileEditor* _tmp22_;
		const gchar* _tmp23_;
		const gchar* _tmp24_;
		ShotwellProfileEditor* _tmp25_;
		const gchar* _tmp26_;
		const gchar* _tmp27_;
		ShotwellProfileEditor* _tmp28_;
		const gchar* _tmp29_;
		const gchar* _tmp30_;
		_tmp5_ = editor;
		_tmp6_ = shotwell_profile_editor_get_id (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp8_ = editor;
		_tmp9_ = shotwell_profile_editor_get_profile_name (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp11_ = editor;
		_tmp12_ = shotwell_profile_editor_get_library_folder (_tmp11_);
		_tmp13_ = _tmp12_;
		_tmp14_ = editor;
		_tmp15_ = shotwell_profile_editor_get_data_folder (_tmp14_);
		_tmp16_ = _tmp15_;
		g_debug ("ProfileBrowser.vala:267: Request to add new profile: %s %s %s %s", _tmp7_, _tmp10_, _tmp13_, _tmp16_);
		_tmp17_ = shotwell_profile_manager_get_instance ();
		_tmp18_ = _tmp17_;
		_tmp19_ = editor;
		_tmp20_ = shotwell_profile_editor_get_id (_tmp19_);
		_tmp21_ = _tmp20_;
		_tmp22_ = editor;
		_tmp23_ = shotwell_profile_editor_get_profile_name (_tmp22_);
		_tmp24_ = _tmp23_;
		_tmp25_ = editor;
		_tmp26_ = shotwell_profile_editor_get_library_folder (_tmp25_);
		_tmp27_ = _tmp26_;
		_tmp28_ = editor;
		_tmp29_ = shotwell_profile_editor_get_data_folder (_tmp28_);
		_tmp30_ = _tmp29_;
		shotwell_profile_manager_add_profile (_tmp18_, _tmp21_, _tmp24_, _tmp27_, _tmp30_);
		_g_object_unref0 (_tmp18_);
	}
	_tmp31_ = editor;
	gtk_widget_destroy (G_TYPE_CHECK_INSTANCE_CAST (_tmp31_, gtk_widget_get_type (), GtkWidget));
	_g_object_unref0 (editor);
}

static void
___lambda34__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
	__lambda34_ ((ShotwellProfileBrowser*) self);
}

static void
shotwell_profile_browser_real_constructed (GObject* base)
{
	ShotwellProfileBrowser * self;
	GtkScrolledWindow* scrollable = NULL;
	GtkScrolledWindow* _tmp0_;
	GtkListBox* list_box = NULL;
	GtkListBox* _tmp1_;
	GtkStyleContext* _tmp2_;
	ShotwellProfileManager* _tmp3_;
	ShotwellProfileManager* _tmp4_;
	GtkButton* button = NULL;
	GtkButton* _tmp5_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, SHOTWELL_TYPE_PROFILE_BROWSER, ShotwellProfileBrowser);
	_tmp0_ = (GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL);
	g_object_ref_sink (_tmp0_);
	scrollable = _tmp0_;
	gtk_widget_set_hexpand (G_TYPE_CHECK_INSTANCE_CAST (scrollable, gtk_widget_get_type (), GtkWidget), TRUE);
	gtk_widget_set_vexpand (G_TYPE_CHECK_INSTANCE_CAST (scrollable, gtk_widget_get_type (), GtkWidget), TRUE);
	_tmp1_ = (GtkListBox*) gtk_list_box_new ();
	g_object_ref_sink (_tmp1_);
	list_box = _tmp1_;
	gtk_list_box_set_activate_on_single_click (list_box, FALSE);
	g_signal_connect_object (list_box, "row-activated", (GCallback) ___lambda32__gtk_list_box_row_activated, self, 0);
	_tmp2_ = gtk_widget_get_style_context (G_TYPE_CHECK_INSTANCE_CAST (list_box, gtk_widget_get_type (), GtkWidget));
	gtk_style_context_add_class (_tmp2_, "rich-list");
	gtk_widget_set_hexpand (G_TYPE_CHECK_INSTANCE_CAST (list_box, gtk_widget_get_type (), GtkWidget), TRUE);
	gtk_widget_set_vexpand (G_TYPE_CHECK_INSTANCE_CAST (list_box, gtk_widget_get_type (), GtkWidget), TRUE);
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (scrollable, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (list_box, gtk_widget_get_type (), GtkWidget));
	_tmp3_ = shotwell_profile_manager_get_instance ();
	_tmp4_ = _tmp3_;
	gtk_list_box_bind_model (list_box, G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, g_list_model_get_type (), GListModel), _shotwell_profile_browser_on_widget_create_gtk_list_box_create_widget_func, g_object_ref (self), g_object_unref);
	_g_object_unref0 (_tmp4_);
	gtk_list_box_set_header_func (list_box, _shotwell_profile_browser_on_header_gtk_list_box_update_header_func, g_object_ref (self), g_object_unref);
	_tmp5_ = (GtkButton*) gtk_button_new_with_label (_ ("Create new Profile"));
	g_object_ref_sink (_tmp5_);
	button = _tmp5_;
	gtk_box_pack_start (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_box_get_type (), GtkBox), G_TYPE_CHECK_INSTANCE_CAST (button, gtk_widget_get_type (), GtkWidget), FALSE, FALSE, (guint) 6);
	g_signal_connect_object (button, "clicked", (GCallback) ___lambda34__gtk_button_clicked, self, 0);
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (scrollable, gtk_widget_get_type (), GtkWidget));
	gtk_widget_show_all (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
	_g_object_unref0 (button);
	_g_object_unref0 (list_box);
	_g_object_unref0 (scrollable);
}

static GtkWidget*
shotwell_profile_browser_on_widget_create (ShotwellProfileBrowser* self,
                                           GObject* item)
{
	GtkListBoxRow* row = NULL;
	GtkListBoxRow* _tmp0_;
	ShotwellProfileRow* _tmp1_;
	ShotwellProfileRow* _tmp2_;
	GtkWidget* result;
	g_return_val_if_fail (SHOTWELL_IS_PROFILE_BROWSER (self), NULL);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (item, G_TYPE_OBJECT), NULL);
	_tmp0_ = (GtkListBoxRow*) gtk_list_box_row_new ();
	g_object_ref_sink (_tmp0_);
	row = _tmp0_;
	_tmp1_ = shotwell_profile_row_new (G_TYPE_CHECK_INSTANCE_CAST (item, SHOTWELL_TYPE_PROFILE, ShotwellProfile));
	g_object_ref_sink (_tmp1_);
	_tmp2_ = _tmp1_;
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (row, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_widget_get_type (), GtkWidget));
	_g_object_unref0 (_tmp2_);
	gtk_widget_show_all (G_TYPE_CHECK_INSTANCE_CAST (row, gtk_widget_get_type (), GtkWidget));
	result = G_TYPE_CHECK_INSTANCE_CAST (row, gtk_widget_get_type (), GtkWidget);
	return result;
}

static void
shotwell_profile_browser_on_header (ShotwellProfileBrowser* self,
                                    GtkListBoxRow* row,
                                    GtkListBoxRow* before)
{
	gboolean _tmp0_ = FALSE;
	GtkSeparator* separator = NULL;
	GtkSeparator* _tmp2_;
	GtkSeparator* _tmp3_;
	GtkSeparator* _tmp4_;
	g_return_if_fail (SHOTWELL_IS_PROFILE_BROWSER (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (row, gtk_list_box_row_get_type ()));
	g_return_if_fail ((before == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (before, gtk_list_box_row_get_type ()));
	if (before == NULL) {
		_tmp0_ = TRUE;
	} else {
		GtkWidget* _tmp1_;
		_tmp1_ = gtk_list_box_row_get_header (row);
		_tmp0_ = _tmp1_ != NULL;
	}
	if (_tmp0_) {
		return;
	}
	_tmp2_ = (GtkSeparator*) gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
	g_object_ref_sink (_tmp2_);
	separator = _tmp2_;
	_tmp3_ = separator;
	gtk_widget_show (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_widget_get_type (), GtkWidget));
	_tmp4_ = separator;
	gtk_list_box_row_set_header (row, G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_widget_get_type (), GtkWidget));
	_g_object_unref0 (separator);
}

static void
shotwell_profile_browser_class_init (ShotwellProfileBrowserClass * klass,
                                     gpointer klass_data)
{
	shotwell_profile_browser_parent_class = g_type_class_peek_parent (klass);
	((GObjectClass *) klass)->constructed = (void (*) (GObject*)) shotwell_profile_browser_real_constructed;
	shotwell_profile_browser_signals[SHOTWELL_PROFILE_BROWSER_PROFILE_ACTIVATED_SIGNAL] = g_signal_new ("profile-activated", SHOTWELL_TYPE_PROFILE_BROWSER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, SHOTWELL_TYPE_PROFILE);
}

static void
shotwell_profile_browser_instance_init (ShotwellProfileBrowser * self,
                                        gpointer klass)
{
}

static GType
shotwell_profile_browser_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ShotwellProfileBrowserClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) shotwell_profile_browser_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ShotwellProfileBrowser), 0, (GInstanceInitFunc) shotwell_profile_browser_instance_init, NULL };
	GType shotwell_profile_browser_type_id;
	shotwell_profile_browser_type_id = g_type_register_static (gtk_box_get_type (), "ShotwellProfileBrowser", &g_define_type_info, 0);
	return shotwell_profile_browser_type_id;
}

GType
shotwell_profile_browser_get_type (void)
{
	static volatile gsize shotwell_profile_browser_type_id__once = 0;
	if (g_once_init_enter (&shotwell_profile_browser_type_id__once)) {
		GType shotwell_profile_browser_type_id;
		shotwell_profile_browser_type_id = shotwell_profile_browser_get_type_once ();
		g_once_init_leave (&shotwell_profile_browser_type_id__once, shotwell_profile_browser_type_id);
	}
	return shotwell_profile_browser_type_id__once;
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

