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

/*
 * Copyright © 2025 Alain M. (https://github.com/alainm23/planify)
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public
 * License along with this program; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301 USA
 *
 * Authored by: Alain M. <alainmh23@gmail.com>
 */

#include <adwaita.h>
#include <glib-object.h>
#include <gee.h>
#include <glib.h>
#include "planify.h"
#include <glib/gi18n-lib.h>
#include <gtk/gtk.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <gdk/gdk.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 DIALOGS_PREFERENCES_PAGES_TYPE_BASE_PAGE (dialogs_preferences_pages_base_page_get_type ())
#define DIALOGS_PREFERENCES_PAGES_BASE_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DIALOGS_PREFERENCES_PAGES_TYPE_BASE_PAGE, DialogsPreferencesPagesBasePage))
#define DIALOGS_PREFERENCES_PAGES_BASE_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DIALOGS_PREFERENCES_PAGES_TYPE_BASE_PAGE, DialogsPreferencesPagesBasePageClass))
#define DIALOGS_PREFERENCES_PAGES_IS_BASE_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DIALOGS_PREFERENCES_PAGES_TYPE_BASE_PAGE))
#define DIALOGS_PREFERENCES_PAGES_IS_BASE_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DIALOGS_PREFERENCES_PAGES_TYPE_BASE_PAGE))
#define DIALOGS_PREFERENCES_PAGES_BASE_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DIALOGS_PREFERENCES_PAGES_TYPE_BASE_PAGE, DialogsPreferencesPagesBasePageClass))

typedef struct _DialogsPreferencesPagesBasePage DialogsPreferencesPagesBasePage;
typedef struct _DialogsPreferencesPagesBasePageClass DialogsPreferencesPagesBasePageClass;
typedef struct _DialogsPreferencesPagesBasePagePrivate DialogsPreferencesPagesBasePagePrivate;

#define DIALOGS_PREFERENCES_PAGES_TYPE_SOURCE_VIEW (dialogs_preferences_pages_source_view_get_type ())
#define DIALOGS_PREFERENCES_PAGES_SOURCE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DIALOGS_PREFERENCES_PAGES_TYPE_SOURCE_VIEW, DialogsPreferencesPagesSourceView))
#define DIALOGS_PREFERENCES_PAGES_SOURCE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DIALOGS_PREFERENCES_PAGES_TYPE_SOURCE_VIEW, DialogsPreferencesPagesSourceViewClass))
#define DIALOGS_PREFERENCES_PAGES_IS_SOURCE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DIALOGS_PREFERENCES_PAGES_TYPE_SOURCE_VIEW))
#define DIALOGS_PREFERENCES_PAGES_IS_SOURCE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DIALOGS_PREFERENCES_PAGES_TYPE_SOURCE_VIEW))
#define DIALOGS_PREFERENCES_PAGES_SOURCE_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DIALOGS_PREFERENCES_PAGES_TYPE_SOURCE_VIEW, DialogsPreferencesPagesSourceViewClass))

typedef struct _DialogsPreferencesPagesSourceView DialogsPreferencesPagesSourceView;
typedef struct _DialogsPreferencesPagesSourceViewClass DialogsPreferencesPagesSourceViewClass;
typedef struct _DialogsPreferencesPagesSourceViewPrivate DialogsPreferencesPagesSourceViewPrivate;
enum  {
	DIALOGS_PREFERENCES_PAGES_SOURCE_VIEW_0_PROPERTY,
	DIALOGS_PREFERENCES_PAGES_SOURCE_VIEW_SOURCE_PROPERTY,
	DIALOGS_PREFERENCES_PAGES_SOURCE_VIEW_NUM_PROPERTIES
};
static GParamSpec* dialogs_preferences_pages_source_view_properties[DIALOGS_PREFERENCES_PAGES_SOURCE_VIEW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block115Data Block115Data;

#define TYPE_PLANIFY (planify_get_type ())
#define PLANIFY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLANIFY, Planify))
#define PLANIFY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLANIFY, PlanifyClass))
#define IS_PLANIFY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLANIFY))
#define IS_PLANIFY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLANIFY))
#define PLANIFY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLANIFY, PlanifyClass))

typedef struct _Planify Planify;
typedef struct _PlanifyClass PlanifyClass;
typedef struct _PlanifyPrivate PlanifyPrivate;

#define TYPE_MAIN_WINDOW (main_window_get_type ())
#define MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MAIN_WINDOW, MainWindow))
#define MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MAIN_WINDOW, MainWindowClass))
#define IS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MAIN_WINDOW))
#define IS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MAIN_WINDOW))
#define MAIN_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MAIN_WINDOW, MainWindowClass))

typedef struct _MainWindow MainWindow;
typedef struct _MainWindowClass MainWindowClass;

#define DIALOGS_PREFERENCES_PAGES_TYPE_INBOX_PAGE (dialogs_preferences_pages_inbox_page_get_type ())
#define DIALOGS_PREFERENCES_PAGES_INBOX_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DIALOGS_PREFERENCES_PAGES_TYPE_INBOX_PAGE, DialogsPreferencesPagesInboxPage))
#define DIALOGS_PREFERENCES_PAGES_INBOX_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DIALOGS_PREFERENCES_PAGES_TYPE_INBOX_PAGE, DialogsPreferencesPagesInboxPageClass))
#define DIALOGS_PREFERENCES_PAGES_IS_INBOX_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DIALOGS_PREFERENCES_PAGES_TYPE_INBOX_PAGE))
#define DIALOGS_PREFERENCES_PAGES_IS_INBOX_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DIALOGS_PREFERENCES_PAGES_TYPE_INBOX_PAGE))
#define DIALOGS_PREFERENCES_PAGES_INBOX_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DIALOGS_PREFERENCES_PAGES_TYPE_INBOX_PAGE, DialogsPreferencesPagesInboxPageClass))

typedef struct _DialogsPreferencesPagesInboxPage DialogsPreferencesPagesInboxPage;
typedef struct _DialogsPreferencesPagesInboxPageClass DialogsPreferencesPagesInboxPageClass;
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _Block116Data Block116Data;
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
#define _g_time_zone_unref0(var) ((var == NULL) ? NULL : (var = (g_time_zone_unref (var), NULL)))

struct _DialogsPreferencesPagesBasePage {
	AdwNavigationPage parent_instance;
	DialogsPreferencesPagesBasePagePrivate * priv;
	GeeHashMap* signal_map;
};

struct _DialogsPreferencesPagesBasePageClass {
	AdwNavigationPageClass parent_class;
	void (*clean_up) (DialogsPreferencesPagesBasePage* self);
};

struct _DialogsPreferencesPagesSourceView {
	DialogsPreferencesPagesBasePage parent_instance;
	DialogsPreferencesPagesSourceViewPrivate * priv;
};

struct _DialogsPreferencesPagesSourceViewClass {
	DialogsPreferencesPagesBasePageClass parent_class;
};

struct _DialogsPreferencesPagesSourceViewPrivate {
	ObjectsSource* _source;
};

struct _Block115Data {
	int _ref_count_;
	DialogsPreferencesPagesSourceView* self;
	AdwAlertDialog* dialog;
};

struct _Planify {
	AdwApplication parent_instance;
	PlanifyPrivate * priv;
	MainWindow* main_window;
};

struct _PlanifyClass {
	AdwApplicationClass parent_class;
};

struct _Block116Data {
	int _ref_count_;
	DialogsPreferencesPagesSourceView* self;
	AdwEntryRow* display_entry;
	AdwSwitchRow* sync_server_row;
	AdwSpinner* delete_spinner;
	GtkStack* delete_stack;
};

static gint DialogsPreferencesPagesSourceView_private_offset;
static gpointer dialogs_preferences_pages_source_view_parent_class = NULL;
VALA_EXTERN Planify* planify__instance;

VALA_EXTERN GType dialogs_preferences_pages_base_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DialogsPreferencesPagesBasePage, g_object_unref)
VALA_EXTERN GType dialogs_preferences_pages_source_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DialogsPreferencesPagesSourceView, g_object_unref)
VALA_EXTERN DialogsPreferencesPagesSourceView* dialogs_preferences_pages_source_view_new (AdwPreferencesDialog* preferences_dialog,
                                                                              ObjectsSource* source);
