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

/*
* Copyright 2020-2021 elementary, Inc. (https://elementary.io)
*
* 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
*
*/

#include "onlineaccounts.h"
#include <adwaita.h>
#include <gio/gio.h>
#include <granite-7.h>
#include <gtk/gtk.h>
#include <glib.h>
#include <libedataserver/libedataserver.h>
#include <glib/gi18n-lib.h>
#include <camel/camel.h>
#include <stdlib.h>
#include <string.h>
#include <float.h>
#include <math.h>
#include <glib-object.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

enum  {
	ONLINE_ACCOUNTS_IMAP_DIALOG_0_PROPERTY,
	ONLINE_ACCOUNTS_IMAP_DIALOG_NUM_PROPERTIES
};
static GParamSpec* online_accounts_imap_dialog_properties[ONLINE_ACCOUNTS_IMAP_DIALOG_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define __vala_ENamedParameters_free0(var) ((var == NULL) ? NULL : (var = (_vala_ENamedParameters_free (var), NULL)))
typedef struct _OnlineAccountsImapDialogLoadConfigurationData OnlineAccountsImapDialogLoadConfigurationData;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
typedef struct _OnlineAccountsImapDialogSaveConfigurationData OnlineAccountsImapDialogSaveConfigurationData;
typedef struct _Block6Data Block6Data;
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
typedef struct _Block7Data Block7Data;

struct _OnlineAccountsImapDialogPrivate {
	AdwNavigationPage* main_page;
	GCancellable* cancellable;
	GraniteValidatedEntry* imap_server_entry;
	GraniteValidatedEntry* imap_username_entry;
	GraniteValidatedEntry* smtp_server_entry;
	GtkButton* save_button;
	GtkCheckButton* use_imap_credentials;
	GtkCheckButton* smtp_no_credentials;
	GtkComboBoxText* imap_encryption_combobox;
	GtkComboBoxText* smtp_encryption_combobox;
	GtkEntry* smtp_password_entry;
	GtkEntry* smtp_username_entry;
	GtkRevealer* smtp_revealer;
	GtkSpinButton* imap_port_spin;
	GtkSpinButton* imap_refresh_interval_spin;
	GtkSpinButton* smtp_port_spin;
	OnlineAccountsImapLoginPage* login_page;
	guint cancel_timeout_id;
	ESourceRegistry* registry;
	ESource* source;
};

struct _OnlineAccountsImapDialogLoadConfigurationData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	OnlineAccountsImapDialog* self;
	ESource* account_source;
	GCancellable* cancellable;
	GError* _tmp0_;
	ESourceRegistry* _tmp1_;
	ESourceRegistry* _tmp2_;
	ESourceRegistry* _tmp3_;
	ESource* _tmp4_;
	ESourceCredentialsProvider* credentials_provider;
	ESourceRegistry* _tmp5_;
	ESourceCredentialsProvider* _tmp6_;
	ENamedParameters* account_credentials;
	ESourceCredentialsProvider* _tmp7_;
	ENamedParameters* _tmp8_;
	ENamedParameters* _tmp9_;
	OnlineAccountsImapLoginPage* _tmp10_;
	ENamedParameters* _tmp11_;
	const gchar* _tmp12_;
	ESourceMailAccount* account_extension;
	ESourceExtension* _tmp13_;
	ESourceMailAccount* _tmp14_;
	const gchar* _tmp15_;
	const gchar* _tmp16_;
	ESource* identity_source;
	ESourceRegistry* _tmp17_;
	ESourceMailAccount* _tmp18_;
	const gchar* _tmp19_;
	const gchar* _tmp20_;
	ESource* _tmp21_;
	ESource* _tmp22_;
	ESource* _tmp23_;
	ESourceMailIdentity* identity_extension;
	ESource* _tmp24_;
	ESourceExtension* _tmp25_;
	OnlineAccountsImapLoginPage* _tmp26_;
	ESourceMailIdentity* _tmp27_;
	const gchar* _tmp28_;
	const gchar* _tmp29_;
	OnlineAccountsImapLoginPage* _tmp30_;
	ESourceMailIdentity* _tmp31_;
	const gchar* _tmp32_;
	const gchar* _tmp33_;
	ESource* _tmp34_;
	ESourceMailSubmission* submission_extension;
	ESource* _tmp35_;
	ESourceExtension* _tmp36_;
	ESourceMailSubmission* _tmp37_;
	const gchar* _tmp38_;
	const gchar* _tmp39_;
	ESource* transport_source;
	ESourceRegistry* _tmp40_;
	ESourceMailSubmission* _tmp41_;
	const gchar* _tmp42_;
	const gchar* _tmp43_;
	ESource* _tmp44_;
	ESource* _tmp45_;
	ESource* _tmp46_;
	ESourceSecurity* transport_security_extension;
	ESource* _tmp47_;
	ESourceExtension* _tmp48_;
	GtkComboBoxText* _tmp49_;
	ESourceSecurity* _tmp50_;
	const gchar* _tmp51_;
	const gchar* _tmp52_;
	ESource* _tmp53_;
	ESourceAuthentication* transport_auth_extension;
	ESource* _tmp54_;
	ESourceExtension* _tmp55_;
	GtkEntry* _tmp56_;
	ESourceAuthentication* _tmp57_;
	const gchar* _tmp58_;
	const gchar* _tmp59_;
	GraniteValidatedEntry* _tmp60_;
	ESourceAuthentication* _tmp61_;
	const gchar* _tmp62_;
	const gchar* _tmp63_;
	GtkSpinButton* _tmp64_;
	ESourceAuthentication* _tmp65_;
	guint _tmp66_;
	guint _tmp67_;
	ENamedParameters* transport_credentials;
	ESourceCredentialsProvider* _tmp68_;
	ESource* _tmp69_;
	ENamedParameters* _tmp70_;
	ENamedParameters* _tmp71_;
	GtkCheckButton* _tmp72_;
	gboolean _tmp73_;
	ENamedParameters* _tmp74_;
	ENamedParameters* _tmp75_;
	const gchar* _tmp76_;
	ENamedParameters* _tmp77_;
	const gchar* _tmp78_;
	GtkCheckButton* _tmp79_;
	GtkCheckButton* _tmp80_;
	GtkEntry* _tmp81_;
	ENamedParameters* _tmp82_;
	const gchar* _tmp83_;
	ESourceSecurity* account_security_extension;
	ESourceExtension* _tmp84_;
	GtkComboBoxText* _tmp85_;
	ESourceSecurity* _tmp86_;
	const gchar* _tmp87_;
	const gchar* _tmp88_;
	ESourceAuthentication* account_auth_extension;
	ESourceExtension* _tmp89_;
	GraniteValidatedEntry* _tmp90_;
	ESourceAuthentication* _tmp91_;
	const gchar* _tmp92_;
	const gchar* _tmp93_;
	GraniteValidatedEntry* _tmp94_;
	ESourceAuthentication* _tmp95_;
	const gchar* _tmp96_;
	const gchar* _tmp97_;
	GtkSpinButton* _tmp98_;
	ESourceAuthentication* _tmp99_;
	guint _tmp100_;
	guint _tmp101_;
	ESourceRefresh* refresh_extension;
	ESourceExtension* _tmp102_;
	GtkSpinButton* _tmp103_;
	ESourceRefresh* _tmp104_;
	guint _tmp105_;
	guint _tmp106_;
	const gchar* _tmp107_;
	const gchar* _tmp108_;
	OnlineAccountsImapLoginPage* _tmp109_;
	const gchar* _tmp110_;
	const gchar* _tmp111_;
	GError* _inner_error0_;
};

struct _OnlineAccountsImapDialogSaveConfigurationData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	OnlineAccountsImapDialog* self;
	ESourceRegistry* _tmp0_;
	ESourceRegistry* _tmp1_;
	GCancellable* _tmp2_;
	ESourceRegistry* _tmp3_;
	ESourceRegistry* _tmp4_;
	GCancellable* _tmp5_;
	ESource* account_source;
	ESource* identity_source;
	ESource* transport_source;
	ESource* _tmp6_;
	ESource* _tmp7_;
	ESource* _tmp8_;
	ESource* _tmp9_;
	ESourceMailAccount* account_extension;
	ESource* _tmp10_;
	ESourceExtension* _tmp11_;
	ESourceMailAccount* _tmp12_;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	ESourceRegistry* _tmp15_;
	ESourceMailAccount* _tmp16_;
	const gchar* _tmp17_;
	const gchar* _tmp18_;
	ESource* _tmp19_;
	gboolean _tmp20_;
	ESource* _tmp21_;
	ESource* _tmp22_;
	ESourceMailSubmission* submission_extension;
	ESource* _tmp23_;
	ESourceExtension* _tmp24_;
	ESourceMailSubmission* _tmp25_;
	const gchar* _tmp26_;
	const gchar* _tmp27_;
	ESourceRegistry* _tmp28_;
	ESourceMailSubmission* _tmp29_;
	const gchar* _tmp30_;
	const gchar* _tmp31_;
	ESource* _tmp32_;
	ESource* _tmp33_;
	ESource* _tmp34_;
	gchar* _tmp35_;
	ESource* _tmp36_;
	ESource* _tmp37_;
	ESource* _tmp38_;
	ESource* _tmp39_;
	ESource* _tmp40_;
	const gchar* _tmp41_;
	const gchar* _tmp42_;
	gchar* _tmp43_;
	ESource* _tmp44_;
	ESource* _tmp45_;
	ESource* _tmp46_;
	ESource* _tmp47_;
	ESource* _tmp48_;
	const gchar* _tmp49_;
	const gchar* _tmp50_;
	gchar* _tmp51_;
	ESource* _tmp52_;
	ESource* _tmp53_;
	ESource* _tmp54_;
	ESource* _tmp55_;
	ESource* _tmp56_;
	OnlineAccountsImapLoginPage* _tmp57_;
	const gchar* _tmp58_;
	const gchar* _tmp59_;
	ESourceMailAccount* _vala1_account_extension;
	ESource* _tmp60_;
	ESourceExtension* _tmp61_;
	ESourceMailAccount* _tmp62_;
	ESource* _tmp63_;
	const gchar* _tmp64_;
	const gchar* _tmp65_;
	ESourceMailAccount* _tmp66_;
	ESourceMailAccount* _tmp67_;
	ESourceSecurity* account_security_extension;
	ESource* _tmp68_;
	ESourceExtension* _tmp69_;
	ESourceSecurity* _tmp70_;
	GtkComboBoxText* _tmp71_;
	const gchar* _tmp72_;
	const gchar* _tmp73_;
	ESourceAuthentication* account_auth_extension;
	ESource* _tmp74_;
	ESourceExtension* _tmp75_;
	ESourceAuthentication* _tmp76_;
	GraniteValidatedEntry* _tmp77_;
	const gchar* _tmp78_;
	const gchar* _tmp79_;
	ESourceAuthentication* _tmp80_;
	GtkSpinButton* _tmp81_;
	gdouble _tmp82_;
	gdouble _tmp83_;
	ESourceAuthentication* _tmp84_;
	GraniteValidatedEntry* _tmp85_;
	const gchar* _tmp86_;
	const gchar* _tmp87_;
	ESourceRefresh* refresh_extension;
	ESource* _tmp88_;
	ESourceExtension* _tmp89_;
	ESourceRefresh* _tmp90_;
	ESourceRefresh* _tmp91_;
	GtkSpinButton* _tmp92_;
	gdouble _tmp93_;
	gdouble _tmp94_;
	ESourceMailSubmission* _vala1_submission_extension;
	ESource* _tmp95_;
	ESourceExtension* _tmp96_;
	ESourceMailSubmission* _tmp97_;
	ESource* _tmp98_;
	const gchar* _tmp99_;
	const gchar* _tmp100_;
	ESourceMailIdentity* identity_extension;
	ESource* _tmp101_;
	ESourceExtension* _tmp102_;
	ESourceMailIdentity* _tmp103_;
	OnlineAccountsImapLoginPage* _tmp104_;
	const gchar* _tmp105_;
	const gchar* _tmp106_;
	ESourceMailIdentity* _tmp107_;
	OnlineAccountsImapLoginPage* _tmp108_;
	const gchar* _tmp109_;
	const gchar* _tmp110_;
	ESourceMailTransport* transport_extension;
	ESource* _tmp111_;
	ESourceExtension* _tmp112_;
	ESourceMailTransport* _tmp113_;
	ESourceSecurity* transport_security_extension;
	ESource* _tmp114_;
	ESourceExtension* _tmp115_;
	ESourceSecurity* _tmp116_;
	GtkComboBoxText* _tmp117_;
	const gchar* _tmp118_;
	const gchar* _tmp119_;
	ESourceAuthentication* transport_auth_extension;
	ESource* _tmp120_;
	ESourceExtension* _tmp121_;
	ESourceAuthentication* _tmp122_;
	GraniteValidatedEntry* _tmp123_;
	const gchar* _tmp124_;
	const gchar* _tmp125_;
	ESourceAuthentication* _tmp126_;
	GtkSpinButton* _tmp127_;
	gdouble _tmp128_;
	gdouble _tmp129_;
	GtkCheckButton* _tmp130_;
	gboolean _tmp131_;
	gboolean _tmp132_;
	ESourceAuthentication* _tmp133_;
	GraniteValidatedEntry* _tmp134_;
	const gchar* _tmp135_;
	const gchar* _tmp136_;
	ESourceAuthentication* _tmp137_;
	GtkEntry* _tmp138_;
	const gchar* _tmp139_;
	const gchar* _tmp140_;
	OnlineAccountsCamelSession* session;
	OnlineAccountsCamelSession* _tmp141_;
	CamelService* imap_service;
	OnlineAccountsCamelSession* _tmp142_;
	ESource* _tmp143_;
	const gchar* _tmp144_;
	const gchar* _tmp145_;
	ESourceMailAccount* _tmp146_;
	const gchar* _tmp147_;
	const gchar* _tmp148_;
	CamelService* _tmp149_;
	CamelService* _tmp150_;
	OnlineAccountsImapLoginPage* _tmp151_;
	const gchar* _tmp152_;
	const gchar* _tmp153_;
	ESource* _tmp154_;
	CamelService* _tmp155_;
	CamelService* _tmp156_;
	CamelService* _tmp157_;
	GCancellable* _tmp158_;
	GList* imap_auth_types;
	CamelService* _tmp159_;
	GCancellable* _tmp160_;
	GList* _tmp161_;
	GError* imap_auth_error;
	GList* _tmp162_;
	GList* imap_auth_type_collection;
	GList* imap_auth_type_it;
	CamelServiceAuthType* imap_auth_type;
	CamelServiceAuthType* _tmp163_;
	const gchar* _tmp164_;
	ESourceAuthentication* _tmp165_;
	CamelServiceAuthType* _tmp166_;
	const gchar* _tmp167_;
	ESource* _tmp168_;
	CamelService* _tmp169_;
	GCancellable* imap_auth_cancellable;
	GCancellable* _tmp170_;
	GCancellable* _tmp171_;
	CamelService* _tmp172_;
	CamelService* _tmp173_;
	GCancellable* _tmp174_;
	CamelService* _tmp175_;
	GCancellable* _tmp176_;
	CamelServiceAuthType* _tmp177_;
	const gchar* _tmp178_;
	GError* e;
	CamelServiceAuthType* _tmp179_;
	const gchar* _tmp180_;
	GError* _tmp181_;
	const gchar* _tmp182_;
	GError* _tmp183_;
	GError* _tmp184_;
	GError* _tmp185_;
	GError* _tmp186_;
	GError* _tmp187_;
	GError* _tmp188_;
	const gchar* _tmp189_;
	gchar* _tmp190_;
	gchar* _tmp191_;
	GError* _tmp192_;
	GError* _tmp193_;
	CamelService* _tmp194_;
	CamelStore* imap_store;
	CamelService* _tmp195_;
	CamelStore* _tmp196_;
	GHashTable* save_setup;
	CamelStore* _tmp197_;
	GCancellable* _tmp198_;
	GHashTable* _tmp199_;
	GHashTable* _tmp200_;
	gchar* encoded_account_uri;
	ESource* _tmp201_;
	const gchar* _tmp202_;
	const gchar* _tmp203_;
	gchar* _tmp204_;
	GHashTable* _tmp205_;
	GList* _tmp206_;
	GList* key_collection;
	GList* key_it;
	const gchar* key;
	gchar** keys;
	const gchar* _tmp207_;
	gchar** _tmp208_;
	gchar** _tmp209_;
	gint keys_length1;
	gint _keys_size_;
	gboolean _tmp210_;
	gchar** _tmp211_;
	gint _tmp211__length1;
	gchar** _tmp212_;
	gint _tmp212__length1;
	gchar** _tmp213_;
	gint _tmp213__length1;
	const gchar* _tmp214_;
	gchar* save_setup_source_type;
	gchar** _tmp215_;
	gint _tmp215__length1;
	const gchar* _tmp216_;
	gchar* _tmp217_;
	gchar* save_setup_extension_name;
	gchar** _tmp218_;
	gint _tmp218__length1;
	const gchar* _tmp219_;
	gchar* _tmp220_;
	gchar* save_setup_property_name;
	gchar** _tmp221_;
	gint _tmp221__length1;
	const gchar* _tmp222_;
	gchar* _tmp223_;
	gchar* save_setup_property_type;
	gchar** _tmp224_;
	gint _tmp224__length1;
	const gchar* _tmp225_;
	gchar* _tmp226_;
	gchar* save_setup_property_value;
	GHashTable* _tmp227_;
	const gchar* _tmp228_;
	gconstpointer _tmp229_;
	gchar* _tmp230_;
	const gchar* _tmp231_;
	const gchar* _tmp232_;
	GQuark _tmp234_;
	ESource* _tmp235_;
	const gchar* _tmp236_;
	const gchar* _tmp237_;
	const gchar* _tmp238_;
	const gchar* _tmp239_;
	const gchar* _tmp240_;
	ESource* _tmp241_;
	const gchar* _tmp242_;
	const gchar* _tmp243_;
	const gchar* _tmp244_;
	const gchar* _tmp245_;
	const gchar* _tmp246_;
	ESource* _tmp247_;
	const gchar* _tmp248_;
	const gchar* _tmp249_;
	const gchar* _tmp250_;
	const gchar* _tmp251_;
	const gchar* _tmp252_;
	ESource* _tmp253_;
	const gchar* _tmp254_;
	const gchar* _tmp255_;
	const gchar* _tmp256_;
	const gchar* _tmp257_;
	const gchar* _tmp258_;
	const gchar* _tmp259_;
	ESourceMailAccount* _tmp260_;
	GError* _vala1_e;
	GError* _tmp261_;
	const gchar* _tmp262_;
	GCancellable* _tmp263_;
	CamelService* transport_service;
	OnlineAccountsCamelSession* _tmp264_;
	ESource* _tmp265_;
	const gchar* _tmp266_;
	const gchar* _tmp267_;
	ESourceMailTransport* _tmp268_;
	const gchar* _tmp269_;
	const gchar* _tmp270_;
	CamelService* _tmp271_;
	ESource* _tmp272_;
	CamelService* _tmp273_;
	GtkCheckButton* _tmp274_;
	gboolean _tmp275_;
	gboolean _tmp276_;
	GtkCheckButton* _tmp277_;
	gboolean _tmp278_;
	gboolean _tmp279_;
	CamelService* _tmp280_;
	OnlineAccountsImapLoginPage* _tmp281_;
	const gchar* _tmp282_;
	const gchar* _tmp283_;
	CamelService* _tmp284_;
	GtkEntry* _tmp285_;
	const gchar* _tmp286_;
	const gchar* _tmp287_;
	CamelService* _tmp288_;
	CamelService* _tmp289_;
	GCancellable* _tmp290_;
	GList* smtp_auth_types;
	CamelService* _tmp291_;
	GCancellable* _tmp292_;
	GList* _tmp293_;
	GError* smtp_auth_error;
	GList* _tmp294_;
	GList* smtp_auth_type_collection;
	GList* smtp_auth_type_it;
	CamelServiceAuthType* smtp_auth_type;
	CamelServiceAuthType* _tmp295_;
	const gchar* _tmp296_;
	ESourceAuthentication* _tmp297_;
	CamelServiceAuthType* _tmp298_;
	const gchar* _tmp299_;
	ESource* _tmp300_;
	CamelService* _tmp301_;
	GCancellable* smtp_auth_cancellable;
	GCancellable* _tmp302_;
	GCancellable* _tmp303_;
	CamelService* _tmp304_;
	GCancellable* _tmp305_;
	CamelServiceAuthType* _tmp306_;
	const gchar* _tmp307_;
	GError* _vala2_e;
	CamelServiceAuthType* _tmp308_;
	const gchar* _tmp309_;
	GError* _tmp310_;
	const gchar* _tmp311_;
	GError* _tmp312_;
	GError* _tmp313_;
	GError* _tmp314_;
	GError* _tmp315_;
	GError* _tmp316_;
	GError* _tmp317_;
	const gchar* _tmp318_;
	gchar* _tmp319_;
	gchar* _tmp320_;
	GError* _tmp321_;
	GError* _tmp322_;
	GCancellable* _tmp323_;
	ESource* _tmp324_;
	OnlineAccountsImapLoginPage* _tmp325_;
	const gchar* _tmp326_;
	const gchar* _tmp327_;
	GCancellable* _tmp328_;
	GtkCheckButton* _tmp329_;
	gboolean _tmp330_;
	gboolean _tmp331_;
	ESource* _tmp332_;
	OnlineAccountsImapLoginPage* _tmp333_;
	const gchar* _tmp334_;
	const gchar* _tmp335_;
	GCancellable* _tmp336_;
	ESource* _tmp337_;
	GtkEntry* _tmp338_;
	const gchar* _tmp339_;
	const gchar* _tmp340_;
	GCancellable* _tmp341_;
	ESourceRegistry* _tmp342_;
	ESource* _tmp343_;
	GCancellable* _tmp344_;
	ESourceRegistry* _tmp345_;
	ESource* _tmp346_;
	GCancellable* _tmp347_;
	ESourceRegistry* _tmp348_;
	ESource* _tmp349_;
	GCancellable* _tmp350_;
	GError* _inner_error0_;
};

