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

#include <glib-object.h>
#include <gee.h>
#include "libdino.h"
#include <gtk/gtk.h>
#include <glib.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.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 DINO_UI_VIEW_MODEL_TYPE_PREFERENCES_WINDOW (dino_ui_view_model_preferences_window_get_type ())
#define DINO_UI_VIEW_MODEL_PREFERENCES_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_VIEW_MODEL_TYPE_PREFERENCES_WINDOW, DinoUiViewModelPreferencesWindow))
#define DINO_UI_VIEW_MODEL_PREFERENCES_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_VIEW_MODEL_TYPE_PREFERENCES_WINDOW, DinoUiViewModelPreferencesWindowClass))
#define DINO_UI_VIEW_MODEL_IS_PREFERENCES_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_VIEW_MODEL_TYPE_PREFERENCES_WINDOW))
#define DINO_UI_VIEW_MODEL_IS_PREFERENCES_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_VIEW_MODEL_TYPE_PREFERENCES_WINDOW))
#define DINO_UI_VIEW_MODEL_PREFERENCES_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_VIEW_MODEL_TYPE_PREFERENCES_WINDOW, DinoUiViewModelPreferencesWindowClass))

typedef struct _DinoUiViewModelPreferencesWindow DinoUiViewModelPreferencesWindow;
typedef struct _DinoUiViewModelPreferencesWindowClass DinoUiViewModelPreferencesWindowClass;
typedef struct _DinoUiViewModelPreferencesWindowPrivate DinoUiViewModelPreferencesWindowPrivate;

#define DINO_UI_VIEW_MODEL_TYPE_ACCOUNT_DETAILS (dino_ui_view_model_account_details_get_type ())
#define DINO_UI_VIEW_MODEL_ACCOUNT_DETAILS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_VIEW_MODEL_TYPE_ACCOUNT_DETAILS, DinoUiViewModelAccountDetails))
#define DINO_UI_VIEW_MODEL_ACCOUNT_DETAILS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_VIEW_MODEL_TYPE_ACCOUNT_DETAILS, DinoUiViewModelAccountDetailsClass))
#define DINO_UI_VIEW_MODEL_IS_ACCOUNT_DETAILS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_VIEW_MODEL_TYPE_ACCOUNT_DETAILS))
#define DINO_UI_VIEW_MODEL_IS_ACCOUNT_DETAILS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_VIEW_MODEL_TYPE_ACCOUNT_DETAILS))
#define DINO_UI_VIEW_MODEL_ACCOUNT_DETAILS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_VIEW_MODEL_TYPE_ACCOUNT_DETAILS, DinoUiViewModelAccountDetailsClass))

typedef struct _DinoUiViewModelAccountDetails DinoUiViewModelAccountDetails;
typedef struct _DinoUiViewModelAccountDetailsClass DinoUiViewModelAccountDetailsClass;

#define DINO_UI_VIEW_MODEL_TYPE_GENERAL_PREFERENCES_PAGE (dino_ui_view_model_general_preferences_page_get_type ())
#define DINO_UI_VIEW_MODEL_GENERAL_PREFERENCES_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_VIEW_MODEL_TYPE_GENERAL_PREFERENCES_PAGE, DinoUiViewModelGeneralPreferencesPage))
#define DINO_UI_VIEW_MODEL_GENERAL_PREFERENCES_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_VIEW_MODEL_TYPE_GENERAL_PREFERENCES_PAGE, DinoUiViewModelGeneralPreferencesPageClass))
#define DINO_UI_VIEW_MODEL_IS_GENERAL_PREFERENCES_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_VIEW_MODEL_TYPE_GENERAL_PREFERENCES_PAGE))
#define DINO_UI_VIEW_MODEL_IS_GENERAL_PREFERENCES_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_VIEW_MODEL_TYPE_GENERAL_PREFERENCES_PAGE))
#define DINO_UI_VIEW_MODEL_GENERAL_PREFERENCES_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_VIEW_MODEL_TYPE_GENERAL_PREFERENCES_PAGE, DinoUiViewModelGeneralPreferencesPageClass))

typedef struct _DinoUiViewModelGeneralPreferencesPage DinoUiViewModelGeneralPreferencesPage;
typedef struct _DinoUiViewModelGeneralPreferencesPageClass DinoUiViewModelGeneralPreferencesPageClass;
enum  {
	DINO_UI_VIEW_MODEL_PREFERENCES_WINDOW_0_PROPERTY,
	DINO_UI_VIEW_MODEL_PREFERENCES_WINDOW_SELECTED_ACCOUNT_PROPERTY,
	DINO_UI_VIEW_MODEL_PREFERENCES_WINDOW_ACTIVE_ACCOUNTS_SELECTION_PROPERTY,
	DINO_UI_VIEW_MODEL_PREFERENCES_WINDOW_GENERAL_PAGE_PROPERTY,
	DINO_UI_VIEW_MODEL_PREFERENCES_WINDOW_NUM_PROPERTIES
};
static GParamSpec* dino_ui_view_model_preferences_window_properties[DINO_UI_VIEW_MODEL_PREFERENCES_WINDOW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _qlite_database_unref0(var) ((var == NULL) ? NULL : (var = (qlite_database_unref (var), NULL)))
typedef struct _Block75Data Block75Data;
#define _dino_connection_manager_connection_error_unref0(var) ((var == NULL) ? NULL : (var = (dino_connection_manager_connection_error_unref (var), NULL)))
typedef struct _Block76Data Block76Data;
typedef struct _Block77Data Block77Data;

#define DINO_UI_VIEW_MODEL_TYPE_CHANGE_PASSWORD_DIALOG (dino_ui_view_model_change_password_dialog_get_type ())
#define DINO_UI_VIEW_MODEL_CHANGE_PASSWORD_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_VIEW_MODEL_TYPE_CHANGE_PASSWORD_DIALOG, DinoUiViewModelChangePasswordDialog))
#define DINO_UI_VIEW_MODEL_CHANGE_PASSWORD_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_VIEW_MODEL_TYPE_CHANGE_PASSWORD_DIALOG, DinoUiViewModelChangePasswordDialogClass))
#define DINO_UI_VIEW_MODEL_IS_CHANGE_PASSWORD_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_VIEW_MODEL_TYPE_CHANGE_PASSWORD_DIALOG))
#define DINO_UI_VIEW_MODEL_IS_CHANGE_PASSWORD_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_VIEW_MODEL_TYPE_CHANGE_PASSWORD_DIALOG))
#define DINO_UI_VIEW_MODEL_CHANGE_PASSWORD_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_VIEW_MODEL_TYPE_CHANGE_PASSWORD_DIALOG, DinoUiViewModelChangePasswordDialogClass))

typedef struct _DinoUiViewModelChangePasswordDialog DinoUiViewModelChangePasswordDialog;
typedef struct _DinoUiViewModelChangePasswordDialogClass DinoUiViewModelChangePasswordDialogClass;
enum  {
	DINO_UI_VIEW_MODEL_PREFERENCES_WINDOW_UPDATE_SIGNAL,
	DINO_UI_VIEW_MODEL_PREFERENCES_WINDOW_NUM_SIGNALS
};
static guint dino_ui_view_model_preferences_window_signals[DINO_UI_VIEW_MODEL_PREFERENCES_WINDOW_NUM_SIGNALS] = {0};
typedef struct _DinoUiViewModelChangePasswordDialogPrivate DinoUiViewModelChangePasswordDialogPrivate;
enum  {
	DINO_UI_VIEW_MODEL_CHANGE_PASSWORD_DIALOG_0_PROPERTY,
	DINO_UI_VIEW_MODEL_CHANGE_PASSWORD_DIALOG_ACCOUNT_PROPERTY,
	DINO_UI_VIEW_MODEL_CHANGE_PASSWORD_DIALOG_STREAM_INTERACTOR_PROPERTY,
	DINO_UI_VIEW_MODEL_CHANGE_PASSWORD_DIALOG_NUM_PROPERTIES
};
static GParamSpec* dino_ui_view_model_change_password_dialog_properties[DINO_UI_VIEW_MODEL_CHANGE_PASSWORD_DIALOG_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _DinoUiViewModelChangePasswordDialogChangePasswordData DinoUiViewModelChangePasswordDialogChangePasswordData;

struct _DinoUiViewModelPreferencesWindow {
	GObject parent_instance;
	DinoUiViewModelPreferencesWindowPrivate * priv;
	GeeHashMap* account_details;
	DinoStreamInteractor* stream_interactor;
	DinoDatabase* db;
};

struct _DinoUiViewModelPreferencesWindowClass {
	GObjectClass parent_class;
};

struct _DinoUiViewModelPreferencesWindowPrivate {
	DinoUiViewModelAccountDetails* _selected_account;
	GtkSingleSelection* _active_accounts_selection;
	DinoUiViewModelGeneralPreferencesPage* _general_page;
};

struct _Block75Data {
	int _ref_count_;
	DinoUiViewModelPreferencesWindow* self;
	DinoStreamInteractor* stream_interactor;
};

struct _Block76Data {
	int _ref_count_;
	DinoUiViewModelPreferencesWindow* self;
	DinoEntitiesAccount* account;
};

struct _Block77Data {
	int _ref_count_;
	DinoUiViewModelPreferencesWindow* self;
	DinoEntitiesAccount* account;
};

struct _DinoUiViewModelChangePasswordDialog {
	GObject parent_instance;
	DinoUiViewModelChangePasswordDialogPrivate * priv;
};

struct _DinoUiViewModelChangePasswordDialogClass {
	GObjectClass parent_class;
};

struct _DinoUiViewModelChangePasswordDialogPrivate {
	DinoEntitiesAccount* _account;
	DinoStreamInteractor* _stream_interactor;
};

struct _DinoUiViewModelChangePasswordDialogChangePasswordData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoUiViewModelChangePasswordDialog* self;
	gchar* new_password;
	gchar* result;
	gchar* res;
	DinoStreamInteractor* _tmp0_;
	DinoModuleIdentity* _tmp1_;
	gpointer _tmp2_;
	DinoRegister* _tmp3_;
	DinoEntitiesAccount* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	const gchar* _tmp7_;
	DinoEntitiesAccount* _tmp8_;
};

static gint DinoUiViewModelPreferencesWindow_private_offset;
static gpointer dino_ui_view_model_preferences_window_parent_class = NULL;
static gint DinoUiViewModelChangePasswordDialog_private_offset;
static gpointer dino_ui_view_model_change_password_dialog_parent_class = NULL;

VALA_EXTERN GType dino_ui_view_model_preferences_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiViewModelPreferencesWindow, g_object_unref)
VALA_EXTERN GType dino_ui_view_model_account_details_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiViewModelAccountDetails, g_object_unref)
VALA_EXTERN GType dino_ui_view_model_general_preferences_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiViewModelGeneralPreferencesPage, g_object_unref)
static guint _dino_entities_account_hash_func_gee_hash_data_func (gconstpointer v,
                                                           gpointer self);