VALA_EXTERN DialogsPreferencesPagesSourceView* dialogs_preferences_pages_source_view_construct (GType object_type,
                                                                                    AdwPreferencesDialog* preferences_dialog,
                                                                                    ObjectsSource* source);
static void dialogs_preferences_pages_source_view_show_inbox_warning_dialog (DialogsPreferencesPagesSourceView* self);
static Block115Data* block115_data_ref (Block115Data* _data115_);
static void block115_data_unref (void * _userdata_);
VALA_EXTERN GType planify_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Planify, g_object_unref)
VALA_EXTERN GType main_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MainWindow, g_object_unref)
static void __lambda333_ (Block115Data* _data115_,
                   GObject* obj,
                   GAsyncResult* res);
VALA_EXTERN AdwPreferencesDialog* dialogs_preferences_pages_base_page_get_preferences_dialog (DialogsPreferencesPagesBasePage* self);
VALA_EXTERN DialogsPreferencesPagesInboxPage* dialogs_preferences_pages_inbox_page_new (AdwPreferencesDialog* preferences_dialog);
VALA_EXTERN DialogsPreferencesPagesInboxPage* dialogs_preferences_pages_inbox_page_construct (GType object_type,
                                                                                  AdwPreferencesDialog* preferences_dialog);
VALA_EXTERN GType dialogs_preferences_pages_inbox_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DialogsPreferencesPagesInboxPage, g_object_unref)
static void ___lambda333__gasync_ready_callback (GObject* source_object,
                                          GAsyncResult* res,
                                          gpointer self);
VALA_EXTERN ObjectsSource* dialogs_preferences_pages_source_view_get_source (DialogsPreferencesPagesSourceView* self);
static void dialogs_preferences_pages_source_view_set_source (DialogsPreferencesPagesSourceView* self,
                                                       ObjectsSource* value);
static GObject * dialogs_preferences_pages_source_view_constructor (GType type,
                                                             guint n_construct_properties,
                                                             GObjectConstructParam * construct_properties);
static Block116Data* block116_data_ref (Block116Data* _data116_);
static void block116_data_unref (void * _userdata_);
static void _dialogs_preferences_pages_source_view___lambda334_ (Block116Data* _data116_);
static void __dialogs_preferences_pages_source_view___lambda334__g_object_notify (GObject* _sender,
                                                                           GParamSpec* pspec,
                                                                           gpointer self);
static void _dialogs_preferences_pages_source_view___lambda335_ (Block116Data* _data116_);
static void __dialogs_preferences_pages_source_view___lambda335__adw_entry_row_apply (AdwEntryRow* _sender,
                                                                               gpointer self);
static void _dialogs_preferences_pages_source_view___lambda336_ (Block116Data* _data116_);
static void __lambda337_ (Block116Data* _data116_,
                   const gchar* response);
static void ___lambda337__adw_alert_dialog_response (AdwAlertDialog* _sender,
                                              const gchar* response,
                                              gpointer self);
static void __dialogs_preferences_pages_source_view___lambda336__adw_button_row_activated (AdwButtonRow* _sender,
                                                                                    gpointer self);
static void _dialogs_preferences_pages_source_view___lambda338_ (DialogsPreferencesPagesSourceView* self);
static void __dialogs_preferences_pages_source_view___lambda338__objects_base_object_deleted (ObjectsBaseObject* _sender,
                                                                                       gpointer self);
static void _dialogs_preferences_pages_source_view___lambda339_ (DialogsPreferencesPagesSourceView* self);
VALA_EXTERN void dialogs_preferences_pages_base_page_clean_up (DialogsPreferencesPagesBasePage* self);
static void __dialogs_preferences_pages_source_view___lambda339__gtk_widget_destroy (GtkWidget* _sender,
                                                                              gpointer self);
static void dialogs_preferences_pages_source_view_finalize (GObject * obj);
static GType dialogs_preferences_pages_source_view_get_type_once (void);
static void _vala_dialogs_preferences_pages_source_view_get_property (GObject * object,
                                                               guint property_id,
                                                               GValue * value,
                                                               GParamSpec * pspec);
static void _vala_dialogs_preferences_pages_source_view_set_property (GObject * object,
                                                               guint property_id,
                                                               const GValue * value,
                                                               GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

static inline gpointer
dialogs_preferences_pages_source_view_get_instance_private (DialogsPreferencesPagesSourceView* self)
{
	return G_STRUCT_MEMBER_P (self, DialogsPreferencesPagesSourceView_private_offset);
}

DialogsPreferencesPagesSourceView*
dialogs_preferences_pages_source_view_construct (GType object_type,
                                                 AdwPreferencesDialog* preferences_dialog,
                                                 ObjectsSource* source)
{
	DialogsPreferencesPagesSourceView * self = NULL;
	g_return_val_if_fail (preferences_dialog != NULL, NULL);
	g_return_val_if_fail (source != NULL, NULL);
	self = (DialogsPreferencesPagesSourceView*) g_object_new (object_type, "preferences-dialog", preferences_dialog, "source", source, "title", _ ("Source"), NULL);
	return self;
}

DialogsPreferencesPagesSourceView*
dialogs_preferences_pages_source_view_new (AdwPreferencesDialog* preferences_dialog,
                                           ObjectsSource* source)
{
	return dialogs_preferences_pages_source_view_construct (DIALOGS_PREFERENCES_PAGES_TYPE_SOURCE_VIEW, preferences_dialog, source);
}

static Block115Data*
block115_data_ref (Block115Data* _data115_)
{
	g_atomic_int_inc (&_data115_->_ref_count_);
	return _data115_;
}

static void
block115_data_unref (void * _userdata_)
{
	Block115Data* _data115_;
	_data115_ = (Block115Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data115_->_ref_count_)) {
		DialogsPreferencesPagesSourceView* self;
		self = _data115_->self;
		_g_object_unref0 (_data115_->dialog);
		_g_object_unref0 (self);
		g_slice_free (Block115Data, _data115_);
	}
}

