/* contacts-linked-accounts-dialog.c generated by valac 0.20.1.71-45f6, the Vala compiler
 * generated from contacts-linked-accounts-dialog.vala, do not modify */

/* -*- Mode: vala; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 8 -*- */
/*
 * Copyright (C) 2011 Alexander Larsson <alexl@redhat.com>
 *
 * 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 2 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, see <http://www.gnu.org/licenses/>.
 */

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


#define CONTACTS_TYPE_LINKED_ACCOUNTS_DIALOG (contacts_linked_accounts_dialog_get_type ())
#define CONTACTS_LINKED_ACCOUNTS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_LINKED_ACCOUNTS_DIALOG, ContactsLinkedAccountsDialog))
#define CONTACTS_LINKED_ACCOUNTS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_LINKED_ACCOUNTS_DIALOG, ContactsLinkedAccountsDialogClass))
#define CONTACTS_IS_LINKED_ACCOUNTS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_LINKED_ACCOUNTS_DIALOG))
#define CONTACTS_IS_LINKED_ACCOUNTS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_LINKED_ACCOUNTS_DIALOG))
#define CONTACTS_LINKED_ACCOUNTS_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_LINKED_ACCOUNTS_DIALOG, ContactsLinkedAccountsDialogClass))

typedef struct _ContactsLinkedAccountsDialog ContactsLinkedAccountsDialog;
typedef struct _ContactsLinkedAccountsDialogClass ContactsLinkedAccountsDialogClass;
typedef struct _ContactsLinkedAccountsDialogPrivate ContactsLinkedAccountsDialogPrivate;

#define CONTACTS_TYPE_CONTACT (contacts_contact_get_type ())
#define CONTACTS_CONTACT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_CONTACT, ContactsContact))
#define CONTACTS_CONTACT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_CONTACT, ContactsContactClass))
#define CONTACTS_IS_CONTACT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_CONTACT))
#define CONTACTS_IS_CONTACT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_CONTACT))
#define CONTACTS_CONTACT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_CONTACT, ContactsContactClass))

typedef struct _ContactsContact ContactsContact;
typedef struct _ContactsContactClass ContactsContactClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block32Data Block32Data;
#define _g_free0(var) (var = (g_free (var), NULL))

#define CONTACTS_TYPE_APP (contacts_app_get_type ())
#define CONTACTS_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_APP, ContactsApp))
#define CONTACTS_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_APP, ContactsAppClass))
#define CONTACTS_IS_APP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_APP))
#define CONTACTS_IS_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_APP))
#define CONTACTS_APP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_APP, ContactsAppClass))

typedef struct _ContactsApp ContactsApp;
typedef struct _ContactsAppClass ContactsAppClass;
typedef struct _ContactsAppPrivate ContactsAppPrivate;

#define CONTACTS_TYPE_STORE (contacts_store_get_type ())
#define CONTACTS_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_STORE, ContactsStore))
#define CONTACTS_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_STORE, ContactsStoreClass))
#define CONTACTS_IS_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_STORE))
#define CONTACTS_IS_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_STORE))
#define CONTACTS_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_STORE, ContactsStoreClass))

typedef struct _ContactsStore ContactsStore;
typedef struct _ContactsStoreClass ContactsStoreClass;

#define CONTACTS_TYPE_WINDOW (contacts_window_get_type ())
#define CONTACTS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_WINDOW, ContactsWindow))
#define CONTACTS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_WINDOW, ContactsWindowClass))
#define CONTACTS_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_WINDOW))
#define CONTACTS_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_WINDOW))
#define CONTACTS_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_WINDOW, ContactsWindowClass))

typedef struct _ContactsWindow ContactsWindow;
typedef struct _ContactsWindowClass ContactsWindowClass;
typedef struct _Block33Data Block33Data;

#define CONTACTS_TYPE_CONTACT_FRAME (contacts_contact_frame_get_type ())
#define CONTACTS_CONTACT_FRAME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_CONTACT_FRAME, ContactsContactFrame))
#define CONTACTS_CONTACT_FRAME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_CONTACT_FRAME, ContactsContactFrameClass))
#define CONTACTS_IS_CONTACT_FRAME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_CONTACT_FRAME))
#define CONTACTS_IS_CONTACT_FRAME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_CONTACT_FRAME))
#define CONTACTS_CONTACT_FRAME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_CONTACT_FRAME, ContactsContactFrameClass))