struct _Block6Data {
	int _ref_count_;
	OnlineAccountsImapDialog* self;
	GCancellable* cancellable;
};

struct _Block7Data {
	int _ref_count_;
	OnlineAccountsImapDialog* self;
	OnlineAccountsFinalizePage* finalize_page;
};

static gint OnlineAccountsImapDialog_private_offset;
static gpointer online_accounts_imap_dialog_parent_class = NULL;

static void online_accounts_imap_dialog_set_button_sensitivity (OnlineAccountsImapDialog* self);
static void online_accounts_imap_dialog_load_configuration_data_free (gpointer _data);
static gboolean online_accounts_imap_dialog_load_configuration_co (OnlineAccountsImapDialogLoadConfigurationData* _data_);
static void online_accounts_imap_dialog_load_configuration_ready (GObject* source_object,
                                                           GAsyncResult* _res_,
                                                           gpointer _user_data_);
static void _vala_ENamedParameters_free (ENamedParameters* self);
static void online_accounts_imap_dialog_save_configuration_data_free (gpointer _data);
static void online_accounts_imap_dialog_save_configuration (OnlineAccountsImapDialog* self,
                                                     GAsyncReadyCallback _callback_,
                                                     gpointer _user_data_);
static void online_accounts_imap_dialog_save_configuration_finish (OnlineAccountsImapDialog* self,
                                                            GAsyncResult* _res_,
                                                            GError** error);
static gboolean online_accounts_imap_dialog_save_configuration_co (OnlineAccountsImapDialogSaveConfigurationData* _data_);
static void online_accounts_imap_dialog_save_configuration_ready (GObject* source_object,
                                                           GAsyncResult* _res_,
                                                           gpointer _user_data_);
static void online_accounts_imap_dialog_set_cancel_timeout (OnlineAccountsImapDialog* self,
                                                     GCancellable* cancellable);
static void online_accounts_imap_dialog_unset_cancel_timeout (OnlineAccountsImapDialog* self);
static void online_accounts_imap_dialog_save_initial_setup_key_for_source (OnlineAccountsImapDialog* self,
                                                                    ESource* source,
                                                                    const gchar* extension_name,
                                                                    const gchar* property_name,
                                                                    const gchar* property_type,
                                                                    const gchar* val,
                                                                    const gchar* encoded_account_uri);
static Block6Data* block6_data_ref (Block6Data* _data6_);
static void block6_data_unref (void * _userdata_);
static gboolean __lambda28_ (Block6Data* _data6_);
static gboolean ___lambda28__gsource_func (gpointer self);
static GObject * online_accounts_imap_dialog_constructor (GType type,
                                                   guint n_construct_properties,
                                                   GObjectConstructParam * construct_properties);
static void _gtk_window_destroy_online_accounts_imap_login_page_cancel (OnlineAccountsImapLoginPage* _sender,
                                                                 gpointer self);
static void _online_accounts_imap_dialog___lambda29_ (OnlineAccountsImapDialog* self);
static void __online_accounts_imap_dialog___lambda29__adw_navigation_page_shown (AdwNavigationPage* _sender,
                                                                          gpointer self);
static void _online_accounts_imap_dialog___lambda30_ (OnlineAccountsImapDialog* self);
static void __online_accounts_imap_dialog___lambda30__online_accounts_imap_login_page_next (OnlineAccountsImapLoginPage* _sender,
                                                                                     gpointer self);
static void _online_accounts_imap_dialog___lambda31_ (OnlineAccountsImapDialog* self);
static void __online_accounts_imap_dialog___lambda31__adw_navigation_page_shown (AdwNavigationPage* _sender,
                                                                          gpointer self);
static void _online_accounts_imap_dialog___lambda32_ (OnlineAccountsImapDialog* self);
static void __online_accounts_imap_dialog___lambda32__gtk_button_clicked (GtkButton* _sender,
                                                                   gpointer self);
static void _online_accounts_imap_dialog___lambda33_ (OnlineAccountsImapDialog* self);
static void __online_accounts_imap_dialog___lambda33__g_object_notify (GObject* _sender,
                                                                GParamSpec* pspec,
                                                                gpointer self);
static void _online_accounts_imap_dialog___lambda34_ (OnlineAccountsImapDialog* self);
static void __online_accounts_imap_dialog___lambda34__g_object_notify (GObject* _sender,
                                                                GParamSpec* pspec,
                                                                gpointer self);
static void _online_accounts_imap_dialog___lambda35_ (OnlineAccountsImapDialog* self);
static void __online_accounts_imap_dialog___lambda35__gtk_editable_changed (GtkEditable* _sender,
                                                                     gpointer self);
static void _online_accounts_imap_dialog___lambda36_ (OnlineAccountsImapDialog* self);
static void __online_accounts_imap_dialog___lambda36__gtk_editable_changed (GtkEditable* _sender,
                                                                     gpointer self);
static void _online_accounts_imap_dialog___lambda37_ (OnlineAccountsImapDialog* self);
static void __online_accounts_imap_dialog___lambda37__gtk_combo_box_changed (GtkComboBox* _sender,
                                                                      gpointer self);
static void _online_accounts_imap_dialog___lambda38_ (OnlineAccountsImapDialog* self);
static void __online_accounts_imap_dialog___lambda38__gtk_editable_changed (GtkEditable* _sender,
                                                                     gpointer self);
static void _online_accounts_imap_dialog___lambda39_ (OnlineAccountsImapDialog* self);
static void __online_accounts_imap_dialog___lambda39__gtk_combo_box_changed (GtkComboBox* _sender,
                                                                      gpointer self);
static void _online_accounts_imap_dialog___lambda40_ (OnlineAccountsImapDialog* self);
static Block7Data* block7_data_ref (Block7Data* _data7_);
static void block7_data_unref (void * _userdata_);
static void __lambda41_ (Block7Data* _data7_,
                  GObject* obj,
                  GAsyncResult* res);
static void ___lambda41__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static void __online_accounts_imap_dialog___lambda40__gtk_button_clicked (GtkButton* _sender,
                                                                   gpointer self);
static void _online_accounts_imap_dialog___lambda42_ (OnlineAccountsImapDialog* self,
                                               guint keyval);
static void __online_accounts_imap_dialog___lambda42__gtk_event_controller_key_key_released (GtkEventControllerKey* _sender,
                                                                                      guint keyval,
                                                                                      guint keycode,
                                                                                      GdkModifierType state,
                                                                                      gpointer self);
static void online_accounts_imap_dialog_finalize (GObject * obj);
static GType online_accounts_imap_dialog_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);

static inline gpointer
online_accounts_imap_dialog_get_instance_private (OnlineAccountsImapDialog* self)
{
	return G_STRUCT_MEMBER_P (self, OnlineAccountsImapDialog_private_offset);
}

static void
online_accounts_imap_dialog_set_button_sensitivity (OnlineAccountsImapDialog* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GraniteValidatedEntry* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	GtkButton* _tmp11_;
	g_return_if_fail (self != NULL);
	_tmp2_ = self->priv->imap_username_entry;
	_tmp3_ = granite_validated_entry_get_is_valid (_tmp2_);
	_tmp4_ = _tmp3_;
	if (_tmp4_) {
		GraniteValidatedEntry* _tmp5_;
		gboolean _tmp6_;
		gboolean _tmp7_;
		_tmp5_ = self->priv->imap_server_entry;
		_tmp6_ = granite_validated_entry_get_is_valid (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp1_ = _tmp7_;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		GraniteValidatedEntry* _tmp8_;
		gboolean _tmp9_;
		gboolean _tmp10_;
		_tmp8_ = self->priv->smtp_server_entry;
		_tmp9_ = granite_validated_entry_get_is_valid (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp0_ = _tmp10_;
	} else {
		_tmp0_ = FALSE;
	}
	_tmp11_ = self->priv->save_button;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp11_, _tmp0_);
}

static void
online_accounts_imap_dialog_load_configuration_data_free (gpointer _data)
{
	OnlineAccountsImapDialogLoadConfigurationData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->account_source);
	_g_object_unref0 (_data_->cancellable);
	_g_object_unref0 (_data_->self);
	g_slice_free (OnlineAccountsImapDialogLoadConfigurationData, _data_);
}

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

void
online_accounts_imap_dialog_load_configuration (OnlineAccountsImapDialog* self,
                                                ESource* account_source,
                                                GCancellable* cancellable,
                                                GAsyncReadyCallback _callback_,
                                                gpointer _user_data_)
{
	OnlineAccountsImapDialogLoadConfigurationData* _data_;
	OnlineAccountsImapDialog* _tmp0_;
	ESource* _tmp1_;
	GCancellable* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account_source != NULL);
	_data_ = g_slice_new0 (OnlineAccountsImapDialogLoadConfigurationData);
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, online_accounts_imap_dialog_load_configuration_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (account_source);
	_g_object_unref0 (_data_->account_source);
	_data_->account_source = _tmp1_;
	_tmp2_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (_data_->cancellable);
	_data_->cancellable = _tmp2_;
	online_accounts_imap_dialog_load_configuration_co (_data_);
}

void
online_accounts_imap_dialog_load_configuration_finish (OnlineAccountsImapDialog* self,
                                                       GAsyncResult* _res_,
                                                       GError** error)
{
	OnlineAccountsImapDialogLoadConfigurationData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
online_accounts_imap_dialog_load_configuration_ready (GObject* source_object,
                                                      GAsyncResult* _res_,
                                                      gpointer _user_data_)
{
	OnlineAccountsImapDialogLoadConfigurationData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	online_accounts_imap_dialog_load_configuration_co (_data_);
}

static void
_vala_ENamedParameters_free (ENamedParameters* self)
{
	g_boxed_free (e_named_parameters_get_type (), self);
}

static gboolean
online_accounts_imap_dialog_load_configuration_co (OnlineAccountsImapDialogLoadConfigurationData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (!e_source_has_extension (_data_->account_source, E_SOURCE_EXTENSION_MAIL_ACCOUNT)) {
		_data_->_tmp0_ = g_error_new_literal (CAMEL_ERROR, CAMEL_ERROR_GENERIC, _ ("The data provided does not seem to reflect a valid mail account."));
		_data_->_inner_error0_ = _data_->_tmp0_;
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_state_ = 1;
	e_source_registry_new (_data_->cancellable, online_accounts_imap_dialog_load_configuration_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp2_ = e_source_registry_new_finish (_data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp1_ = _data_->_tmp2_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp3_ = _data_->_tmp1_;
	_data_->_tmp1_ = NULL;
	_g_object_unref0 (_data_->self->priv->registry);
	_data_->self->priv->registry = _data_->_tmp3_;
	if (g_cancellable_is_cancelled (_data_->cancellable)) {
		_g_object_unref0 (_data_->_tmp1_);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp4_ = _g_object_ref0 (_data_->account_source);
	_g_object_unref0 (_data_->self->priv->source);
	_data_->self->priv->source = _data_->_tmp4_;
	_data_->_tmp5_ = _data_->self->priv->registry;
	_data_->_tmp6_ = e_source_credentials_provider_new (_data_->_tmp5_);
	_data_->credentials_provider = _data_->_tmp6_;
	_data_->_tmp7_ = _data_->credentials_provider;
	_data_->_tmp8_ = NULL;
	e_source_credentials_provider_lookup_sync (_data_->_tmp7_, _data_->account_source, NULL, &_data_->_tmp8_, &_data_->_inner_error0_);
	__vala_ENamedParameters_free0 (_data_->account_credentials);
	_data_->account_credentials = _data_->_tmp8_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		__vala_ENamedParameters_free0 (_data_->account_credentials);
		_g_object_unref0 (_data_->credentials_provider);
		_g_object_unref0 (_data_->_tmp1_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp9_ = _data_->account_credentials;
	if (_data_->_tmp9_ != NULL) {
		_data_->_tmp10_ = _data_->self->priv->login_page;
		_data_->_tmp11_ = _data_->account_credentials;
		_data_->_tmp12_ = e_named_parameters_get (_data_->_tmp11_, E_SOURCE_CREDENTIAL_PASSWORD);
		online_accounts_imap_login_page_set_password (_data_->_tmp10_, _data_->_tmp12_);
	}
	_data_->_tmp13_ = e_source_get_extension (_data_->account_source, E_SOURCE_EXTENSION_MAIL_ACCOUNT);
	_data_->account_extension = G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp13_, e_source_mail_account_get_type (), ESourceMailAccount);
	_data_->_tmp14_ = _data_->account_extension;
	_data_->_tmp15_ = e_source_mail_account_get_identity_uid (_data_->_tmp14_);
	_data_->_tmp16_ = _data_->_tmp15_;
	if (g_strcmp0 (_data_->_tmp16_, "") != 0) {
		_data_->_tmp17_ = _data_->self->priv->registry;
		_data_->_tmp18_ = _data_->account_extension;
		_data_->_tmp19_ = e_source_mail_account_get_identity_uid (_data_->_tmp18_);
		_data_->_tmp20_ = _data_->_tmp19_;
		_data_->_tmp21_ = e_source_registry_ref_source (_data_->_tmp17_, _data_->_tmp20_);
		_data_->identity_source = _data_->_tmp21_;
		_data_->_tmp22_ = _data_->identity_source;
		if (_data_->_tmp22_ != NULL) {
			_data_->_tmp23_ = _data_->identity_source;
			if (e_source_has_extension (_data_->_tmp23_, E_SOURCE_EXTENSION_MAIL_IDENTITY)) {
				_data_->_tmp24_ = _data_->identity_source;
				_data_->_tmp25_ = e_source_get_extension (_data_->_tmp24_, E_SOURCE_EXTENSION_MAIL_IDENTITY);
				_data_->identity_extension = G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp25_, e_source_mail_identity_get_type (), ESourceMailIdentity);
				_data_->_tmp26_ = _data_->self->priv->login_page;
				_data_->_tmp27_ = _data_->identity_extension;
				_data_->_tmp28_ = e_source_mail_identity_get_address (_data_->_tmp27_);
				_data_->_tmp29_ = _data_->_tmp28_;
				online_accounts_imap_login_page_set_email (_data_->_tmp26_, _data_->_tmp29_);
				_data_->_tmp30_ = _data_->self->priv->login_page;
				_data_->_tmp31_ = _data_->identity_extension;
				_data_->_tmp32_ = e_source_mail_identity_get_name (_data_->_tmp31_);
				_data_->_tmp33_ = _data_->_tmp32_;
				online_accounts_imap_login_page_set_real_name (_data_->_tmp30_, _data_->_tmp33_);
			}
			_data_->_tmp34_ = _data_->identity_source;
			if (e_source_has_extension (_data_->_tmp34_, E_SOURCE_EXTENSION_MAIL_SUBMISSION)) {
				_data_->_tmp35_ = _data_->identity_source;
				_data_->_tmp36_ = e_source_get_extension (_data_->_tmp35_, E_SOURCE_EXTENSION_MAIL_SUBMISSION);
				_data_->submission_extension = G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp36_, e_source_mail_submission_get_type (), ESourceMailSubmission);
				_data_->_tmp37_ = _data_->submission_extension;
				_data_->_tmp38_ = e_source_mail_submission_get_transport_uid (_data_->_tmp37_);
				_data_->_tmp39_ = _data_->_tmp38_;
				if (_data_->_tmp39_ != NULL) {
					_data_->_tmp40_ = _data_->self->priv->registry;
					_data_->_tmp41_ = _data_->submission_extension;
					_data_->_tmp42_ = e_source_mail_submission_get_transport_uid (_data_->_tmp41_);
					_data_->_tmp43_ = _data_->_tmp42_;
					_data_->_tmp44_ = e_source_registry_ref_source (_data_->_tmp40_, _data_->_tmp43_);
					_data_->transport_source = _data_->_tmp44_;
					_data_->_tmp45_ = _data_->transport_source;
					if (_data_->_tmp45_ != NULL) {
						_data_->_tmp46_ = _data_->transport_source;
						if (e_source_has_extension (_data_->_tmp46_, E_SOURCE_EXTENSION_SECURITY)) {
							_data_->_tmp47_ = _data_->transport_source;
							_data_->_tmp48_ = e_source_get_extension (_data_->_tmp47_, E_SOURCE_EXTENSION_SECURITY);
							_data_->transport_security_extension = G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp48_, e_source_security_get_type (), ESourceSecurity);
							_data_->_tmp49_ = _data_->self->priv->smtp_encryption_combobox;
							_data_->_tmp50_ = _data_->transport_security_extension;
							_data_->_tmp51_ = e_source_security_get_method (_data_->_tmp50_);
							_data_->_tmp52_ = _data_->_tmp51_;
							gtk_combo_box_set_active_id ((GtkComboBox*) _data_->_tmp49_, _data_->_tmp52_);
						}
						_data_->_tmp53_ = _data_->transport_source;
						if (e_source_has_extension (_data_->_tmp53_, E_SOURCE_EXTENSION_AUTHENTICATION)) {
							_data_->_tmp54_ = _data_->transport_source;
							_data_->_tmp55_ = e_source_get_extension (_data_->_tmp54_, E_SOURCE_EXTENSION_AUTHENTICATION);
							_data_->transport_auth_extension = G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp55_, e_source_authentication_get_type (), ESourceAuthentication);
							_data_->_tmp56_ = _data_->self->priv->smtp_username_entry;
							_data_->_tmp57_ = _data_->transport_auth_extension;
							_data_->_tmp58_ = e_source_authentication_get_user (_data_->_tmp57_);
							_data_->_tmp59_ = _data_->_tmp58_;
							gtk_editable_set_text ((GtkEditable*) _data_->_tmp56_, _data_->_tmp59_);
							_data_->_tmp60_ = _data_->self->priv->smtp_server_entry;
							_data_->_tmp61_ = _data_->transport_auth_extension;
							_data_->_tmp62_ = e_source_authentication_get_host (_data_->_tmp61_);
							_data_->_tmp63_ = _data_->_tmp62_;
							gtk_editable_set_text ((GtkEditable*) _data_->_tmp60_, _data_->_tmp63_);
							_data_->_tmp64_ = _data_->self->priv->smtp_port_spin;
							_data_->_tmp65_ = _data_->transport_auth_extension;
							_data_->_tmp66_ = e_source_authentication_get_port (_data_->_tmp65_);
							_data_->_tmp67_ = _data_->_tmp66_;
							gtk_spin_button_set_value (_data_->_tmp64_, (gdouble) _data_->_tmp67_);
						}
						_data_->_tmp68_ = _data_->credentials_provider;
						_data_->_tmp69_ = _data_->transport_source;
						_data_->_tmp70_ = NULL;
						e_source_credentials_provider_lookup_sync (_data_->_tmp68_, _data_->_tmp69_, NULL, &_data_->_tmp70_, &_data_->_inner_error0_);
						__vala_ENamedParameters_free0 (_data_->transport_credentials);
						_data_->transport_credentials = _data_->_tmp70_;
						if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
							g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
							__vala_ENamedParameters_free0 (_data_->transport_credentials);
							_g_object_unref0 (_data_->transport_source);
							_g_object_unref0 (_data_->identity_source);
							__vala_ENamedParameters_free0 (_data_->account_credentials);
							_g_object_unref0 (_data_->credentials_provider);
							_g_object_unref0 (_data_->_tmp1_);
							g_object_unref (_data_->_async_result);
							return FALSE;
						}
						_data_->_tmp71_ = _data_->transport_credentials;
						if (_data_->_tmp71_ == NULL) {
							_data_->_tmp72_ = _data_->self->priv->smtp_no_credentials;
							gtk_check_button_set_active (_data_->_tmp72_, TRUE);
						} else {
							_data_->_tmp74_ = _data_->account_credentials;
							if (_data_->_tmp74_ != NULL) {
								_data_->_tmp75_ = _data_->account_credentials;
								_data_->_tmp76_ = e_named_parameters_get (_data_->_tmp75_, E_SOURCE_CREDENTIAL_PASSWORD);
								_data_->_tmp77_ = _data_->transport_credentials;
								_data_->_tmp78_ = e_named_parameters_get (_data_->_tmp77_, E_SOURCE_CREDENTIAL_PASSWORD);
								_data_->_tmp73_ = g_strcmp0 (_data_->_tmp76_, _data_->_tmp78_) == 0;
							} else {
								_data_->_tmp73_ = FALSE;
							}
							if (_data_->_tmp73_) {
								_data_->_tmp79_ = _data_->self->priv->use_imap_credentials;
								gtk_check_button_set_active (_data_->_tmp79_, TRUE);
							} else {
								_data_->_tmp80_ = _data_->self->priv->use_imap_credentials;
								gtk_check_button_set_active (_data_->_tmp80_, FALSE);
								_data_->_tmp81_ = _data_->self->priv->smtp_password_entry;
								_data_->_tmp82_ = _data_->transport_credentials;
								_data_->_tmp83_ = e_named_parameters_get (_data_->_tmp82_, E_SOURCE_CREDENTIAL_PASSWORD);
								gtk_editable_set_text ((GtkEditable*) _data_->_tmp81_, _data_->_tmp83_);
							}
						}
						__vala_ENamedParameters_free0 (_data_->transport_credentials);
					}
					_g_object_unref0 (_data_->transport_source);
				}
			}
		}
		_g_object_unref0 (_data_->identity_source);
	}
	if (e_source_has_extension (_data_->account_source, E_SOURCE_EXTENSION_SECURITY)) {
		_data_->_tmp84_ = e_source_get_extension (_data_->account_source, E_SOURCE_EXTENSION_SECURITY);
		_data_->account_security_extension = G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp84_, e_source_security_get_type (), ESourceSecurity);
		_data_->_tmp85_ = _data_->self->priv->imap_encryption_combobox;
		_data_->_tmp86_ = _data_->account_security_extension;
		_data_->_tmp87_ = e_source_security_get_method (_data_->_tmp86_);
		_data_->_tmp88_ = _data_->_tmp87_;
		gtk_combo_box_set_active_id ((GtkComboBox*) _data_->_tmp85_, _data_->_tmp88_);
	}
	if (e_source_has_extension (_data_->account_source, E_SOURCE_EXTENSION_AUTHENTICATION)) {
		_data_->_tmp89_ = e_source_get_extension (_data_->account_source, E_SOURCE_EXTENSION_AUTHENTICATION);
		_data_->account_auth_extension = G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp89_, e_source_authentication_get_type (), ESourceAuthentication);
		_data_->_tmp90_ = _data_->self->priv->imap_username_entry;
		_data_->_tmp91_ = _data_->account_auth_extension;
		_data_->_tmp92_ = e_source_authentication_get_user (_data_->_tmp91_);
		_data_->_tmp93_ = _data_->_tmp92_;
		gtk_editable_set_text ((GtkEditable*) _data_->_tmp90_, _data_->_tmp93_);
		_data_->_tmp94_ = _data_->self->priv->imap_server_entry;
		_data_->_tmp95_ = _data_->account_auth_extension;
		_data_->_tmp96_ = e_source_authentication_get_host (_data_->_tmp95_);
		_data_->_tmp97_ = _data_->_tmp96_;
		gtk_editable_set_text ((GtkEditable*) _data_->_tmp94_, _data_->_tmp97_);
		_data_->_tmp98_ = _data_->self->priv->imap_port_spin;
		_data_->_tmp99_ = _data_->account_auth_extension;
		_data_->_tmp100_ = e_source_authentication_get_port (_data_->_tmp99_);
		_data_->_tmp101_ = _data_->_tmp100_;
		gtk_spin_button_set_value (_data_->_tmp98_, (gdouble) _data_->_tmp101_);
	}
	if (e_source_has_extension (_data_->account_source, E_SOURCE_EXTENSION_REFRESH)) {
		_data_->_tmp102_ = e_source_get_extension (_data_->account_source, E_SOURCE_EXTENSION_REFRESH);
		_data_->refresh_extension = G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp102_, e_source_refresh_get_type (), ESourceRefresh);
		_data_->_tmp103_ = _data_->self->priv->imap_refresh_interval_spin;
		_data_->_tmp104_ = _data_->refresh_extension;
		_data_->_tmp105_ = e_source_refresh_get_interval_minutes (_data_->_tmp104_);
		_data_->_tmp106_ = _data_->_tmp105_;
		gtk_spin_button_set_value (_data_->_tmp103_, (gdouble) _data_->_tmp106_);
	}
	_data_->_tmp107_ = e_source_get_display_name (_data_->account_source);
	_data_->_tmp108_ = _data_->_tmp107_;
	if (g_strcmp0 (_data_->_tmp108_, "") != 0) {
		_data_->_tmp109_ = _data_->self->priv->login_page;
		_data_->_tmp110_ = e_source_get_display_name (_data_->account_source);
		_data_->_tmp111_ = _data_->_tmp110_;
		online_accounts_imap_login_page_set_display_name (_data_->_tmp109_, _data_->_tmp111_);
	}
	__vala_ENamedParameters_free0 (_data_->account_credentials);
	_g_object_unref0 (_data_->credentials_provider);
	_g_object_unref0 (_data_->_tmp1_);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

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