static void
__lambda333_ (Block115Data* _data115_,
              GObject* obj,
              GAsyncResult* res)
{
	DialogsPreferencesPagesSourceView* self;
	gchar* response = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	self = _data115_->self;
	g_return_if_fail (res != NULL);
	_tmp0_ = adw_alert_dialog_choose_finish (_data115_->dialog, res);
	_tmp1_ = g_strdup (_tmp0_);
	response = _tmp1_;
	_tmp2_ = response;
	if (g_strcmp0 (_tmp2_, "change") == 0) {
		AdwPreferencesDialog* _tmp3_;
		AdwPreferencesDialog* _tmp4_;
		AdwPreferencesDialog* _tmp5_;
		AdwPreferencesDialog* _tmp6_;
		DialogsPreferencesPagesInboxPage* _tmp7_;
		DialogsPreferencesPagesInboxPage* _tmp8_;
		_tmp3_ = dialogs_preferences_pages_base_page_get_preferences_dialog ((DialogsPreferencesPagesBasePage*) self);
		_tmp4_ = _tmp3_;
		_tmp5_ = dialogs_preferences_pages_base_page_get_preferences_dialog ((DialogsPreferencesPagesBasePage*) self);
		_tmp6_ = _tmp5_;
		_tmp7_ = dialogs_preferences_pages_inbox_page_new (_tmp6_);
		g_object_ref_sink (_tmp7_);
		_tmp8_ = _tmp7_;
		adw_preferences_dialog_push_subpage (_tmp4_, (AdwNavigationPage*) _tmp8_);
		_g_object_unref0 (_tmp8_);
	}
	_g_free0 (response);
}

static void
___lambda333__gasync_ready_callback (GObject* source_object,
                                     GAsyncResult* res,
                                     gpointer self)
{
	__lambda333_ (self, source_object, res);
	block115_data_unref (self);
}

static void
dialogs_preferences_pages_source_view_show_inbox_warning_dialog (DialogsPreferencesPagesSourceView* self)
{
	Block115Data* _data115_;
	AdwAlertDialog* _tmp0_;
	Planify* _tmp1_;
	MainWindow* _tmp2_;
	g_return_if_fail (self != NULL);
	_data115_ = g_slice_new0 (Block115Data);
	_data115_->_ref_count_ = 1;
	_data115_->self = g_object_ref (self);
	_tmp0_ = (AdwAlertDialog*) adw_alert_dialog_new (_ ("Cannot Delete This Source"), _ ("This source contains your current Inbox project. Please change your In" \
"box project first."));
	g_object_ref_sink (_tmp0_);
	_data115_->dialog = _tmp0_;
	adw_alert_dialog_add_response (_data115_->dialog, "cancel", _ ("Cancel"));
	adw_alert_dialog_add_response (_data115_->dialog, "change", _ ("Change Inbox"));
	adw_alert_dialog_set_response_appearance (_data115_->dialog, "change", ADW_RESPONSE_SUGGESTED);
	adw_alert_dialog_set_default_response (_data115_->dialog, "change");
	adw_alert_dialog_set_close_response (_data115_->dialog, "cancel");
	_tmp1_ = planify__instance;
	_tmp2_ = _tmp1_->main_window;
	adw_alert_dialog_choose (_data115_->dialog, (GtkWidget*) _tmp2_, NULL, ___lambda333__gasync_ready_callback, block115_data_ref (_data115_));
	block115_data_unref (_data115_);
	_data115_ = NULL;
}

ObjectsSource*
dialogs_preferences_pages_source_view_get_source (DialogsPreferencesPagesSourceView* self)
{
	ObjectsSource* result;
	ObjectsSource* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_source;
	result = _tmp0_;
	return result;
}

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

static void
dialogs_preferences_pages_source_view_set_source (DialogsPreferencesPagesSourceView* self,
                                                  ObjectsSource* value)
{
	ObjectsSource* old_value;
	g_return_if_fail (self != NULL);
	old_value = dialogs_preferences_pages_source_view_get_source (self);
	if (old_value != value) {
		ObjectsSource* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_source);
		self->priv->_source = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dialogs_preferences_pages_source_view_properties[DIALOGS_PREFERENCES_PAGES_SOURCE_VIEW_SOURCE_PROPERTY]);
	}
}

static Block116Data*
block116_data_ref (Block116Data* _data116_)
{
	g_atomic_int_inc (&_data116_->_ref_count_);
	return _data116_;
}

static void
block116_data_unref (void * _userdata_)
{
	Block116Data* _data116_;
	_data116_ = (Block116Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data116_->_ref_count_)) {
		DialogsPreferencesPagesSourceView* self;
		self = _data116_->self;
		_g_object_unref0 (_data116_->delete_stack);
		_g_object_unref0 (_data116_->delete_spinner);
		_g_object_unref0 (_data116_->sync_server_row);
		_g_object_unref0 (_data116_->display_entry);
		_g_object_unref0 (self);
		g_slice_free (Block116Data, _data116_);
	}
}

static void
_dialogs_preferences_pages_source_view___lambda334_ (Block116Data* _data116_)
{
	DialogsPreferencesPagesSourceView* self;
	ObjectsSource* _tmp0_;
	AdwSwitchRow* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	ObjectsSource* _tmp4_;
	ObjectsSource* _tmp5_;
	gboolean _tmp6_;
	gboolean _tmp7_;
	self = _data116_->self;
	_tmp0_ = self->priv->_source;
	_tmp1_ = _data116_->sync_server_row;
	_tmp2_ = adw_switch_row_get_active (_tmp1_);
	_tmp3_ = _tmp2_;
	objects_source_set_sync_server (_tmp0_, _tmp3_);
	_tmp4_ = self->priv->_source;
	objects_source_save (_tmp4_);
	_tmp5_ = self->priv->_source;
	_tmp6_ = objects_source_get_sync_server (_tmp5_);
	_tmp7_ = _tmp6_;
	if (_tmp7_) {
		ObjectsSource* _tmp8_;
		_tmp8_ = self->priv->_source;
		objects_source_run_server (_tmp8_, FALSE);
	} else {
		ObjectsSource* _tmp9_;
		_tmp9_ = self->priv->_source;
		objects_source_remove_sync_server (_tmp9_);
	}
}

static void
__dialogs_preferences_pages_source_view___lambda334__g_object_notify (GObject* _sender,
                                                                      GParamSpec* pspec,
                                                                      gpointer self)
{
	_dialogs_preferences_pages_source_view___lambda334_ (self);
}

static void
_dialogs_preferences_pages_source_view___lambda335_ (Block116Data* _data116_)
{
	DialogsPreferencesPagesSourceView* self;
	ObjectsSource* _tmp0_;
	AdwEntryRow* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	ObjectsSource* _tmp4_;
	self = _data116_->self;
	_tmp0_ = self->priv->_source;
	_tmp1_ = _data116_->display_entry;
	_tmp2_ = gtk_editable_get_text ((GtkEditable*) _tmp1_);
	_tmp3_ = _tmp2_;
	objects_source_set_display_name (_tmp0_, _tmp3_);
	_tmp4_ = self->priv->_source;
	objects_source_save (_tmp4_);
}