static gboolean _dino_entities_account_equals_func_gee_equal_data_func (gconstpointer a,
                                                                 gconstpointer b,
                                                                 gpointer self);
VALA_EXTERN DinoUiViewModelGeneralPreferencesPage* dino_ui_view_model_general_preferences_page_new (void);
VALA_EXTERN DinoUiViewModelGeneralPreferencesPage* dino_ui_view_model_general_preferences_page_construct (GType object_type);
VALA_EXTERN void dino_ui_view_model_preferences_window_populate (DinoUiViewModelPreferencesWindow* self,
                                                     DinoDatabase* db,
                                                     DinoStreamInteractor* stream_interactor);
static Block75Data* block75_data_ref (Block75Data* _data75_);
static void block75_data_unref (void * _userdata_);
static void __lambda251_ (DinoUiViewModelPreferencesWindow* self,
                   DinoEntitiesAccount* account,
                   DinoConnectionManagerConnectionError* _error_);
VALA_EXTERN void dino_ui_view_model_account_details_set_connection_error (DinoUiViewModelAccountDetails* self,
                                                              DinoConnectionManagerConnectionError* value);
static void ___lambda251__dino_connection_manager_connection_error (DinoConnectionManager* _sender,
                                                             DinoEntitiesAccount* account,
                                                             DinoConnectionManagerConnectionError* _error_,
                                                             gpointer self);
static void __lambda252_ (Block75Data* _data75_,
                   DinoEntitiesAccount* account,
                   DinoConnectionManagerConnectionState state);
VALA_EXTERN void dino_ui_view_model_account_details_set_connection_state (DinoUiViewModelAccountDetails* self,
                                                              DinoConnectionManagerConnectionState value);
static void ___lambda252__dino_connection_manager_connection_state_changed (DinoConnectionManager* _sender,
                                                                     DinoEntitiesAccount* account,
                                                                     DinoConnectionManagerConnectionState state,
                                                                     gpointer self);
static void dino_ui_view_model_preferences_window_update_data (DinoUiViewModelPreferencesWindow* self);
static void _dino_ui_view_model_preferences_window_update_data_dino_stream_interactor_account_added (DinoStreamInteractor* _sender,
                                                                                              DinoEntitiesAccount* account,
                                                                                              gpointer self);
static void _dino_ui_view_model_preferences_window_update_data_dino_stream_interactor_account_removed (DinoStreamInteractor* _sender,
                                                                                                DinoEntitiesAccount* account,
                                                                                                gpointer self);
static void dino_ui_view_model_preferences_window_bind_general_page (DinoUiViewModelPreferencesWindow* self);
VALA_EXTERN DinoUiViewModelAccountDetails* dino_ui_view_model_account_details_new (DinoEntitiesAccount* account,
                                                                       DinoStreamInteractor* stream_interactor);
VALA_EXTERN DinoUiViewModelAccountDetails* dino_ui_view_model_account_details_construct (GType object_type,
                                                                             DinoEntitiesAccount* account,
                                                                             DinoStreamInteractor* stream_interactor);
VALA_EXTERN DinoUiViewModelAccountDetails* dino_ui_view_model_preferences_window_get_selected_account (DinoUiViewModelPreferencesWindow* self);
VALA_EXTERN void dino_ui_view_model_preferences_window_set_selected_account (DinoUiViewModelPreferencesWindow* self,
                                                                 DinoUiViewModelAccountDetails* value);
VALA_EXTERN GtkSingleSelection* dino_ui_view_model_preferences_window_get_active_accounts_selection (DinoUiViewModelPreferencesWindow* self);
VALA_EXTERN void dino_ui_view_model_preferences_window_set_avatar_uri (DinoUiViewModelPreferencesWindow* self,
                                                           DinoEntitiesAccount* account,
                                                           const gchar* uri);
VALA_EXTERN void dino_ui_view_model_preferences_window_remove_avatar (DinoUiViewModelPreferencesWindow* self,
                                                          DinoEntitiesAccount* account);
VALA_EXTERN void dino_ui_view_model_preferences_window_remove_account (DinoUiViewModelPreferencesWindow* self,
                                                           DinoEntitiesAccount* account);
static Block76Data* block76_data_ref (Block76Data* _data76_);
static void block76_data_unref (void * _userdata_);
static void __lambda253_ (Block76Data* _data76_);
static void ___lambda253__gasync_ready_callback (GObject* source_object,
                                          GAsyncResult* res,
                                          gpointer self);
VALA_EXTERN void dino_ui_view_model_preferences_window_reconnect_account (DinoUiViewModelPreferencesWindow* self,
                                                              DinoEntitiesAccount* account);
static Block77Data* block77_data_ref (Block77Data* _data77_);
static void block77_data_unref (void * _userdata_);
static void __lambda254_ (Block77Data* _data77_);
static void ___lambda254__gasync_ready_callback (GObject* source_object,
                                          GAsyncResult* res,
                                          gpointer self);
VALA_EXTERN void dino_ui_view_model_preferences_window_enable_disable_account (DinoUiViewModelPreferencesWindow* self,
                                                                   DinoEntitiesAccount* account);
VALA_EXTERN GType dino_ui_view_model_change_password_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiViewModelChangePasswordDialog, g_object_unref)
VALA_EXTERN DinoUiViewModelChangePasswordDialog* dino_ui_view_model_preferences_window_get_change_password_dialog_model (DinoUiViewModelPreferencesWindow* self);
VALA_EXTERN DinoEntitiesAccount* dino_ui_view_model_account_details_get_account (DinoUiViewModelAccountDetails* self);
VALA_EXTERN DinoUiViewModelChangePasswordDialog* dino_ui_view_model_change_password_dialog_new (void);
VALA_EXTERN DinoUiViewModelChangePasswordDialog* dino_ui_view_model_change_password_dialog_construct (GType object_type);
VALA_EXTERN void dino_ui_view_model_change_password_dialog_set_account (DinoUiViewModelChangePasswordDialog* self,
                                                            DinoEntitiesAccount* value);