static void
online_accounts_imap_dialog_save_configuration (OnlineAccountsImapDialog* self,
                                                GAsyncReadyCallback _callback_,
                                                gpointer _user_data_)
{
	OnlineAccountsImapDialogSaveConfigurationData* _data_;
	OnlineAccountsImapDialog* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (OnlineAccountsImapDialogSaveConfigurationData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, online_accounts_imap_dialog_save_configuration_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	online_accounts_imap_dialog_save_configuration_co (_data_);
}

static void
online_accounts_imap_dialog_save_configuration_finish (OnlineAccountsImapDialog* self,
                                                       GAsyncResult* _res_,
                                                       GError** error)
{
	OnlineAccountsImapDialogSaveConfigurationData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
online_accounts_imap_dialog_save_configuration_ready (GObject* source_object,
                                                      GAsyncResult* _res_,
                                                      gpointer _user_data_)
{
	OnlineAccountsImapDialogSaveConfigurationData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	online_accounts_imap_dialog_save_configuration_co (_data_);
}

static gpointer
_g_error_copy0 (gpointer self)
{
	return self ? g_error_copy (self) : NULL;
}

static gboolean
online_accounts_imap_dialog_save_configuration_co (OnlineAccountsImapDialogSaveConfigurationData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		case 4:
		goto _state_4;
		case 5:
		goto _state_5;
		case 6:
		goto _state_6;
		case 7:
		goto _state_7;
		case 8:
		goto _state_8;
		case 9:
		goto _state_9;
		case 10:
		goto _state_10;
		case 11:
		goto _state_11;
		case 12:
		goto _state_12;
		case 13:
		goto _state_13;
		case 14:
		goto _state_14;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->registry;
	if (_data_->_tmp0_ == NULL) {
		_data_->_tmp2_ = _data_->self->priv->cancellable;
		_data_->_state_ = 1;
		e_source_registry_new (_data_->_tmp2_, online_accounts_imap_dialog_save_configuration_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp3_ = e_source_registry_new_finish (_data_->_res_, &_data_->_inner_error0_);
		_data_->_tmp1_ = _data_->_tmp3_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp4_ = _data_->_tmp1_;
		_data_->_tmp1_ = NULL;
		_g_object_unref0 (_data_->self->priv->registry);
		_data_->self->priv->registry = _data_->_tmp4_;
		_g_object_unref0 (_data_->_tmp1_);
	}
	_data_->_tmp5_ = _data_->self->priv->cancellable;
	if (g_cancellable_is_cancelled (_data_->_tmp5_)) {
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->account_source = NULL;
	_data_->identity_source = NULL;
	_data_->transport_source = NULL;
	_data_->_tmp6_ = _data_->self->priv->source;
	if (_data_->_tmp6_ != NULL) {
		_data_->_tmp7_ = _data_->self->priv->source;
		_data_->_tmp8_ = _g_object_ref0 (_data_->_tmp7_);
		_g_object_unref0 (_data_->account_source);
		_data_->account_source = _data_->_tmp8_;
		_data_->_tmp9_ = _data_->account_source;
		if (!e_source_has_extension (_data_->_tmp9_, E_SOURCE_EXTENSION_MAIL_ACCOUNT)) {
			_data_->_tmp10_ = _data_->account_source;
			_data_->_tmp11_ = e_source_get_extension (_data_->_tmp10_, E_SOURCE_EXTENSION_MAIL_ACCOUNT);
			_data_->account_extension = G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp11_, e_source_mail_account_get_type (), ESourceMailAccount);
			_data_->_tmp12_ = _data_->account_extension;
			_data_->_tmp13_ = e_source_mail_account_get_identity_uid (_data_->_tmp12_);
			_data_->_tmp14_ = _data_->_tmp13_;
			if (g_strcmp0 (_data_->_tmp14_, "") != 0) {
				_data_->_tmp15_ = _data_->self->priv->registry;
				_data_->_tmp16_ = _data_->account_extension;
				_data_->_tmp17_ = e_source_mail_account_get_identity_uid (_data_->_tmp16_);
				_data_->_tmp18_ = _data_->_tmp17_;
				_data_->_tmp19_ = e_source_registry_ref_source (_data_->_tmp15_, _data_->_tmp18_);
				_g_object_unref0 (_data_->identity_source);
				_data_->identity_source = _data_->_tmp19_;
				_data_->_tmp21_ = _data_->identity_source;
				if (_data_->_tmp21_ != NULL) {
					_data_->_tmp22_ = _data_->identity_source;
					_data_->_tmp20_ = e_source_has_extension (_data_->_tmp22_, E_SOURCE_EXTENSION_MAIL_SUBMISSION);
				} else {
					_data_->_tmp20_ = FALSE;
				}
				if (_data_->_tmp20_) {
					_data_->_tmp23_ = _data_->identity_source;
					_data_->_tmp24_ = e_source_get_extension (_data_->_tmp23_, E_SOURCE_EXTENSION_MAIL_SUBMISSION);
					_data_->submission_extension = G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp24_, e_source_mail_submission_get_type (), ESourceMailSubmission);
					_data_->_tmp25_ = _data_->submission_extension;
					_data_->_tmp26_ = e_source_mail_submission_get_transport_uid (_data_->_tmp25_);
					_data_->_tmp27_ = _data_->_tmp26_;
					if (g_strcmp0 (_data_->_tmp27_, "") != 0) {
						_data_->_tmp28_ = _data_->self->priv->registry;
						_data_->_tmp29_ = _data_->submission_extension;
						_data_->_tmp30_ = e_source_mail_submission_get_transport_uid (_data_->_tmp29_);
						_data_->_tmp31_ = _data_->_tmp30_;
						_data_->_tmp32_ = e_source_registry_ref_source (_data_->_tmp28_, _data_->_tmp31_);
						_g_object_unref0 (_data_->transport_source);
						_data_->transport_source = _data_->_tmp32_;
					}
				}
			}
		}
	}
	_data_->_tmp33_ = _data_->account_source;
	if (_data_->_tmp33_ == NULL) {
		_data_->_tmp35_ = g_strdup ("");
		_data_->_tmp36_ = NULL;
		_data_->_tmp36_ = e_source_new (NULL, NULL, &_data_->_inner_error0_);
		e_source_set_parent (_data_->_tmp36_, _data_->_tmp35_);
		_g_free0 (_data_->_tmp35_);
		_data_->_tmp34_ = _data_->_tmp36_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->transport_source);
			_g_object_unref0 (_data_->identity_source);
			_g_object_unref0 (_data_->account_source);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp37_ = _data_->_tmp34_;
		_data_->_tmp34_ = NULL;
		_g_object_unref0 (_data_->account_source);
		_data_->account_source = _data_->_tmp37_;
		_g_object_unref0 (_data_->_tmp34_);
	}
	_data_->_tmp38_ = _data_->identity_source;
	if (_data_->_tmp38_ == NULL) {
		_data_->_tmp40_ = _data_->account_source;
		_data_->_tmp41_ = e_source_get_uid (_data_->_tmp40_);
		_data_->_tmp42_ = _data_->_tmp41_;
		_data_->_tmp43_ = g_strdup (_data_->_tmp42_);
		_data_->_tmp44_ = NULL;
		_data_->_tmp44_ = e_source_new (NULL, NULL, &_data_->_inner_error0_);
		e_source_set_parent (_data_->_tmp44_, _data_->_tmp43_);
		_g_free0 (_data_->_tmp43_);
		_data_->_tmp39_ = _data_->_tmp44_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->transport_source);
			_g_object_unref0 (_data_->identity_source);
			_g_object_unref0 (_data_->account_source);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp45_ = _data_->_tmp39_;
		_data_->_tmp39_ = NULL;
		_g_object_unref0 (_data_->identity_source);
		_data_->identity_source = _data_->_tmp45_;
		_g_object_unref0 (_data_->_tmp39_);
	}
	_data_->_tmp46_ = _data_->transport_source;
	if (_data_->_tmp46_ == NULL) {
		_data_->_tmp48_ = _data_->account_source;
		_data_->_tmp49_ = e_source_get_uid (_data_->_tmp48_);
		_data_->_tmp50_ = _data_->_tmp49_;
		_data_->_tmp51_ = g_strdup (_data_->_tmp50_);
		_data_->_tmp52_ = NULL;
		_data_->_tmp52_ = e_source_new (NULL, NULL, &_data_->_inner_error0_);
		e_source_set_parent (_data_->_tmp52_, _data_->_tmp51_);
		_g_free0 (_data_->_tmp51_);
		_data_->_tmp47_ = _data_->_tmp52_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->transport_source);
			_g_object_unref0 (_data_->identity_source);
			_g_object_unref0 (_data_->account_source);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp53_ = _data_->_tmp47_;
		_data_->_tmp47_ = NULL;
		_g_object_unref0 (_data_->transport_source);
		_data_->transport_source = _data_->_tmp53_;
		_g_object_unref0 (_data_->_tmp47_);
	}
	_data_->_tmp54_ = _data_->account_source;
	_data_->_tmp55_ = _data_->identity_source;
	_data_->_tmp56_ = _data_->transport_source;
	_data_->_tmp57_ = _data_->self->priv->login_page;
	_data_->_tmp58_ = online_accounts_imap_login_page_get_display_name (_data_->_tmp57_);
	_data_->_tmp59_ = _data_->_tmp58_;
	e_source_set_display_name (_data_->_tmp56_, _data_->_tmp59_);
	e_source_set_display_name (_data_->_tmp55_, _data_->_tmp59_);
	e_source_set_display_name (_data_->_tmp54_, _data_->_tmp59_);
	_data_->_tmp60_ = _data_->account_source;
	_data_->_tmp61_ = e_source_get_extension (_data_->_tmp60_, E_SOURCE_EXTENSION_MAIL_ACCOUNT);
	_data_->_vala1_account_extension = G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp61_, e_source_mail_account_get_type (), ESourceMailAccount);
	_data_->_tmp62_ = _data_->_vala1_account_extension;
	_data_->_tmp63_ = _data_->identity_source;
	_data_->_tmp64_ = e_source_get_uid (_data_->_tmp63_);
	_data_->_tmp65_ = _data_->_tmp64_;
	e_source_mail_account_set_identity_uid (_data_->_tmp62_, _data_->_tmp65_);
	_data_->_tmp66_ = _data_->_vala1_account_extension;
	e_source_mail_account_set_needs_initial_setup (_data_->_tmp66_, TRUE);
	_data_->_tmp67_ = _data_->_vala1_account_extension;
	e_source_backend_set_backend_name ((ESourceBackend*) _data_->_tmp67_, "imapx");
	_data_->_tmp68_ = _data_->account_source;
	_data_->_tmp69_ = e_source_get_extension (_data_->_tmp68_, E_SOURCE_EXTENSION_SECURITY);
	_data_->account_security_extension = G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp69_, e_source_security_get_type (), ESourceSecurity);
	_data_->_tmp70_ = _data_->account_security_extension;
	_data_->_tmp71_ = _data_->self->priv->imap_encryption_combobox;
	_data_->_tmp72_ = gtk_combo_box_get_active_id ((GtkComboBox*) _data_->_tmp71_);
	_data_->_tmp73_ = _data_->_tmp72_;
	e_source_security_set_method (_data_->_tmp70_, _data_->_tmp73_);
	_data_->_tmp74_ = _data_->account_source;
	_data_->_tmp75_ = e_source_get_extension (_data_->_tmp74_, E_SOURCE_EXTENSION_AUTHENTICATION);
	_data_->account_auth_extension = G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp75_, e_source_authentication_get_type (), ESourceAuthentication);
	_data_->_tmp76_ = _data_->account_auth_extension;
	_data_->_tmp77_ = _data_->self->priv->imap_server_entry;
	_data_->_tmp78_ = gtk_editable_get_text ((GtkEditable*) _data_->_tmp77_);
	_data_->_tmp79_ = _data_->_tmp78_;
	e_source_authentication_set_host (_data_->_tmp76_, _data_->_tmp79_);
	_data_->_tmp80_ = _data_->account_auth_extension;
	_data_->_tmp81_ = _data_->self->priv->imap_port_spin;
	_data_->_tmp82_ = gtk_spin_button_get_value (_data_->_tmp81_);
	_data_->_tmp83_ = _data_->_tmp82_;
	e_source_authentication_set_port (_data_->_tmp80_, (guint) _data_->_tmp83_);
	_data_->_tmp84_ = _data_->account_auth_extension;
	_data_->_tmp85_ = _data_->self->priv->imap_username_entry;
	_data_->_tmp86_ = gtk_editable_get_text ((GtkEditable*) _data_->_tmp85_);
	_data_->_tmp87_ = _data_->_tmp86_;
	e_source_authentication_set_user (_data_->_tmp84_, _data_->_tmp87_);
	_data_->_tmp88_ = _data_->account_source;
	_data_->_tmp89_ = e_source_get_extension (_data_->_tmp88_, E_SOURCE_EXTENSION_REFRESH);
	_data_->refresh_extension = G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp89_, e_source_refresh_get_type (), ESourceRefresh);
	_data_->_tmp90_ = _data_->refresh_extension;
	e_source_refresh_set_enabled (_data_->_tmp90_, TRUE);
	_data_->_tmp91_ = _data_->refresh_extension;
	_data_->_tmp92_ = _data_->self->priv->imap_refresh_interval_spin;
	_data_->_tmp93_ = gtk_spin_button_get_value (_data_->_tmp92_);
	_data_->_tmp94_ = _data_->_tmp93_;
	e_source_refresh_set_interval_minutes (_data_->_tmp91_, (guint) _data_->_tmp94_);
	_data_->_tmp95_ = _data_->identity_source;
	_data_->_tmp96_ = e_source_get_extension (_data_->_tmp95_, E_SOURCE_EXTENSION_MAIL_SUBMISSION);
	_data_->_vala1_submission_extension = G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp96_, e_source_mail_submission_get_type (), ESourceMailSubmission);
	_data_->_tmp97_ = _data_->_vala1_submission_extension;
	_data_->_tmp98_ = _data_->transport_source;
	_data_->_tmp99_ = e_source_get_uid (_data_->_tmp98_);
	_data_->_tmp100_ = _data_->_tmp99_;
	e_source_mail_submission_set_transport_uid (_data_->_tmp97_, _data_->_tmp100_);
	_data_->_tmp101_ = _data_->identity_source;
	_data_->_tmp102_ = e_source_get_extension (_data_->_tmp101_, E_SOURCE_EXTENSION_MAIL_IDENTITY);
	_data_->identity_extension = G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp102_, e_source_mail_identity_get_type (), ESourceMailIdentity);
	_data_->_tmp103_ = _data_->identity_extension;
	_data_->_tmp104_ = _data_->self->priv->login_page;
	_data_->_tmp105_ = online_accounts_imap_login_page_get_email (_data_->_tmp104_);
	_data_->_tmp106_ = _data_->_tmp105_;
	e_source_mail_identity_set_address (_data_->_tmp103_, _data_->_tmp106_);
	_data_->_tmp107_ = _data_->identity_extension;
	_data_->_tmp108_ = _data_->self->priv->login_page;
	_data_->_tmp109_ = online_accounts_imap_login_page_get_real_name (_data_->_tmp108_);
	_data_->_tmp110_ = _data_->_tmp109_;
	e_source_mail_identity_set_name (_data_->_tmp107_, _data_->_tmp110_);
	_data_->_tmp111_ = _data_->transport_source;
	_data_->_tmp112_ = e_source_get_extension (_data_->_tmp111_, E_SOURCE_EXTENSION_MAIL_TRANSPORT);
	_data_->transport_extension = G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp112_, e_source_mail_transport_get_type (), ESourceMailTransport);
	_data_->_tmp113_ = _data_->transport_extension;
	e_source_backend_set_backend_name ((ESourceBackend*) _data_->_tmp113_, "smtp");
	_data_->_tmp114_ = _data_->transport_source;
	_data_->_tmp115_ = e_source_get_extension (_data_->_tmp114_, E_SOURCE_EXTENSION_SECURITY);
	_data_->transport_security_extension = G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp115_, e_source_security_get_type (), ESourceSecurity);
	_data_->_tmp116_ = _data_->transport_security_extension;
	_data_->_tmp117_ = _data_->self->priv->smtp_encryption_combobox;
	_data_->_tmp118_ = gtk_combo_box_get_active_id ((GtkComboBox*) _data_->_tmp117_);
	_data_->_tmp119_ = _data_->_tmp118_;
	e_source_security_set_method (_data_->_tmp116_, _data_->_tmp119_);
	_data_->_tmp120_ = _data_->transport_source;
	_data_->_tmp121_ = e_source_get_extension (_data_->_tmp120_, E_SOURCE_EXTENSION_AUTHENTICATION);
	_data_->transport_auth_extension = G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp121_, e_source_authentication_get_type (), ESourceAuthentication);
	_data_->_tmp122_ = _data_->transport_auth_extension;
	_data_->_tmp123_ = _data_->self->priv->smtp_server_entry;
	_data_->_tmp124_ = gtk_editable_get_text ((GtkEditable*) _data_->_tmp123_);
	_data_->_tmp125_ = _data_->_tmp124_;
	e_source_authentication_set_host (_data_->_tmp122_, _data_->_tmp125_);
	_data_->_tmp126_ = _data_->transport_auth_extension;
	_data_->_tmp127_ = _data_->self->priv->smtp_port_spin;
	_data_->_tmp128_ = gtk_spin_button_get_value (_data_->_tmp127_);
	_data_->_tmp129_ = _data_->_tmp128_;
	e_source_authentication_set_port (_data_->_tmp126_, (guint) _data_->_tmp129_);
	_data_->_tmp130_ = _data_->self->priv->use_imap_credentials;
	_data_->_tmp131_ = gtk_check_button_get_active (_data_->_tmp130_);
	_data_->_tmp132_ = _data_->_tmp131_;
	if (_data_->_tmp132_) {
		_data_->_tmp133_ = _data_->transport_auth_extension;
		_data_->_tmp134_ = _data_->self->priv->imap_username_entry;
		_data_->_tmp135_ = gtk_editable_get_text ((GtkEditable*) _data_->_tmp134_);
		_data_->_tmp136_ = _data_->_tmp135_;
		e_source_authentication_set_user (_data_->_tmp133_, _data_->_tmp136_);
	} else {
		_data_->_tmp137_ = _data_->transport_auth_extension;
		_data_->_tmp138_ = _data_->self->priv->smtp_username_entry;
		_data_->_tmp139_ = gtk_editable_get_text ((GtkEditable*) _data_->_tmp138_);
		_data_->_tmp140_ = _data_->_tmp139_;
		e_source_authentication_set_user (_data_->_tmp137_, _data_->_tmp140_);
	}
	_data_->_tmp141_ = online_accounts_camel_session_get_default ();
	_data_->session = _data_->_tmp141_;
	g_debug ("ImapDialog.vala:573: Add imap service for mail account extension");
	_data_->_tmp142_ = _data_->session;
	_data_->_tmp143_ = _data_->account_source;
	_data_->_tmp144_ = e_source_get_uid (_data_->_tmp143_);
	_data_->_tmp145_ = _data_->_tmp144_;
	_data_->_tmp146_ = _data_->_vala1_account_extension;
	_data_->_tmp147_ = e_source_backend_get_backend_name ((ESourceBackend*) _data_->_tmp146_);
	_data_->_tmp148_ = _data_->_tmp147_;
	_data_->_tmp149_ = camel_session_add_service ((CamelSession*) _data_->_tmp142_, _data_->_tmp145_, _data_->_tmp148_, CAMEL_PROVIDER_STORE, &_data_->_inner_error0_);
	_data_->imap_service = _data_->_tmp149_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->transport_source);
		_g_object_unref0 (_data_->identity_source);
		_g_object_unref0 (_data_->account_source);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp150_ = _data_->imap_service;
	_data_->_tmp151_ = _data_->self->priv->login_page;
	_data_->_tmp152_ = online_accounts_imap_login_page_get_password (_data_->_tmp151_);
	_data_->_tmp153_ = _data_->_tmp152_;
	camel_service_set_password (_data_->_tmp150_, _data_->_tmp153_);
	_data_->_tmp154_ = _data_->account_source;
	_data_->_tmp155_ = _data_->imap_service;
	e_source_camel_configure_service (_data_->_tmp154_, _data_->_tmp155_);
	_data_->_tmp156_ = _data_->imap_service;
	if (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp156_, camel_network_service_get_type ())) {
		g_debug ("ImapDialog.vala:579: Test if we can reach the imap service…");
		_data_->_tmp157_ = _data_->imap_service;
		_data_->_tmp158_ = _data_->self->priv->cancellable;
		_data_->_state_ = 2;
		camel_network_service_can_reach (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp157_, camel_network_service_get_type (), CamelNetworkService), _data_->_tmp158_, online_accounts_imap_dialog_save_configuration_ready, _data_);
		return FALSE;
		_state_2:
		camel_network_service_can_reach_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp157_, camel_network_service_get_type (), CamelNetworkService), _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->imap_service);
			_g_object_unref0 (_data_->transport_source);
			_g_object_unref0 (_data_->identity_source);
			_g_object_unref0 (_data_->account_source);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	_data_->_tmp159_ = _data_->imap_service;
	_data_->_tmp160_ = _data_->self->priv->cancellable;
	_data_->_state_ = 3;
	camel_service_query_auth_types (_data_->_tmp159_, G_PRIORITY_DEFAULT, _data_->_tmp160_, online_accounts_imap_dialog_save_configuration_ready, _data_);
	return FALSE;
	_state_3:
	_data_->_tmp161_ = camel_service_query_auth_types_finish (_data_->_tmp159_, _data_->_res_, &_data_->_inner_error0_);
	_data_->imap_auth_types = _data_->_tmp161_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->imap_service);
		_g_object_unref0 (_data_->transport_source);
		_g_object_unref0 (_data_->identity_source);
		_g_object_unref0 (_data_->account_source);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->imap_auth_error = NULL;
	_data_->_tmp162_ = _data_->imap_auth_types;
	{
		_data_->imap_auth_type_collection = _data_->_tmp162_;
		for (_data_->imap_auth_type_it = _data_->imap_auth_type_collection; _data_->imap_auth_type_it != NULL; _data_->imap_auth_type_it = _data_->imap_auth_type_it->next) {
			_data_->imap_auth_type = (CamelServiceAuthType*) _data_->imap_auth_type_it->data;
			{
				_data_->_tmp163_ = _data_->imap_auth_type;
				_data_->_tmp164_ = _data_->_tmp163_->name;
				g_debug ("ImapDialog.vala:586: Testing %s authentication for imap service…", _data_->_tmp164_);
				_data_->_tmp165_ = _data_->account_auth_extension;
				_data_->_tmp166_ = _data_->imap_auth_type;
				_data_->_tmp167_ = _data_->_tmp166_->authproto;
				e_source_authentication_set_method (_data_->_tmp165_, _data_->_tmp167_);
				_data_->_tmp168_ = _data_->account_source;
				_data_->_tmp169_ = _data_->imap_service;
				e_source_camel_configure_service (_data_->_tmp168_, _data_->_tmp169_);
				_data_->_tmp170_ = g_cancellable_new ();
				_data_->imap_auth_cancellable = _data_->_tmp170_;
				_data_->_tmp171_ = _data_->imap_auth_cancellable;
				online_accounts_imap_dialog_set_cancel_timeout (_data_->self, _data_->_tmp171_);
				{
					_data_->_tmp172_ = _data_->imap_service;
					if (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp172_, camel_offline_store_get_type ())) {
						g_debug ("ImapDialog.vala:596: Setting the imap service online…");
						_data_->_tmp173_ = _data_->imap_service;
						_data_->_tmp174_ = _data_->imap_auth_cancellable;
						_data_->_state_ = 4;
						camel_offline_store_set_online (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp173_, camel_offline_store_get_type (), CamelOfflineStore), TRUE, G_PRIORITY_DEFAULT, _data_->_tmp174_, online_accounts_imap_dialog_save_configuration_ready, _data_);
						return FALSE;
						_state_4:
						camel_offline_store_set_online_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp173_, camel_offline_store_get_type (), CamelOfflineStore), _data_->_res_, &_data_->_inner_error0_);
						if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
							goto __catch0_g_error;
						}
					} else {
						g_debug ("ImapDialog.vala:599: Connecting to the imap service…");
						_data_->_tmp175_ = _data_->imap_service;
						_data_->_tmp176_ = _data_->imap_auth_cancellable;
						_data_->_state_ = 5;
						camel_service_connect (_data_->_tmp175_, G_PRIORITY_DEFAULT, _data_->_tmp176_, online_accounts_imap_dialog_save_configuration_ready, _data_);
						return FALSE;
						_state_5:
						camel_service_connect_finish (_data_->_tmp175_, _data_->_res_, &_data_->_inner_error0_);
						if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
							goto __catch0_g_error;
						}
					}
					_data_->_tmp177_ = _data_->imap_auth_type;
					_data_->_tmp178_ = _data_->_tmp177_->name;
					g_debug ("ImapDialog.vala:603: Successfully connected to the imap service using " \
"%s authentication.", _data_->_tmp178_);
					_g_error_free0 (_data_->imap_auth_error);
					_data_->imap_auth_error = NULL;
					_g_object_unref0 (_data_->imap_auth_cancellable);
					break;
				}
				goto __finally0;
				__catch0_g_error:
				{
					_data_->e = _data_->_inner_error0_;
					_data_->_inner_error0_ = NULL;
					_data_->_tmp179_ = _data_->imap_auth_type;
					_data_->_tmp180_ = _data_->_tmp179_->name;
					_data_->_tmp181_ = _data_->e;
					_data_->_tmp182_ = _data_->_tmp181_->message;
					g_debug ("ImapDialog.vala:608: Error using %s authentication for imap service: %" \
"s", _data_->_tmp180_, _data_->_tmp182_);
					_data_->_tmp183_ = _data_->e;
					if (g_error_matches (_data_->_tmp183_, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
						_data_->_tmp184_ = g_error_new (camel_service_error_quark (), CAMEL_SERVICE_ERROR_CANT_AUTHENTICATE, "%s", _ ("Could not log in. Please verify your credentials."));
						_g_error_free0 (_data_->imap_auth_error);
						_data_->imap_auth_error = _data_->_tmp184_;
					} else {
						_data_->_tmp185_ = _data_->e;
						_data_->_tmp186_ = _g_error_copy0 (_data_->_tmp185_);
						_g_error_free0 (_data_->imap_auth_error);
						_data_->imap_auth_error = _data_->_tmp186_;
					}
					_g_error_free0 (_data_->e);
				}
				__finally0:
				if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
					g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
					_g_object_unref0 (_data_->imap_auth_cancellable);
					_g_error_free0 (_data_->imap_auth_error);
					(_data_->imap_auth_types == NULL) ? NULL : (_data_->imap_auth_types = (g_list_free (_data_->imap_auth_types), NULL));
					_g_object_unref0 (_data_->imap_service);
					_g_object_unref0 (_data_->transport_source);
					_g_object_unref0 (_data_->identity_source);
					_g_object_unref0 (_data_->account_source);
					g_object_unref (_data_->_async_result);
					return FALSE;
				}
				online_accounts_imap_dialog_unset_cancel_timeout (_data_->self);
				_g_object_unref0 (_data_->imap_auth_cancellable);
			}
		}
	}
	_data_->_tmp187_ = _data_->imap_auth_error;
	if (_data_->_tmp187_ != NULL) {
		_data_->_tmp188_ = _data_->imap_auth_error;
		_data_->_tmp189_ = _data_->_tmp188_->message;
		_data_->_tmp190_ = g_strdup_printf (_ ("IMAP verification failed: %s"), _data_->_tmp189_);
		_data_->_tmp191_ = _data_->_tmp190_;
		_data_->_tmp192_ = g_error_new (camel_service_error_quark (), CAMEL_SERVICE_ERROR_CANT_AUTHENTICATE, "%s", _data_->_tmp191_);
		_data_->_tmp193_ = _data_->_tmp192_;
		_g_free0 (_data_->_tmp191_);
		_data_->_inner_error0_ = _data_->_tmp193_;
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_error_free0 (_data_->imap_auth_error);
		(_data_->imap_auth_types == NULL) ? NULL : (_data_->imap_auth_types = (g_list_free (_data_->imap_auth_types), NULL));
		_g_object_unref0 (_data_->imap_service);
		_g_object_unref0 (_data_->transport_source);
		_g_object_unref0 (_data_->identity_source);
		_g_object_unref0 (_data_->account_source);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp194_ = _data_->imap_service;
	if (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp194_, camel_store_get_type ())) {
		_data_->_tmp195_ = _data_->imap_service;
		_data_->_tmp196_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp195_, camel_store_get_type (), CamelStore));
		_data_->imap_store = _data_->_tmp196_;
		{
			_data_->_tmp197_ = _data_->imap_store;
			_data_->_tmp198_ = _data_->self->priv->cancellable;
			_data_->_tmp199_ = NULL;
			camel_store_initial_setup_sync (_data_->_tmp197_, &_data_->_tmp199_, _data_->_tmp198_, &_data_->_inner_error0_);
			_g_hash_table_unref0 (_data_->save_setup);
			_data_->save_setup = _data_->_tmp199_;
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				_g_hash_table_unref0 (_data_->save_setup);
				goto __catch1_g_error;
			}
			_data_->_tmp200_ = _data_->save_setup;
			if (_data_->_tmp200_ == NULL) {
				g_warning ("ImapDialog.vala:640: Initial setup is NULL. Well known folders will pr" \
"obably not work correctly.");
			} else {
				_data_->_tmp201_ = _data_->account_source;
				_data_->_tmp202_ = e_source_get_uid (_data_->_tmp201_);
				_data_->_tmp203_ = _data_->_tmp202_;
				_data_->_tmp204_ = camel_url_encode (_data_->_tmp203_, ":;@/");
				_data_->encoded_account_uri = _data_->_tmp204_;
				_data_->_tmp205_ = _data_->save_setup;
				_data_->_tmp206_ = g_hash_table_get_keys (_data_->_tmp205_);
				{
					_data_->key_collection = _data_->_tmp206_;
					for (_data_->key_it = _data_->key_collection; _data_->key_it != NULL; _data_->key_it = _data_->key_it->next) {
						_data_->key = (const gchar*) _data_->key_it->data;
						{
							_data_->_tmp207_ = _data_->key;
							_data_->_tmp209_ = _data_->_tmp208_ = g_strsplit (_data_->_tmp207_, ":", 0);
							_data_->keys = _data_->_tmp209_;
							_data_->keys_length1 = _vala_array_length (_data_->_tmp208_);
							_data_->_keys_size_ = _data_->keys_length1;
							_data_->_tmp211_ = _data_->keys;
							_data_->_tmp211__length1 = _data_->keys_length1;
							if (_data_->_tmp211__length1 < 3) {
								_data_->_tmp210_ = TRUE;
							} else {
								_data_->_tmp212_ = _data_->keys;
								_data_->_tmp212__length1 = _data_->keys_length1;
								_data_->_tmp210_ = _data_->_tmp212__length1 > 4;
							}
							if (_data_->_tmp210_) {
								_data_->_tmp213_ = _data_->keys;
								_data_->_tmp213__length1 = _data_->keys_length1;
								_data_->_tmp214_ = _data_->key;
								g_warning ("ImapDialog.vala:663: Incorrect store setup key. 3 or 4 parts expected," \
" but %d given in “%s”", _data_->_tmp213__length1, _data_->_tmp214_);
								_data_->keys = (_vala_array_free (_data_->keys, _data_->keys_length1, (GDestroyNotify) g_free), NULL);
								continue;
							} else {
								static GQuark _tmp233_label0 = 0;
								static GQuark _tmp233_label1 = 0;
								static GQuark _tmp233_label2 = 0;
								static GQuark _tmp233_label3 = 0;
								_data_->_tmp215_ = _data_->keys;
								_data_->_tmp215__length1 = _data_->keys_length1;
								_data_->_tmp216_ = _data_->_tmp215_[0];
								_data_->_tmp217_ = g_strdup (_data_->_tmp216_);
								_data_->save_setup_source_type = _data_->_tmp217_;
								_data_->_tmp218_ = _data_->keys;
								_data_->_tmp218__length1 = _data_->keys_length1;
								_data_->_tmp219_ = _data_->_tmp218_[1];
								_data_->_tmp220_ = g_strdup (_data_->_tmp219_);
								_data_->save_setup_extension_name = _data_->_tmp220_;
								_data_->_tmp221_ = _data_->keys;
								_data_->_tmp221__length1 = _data_->keys_length1;
								_data_->_tmp222_ = _data_->_tmp221_[2];
								_data_->_tmp223_ = g_strdup (_data_->_tmp222_);
								_data_->save_setup_property_name = _data_->_tmp223_;
								_data_->_tmp224_ = _data_->keys;
								_data_->_tmp224__length1 = _data_->keys_length1;
								_data_->_tmp225_ = _data_->_tmp224_[3];
								_data_->_tmp226_ = g_strdup (_data_->_tmp225_);
								_data_->save_setup_property_type = _data_->_tmp226_;
								_data_->_tmp227_ = _data_->save_setup;
								_data_->_tmp228_ = _data_->key;
								_data_->_tmp229_ = g_hash_table_lookup (_data_->_tmp227_, _data_->_tmp228_);
								_data_->_tmp230_ = g_strdup ((const gchar*) _data_->_tmp229_);
								_data_->save_setup_property_value = _data_->_tmp230_;
								_data_->_tmp231_ = _data_->save_setup_source_type;
								_data_->_tmp234_ = 0U;
								_data_->_tmp232_ = _data_->_tmp231_;
								_data_->_tmp234_ = (NULL == _data_->_tmp232_) ? 0 : g_quark_from_string (_data_->_tmp232_);
								if (_data_->_tmp234_ == ((0 != _tmp233_label0) ? _tmp233_label0 : (_tmp233_label0 = g_quark_from_static_string ("Account")))) {
									switch (0) {
										default:
										{
											_data_->_tmp235_ = _data_->account_source;
											_data_->_tmp236_ = _data_->save_setup_extension_name;
											_data_->_tmp237_ = _data_->save_setup_property_name;
											_data_->_tmp238_ = _data_->save_setup_property_type;
											_data_->_tmp239_ = _data_->save_setup_property_value;
											_data_->_tmp240_ = _data_->encoded_account_uri;
											online_accounts_imap_dialog_save_initial_setup_key_for_source (_data_->self, _data_->_tmp235_, _data_->_tmp236_, _data_->_tmp237_, _data_->_tmp238_, _data_->_tmp239_, _data_->_tmp240_);
											break;
										}
									}
								} else if (_data_->_tmp234_ == ((0 != _tmp233_label1) ? _tmp233_label1 : (_tmp233_label1 = g_quark_from_static_string ("Submission")))) {
									switch (0) {
										default:
										{
											_data_->_tmp241_ = _data_->identity_source;
											_data_->_tmp242_ = _data_->save_setup_extension_name;
											_data_->_tmp243_ = _data_->save_setup_property_name;
											_data_->_tmp244_ = _data_->save_setup_property_type;
											_data_->_tmp245_ = _data_->save_setup_property_value;
											_data_->_tmp246_ = _data_->encoded_account_uri;
											online_accounts_imap_dialog_save_initial_setup_key_for_source (_data_->self, _data_->_tmp241_, _data_->_tmp242_, _data_->_tmp243_, _data_->_tmp244_, _data_->_tmp245_, _data_->_tmp246_);
											break;
										}
									}
								} else if (_data_->_tmp234_ == ((0 != _tmp233_label2) ? _tmp233_label2 : (_tmp233_label2 = g_quark_from_static_string ("Transport")))) {
									switch (0) {
										default:
										{
											_data_->_tmp247_ = _data_->transport_source;
											_data_->_tmp248_ = _data_->save_setup_extension_name;
											_data_->_tmp249_ = _data_->save_setup_property_name;
											_data_->_tmp250_ = _data_->save_setup_property_type;
											_data_->_tmp251_ = _data_->save_setup_property_value;
											_data_->_tmp252_ = _data_->encoded_account_uri;
											online_accounts_imap_dialog_save_initial_setup_key_for_source (_data_->self, _data_->_tmp247_, _data_->_tmp248_, _data_->_tmp249_, _data_->_tmp250_, _data_->_tmp251_, _data_->_tmp252_);
											break;
										}
									}
								} else if (_data_->_tmp234_ == ((0 != _tmp233_label3) ? _tmp233_label3 : (_tmp233_label3 = g_quark_from_static_string ("Backend")))) {
									switch (0) {
										default:
										{
											_data_->_tmp253_ = _data_->account_source;
											_data_->_tmp254_ = _data_->save_setup_extension_name;
											_data_->_tmp255_ = _data_->save_setup_property_name;
											_data_->_tmp256_ = _data_->save_setup_property_type;
											_data_->_tmp257_ = _data_->save_setup_property_value;
											_data_->_tmp258_ = _data_->encoded_account_uri;
											online_accounts_imap_dialog_save_initial_setup_key_for_source (_data_->self, _data_->_tmp253_, _data_->_tmp254_, _data_->_tmp255_, _data_->_tmp256_, _data_->_tmp257_, _data_->_tmp258_);
											break;
										}
									}
								} else {
									switch (0) {
										default:
										{
											_data_->_tmp259_ = _data_->key;
											g_warning ("ImapDialog.vala:719: Initial setup key is not stored: “%s”", _data_->_tmp259_);
											break;
										}
									}
								}
								_g_free0 (_data_->save_setup_property_value);
								_g_free0 (_data_->save_setup_property_type);
								_g_free0 (_data_->save_setup_property_name);
								_g_free0 (_data_->save_setup_extension_name);
								_g_free0 (_data_->save_setup_source_type);
							}
							_data_->keys = (_vala_array_free (_data_->keys, _data_->keys_length1, (GDestroyNotify) g_free), NULL);
						}
					}
					(_data_->key_collection == NULL) ? NULL : (_data_->key_collection = (g_list_free (_data_->key_collection), NULL));
				}
				_data_->_tmp260_ = _data_->_vala1_account_extension;
				e_source_mail_account_set_needs_initial_setup (_data_->_tmp260_, FALSE);
				_g_free0 (_data_->encoded_account_uri);
			}
			_g_hash_table_unref0 (_data_->save_setup);
		}
		goto __finally1;
		__catch1_g_error:
		{
			_data_->_vala1_e = _data_->_inner_error0_;
			_data_->_inner_error0_ = NULL;
			_data_->_tmp261_ = _data_->_vala1_e;
			_data_->_tmp262_ = _data_->_tmp261_->message;
			g_warning ("ImapDialog.vala:729: Incomplete setup. It is possible to use this e-ma" \
"il account, but well known folders most likely will not work as expect" \
"ed: %s", _data_->_tmp262_);
			_g_error_free0 (_data_->_vala1_e);
		}
		__finally1:
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->imap_store);
			_g_error_free0 (_data_->imap_auth_error);
			(_data_->imap_auth_types == NULL) ? NULL : (_data_->imap_auth_types = (g_list_free (_data_->imap_auth_types), NULL));
			_g_object_unref0 (_data_->imap_service);
			_g_object_unref0 (_data_->transport_source);
			_g_object_unref0 (_data_->identity_source);
			_g_object_unref0 (_data_->account_source);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_g_object_unref0 (_data_->imap_store);
	}
	_data_->_tmp263_ = _data_->self->priv->cancellable;
	if (g_cancellable_is_cancelled (_data_->_tmp263_)) {
		_g_error_free0 (_data_->imap_auth_error);
		(_data_->imap_auth_types == NULL) ? NULL : (_data_->imap_auth_types = (g_list_free (_data_->imap_auth_types), NULL));
		_g_object_unref0 (_data_->imap_service);
		_g_object_unref0 (_data_->transport_source);
		_g_object_unref0 (_data_->identity_source);
		_g_object_unref0 (_data_->account_source);
		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;
	}
	g_debug ("ImapDialog.vala:737: Add smtp service");
	_data_->_tmp264_ = _data_->session;
	_data_->_tmp265_ = _data_->transport_source;
	_data_->_tmp266_ = e_source_get_uid (_data_->_tmp265_);
	_data_->_tmp267_ = _data_->_tmp266_;
	_data_->_tmp268_ = _data_->transport_extension;
	_data_->_tmp269_ = e_source_backend_get_backend_name ((ESourceBackend*) _data_->_tmp268_);
	_data_->_tmp270_ = _data_->_tmp269_;
	_data_->_tmp271_ = camel_session_add_service ((CamelSession*) _data_->_tmp264_, _data_->_tmp267_, _data_->_tmp270_, CAMEL_PROVIDER_TRANSPORT, &_data_->_inner_error0_);
	_data_->transport_service = _data_->_tmp271_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_error_free0 (_data_->imap_auth_error);
		(_data_->imap_auth_types == NULL) ? NULL : (_data_->imap_auth_types = (g_list_free (_data_->imap_auth_types), NULL));
		_g_object_unref0 (_data_->imap_service);
		_g_object_unref0 (_data_->transport_source);
		_g_object_unref0 (_data_->identity_source);
		_g_object_unref0 (_data_->account_source);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp272_ = _data_->transport_source;
	_data_->_tmp273_ = _data_->transport_service;
	e_source_camel_configure_service (_data_->_tmp272_, _data_->_tmp273_);
	_data_->_tmp274_ = _data_->self->priv->smtp_no_credentials;
	_data_->_tmp275_ = gtk_check_button_get_active (_data_->_tmp274_);
	_data_->_tmp276_ = _data_->_tmp275_;
	if (!_data_->_tmp276_) {
		_data_->_tmp277_ = _data_->self->priv->use_imap_credentials;
		_data_->_tmp278_ = gtk_check_button_get_active (_data_->_tmp277_);
		_data_->_tmp279_ = _data_->_tmp278_;
		if (_data_->_tmp279_) {
			_data_->_tmp280_ = _data_->transport_service;
			_data_->_tmp281_ = _data_->self->priv->login_page;
			_data_->_tmp282_ = online_accounts_imap_login_page_get_password (_data_->_tmp281_);
			_data_->_tmp283_ = _data_->_tmp282_;
			camel_service_set_password (_data_->_tmp280_, _data_->_tmp283_);
		} else {
			_data_->_tmp284_ = _data_->transport_service;
			_data_->_tmp285_ = _data_->self->priv->smtp_password_entry;
			_data_->_tmp286_ = gtk_editable_get_text ((GtkEditable*) _data_->_tmp285_);
			_data_->_tmp287_ = _data_->_tmp286_;
			camel_service_set_password (_data_->_tmp284_, _data_->_tmp287_);
		}
	}
	_data_->_tmp288_ = _data_->transport_service;
	if (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp288_, camel_network_service_get_type ())) {
		g_debug ("ImapDialog.vala:750: Test if the smtp service can be reached…");
		_data_->_tmp289_ = _data_->transport_service;
		_data_->_tmp290_ = _data_->self->priv->cancellable;
		_data_->_state_ = 6;
		camel_network_service_can_reach (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp289_, camel_network_service_get_type (), CamelNetworkService), _data_->_tmp290_, online_accounts_imap_dialog_save_configuration_ready, _data_);
		return FALSE;
		_state_6:
		camel_network_service_can_reach_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp289_, camel_network_service_get_type (), CamelNetworkService), _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->transport_service);
			_g_error_free0 (_data_->imap_auth_error);
			(_data_->imap_auth_types == NULL) ? NULL : (_data_->imap_auth_types = (g_list_free (_data_->imap_auth_types), NULL));
			_g_object_unref0 (_data_->imap_service);
			_g_object_unref0 (_data_->transport_source);
			_g_object_unref0 (_data_->identity_source);
			_g_object_unref0 (_data_->account_source);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	_data_->_tmp291_ = _data_->transport_service;
	_data_->_tmp292_ = _data_->self->priv->cancellable;
	_data_->_state_ = 7;
	camel_service_query_auth_types (_data_->_tmp291_, G_PRIORITY_DEFAULT, _data_->_tmp292_, online_accounts_imap_dialog_save_configuration_ready, _data_);
	return FALSE;
	_state_7:
	_data_->_tmp293_ = camel_service_query_auth_types_finish (_data_->_tmp291_, _data_->_res_, &_data_->_inner_error0_);
	_data_->smtp_auth_types = _data_->_tmp293_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->transport_service);
		_g_error_free0 (_data_->imap_auth_error);
		(_data_->imap_auth_types == NULL) ? NULL : (_data_->imap_auth_types = (g_list_free (_data_->imap_auth_types), NULL));
		_g_object_unref0 (_data_->imap_service);
		_g_object_unref0 (_data_->transport_source);
		_g_object_unref0 (_data_->identity_source);
		_g_object_unref0 (_data_->account_source);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->smtp_auth_error = NULL;
	_data_->_tmp294_ = _data_->smtp_auth_types;
	{
		_data_->smtp_auth_type_collection = _data_->_tmp294_;
		for (_data_->smtp_auth_type_it = _data_->smtp_auth_type_collection; _data_->smtp_auth_type_it != NULL; _data_->smtp_auth_type_it = _data_->smtp_auth_type_it->next) {
			_data_->smtp_auth_type = (CamelServiceAuthType*) _data_->smtp_auth_type_it->data;
			{
				_data_->_tmp295_ = _data_->smtp_auth_type;
				_data_->_tmp296_ = _data_->_tmp295_->name;
				g_debug ("ImapDialog.vala:757: Testing %s authentication for smtp service…", _data_->_tmp296_);
				_data_->_tmp297_ = _data_->transport_auth_extension;
				_data_->_tmp298_ = _data_->smtp_auth_type;
				_data_->_tmp299_ = _data_->_tmp298_->authproto;
				e_source_authentication_set_method (_data_->_tmp297_, _data_->_tmp299_);
				_data_->_tmp300_ = _data_->transport_source;
				_data_->_tmp301_ = _data_->transport_service;
				e_source_camel_configure_service (_data_->_tmp300_, _data_->_tmp301_);
				_data_->_tmp302_ = g_cancellable_new ();
				_data_->smtp_auth_cancellable = _data_->_tmp302_;
				_data_->_tmp303_ = _data_->smtp_auth_cancellable;
				online_accounts_imap_dialog_set_cancel_timeout (_data_->self, _data_->_tmp303_);
				{
					g_debug ("ImapDialog.vala:766: Connecting to the smtp service…");
					_data_->_tmp304_ = _data_->transport_service;
					_data_->_tmp305_ = _data_->smtp_auth_cancellable;
					_data_->_state_ = 8;
					camel_service_connect (_data_->_tmp304_, G_PRIORITY_DEFAULT, _data_->_tmp305_, online_accounts_imap_dialog_save_configuration_ready, _data_);
					return FALSE;
					_state_8:
					camel_service_connect_finish (_data_->_tmp304_, _data_->_res_, &_data_->_inner_error0_);
					if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
						goto __catch2_g_error;
					}
					_data_->_tmp306_ = _data_->smtp_auth_type;
					_data_->_tmp307_ = _data_->_tmp306_->name;
					g_debug ("ImapDialog.vala:769: Successfully connected to the smtp service using " \
"%s authentication.", _data_->_tmp307_);
					_g_error_free0 (_data_->smtp_auth_error);
					_data_->smtp_auth_error = NULL;
					_g_object_unref0 (_data_->smtp_auth_cancellable);
					break;
				}
				goto __finally2;
				__catch2_g_error:
				{
					_data_->_vala2_e = _data_->_inner_error0_;
					_data_->_inner_error0_ = NULL;
					_data_->_tmp308_ = _data_->smtp_auth_type;
					_data_->_tmp309_ = _data_->_tmp308_->name;
					_data_->_tmp310_ = _data_->_vala2_e;
					_data_->_tmp311_ = _data_->_tmp310_->message;
					g_debug ("ImapDialog.vala:774: Error using %s authentication for smtp service: %" \
"s", _data_->_tmp309_, _data_->_tmp311_);
					_data_->_tmp312_ = _data_->_vala2_e;
					if (g_error_matches (_data_->_tmp312_, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
						_data_->_tmp313_ = g_error_new (camel_service_error_quark (), CAMEL_SERVICE_ERROR_CANT_AUTHENTICATE, "Could not log in. Please verify your credentials.");
						_g_error_free0 (_data_->smtp_auth_error);
						_data_->smtp_auth_error = _data_->_tmp313_;
					} else {
						_data_->_tmp314_ = _data_->_vala2_e;
						_data_->_tmp315_ = _g_error_copy0 (_data_->_tmp314_);
						_g_error_free0 (_data_->smtp_auth_error);
						_data_->smtp_auth_error = _data_->_tmp315_;
					}
					_g_error_free0 (_data_->_vala2_e);
				}
				__finally2:
				if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
					g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
					_g_object_unref0 (_data_->smtp_auth_cancellable);
					_g_error_free0 (_data_->smtp_auth_error);
					(_data_->smtp_auth_types == NULL) ? NULL : (_data_->smtp_auth_types = (g_list_free (_data_->smtp_auth_types), NULL));
					_g_object_unref0 (_data_->transport_service);
					_g_error_free0 (_data_->imap_auth_error);
					(_data_->imap_auth_types == NULL) ? NULL : (_data_->imap_auth_types = (g_list_free (_data_->imap_auth_types), NULL));
					_g_object_unref0 (_data_->imap_service);
					_g_object_unref0 (_data_->transport_source);
					_g_object_unref0 (_data_->identity_source);
					_g_object_unref0 (_data_->account_source);
					g_object_unref (_data_->_async_result);
					return FALSE;
				}
				online_accounts_imap_dialog_unset_cancel_timeout (_data_->self);
				_g_object_unref0 (_data_->smtp_auth_cancellable);
			}
		}
	}
	_data_->_tmp316_ = _data_->smtp_auth_error;
	if (_data_->_tmp316_ != NULL) {
		_data_->_tmp317_ = _data_->smtp_auth_error;
		_data_->_tmp318_ = _data_->_tmp317_->message;
		_data_->_tmp319_ = g_strdup_printf ("SMTP verification failed: %s", _data_->_tmp318_);
		_data_->_tmp320_ = _data_->_tmp319_;
		_data_->_tmp321_ = g_error_new (camel_service_error_quark (), CAMEL_SERVICE_ERROR_CANT_AUTHENTICATE, "%s", _data_->_tmp320_);
		_data_->_tmp322_ = _data_->_tmp321_;
		_g_free0 (_data_->_tmp320_);
		_data_->_inner_error0_ = _data_->_tmp322_;
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_error_free0 (_data_->smtp_auth_error);
		(_data_->smtp_auth_types == NULL) ? NULL : (_data_->smtp_auth_types = (g_list_free (_data_->smtp_auth_types), NULL));
		_g_object_unref0 (_data_->transport_service);
		_g_error_free0 (_data_->imap_auth_error);
		(_data_->imap_auth_types == NULL) ? NULL : (_data_->imap_auth_types = (g_list_free (_data_->imap_auth_types), NULL));
		_g_object_unref0 (_data_->imap_service);
		_g_object_unref0 (_data_->transport_source);
		_g_object_unref0 (_data_->identity_source);
		_g_object_unref0 (_data_->account_source);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp323_ = _data_->self->priv->cancellable;
	if (g_cancellable_is_cancelled (_data_->_tmp323_)) {
		_g_error_free0 (_data_->smtp_auth_error);
		(_data_->smtp_auth_types == NULL) ? NULL : (_data_->smtp_auth_types = (g_list_free (_data_->smtp_auth_types), NULL));
		_g_object_unref0 (_data_->transport_service);
		_g_error_free0 (_data_->imap_auth_error);
		(_data_->imap_auth_types == NULL) ? NULL : (_data_->imap_auth_types = (g_list_free (_data_->imap_auth_types), NULL));
		_g_object_unref0 (_data_->imap_service);
		_g_object_unref0 (_data_->transport_source);
		_g_object_unref0 (_data_->identity_source);
		_g_object_unref0 (_data_->account_source);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp324_ = _data_->account_source;
	_data_->_tmp325_ = _data_->self->priv->login_page;
	_data_->_tmp326_ = online_accounts_imap_login_page_get_password (_data_->_tmp325_);
	_data_->_tmp327_ = _data_->_tmp326_;
	_data_->_tmp328_ = _data_->self->priv->cancellable;
	_data_->_state_ = 9;
	e_source_store_password (_data_->_tmp324_, _data_->_tmp327_, TRUE, _data_->_tmp328_, online_accounts_imap_dialog_save_configuration_ready, _data_);
	return FALSE;
	_state_9:
	e_source_store_password_finish (_data_->_tmp324_, _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_error_free0 (_data_->smtp_auth_error);
		(_data_->smtp_auth_types == NULL) ? NULL : (_data_->smtp_auth_types = (g_list_free (_data_->smtp_auth_types), NULL));
		_g_object_unref0 (_data_->transport_service);
		_g_error_free0 (_data_->imap_auth_error);
		(_data_->imap_auth_types == NULL) ? NULL : (_data_->imap_auth_types = (g_list_free (_data_->imap_auth_types), NULL));
		_g_object_unref0 (_data_->imap_service);
		_g_object_unref0 (_data_->transport_source);
		_g_object_unref0 (_data_->identity_source);
		_g_object_unref0 (_data_->account_source);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp329_ = _data_->self->priv->use_imap_credentials;
	_data_->_tmp330_ = gtk_check_button_get_active (_data_->_tmp329_);
	_data_->_tmp331_ = _data_->_tmp330_;
	if (_data_->_tmp331_) {
		_data_->_tmp332_ = _data_->transport_source;
		_data_->_tmp333_ = _data_->self->priv->login_page;
		_data_->_tmp334_ = online_accounts_imap_login_page_get_password (_data_->_tmp333_);
		_data_->_tmp335_ = _data_->_tmp334_;
		_data_->_tmp336_ = _data_->self->priv->cancellable;
		_data_->_state_ = 10;
		e_source_store_password (_data_->_tmp332_, _data_->_tmp335_, TRUE, _data_->_tmp336_, online_accounts_imap_dialog_save_configuration_ready, _data_);
		return FALSE;
		_state_10:
		e_source_store_password_finish (_data_->_tmp332_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_error_free0 (_data_->smtp_auth_error);
			(_data_->smtp_auth_types == NULL) ? NULL : (_data_->smtp_auth_types = (g_list_free (_data_->smtp_auth_types), NULL));
			_g_object_unref0 (_data_->transport_service);
			_g_error_free0 (_data_->imap_auth_error);
			(_data_->imap_auth_types == NULL) ? NULL : (_data_->imap_auth_types = (g_list_free (_data_->imap_auth_types), NULL));
			_g_object_unref0 (_data_->imap_service);
			_g_object_unref0 (_data_->transport_source);
			_g_object_unref0 (_data_->identity_source);
			_g_object_unref0 (_data_->account_source);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	} else {
		_data_->_tmp337_ = _data_->transport_source;
		_data_->_tmp338_ = _data_->self->priv->smtp_password_entry;
		_data_->_tmp339_ = gtk_editable_get_text ((GtkEditable*) _data_->_tmp338_);
		_data_->_tmp340_ = _data_->_tmp339_;
		_data_->_tmp341_ = _data_->self->priv->cancellable;
		_data_->_state_ = 11;
		e_source_store_password (_data_->_tmp337_, _data_->_tmp340_, TRUE, _data_->_tmp341_, online_accounts_imap_dialog_save_configuration_ready, _data_);
		return FALSE;
		_state_11:
		e_source_store_password_finish (_data_->_tmp337_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_error_free0 (_data_->smtp_auth_error);
			(_data_->smtp_auth_types == NULL) ? NULL : (_data_->smtp_auth_types = (g_list_free (_data_->smtp_auth_types), NULL));
			_g_object_unref0 (_data_->transport_service);
			_g_error_free0 (_data_->imap_auth_error);
			(_data_->imap_auth_types == NULL) ? NULL : (_data_->imap_auth_types = (g_list_free (_data_->imap_auth_types), NULL));
			_g_object_unref0 (_data_->imap_service);
			_g_object_unref0 (_data_->transport_source);
			_g_object_unref0 (_data_->identity_source);
			_g_object_unref0 (_data_->account_source);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	_data_->_tmp342_ = _data_->self->priv->registry;
	_data_->_tmp343_ = _data_->account_source;
	_data_->_tmp344_ = _data_->self->priv->cancellable;
	_data_->_state_ = 12;
	e_source_registry_commit_source (_data_->_tmp342_, _data_->_tmp343_, _data_->_tmp344_, online_accounts_imap_dialog_save_configuration_ready, _data_);
	return FALSE;
	_state_12:
	e_source_registry_commit_source_finish (_data_->_tmp342_, _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_error_free0 (_data_->smtp_auth_error);
		(_data_->smtp_auth_types == NULL) ? NULL : (_data_->smtp_auth_types = (g_list_free (_data_->smtp_auth_types), NULL));
		_g_object_unref0 (_data_->transport_service);
		_g_error_free0 (_data_->imap_auth_error);
		(_data_->imap_auth_types == NULL) ? NULL : (_data_->imap_auth_types = (g_list_free (_data_->imap_auth_types), NULL));
		_g_object_unref0 (_data_->imap_service);
		_g_object_unref0 (_data_->transport_source);
		_g_object_unref0 (_data_->identity_source);
		_g_object_unref0 (_data_->account_source);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp345_ = _data_->self->priv->registry;
	_data_->_tmp346_ = _data_->identity_source;
	_data_->_tmp347_ = _data_->self->priv->cancellable;
	_data_->_state_ = 13;
	e_source_registry_commit_source (_data_->_tmp345_, _data_->_tmp346_, _data_->_tmp347_, online_accounts_imap_dialog_save_configuration_ready, _data_);
	return FALSE;
	_state_13:
	e_source_registry_commit_source_finish (_data_->_tmp345_, _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_error_free0 (_data_->smtp_auth_error);
		(_data_->smtp_auth_types == NULL) ? NULL : (_data_->smtp_auth_types = (g_list_free (_data_->smtp_auth_types), NULL));
		_g_object_unref0 (_data_->transport_service);
		_g_error_free0 (_data_->imap_auth_error);
		(_data_->imap_auth_types == NULL) ? NULL : (_data_->imap_auth_types = (g_list_free (_data_->imap_auth_types), NULL));
		_g_object_unref0 (_data_->imap_service);
		_g_object_unref0 (_data_->transport_source);
		_g_object_unref0 (_data_->identity_source);
		_g_object_unref0 (_data_->account_source);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp348_ = _data_->self->priv->registry;
	_data_->_tmp349_ = _data_->transport_source;
	_data_->_tmp350_ = _data_->self->priv->cancellable;
	_data_->_state_ = 14;
	e_source_registry_commit_source (_data_->_tmp348_, _data_->_tmp349_, _data_->_tmp350_, online_accounts_imap_dialog_save_configuration_ready, _data_);
	return FALSE;
	_state_14:
	e_source_registry_commit_source_finish (_data_->_tmp348_, _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_error_free0 (_data_->smtp_auth_error);
		(_data_->smtp_auth_types == NULL) ? NULL : (_data_->smtp_auth_types = (g_list_free (_data_->smtp_auth_types), NULL));
		_g_object_unref0 (_data_->transport_service);
		_g_error_free0 (_data_->imap_auth_error);
		(_data_->imap_auth_types == NULL) ? NULL : (_data_->imap_auth_types = (g_list_free (_data_->imap_auth_types), NULL));
		_g_object_unref0 (_data_->imap_service);
		_g_object_unref0 (_data_->transport_source);
		_g_object_unref0 (_data_->identity_source);
		_g_object_unref0 (_data_->account_source);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_g_error_free0 (_data_->smtp_auth_error);
	(_data_->smtp_auth_types == NULL) ? NULL : (_data_->smtp_auth_types = (g_list_free (_data_->smtp_auth_types), NULL));
	_g_object_unref0 (_data_->transport_service);
	_g_error_free0 (_data_->imap_auth_error);
	(_data_->imap_auth_types == NULL) ? NULL : (_data_->imap_auth_types = (g_list_free (_data_->imap_auth_types), NULL));
	_g_object_unref0 (_data_->imap_service);
	_g_object_unref0 (_data_->transport_source);
	_g_object_unref0 (_data_->identity_source);
	_g_object_unref0 (_data_->account_source);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

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

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

static gboolean
__lambda28_ (Block6Data* _data6_)
{
	OnlineAccountsImapDialog* self;
	gboolean result;
	self = _data6_->self;
	self->priv->cancel_timeout_id = (guint) 0;
	g_cancellable_cancel (_data6_->cancellable);
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda28__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda28_ (self);
	return result;
}

static void
online_accounts_imap_dialog_set_cancel_timeout (OnlineAccountsImapDialog* self,
                                                GCancellable* cancellable)
{
	Block6Data* _data6_;
	GCancellable* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (cancellable != NULL);
	_data6_ = g_slice_new0 (Block6Data);
	_data6_->_ref_count_ = 1;
	_data6_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (_data6_->cancellable);
	_data6_->cancellable = _tmp0_;
	self->priv->cancel_timeout_id = g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 4000, ___lambda28__gsource_func, block6_data_ref (_data6_), block6_data_unref);
	block6_data_unref (_data6_);
	_data6_ = NULL;
}

static void
online_accounts_imap_dialog_unset_cancel_timeout (OnlineAccountsImapDialog* self)
{
	g_return_if_fail (self != NULL);
	if (self->priv->cancel_timeout_id != ((guint) 0)) {
		g_source_remove (self->priv->cancel_timeout_id);
	}
}

static gboolean
bool_parse (const gchar* str)
{
	gboolean result;
	g_return_val_if_fail (str != NULL, FALSE);
	if (g_strcmp0 (str, "true") == 0) {
		result = TRUE;
		return result;
	} else {
		result = FALSE;
		return result;
	}
}

static gchar
string_get (const gchar* self,
            glong index)
{
	gchar _tmp0_;
	gchar result;
	g_return_val_if_fail (self != NULL, '\0');
	_tmp0_ = ((gchar*) self)[index];
	result = _tmp0_;
	return result;
}

static gint
string_index_of_nth_char (const gchar* self,
                          glong c)
{
	gchar* _tmp0_;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	_tmp0_ = g_utf8_offset_to_pointer (self, c);
	result = (gint) (_tmp0_ - ((gchar*) self));
	return result;
}

static glong
string_strnlen (gchar* str,
                glong maxlen)
{
	gchar* end = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	glong result;
	_tmp0_ = memchr (str, 0, (gsize) maxlen);
	end = _tmp0_;
	_tmp1_ = end;
	if (_tmp1_ == NULL) {
		result = maxlen;
		return result;
	} else {
		gchar* _tmp2_;
		_tmp2_ = end;
		result = (glong) (_tmp2_ - str);
		return result;
	}
}

static gchar*
string_substring (const gchar* self,
                  glong offset,
                  glong len)
{
	glong string_length = 0L;
	gboolean _tmp0_ = FALSE;
	gchar* _tmp3_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	if (offset >= ((glong) 0)) {
		_tmp0_ = len >= ((glong) 0);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		string_length = string_strnlen ((gchar*) self, offset + len);
	} else {
		gint _tmp1_;
		gint _tmp2_;
		_tmp1_ = strlen (self);
		_tmp2_ = _tmp1_;
		string_length = (glong) _tmp2_;
	}
	if (offset < ((glong) 0)) {
		offset = string_length + offset;
		g_return_val_if_fail (offset >= ((glong) 0), NULL);
	} else {
		g_return_val_if_fail (offset <= string_length, NULL);
	}
	if (len < ((glong) 0)) {
		len = string_length - offset;
	}
	g_return_val_if_fail ((offset + len) <= string_length, NULL);
	_tmp3_ = g_strndup (((gchar*) self) + offset, (gsize) len);
	result = _tmp3_;
	return result;
}

static void
online_accounts_imap_dialog_save_initial_setup_key_for_source (OnlineAccountsImapDialog* self,
                                                               ESource* source,
                                                               const gchar* extension_name,
                                                               const gchar* property_name,
                                                               const gchar* property_type,
                                                               const gchar* val,
                                                               const gchar* encoded_account_uri)
{
	ESourceExtension* extension = NULL;
	ESourceExtension* _tmp0_;
	ESourceExtension* _tmp1_;
	const gchar* _tmp4_;
	GQuark _tmp6_ = 0U;
	static GQuark _tmp5_label0 = 0;
	static GQuark _tmp5_label1 = 0;
	static GQuark _tmp5_label2 = 0;
	static GQuark _tmp5_label3 = 0;
	g_return_if_fail (self != NULL);
	g_return_if_fail (source != NULL);
	g_return_if_fail (extension_name != NULL);
	g_return_if_fail (property_name != NULL);
	g_return_if_fail (val != NULL);
	g_return_if_fail (encoded_account_uri != NULL);
	_tmp0_ = e_source_get_extension (source, extension_name);
	extension = _tmp0_;
	_tmp1_ = extension;
	if (_tmp1_ == NULL) {
		const gchar* _tmp2_;
		const gchar* _tmp3_;
		_tmp2_ = e_source_get_display_name (source);
		_tmp3_ = _tmp2_;
		g_warning ("ImapDialog.vala:835: Extension '%s' not found for source '%s'", extension_name, _tmp3_);
		return;
	}
	if (property_type == NULL) {
		property_type = "s";
	}
	_tmp4_ = property_type;
	_tmp6_ = (NULL == _tmp4_) ? 0 : g_quark_from_string (_tmp4_);
	if (_tmp6_ == ((0 != _tmp5_label0) ? _tmp5_label0 : (_tmp5_label0 = g_quark_from_static_string ("s")))) {
		switch (0) {
			default:
			{
				ESourceExtension* _tmp7_;
				_tmp7_ = extension;
				g_object_set ((GObject*) _tmp7_, property_name, val, NULL);
				break;
			}
		}
	} else if (_tmp6_ == ((0 != _tmp5_label1) ? _tmp5_label1 : (_tmp5_label1 = g_quark_from_static_string ("b")))) {
		switch (0) {
			default:
			{
				gboolean bool_val = FALSE;
				ESourceExtension* _tmp8_;
				bool_val = bool_parse (val);
				_tmp8_ = extension;
				g_object_set ((GObject*) _tmp8_, property_name, bool_val, NULL);
				break;
			}
		}
	} else if (_tmp6_ == ((0 != _tmp5_label2) ? _tmp5_label2 : (_tmp5_label2 = g_quark_from_static_string ("i")))) {
		switch (0) {
			default:
			{
				gint int_val = 0;
				ESourceExtension* _tmp9_;
				int_val = atoi (val);
				_tmp9_ = extension;
				g_object_set ((GObject*) _tmp9_, property_name, int_val, NULL);
				break;
			}
		}
	} else if (_tmp6_ == ((0 != _tmp5_label3) ? _tmp5_label3 : (_tmp5_label3 = g_quark_from_static_string ("f")))) {
		switch (0) {
			default:
			{
				gchar* folder_val = NULL;
				gchar* _tmp10_;
				const gchar* _tmp11_;
				gchar* full_folder_uri = NULL;
				gchar* _tmp15_;
				gchar* _tmp16_;
				gchar* _tmp17_;
				gchar* _tmp18_;
				ESourceExtension* _tmp19_;
				const gchar* _tmp20_;
				_tmp10_ = g_strdup (val);
				folder_val = _tmp10_;
				_tmp11_ = folder_val;
				if (string_get (_tmp11_, (glong) 0) == '/') {
					gint start = 0;
					const gchar* _tmp12_;
					const gchar* _tmp13_;
					gchar* _tmp14_;
					_tmp12_ = folder_val;
					start = string_index_of_nth_char (_tmp12_, (glong) 1);
					_tmp13_ = folder_val;
					_tmp14_ = string_substring (_tmp13_, (glong) start, (glong) -1);
					_g_free0 (folder_val);
					folder_val = _tmp14_;
				}
				_tmp15_ = camel_url_encode (val, ":;@?#");
				_tmp16_ = _tmp15_;
				_tmp17_ = g_strdup_printf ("folder://%s/%s", encoded_account_uri, _tmp16_);
				_tmp18_ = _tmp17_;
				_g_free0 (_tmp16_);
				full_folder_uri = _tmp18_;
				_tmp19_ = extension;
				_tmp20_ = full_folder_uri;
				g_object_set ((GObject*) _tmp19_, property_name, _tmp20_, NULL);
				_g_free0 (full_folder_uri);
				_g_free0 (folder_val);
				break;
			}
		}
	} else {
		switch (0) {
			default:
			{
				g_warning ("ImapDialog.vala:868: Unknown type identifier '%s' provided", property_type);
				break;
			}
		}
	}
}

OnlineAccountsImapDialog*
online_accounts_imap_dialog_construct (GType object_type)
{
	OnlineAccountsImapDialog * self = NULL;
	self = (OnlineAccountsImapDialog*) online_accounts_paged_dialog_construct (object_type);
	return self;
}

OnlineAccountsImapDialog*
online_accounts_imap_dialog_new (void)
{
	return online_accounts_imap_dialog_construct (ONLINE_ACCOUNTS_TYPE_IMAP_DIALOG);
}

static void
_gtk_window_destroy_online_accounts_imap_login_page_cancel (OnlineAccountsImapLoginPage* _sender,
                                                            gpointer self)
{
	gtk_window_destroy ((GtkWindow*) self);
}

static void
_online_accounts_imap_dialog___lambda29_ (OnlineAccountsImapDialog* self)
{
	GtkButton* _tmp0_;
	_tmp0_ = self->priv->save_button;
	gtk_window_set_default_widget ((GtkWindow*) self, (GtkWidget*) _tmp0_);
}

static void
__online_accounts_imap_dialog___lambda29__adw_navigation_page_shown (AdwNavigationPage* _sender,
                                                                     gpointer self)
{
	_online_accounts_imap_dialog___lambda29_ ((OnlineAccountsImapDialog*) self);
}

static void
_online_accounts_imap_dialog___lambda30_ (OnlineAccountsImapDialog* self)
{
	AdwNavigationPage* _tmp0_;
	_tmp0_ = self->priv->main_page;
	online_accounts_paged_dialog_push_page ((OnlineAccountsPagedDialog*) self, _tmp0_);
}

static void
__online_accounts_imap_dialog___lambda30__online_accounts_imap_login_page_next (OnlineAccountsImapLoginPage* _sender,
                                                                                gpointer self)
{
	_online_accounts_imap_dialog___lambda30_ ((OnlineAccountsImapDialog*) self);
}

static void
_online_accounts_imap_dialog___lambda31_ (OnlineAccountsImapDialog* self)
{
	OnlineAccountsImapLoginPage* _tmp0_;
	GtkButton* _tmp1_;
	GtkButton* _tmp2_;
	_tmp0_ = self->priv->login_page;
	_tmp1_ = online_accounts_imap_login_page_get_next_button (_tmp0_);
	_tmp2_ = _tmp1_;
	gtk_window_set_default_widget ((GtkWindow*) self, (GtkWidget*) _tmp2_);
}

static void
__online_accounts_imap_dialog___lambda31__adw_navigation_page_shown (AdwNavigationPage* _sender,
                                                                     gpointer self)
{
	_online_accounts_imap_dialog___lambda31_ ((OnlineAccountsImapDialog*) self);
}

static void
_online_accounts_imap_dialog___lambda32_ (OnlineAccountsImapDialog* self)
{
	online_accounts_paged_dialog_pop_page ((OnlineAccountsPagedDialog*) self);
}

static void
__online_accounts_imap_dialog___lambda32__gtk_button_clicked (GtkButton* _sender,
                                                              gpointer self)
{
	_online_accounts_imap_dialog___lambda32_ ((OnlineAccountsImapDialog*) self);
}

static void
_online_accounts_imap_dialog___lambda33_ (OnlineAccountsImapDialog* self)
{
	gboolean _tmp0_ = FALSE;
	GtkCheckButton* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	GtkRevealer* _tmp7_;
	GtkCheckButton* _tmp8_;
	GtkCheckButton* _tmp9_;
	gboolean _tmp10_;
	gboolean _tmp11_;
	_tmp1_ = self->priv->smtp_no_credentials;
	_tmp2_ = gtk_check_button_get_active (_tmp1_);
	_tmp3_ = _tmp2_;
	if (!_tmp3_) {
		GtkCheckButton* _tmp4_;
		gboolean _tmp5_;
		gboolean _tmp6_;
		_tmp4_ = self->priv->use_imap_credentials;
		_tmp5_ = gtk_check_button_get_active (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp0_ = !_tmp6_;
	} else {
		_tmp0_ = FALSE;
	}
	_tmp7_ = self->priv->smtp_revealer;
	gtk_revealer_set_reveal_child (_tmp7_, _tmp0_);
	_tmp8_ = self->priv->use_imap_credentials;
	_tmp9_ = self->priv->smtp_no_credentials;
	_tmp10_ = gtk_check_button_get_active (_tmp9_);
	_tmp11_ = _tmp10_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp8_, !_tmp11_);
}

static void
__online_accounts_imap_dialog___lambda33__g_object_notify (GObject* _sender,
                                                           GParamSpec* pspec,
                                                           gpointer self)
{
	_online_accounts_imap_dialog___lambda33_ ((OnlineAccountsImapDialog*) self);
}

static gboolean
string_contains (const gchar* self,
                 const gchar* needle)
{
	gchar* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (needle != NULL, FALSE);
	_tmp0_ = strstr ((gchar*) self, (gchar*) needle);
	result = _tmp0_ != NULL;
	return result;
}

static gchar*
string_strip (const gchar* self)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup (self);
	_result_ = _tmp0_;
	g_strstrip (_result_);
	result = _result_;
	return result;
}

static gchar*
string_replace (const gchar* self,
                const gchar* old,
                const gchar* replacement)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GError* _inner_error0_ = NULL;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (old != NULL, NULL);
	g_return_val_if_fail (replacement != NULL, NULL);
	if ((*((gchar*) self)) == '\0') {
		_tmp1_ = TRUE;
	} else {
		_tmp1_ = (*((gchar*) old)) == '\0';
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = g_strcmp0 (old, replacement) == 0;
	}
	if (_tmp0_) {
		gchar* _tmp2_;
		_tmp2_ = g_strdup (self);
		result = _tmp2_;
		return result;
	}
	{
		GRegex* regex = NULL;
		gchar* _tmp3_;
		gchar* _tmp4_;
		GRegex* _tmp5_;
		GRegex* _tmp6_;
		gchar* _tmp7_ = NULL;
		GRegex* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		_tmp3_ = g_regex_escape_string (old, -1);
		_tmp4_ = _tmp3_;
		_tmp5_ = g_regex_new (_tmp4_, 0, 0, &_inner_error0_);
		_tmp6_ = _tmp5_;
		_g_free0 (_tmp4_);
		regex = _tmp6_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		_tmp8_ = regex;
		_tmp9_ = g_regex_replace_literal (_tmp8_, self, (gssize) -1, 0, replacement, 0, &_inner_error0_);
		_tmp7_ = _tmp9_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_regex_unref0 (regex);
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		_tmp10_ = _tmp7_;
		_tmp7_ = NULL;
		result = _tmp10_;
		_g_free0 (_tmp7_);
		_g_regex_unref0 (regex);
		return result;
	}
	goto __finally0;
	__catch0_g_regex_error:
	{
		g_clear_error (&_inner_error0_);
		g_assert_not_reached ();
	}
	__finally0:
	g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
	g_clear_error (&_inner_error0_);
	return NULL;
}

static void
_online_accounts_imap_dialog___lambda34_ (OnlineAccountsImapDialog* self)
{
	OnlineAccountsImapLoginPage* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	_tmp0_ = self->priv->login_page;
	_tmp1_ = online_accounts_imap_login_page_get_email (_tmp0_);
	_tmp2_ = _tmp1_;
	if (string_contains (_tmp2_, "@")) {
		gchar* domain = NULL;
		OnlineAccountsImapLoginPage* _tmp3_;
		const gchar* _tmp4_;
		const gchar* _tmp5_;
		gchar** _tmp6_;
		gchar** _tmp7_;
		gchar** _tmp8_;
		gint _tmp8__length1;
		const gchar* _tmp9_;
		gchar* _tmp10_;
		gchar* _tmp11_;
		gchar* _tmp12_;
		gchar* _tmp13_;
		const gchar* _tmp14_;
		gint _tmp15_;
		gint _tmp16_;
		GraniteValidatedEntry* _tmp25_;
		OnlineAccountsImapLoginPage* _tmp26_;
		const gchar* _tmp27_;
		const gchar* _tmp28_;
		GtkEntry* _tmp29_;
		OnlineAccountsImapLoginPage* _tmp30_;
		const gchar* _tmp31_;
		const gchar* _tmp32_;
		_tmp3_ = self->priv->login_page;
		_tmp4_ = online_accounts_imap_login_page_get_email (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp7_ = _tmp6_ = g_strsplit (_tmp5_, "@", 2);
		_tmp8_ = _tmp7_;
		_tmp8__length1 = _vala_array_length (_tmp6_);
		_tmp9_ = _tmp8_[1];
		_tmp10_ = string_strip (_tmp9_);
		_tmp11_ = _tmp10_;
		_tmp12_ = string_replace (_tmp11_, "@", "");
		_tmp13_ = _tmp12_;
		_g_free0 (_tmp11_);
		_tmp8_ = (_vala_array_free (_tmp8_, _tmp8__length1, (GDestroyNotify) g_free), NULL);
		domain = _tmp13_;
		_tmp14_ = domain;
		_tmp15_ = strlen (_tmp14_);
		_tmp16_ = _tmp15_;
		if (_tmp16_ > 0) {
			GraniteValidatedEntry* _tmp17_;
			const gchar* _tmp18_;
			gchar* _tmp19_;
			gchar* _tmp20_;
			GraniteValidatedEntry* _tmp21_;
			const gchar* _tmp22_;
			gchar* _tmp23_;
			gchar* _tmp24_;
			_tmp17_ = self->priv->imap_server_entry;
			_tmp18_ = domain;
			_tmp19_ = g_strconcat ("imap.", _tmp18_, NULL);
			_tmp20_ = _tmp19_;
			gtk_editable_set_text ((GtkEditable*) _tmp17_, _tmp20_);
			_g_free0 (_tmp20_);
			_tmp21_ = self->priv->smtp_server_entry;
			_tmp22_ = domain;
			_tmp23_ = g_strconcat ("smtp.", _tmp22_, NULL);
			_tmp24_ = _tmp23_;
			gtk_editable_set_text ((GtkEditable*) _tmp21_, _tmp24_);
			_g_free0 (_tmp24_);
		}
		_tmp25_ = self->priv->imap_username_entry;
		_tmp26_ = self->priv->login_page;
		_tmp27_ = online_accounts_imap_login_page_get_email (_tmp26_);
		_tmp28_ = _tmp27_;
		gtk_editable_set_text ((GtkEditable*) _tmp25_, _tmp28_);
		_tmp29_ = self->priv->smtp_username_entry;
		_tmp30_ = self->priv->login_page;
		_tmp31_ = online_accounts_imap_login_page_get_email (_tmp30_);
		_tmp32_ = _tmp31_;
		gtk_editable_set_text ((GtkEditable*) _tmp29_, _tmp32_);
		_g_free0 (domain);
	}
	online_accounts_imap_dialog_set_button_sensitivity (self);
}

static void
__online_accounts_imap_dialog___lambda34__g_object_notify (GObject* _sender,
                                                           GParamSpec* pspec,
                                                           gpointer self)
{
	_online_accounts_imap_dialog___lambda34_ ((OnlineAccountsImapDialog*) self);
}

static void
_online_accounts_imap_dialog___lambda35_ (OnlineAccountsImapDialog* self)
{
	GraniteValidatedEntry* _tmp0_;
	GraniteValidatedEntry* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	GtkCheckButton* _tmp6_;
	gboolean _tmp7_;
	gboolean _tmp8_;
	_tmp0_ = self->priv->imap_username_entry;
	_tmp1_ = self->priv->imap_username_entry;
	_tmp2_ = gtk_editable_get_text ((GtkEditable*) _tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = strlen (_tmp3_);
	_tmp5_ = _tmp4_;
	granite_validated_entry_set_is_valid (_tmp0_, _tmp5_ > 0);
	_tmp6_ = self->priv->use_imap_credentials;
	_tmp7_ = gtk_check_button_get_active (_tmp6_);
	_tmp8_ = _tmp7_;
	if (_tmp8_) {
		GtkEntry* _tmp9_;
		GraniteValidatedEntry* _tmp10_;
		const gchar* _tmp11_;
		const gchar* _tmp12_;
		_tmp9_ = self->priv->smtp_username_entry;
		_tmp10_ = self->priv->imap_username_entry;
		_tmp11_ = gtk_editable_get_text ((GtkEditable*) _tmp10_);
		_tmp12_ = _tmp11_;
		gtk_editable_set_text ((GtkEditable*) _tmp9_, _tmp12_);
	}
	online_accounts_imap_dialog_set_button_sensitivity (self);
}

static void
__online_accounts_imap_dialog___lambda35__gtk_editable_changed (GtkEditable* _sender,
                                                                gpointer self)
{
	_online_accounts_imap_dialog___lambda35_ ((OnlineAccountsImapDialog*) self);
}

static void
_online_accounts_imap_dialog___lambda36_ (OnlineAccountsImapDialog* self)
{
	GraniteValidatedEntry* _tmp0_;
	GraniteValidatedEntry* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	_tmp0_ = self->priv->imap_server_entry;
	_tmp1_ = self->priv->imap_server_entry;
	_tmp2_ = gtk_editable_get_text ((GtkEditable*) _tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = strlen (_tmp3_);
	_tmp5_ = _tmp4_;
	granite_validated_entry_set_is_valid (_tmp0_, _tmp5_ > 3);
	online_accounts_imap_dialog_set_button_sensitivity (self);
}

static void
__online_accounts_imap_dialog___lambda36__gtk_editable_changed (GtkEditable* _sender,
                                                                gpointer self)
{
	_online_accounts_imap_dialog___lambda36_ ((OnlineAccountsImapDialog*) self);
}

static void
_online_accounts_imap_dialog___lambda37_ (OnlineAccountsImapDialog* self)
{
	GtkComboBoxText* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	_tmp0_ = self->priv->imap_encryption_combobox;
	_tmp1_ = gtk_combo_box_get_active ((GtkComboBox*) _tmp0_);
	_tmp2_ = _tmp1_;
	switch (_tmp2_) {
		case 1:
		{
			GtkSpinButton* _tmp3_;
			_tmp3_ = self->priv->imap_port_spin;
			gtk_spin_button_set_value (_tmp3_, (gdouble) 993);
			break;
		}
		case 2:
		{
			GtkSpinButton* _tmp4_;
			_tmp4_ = self->priv->imap_port_spin;
			gtk_spin_button_set_value (_tmp4_, (gdouble) 143);
			break;
		}
		default:
		{
			GtkSpinButton* _tmp5_;
			_tmp5_ = self->priv->imap_port_spin;
			gtk_spin_button_set_value (_tmp5_, (gdouble) 143);
			break;
		}
	}
}

static void
__online_accounts_imap_dialog___lambda37__gtk_combo_box_changed (GtkComboBox* _sender,
                                                                 gpointer self)
{
	_online_accounts_imap_dialog___lambda37_ ((OnlineAccountsImapDialog*) self);
}

static void
_online_accounts_imap_dialog___lambda38_ (OnlineAccountsImapDialog* self)
{
	GraniteValidatedEntry* _tmp0_;
	GraniteValidatedEntry* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	_tmp0_ = self->priv->smtp_server_entry;
	_tmp1_ = self->priv->smtp_server_entry;
	_tmp2_ = gtk_editable_get_text ((GtkEditable*) _tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = strlen (_tmp3_);
	_tmp5_ = _tmp4_;
	granite_validated_entry_set_is_valid (_tmp0_, _tmp5_ > 3);
	online_accounts_imap_dialog_set_button_sensitivity (self);
}

static void
__online_accounts_imap_dialog___lambda38__gtk_editable_changed (GtkEditable* _sender,
                                                                gpointer self)
{
	_online_accounts_imap_dialog___lambda38_ ((OnlineAccountsImapDialog*) self);
}

static void
_online_accounts_imap_dialog___lambda39_ (OnlineAccountsImapDialog* self)
{
	GtkComboBoxText* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	_tmp0_ = self->priv->smtp_encryption_combobox;
	_tmp1_ = gtk_combo_box_get_active ((GtkComboBox*) _tmp0_);
	_tmp2_ = _tmp1_;
	switch (_tmp2_) {
		case 1:
		{
			GtkSpinButton* _tmp3_;
			_tmp3_ = self->priv->smtp_port_spin;
			gtk_spin_button_set_value (_tmp3_, (gdouble) 465);
			break;
		}
		case 2:
		{
			GtkSpinButton* _tmp4_;
			_tmp4_ = self->priv->smtp_port_spin;
			gtk_spin_button_set_value (_tmp4_, (gdouble) 587);
			break;
		}
		default:
		{
			GtkSpinButton* _tmp5_;
			_tmp5_ = self->priv->smtp_port_spin;
			gtk_spin_button_set_value (_tmp5_, (gdouble) 25);
			break;
		}
	}
}

static void
__online_accounts_imap_dialog___lambda39__gtk_combo_box_changed (GtkComboBox* _sender,
                                                                 gpointer self)
{
	_online_accounts_imap_dialog___lambda39_ ((OnlineAccountsImapDialog*) self);
}

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

static void
block7_data_unref (void * _userdata_)
{
	Block7Data* _data7_;
	_data7_ = (Block7Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data7_->_ref_count_)) {
		OnlineAccountsImapDialog* self;
		self = _data7_->self;
		_g_object_unref0 (_data7_->finalize_page);
		_g_object_unref0 (self);
		g_slice_free (Block7Data, _data7_);
	}
}

static void
__lambda41_ (Block7Data* _data7_,
             GObject* obj,
             GAsyncResult* res)
{
	OnlineAccountsImapDialog* self;
	GError* _inner_error0_ = NULL;
	self = _data7_->self;
	g_return_if_fail (res != NULL);
	{
		OnlineAccountsFinalizePage* _tmp0_;
		online_accounts_imap_dialog_save_configuration_finish (self, res, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp0_ = _data7_->finalize_page;
		online_accounts_finalize_page_show_success (_tmp0_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		OnlineAccountsFinalizePage* _tmp1_;
		GError* _tmp2_;
		const gchar* _tmp3_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp1_ = _data7_->finalize_page;
		_tmp2_ = e;
		_tmp3_ = _tmp2_->message;
		online_accounts_finalize_page_show_error (_tmp1_, _tmp3_);
		_g_error_free0 (e);
	}
	__finally0:
	{
		GError* _inner_error1_ = NULL;
		_g_object_unref0 (self->priv->cancellable);
		self->priv->cancellable = NULL;
	}
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
___lambda41__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda41_ (self, source_object, res);
	block7_data_unref (self);
}

static void
_online_accounts_imap_dialog___lambda40_ (OnlineAccountsImapDialog* self)
{
	Block7Data* _data7_;
	GCancellable* _tmp0_;
	GCancellable* _tmp2_;
	GThemedIcon* _tmp3_;
	GThemedIcon* _tmp4_;
	GCancellable* _tmp5_;
	OnlineAccountsFinalizePage* _tmp6_;
	OnlineAccountsFinalizePage* _tmp7_;
	OnlineAccountsFinalizePage* _tmp8_;
	_data7_ = g_slice_new0 (Block7Data);
	_data7_->_ref_count_ = 1;
	_data7_->self = g_object_ref (self);
	_tmp0_ = self->priv->cancellable;
	if (_tmp0_ != NULL) {
		GCancellable* _tmp1_;
		_tmp1_ = self->priv->cancellable;
		g_cancellable_cancel (_tmp1_);
	}
	_tmp2_ = g_cancellable_new ();
	_g_object_unref0 (self->priv->cancellable);
	self->priv->cancellable = _tmp2_;
	_tmp3_ = (GThemedIcon*) g_themed_icon_new ("onlineaccounts-mail");
	_tmp4_ = _tmp3_;
	_tmp5_ = self->priv->cancellable;
	_tmp6_ = online_accounts_finalize_page_new ((GIcon*) _tmp4_, _tmp5_);
	g_object_ref_sink (_tmp6_);
	_tmp7_ = _tmp6_;
	_g_object_unref0 (_tmp4_);
	_data7_->finalize_page = _tmp7_;
	_tmp8_ = _data7_->finalize_page;
	online_accounts_paged_dialog_push_page ((OnlineAccountsPagedDialog*) self, (AdwNavigationPage*) _tmp8_);
	online_accounts_imap_dialog_save_configuration (self, ___lambda41__gasync_ready_callback, block7_data_ref (_data7_));
	block7_data_unref (_data7_);
	_data7_ = NULL;
}

static void
__online_accounts_imap_dialog___lambda40__gtk_button_clicked (GtkButton* _sender,
                                                              gpointer self)
{
	_online_accounts_imap_dialog___lambda40_ ((OnlineAccountsImapDialog*) self);
}

static void
_online_accounts_imap_dialog___lambda42_ (OnlineAccountsImapDialog* self,
                                          guint keyval)
{
	GCancellable* _tmp0_;
	if (keyval != GDK_KEY_Escape) {
		return;
	}
	_tmp0_ = self->priv->cancellable;
	if (_tmp0_ != NULL) {
		GCancellable* _tmp1_;
		_tmp1_ = self->priv->cancellable;
		g_cancellable_cancel (_tmp1_);
	}
	gtk_window_destroy ((GtkWindow*) self);
}

static void
__online_accounts_imap_dialog___lambda42__gtk_event_controller_key_key_released (GtkEventControllerKey* _sender,
                                                                                 guint keyval,
                                                                                 guint keycode,
                                                                                 GdkModifierType state,
                                                                                 gpointer self)
{
	_online_accounts_imap_dialog___lambda42_ ((OnlineAccountsImapDialog*) self, keyval);
}

static GObject *
online_accounts_imap_dialog_constructor (GType type,
                                         guint n_construct_properties,
                                         GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	OnlineAccountsImapDialog * self;
	OnlineAccountsImapLoginPage* _tmp0_;
	GraniteHeaderLabel* imap_header = NULL;
	GraniteHeaderLabel* _tmp1_;
	GraniteValidatedEntry* _tmp2_ = NULL;
	GtkLabel* imap_username_label = NULL;
	GraniteValidatedEntry* _tmp3_;
	GtkWidget* _tmp4_;
	GtkLabel* _tmp5_ = NULL;
	GtkLabel* imap_password_label = NULL;
	GtkLabel* _tmp6_ = NULL;
	GraniteValidatedEntry* _tmp7_ = NULL;
	GtkLabel* imap_url_label = NULL;
	GraniteValidatedEntry* _tmp8_;
	GtkWidget* _tmp9_;
	GtkLabel* _tmp10_ = NULL;
	GtkSpinButton* _tmp11_ = NULL;
	GtkSpinButton* _tmp12_ = NULL;
	GtkLabel* imap_port_label = NULL;
	GtkSpinButton* _tmp13_;
	GtkWidget* _tmp14_;
	GtkLabel* _tmp15_ = NULL;
	GtkLabel* imap_refresh_interval_label = NULL;
	GtkSpinButton* _tmp16_;
	GtkWidget* _tmp17_;
	GtkLabel* _tmp18_ = NULL;
	GtkComboBoxText* _tmp19_ = NULL;
	GtkComboBoxText* _tmp20_;
	GtkComboBoxText* _tmp21_;
	GtkComboBoxText* _tmp22_;
	GtkComboBoxText* _tmp23_;
	GtkLabel* imap_encryption_label = NULL;
	GtkComboBoxText* _tmp24_;
	GtkWidget* _tmp25_;
	GtkLabel* _tmp26_ = NULL;
	GtkGrid* imap_server_grid = NULL;
	GtkGrid* _tmp27_ = NULL;
	GtkGrid* _tmp28_;
	GraniteHeaderLabel* _tmp29_;
	GtkGrid* _tmp30_;
	GtkLabel* _tmp31_;
	GtkGrid* _tmp32_;
	GraniteValidatedEntry* _tmp33_;
	GtkGrid* _tmp34_;
	GtkLabel* _tmp35_;
	GtkGrid* _tmp36_;
	GraniteValidatedEntry* _tmp37_;
	GtkGrid* _tmp38_;
	GtkLabel* _tmp39_;
	GtkGrid* _tmp40_;
	GtkComboBoxText* _tmp41_;
	GtkGrid* _tmp42_;
	GtkLabel* _tmp43_;
	GtkGrid* _tmp44_;
	GtkSpinButton* _tmp45_;
	GtkGrid* _tmp46_;
	GtkLabel* _tmp47_;
	GtkGrid* _tmp48_;
	GtkSpinButton* _tmp49_;
	GtkCheckButton* _tmp50_ = NULL;
	GtkCheckButton* _tmp51_;
	GraniteHeaderLabel* smtp_header = NULL;
	GraniteHeaderLabel* _tmp52_;
	GtkEntry* _tmp53_ = NULL;
	GtkLabel* smtp_username_label = NULL;
	GtkEntry* _tmp54_;
	GtkWidget* _tmp55_;
	GtkLabel* _tmp56_ = NULL;
	GtkEntry* _tmp57_ = NULL;
	GtkLabel* smtp_password_label = NULL;
	GtkEntry* _tmp58_;
	GtkWidget* _tmp59_;
	GtkLabel* _tmp60_ = NULL;
	GtkGrid* smtp_credentials = NULL;
	GtkGrid* _tmp61_ = NULL;
	GtkGrid* _tmp62_;
	GtkLabel* _tmp63_;
	GtkGrid* _tmp64_;
	GtkEntry* _tmp65_;
	GtkGrid* _tmp66_;
	GtkLabel* _tmp67_;
	GtkGrid* _tmp68_;
	GtkEntry* _tmp69_;
	GtkGrid* _tmp70_;
	GtkWidget* _tmp71_;
	GtkRevealer* _tmp72_ = NULL;
	GraniteValidatedEntry* _tmp73_ = NULL;
	GtkLabel* smtp_url_label = NULL;
	GraniteValidatedEntry* _tmp74_;
	GtkWidget* _tmp75_;
	GtkLabel* _tmp76_ = NULL;
	GtkSpinButton* _tmp77_ = NULL;
	GtkLabel* smtp_port_label = NULL;
	GtkSpinButton* _tmp78_;
	GtkWidget* _tmp79_;
	GtkLabel* _tmp80_ = NULL;
	GtkComboBoxText* _tmp81_ = NULL;
	GtkComboBoxText* _tmp82_;
	GtkComboBoxText* _tmp83_;
	GtkComboBoxText* _tmp84_;
	GtkComboBoxText* _tmp85_;
	GtkLabel* smtp_encryption_label = NULL;
	GtkComboBoxText* _tmp86_;
	GtkWidget* _tmp87_;
	GtkLabel* _tmp88_ = NULL;
	GtkGrid* smtp_server_grid = NULL;
	GtkGrid* _tmp89_ = NULL;
	GtkGrid* _tmp90_;
	GraniteHeaderLabel* _tmp91_;
	GtkGrid* _tmp92_;
	GtkCheckButton* _tmp93_;
	GtkGrid* _tmp94_;
	GtkCheckButton* _tmp95_;
	GtkGrid* _tmp96_;
	GtkRevealer* _tmp97_;
	GtkGrid* _tmp98_;
	GtkLabel* _tmp99_;
	GtkGrid* _tmp100_;
	GraniteValidatedEntry* _tmp101_;
	GtkGrid* _tmp102_;
	GtkLabel* _tmp103_;
	GtkGrid* _tmp104_;
	GtkComboBoxText* _tmp105_;
	GtkGrid* _tmp106_;
	GtkLabel* _tmp107_;
	GtkGrid* _tmp108_;
	GtkSpinButton* _tmp109_;
	GtkSizeGroup* smtp_sizegroup = NULL;
	GtkSizeGroup* _tmp110_;
	GtkSizeGroup* _tmp111_;
	GtkLabel* _tmp112_;
	GtkSizeGroup* _tmp113_;
	GtkLabel* _tmp114_;
	GtkSizeGroup* _tmp115_;
	GtkLabel* _tmp116_;
	GtkSizeGroup* _tmp117_;
	GtkLabel* _tmp118_;
	GtkSizeGroup* _tmp119_;
	GtkLabel* _tmp120_;
	GtkButton* back_button = NULL;
	GtkButton* _tmp121_;
	GtkButton* _tmp122_ = NULL;
	GtkButton* _tmp123_;
	GtkBox* action_area = NULL;
	GtkBox* _tmp124_ = NULL;
	GtkBox* _tmp125_;
	GtkBox* _tmp126_;
	GtkButton* _tmp127_;
	GtkBox* _tmp128_;
	GtkButton* _tmp129_;
	GtkBox* main_box = NULL;
	GtkBox* _tmp130_;
	GtkBox* _tmp131_;
	GtkGrid* _tmp132_;
	GtkBox* _tmp133_;
	GtkGrid* _tmp134_;
	GtkBox* _tmp135_;
	GtkBox* _tmp136_;
	GtkBox* _tmp137_;
	AdwNavigationPage* _tmp138_;
	OnlineAccountsImapLoginPage* _tmp139_;
	OnlineAccountsImapLoginPage* _tmp140_;
	GtkButton* _tmp141_;
	GtkButton* _tmp142_;
	OnlineAccountsImapLoginPage* _tmp143_;
	AdwNavigationPage* _tmp144_;
	OnlineAccountsImapLoginPage* _tmp145_;
	OnlineAccountsImapLoginPage* _tmp146_;
	GtkButton* _tmp147_;
	GtkCheckButton* _tmp148_;
	GtkCheckButton* _tmp149_;
	GtkRevealer* _tmp150_;
	OnlineAccountsImapLoginPage* _tmp151_;
	GraniteValidatedEntry* _tmp152_;
	GraniteValidatedEntry* _tmp153_;
	GtkComboBoxText* _tmp154_;
	GraniteValidatedEntry* _tmp155_;
	GtkComboBoxText* _tmp156_;
	GtkButton* _tmp157_;
	GtkEventControllerKey* key_controller = NULL;
	GtkEventControllerKey* _tmp158_;
	GtkEventControllerKey* _tmp159_;
	GtkEventController* _tmp160_;
	GtkEventControllerKey* _tmp161_;
	parent_class = G_OBJECT_CLASS (online_accounts_imap_dialog_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, ONLINE_ACCOUNTS_TYPE_IMAP_DIALOG, OnlineAccountsImapDialog);
	_tmp0_ = online_accounts_imap_login_page_new ();
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->login_page);
	self->priv->login_page = _tmp0_;
	_tmp1_ = granite_header_label_new ("IMAP");
	g_object_ref_sink (_tmp1_);
	imap_header = _tmp1_;
	_tmp2_ = granite_validated_entry_new ();
	gtk_widget_set_hexpand ((GtkWidget*) _tmp2_, TRUE);
	g_object_ref_sink (_tmp2_);
	_g_object_unref0 (self->priv->imap_username_entry);
	self->priv->imap_username_entry = _tmp2_;
	_tmp3_ = self->priv->imap_username_entry;
	_tmp4_ = _g_object_ref0 ((GtkWidget*) _tmp3_);
	_tmp5_ = (GtkLabel*) gtk_label_new (_ ("Username:"));
	gtk_widget_set_halign ((GtkWidget*) _tmp5_, GTK_ALIGN_END);
	gtk_label_set_mnemonic_widget (_tmp5_, _tmp4_);
	_g_object_unref0 (_tmp4_);
	g_object_ref_sink (_tmp5_);
	imap_username_label = _tmp5_;
	_tmp6_ = (GtkLabel*) gtk_label_new (_ ("Password:"));
	gtk_widget_set_halign ((GtkWidget*) _tmp6_, GTK_ALIGN_END);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp6_, 18);
	g_object_ref_sink (_tmp6_);
	imap_password_label = _tmp6_;
	_tmp7_ = granite_validated_entry_new ();
	gtk_entry_set_input_purpose ((GtkEntry*) _tmp7_, GTK_INPUT_PURPOSE_URL);
	g_object_ref_sink (_tmp7_);
	_g_object_unref0 (self->priv->imap_server_entry);
	self->priv->imap_server_entry = _tmp7_;
	_tmp8_ = self->priv->imap_server_entry;
	_tmp9_ = _g_object_ref0 ((GtkWidget*) _tmp8_);
	_tmp10_ = (GtkLabel*) gtk_label_new (_ ("Server URL:"));
	gtk_widget_set_halign ((GtkWidget*) _tmp10_, GTK_ALIGN_END);
	gtk_label_set_mnemonic_widget (_tmp10_, _tmp9_);
	_g_object_unref0 (_tmp9_);
	g_object_ref_sink (_tmp10_);
	imap_url_label = _tmp10_;
	_tmp11_ = (GtkSpinButton*) gtk_spin_button_new_with_range ((gdouble) 1, (gdouble) G_MAXUINT16, (gdouble) 10);
	gtk_spin_button_set_value (_tmp11_, (gdouble) 993);
	g_object_ref_sink (_tmp11_);
	_g_object_unref0 (self->priv->imap_port_spin);
	self->priv->imap_port_spin = _tmp11_;
	_tmp12_ = (GtkSpinButton*) gtk_spin_button_new_with_range ((gdouble) 1, (gdouble) 60, (gdouble) 1);
	gtk_spin_button_set_value (_tmp12_, (gdouble) 10);
	g_object_ref_sink (_tmp12_);
	_g_object_unref0 (self->priv->imap_refresh_interval_spin);
	self->priv->imap_refresh_interval_spin = _tmp12_;
	_tmp13_ = self->priv->imap_port_spin;
	_tmp14_ = _g_object_ref0 ((GtkWidget*) _tmp13_);
	_tmp15_ = (GtkLabel*) gtk_label_new (_ ("Port:"));
	gtk_widget_set_halign ((GtkWidget*) _tmp15_, GTK_ALIGN_END);
	gtk_label_set_mnemonic_widget (_tmp15_, _tmp14_);
	_g_object_unref0 (_tmp14_);
	g_object_ref_sink (_tmp15_);
	imap_port_label = _tmp15_;
	_tmp16_ = self->priv->imap_refresh_interval_spin;
	_tmp17_ = _g_object_ref0 ((GtkWidget*) _tmp16_);
	_tmp18_ = (GtkLabel*) gtk_label_new (_ ("Refresh Interval in Minutes:"));
	gtk_widget_set_halign ((GtkWidget*) _tmp18_, GTK_ALIGN_END);
	gtk_label_set_mnemonic_widget (_tmp18_, _tmp17_);
	_g_object_unref0 (_tmp17_);
	g_object_ref_sink (_tmp18_);
	imap_refresh_interval_label = _tmp18_;
	_tmp19_ = (GtkComboBoxText*) gtk_combo_box_text_new ();
	gtk_widget_set_hexpand ((GtkWidget*) _tmp19_, TRUE);
	g_object_ref_sink (_tmp19_);
	_g_object_unref0 (self->priv->imap_encryption_combobox);
	self->priv->imap_encryption_combobox = _tmp19_;
	_tmp20_ = self->priv->imap_encryption_combobox;
	gtk_combo_box_text_append (_tmp20_, "none", _ ("None"));
	_tmp21_ = self->priv->imap_encryption_combobox;
	gtk_combo_box_text_append (_tmp21_, "ssl-on-alternate-port", "SSL/TLS");
	_tmp22_ = self->priv->imap_encryption_combobox;
	gtk_combo_box_text_append (_tmp22_, "starttls-on-standard-port", "STARTTLS");
	_tmp23_ = self->priv->imap_encryption_combobox;
	gtk_combo_box_set_active ((GtkComboBox*) _tmp23_, 1);
	_tmp24_ = self->priv->imap_encryption_combobox;
	_tmp25_ = _g_object_ref0 ((GtkWidget*) _tmp24_);
	_tmp26_ = (GtkLabel*) gtk_label_new (_ ("Encryption:"));
	gtk_widget_set_halign ((GtkWidget*) _tmp26_, GTK_ALIGN_END);
	gtk_label_set_mnemonic_widget (_tmp26_, _tmp25_);
	_g_object_unref0 (_tmp25_);
	g_object_ref_sink (_tmp26_);
	imap_encryption_label = _tmp26_;
	_tmp27_ = (GtkGrid*) gtk_grid_new ();
	gtk_grid_set_column_spacing (_tmp27_, 6);
	gtk_grid_set_row_spacing (_tmp27_, 6);
	g_object_ref_sink (_tmp27_);
	imap_server_grid = _tmp27_;
	_tmp28_ = imap_server_grid;
	_tmp29_ = imap_header;
	gtk_grid_attach (_tmp28_, (GtkWidget*) _tmp29_, 0, 0, 2, 1);
	_tmp30_ = imap_server_grid;
	_tmp31_ = imap_username_label;
	gtk_grid_attach (_tmp30_, (GtkWidget*) _tmp31_, 0, 1, 1, 1);
	_tmp32_ = imap_server_grid;
	_tmp33_ = self->priv->imap_username_entry;
	gtk_grid_attach (_tmp32_, (GtkWidget*) _tmp33_, 1, 1, 1, 1);
	_tmp34_ = imap_server_grid;
	_tmp35_ = imap_url_label;
	gtk_grid_attach (_tmp34_, (GtkWidget*) _tmp35_, 0, 3, 1, 1);
	_tmp36_ = imap_server_grid;
	_tmp37_ = self->priv->imap_server_entry;
	gtk_grid_attach (_tmp36_, (GtkWidget*) _tmp37_, 1, 3, 1, 1);
	_tmp38_ = imap_server_grid;
	_tmp39_ = imap_encryption_label;
	gtk_grid_attach (_tmp38_, (GtkWidget*) _tmp39_, 0, 4, 1, 1);
	_tmp40_ = imap_server_grid;
	_tmp41_ = self->priv->imap_encryption_combobox;
	gtk_grid_attach (_tmp40_, (GtkWidget*) _tmp41_, 1, 4, 1, 1);
	_tmp42_ = imap_server_grid;
	_tmp43_ = imap_port_label;
	gtk_grid_attach (_tmp42_, (GtkWidget*) _tmp43_, 0, 5, 1, 1);
	_tmp44_ = imap_server_grid;
	_tmp45_ = self->priv->imap_port_spin;
	gtk_grid_attach (_tmp44_, (GtkWidget*) _tmp45_, 1, 5, 1, 1);
	_tmp46_ = imap_server_grid;
	_tmp47_ = imap_refresh_interval_label;
	gtk_grid_attach (_tmp46_, (GtkWidget*) _tmp47_, 0, 6, 1, 1);
	_tmp48_ = imap_server_grid;
	_tmp49_ = self->priv->imap_refresh_interval_spin;
	gtk_grid_attach (_tmp48_, (GtkWidget*) _tmp49_, 1, 6, 1, 1);
	_tmp50_ = (GtkCheckButton*) gtk_check_button_new_with_label (_ ("Use IMAP Credentials"));
	gtk_check_button_set_active (_tmp50_, TRUE);
	g_object_ref_sink (_tmp50_);
	_g_object_unref0 (self->priv->use_imap_credentials);
	self->priv->use_imap_credentials = _tmp50_;
	_tmp51_ = (GtkCheckButton*) gtk_check_button_new_with_label (_ ("No authentication required"));
	g_object_ref_sink (_tmp51_);
	_g_object_unref0 (self->priv->smtp_no_credentials);
	self->priv->smtp_no_credentials = _tmp51_;
	_tmp52_ = granite_header_label_new ("SMTP");
	g_object_ref_sink (_tmp52_);
	smtp_header = _tmp52_;
	_tmp53_ = (GtkEntry*) gtk_entry_new ();
	gtk_entry_set_activates_default (_tmp53_, TRUE);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp53_, TRUE);
	g_object_ref_sink (_tmp53_);
	_g_object_unref0 (self->priv->smtp_username_entry);
	self->priv->smtp_username_entry = _tmp53_;
	_tmp54_ = self->priv->smtp_username_entry;
	_tmp55_ = _g_object_ref0 ((GtkWidget*) _tmp54_);
	_tmp56_ = (GtkLabel*) gtk_label_new (_ ("Username:"));
	gtk_label_set_mnemonic_widget (_tmp56_, _tmp55_);
	_g_object_unref0 (_tmp55_);
	gtk_label_set_xalign (_tmp56_, (gfloat) 1);
	g_object_ref_sink (_tmp56_);
	smtp_username_label = _tmp56_;
	_tmp57_ = (GtkEntry*) gtk_entry_new ();
	gtk_entry_set_activates_default (_tmp57_, TRUE);
	gtk_entry_set_input_purpose (_tmp57_, GTK_INPUT_PURPOSE_PASSWORD);
	gtk_entry_set_visibility (_tmp57_, FALSE);
	g_object_ref_sink (_tmp57_);
	_g_object_unref0 (self->priv->smtp_password_entry);
	self->priv->smtp_password_entry = _tmp57_;
	_tmp58_ = self->priv->smtp_password_entry;
	_tmp59_ = _g_object_ref0 ((GtkWidget*) _tmp58_);
	_tmp60_ = (GtkLabel*) gtk_label_new (_ ("Password:"));
	gtk_label_set_mnemonic_widget (_tmp60_, _tmp59_);
	_g_object_unref0 (_tmp59_);
	gtk_label_set_xalign (_tmp60_, (gfloat) 1);
	g_object_ref_sink (_tmp60_);
	smtp_password_label = _tmp60_;
	_tmp61_ = (GtkGrid*) gtk_grid_new ();
	gtk_grid_set_column_spacing (_tmp61_, 6);
	gtk_grid_set_row_spacing (_tmp61_, 6);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp61_, 18);
	g_object_ref_sink (_tmp61_);
	smtp_credentials = _tmp61_;
	_tmp62_ = smtp_credentials;
	_tmp63_ = smtp_username_label;
	gtk_grid_attach (_tmp62_, (GtkWidget*) _tmp63_, 0, 0, 1, 1);
	_tmp64_ = smtp_credentials;
	_tmp65_ = self->priv->smtp_username_entry;
	gtk_grid_attach (_tmp64_, (GtkWidget*) _tmp65_, 1, 0, 1, 1);
	_tmp66_ = smtp_credentials;
	_tmp67_ = smtp_password_label;
	gtk_grid_attach (_tmp66_, (GtkWidget*) _tmp67_, 0, 1, 1, 1);
	_tmp68_ = smtp_credentials;
	_tmp69_ = self->priv->smtp_password_entry;
	gtk_grid_attach (_tmp68_, (GtkWidget*) _tmp69_, 1, 1, 1, 1);
	_tmp70_ = smtp_credentials;
	_tmp71_ = _g_object_ref0 ((GtkWidget*) _tmp70_);
	_tmp72_ = (GtkRevealer*) gtk_revealer_new ();
	gtk_revealer_set_child (_tmp72_, _tmp71_);
	_g_object_unref0 (_tmp71_);
	g_object_ref_sink (_tmp72_);
	_g_object_unref0 (self->priv->smtp_revealer);
	self->priv->smtp_revealer = _tmp72_;
	_tmp73_ = granite_validated_entry_new ();
	gtk_entry_set_input_purpose ((GtkEntry*) _tmp73_, GTK_INPUT_PURPOSE_URL);
	g_object_ref_sink (_tmp73_);
	_g_object_unref0 (self->priv->smtp_server_entry);
	self->priv->smtp_server_entry = _tmp73_;
	_tmp74_ = self->priv->smtp_server_entry;
	_tmp75_ = _g_object_ref0 ((GtkWidget*) _tmp74_);
	_tmp76_ = (GtkLabel*) gtk_label_new (_ ("Server URL:"));
	gtk_label_set_mnemonic_widget (_tmp76_, _tmp75_);
	_g_object_unref0 (_tmp75_);
	gtk_label_set_xalign (_tmp76_, (gfloat) 1);
	g_object_ref_sink (_tmp76_);
	smtp_url_label = _tmp76_;
	_tmp77_ = (GtkSpinButton*) gtk_spin_button_new_with_range ((gdouble) 1, (gdouble) G_MAXUINT16, (gdouble) 10);
	gtk_spin_button_set_value (_tmp77_, (gdouble) 587);
	g_object_ref_sink (_tmp77_);
	_g_object_unref0 (self->priv->smtp_port_spin);
	self->priv->smtp_port_spin = _tmp77_;
	_tmp78_ = self->priv->smtp_port_spin;
	_tmp79_ = _g_object_ref0 ((GtkWidget*) _tmp78_);
	_tmp80_ = (GtkLabel*) gtk_label_new (_ ("Port:"));
	gtk_label_set_mnemonic_widget (_tmp80_, _tmp79_);
	_g_object_unref0 (_tmp79_);
	gtk_label_set_xalign (_tmp80_, (gfloat) 1);
	g_object_ref_sink (_tmp80_);
	smtp_port_label = _tmp80_;
	_tmp81_ = (GtkComboBoxText*) gtk_combo_box_text_new ();
	gtk_widget_set_hexpand ((GtkWidget*) _tmp81_, TRUE);
	g_object_ref_sink (_tmp81_);
	_g_object_unref0 (self->priv->smtp_encryption_combobox);
	self->priv->smtp_encryption_combobox = _tmp81_;
	_tmp82_ = self->priv->smtp_encryption_combobox;
	gtk_combo_box_text_append (_tmp82_, "none", _ ("None"));
	_tmp83_ = self->priv->smtp_encryption_combobox;
	gtk_combo_box_text_append (_tmp83_, "ssl-on-alternate-port", "SSL/TLS");
	_tmp84_ = self->priv->smtp_encryption_combobox;
	gtk_combo_box_text_append (_tmp84_, "starttls-on-standard-port", "STARTTLS");
	_tmp85_ = self->priv->smtp_encryption_combobox;
	gtk_combo_box_set_active ((GtkComboBox*) _tmp85_, 2);
	_tmp86_ = self->priv->smtp_encryption_combobox;
	_tmp87_ = _g_object_ref0 ((GtkWidget*) _tmp86_);
	_tmp88_ = (GtkLabel*) gtk_label_new (_ ("Encryption:"));
	gtk_label_set_mnemonic_widget (_tmp88_, _tmp87_);
	_g_object_unref0 (_tmp87_);
	gtk_label_set_xalign (_tmp88_, (gfloat) 1);
	g_object_ref_sink (_tmp88_);
	smtp_encryption_label = _tmp88_;
	_tmp89_ = (GtkGrid*) gtk_grid_new ();
	gtk_grid_set_column_spacing (_tmp89_, 6);
	gtk_grid_set_row_spacing (_tmp89_, 6);
	g_object_ref_sink (_tmp89_);
	smtp_server_grid = _tmp89_;
	_tmp90_ = smtp_server_grid;
	_tmp91_ = smtp_header;
	gtk_grid_attach (_tmp90_, (GtkWidget*) _tmp91_, 0, 0, 2, 1);
	_tmp92_ = smtp_server_grid;
	_tmp93_ = self->priv->smtp_no_credentials;
	gtk_grid_attach (_tmp92_, (GtkWidget*) _tmp93_, 1, 1, 1, 1);
	_tmp94_ = smtp_server_grid;
	_tmp95_ = self->priv->use_imap_credentials;
	gtk_grid_attach (_tmp94_, (GtkWidget*) _tmp95_, 1, 2, 1, 1);
	_tmp96_ = smtp_server_grid;
	_tmp97_ = self->priv->smtp_revealer;
	gtk_grid_attach (_tmp96_, (GtkWidget*) _tmp97_, 0, 3, 2, 1);
	_tmp98_ = smtp_server_grid;
	_tmp99_ = smtp_url_label;
	gtk_grid_attach (_tmp98_, (GtkWidget*) _tmp99_, 0, 4, 1, 1);
	_tmp100_ = smtp_server_grid;
	_tmp101_ = self->priv->smtp_server_entry;
	gtk_grid_attach (_tmp100_, (GtkWidget*) _tmp101_, 1, 4, 1, 1);
	_tmp102_ = smtp_server_grid;
	_tmp103_ = smtp_encryption_label;
	gtk_grid_attach (_tmp102_, (GtkWidget*) _tmp103_, 0, 5, 1, 1);
	_tmp104_ = smtp_server_grid;
	_tmp105_ = self->priv->smtp_encryption_combobox;
	gtk_grid_attach (_tmp104_, (GtkWidget*) _tmp105_, 1, 5, 1, 1);
	_tmp106_ = smtp_server_grid;
	_tmp107_ = smtp_port_label;
	gtk_grid_attach (_tmp106_, (GtkWidget*) _tmp107_, 0, 6, 1, 1);
	_tmp108_ = smtp_server_grid;
	_tmp109_ = self->priv->smtp_port_spin;
	gtk_grid_attach (_tmp108_, (GtkWidget*) _tmp109_, 1, 6, 1, 1);
	_tmp110_ = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
	smtp_sizegroup = _tmp110_;
	_tmp111_ = smtp_sizegroup;
	_tmp112_ = smtp_username_label;
	gtk_size_group_add_widget (_tmp111_, (GtkWidget*) _tmp112_);
	_tmp113_ = smtp_sizegroup;
	_tmp114_ = smtp_password_label;
	gtk_size_group_add_widget (_tmp113_, (GtkWidget*) _tmp114_);
	_tmp115_ = smtp_sizegroup;
	_tmp116_ = smtp_url_label;
	gtk_size_group_add_widget (_tmp115_, (GtkWidget*) _tmp116_);
	_tmp117_ = smtp_sizegroup;
	_tmp118_ = smtp_encryption_label;
	gtk_size_group_add_widget (_tmp117_, (GtkWidget*) _tmp118_);
	_tmp119_ = smtp_sizegroup;
	_tmp120_ = smtp_port_label;
	gtk_size_group_add_widget (_tmp119_, (GtkWidget*) _tmp120_);
	_tmp121_ = (GtkButton*) gtk_button_new_with_label (_ ("Back"));
	g_object_ref_sink (_tmp121_);
	back_button = _tmp121_;
	_tmp122_ = (GtkButton*) gtk_button_new_with_label (_ ("Log In"));
	gtk_widget_set_sensitive ((GtkWidget*) _tmp122_, FALSE);
	g_object_ref_sink (_tmp122_);
	_g_object_unref0 (self->priv->save_button);
	self->priv->save_button = _tmp122_;
	_tmp123_ = self->priv->save_button;
	gtk_widget_add_css_class ((GtkWidget*) _tmp123_, GRANITE_STYLE_CLASS_SUGGESTED_ACTION);
	_tmp124_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	gtk_widget_set_valign ((GtkWidget*) _tmp124_, GTK_ALIGN_END);
	gtk_widget_set_halign ((GtkWidget*) _tmp124_, GTK_ALIGN_END);
	gtk_box_set_homogeneous (_tmp124_, TRUE);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp124_, TRUE);
	g_object_ref_sink (_tmp124_);
	action_area = _tmp124_;
	_tmp125_ = action_area;
	gtk_widget_add_css_class ((GtkWidget*) _tmp125_, "action-area");
	_tmp126_ = action_area;
	_tmp127_ = back_button;
	gtk_box_append (_tmp126_, (GtkWidget*) _tmp127_);
	_tmp128_ = action_area;
	_tmp129_ = self->priv->save_button;
	gtk_box_append (_tmp128_, (GtkWidget*) _tmp129_);
	_tmp130_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 24);
	g_object_ref_sink (_tmp130_);
	main_box = _tmp130_;
	_tmp131_ = main_box;
	_tmp132_ = imap_server_grid;
	gtk_box_append (_tmp131_, (GtkWidget*) _tmp132_);
	_tmp133_ = main_box;
	_tmp134_ = smtp_server_grid;
	gtk_box_append (_tmp133_, (GtkWidget*) _tmp134_);
	_tmp135_ = main_box;
	_tmp136_ = action_area;
	gtk_box_append (_tmp135_, (GtkWidget*) _tmp136_);
	_tmp137_ = main_box;
	_tmp138_ = adw_navigation_page_new ((GtkWidget*) _tmp137_, _ ("Credentials"));
	g_object_ref_sink (_tmp138_);
	_g_object_unref0 (self->priv->main_page);
	self->priv->main_page = _tmp138_;
	_tmp139_ = self->priv->login_page;
	online_accounts_paged_dialog_push_page ((OnlineAccountsPagedDialog*) self, (AdwNavigationPage*) _tmp139_);
	_tmp140_ = self->priv->login_page;
	_tmp141_ = online_accounts_imap_login_page_get_next_button (_tmp140_);
	_tmp142_ = _tmp141_;
	gtk_window_set_default_widget ((GtkWindow*) self, (GtkWidget*) _tmp142_);
	_tmp143_ = self->priv->login_page;
	g_signal_connect_object (_tmp143_, "cancel", (GCallback) _gtk_window_destroy_online_accounts_imap_login_page_cancel, (GtkWindow*) self, 0);
	_tmp144_ = self->priv->main_page;
	g_signal_connect_object (_tmp144_, "shown", (GCallback) __online_accounts_imap_dialog___lambda29__adw_navigation_page_shown, self, 0);
	_tmp145_ = self->priv->login_page;
	g_signal_connect_object (_tmp145_, "next", (GCallback) __online_accounts_imap_dialog___lambda30__online_accounts_imap_login_page_next, self, 0);
	_tmp146_ = self->priv->login_page;
	g_signal_connect_object ((AdwNavigationPage*) _tmp146_, "shown", (GCallback) __online_accounts_imap_dialog___lambda31__adw_navigation_page_shown, self, 0);
	_tmp147_ = back_button;
	g_signal_connect_object (_tmp147_, "clicked", (GCallback) __online_accounts_imap_dialog___lambda32__gtk_button_clicked, self, 0);
	_tmp148_ = self->priv->smtp_no_credentials;
	g_signal_connect_object ((GObject*) _tmp148_, "notify::active", (GCallback) __online_accounts_imap_dialog___lambda33__g_object_notify, self, 0);
	_tmp149_ = self->priv->use_imap_credentials;
	_tmp150_ = self->priv->smtp_revealer;
	g_object_bind_property_with_closures ((GObject*) _tmp149_, "active", (GObject*) _tmp150_, "reveal-child", G_BINDING_INVERT_BOOLEAN, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp151_ = self->priv->login_page;
	g_signal_connect_object ((GObject*) _tmp151_, "notify::email", (GCallback) __online_accounts_imap_dialog___lambda34__g_object_notify, self, 0);
	_tmp152_ = self->priv->imap_username_entry;
	g_signal_connect_object ((GtkEditable*) _tmp152_, "changed", (GCallback) __online_accounts_imap_dialog___lambda35__gtk_editable_changed, self, 0);
	_tmp153_ = self->priv->imap_server_entry;
	g_signal_connect_object ((GtkEditable*) _tmp153_, "changed", (GCallback) __online_accounts_imap_dialog___lambda36__gtk_editable_changed, self, 0);
	_tmp154_ = self->priv->imap_encryption_combobox;
	g_signal_connect_object ((GtkComboBox*) _tmp154_, "changed", (GCallback) __online_accounts_imap_dialog___lambda37__gtk_combo_box_changed, self, 0);
	_tmp155_ = self->priv->smtp_server_entry;
	g_signal_connect_object ((GtkEditable*) _tmp155_, "changed", (GCallback) __online_accounts_imap_dialog___lambda38__gtk_editable_changed, self, 0);
	_tmp156_ = self->priv->smtp_encryption_combobox;
	g_signal_connect_object ((GtkComboBox*) _tmp156_, "changed", (GCallback) __online_accounts_imap_dialog___lambda39__gtk_combo_box_changed, self, 0);
	_tmp157_ = self->priv->save_button;
	g_signal_connect_object (_tmp157_, "clicked", (GCallback) __online_accounts_imap_dialog___lambda40__gtk_button_clicked, self, 0);
	_tmp158_ = (GtkEventControllerKey*) gtk_event_controller_key_new ();
	key_controller = _tmp158_;
	_tmp159_ = key_controller;
	_tmp160_ = _g_object_ref0 ((GtkEventController*) _tmp159_);
	gtk_widget_add_controller (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), _tmp160_);
	_tmp161_ = key_controller;
	g_signal_connect_object (_tmp161_, "key-released", (GCallback) __online_accounts_imap_dialog___lambda42__gtk_event_controller_key_key_released, self, 0);
	_g_object_unref0 (key_controller);
	_g_object_unref0 (main_box);
	_g_object_unref0 (action_area);
	_g_object_unref0 (back_button);
	_g_object_unref0 (smtp_sizegroup);
	_g_object_unref0 (smtp_server_grid);
	_g_object_unref0 (smtp_encryption_label);
	_g_object_unref0 (smtp_port_label);
	_g_object_unref0 (smtp_url_label);
	_g_object_unref0 (smtp_credentials);
	_g_object_unref0 (smtp_password_label);
	_g_object_unref0 (smtp_username_label);
	_g_object_unref0 (smtp_header);
	_g_object_unref0 (imap_server_grid);
	_g_object_unref0 (imap_encryption_label);
	_g_object_unref0 (imap_refresh_interval_label);
	_g_object_unref0 (imap_port_label);
	_g_object_unref0 (imap_url_label);
	_g_object_unref0 (imap_password_label);
	_g_object_unref0 (imap_username_label);
	_g_object_unref0 (imap_header);
	return obj;
}

static void
online_accounts_imap_dialog_class_init (OnlineAccountsImapDialogClass * klass,
                                        gpointer klass_data)
{
	online_accounts_imap_dialog_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &OnlineAccountsImapDialog_private_offset);
	G_OBJECT_CLASS (klass)->constructor = online_accounts_imap_dialog_constructor;
	G_OBJECT_CLASS (klass)->finalize = online_accounts_imap_dialog_finalize;
}

static void
online_accounts_imap_dialog_instance_init (OnlineAccountsImapDialog * self,
                                           gpointer klass)
{
	self->priv = online_accounts_imap_dialog_get_instance_private (self);
	self->priv->cancel_timeout_id = (guint) 0;
	self->priv->registry = NULL;
	self->priv->source = NULL;
}

static void
online_accounts_imap_dialog_finalize (GObject * obj)
{
	OnlineAccountsImapDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, ONLINE_ACCOUNTS_TYPE_IMAP_DIALOG, OnlineAccountsImapDialog);
	_g_object_unref0 (self->priv->main_page);
	_g_object_unref0 (self->priv->cancellable);
	_g_object_unref0 (self->priv->imap_server_entry);
	_g_object_unref0 (self->priv->imap_username_entry);
	_g_object_unref0 (self->priv->smtp_server_entry);
	_g_object_unref0 (self->priv->save_button);
	_g_object_unref0 (self->priv->use_imap_credentials);
	_g_object_unref0 (self->priv->smtp_no_credentials);
	_g_object_unref0 (self->priv->imap_encryption_combobox);
	_g_object_unref0 (self->priv->smtp_encryption_combobox);
	_g_object_unref0 (self->priv->smtp_password_entry);
	_g_object_unref0 (self->priv->smtp_username_entry);
	_g_object_unref0 (self->priv->smtp_revealer);
	_g_object_unref0 (self->priv->imap_port_spin);
	_g_object_unref0 (self->priv->imap_refresh_interval_spin);
	_g_object_unref0 (self->priv->smtp_port_spin);
	_g_object_unref0 (self->priv->login_page);
	_g_object_unref0 (self->priv->registry);
	_g_object_unref0 (self->priv->source);
	G_OBJECT_CLASS (online_accounts_imap_dialog_parent_class)->finalize (obj);
}

static GType
online_accounts_imap_dialog_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (OnlineAccountsImapDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) online_accounts_imap_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (OnlineAccountsImapDialog), 0, (GInstanceInitFunc) online_accounts_imap_dialog_instance_init, NULL };
	GType online_accounts_imap_dialog_type_id;
	online_accounts_imap_dialog_type_id = g_type_register_static (ONLINE_ACCOUNTS_TYPE_PAGED_DIALOG, "OnlineAccountsImapDialog", &g_define_type_info, 0);
	OnlineAccountsImapDialog_private_offset = g_type_add_instance_private (online_accounts_imap_dialog_type_id, sizeof (OnlineAccountsImapDialogPrivate));
	return online_accounts_imap_dialog_type_id;
}

GType
online_accounts_imap_dialog_get_type (void)
{
	static volatile gsize online_accounts_imap_dialog_type_id__once = 0;
	if (g_once_init_enter (&online_accounts_imap_dialog_type_id__once)) {
		GType online_accounts_imap_dialog_type_id;
		online_accounts_imap_dialog_type_id = online_accounts_imap_dialog_get_type_once ();
		g_once_init_leave (&online_accounts_imap_dialog_type_id__once, online_accounts_imap_dialog_type_id);
	}
	return online_accounts_imap_dialog_type_id__once;
}

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

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

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