static void
__dialogs_preferences_pages_source_view___lambda335__adw_entry_row_apply (AdwEntryRow* _sender,
                                                                          gpointer self)
{
	_dialogs_preferences_pages_source_view___lambda335_ (self);
}

static void
__lambda337_ (Block116Data* _data116_,
              const gchar* response)
{
	DialogsPreferencesPagesSourceView* self;
	self = _data116_->self;
	g_return_if_fail (response != NULL);
	if (g_strcmp0 (response, "delete") == 0) {
		GtkStack* _tmp0_;
		AdwSpinner* _tmp1_;
		ObjectsSource* _tmp2_;
		_tmp0_ = _data116_->delete_stack;
		_tmp1_ = _data116_->delete_spinner;
		gtk_stack_set_visible_child (_tmp0_, (GtkWidget*) _tmp1_);
		_tmp2_ = self->priv->_source;
		objects_source_delete_source (_tmp2_, NULL, NULL);
	}
}

static void
___lambda337__adw_alert_dialog_response (AdwAlertDialog* _sender,
                                         const gchar* response,
                                         gpointer self)
{
	__lambda337_ (self, response);
}

static void
_dialogs_preferences_pages_source_view___lambda336_ (Block116Data* _data116_)
{
	DialogsPreferencesPagesSourceView* self;
	gchar* current_inbox_id = NULL;
	ServicesSettings* _tmp0_;
	ServicesSettings* _tmp1_;
	GSettings* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	ObjectsProject* current_inbox = NULL;
	ServicesStore* _tmp5_;
	const gchar* _tmp6_;
	ObjectsProject* _tmp7_;
	gboolean _tmp8_ = FALSE;
	ObjectsProject* _tmp9_;
	AdwAlertDialog* dialog = NULL;
	AdwAlertDialog* _tmp16_;
	AdwAlertDialog* _tmp17_;
	AdwAlertDialog* _tmp18_;
	AdwAlertDialog* _tmp19_;
	AdwAlertDialog* _tmp20_;
	AdwAlertDialog* _tmp21_;
	Planify* _tmp22_;
	MainWindow* _tmp23_;
	AdwAlertDialog* _tmp24_;
	self = _data116_->self;
	_tmp0_ = services_settings_get_default ();
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_->settings;
	_tmp3_ = g_settings_get_string (_tmp2_, "local-inbox-project-id");
	_tmp4_ = _tmp3_;
	_g_object_unref0 (_tmp1_);
	current_inbox_id = _tmp4_;
	_tmp5_ = services_store_instance ();
	_tmp6_ = current_inbox_id;
	_tmp7_ = services_store_get_project (_tmp5_, _tmp6_);
	current_inbox = _tmp7_;
	_tmp9_ = current_inbox;
	if (_tmp9_ != NULL) {
		ObjectsProject* _tmp10_;
		const gchar* _tmp11_;
		const gchar* _tmp12_;
		ObjectsSource* _tmp13_;
		const gchar* _tmp14_;
		const gchar* _tmp15_;
		_tmp10_ = current_inbox;
		_tmp11_ = objects_project_get_source_id (_tmp10_);
		_tmp12_ = _tmp11_;
		_tmp13_ = self->priv->_source;
		_tmp14_ = objects_base_object_get_id ((ObjectsBaseObject*) _tmp13_);
		_tmp15_ = _tmp14_;
		_tmp8_ = g_strcmp0 (_tmp12_, _tmp15_) == 0;
	} else {
		_tmp8_ = FALSE;
	}
	if (_tmp8_) {
		dialogs_preferences_pages_source_view_show_inbox_warning_dialog (self);
		_g_object_unref0 (current_inbox);
		_g_free0 (current_inbox_id);
		return;
	}
	_tmp16_ = (AdwAlertDialog*) adw_alert_dialog_new (_ ("Delete Source?"), _ ("This can not be undone"));
	g_object_ref_sink (_tmp16_);
	dialog = _tmp16_;
	_tmp17_ = dialog;
	adw_alert_dialog_add_response (_tmp17_, "cancel", _ ("Cancel"));
	_tmp18_ = dialog;
	adw_alert_dialog_add_response (_tmp18_, "delete", _ ("Delete"));
	_tmp19_ = dialog;
	adw_alert_dialog_set_close_response (_tmp19_, "cancel");
	_tmp20_ = dialog;
	adw_alert_dialog_set_response_appearance (_tmp20_, "delete", ADW_RESPONSE_DESTRUCTIVE);
	_tmp21_ = dialog;
	_tmp22_ = planify__instance;
	_tmp23_ = _tmp22_->main_window;
	adw_dialog_present ((AdwDialog*) _tmp21_, (GtkWidget*) _tmp23_);
	_tmp24_ = dialog;
	g_signal_connect_data (_tmp24_, "response", (GCallback) ___lambda337__adw_alert_dialog_response, block116_data_ref (_data116_), (GClosureNotify) block116_data_unref, 0);
	_g_object_unref0 (dialog);
	_g_object_unref0 (current_inbox);
	_g_free0 (current_inbox_id);
}

static void
__dialogs_preferences_pages_source_view___lambda336__adw_button_row_activated (AdwButtonRow* _sender,
                                                                               gpointer self)
{
	_dialogs_preferences_pages_source_view___lambda336_ (self);
}

static void
_dialogs_preferences_pages_source_view___lambda338_ (DialogsPreferencesPagesSourceView* self)
{
	AdwPreferencesDialog* _tmp0_;
	AdwPreferencesDialog* _tmp1_;
	_tmp0_ = dialogs_preferences_pages_base_page_get_preferences_dialog ((DialogsPreferencesPagesBasePage*) self);
	_tmp1_ = _tmp0_;
	adw_preferences_dialog_pop_subpage (_tmp1_);
}

static void
__dialogs_preferences_pages_source_view___lambda338__objects_base_object_deleted (ObjectsBaseObject* _sender,
                                                                                  gpointer self)
{
	_dialogs_preferences_pages_source_view___lambda338_ ((DialogsPreferencesPagesSourceView*) self);
}

static void
_dialogs_preferences_pages_source_view___lambda339_ (DialogsPreferencesPagesSourceView* self)
{
	dialogs_preferences_pages_base_page_clean_up ((DialogsPreferencesPagesBasePage*) self);
}

static void
__dialogs_preferences_pages_source_view___lambda339__gtk_widget_destroy (GtkWidget* _sender,
                                                                         gpointer self)
{
	_dialogs_preferences_pages_source_view___lambda339_ ((DialogsPreferencesPagesSourceView*) self);
}