VALA_EXTERN void dino_ui_view_model_change_password_dialog_set_stream_interactor (DinoUiViewModelChangePasswordDialog* self,
                                                                      DinoStreamInteractor* value);
VALA_EXTERN DinoUiViewModelGeneralPreferencesPage* dino_ui_view_model_preferences_window_get_general_page (DinoUiViewModelPreferencesWindow* self);
VALA_EXTERN DinoUiViewModelPreferencesWindow* dino_ui_view_model_preferences_window_new (void);
VALA_EXTERN DinoUiViewModelPreferencesWindow* dino_ui_view_model_preferences_window_construct (GType object_type);
VALA_EXTERN void dino_ui_view_model_preferences_window_set_general_page (DinoUiViewModelPreferencesWindow* self,
                                                             DinoUiViewModelGeneralPreferencesPage* value);
static void dino_ui_view_model_preferences_window_finalize (GObject * obj);
static GType dino_ui_view_model_preferences_window_get_type_once (void);
static void _vala_dino_ui_view_model_preferences_window_get_property (GObject * object,
                                                               guint property_id,
                                                               GValue * value,
                                                               GParamSpec * pspec);
static void _vala_dino_ui_view_model_preferences_window_set_property (GObject * object,
                                                               guint property_id,
                                                               const GValue * value,
                                                               GParamSpec * pspec);
static void dino_ui_view_model_change_password_dialog_change_password_data_free (gpointer _data);
VALA_EXTERN void dino_ui_view_model_change_password_dialog_change_password (DinoUiViewModelChangePasswordDialog* self,
                                                                const gchar* new_password,
                                                                GAsyncReadyCallback _callback_,
                                                                gpointer _user_data_);
VALA_EXTERN gchar* dino_ui_view_model_change_password_dialog_change_password_finish (DinoUiViewModelChangePasswordDialog* self,
                                                                         GAsyncResult* _res_);
static gboolean dino_ui_view_model_change_password_dialog_change_password_co (DinoUiViewModelChangePasswordDialogChangePasswordData* _data_);
VALA_EXTERN DinoStreamInteractor* dino_ui_view_model_change_password_dialog_get_stream_interactor (DinoUiViewModelChangePasswordDialog* self);
VALA_EXTERN DinoEntitiesAccount* dino_ui_view_model_change_password_dialog_get_account (DinoUiViewModelChangePasswordDialog* self);
static void dino_ui_view_model_change_password_dialog_change_password_ready (GObject* source_object,
                                                                      GAsyncResult* _res_,
                                                                      gpointer _user_data_);
static void dino_ui_view_model_change_password_dialog_finalize (GObject * obj);
static GType dino_ui_view_model_change_password_dialog_get_type_once (void);
static void _vala_dino_ui_view_model_change_password_dialog_get_property (GObject * object,
                                                                   guint property_id,
                                                                   GValue * value,
                                                                   GParamSpec * pspec);
static void _vala_dino_ui_view_model_change_password_dialog_set_property (GObject * object,
                                                                   guint property_id,
                                                                   const GValue * value,
                                                                   GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
dino_ui_view_model_preferences_window_get_instance_private (DinoUiViewModelPreferencesWindow* self)
{
	return G_STRUCT_MEMBER_P (self, DinoUiViewModelPreferencesWindow_private_offset);
}

static guint
_dino_entities_account_hash_func_gee_hash_data_func (gconstpointer v,
                                                     gpointer self)
{
	guint result;
	result = dino_entities_account_hash_func ((DinoEntitiesAccount*) v);
	return result;
}

static gboolean
_dino_entities_account_equals_func_gee_equal_data_func (gconstpointer a,
                                                        gconstpointer b,
                                                        gpointer self)
{
	gboolean result;
	result = dino_entities_account_equals_func ((DinoEntitiesAccount*) a, (DinoEntitiesAccount*) b);
	return result;
}

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

static Block75Data*
block75_data_ref (Block75Data* _data75_)
{
	g_atomic_int_inc (&_data75_->_ref_count_);
	return _data75_;
}

static void
block75_data_unref (void * _userdata_)
{
	Block75Data* _data75_;
	_data75_ = (Block75Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data75_->_ref_count_)) {
		DinoUiViewModelPreferencesWindow* self;
		self = _data75_->self;
		_g_object_unref0 (_data75_->stream_interactor);
		_g_object_unref0 (self);
		g_slice_free (Block75Data, _data75_);
	}
}

static gpointer
_qlite_database_ref0 (gpointer self)
{
	return self ? qlite_database_ref (self) : NULL;
}

static void
__lambda251_ (DinoUiViewModelPreferencesWindow* self,
              DinoEntitiesAccount* account,
              DinoConnectionManagerConnectionError* _error_)
{
	DinoUiViewModelAccountDetails* account_detail = NULL;
	GeeHashMap* _tmp0_;
	gpointer _tmp1_;
	GeeHashMap* _tmp2_;
	g_return_if_fail (account != NULL);
	g_return_if_fail (_error_ != NULL);
	_tmp0_ = self->account_details;
	_tmp1_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp0_, account);
	account_detail = (DinoUiViewModelAccountDetails*) _tmp1_;
	_tmp2_ = self->account_details;
	if (_tmp2_ != NULL) {
		DinoUiViewModelAccountDetails* _tmp3_;
		_tmp3_ = account_detail;
		dino_ui_view_model_account_details_set_connection_error (_tmp3_, _error_);
	}
	_g_object_unref0 (account_detail);
}

static void
___lambda251__dino_connection_manager_connection_error (DinoConnectionManager* _sender,
                                                        DinoEntitiesAccount* account,
                                                        DinoConnectionManagerConnectionError* _error_,
                                                        gpointer self)
{
	__lambda251_ ((DinoUiViewModelPreferencesWindow*) self, account, _error_);
}

static void
__lambda252_ (Block75Data* _data75_,
              DinoEntitiesAccount* account,
              DinoConnectionManagerConnectionState state)
{
	DinoUiViewModelPreferencesWindow* self;
	DinoUiViewModelAccountDetails* account_detail = NULL;
	GeeHashMap* _tmp0_;
	gpointer _tmp1_;
	GeeHashMap* _tmp2_;
	self = _data75_->self;
	g_return_if_fail (account != NULL);
	_tmp0_ = self->account_details;
	_tmp1_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp0_, account);
	account_detail = (DinoUiViewModelAccountDetails*) _tmp1_;
	_tmp2_ = self->account_details;
	if (_tmp2_ != NULL) {
		DinoUiViewModelAccountDetails* _tmp3_;
		DinoUiViewModelAccountDetails* _tmp4_;
		DinoConnectionManager* _tmp5_;
		DinoConnectionManagerConnectionError* _tmp6_;
		DinoConnectionManagerConnectionError* _tmp7_;
		_tmp3_ = account_detail;
		dino_ui_view_model_account_details_set_connection_state (_tmp3_, state);
		_tmp4_ = account_detail;
		_tmp5_ = _data75_->stream_interactor->connection_manager;
		_tmp6_ = dino_connection_manager_get_error (_tmp5_, account);
		_tmp7_ = _tmp6_;
		dino_ui_view_model_account_details_set_connection_error (_tmp4_, _tmp7_);
		_dino_connection_manager_connection_error_unref0 (_tmp7_);
	}
	_g_object_unref0 (account_detail);
}

static void
___lambda252__dino_connection_manager_connection_state_changed (DinoConnectionManager* _sender,
                                                                DinoEntitiesAccount* account,
                                                                DinoConnectionManagerConnectionState state,
                                                                gpointer self)
{
	__lambda252_ (self, account, state);
}

static void
_dino_ui_view_model_preferences_window_update_data_dino_stream_interactor_account_added (DinoStreamInteractor* _sender,
                                                                                         DinoEntitiesAccount* account,
                                                                                         gpointer self)
{
	dino_ui_view_model_preferences_window_update_data ((DinoUiViewModelPreferencesWindow*) self);
}

static void
_dino_ui_view_model_preferences_window_update_data_dino_stream_interactor_account_removed (DinoStreamInteractor* _sender,
                                                                                           DinoEntitiesAccount* account,
                                                                                           gpointer self)
{
	dino_ui_view_model_preferences_window_update_data ((DinoUiViewModelPreferencesWindow*) self);
}