typedef struct _ContactsContactFrame ContactsContactFrame;
typedef struct _ContactsContactFrameClass ContactsContactFrameClass;
typedef struct _ContactsContactPrivate ContactsContactPrivate;

#define CONTACTS_TYPE_LINK_OPERATION (contacts_link_operation_get_type ())
#define CONTACTS_LINK_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_LINK_OPERATION, ContactsLinkOperation))
#define CONTACTS_LINK_OPERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_LINK_OPERATION, ContactsLinkOperationClass))
#define CONTACTS_IS_LINK_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_LINK_OPERATION))
#define CONTACTS_IS_LINK_OPERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_LINK_OPERATION))
#define CONTACTS_LINK_OPERATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_LINK_OPERATION, ContactsLinkOperationClass))

typedef struct _ContactsLinkOperation ContactsLinkOperation;
typedef struct _ContactsLinkOperationClass ContactsLinkOperationClass;

struct _ContactsLinkedAccountsDialog {
	GtkDialog parent_instance;
	ContactsLinkedAccountsDialogPrivate * priv;
	gboolean any_unlinked;
};

struct _ContactsLinkedAccountsDialogClass {
	GtkDialogClass parent_class;
};

struct _ContactsLinkedAccountsDialogPrivate {
	ContactsContact* contact;
	GtkListBox* linked_accounts_view;
};

struct _Block32Data {
	int _ref_count_;
	ContactsLinkedAccountsDialog * self;
	ContactsContact* contact;
};

struct _ContactsApp {
	GtkApplication parent_instance;
	ContactsAppPrivate * priv;
	GSettings* settings;
	ContactsStore* contacts_store;
	ContactsWindow* window;
};

struct _ContactsAppClass {
	GtkApplicationClass parent_class;
};

struct _Block33Data {
	int _ref_count_;
	Block32Data * _data32_;
	FolksPersona* p;
	GtkGrid* row_grid;
};

struct _ContactsContact {
	GObject parent_instance;
	ContactsContactPrivate * priv;
	ContactsStore* store;
	gboolean is_main;
	FolksPresenceType presence_type;
	gchar* presence_message;
	gboolean is_phone;
	FolksIndividual* individual;
};

struct _ContactsContactClass {
	GObjectClass parent_class;
};


static gpointer contacts_linked_accounts_dialog_parent_class = NULL;
extern ContactsApp* contacts_app_app;

GType contacts_linked_accounts_dialog_get_type (void) G_GNUC_CONST;
GType contacts_contact_get_type (void) G_GNUC_CONST;
#define CONTACTS_LINKED_ACCOUNTS_DIALOG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CONTACTS_TYPE_LINKED_ACCOUNTS_DIALOG, ContactsLinkedAccountsDialogPrivate))
enum  {
	CONTACTS_LINKED_ACCOUNTS_DIALOG_DUMMY_PROPERTY
};
ContactsLinkedAccountsDialog* contacts_linked_accounts_dialog_new (ContactsContact* contact);
ContactsLinkedAccountsDialog* contacts_linked_accounts_dialog_construct (GType object_type, ContactsContact* contact);
static Block32Data* block32_data_ref (Block32Data* _data32_);
static void block32_data_unref (void * _userdata_);
const gchar* contacts_contact_get_display_name (ContactsContact* self);
GType contacts_app_get_type (void) G_GNUC_CONST;
GType contacts_store_get_type (void) G_GNUC_CONST;
GType contacts_window_get_type (void) G_GNUC_CONST;
GeeList* contacts_contact_get_personas_for_display (ContactsContact* self);
static Block33Data* block33_data_ref (Block33Data* _data33_);
static void block33_data_unref (void * _userdata_);
GType contacts_contact_frame_get_type (void) G_GNUC_CONST;
#define CONTACTS_CONTACT_SMALL_AVATAR_SIZE 54
ContactsContactFrame* contacts_contact_frame_new (gint size, gboolean with_button);
ContactsContactFrame* contacts_contact_frame_construct (GType object_type, gint size, gboolean with_button);
void contacts_contact_keep_widget_uptodate (ContactsContact* self, GtkWidget* w, GtkCallback callback, void* callback_target, GDestroyNotify callback_target_destroy_notify);
static void ____lambda88_ (Block33Data* _data33_, GtkWidget* w);
void contacts_contact_frame_set_image (ContactsContactFrame* self, FolksAvatarDetails* details, ContactsContact* contact);
static void _____lambda88__gtk_callback (GtkWidget* widget, gpointer self);
gchar* contacts_contact_format_persona_store_name_for_contact (FolksPersona* persona);
static void ____lambda89_ (Block33Data* _data33_);
void contacts_unlink_persona (ContactsContact* contact, FolksPersona* persona_to_unlink, GAsyncReadyCallback _callback_, gpointer _user_data_);
GType contacts_link_operation_get_type (void) G_GNUC_CONST;
ContactsLinkOperation* contacts_unlink_persona_finish (GAsyncResult* _res_);
static void __lambda90_ (Block33Data* _data33_, GObject* obj, GAsyncResult* _result_);
static void ___lambda90__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
static void _____lambda89__gtk_button_clicked (GtkButton* _sender, gpointer self);
static void contacts_linked_accounts_dialog_finalize (GObject* obj);


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