static GObject *
dialogs_preferences_pages_source_view_constructor (GType type,
                                                   guint n_construct_properties,
                                                   GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	DialogsPreferencesPagesSourceView * self;
	Block116Data* _data116_;
	AdwAvatar* avatar = NULL;
	ObjectsSource* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	AdwAvatar* _tmp3_;
	ObjectsSource* _tmp4_;
	SourceType _tmp5_;
	SourceType _tmp6_;
	GtkLabel* user_label = NULL;
	ObjectsSource* _tmp25_;
	const gchar* _tmp26_;
	const gchar* _tmp27_;
	gchar* _tmp28_;
	gchar** _tmp29_;
	GtkLabel* _tmp30_ = NULL;
	gboolean _tmp31_ = FALSE;
	ObjectsSource* _tmp32_;
	const gchar* _tmp33_;
	const gchar* _tmp34_;
	GtkLabel* email_label = NULL;
	ObjectsSource* _tmp38_;
	const gchar* _tmp39_;
	const gchar* _tmp40_;
	gchar* _tmp41_;
	gchar** _tmp42_;
	GtkLabel* _tmp43_ = NULL;
	GtkBox* user_box = NULL;
	GtkBox* _tmp44_ = NULL;
	GtkBox* _tmp45_;
	AdwAvatar* _tmp46_;
	GtkBox* _tmp47_;
	GtkLabel* _tmp48_;
	GtkBox* _tmp49_;
	GtkLabel* _tmp50_;
	ObjectsSource* _tmp51_;
	SourceType _tmp52_;
	SourceType _tmp53_;
	gchar* _tmp64_;
	ObjectsSource* _tmp65_;
	const gchar* _tmp66_;
	const gchar* _tmp67_;
	gchar* _tmp68_;
	AdwEntryRow* _tmp69_ = NULL;
	AdwSwitchRow* _tmp70_;
	AdwSwitchRow* _tmp71_;
	AdwSwitchRow* _tmp72_;
	AdwSwitchRow* _tmp73_;
	ObjectsSource* _tmp74_;
	gboolean _tmp75_;
	gboolean _tmp76_;
	GtkLabel* last_sync_label = NULL;
	ObjectsSource* _tmp77_;
	const gchar* _tmp78_;
	const gchar* _tmp79_;
	GTimeZone* _tmp80_;
	GTimeZone* _tmp81_;
	GDateTime* _tmp82_;
	GDateTime* _tmp83_;
	gchar* _tmp84_;
	gchar* _tmp85_;
	GtkLabel* _tmp86_;
	GtkLabel* _tmp87_;
	AdwActionRow* last_sync_row = NULL;
	AdwActionRow* _tmp88_;
	AdwActionRow* _tmp89_;
	AdwActionRow* _tmp90_;
	AdwActionRow* _tmp91_;
	GtkLabel* _tmp92_;
	AdwPreferencesGroup* default_group = NULL;
	AdwPreferencesGroup* _tmp93_ = NULL;
	AdwPreferencesGroup* _tmp94_;
	AdwEntryRow* _tmp95_;
	ObjectsSource* _tmp96_;
	SourceType _tmp97_;
	SourceType _tmp98_;
	AdwButtonRow* delete_button = NULL;
	gchar* _tmp103_;
	AdwButtonRow* _tmp104_ = NULL;
	AdwButtonRow* _tmp105_;
	AdwPreferencesGroup* delete_group = NULL;
	AdwPreferencesGroup* _tmp106_;
	AdwPreferencesGroup* _tmp107_;
	AdwButtonRow* _tmp108_;
	AdwSpinner* _tmp109_ = NULL;
	GtkStack* _tmp110_ = NULL;
	GtkStack* _tmp111_;
	AdwPreferencesGroup* _tmp112_;
	GtkStack* _tmp113_;
	AdwSpinner* _tmp114_;
	GtkBox* main_content = NULL;
	GtkBox* _tmp115_ = NULL;
	ObjectsSource* _tmp116_;
	SourceType _tmp117_;
	SourceType _tmp118_;
	GtkBox* _tmp121_;
	AdwPreferencesGroup* _tmp122_;
	ObjectsSource* _tmp123_;
	SourceType _tmp124_;
	SourceType _tmp125_;
	AdwClamp* content_clamp = NULL;
	GtkBox* _tmp128_;
	GtkWidget* _tmp129_;
	AdwClamp* _tmp130_ = NULL;
	AdwToolbarView* toolbar_view = NULL;
	AdwClamp* _tmp131_;
	GtkWidget* _tmp132_;
	AdwToolbarView* _tmp133_ = NULL;
	AdwToolbarView* _tmp134_;
	AdwHeaderBar* _tmp135_;
	AdwHeaderBar* _tmp136_;
	AdwToolbarView* _tmp137_;
	GeeHashMap* _tmp138_;
	AdwSwitchRow* _tmp139_;
	gulong _tmp140_;
	AdwSwitchRow* _tmp141_;
	GeeHashMap* _tmp142_;
	AdwEntryRow* _tmp143_;
	gulong _tmp144_;
	AdwEntryRow* _tmp145_;
	GeeHashMap* _tmp146_;
	AdwButtonRow* _tmp147_;
	gulong _tmp148_;
	AdwButtonRow* _tmp149_;
	GeeHashMap* _tmp150_;
	ObjectsSource* _tmp151_;
	gulong _tmp152_;
	ObjectsSource* _tmp153_;
	parent_class = G_OBJECT_CLASS (dialogs_preferences_pages_source_view_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DIALOGS_PREFERENCES_PAGES_TYPE_SOURCE_VIEW, DialogsPreferencesPagesSourceView);
	_data116_ = g_slice_new0 (Block116Data);
	_data116_->_ref_count_ = 1;
	_data116_->self = g_object_ref (self);
	_tmp0_ = self->priv->_source;
	_tmp1_ = objects_source_get_user_displayname (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = (AdwAvatar*) adw_avatar_new (84, _tmp2_, TRUE);
	g_object_ref_sink (_tmp3_);
	avatar = _tmp3_;
	_tmp4_ = self->priv->_source;
	_tmp5_ = objects_source_get_source_type (_tmp4_);
	_tmp6_ = _tmp5_;
	if (_tmp6_ == SOURCE_TYPE_TODOIST) {
		GFile* file = NULL;
		Util* _tmp7_;
		Util* _tmp8_;
		ObjectsSource* _tmp9_;
		const gchar* _tmp10_;
		const gchar* _tmp11_;
		gchar* _tmp12_;
		gchar* _tmp13_;
		GFile* _tmp14_;
		GFile* _tmp15_;
		GFile* _tmp16_;
		_tmp7_ = util_get_default ();
		_tmp8_ = _tmp7_;
		_tmp9_ = self->priv->_source;
		_tmp10_ = objects_source_get_avatar_path (_tmp9_);
		_tmp11_ = _tmp10_;
		_tmp12_ = util_get_avatar_path (_tmp8_, _tmp11_);
		_tmp13_ = _tmp12_;
		_tmp14_ = g_file_new_for_path (_tmp13_);
		_tmp15_ = _tmp14_;
		_g_free0 (_tmp13_);
		_g_object_unref0 (_tmp8_);
		file = _tmp15_;
		_tmp16_ = file;
		if (g_file_query_exists (_tmp16_, NULL)) {
			GtkImage* image = NULL;
			GFile* _tmp17_;
			gchar* _tmp18_;
			gchar* _tmp19_;
			GtkImage* _tmp20_;
			GtkImage* _tmp21_;
			AdwAvatar* _tmp22_;
			GtkImage* _tmp23_;
			GdkPaintable* _tmp24_;
			_tmp17_ = file;
			_tmp18_ = g_file_get_path (_tmp17_);
			_tmp19_ = _tmp18_;
			_tmp20_ = (GtkImage*) gtk_image_new_from_file (_tmp19_);
			g_object_ref_sink (_tmp20_);
			_tmp21_ = _tmp20_;
			_g_free0 (_tmp19_);
			image = _tmp21_;
			_tmp22_ = avatar;
			_tmp23_ = image;
			_tmp24_ = gtk_image_get_paintable (_tmp23_);
			adw_avatar_set_custom_image (_tmp22_, _tmp24_);
			_g_object_unref0 (image);
		}
		_g_object_unref0 (file);
	}
	_tmp25_ = self->priv->_source;
	_tmp26_ = objects_source_get_user_displayname (_tmp25_);
	_tmp27_ = _tmp26_;
	_tmp28_ = g_strdup ("title-1");
	_tmp29_ = g_new0 (gchar*, 1 + 1);
	_tmp29_[0] = _tmp28_;
	_tmp30_ = (GtkLabel*) gtk_label_new (_tmp27_);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp30_, 12);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp30_, _tmp29_);
	_tmp29_ = (_vala_array_free (_tmp29_, 1, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp30_);
	user_label = _tmp30_;
	_tmp32_ = self->priv->_source;
	_tmp33_ = objects_source_get_user_email (_tmp32_);
	_tmp34_ = _tmp33_;
	if (_tmp34_ != NULL) {
		ObjectsSource* _tmp35_;
		const gchar* _tmp36_;
		const gchar* _tmp37_;
		_tmp35_ = self->priv->_source;
		_tmp36_ = objects_source_get_user_email (_tmp35_);
		_tmp37_ = _tmp36_;
		_tmp31_ = g_strcmp0 (_tmp37_, "") != 0;
	} else {
		_tmp31_ = FALSE;
	}
	_tmp38_ = self->priv->_source;
	_tmp39_ = objects_source_get_user_email (_tmp38_);
	_tmp40_ = _tmp39_;
	_tmp41_ = g_strdup ("dimmed");
	_tmp42_ = g_new0 (gchar*, 1 + 1);
	_tmp42_[0] = _tmp41_;
	_tmp43_ = (GtkLabel*) gtk_label_new (_tmp40_);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp43_, _tmp42_);
	_tmp42_ = (_vala_array_free (_tmp42_, 1, (GDestroyNotify) g_free), NULL);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp43_, 6);
	gtk_widget_set_visible ((GtkWidget*) _tmp43_, _tmp31_);
	g_object_ref_sink (_tmp43_);
	email_label = _tmp43_;
	_tmp44_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp44_, 24);
	g_object_ref_sink (_tmp44_);
	user_box = _tmp44_;
	_tmp45_ = user_box;
	_tmp46_ = avatar;
	gtk_box_append (_tmp45_, (GtkWidget*) _tmp46_);
	_tmp47_ = user_box;
	_tmp48_ = user_label;
	gtk_box_append (_tmp47_, (GtkWidget*) _tmp48_);
	_tmp49_ = user_box;
	_tmp50_ = email_label;
	gtk_box_append (_tmp49_, (GtkWidget*) _tmp50_);
	_tmp51_ = self->priv->_source;
	_tmp52_ = objects_source_get_source_type (_tmp51_);
	_tmp53_ = _tmp52_;
	if (_tmp53_ == SOURCE_TYPE_CALDAV) {
		GtkLabel* url_label = NULL;
		ObjectsSource* _tmp54_;
		ObjectsSourceCalDAVData* _tmp55_;
		ObjectsSourceCalDAVData* _tmp56_;
		const gchar* _tmp57_;
		const gchar* _tmp58_;
		gchar* _tmp59_;
		gchar** _tmp60_;
		GtkLabel* _tmp61_ = NULL;
		GtkBox* _tmp62_;
		GtkLabel* _tmp63_;
		_tmp54_ = self->priv->_source;
		_tmp55_ = objects_source_get_caldav_data (_tmp54_);
		_tmp56_ = _tmp55_;
		_tmp57_ = objects_source_cal_dav_data_get_server_url (_tmp56_);
		_tmp58_ = _tmp57_;
		_tmp59_ = g_strdup ("dimmed");
		_tmp60_ = g_new0 (gchar*, 1 + 1);
		_tmp60_[0] = _tmp59_;
		_tmp61_ = (GtkLabel*) gtk_label_new (_tmp58_);
		gtk_widget_set_css_classes ((GtkWidget*) _tmp61_, _tmp60_);
		_tmp60_ = (_vala_array_free (_tmp60_, 1, (GDestroyNotify) g_free), NULL);
		g_object_ref_sink (_tmp61_);
		url_label = _tmp61_;
		_tmp62_ = user_box;
		_tmp63_ = url_label;
		gtk_box_append (_tmp62_, (GtkWidget*) _tmp63_);
		_g_object_unref0 (url_label);
	}
	_tmp64_ = g_strdup (_ ("Display Name"));
	_tmp65_ = self->priv->_source;
	_tmp66_ = objects_source_get_display_name (_tmp65_);
	_tmp67_ = _tmp66_;
	_tmp68_ = g_strdup (_tmp67_);
	_tmp69_ = (AdwEntryRow*) adw_entry_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp69_, _tmp64_);
	_g_free0 (_tmp64_);
	gtk_editable_set_text ((GtkEditable*) _tmp69_, _tmp68_);
	_g_free0 (_tmp68_);
	adw_entry_row_set_show_apply_button (_tmp69_, TRUE);
	g_object_ref_sink (_tmp69_);
	_data116_->display_entry = _tmp69_;
	_tmp70_ = (AdwSwitchRow*) adw_switch_row_new ();
	g_object_ref_sink (_tmp70_);
	_data116_->sync_server_row = _tmp70_;
	_tmp71_ = _data116_->sync_server_row;
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp71_, _ ("Sync Server"));
	_tmp72_ = _data116_->sync_server_row;
	adw_action_row_set_subtitle ((AdwActionRow*) _tmp72_, _ ("Activate this setting so that Planify automatically synchronizes with " \
"your account account every 15 minutes"));
	_tmp73_ = _data116_->sync_server_row;
	_tmp74_ = self->priv->_source;
	_tmp75_ = objects_source_get_sync_server (_tmp74_);
	_tmp76_ = _tmp75_;
	adw_switch_row_set_active (_tmp73_, _tmp76_);
	_tmp77_ = self->priv->_source;
	_tmp78_ = objects_source_get_last_sync (_tmp77_);
	_tmp79_ = _tmp78_;
	_tmp80_ = g_time_zone_new_local ();
	_tmp81_ = _tmp80_;
	_tmp82_ = g_date_time_new_from_iso8601 (_tmp79_, _tmp81_);
	_tmp83_ = _tmp82_;
	_tmp84_ = utils_datetime_get_relative_date_from_date (_tmp83_);
	_tmp85_ = _tmp84_;
	_tmp86_ = (GtkLabel*) gtk_label_new (_tmp85_);
	g_object_ref_sink (_tmp86_);
	_tmp87_ = _tmp86_;
	_g_free0 (_tmp85_);
	_g_date_time_unref0 (_tmp83_);
	_g_time_zone_unref0 (_tmp81_);
	last_sync_label = _tmp87_;
	_tmp88_ = (AdwActionRow*) adw_action_row_new ();
	g_object_ref_sink (_tmp88_);
	last_sync_row = _tmp88_;
	_tmp89_ = last_sync_row;
	gtk_list_box_row_set_activatable ((GtkListBoxRow*) _tmp89_, FALSE);
	_tmp90_ = last_sync_row;
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp90_, _ ("Last Sync"));
	_tmp91_ = last_sync_row;
	_tmp92_ = last_sync_label;
	adw_action_row_add_suffix (_tmp91_, (GtkWidget*) _tmp92_);
	_tmp93_ = (AdwPreferencesGroup*) adw_preferences_group_new ();
	gtk_widget_set_margin_top ((GtkWidget*) _tmp93_, 24);
	g_object_ref_sink (_tmp93_);
	default_group = _tmp93_;
	_tmp94_ = default_group;
	_tmp95_ = _data116_->display_entry;
	adw_preferences_group_add (_tmp94_, (GtkWidget*) _tmp95_);
	_tmp96_ = self->priv->_source;
	_tmp97_ = objects_source_get_source_type (_tmp96_);
	_tmp98_ = _tmp97_;
	if (_tmp98_ != SOURCE_TYPE_LOCAL) {
		AdwPreferencesGroup* _tmp99_;
		AdwSwitchRow* _tmp100_;
		AdwPreferencesGroup* _tmp101_;
		AdwActionRow* _tmp102_;
		_tmp99_ = default_group;
		_tmp100_ = _data116_->sync_server_row;
		adw_preferences_group_add (_tmp99_, (GtkWidget*) _tmp100_);
		_tmp101_ = default_group;
		_tmp102_ = last_sync_row;
		adw_preferences_group_add (_tmp101_, (GtkWidget*) _tmp102_);
	}
	_tmp103_ = g_strdup (_ ("Delete Source"));
	_tmp104_ = (AdwButtonRow*) adw_button_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp104_, _tmp103_);
	_g_free0 (_tmp103_);
	g_object_ref_sink (_tmp104_);
	delete_button = _tmp104_;
	_tmp105_ = delete_button;
	gtk_widget_add_css_class ((GtkWidget*) _tmp105_, "destructive-action");
	_tmp106_ = (AdwPreferencesGroup*) adw_preferences_group_new ();
	g_object_ref_sink (_tmp106_);
	delete_group = _tmp106_;
	_tmp107_ = delete_group;
	_tmp108_ = delete_button;
	adw_preferences_group_add (_tmp107_, (GtkWidget*) _tmp108_);
	_tmp109_ = (AdwSpinner*) adw_spinner_new ();
	gtk_widget_set_valign ((GtkWidget*) _tmp109_, GTK_ALIGN_CENTER);
	gtk_widget_set_halign ((GtkWidget*) _tmp109_, GTK_ALIGN_CENTER);
	g_object_set ((GtkWidget*) _tmp109_, "height-request", 32, NULL);
	g_object_set ((GtkWidget*) _tmp109_, "width-request", 32, NULL);
	g_object_ref_sink (_tmp109_);
	_data116_->delete_spinner = _tmp109_;
	_tmp110_ = (GtkStack*) gtk_stack_new ();
	gtk_widget_set_margin_top ((GtkWidget*) _tmp110_, 24);
	g_object_ref_sink (_tmp110_);
	_data116_->delete_stack = _tmp110_;
	_tmp111_ = _data116_->delete_stack;
	_tmp112_ = delete_group;
	gtk_stack_add_child (_tmp111_, (GtkWidget*) _tmp112_);
	_tmp113_ = _data116_->delete_stack;
	_tmp114_ = _data116_->delete_spinner;
	gtk_stack_add_child (_tmp113_, (GtkWidget*) _tmp114_);
	_tmp115_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp115_, TRUE);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp115_, TRUE);
	g_object_ref_sink (_tmp115_);
	main_content = _tmp115_;
	_tmp116_ = self->priv->_source;
	_tmp117_ = objects_source_get_source_type (_tmp116_);
	_tmp118_ = _tmp117_;
	if (_tmp118_ != SOURCE_TYPE_LOCAL) {
		GtkBox* _tmp119_;
		GtkBox* _tmp120_;
		_tmp119_ = main_content;
		_tmp120_ = user_box;
		gtk_box_append (_tmp119_, (GtkWidget*) _tmp120_);
	}
	_tmp121_ = main_content;
	_tmp122_ = default_group;
	gtk_box_append (_tmp121_, (GtkWidget*) _tmp122_);
	_tmp123_ = self->priv->_source;
	_tmp124_ = objects_source_get_source_type (_tmp123_);
	_tmp125_ = _tmp124_;
	if (_tmp125_ != SOURCE_TYPE_LOCAL) {
		GtkBox* _tmp126_;
		GtkStack* _tmp127_;
		_tmp126_ = main_content;
		_tmp127_ = _data116_->delete_stack;
		gtk_box_append (_tmp126_, (GtkWidget*) _tmp127_);
	}
	_tmp128_ = main_content;
	_tmp129_ = _g_object_ref0 ((GtkWidget*) _tmp128_);
	_tmp130_ = (AdwClamp*) adw_clamp_new ();
	adw_clamp_set_maximum_size (_tmp130_, 600);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp130_, 24);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp130_, 24);
	adw_clamp_set_child (_tmp130_, _tmp129_);
	_g_object_unref0 (_tmp129_);
	g_object_ref_sink (_tmp130_);
	content_clamp = _tmp130_;
	_tmp131_ = content_clamp;
	_tmp132_ = _g_object_ref0 ((GtkWidget*) _tmp131_);
	_tmp133_ = (AdwToolbarView*) adw_toolbar_view_new ();
	adw_toolbar_view_set_content (_tmp133_, _tmp132_);
	_g_object_unref0 (_tmp132_);
	g_object_ref_sink (_tmp133_);
	toolbar_view = _tmp133_;
	_tmp134_ = toolbar_view;
	_tmp135_ = (AdwHeaderBar*) adw_header_bar_new ();
	g_object_ref_sink (_tmp135_);
	_tmp136_ = _tmp135_;
	adw_toolbar_view_add_top_bar (_tmp134_, (GtkWidget*) _tmp136_);
	_g_object_unref0 (_tmp136_);
	_tmp137_ = toolbar_view;
	adw_navigation_page_set_child ((AdwNavigationPage*) self, (GtkWidget*) _tmp137_);
	_tmp138_ = ((DialogsPreferencesPagesBasePage*) self)->signal_map;
	_tmp139_ = _data116_->sync_server_row;
	_tmp140_ = g_signal_connect_data ((GObject*) _tmp139_, "notify::active", (GCallback) __dialogs_preferences_pages_source_view___lambda334__g_object_notify, block116_data_ref (_data116_), (GClosureNotify) block116_data_unref, 0);
	_tmp141_ = _data116_->sync_server_row;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp138_, (gpointer) ((guintptr) _tmp140_), (GObject*) _tmp141_);
	_tmp142_ = ((DialogsPreferencesPagesBasePage*) self)->signal_map;
	_tmp143_ = _data116_->display_entry;
	_tmp144_ = g_signal_connect_data (_tmp143_, "apply", (GCallback) __dialogs_preferences_pages_source_view___lambda335__adw_entry_row_apply, block116_data_ref (_data116_), (GClosureNotify) block116_data_unref, 0);
	_tmp145_ = _data116_->display_entry;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp142_, (gpointer) ((guintptr) _tmp144_), (GObject*) _tmp145_);
	_tmp146_ = ((DialogsPreferencesPagesBasePage*) self)->signal_map;
	_tmp147_ = delete_button;
	_tmp148_ = g_signal_connect_data (_tmp147_, "activated", (GCallback) __dialogs_preferences_pages_source_view___lambda336__adw_button_row_activated, block116_data_ref (_data116_), (GClosureNotify) block116_data_unref, 0);
	_tmp149_ = delete_button;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp146_, (gpointer) ((guintptr) _tmp148_), (GObject*) _tmp149_);
	_tmp150_ = ((DialogsPreferencesPagesBasePage*) self)->signal_map;
	_tmp151_ = self->priv->_source;
	_tmp152_ = g_signal_connect_object ((ObjectsBaseObject*) _tmp151_, "deleted", (GCallback) __dialogs_preferences_pages_source_view___lambda338__objects_base_object_deleted, self, 0);
	_tmp153_ = self->priv->_source;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp150_, (gpointer) ((guintptr) _tmp152_), (GObject*) _tmp153_);
	g_signal_connect_object ((GtkWidget*) self, "destroy", (GCallback) __dialogs_preferences_pages_source_view___lambda339__gtk_widget_destroy, self, 0);
	_g_object_unref0 (toolbar_view);
	_g_object_unref0 (content_clamp);
	_g_object_unref0 (main_content);
	_g_object_unref0 (delete_group);
	_g_object_unref0 (delete_button);
	_g_object_unref0 (default_group);
	_g_object_unref0 (last_sync_row);
	_g_object_unref0 (last_sync_label);
	_g_object_unref0 (user_box);
	_g_object_unref0 (email_label);
	_g_object_unref0 (user_label);
	_g_object_unref0 (avatar);
	block116_data_unref (_data116_);
	_data116_ = NULL;
	return obj;
}