void
dino_ui_view_model_preferences_window_populate (DinoUiViewModelPreferencesWindow* self,
                                                DinoDatabase* db,
                                                DinoStreamInteractor* stream_interactor)
{
	Block75Data* _data75_;
	DinoStreamInteractor* _tmp0_;
	DinoDatabase* _tmp1_;
	DinoStreamInteractor* _tmp2_;
	DinoConnectionManager* _tmp3_;
	DinoConnectionManager* _tmp4_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (db != NULL);
	g_return_if_fail (stream_interactor != NULL);
	_data75_ = g_slice_new0 (Block75Data);
	_data75_->_ref_count_ = 1;
	_data75_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (stream_interactor);
	_g_object_unref0 (_data75_->stream_interactor);
	_data75_->stream_interactor = _tmp0_;
	_tmp1_ = _qlite_database_ref0 (db);
	_qlite_database_unref0 (self->db);
	self->db = _tmp1_;
	_tmp2_ = _g_object_ref0 (_data75_->stream_interactor);
	_g_object_unref0 (self->stream_interactor);
	self->stream_interactor = _tmp2_;
	_tmp3_ = _data75_->stream_interactor->connection_manager;
	g_signal_connect_object (_tmp3_, "connection-error", (GCallback) ___lambda251__dino_connection_manager_connection_error, self, 0);
	_tmp4_ = _data75_->stream_interactor->connection_manager;
	g_signal_connect_data (_tmp4_, "connection-state-changed", (GCallback) ___lambda252__dino_connection_manager_connection_state_changed, block75_data_ref (_data75_), (GClosureNotify) block75_data_unref, 0);
	g_signal_connect_object (_data75_->stream_interactor, "account-added", (GCallback) _dino_ui_view_model_preferences_window_update_data_dino_stream_interactor_account_added, self, 0);
	g_signal_connect_object (_data75_->stream_interactor, "account-removed", (GCallback) _dino_ui_view_model_preferences_window_update_data_dino_stream_interactor_account_removed, self, 0);
	dino_ui_view_model_preferences_window_bind_general_page (self);
	dino_ui_view_model_preferences_window_update_data (self);
	block75_data_unref (_data75_);
	_data75_ = NULL;
}

static void
dino_ui_view_model_preferences_window_update_data (DinoUiViewModelPreferencesWindow* self)
{
	GeeArrayList* current_accounts = NULL;
	DinoDatabase* _tmp0_;
	GeeArrayList* _tmp1_;
	GeeArrayList* remove_accounts = NULL;
	GeeArrayList* _tmp2_;
	GListStore* list_model = NULL;
	GtkSingleSelection* _tmp51_;
	GListModel* _tmp52_;
	GListModel* _tmp53_;
	GListStore* _tmp54_;
	GListStore* _tmp55_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->db;
	_tmp1_ = dino_database_get_accounts (_tmp0_);
	current_accounts = _tmp1_;
	_tmp2_ = gee_array_list_new (DINO_ENTITIES_TYPE_ACCOUNT, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	remove_accounts = _tmp2_;
	{
		GeeIterator* _account_it = NULL;
		GeeHashMap* _tmp3_;
		GeeSet* _tmp4_;
		GeeSet* _tmp5_;
		GeeSet* _tmp6_;
		GeeIterator* _tmp7_;
		GeeIterator* _tmp8_;
		_tmp3_ = self->account_details;
		_tmp4_ = gee_abstract_map_get_keys ((GeeAbstractMap*) _tmp3_);
		_tmp5_ = _tmp4_;
		_tmp6_ = _tmp5_;
		_tmp7_ = gee_iterable_iterator ((GeeIterable*) _tmp6_);
		_tmp8_ = _tmp7_;
		_g_object_unref0 (_tmp6_);
		_account_it = _tmp8_;
		while (TRUE) {
			GeeIterator* _tmp9_;
			DinoEntitiesAccount* account = NULL;
			GeeIterator* _tmp10_;
			gpointer _tmp11_;
			GeeArrayList* _tmp12_;
			DinoEntitiesAccount* _tmp13_;
			_tmp9_ = _account_it;
			if (!gee_iterator_next (_tmp9_)) {
				break;
			}
			_tmp10_ = _account_it;
			_tmp11_ = gee_iterator_get (_tmp10_);
			account = (DinoEntitiesAccount*) _tmp11_;
			_tmp12_ = current_accounts;
			_tmp13_ = account;
			if (!gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp12_, _tmp13_)) {
				GeeArrayList* _tmp14_;
				DinoEntitiesAccount* _tmp15_;
				_tmp14_ = remove_accounts;
				_tmp15_ = account;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp14_, _tmp15_);
			}
			_g_object_unref0 (account);
		}
		_g_object_unref0 (_account_it);
	}
	{
		GeeArrayList* _account_list = NULL;
		GeeArrayList* _tmp16_;
		gint _account_size = 0;
		GeeArrayList* _tmp17_;
		gint _tmp18_;
		gint _tmp19_;
		gint _account_index = 0;
		_tmp16_ = remove_accounts;
		_account_list = _tmp16_;
		_tmp17_ = _account_list;
		_tmp18_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp17_);
		_tmp19_ = _tmp18_;
		_account_size = _tmp19_;
		_account_index = -1;
		while (TRUE) {
			gint _tmp20_;
			gint _tmp21_;
			DinoEntitiesAccount* account = NULL;
			GeeArrayList* _tmp22_;
			gpointer _tmp23_;
			GeeHashMap* _tmp24_;
			DinoEntitiesAccount* _tmp25_;
			_account_index = _account_index + 1;
			_tmp20_ = _account_index;
			_tmp21_ = _account_size;
			if (!(_tmp20_ < _tmp21_)) {
				break;
			}
			_tmp22_ = _account_list;
			_tmp23_ = gee_abstract_list_get ((GeeAbstractList*) _tmp22_, _account_index);
			account = (DinoEntitiesAccount*) _tmp23_;
			_tmp24_ = self->account_details;
			_tmp25_ = account;
			gee_abstract_map_unset ((GeeAbstractMap*) _tmp24_, _tmp25_, NULL);
			_g_object_unref0 (account);
		}
	}
	{
		GeeArrayList* _account_list = NULL;
		GeeArrayList* _tmp26_;
		gint _account_size = 0;
		GeeArrayList* _tmp27_;
		gint _tmp28_;
		gint _tmp29_;
		gint _account_index = 0;
		_tmp26_ = current_accounts;
		_account_list = _tmp26_;
		_tmp27_ = _account_list;
		_tmp28_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp27_);
		_tmp29_ = _tmp28_;
		_account_size = _tmp29_;
		_account_index = -1;
		while (TRUE) {
			gint _tmp30_;
			gint _tmp31_;
			DinoEntitiesAccount* account = NULL;
			GeeArrayList* _tmp32_;
			gpointer _tmp33_;
			GeeHashMap* _tmp34_;
			DinoEntitiesAccount* _tmp35_;
			gboolean _tmp42_ = FALSE;
			DinoUiViewModelAccountDetails* _tmp43_;
			_account_index = _account_index + 1;
			_tmp30_ = _account_index;
			_tmp31_ = _account_size;
			if (!(_tmp30_ < _tmp31_)) {
				break;
			}
			_tmp32_ = _account_list;
			_tmp33_ = gee_abstract_list_get ((GeeAbstractList*) _tmp32_, _account_index);
			account = (DinoEntitiesAccount*) _tmp33_;
			_tmp34_ = self->account_details;
			_tmp35_ = account;
			if (!gee_abstract_map_has_key ((GeeAbstractMap*) _tmp34_, _tmp35_)) {
				GeeHashMap* _tmp36_;
				DinoEntitiesAccount* _tmp37_;
				DinoEntitiesAccount* _tmp38_;
				DinoStreamInteractor* _tmp39_;
				DinoUiViewModelAccountDetails* _tmp40_;
				DinoUiViewModelAccountDetails* _tmp41_;
				_tmp36_ = self->account_details;
				_tmp37_ = account;
				_tmp38_ = account;
				_tmp39_ = self->stream_interactor;
				_tmp40_ = dino_ui_view_model_account_details_new (_tmp38_, _tmp39_);
				_tmp41_ = _tmp40_;
				gee_abstract_map_set ((GeeAbstractMap*) _tmp36_, _tmp37_, _tmp41_);
				_g_object_unref0 (_tmp41_);
			}
			_tmp43_ = self->priv->_selected_account;
			if (_tmp43_ == NULL) {
				DinoEntitiesAccount* _tmp44_;
				gboolean _tmp45_;
				gboolean _tmp46_;
				_tmp44_ = account;
				_tmp45_ = dino_entities_account_get_enabled (_tmp44_);
				_tmp46_ = _tmp45_;
				_tmp42_ = _tmp46_;
			} else {
				_tmp42_ = FALSE;
			}
			if (_tmp42_) {
				GeeHashMap* _tmp47_;
				DinoEntitiesAccount* _tmp48_;
				gpointer _tmp49_;
				DinoUiViewModelAccountDetails* _tmp50_;
				_tmp47_ = self->account_details;
				_tmp48_ = account;
				_tmp49_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp47_, _tmp48_);
				_tmp50_ = (DinoUiViewModelAccountDetails*) _tmp49_;
				dino_ui_view_model_preferences_window_set_selected_account (self, _tmp50_);
				_g_object_unref0 (_tmp50_);
			}
			_g_object_unref0 (account);
		}
	}
	_tmp51_ = self->priv->_active_accounts_selection;
	_tmp52_ = gtk_single_selection_get_model (_tmp51_);
	_tmp53_ = _tmp52_;
	_tmp54_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp53_, g_list_store_get_type (), GListStore));
	list_model = _tmp54_;
	_tmp55_ = list_model;
	g_list_store_remove_all (_tmp55_);
	{
		GeeArrayList* _account_list = NULL;
		DinoStreamInteractor* _tmp56_;
		GeeArrayList* _tmp57_;
		gint _account_size = 0;
		GeeArrayList* _tmp58_;
		gint _tmp59_;
		gint _tmp60_;
		gint _account_index = 0;
		_tmp56_ = self->stream_interactor;
		_tmp57_ = dino_stream_interactor_get_accounts (_tmp56_);
		_account_list = _tmp57_;
		_tmp58_ = _account_list;
		_tmp59_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp58_);
		_tmp60_ = _tmp59_;
		_account_size = _tmp60_;
		_account_index = -1;
		while (TRUE) {
			gint _tmp61_;
			gint _tmp62_;
			DinoEntitiesAccount* account = NULL;
			GeeArrayList* _tmp63_;
			gpointer _tmp64_;
			GListStore* _tmp65_;
			DinoEntitiesAccount* _tmp66_;
			DinoStreamInteractor* _tmp67_;
			DinoUiViewModelAccountDetails* _tmp68_;
			DinoUiViewModelAccountDetails* _tmp69_;
			_account_index = _account_index + 1;
			_tmp61_ = _account_index;
			_tmp62_ = _account_size;
			if (!(_tmp61_ < _tmp62_)) {
				break;
			}
			_tmp63_ = _account_list;
			_tmp64_ = gee_abstract_list_get ((GeeAbstractList*) _tmp63_, _account_index);
			account = (DinoEntitiesAccount*) _tmp64_;
			_tmp65_ = list_model;
			_tmp66_ = account;
			_tmp67_ = self->stream_interactor;
			_tmp68_ = dino_ui_view_model_account_details_new (_tmp66_, _tmp67_);
			_tmp69_ = _tmp68_;
			g_list_store_append (_tmp65_, (GObject*) _tmp69_);
			_g_object_unref0 (_tmp69_);
			_g_object_unref0 (account);
		}
		_g_object_unref0 (_account_list);
	}
	g_signal_emit (self, dino_ui_view_model_preferences_window_signals[DINO_UI_VIEW_MODEL_PREFERENCES_WINDOW_UPDATE_SIGNAL], 0);
	_g_object_unref0 (list_model);
	_g_object_unref0 (remove_accounts);
	_g_object_unref0 (current_accounts);
}