static Block32Data* block32_data_ref (Block32Data* _data32_) {
	g_atomic_int_inc (&_data32_->_ref_count_);
	return _data32_;
}


static void block32_data_unref (void * _userdata_) {
	Block32Data* _data32_;
	_data32_ = (Block32Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data32_->_ref_count_)) {
		ContactsLinkedAccountsDialog * self;
		self = _data32_->self;
		_g_object_unref0 (_data32_->contact);
		_g_object_unref0 (self);
		g_slice_free (Block32Data, _data32_);
	}
}


static Block33Data* block33_data_ref (Block33Data* _data33_) {
	g_atomic_int_inc (&_data33_->_ref_count_);
	return _data33_;
}


static void block33_data_unref (void * _userdata_) {
	Block33Data* _data33_;
	_data33_ = (Block33Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data33_->_ref_count_)) {
		ContactsLinkedAccountsDialog * self;
		self = _data33_->_data32_->self;
		_g_object_unref0 (_data33_->row_grid);
		_g_object_unref0 (_data33_->p);
		block32_data_unref (_data33_->_data32_);
		_data33_->_data32_ = NULL;
		g_slice_free (Block33Data, _data33_);
	}
}


static void ____lambda88_ (Block33Data* _data33_, GtkWidget* w) {
	Block32Data* _data32_;
	ContactsLinkedAccountsDialog * self;
	GtkWidget* _tmp0_ = NULL;
	ContactsContact* _tmp1_ = NULL;
	FolksIndividual* _tmp2_ = NULL;
	ContactsContact* _tmp3_ = NULL;
	_data32_ = _data33_->_data32_;
	self = _data32_->self;
	g_return_if_fail (w != NULL);
	_tmp0_ = w;
	_tmp1_ = _data32_->contact;
	_tmp2_ = _tmp1_->individual;
	_tmp3_ = _data32_->contact;
	contacts_contact_frame_set_image (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, CONTACTS_TYPE_CONTACT_FRAME) ? ((ContactsContactFrame*) _tmp0_) : NULL, (FolksAvatarDetails*) _tmp2_, _tmp3_);
}


static void _____lambda88__gtk_callback (GtkWidget* widget, gpointer self) {
	____lambda88_ (self, widget);
}


static void __lambda90_ (Block33Data* _data33_, GObject* obj, GAsyncResult* _result_) {
	Block32Data* _data32_;
	ContactsLinkedAccountsDialog * self;
	GAsyncResult* _tmp0_ = NULL;
	ContactsLinkOperation* _tmp1_ = NULL;
	ContactsLinkOperation* _tmp2_ = NULL;
	GtkWidget* sep = NULL;
	GtkGrid* _tmp3_ = NULL;
	gconstpointer _tmp4_ = NULL;
	GtkWidget* _tmp5_ = NULL;
	GtkWidget* _tmp6_ = NULL;
	GtkGrid* _tmp8_ = NULL;
	_data32_ = _data33_->_data32_;
	self = _data32_->self;
	g_return_if_fail (_result_ != NULL);
	_tmp0_ = _result_;
	_tmp1_ = contacts_unlink_persona_finish (_tmp0_);
	_tmp2_ = _tmp1_;
	_g_object_unref0 (_tmp2_);
	_tmp3_ = _data33_->row_grid;
	_tmp4_ = g_object_get_data ((GObject*) _tmp3_, "separator");
	_tmp5_ = _g_object_ref0 ((GtkWidget*) _tmp4_);
	sep = _tmp5_;
	_tmp6_ = sep;
	if (_tmp6_ != NULL) {
		GtkWidget* _tmp7_ = NULL;
		_tmp7_ = sep;
		gtk_widget_destroy (_tmp7_);
	}
	_tmp8_ = _data33_->row_grid;
	gtk_widget_destroy ((GtkWidget*) _tmp8_);
	self->any_unlinked = TRUE;
	_g_object_unref0 (sep);
}