static void
dialogs_preferences_pages_source_view_class_init (DialogsPreferencesPagesSourceViewClass * klass,
                                                  gpointer klass_data)
{
	dialogs_preferences_pages_source_view_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DialogsPreferencesPagesSourceView_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_dialogs_preferences_pages_source_view_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_dialogs_preferences_pages_source_view_set_property;
	G_OBJECT_CLASS (klass)->constructor = dialogs_preferences_pages_source_view_constructor;
	G_OBJECT_CLASS (klass)->finalize = dialogs_preferences_pages_source_view_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DIALOGS_PREFERENCES_PAGES_SOURCE_VIEW_SOURCE_PROPERTY, dialogs_preferences_pages_source_view_properties[DIALOGS_PREFERENCES_PAGES_SOURCE_VIEW_SOURCE_PROPERTY] = g_param_spec_object ("source", "source", "source", OBJECTS_TYPE_SOURCE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}

static void
dialogs_preferences_pages_source_view_instance_init (DialogsPreferencesPagesSourceView * self,
                                                     gpointer klass)
{
	self->priv = dialogs_preferences_pages_source_view_get_instance_private (self);
}

static void
dialogs_preferences_pages_source_view_finalize (GObject * obj)
{
	DialogsPreferencesPagesSourceView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DIALOGS_PREFERENCES_PAGES_TYPE_SOURCE_VIEW, DialogsPreferencesPagesSourceView);
	g_debug ("SourceView.vala:34: Destroying Dialogs.Preferences.Pages.SourceView\n");
	_g_object_unref0 (self->priv->_source);
	G_OBJECT_CLASS (dialogs_preferences_pages_source_view_parent_class)->finalize (obj);
}