void
dino_ui_view_model_preferences_window_set_avatar_uri (DinoUiViewModelPreferencesWindow* self,
                                                      DinoEntitiesAccount* account,
                                                      const gchar* uri)
{
	DinoStreamInteractor* _tmp0_;
	DinoModuleIdentity* _tmp1_;
	gpointer _tmp2_;
	DinoAvatarManager* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	g_return_if_fail (uri != NULL);
	_tmp0_ = self->stream_interactor;
	_tmp1_ = dino_avatar_manager_IDENTITY;
	_tmp2_ = dino_stream_interactor_get_module (_tmp0_, DINO_TYPE_AVATAR_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp1_);
	_tmp3_ = (DinoAvatarManager*) _tmp2_;
	dino_avatar_manager_publish (_tmp3_, account, uri);
	_g_object_unref0 (_tmp3_);
}

void
dino_ui_view_model_preferences_window_remove_avatar (DinoUiViewModelPreferencesWindow* self,
                                                     DinoEntitiesAccount* account)
{
	DinoStreamInteractor* _tmp0_;
	DinoModuleIdentity* _tmp1_;
	gpointer _tmp2_;
	DinoAvatarManager* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	_tmp0_ = self->stream_interactor;
	_tmp1_ = dino_avatar_manager_IDENTITY;
	_tmp2_ = dino_stream_interactor_get_module (_tmp0_, DINO_TYPE_AVATAR_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp1_);
	_tmp3_ = (DinoAvatarManager*) _tmp2_;
	dino_avatar_manager_unset_avatar (_tmp3_, account);
	_g_object_unref0 (_tmp3_);
}

static Block76Data*
block76_data_ref (Block76Data* _data76_)
{
	g_atomic_int_inc (&_data76_->_ref_count_);
	return _data76_;
}

static void
block76_data_unref (void * _userdata_)
{
	Block76Data* _data76_;
	_data76_ = (Block76Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data76_->_ref_count_)) {
		DinoUiViewModelPreferencesWindow* self;
		self = _data76_->self;
		_g_object_unref0 (_data76_->account);
		_g_object_unref0 (self);
		g_slice_free (Block76Data, _data76_);
	}
}

static void
__lambda253_ (Block76Data* _data76_)
{
	DinoUiViewModelPreferencesWindow* self;
	self = _data76_->self;
	dino_entities_account_remove (_data76_->account);
	dino_ui_view_model_preferences_window_update_data (self);
}

static void
___lambda253__gasync_ready_callback (GObject* source_object,
                                     GAsyncResult* res,
                                     gpointer self)
{
	__lambda253_ (self);
	block76_data_unref (self);
}

void
dino_ui_view_model_preferences_window_remove_account (DinoUiViewModelPreferencesWindow* self,
                                                      DinoEntitiesAccount* account)
{
	Block76Data* _data76_;
	DinoEntitiesAccount* _tmp0_;
	DinoStreamInteractor* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	_data76_ = g_slice_new0 (Block76Data);
	_data76_->_ref_count_ = 1;
	_data76_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (account);
	_g_object_unref0 (_data76_->account);
	_data76_->account = _tmp0_;
	_tmp1_ = self->stream_interactor;
	dino_stream_interactor_disconnect_account (_tmp1_, _data76_->account, ___lambda253__gasync_ready_callback, block76_data_ref (_data76_));
	block76_data_unref (_data76_);
	_data76_ = NULL;
}

static Block77Data*
block77_data_ref (Block77Data* _data77_)
{
	g_atomic_int_inc (&_data77_->_ref_count_);
	return _data77_;
}

static void
block77_data_unref (void * _userdata_)
{
	Block77Data* _data77_;
	_data77_ = (Block77Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data77_->_ref_count_)) {
		DinoUiViewModelPreferencesWindow* self;
		self = _data77_->self;
		_g_object_unref0 (_data77_->account);
		_g_object_unref0 (self);
		g_slice_free (Block77Data, _data77_);
	}
}

static void
__lambda254_ (Block77Data* _data77_)
{
	DinoUiViewModelPreferencesWindow* self;
	DinoStreamInteractor* _tmp0_;
	self = _data77_->self;
	_tmp0_ = self->stream_interactor;
	dino_stream_interactor_connect_account (_tmp0_, _data77_->account);
}

static void
___lambda254__gasync_ready_callback (GObject* source_object,
                                     GAsyncResult* res,
                                     gpointer self)
{
	__lambda254_ (self);
	block77_data_unref (self);
}