static void ___lambda90__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
	__lambda90_ (self, source_object, res);
	block33_data_unref (self);
}


static void ____lambda89_ (Block33Data* _data33_) {
	Block32Data* _data32_;
	ContactsLinkedAccountsDialog * self;
	ContactsContact* _tmp0_ = NULL;
	FolksPersona* _tmp1_ = NULL;
	_data32_ = _data33_->_data32_;
	self = _data32_->self;
	_tmp0_ = _data32_->contact;
	_tmp1_ = _data33_->p;
	contacts_unlink_persona (_tmp0_, _tmp1_, ___lambda90__gasync_ready_callback, block33_data_ref (_data33_));
}


static void _____lambda89__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	____lambda89_ (self);
}


ContactsLinkedAccountsDialog* contacts_linked_accounts_dialog_construct (GType object_type, ContactsContact* contact) {
	ContactsLinkedAccountsDialog * self = NULL;
	Block32Data* _data32_;
	ContactsContact* _tmp0_ = NULL;
	ContactsContact* _tmp1_ = NULL;
	ContactsContact* _tmp2_ = NULL;
	ContactsContact* _tmp3_ = NULL;
	const gchar* _tmp4_ = NULL;
	ContactsContact* _tmp5_ = NULL;
	const gchar* _tmp6_ = NULL;
	const gchar* _tmp7_ = NULL;
	gchar* _tmp8_ = NULL;
	gchar* _tmp9_ = NULL;
	ContactsApp* _tmp10_ = NULL;
	ContactsWindow* _tmp11_ = NULL;
	const gchar* _tmp12_ = NULL;
	GtkGrid* grid = NULL;
	GtkGrid* _tmp13_ = NULL;
	GtkGrid* _tmp14_ = NULL;
	GtkGrid* _tmp15_ = NULL;
	GtkGrid* _tmp16_ = NULL;
	GtkScrolledWindow* scrolled = NULL;
	GtkScrolledWindow* _tmp17_ = NULL;
	GtkScrolledWindow* _tmp18_ = NULL;
	GtkScrolledWindow* _tmp19_ = NULL;
	GtkScrolledWindow* _tmp20_ = NULL;
	GtkScrolledWindow* _tmp21_ = NULL;
	GtkListBox* _tmp22_ = NULL;
	GtkListBox* _tmp23_ = NULL;
	GtkScrolledWindow* _tmp24_ = NULL;
	GtkListBox* _tmp25_ = NULL;
	GtkGrid* _tmp26_ = NULL;
	GtkScrolledWindow* _tmp27_ = NULL;
	GtkLabel* label = NULL;
	const gchar* _tmp28_ = NULL;
	GtkLabel* _tmp29_ = NULL;
	GtkLabel* _tmp30_ = NULL;
	GtkGrid* _tmp31_ = NULL;
	GtkLabel* _tmp32_ = NULL;
	GtkGrid* _tmp33_ = NULL;
	GtkBox* _tmp34_ = NULL;
	GtkGrid* _tmp35_ = NULL;
	GeeList* personas = NULL;
	ContactsContact* _tmp36_ = NULL;
	GeeList* _tmp37_ = NULL;
	gboolean is_first = FALSE;
	gint counter = 0;
	g_return_val_if_fail (contact != NULL, NULL);
	_data32_ = g_slice_new0 (Block32Data);
	_data32_->_ref_count_ = 1;
	_tmp0_ = contact;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (_data32_->contact);
	_data32_->contact = _tmp1_;
	self = (ContactsLinkedAccountsDialog*) g_object_new (object_type, NULL);
	_data32_->self = g_object_ref (self);
	_tmp2_ = _data32_->contact;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	_g_object_unref0 (self->priv->contact);
	self->priv->contact = _tmp3_;
	self->any_unlinked = FALSE;
	_tmp4_ = _ ("%s - Linked Accounts");
	_tmp5_ = _data32_->contact;
	_tmp6_ = contacts_contact_get_display_name (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = g_strdup_printf (_tmp4_, _tmp7_);
	_tmp9_ = _tmp8_;
	gtk_window_set_title ((GtkWindow*) self, _tmp9_);
	_g_free0 (_tmp9_);
	_tmp10_ = contacts_app_app;
	_tmp11_ = _tmp10_->window;
	gtk_window_set_transient_for ((GtkWindow*) self, (GtkWindow*) _tmp11_);
	gtk_window_set_modal ((GtkWindow*) self, TRUE);
	gtk_window_set_default_size ((GtkWindow*) self, 600, 400);
	_tmp12_ = _ ("Close");
	gtk_dialog_add_buttons ((GtkDialog*) self, _tmp12_, GTK_RESPONSE_CLOSE, NULL, NULL);
	_tmp13_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp13_);
	grid = _tmp13_;
	_tmp14_ = grid;
	gtk_orientable_set_orientation ((GtkOrientable*) _tmp14_, GTK_ORIENTATION_VERTICAL);
	_tmp15_ = grid;
	gtk_grid_set_row_spacing (_tmp15_, (guint) 12);
	_tmp16_ = grid;
	gtk_container_set_border_width ((GtkContainer*) _tmp16_, (guint) 8);
	_tmp17_ = (GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL);
	g_object_ref_sink (_tmp17_);
	scrolled = _tmp17_;
	_tmp18_ = scrolled;
	gtk_scrolled_window_set_policy (_tmp18_, GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
	_tmp19_ = scrolled;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp19_, TRUE);
	_tmp20_ = scrolled;
	gtk_widget_set_vexpand ((GtkWidget*) _tmp20_, TRUE);
	_tmp21_ = scrolled;
	gtk_scrolled_window_set_shadow_type (_tmp21_, GTK_SHADOW_NONE);
	_tmp22_ = (GtkListBox*) gtk_list_box_new ();
	g_object_ref_sink (_tmp22_);
	_g_object_unref0 (self->priv->linked_accounts_view);
	self->priv->linked_accounts_view = _tmp22_;
	_tmp23_ = self->priv->linked_accounts_view;
	gtk_list_box_set_selection_mode (_tmp23_, GTK_SELECTION_NONE);
	_tmp24_ = scrolled;
	_tmp25_ = self->priv->linked_accounts_view;
	gtk_container_add ((GtkContainer*) _tmp24_, (GtkWidget*) _tmp25_);
	_tmp26_ = grid;
	_tmp27_ = scrolled;
	gtk_container_add ((GtkContainer*) _tmp26_, (GtkWidget*) _tmp27_);
	_tmp28_ = _ ("You can manually link contacts from the contacts list");
	_tmp29_ = (GtkLabel*) gtk_label_new (_tmp28_);
	g_object_ref_sink (_tmp29_);
	label = _tmp29_;
	_tmp30_ = label;
	gtk_widget_set_halign ((GtkWidget*) _tmp30_, GTK_ALIGN_CENTER);
	_tmp31_ = grid;
	_tmp32_ = label;
	gtk_container_add ((GtkContainer*) _tmp31_, (GtkWidget*) _tmp32_);
	_tmp33_ = grid;
	gtk_widget_show_all ((GtkWidget*) _tmp33_);
	_tmp34_ = (GtkBox*) gtk_dialog_get_content_area ((GtkDialog*) self);
	_tmp35_ = grid;
	gtk_container_add (G_TYPE_CHECK_INSTANCE_TYPE (_tmp34_, GTK_TYPE_CONTAINER) ? ((GtkContainer*) _tmp34_) : NULL, (GtkWidget*) _tmp35_);
	_tmp36_ = _data32_->contact;
	_tmp37_ = contacts_contact_get_personas_for_display (_tmp36_);
	personas = _tmp37_;
	is_first = TRUE;
	counter = 1;
	{
		GeeList* _p_list = NULL;
		GeeList* _tmp38_ = NULL;
		GeeList* _tmp39_ = NULL;
		gint _p_size = 0;
		GeeList* _tmp40_ = NULL;
		gint _tmp41_ = 0;
		gint _tmp42_ = 0;
		gint _p_index = 0;
		_tmp38_ = personas;
		_tmp39_ = _g_object_ref0 (_tmp38_);
		_p_list = _tmp39_;
		_tmp40_ = _p_list;
		_tmp41_ = gee_collection_get_size ((GeeCollection*) _tmp40_);
		_tmp42_ = _tmp41_;
		_p_size = _tmp42_;
		_p_index = -1;
		while (TRUE) {
			Block33Data* _data33_;
			gint _tmp43_ = 0;
			gint _tmp44_ = 0;
			gint _tmp45_ = 0;
			GeeList* _tmp46_ = NULL;
			gint _tmp47_ = 0;
			gpointer _tmp48_ = NULL;
			gboolean _tmp49_ = FALSE;
			GtkGrid* _tmp50_ = NULL;
			GtkGrid* _tmp51_ = NULL;
			ContactsContactFrame* image_frame = NULL;
			ContactsContactFrame* _tmp52_ = NULL;
			ContactsContactFrame* _tmp53_ = NULL;
			ContactsContactFrame* _tmp54_ = NULL;
			ContactsContactFrame* _tmp55_ = NULL;
			ContactsContact* _tmp56_ = NULL;
			ContactsContactFrame* _tmp57_ = NULL;
			GtkGrid* _tmp58_ = NULL;
			ContactsContactFrame* _tmp59_ = NULL;
			GtkLabel* display_name = NULL;
			GtkLabel* _tmp60_ = NULL;
			GtkLabel* _tmp61_ = NULL;
			GtkLabel* _tmp62_ = NULL;
			GtkLabel* _tmp63_ = NULL;
			GtkLabel* _tmp64_ = NULL;
			FolksPersona* _tmp65_ = NULL;
			const gchar* _tmp66_ = NULL;
			const gchar* _tmp67_ = NULL;
			gchar* _tmp68_ = NULL;
			gchar* _tmp69_ = NULL;
			GtkGrid* _tmp70_ = NULL;
			GtkLabel* _tmp71_ = NULL;
			GtkLabel* store_name = NULL;
			FolksPersona* _tmp72_ = NULL;
			gchar* _tmp73_ = NULL;
			gchar* _tmp74_ = NULL;
			GtkLabel* _tmp75_ = NULL;
			GtkLabel* _tmp76_ = NULL;
			GtkLabel* _tmp77_ = NULL;
			GtkLabel* _tmp78_ = NULL;
			GtkLabel* _tmp79_ = NULL;
			GtkLabel* _tmp80_ = NULL;
			GtkStyleContext* _tmp81_ = NULL;
			GtkGrid* _tmp82_ = NULL;
			GtkLabel* _tmp83_ = NULL;
			GtkButton* button = NULL;
			const gchar* _tmp84_ = NULL;
			GtkButton* _tmp85_ = NULL;
			GtkButton* _tmp86_ = NULL;
			GtkButton* _tmp87_ = NULL;
			GtkButton* _tmp88_ = NULL;
			GtkButton* _tmp89_ = NULL;
			GtkWidget* _tmp90_ = NULL;
			GtkGrid* _tmp91_ = NULL;
			GtkButton* _tmp92_ = NULL;
			GtkButton* _tmp93_ = NULL;
			GtkGrid* _tmp94_ = NULL;
			GtkListBox* _tmp95_ = NULL;
			GtkGrid* _tmp96_ = NULL;
			gint _tmp97_ = 0;
			GeeList* _tmp98_ = NULL;
			gint _tmp99_ = 0;
			gint _tmp100_ = 0;
			_data33_ = g_slice_new0 (Block33Data);
			_data33_->_ref_count_ = 1;
			_data33_->_data32_ = block32_data_ref (_data32_);
			_tmp43_ = _p_index;
			_p_index = _tmp43_ + 1;
			_tmp44_ = _p_index;
			_tmp45_ = _p_size;
			if (!(_tmp44_ < _tmp45_)) {
				block33_data_unref (_data33_);
				_data33_ = NULL;
				break;
			}
			_tmp46_ = _p_list;
			_tmp47_ = _p_index;
			_tmp48_ = gee_list_get (_tmp46_, _tmp47_);
			_data33_->p = (FolksPersona*) _tmp48_;
			_tmp49_ = is_first;
			if (_tmp49_) {
				is_first = FALSE;
				block33_data_unref (_data33_);
				_data33_ = NULL;
				continue;
			}
			_tmp50_ = (GtkGrid*) gtk_grid_new ();
			g_object_ref_sink (_tmp50_);
			_data33_->row_grid = _tmp50_;
			_tmp51_ = _data33_->row_grid;
			gtk_grid_set_row_spacing (_tmp51_, (guint) 6);
			_tmp52_ = contacts_contact_frame_new (CONTACTS_CONTACT_SMALL_AVATAR_SIZE, FALSE);
			g_object_ref_sink (_tmp52_);
			image_frame = _tmp52_;
			_tmp53_ = image_frame;
			gtk_widget_set_hexpand ((GtkWidget*) _tmp53_, FALSE);
			_tmp54_ = image_frame;
			g_object_set ((GtkWidget*) _tmp54_, "margin", 6, NULL);
			_tmp55_ = image_frame;
			gtk_widget_set_margin_right ((GtkWidget*) _tmp55_, 12);
			_tmp56_ = _data32_->contact;
			_tmp57_ = image_frame;
			contacts_contact_keep_widget_uptodate (_tmp56_, (GtkWidget*) _tmp57_, _____lambda88__gtk_callback, block33_data_ref (_data33_), block33_data_unref);
			_tmp58_ = _data33_->row_grid;
			_tmp59_ = image_frame;
			gtk_grid_attach (_tmp58_, (GtkWidget*) _tmp59_, 0, 0, 1, 2);
			_tmp60_ = (GtkLabel*) gtk_label_new ("");
			g_object_ref_sink (_tmp60_);
			display_name = _tmp60_;
			_tmp61_ = display_name;
			gtk_widget_set_halign ((GtkWidget*) _tmp61_, GTK_ALIGN_START);
			_tmp62_ = display_name;
			gtk_widget_set_valign ((GtkWidget*) _tmp62_, GTK_ALIGN_END);
			_tmp63_ = display_name;
			gtk_widget_set_hexpand ((GtkWidget*) _tmp63_, TRUE);
			_tmp64_ = display_name;
			_tmp65_ = _data33_->p;
			_tmp66_ = folks_persona_get_display_id (_tmp65_);
			_tmp67_ = _tmp66_;
			_tmp68_ = g_markup_printf_escaped ("<span font='12px bold'>%s</span>", _tmp67_);
			_tmp69_ = _tmp68_;
			gtk_label_set_markup (_tmp64_, _tmp69_);
			_g_free0 (_tmp69_);
			_tmp70_ = _data33_->row_grid;
			_tmp71_ = display_name;
			gtk_grid_attach (_tmp70_, (GtkWidget*) _tmp71_, 1, 0, 1, 1);
			_tmp72_ = _data33_->p;
			_tmp73_ = contacts_contact_format_persona_store_name_for_contact (_tmp72_);
			_tmp74_ = _tmp73_;
			_tmp75_ = (GtkLabel*) gtk_label_new (_tmp74_);
			g_object_ref_sink (_tmp75_);
			_tmp76_ = _tmp75_;
			_g_free0 (_tmp74_);
			store_name = _tmp76_;
			_tmp77_ = store_name;
			gtk_widget_set_halign ((GtkWidget*) _tmp77_, GTK_ALIGN_START);
			_tmp78_ = store_name;
			gtk_widget_set_valign ((GtkWidget*) _tmp78_, GTK_ALIGN_START);
			_tmp79_ = store_name;
			gtk_widget_set_hexpand ((GtkWidget*) _tmp79_, TRUE);
			_tmp80_ = store_name;
			_tmp81_ = gtk_widget_get_style_context ((GtkWidget*) _tmp80_);
			gtk_style_context_add_class (_tmp81_, "dim-label");
			_tmp82_ = _data33_->row_grid;
			_tmp83_ = store_name;
			gtk_grid_attach (_tmp82_, (GtkWidget*) _tmp83_, 1, 1, 1, 1);
			_tmp84_ = _ ("Remove");
			_tmp85_ = (GtkButton*) gtk_button_new_with_label (_tmp84_);
			g_object_ref_sink (_tmp85_);
			button = _tmp85_;
			_tmp86_ = button;
			g_object_set ((GtkWidget*) _tmp86_, "margin", 6, NULL);
			_tmp87_ = button;
			gtk_widget_set_margin_left ((GtkWidget*) _tmp87_, 12);
			_tmp88_ = button;
			gtk_widget_set_valign ((GtkWidget*) _tmp88_, GTK_ALIGN_CENTER);
			_tmp89_ = button;
			_tmp90_ = gtk_bin_get_child ((GtkBin*) _tmp89_);
			g_object_set (_tmp90_, "margin", 6, NULL);
			_tmp91_ = _data33_->row_grid;
			_tmp92_ = button;
			gtk_grid_attach (_tmp91_, (GtkWidget*) _tmp92_, 2, 0, 1, 2);
			_tmp93_ = button;
			g_signal_connect_data (_tmp93_, "clicked", (GCallback) _____lambda89__gtk_button_clicked, block33_data_ref (_data33_), (GClosureNotify) block33_data_unref, 0);
			_tmp94_ = _data33_->row_grid;
			gtk_widget_show_all ((GtkWidget*) _tmp94_);
			_tmp95_ = self->priv->linked_accounts_view;
			_tmp96_ = _data33_->row_grid;
			gtk_container_add ((GtkContainer*) _tmp95_, (GtkWidget*) _tmp96_);
			_tmp97_ = counter;
			_tmp98_ = personas;
			_tmp99_ = gee_collection_get_size ((GeeCollection*) _tmp98_);
			_tmp100_ = _tmp99_;
			if (_tmp97_ != (_tmp100_ - 1)) {
				GtkSeparator* sep = NULL;
				GtkSeparator* _tmp101_ = NULL;
				GtkListBox* _tmp102_ = NULL;
				GtkSeparator* _tmp103_ = NULL;
				gint _tmp104_ = 0;
				GtkGrid* _tmp105_ = NULL;
				GtkSeparator* _tmp106_ = NULL;
				GtkSeparator* _tmp107_ = NULL;
				_tmp101_ = (GtkSeparator*) gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
				g_object_ref_sink (_tmp101_);
				sep = _tmp101_;
				_tmp102_ = self->priv->linked_accounts_view;
				_tmp103_ = sep;
				gtk_container_add ((GtkContainer*) _tmp102_, (GtkWidget*) _tmp103_);
				_tmp104_ = counter;
				counter = _tmp104_ + 1;
				_tmp105_ = _data33_->row_grid;
				_tmp106_ = sep;
				_tmp107_ = _g_object_ref0 (_tmp106_);
				g_object_set_data_full ((GObject*) _tmp105_, "separator", _tmp107_, g_object_unref);
				_g_object_unref0 (sep);
			}
			_g_object_unref0 (button);
			_g_object_unref0 (store_name);
			_g_object_unref0 (display_name);
			_g_object_unref0 (image_frame);
			block33_data_unref (_data33_);
			_data33_ = NULL;
		}
		_g_object_unref0 (_p_list);
	}
	_g_object_unref0 (personas);
	_g_object_unref0 (label);
	_g_object_unref0 (scrolled);
	_g_object_unref0 (grid);
	block32_data_unref (_data32_);
	_data32_ = NULL;
	return self;
}