static GType
dialogs_preferences_pages_source_view_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DialogsPreferencesPagesSourceViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dialogs_preferences_pages_source_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DialogsPreferencesPagesSourceView), 0, (GInstanceInitFunc) dialogs_preferences_pages_source_view_instance_init, NULL };
	GType dialogs_preferences_pages_source_view_type_id;
	dialogs_preferences_pages_source_view_type_id = g_type_register_static (DIALOGS_PREFERENCES_PAGES_TYPE_BASE_PAGE, "DialogsPreferencesPagesSourceView", &g_define_type_info, 0);
	DialogsPreferencesPagesSourceView_private_offset = g_type_add_instance_private (dialogs_preferences_pages_source_view_type_id, sizeof (DialogsPreferencesPagesSourceViewPrivate));
	return dialogs_preferences_pages_source_view_type_id;
}

GType
dialogs_preferences_pages_source_view_get_type (void)
{
	static volatile gsize dialogs_preferences_pages_source_view_type_id__once = 0;
	if (g_once_init_enter (&dialogs_preferences_pages_source_view_type_id__once)) {
		GType dialogs_preferences_pages_source_view_type_id;
		dialogs_preferences_pages_source_view_type_id = dialogs_preferences_pages_source_view_get_type_once ();
		g_once_init_leave (&dialogs_preferences_pages_source_view_type_id__once, dialogs_preferences_pages_source_view_type_id);
	}
	return dialogs_preferences_pages_source_view_type_id__once;
}

static void
_vala_dialogs_preferences_pages_source_view_get_property (GObject * object,
                                                          guint property_id,
                                                          GValue * value,
                                                          GParamSpec * pspec)
{
	DialogsPreferencesPagesSourceView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DIALOGS_PREFERENCES_PAGES_TYPE_SOURCE_VIEW, DialogsPreferencesPagesSourceView);
	switch (property_id) {
		case DIALOGS_PREFERENCES_PAGES_SOURCE_VIEW_SOURCE_PROPERTY:
		g_value_set_object (value, dialogs_preferences_pages_source_view_get_source (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_dialogs_preferences_pages_source_view_set_property (GObject * object,
                                                          guint property_id,
                                                          const GValue * value,
                                                          GParamSpec * pspec)
{
	DialogsPreferencesPagesSourceView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DIALOGS_PREFERENCES_PAGES_TYPE_SOURCE_VIEW, DialogsPreferencesPagesSourceView);
	switch (property_id) {
		case DIALOGS_PREFERENCES_PAGES_SOURCE_VIEW_SOURCE_PROPERTY:
		dialogs_preferences_pages_source_view_set_source (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

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