void
dino_ui_view_model_preferences_window_reconnect_account (DinoUiViewModelPreferencesWindow* self,
                                                         DinoEntitiesAccount* account)
{
	Block77Data* _data77_;
	DinoEntitiesAccount* _tmp0_;
	DinoStreamInteractor* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	_data77_ = g_slice_new0 (Block77Data);
	_data77_->_ref_count_ = 1;
	_data77_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (account);
	_g_object_unref0 (_data77_->account);
	_data77_->account = _tmp0_;
	_tmp1_ = self->stream_interactor;
	dino_stream_interactor_disconnect_account (_tmp1_, _data77_->account, ___lambda254__gasync_ready_callback, block77_data_ref (_data77_));
	block77_data_unref (_data77_);
	_data77_ = NULL;
}

void
dino_ui_view_model_preferences_window_enable_disable_account (DinoUiViewModelPreferencesWindow* self,
                                                              DinoEntitiesAccount* account)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	_tmp0_ = dino_entities_account_get_enabled (account);
	_tmp1_ = _tmp0_;
	if (_tmp1_) {
		DinoStreamInteractor* _tmp2_;
		dino_entities_account_set_enabled (account, FALSE);
		_tmp2_ = self->stream_interactor;
		dino_stream_interactor_disconnect_account (_tmp2_, account, NULL, NULL);
	} else {
		DinoStreamInteractor* _tmp3_;
		dino_entities_account_set_enabled (account, TRUE);
		_tmp3_ = self->stream_interactor;
		dino_stream_interactor_connect_account (_tmp3_, account);
	}
	dino_ui_view_model_preferences_window_update_data (self);
}

DinoUiViewModelChangePasswordDialog*
dino_ui_view_model_preferences_window_get_change_password_dialog_model (DinoUiViewModelPreferencesWindow* self)
{
	DinoUiViewModelAccountDetails* _tmp0_;
	DinoEntitiesAccount* _tmp1_;
	DinoEntitiesAccount* _tmp2_;
	DinoEntitiesAccount* _tmp3_;
	DinoStreamInteractor* _tmp4_;
	DinoStreamInteractor* _tmp5_;
	DinoUiViewModelChangePasswordDialog* _tmp6_ = NULL;
	DinoUiViewModelChangePasswordDialog* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_selected_account;
	_tmp1_ = dino_ui_view_model_account_details_get_account (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	_tmp4_ = self->stream_interactor;
	_tmp5_ = _g_object_ref0 (_tmp4_);
	_tmp6_ = dino_ui_view_model_change_password_dialog_new ();
	dino_ui_view_model_change_password_dialog_set_account (_tmp6_, _tmp3_);
	_g_object_unref0 (_tmp3_);
	dino_ui_view_model_change_password_dialog_set_stream_interactor (_tmp6_, _tmp5_);
	_g_object_unref0 (_tmp5_);
	result = _tmp6_;
	return result;
}

static void
dino_ui_view_model_preferences_window_bind_general_page (DinoUiViewModelPreferencesWindow* self)
{
	DinoEntitiesSettings* settings = NULL;
	DinoApplication* _tmp0_;
	DinoEntitiesSettings* _tmp1_;
	DinoEntitiesSettings* _tmp2_;
	DinoEntitiesSettings* _tmp3_;
	DinoUiViewModelGeneralPreferencesPage* _tmp4_;
	DinoUiViewModelGeneralPreferencesPage* _tmp5_;
	DinoUiViewModelGeneralPreferencesPage* _tmp6_;
	DinoUiViewModelGeneralPreferencesPage* _tmp7_;
	g_return_if_fail (self != NULL);
	_tmp0_ = dino_application_get_default ();
	_tmp1_ = dino_application_get_settings (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	settings = _tmp3_;
	_tmp4_ = self->priv->_general_page;
	g_object_bind_property_with_closures ((GObject*) settings, "send-typing", (GObject*) _tmp4_, "send-typing", 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)));
	_tmp5_ = self->priv->_general_page;
	g_object_bind_property_with_closures ((GObject*) settings, "send-marker", (GObject*) _tmp5_, "send-marker", 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)));
	_tmp6_ = self->priv->_general_page;
	g_object_bind_property_with_closures ((GObject*) settings, "notifications", (GObject*) _tmp6_, "notifications", 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)));
	_tmp7_ = self->priv->_general_page;
	g_object_bind_property_with_closures ((GObject*) settings, "convert-utf8-smileys", (GObject*) _tmp7_, "convert-emojis", 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)));
	_g_object_unref0 (settings);
}

DinoUiViewModelPreferencesWindow*
dino_ui_view_model_preferences_window_construct (GType object_type)
{
	DinoUiViewModelPreferencesWindow * self = NULL;
	self = (DinoUiViewModelPreferencesWindow*) g_object_new (object_type, NULL);
	return self;
}

DinoUiViewModelPreferencesWindow*
dino_ui_view_model_preferences_window_new (void)
{
	return dino_ui_view_model_preferences_window_construct (DINO_UI_VIEW_MODEL_TYPE_PREFERENCES_WINDOW);
}

DinoUiViewModelAccountDetails*
dino_ui_view_model_preferences_window_get_selected_account (DinoUiViewModelPreferencesWindow* self)
{
	DinoUiViewModelAccountDetails* result;
	DinoUiViewModelAccountDetails* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_selected_account;
	result = _tmp0_;
	return result;
}

void
dino_ui_view_model_preferences_window_set_selected_account (DinoUiViewModelPreferencesWindow* self,
                                                            DinoUiViewModelAccountDetails* value)
{
	DinoUiViewModelAccountDetails* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_ui_view_model_preferences_window_get_selected_account (self);
	if (old_value != value) {
		DinoUiViewModelAccountDetails* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_selected_account);
		self->priv->_selected_account = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dino_ui_view_model_preferences_window_properties[DINO_UI_VIEW_MODEL_PREFERENCES_WINDOW_SELECTED_ACCOUNT_PROPERTY]);
	}
}

GtkSingleSelection*
dino_ui_view_model_preferences_window_get_active_accounts_selection (DinoUiViewModelPreferencesWindow* self)
{
	GtkSingleSelection* result;
	GtkSingleSelection* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_active_accounts_selection;
	result = _tmp0_;
	return result;
}

DinoUiViewModelGeneralPreferencesPage*
dino_ui_view_model_preferences_window_get_general_page (DinoUiViewModelPreferencesWindow* self)
{
	DinoUiViewModelGeneralPreferencesPage* result;
	DinoUiViewModelGeneralPreferencesPage* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_general_page;
	result = _tmp0_;
	return result;
}

void
dino_ui_view_model_preferences_window_set_general_page (DinoUiViewModelPreferencesWindow* self,
                                                        DinoUiViewModelGeneralPreferencesPage* value)
{
	DinoUiViewModelGeneralPreferencesPage* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_ui_view_model_preferences_window_get_general_page (self);
	if (old_value != value) {
		DinoUiViewModelGeneralPreferencesPage* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_general_page);
		self->priv->_general_page = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dino_ui_view_model_preferences_window_properties[DINO_UI_VIEW_MODEL_PREFERENCES_WINDOW_GENERAL_PAGE_PROPERTY]);
	}
}