ContactsLinkedAccountsDialog* contacts_linked_accounts_dialog_new (ContactsContact* contact) {
	return contacts_linked_accounts_dialog_construct (CONTACTS_TYPE_LINKED_ACCOUNTS_DIALOG, contact);
}


static void contacts_linked_accounts_dialog_class_init (ContactsLinkedAccountsDialogClass * klass) {
	contacts_linked_accounts_dialog_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (ContactsLinkedAccountsDialogPrivate));
	G_OBJECT_CLASS (klass)->finalize = contacts_linked_accounts_dialog_finalize;
}


static void contacts_linked_accounts_dialog_instance_init (ContactsLinkedAccountsDialog * self) {
	self->priv = CONTACTS_LINKED_ACCOUNTS_DIALOG_GET_PRIVATE (self);
}


static void contacts_linked_accounts_dialog_finalize (GObject* obj) {
	ContactsLinkedAccountsDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CONTACTS_TYPE_LINKED_ACCOUNTS_DIALOG, ContactsLinkedAccountsDialog);
	_g_object_unref0 (self->priv->contact);
	_g_object_unref0 (self->priv->linked_accounts_view);
	G_OBJECT_CLASS (contacts_linked_accounts_dialog_parent_class)->finalize (obj);
}


GType contacts_linked_accounts_dialog_get_type (void) {
	static volatile gsize contacts_linked_accounts_dialog_type_id__volatile = 0;
	if (g_once_init_enter (&contacts_linked_accounts_dialog_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ContactsLinkedAccountsDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) contacts_linked_accounts_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ContactsLinkedAccountsDialog), 0, (GInstanceInitFunc) contacts_linked_accounts_dialog_instance_init, NULL };
		GType contacts_linked_accounts_dialog_type_id;
		contacts_linked_accounts_dialog_type_id = g_type_register_static (GTK_TYPE_DIALOG, "ContactsLinkedAccountsDialog", &g_define_type_info, 0);
		g_once_init_leave (&contacts_linked_accounts_dialog_type_id__volatile, contacts_linked_accounts_dialog_type_id);
	}
	return contacts_linked_accounts_dialog_type_id__volatile;
}