static void
dino_ui_view_model_preferences_window_class_init (DinoUiViewModelPreferencesWindowClass * klass,
                                                  gpointer klass_data)
{
	dino_ui_view_model_preferences_window_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoUiViewModelPreferencesWindow_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_dino_ui_view_model_preferences_window_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_dino_ui_view_model_preferences_window_set_property;
	G_OBJECT_CLASS (klass)->finalize = dino_ui_view_model_preferences_window_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_UI_VIEW_MODEL_PREFERENCES_WINDOW_SELECTED_ACCOUNT_PROPERTY, dino_ui_view_model_preferences_window_properties[DINO_UI_VIEW_MODEL_PREFERENCES_WINDOW_SELECTED_ACCOUNT_PROPERTY] = g_param_spec_object ("selected-account", "selected-account", "selected-account", DINO_UI_VIEW_MODEL_TYPE_ACCOUNT_DETAILS, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_UI_VIEW_MODEL_PREFERENCES_WINDOW_ACTIVE_ACCOUNTS_SELECTION_PROPERTY, dino_ui_view_model_preferences_window_properties[DINO_UI_VIEW_MODEL_PREFERENCES_WINDOW_ACTIVE_ACCOUNTS_SELECTION_PROPERTY] = g_param_spec_object ("active-accounts-selection", "active-accounts-selection", "active-accounts-selection", gtk_single_selection_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_UI_VIEW_MODEL_PREFERENCES_WINDOW_GENERAL_PAGE_PROPERTY, dino_ui_view_model_preferences_window_properties[DINO_UI_VIEW_MODEL_PREFERENCES_WINDOW_GENERAL_PAGE_PROPERTY] = g_param_spec_object ("general-page", "general-page", "general-page", DINO_UI_VIEW_MODEL_TYPE_GENERAL_PREFERENCES_PAGE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	dino_ui_view_model_preferences_window_signals[DINO_UI_VIEW_MODEL_PREFERENCES_WINDOW_UPDATE_SIGNAL] = g_signal_new ("update", DINO_UI_VIEW_MODEL_TYPE_PREFERENCES_WINDOW, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
dino_ui_view_model_preferences_window_instance_init (DinoUiViewModelPreferencesWindow * self,
                                                     gpointer klass)
{
	GeeHashMap* _tmp0_;
	GListStore* _tmp1_;
	GtkSingleSelection* _tmp2_;
	DinoUiViewModelGeneralPreferencesPage* _tmp3_;
	self->priv = dino_ui_view_model_preferences_window_get_instance_private (self);
	_tmp0_ = gee_hash_map_new (DINO_ENTITIES_TYPE_ACCOUNT, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, DINO_UI_VIEW_MODEL_TYPE_ACCOUNT_DETAILS, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _dino_entities_account_hash_func_gee_hash_data_func, NULL, NULL, _dino_entities_account_equals_func_gee_equal_data_func, NULL, NULL, NULL, NULL, NULL);
	self->account_details = _tmp0_;
	_tmp1_ = g_list_store_new (DINO_UI_VIEW_MODEL_TYPE_ACCOUNT_DETAILS);
	_tmp2_ = gtk_single_selection_new ((GListModel*) _tmp1_);
	self->priv->_active_accounts_selection = _tmp2_;
	_tmp3_ = dino_ui_view_model_general_preferences_page_new ();
	self->priv->_general_page = _tmp3_;
}

static void
dino_ui_view_model_preferences_window_finalize (GObject * obj)
{
	DinoUiViewModelPreferencesWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_UI_VIEW_MODEL_TYPE_PREFERENCES_WINDOW, DinoUiViewModelPreferencesWindow);
	_g_object_unref0 (self->account_details);
	_g_object_unref0 (self->priv->_selected_account);
	_g_object_unref0 (self->priv->_active_accounts_selection);
	_g_object_unref0 (self->stream_interactor);
	_qlite_database_unref0 (self->db);
	_g_object_unref0 (self->priv->_general_page);
	G_OBJECT_CLASS (dino_ui_view_model_preferences_window_parent_class)->finalize (obj);
}

static GType
dino_ui_view_model_preferences_window_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoUiViewModelPreferencesWindowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_ui_view_model_preferences_window_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoUiViewModelPreferencesWindow), 0, (GInstanceInitFunc) dino_ui_view_model_preferences_window_instance_init, NULL };
	GType dino_ui_view_model_preferences_window_type_id;
	dino_ui_view_model_preferences_window_type_id = g_type_register_static (G_TYPE_OBJECT, "DinoUiViewModelPreferencesWindow", &g_define_type_info, 0);
	DinoUiViewModelPreferencesWindow_private_offset = g_type_add_instance_private (dino_ui_view_model_preferences_window_type_id, sizeof (DinoUiViewModelPreferencesWindowPrivate));
	return dino_ui_view_model_preferences_window_type_id;
}

GType
dino_ui_view_model_preferences_window_get_type (void)
{
	static volatile gsize dino_ui_view_model_preferences_window_type_id__once = 0;
	if (g_once_init_enter (&dino_ui_view_model_preferences_window_type_id__once)) {
		GType dino_ui_view_model_preferences_window_type_id;
		dino_ui_view_model_preferences_window_type_id = dino_ui_view_model_preferences_window_get_type_once ();
		g_once_init_leave (&dino_ui_view_model_preferences_window_type_id__once, dino_ui_view_model_preferences_window_type_id);
	}
	return dino_ui_view_model_preferences_window_type_id__once;
}

static void
_vala_dino_ui_view_model_preferences_window_get_property (GObject * object,
                                                          guint property_id,
                                                          GValue * value,
                                                          GParamSpec * pspec)
{
	DinoUiViewModelPreferencesWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_UI_VIEW_MODEL_TYPE_PREFERENCES_WINDOW, DinoUiViewModelPreferencesWindow);
	switch (property_id) {
		case DINO_UI_VIEW_MODEL_PREFERENCES_WINDOW_SELECTED_ACCOUNT_PROPERTY:
		g_value_set_object (value, dino_ui_view_model_preferences_window_get_selected_account (self));
		break;
		case DINO_UI_VIEW_MODEL_PREFERENCES_WINDOW_ACTIVE_ACCOUNTS_SELECTION_PROPERTY:
		g_value_set_object (value, dino_ui_view_model_preferences_window_get_active_accounts_selection (self));
		break;
		case DINO_UI_VIEW_MODEL_PREFERENCES_WINDOW_GENERAL_PAGE_PROPERTY:
		g_value_set_object (value, dino_ui_view_model_preferences_window_get_general_page (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_dino_ui_view_model_preferences_window_set_property (GObject * object,
                                                          guint property_id,
                                                          const GValue * value,
                                                          GParamSpec * pspec)
{
	DinoUiViewModelPreferencesWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_UI_VIEW_MODEL_TYPE_PREFERENCES_WINDOW, DinoUiViewModelPreferencesWindow);
	switch (property_id) {
		case DINO_UI_VIEW_MODEL_PREFERENCES_WINDOW_SELECTED_ACCOUNT_PROPERTY:
		dino_ui_view_model_preferences_window_set_selected_account (self, g_value_get_object (value));
		break;
		case DINO_UI_VIEW_MODEL_PREFERENCES_WINDOW_GENERAL_PAGE_PROPERTY:
		dino_ui_view_model_preferences_window_set_general_page (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
dino_ui_view_model_change_password_dialog_get_instance_private (DinoUiViewModelChangePasswordDialog* self)
{
	return G_STRUCT_MEMBER_P (self, DinoUiViewModelChangePasswordDialog_private_offset);
}

static void
dino_ui_view_model_change_password_dialog_change_password_data_free (gpointer _data)
{
	DinoUiViewModelChangePasswordDialogChangePasswordData* _data_;
	_data_ = _data;
	_g_free0 (_data_->new_password);
	_g_free0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoUiViewModelChangePasswordDialogChangePasswordData, _data_);
}

void
dino_ui_view_model_change_password_dialog_change_password (DinoUiViewModelChangePasswordDialog* self,
                                                           const gchar* new_password,
                                                           GAsyncReadyCallback _callback_,
                                                           gpointer _user_data_)
{
	DinoUiViewModelChangePasswordDialogChangePasswordData* _data_;
	DinoUiViewModelChangePasswordDialog* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (new_password != NULL);
	_data_ = g_slice_new0 (DinoUiViewModelChangePasswordDialogChangePasswordData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_ui_view_model_change_password_dialog_change_password_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (new_password);
	_g_free0 (_data_->new_password);
	_data_->new_password = _tmp1_;
	dino_ui_view_model_change_password_dialog_change_password_co (_data_);
}

gchar*
dino_ui_view_model_change_password_dialog_change_password_finish (DinoUiViewModelChangePasswordDialog* self,
                                                                  GAsyncResult* _res_)
{
	gchar* result;
	DinoUiViewModelChangePasswordDialogChangePasswordData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
dino_ui_view_model_change_password_dialog_change_password_ready (GObject* source_object,
                                                                 GAsyncResult* _res_,
                                                                 gpointer _user_data_)
{
	DinoUiViewModelChangePasswordDialogChangePasswordData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dino_ui_view_model_change_password_dialog_change_password_co (_data_);
}

static gboolean
dino_ui_view_model_change_password_dialog_change_password_co (DinoUiViewModelChangePasswordDialogChangePasswordData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->_stream_interactor;
	_data_->_tmp1_ = dino_register_IDENTITY;
	_data_->_tmp2_ = dino_stream_interactor_get_module (_data_->_tmp0_, DINO_TYPE_REGISTER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp1_);
	_data_->_tmp3_ = (DinoRegister*) _data_->_tmp2_;
	_data_->_tmp4_ = _data_->self->priv->_account;
	_data_->_state_ = 1;
	dino_register_change_password (_data_->_tmp3_, _data_->_tmp4_, _data_->new_password, dino_ui_view_model_change_password_dialog_change_password_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp5_ = dino_register_change_password_finish (_data_->_tmp3_, _data_->_res_);
	_data_->_tmp6_ = _data_->_tmp5_;
	_g_object_unref0 (_data_->_tmp3_);
	_data_->res = _data_->_tmp6_;
	_data_->_tmp7_ = _data_->res;
	if (_data_->_tmp7_ == NULL) {
		_data_->_tmp8_ = _data_->self->priv->_account;
		dino_entities_account_set_password (_data_->_tmp8_, _data_->new_password);
	}
	_data_->result = _data_->res;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

DinoUiViewModelChangePasswordDialog*
dino_ui_view_model_change_password_dialog_construct (GType object_type)
{
	DinoUiViewModelChangePasswordDialog * self = NULL;
	self = (DinoUiViewModelChangePasswordDialog*) g_object_new (object_type, NULL);
	return self;
}

DinoUiViewModelChangePasswordDialog*
dino_ui_view_model_change_password_dialog_new (void)
{
	return dino_ui_view_model_change_password_dialog_construct (DINO_UI_VIEW_MODEL_TYPE_CHANGE_PASSWORD_DIALOG);
}

DinoEntitiesAccount*
dino_ui_view_model_change_password_dialog_get_account (DinoUiViewModelChangePasswordDialog* self)
{
	DinoEntitiesAccount* result;
	DinoEntitiesAccount* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_account;
	result = _tmp0_;
	return result;
}

void
dino_ui_view_model_change_password_dialog_set_account (DinoUiViewModelChangePasswordDialog* self,
                                                       DinoEntitiesAccount* value)
{
	DinoEntitiesAccount* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_ui_view_model_change_password_dialog_get_account (self);
	if (old_value != value) {
		DinoEntitiesAccount* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_account);
		self->priv->_account = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dino_ui_view_model_change_password_dialog_properties[DINO_UI_VIEW_MODEL_CHANGE_PASSWORD_DIALOG_ACCOUNT_PROPERTY]);
	}
}

DinoStreamInteractor*
dino_ui_view_model_change_password_dialog_get_stream_interactor (DinoUiViewModelChangePasswordDialog* self)
{
	DinoStreamInteractor* result;
	DinoStreamInteractor* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_stream_interactor;
	result = _tmp0_;
	return result;
}

void
dino_ui_view_model_change_password_dialog_set_stream_interactor (DinoUiViewModelChangePasswordDialog* self,
                                                                 DinoStreamInteractor* value)
{
	DinoStreamInteractor* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_ui_view_model_change_password_dialog_get_stream_interactor (self);
	if (old_value != value) {
		DinoStreamInteractor* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_stream_interactor);
		self->priv->_stream_interactor = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dino_ui_view_model_change_password_dialog_properties[DINO_UI_VIEW_MODEL_CHANGE_PASSWORD_DIALOG_STREAM_INTERACTOR_PROPERTY]);
	}
}

static void
dino_ui_view_model_change_password_dialog_class_init (DinoUiViewModelChangePasswordDialogClass * klass,
                                                      gpointer klass_data)
{
	dino_ui_view_model_change_password_dialog_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoUiViewModelChangePasswordDialog_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_dino_ui_view_model_change_password_dialog_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_dino_ui_view_model_change_password_dialog_set_property;
	G_OBJECT_CLASS (klass)->finalize = dino_ui_view_model_change_password_dialog_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_UI_VIEW_MODEL_CHANGE_PASSWORD_DIALOG_ACCOUNT_PROPERTY, dino_ui_view_model_change_password_dialog_properties[DINO_UI_VIEW_MODEL_CHANGE_PASSWORD_DIALOG_ACCOUNT_PROPERTY] = g_param_spec_object ("account", "account", "account", DINO_ENTITIES_TYPE_ACCOUNT, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_UI_VIEW_MODEL_CHANGE_PASSWORD_DIALOG_STREAM_INTERACTOR_PROPERTY, dino_ui_view_model_change_password_dialog_properties[DINO_UI_VIEW_MODEL_CHANGE_PASSWORD_DIALOG_STREAM_INTERACTOR_PROPERTY] = g_param_spec_object ("stream-interactor", "stream-interactor", "stream-interactor", DINO_TYPE_STREAM_INTERACTOR, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
dino_ui_view_model_change_password_dialog_instance_init (DinoUiViewModelChangePasswordDialog * self,
                                                         gpointer klass)
{
	self->priv = dino_ui_view_model_change_password_dialog_get_instance_private (self);
}

static void
dino_ui_view_model_change_password_dialog_finalize (GObject * obj)
{
	DinoUiViewModelChangePasswordDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_UI_VIEW_MODEL_TYPE_CHANGE_PASSWORD_DIALOG, DinoUiViewModelChangePasswordDialog);
	_g_object_unref0 (self->priv->_account);
	_g_object_unref0 (self->priv->_stream_interactor);
	G_OBJECT_CLASS (dino_ui_view_model_change_password_dialog_parent_class)->finalize (obj);
}

static GType
dino_ui_view_model_change_password_dialog_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoUiViewModelChangePasswordDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_ui_view_model_change_password_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoUiViewModelChangePasswordDialog), 0, (GInstanceInitFunc) dino_ui_view_model_change_password_dialog_instance_init, NULL };
	GType dino_ui_view_model_change_password_dialog_type_id;
	dino_ui_view_model_change_password_dialog_type_id = g_type_register_static (G_TYPE_OBJECT, "DinoUiViewModelChangePasswordDialog", &g_define_type_info, 0);
	DinoUiViewModelChangePasswordDialog_private_offset = g_type_add_instance_private (dino_ui_view_model_change_password_dialog_type_id, sizeof (DinoUiViewModelChangePasswordDialogPrivate));
	return dino_ui_view_model_change_password_dialog_type_id;
}

GType
dino_ui_view_model_change_password_dialog_get_type (void)
{
	static volatile gsize dino_ui_view_model_change_password_dialog_type_id__once = 0;
	if (g_once_init_enter (&dino_ui_view_model_change_password_dialog_type_id__once)) {
		GType dino_ui_view_model_change_password_dialog_type_id;
		dino_ui_view_model_change_password_dialog_type_id = dino_ui_view_model_change_password_dialog_get_type_once ();
		g_once_init_leave (&dino_ui_view_model_change_password_dialog_type_id__once, dino_ui_view_model_change_password_dialog_type_id);
	}
	return dino_ui_view_model_change_password_dialog_type_id__once;
}

static void
_vala_dino_ui_view_model_change_password_dialog_get_property (GObject * object,
                                                              guint property_id,
                                                              GValue * value,
                                                              GParamSpec * pspec)
{
	DinoUiViewModelChangePasswordDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_UI_VIEW_MODEL_TYPE_CHANGE_PASSWORD_DIALOG, DinoUiViewModelChangePasswordDialog);
	switch (property_id) {
		case DINO_UI_VIEW_MODEL_CHANGE_PASSWORD_DIALOG_ACCOUNT_PROPERTY:
		g_value_set_object (value, dino_ui_view_model_change_password_dialog_get_account (self));
		break;
		case DINO_UI_VIEW_MODEL_CHANGE_PASSWORD_DIALOG_STREAM_INTERACTOR_PROPERTY:
		g_value_set_object (value, dino_ui_view_model_change_password_dialog_get_stream_interactor (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_dino_ui_view_model_change_password_dialog_set_property (GObject * object,
                                                              guint property_id,
                                                              const GValue * value,
                                                              GParamSpec * pspec)
{
	DinoUiViewModelChangePasswordDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_UI_VIEW_MODEL_TYPE_CHANGE_PASSWORD_DIALOG, DinoUiViewModelChangePasswordDialog);
	switch (property_id) {
		case DINO_UI_VIEW_MODEL_CHANGE_PASSWORD_DIALOG_ACCOUNT_PROPERTY:
		dino_ui_view_model_change_password_dialog_set_account (self, g_value_get_object (value));
		break;
		case DINO_UI_VIEW_MODEL_CHANGE_PASSWORD_DIALOG_STREAM_INTERACTOR_PROPERTY:
		dino_ui_view_model_change_password_dialog_set_stream_interactor (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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;
}

