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

#include "omemo.h"
#include <gtk/gtk.h>
#include "qlite.h"
#include <glib.h>
#include <glib-object.h>
#include "dino_i18n.h"
#include <stdlib.h>
#include <string.h>
#include <float.h>
#include <math.h>
#include <pango/pango.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  {
	DINO_PLUGINS_OMEMO_MANAGE_KEY_DIALOG_0_PROPERTY,
	DINO_PLUGINS_OMEMO_MANAGE_KEY_DIALOG_NUM_PROPERTIES
};
static GParamSpec* dino_plugins_omemo_manage_key_dialog_properties[DINO_PLUGINS_OMEMO_MANAGE_KEY_DIALOG_NUM_PROPERTIES];
#define _qlite_row_unref0(var) ((var == NULL) ? NULL : (var = (qlite_row_unref (var), NULL)))
#define _qlite_database_unref0(var) ((var == NULL) ? NULL : (var = (qlite_database_unref (var), NULL)))
typedef struct _Block27Data Block27Data;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _pango_attr_list_unref0(var) ((var == NULL) ? NULL : (var = (pango_attr_list_unref (var), NULL)))
typedef struct _Block28Data Block28Data;

struct _DinoPluginsOmemoManageKeyDialogPrivate {
	GtkStack* manage_stack;
	GtkButton* cancel_button;
	GtkButton* ok_button;
	GtkLabel* main_desc_label;
	GtkListBox* main_action_list;
	GtkImage* confirm_image;
	GtkLabel* confirm_title_label;
	GtkLabel* confirm_desc_label;
	GtkLabel* verify_label;
	GtkLabel* compare_fingerprint_label;
	GtkButton* verify_yes_button;
	GtkButton* verify_no_button;
	QliteRow* device;
	DinoPluginsOmemoDatabase* db;
	gboolean return_to_main;
	gint current_response;
};

struct _Block27Data {
	int _ref_count_;
	DinoPluginsOmemoManageKeyDialog* self;
	QliteRow* device;
	DinoPluginsOmemoDatabase* db;
};

struct _Block28Data {
	int _ref_count_;
	DinoPluginsOmemoManageKeyDialog* self;
	GtkListBoxRow* verify_row;
	GtkListBoxRow* reject_row;
	GtkListBoxRow* accept_row;
};

static gint DinoPluginsOmemoManageKeyDialog_private_offset;
static gpointer dino_plugins_omemo_manage_key_dialog_parent_class = NULL;

static Block27Data* block27_data_ref (Block27Data* _data27_);
static void block27_data_unref (void * _userdata_);
static void dino_plugins_omemo_manage_key_dialog_setup_main_screen (DinoPluginsOmemoManageKeyDialog* self);
static void dino_plugins_omemo_manage_key_dialog_setup_verify_screen (DinoPluginsOmemoManageKeyDialog* self);
static void dino_plugins_omemo_manage_key_dialog_handle_cancel (DinoPluginsOmemoManageKeyDialog* self);
static void _dino_plugins_omemo_manage_key_dialog_handle_cancel_gtk_button_clicked (GtkButton* _sender,
                                                                             gpointer self);
static void __lambda29_ (DinoPluginsOmemoManageKeyDialog* self);
static void ___lambda29__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);
static void __lambda30_ (Block27Data* _data27_);
static void ___lambda30__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);
static void __lambda31_ (Block27Data* _data27_);
static void ___lambda31__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);
static GtkBox* dino_plugins_omemo_manage_key_dialog_make_action_box (DinoPluginsOmemoManageKeyDialog* self,
                                                              const gchar* title,
                                                              const gchar* desc);
static Block28Data* block28_data_ref (Block28Data* _data28_);
static void block28_data_unref (void * _userdata_);
static void __lambda27_ (DinoPluginsOmemoManageKeyDialog* self,
                  GtkListBoxRow* row,
                  GtkListBoxRow* before_row);
static void ___lambda27__gtk_list_box_update_header_func (GtkListBoxRow* row,
                                                   GtkListBoxRow* before,
                                                   gpointer self);
static void __lambda28_ (Block28Data* _data28_,
                  GtkListBoxRow* row);
static void ___lambda28__gtk_list_box_row_activated (GtkListBox* _sender,
                                              GtkListBoxRow* row,
                                              gpointer self);
static GObject * dino_plugins_omemo_manage_key_dialog_constructor (GType type,
                                                            guint n_construct_properties,
                                                            GObjectConstructParam * construct_properties);
static void dino_plugins_omemo_manage_key_dialog_finalize (GObject * obj);
static GType dino_plugins_omemo_manage_key_dialog_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
dino_plugins_omemo_manage_key_dialog_get_instance_private (DinoPluginsOmemoManageKeyDialog* self)
{
	return G_STRUCT_MEMBER_P (self, DinoPluginsOmemoManageKeyDialog_private_offset);
}

static gpointer
_qlite_row_ref0 (gpointer self)
{
	return self ? qlite_row_ref (self) : NULL;
}

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

static Block27Data*
block27_data_ref (Block27Data* _data27_)
{
	g_atomic_int_inc (&_data27_->_ref_count_);
	return _data27_;
}

static void
block27_data_unref (void * _userdata_)
{
	Block27Data* _data27_;
	_data27_ = (Block27Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data27_->_ref_count_)) {
		DinoPluginsOmemoManageKeyDialog* self;
		self = _data27_->self;
		_qlite_row_unref0 (_data27_->device);
		_qlite_database_unref0 (_data27_->db);
		_g_object_unref0 (self);
		g_slice_free (Block27Data, _data27_);
	}
}

static void
_dino_plugins_omemo_manage_key_dialog_handle_cancel_gtk_button_clicked (GtkButton* _sender,
                                                                        gpointer self)
{
	dino_plugins_omemo_manage_key_dialog_handle_cancel ((DinoPluginsOmemoManageKeyDialog*) self);
}

static void
__lambda29_ (DinoPluginsOmemoManageKeyDialog* self)
{
	gtk_dialog_response ((GtkDialog*) self, self->priv->current_response);
	g_signal_emit_by_name ((GtkDialog*) self, "close");
}

static void
___lambda29__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
	__lambda29_ ((DinoPluginsOmemoManageKeyDialog*) self);
}

static const gchar*
string_to_string (const gchar* self)
{
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self;
	return result;
}

static void
__lambda30_ (Block27Data* _data27_)
{
	DinoPluginsOmemoManageKeyDialog* self;
	GtkImage* _tmp0_;
	GtkLabel* _tmp1_;
	const gchar* _tmp2_;
	GtkLabel* _tmp3_;
	const gchar* _tmp4_;
	DinoPluginsOmemoDatabaseIdentityMetaTable* _tmp5_;
	DinoPluginsOmemoDatabaseIdentityMetaTable* _tmp6_;
	QliteColumn* _tmp7_;
	gpointer _tmp8_;
	gchar* _tmp9_;
	const gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	GtkStack* _tmp15_;
	GtkButton* _tmp16_;
	self = _data27_->self;
	_tmp0_ = self->priv->confirm_image;
	gtk_image_set_from_icon_name (_tmp0_, "security-high-symbolic");
	_tmp1_ = self->priv->confirm_title_label;
	_tmp2_ = dino_gettext ("Verify key");
	gtk_label_set_label (_tmp1_, _tmp2_);
	_tmp3_ = self->priv->confirm_desc_label;
	_tmp4_ = dino_gettext ("Future messages sent by %s from the device that uses this key will be " \
"highlighted accordingly in the chat window.");
	_tmp5_ = dino_plugins_omemo_database_get_identity_meta (_data27_->db);
	_tmp6_ = _tmp5_;
	_tmp7_ = _tmp6_->address_name;
	_tmp8_ = qlite_row_get (_data27_->device, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp7_);
	_tmp9_ = (gchar*) _tmp8_;
	_tmp10_ = string_to_string (_tmp9_);
	_tmp11_ = g_strconcat ("<b>", _tmp10_, "</b>", NULL);
	_tmp12_ = _tmp11_;
	_tmp13_ = g_strdup_printf (_tmp4_, _tmp12_);
	_tmp14_ = _tmp13_;
	gtk_label_set_markup (_tmp3_, _tmp14_);
	_g_free0 (_tmp14_);
	_g_free0 (_tmp12_);
	_g_free0 (_tmp9_);
	_tmp15_ = self->priv->manage_stack;
	gtk_stack_set_visible_child_name (_tmp15_, "confirm");
	_tmp16_ = self->priv->ok_button;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp16_, TRUE);
	self->priv->return_to_main = FALSE;
	self->priv->current_response = (gint) DINO_PLUGINS_OMEMO_TRUST_LEVEL_VERIFIED;
}

static void
___lambda30__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
	__lambda30_ (self);
}

static void
__lambda31_ (Block27Data* _data27_)
{
	DinoPluginsOmemoManageKeyDialog* self;
	GtkImage* _tmp0_;
	GtkLabel* _tmp1_;
	const gchar* _tmp2_;
	GtkLabel* _tmp3_;
	const gchar* _tmp4_;
	DinoPluginsOmemoDatabaseIdentityMetaTable* _tmp5_;
	DinoPluginsOmemoDatabaseIdentityMetaTable* _tmp6_;
	QliteColumn* _tmp7_;
	gpointer _tmp8_;
	gchar* _tmp9_;
	const gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	GtkStack* _tmp15_;
	self = _data27_->self;
	self->priv->return_to_main = FALSE;
	_tmp0_ = self->priv->confirm_image;
	gtk_image_set_from_icon_name (_tmp0_, "dialog-warning-symbolic");
	_tmp1_ = self->priv->confirm_title_label;
	_tmp2_ = dino_gettext ("Fingerprints do not match");
	gtk_label_set_label (_tmp1_, _tmp2_);
	_tmp3_ = self->priv->confirm_desc_label;
	_tmp4_ = dino_gettext ("Please verify that you are comparing the correct fingerprint. If finge" \
"rprints do not match, %s's account may be compromised and you should c" \
"onsider rejecting this key.");
	_tmp5_ = dino_plugins_omemo_database_get_identity_meta (_data27_->db);
	_tmp6_ = _tmp5_;
	_tmp7_ = _tmp6_->address_name;
	_tmp8_ = qlite_row_get (_data27_->device, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp7_);
	_tmp9_ = (gchar*) _tmp8_;
	_tmp10_ = string_to_string (_tmp9_);
	_tmp11_ = g_strconcat ("<b>", _tmp10_, "</b>", NULL);
	_tmp12_ = _tmp11_;
	_tmp13_ = g_strdup_printf (_tmp4_, _tmp12_);
	_tmp14_ = _tmp13_;
	gtk_label_set_markup (_tmp3_, _tmp14_);
	_g_free0 (_tmp14_);
	_g_free0 (_tmp12_);
	_g_free0 (_tmp9_);
	_tmp15_ = self->priv->manage_stack;
	gtk_stack_set_visible_child_name (_tmp15_, "confirm");
}

static void
___lambda31__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
	__lambda31_ (self);
}

DinoPluginsOmemoManageKeyDialog*
dino_plugins_omemo_manage_key_dialog_construct (GType object_type,
                                                QliteRow* device,
                                                DinoPluginsOmemoDatabase* db)
{
	DinoPluginsOmemoManageKeyDialog * self = NULL;
	Block27Data* _data27_;
	QliteRow* _tmp0_;
	DinoPluginsOmemoDatabase* _tmp1_;
	QliteRow* _tmp2_;
	DinoPluginsOmemoDatabase* _tmp3_;
	GtkButton* _tmp4_;
	GtkButton* _tmp5_;
	GtkButton* _tmp6_;
	GtkButton* _tmp7_;
	g_return_val_if_fail (device != NULL, NULL);
	g_return_val_if_fail (db != NULL, NULL);
	_data27_ = g_slice_new0 (Block27Data);
	_data27_->_ref_count_ = 1;
	_tmp0_ = _qlite_row_ref0 (device);
	_qlite_row_unref0 (_data27_->device);
	_data27_->device = _tmp0_;
	_tmp1_ = _qlite_database_ref0 (db);
	_qlite_database_unref0 (_data27_->db);
	_data27_->db = _tmp1_;
	self = (DinoPluginsOmemoManageKeyDialog*) g_object_new (object_type, "use-header-bar", 1, NULL);
	_data27_->self = g_object_ref (self);
	_tmp2_ = _qlite_row_ref0 (_data27_->device);
	_qlite_row_unref0 (self->priv->device);
	self->priv->device = _tmp2_;
	_tmp3_ = _qlite_database_ref0 (_data27_->db);
	_qlite_database_unref0 (self->priv->db);
	self->priv->db = _tmp3_;
	dino_plugins_omemo_manage_key_dialog_setup_main_screen (self);
	dino_plugins_omemo_manage_key_dialog_setup_verify_screen (self);
	_tmp4_ = self->priv->cancel_button;
	g_signal_connect_object (_tmp4_, "clicked", (GCallback) _dino_plugins_omemo_manage_key_dialog_handle_cancel_gtk_button_clicked, self, 0);
	_tmp5_ = self->priv->ok_button;
	g_signal_connect_object (_tmp5_, "clicked", (GCallback) ___lambda29__gtk_button_clicked, self, 0);
	_tmp6_ = self->priv->verify_yes_button;
	g_signal_connect_data (_tmp6_, "clicked", (GCallback) ___lambda30__gtk_button_clicked, block27_data_ref (_data27_), (GClosureNotify) block27_data_unref, 0);
	_tmp7_ = self->priv->verify_no_button;
	g_signal_connect_data (_tmp7_, "clicked", (GCallback) ___lambda31__gtk_button_clicked, block27_data_ref (_data27_), (GClosureNotify) block27_data_unref, 0);
	block27_data_unref (_data27_);
	_data27_ = NULL;
	return self;
}

DinoPluginsOmemoManageKeyDialog*
dino_plugins_omemo_manage_key_dialog_new (QliteRow* device,
                                          DinoPluginsOmemoDatabase* db)
{
	return dino_plugins_omemo_manage_key_dialog_construct (DINO_PLUGINS_OMEMO_TYPE_MANAGE_KEY_DIALOG, device, db);
}

static void
dino_plugins_omemo_manage_key_dialog_handle_cancel (DinoPluginsOmemoManageKeyDialog* self)
{
	GtkStack* _tmp0_;
	const gchar* _tmp1_;
	GtkStack* _tmp2_;
	const gchar* _tmp3_;
	GtkStack* _tmp7_;
	const gchar* _tmp8_;
	GtkButton* _tmp13_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->manage_stack;
	_tmp1_ = gtk_stack_get_visible_child_name (_tmp0_);
	if (g_strcmp0 (_tmp1_, "main") == 0) {
		g_signal_emit_by_name ((GtkDialog*) self, "close");
	}
	_tmp2_ = self->priv->manage_stack;
	_tmp3_ = gtk_stack_get_visible_child_name (_tmp2_);
	if (g_strcmp0 (_tmp3_, "verify") == 0) {
		GtkStack* _tmp4_;
		GtkButton* _tmp5_;
		const gchar* _tmp6_;
		_tmp4_ = self->priv->manage_stack;
		gtk_stack_set_visible_child_name (_tmp4_, "main");
		_tmp5_ = self->priv->cancel_button;
		_tmp6_ = dino_gettext ("Cancel");
		gtk_button_set_label (_tmp5_, _tmp6_);
	}
	_tmp7_ = self->priv->manage_stack;
	_tmp8_ = gtk_stack_get_visible_child_name (_tmp7_);
	if (g_strcmp0 (_tmp8_, "confirm") == 0) {
		if (self->priv->return_to_main) {
			GtkStack* _tmp9_;
			GtkButton* _tmp10_;
			const gchar* _tmp11_;
			_tmp9_ = self->priv->manage_stack;
			gtk_stack_set_visible_child_name (_tmp9_, "main");
			_tmp10_ = self->priv->cancel_button;
			_tmp11_ = dino_gettext ("Cancel");
			gtk_button_set_label (_tmp10_, _tmp11_);
		} else {
			GtkStack* _tmp12_;
			_tmp12_ = self->priv->manage_stack;
			gtk_stack_set_visible_child_name (_tmp12_, "verify");
		}
	}
	_tmp13_ = self->priv->ok_button;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp13_, FALSE);
}

static GtkBox*
dino_plugins_omemo_manage_key_dialog_make_action_box (DinoPluginsOmemoManageKeyDialog* self,
                                                      const gchar* title,
                                                      const gchar* desc)
{
	GtkBox* box = NULL;
	GtkBox* _tmp0_ = NULL;
	GtkLabel* lbl_title = NULL;
	GtkLabel* _tmp1_ = NULL;
	GtkLabel* lbl_desc = NULL;
	GtkLabel* _tmp2_ = NULL;
	PangoAttrList* title_attrs = NULL;
	PangoAttrList* _tmp3_;
	PangoAttribute* _tmp4_;
	PangoAttrList* desc_attrs = NULL;
	PangoAttrList* _tmp5_;
	PangoAttribute* _tmp6_;
	GtkBox* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (title != NULL, NULL);
	g_return_val_if_fail (desc != NULL, NULL);
	_tmp0_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	gtk_widget_set_visible ((GtkWidget*) _tmp0_, TRUE);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp0_, 20);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp0_, 20);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp0_, 14);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp0_, 14);
	g_object_ref_sink (_tmp0_);
	box = _tmp0_;
	_tmp1_ = (GtkLabel*) gtk_label_new (title);
	gtk_widget_set_visible ((GtkWidget*) _tmp1_, TRUE);
	gtk_widget_set_halign ((GtkWidget*) _tmp1_, GTK_ALIGN_START);
	g_object_ref_sink (_tmp1_);
	lbl_title = _tmp1_;
	_tmp2_ = (GtkLabel*) gtk_label_new (desc);
	gtk_widget_set_visible ((GtkWidget*) _tmp2_, TRUE);
	gtk_label_set_xalign (_tmp2_, (gfloat) 0);
	gtk_label_set_wrap (_tmp2_, TRUE);
	gtk_label_set_max_width_chars (_tmp2_, 40);
	g_object_ref_sink (_tmp2_);
	lbl_desc = _tmp2_;
	_tmp3_ = pango_attr_list_new ();
	title_attrs = _tmp3_;
	_tmp4_ = pango_attr_scale_new (1.1);
	pango_attr_list_insert (title_attrs, _tmp4_);
	gtk_label_set_attributes (lbl_title, title_attrs);
	_tmp5_ = pango_attr_list_new ();
	desc_attrs = _tmp5_;
	_tmp6_ = pango_attr_scale_new (0.8);
	pango_attr_list_insert (desc_attrs, _tmp6_);
	gtk_label_set_attributes (lbl_desc, desc_attrs);
	gtk_widget_add_css_class ((GtkWidget*) lbl_desc, "dim-label");
	gtk_box_append (box, (GtkWidget*) lbl_title);
	gtk_box_append (box, (GtkWidget*) lbl_desc);
	result = box;
	_pango_attr_list_unref0 (desc_attrs);
	_pango_attr_list_unref0 (title_attrs);
	_g_object_unref0 (lbl_desc);
	_g_object_unref0 (lbl_title);
	return result;
}

static Block28Data*
block28_data_ref (Block28Data* _data28_)
{
	g_atomic_int_inc (&_data28_->_ref_count_);
	return _data28_;
}

static void
block28_data_unref (void * _userdata_)
{
	Block28Data* _data28_;
	_data28_ = (Block28Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data28_->_ref_count_)) {
		DinoPluginsOmemoManageKeyDialog* self;
		self = _data28_->self;
		_g_object_unref0 (_data28_->accept_row);
		_g_object_unref0 (_data28_->reject_row);
		_g_object_unref0 (_data28_->verify_row);
		_g_object_unref0 (self);
		g_slice_free (Block28Data, _data28_);
	}
}

static void
__lambda27_ (DinoPluginsOmemoManageKeyDialog* self,
             GtkListBoxRow* row,
             GtkListBoxRow* before_row)
{
	gboolean _tmp0_ = FALSE;
	GtkWidget* _tmp1_;
	g_return_if_fail (row != NULL);
	_tmp1_ = gtk_list_box_row_get_header (row);
	if (_tmp1_ == NULL) {
		_tmp0_ = before_row != NULL;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GtkSeparator* _tmp2_;
		GtkSeparator* _tmp3_;
		_tmp2_ = (GtkSeparator*) gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
		g_object_ref_sink (_tmp2_);
		_tmp3_ = _tmp2_;
		gtk_list_box_row_set_header (row, (GtkWidget*) _tmp3_);
		_g_object_unref0 (_tmp3_);
	}
}

static void
___lambda27__gtk_list_box_update_header_func (GtkListBoxRow* row,
                                              GtkListBoxRow* before,
                                              gpointer self)
{
	__lambda27_ ((DinoPluginsOmemoManageKeyDialog*) self, row, before);
}

static void
__lambda28_ (Block28Data* _data28_,
             GtkListBoxRow* row)
{
	DinoPluginsOmemoManageKeyDialog* self;
	GtkListBoxRow* _tmp0_;
	GtkButton* _tmp42_;
	const gchar* _tmp43_;
	self = _data28_->self;
	g_return_if_fail (row != NULL);
	_tmp0_ = _data28_->verify_row;
	if (row == _tmp0_) {
		GtkStack* _tmp1_;
		_tmp1_ = self->priv->manage_stack;
		gtk_stack_set_visible_child_name (_tmp1_, "verify");
	} else {
		GtkListBoxRow* _tmp2_;
		_tmp2_ = _data28_->reject_row;
		if (row == _tmp2_) {
			GtkImage* _tmp3_;
			GtkLabel* _tmp4_;
			const gchar* _tmp5_;
			GtkLabel* _tmp6_;
			const gchar* _tmp7_;
			QliteRow* _tmp8_;
			DinoPluginsOmemoDatabase* _tmp9_;
			DinoPluginsOmemoDatabaseIdentityMetaTable* _tmp10_;
			DinoPluginsOmemoDatabaseIdentityMetaTable* _tmp11_;
			QliteColumn* _tmp12_;
			gpointer _tmp13_;
			gchar* _tmp14_;
			const gchar* _tmp15_;
			gchar* _tmp16_;
			gchar* _tmp17_;
			gchar* _tmp18_;
			gchar* _tmp19_;
			GtkStack* _tmp20_;
			GtkButton* _tmp21_;
			_tmp3_ = self->priv->confirm_image;
			gtk_image_set_from_icon_name (_tmp3_, "action-unavailable-symbolic");
			_tmp4_ = self->priv->confirm_title_label;
			_tmp5_ = dino_gettext ("Reject key");
			gtk_label_set_label (_tmp4_, _tmp5_);
			_tmp6_ = self->priv->confirm_desc_label;
			_tmp7_ = dino_gettext ("You won't see encrypted messages from the device of %s that uses this " \
"key. Conversely, that device won't be able to decipher your messages a" \
"nymore.");
			_tmp8_ = self->priv->device;
			_tmp9_ = self->priv->db;
			_tmp10_ = dino_plugins_omemo_database_get_identity_meta (_tmp9_);
			_tmp11_ = _tmp10_;
			_tmp12_ = _tmp11_->address_name;
			_tmp13_ = qlite_row_get (_tmp8_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp12_);
			_tmp14_ = (gchar*) _tmp13_;
			_tmp15_ = string_to_string (_tmp14_);
			_tmp16_ = g_strconcat ("<b>", _tmp15_, "</b>", NULL);
			_tmp17_ = _tmp16_;
			_tmp18_ = g_strdup_printf (_tmp7_, _tmp17_);
			_tmp19_ = _tmp18_;
			gtk_label_set_markup (_tmp6_, _tmp19_);
			_g_free0 (_tmp19_);
			_g_free0 (_tmp17_);
			_g_free0 (_tmp14_);
			_tmp20_ = self->priv->manage_stack;
			gtk_stack_set_visible_child_name (_tmp20_, "confirm");
			_tmp21_ = self->priv->ok_button;
			gtk_widget_set_sensitive ((GtkWidget*) _tmp21_, TRUE);
			self->priv->return_to_main = TRUE;
			self->priv->current_response = (gint) DINO_PLUGINS_OMEMO_TRUST_LEVEL_UNTRUSTED;
		} else {
			GtkListBoxRow* _tmp22_;
			_tmp22_ = _data28_->accept_row;
			if (row == _tmp22_) {
				GtkImage* _tmp23_;
				GtkLabel* _tmp24_;
				const gchar* _tmp25_;
				GtkLabel* _tmp26_;
				const gchar* _tmp27_;
				QliteRow* _tmp28_;
				DinoPluginsOmemoDatabase* _tmp29_;
				DinoPluginsOmemoDatabaseIdentityMetaTable* _tmp30_;
				DinoPluginsOmemoDatabaseIdentityMetaTable* _tmp31_;
				QliteColumn* _tmp32_;
				gpointer _tmp33_;
				gchar* _tmp34_;
				const gchar* _tmp35_;
				gchar* _tmp36_;
				gchar* _tmp37_;
				gchar* _tmp38_;
				gchar* _tmp39_;
				GtkStack* _tmp40_;
				GtkButton* _tmp41_;
				_tmp23_ = self->priv->confirm_image;
				gtk_image_set_from_icon_name (_tmp23_, "check-plain-symbolic");
				_tmp24_ = self->priv->confirm_title_label;
				_tmp25_ = dino_gettext ("Accept key");
				gtk_label_set_label (_tmp24_, _tmp25_);
				_tmp26_ = self->priv->confirm_desc_label;
				_tmp27_ = dino_gettext ("You will be able to exchange encrypted messages with the device of %s " \
"that uses this key.");
				_tmp28_ = self->priv->device;
				_tmp29_ = self->priv->db;
				_tmp30_ = dino_plugins_omemo_database_get_identity_meta (_tmp29_);
				_tmp31_ = _tmp30_;
				_tmp32_ = _tmp31_->address_name;
				_tmp33_ = qlite_row_get (_tmp28_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp32_);
				_tmp34_ = (gchar*) _tmp33_;
				_tmp35_ = string_to_string (_tmp34_);
				_tmp36_ = g_strconcat ("<b>", _tmp35_, "</b>", NULL);
				_tmp37_ = _tmp36_;
				_tmp38_ = g_strdup_printf (_tmp27_, _tmp37_);
				_tmp39_ = _tmp38_;
				gtk_label_set_markup (_tmp26_, _tmp39_);
				_g_free0 (_tmp39_);
				_g_free0 (_tmp37_);
				_g_free0 (_tmp34_);
				_tmp40_ = self->priv->manage_stack;
				gtk_stack_set_visible_child_name (_tmp40_, "confirm");
				_tmp41_ = self->priv->ok_button;
				gtk_widget_set_sensitive ((GtkWidget*) _tmp41_, TRUE);
				self->priv->return_to_main = TRUE;
				self->priv->current_response = (gint) DINO_PLUGINS_OMEMO_TRUST_LEVEL_TRUSTED;
			}
		}
	}
	_tmp42_ = self->priv->cancel_button;
	_tmp43_ = dino_gettext ("Back");
	gtk_button_set_label (_tmp42_, _tmp43_);
}

static void
___lambda28__gtk_list_box_row_activated (GtkListBox* _sender,
                                         GtkListBoxRow* row,
                                         gpointer self)
{
	__lambda28_ (self, row);
}

static void
dino_plugins_omemo_manage_key_dialog_setup_main_screen (DinoPluginsOmemoManageKeyDialog* self)
{
	Block28Data* _data28_;
	GtkListBox* _tmp0_;
	GtkListBoxRow* _tmp1_ = NULL;
	GtkListBoxRow* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	GtkBox* _tmp5_;
	GtkBox* _tmp6_;
	GtkListBoxRow* _tmp7_ = NULL;
	GtkListBoxRow* _tmp8_;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	GtkBox* _tmp11_;
	GtkBox* _tmp12_;
	GtkListBoxRow* _tmp13_ = NULL;
	GtkListBoxRow* _tmp14_;
	const gchar* _tmp15_;
	const gchar* _tmp16_;
	GtkBox* _tmp17_;
	GtkBox* _tmp18_;
	QliteRow* _tmp19_;
	DinoPluginsOmemoDatabase* _tmp20_;
	DinoPluginsOmemoDatabaseIdentityMetaTable* _tmp21_;
	DinoPluginsOmemoDatabaseIdentityMetaTable* _tmp22_;
	QliteColumn* _tmp23_;
	gpointer _tmp24_;
	GtkListBox* _tmp116_;
	GtkStack* _tmp117_;
	g_return_if_fail (self != NULL);
	_data28_ = g_slice_new0 (Block28Data);
	_data28_->_ref_count_ = 1;
	_data28_->self = g_object_ref (self);
	_tmp0_ = self->priv->main_action_list;
	gtk_list_box_set_header_func (_tmp0_, ___lambda27__gtk_list_box_update_header_func, g_object_ref (self), g_object_unref);
	_tmp1_ = (GtkListBoxRow*) gtk_list_box_row_new ();
	gtk_widget_set_visible ((GtkWidget*) _tmp1_, TRUE);
	g_object_ref_sink (_tmp1_);
	_data28_->verify_row = _tmp1_;
	_tmp2_ = _data28_->verify_row;
	_tmp3_ = dino_gettext ("Verify key fingerprint");
	_tmp4_ = dino_gettext ("Compare this key's fingerprint with the fingerprint displayed on the c" \
"ontact's device.");
	_tmp5_ = dino_plugins_omemo_manage_key_dialog_make_action_box (self, _tmp3_, _tmp4_);
	_tmp6_ = _tmp5_;
	gtk_list_box_row_set_child (_tmp2_, (GtkWidget*) _tmp6_);
	_g_object_unref0 (_tmp6_);
	_tmp7_ = (GtkListBoxRow*) gtk_list_box_row_new ();
	gtk_widget_set_visible ((GtkWidget*) _tmp7_, TRUE);
	g_object_ref_sink (_tmp7_);
	_data28_->reject_row = _tmp7_;
	_tmp8_ = _data28_->reject_row;
	_tmp9_ = dino_gettext ("Reject key");
	_tmp10_ = dino_gettext ("Block encrypted communication with the contact's device that uses this" \
" key.");
	_tmp11_ = dino_plugins_omemo_manage_key_dialog_make_action_box (self, _tmp9_, _tmp10_);
	_tmp12_ = _tmp11_;
	gtk_list_box_row_set_child (_tmp8_, (GtkWidget*) _tmp12_);
	_g_object_unref0 (_tmp12_);
	_tmp13_ = (GtkListBoxRow*) gtk_list_box_row_new ();
	gtk_widget_set_visible ((GtkWidget*) _tmp13_, TRUE);
	g_object_ref_sink (_tmp13_);
	_data28_->accept_row = _tmp13_;
	_tmp14_ = _data28_->accept_row;
	_tmp15_ = dino_gettext ("Accept key");
	_tmp16_ = dino_gettext ("Allow encrypted communication with the contact's device that uses this" \
" key.");
	_tmp17_ = dino_plugins_omemo_manage_key_dialog_make_action_box (self, _tmp15_, _tmp16_);
	_tmp18_ = _tmp17_;
	gtk_list_box_row_set_child (_tmp14_, (GtkWidget*) _tmp18_);
	_g_object_unref0 (_tmp18_);
	_tmp19_ = self->priv->device;
	_tmp20_ = self->priv->db;
	_tmp21_ = dino_plugins_omemo_database_get_identity_meta (_tmp20_);
	_tmp22_ = _tmp21_;
	_tmp23_ = _tmp22_->trust_level;
	_tmp24_ = qlite_row_get (_tmp19_, G_TYPE_INT, NULL, NULL, _tmp23_);
	switch ((DinoPluginsOmemoTrustLevel) ((gint) ((gintptr) _tmp24_))) {
		case DINO_PLUGINS_OMEMO_TRUST_LEVEL_TRUSTED:
		{
			GtkLabel* _tmp25_;
			const gchar* _tmp26_;
			const gchar* _tmp27_;
			gchar* _tmp28_;
			gchar* _tmp29_;
			gchar* _tmp30_;
			gchar* _tmp31_;
			gchar* _tmp32_;
			gchar* _tmp33_;
			gchar* _tmp34_;
			gchar* _tmp35_;
			const gchar* _tmp36_;
			QliteRow* _tmp37_;
			DinoPluginsOmemoDatabase* _tmp38_;
			DinoPluginsOmemoDatabaseIdentityMetaTable* _tmp39_;
			DinoPluginsOmemoDatabaseIdentityMetaTable* _tmp40_;
			QliteColumn* _tmp41_;
			gpointer _tmp42_;
			gchar* _tmp43_;
			const gchar* _tmp44_;
			gchar* _tmp45_;
			gchar* _tmp46_;
			gchar* _tmp47_;
			gchar* _tmp48_;
			gchar* _tmp49_;
			gchar* _tmp50_;
			GtkListBox* _tmp51_;
			GtkListBoxRow* _tmp52_;
			GtkListBox* _tmp53_;
			GtkListBoxRow* _tmp54_;
			_tmp25_ = self->priv->main_desc_label;
			_tmp26_ = dino_gettext ("This key is currently %s.");
			_tmp27_ = dino_gettext ("accepted");
			_tmp28_ = g_strconcat ("<span color='#1A63D9'>", _tmp27_, NULL);
			_tmp29_ = _tmp28_;
			_tmp30_ = g_strconcat (_tmp29_, "</span>", NULL);
			_tmp31_ = _tmp30_;
			_tmp32_ = g_strdup_printf (_tmp26_, _tmp31_);
			_tmp33_ = _tmp32_;
			_tmp34_ = g_strconcat (_tmp33_, " ", NULL);
			_tmp35_ = _tmp34_;
			_tmp36_ = dino_gettext ("This means it can be used by %s to receive and send encrypted messages" \
".");
			_tmp37_ = self->priv->device;
			_tmp38_ = self->priv->db;
			_tmp39_ = dino_plugins_omemo_database_get_identity_meta (_tmp38_);
			_tmp40_ = _tmp39_;
			_tmp41_ = _tmp40_->address_name;
			_tmp42_ = qlite_row_get (_tmp37_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp41_);
			_tmp43_ = (gchar*) _tmp42_;
			_tmp44_ = string_to_string (_tmp43_);
			_tmp45_ = g_strconcat ("<b>", _tmp44_, "</b>", NULL);
			_tmp46_ = _tmp45_;
			_tmp47_ = g_strdup_printf (_tmp36_, _tmp46_);
			_tmp48_ = _tmp47_;
			_tmp49_ = g_strconcat (_tmp35_, _tmp48_, NULL);
			_tmp50_ = _tmp49_;
			gtk_label_set_markup (_tmp25_, _tmp50_);
			_g_free0 (_tmp50_);
			_g_free0 (_tmp48_);
			_g_free0 (_tmp46_);
			_g_free0 (_tmp43_);
			_g_free0 (_tmp35_);
			_g_free0 (_tmp33_);
			_g_free0 (_tmp31_);
			_g_free0 (_tmp29_);
			_tmp51_ = self->priv->main_action_list;
			_tmp52_ = _data28_->verify_row;
			gtk_list_box_append (_tmp51_, (GtkWidget*) _tmp52_);
			_tmp53_ = self->priv->main_action_list;
			_tmp54_ = _data28_->reject_row;
			gtk_list_box_append (_tmp53_, (GtkWidget*) _tmp54_);
			break;
		}
		case DINO_PLUGINS_OMEMO_TRUST_LEVEL_VERIFIED:
		{
			GtkLabel* _tmp55_;
			const gchar* _tmp56_;
			const gchar* _tmp57_;
			gchar* _tmp58_;
			gchar* _tmp59_;
			gchar* _tmp60_;
			gchar* _tmp61_;
			gchar* _tmp62_;
			gchar* _tmp63_;
			gchar* _tmp64_;
			gchar* _tmp65_;
			const gchar* _tmp66_;
			QliteRow* _tmp67_;
			DinoPluginsOmemoDatabase* _tmp68_;
			DinoPluginsOmemoDatabaseIdentityMetaTable* _tmp69_;
			DinoPluginsOmemoDatabaseIdentityMetaTable* _tmp70_;
			QliteColumn* _tmp71_;
			gpointer _tmp72_;
			gchar* _tmp73_;
			const gchar* _tmp74_;
			gchar* _tmp75_;
			gchar* _tmp76_;
			gchar* _tmp77_;
			gchar* _tmp78_;
			gchar* _tmp79_;
			gchar* _tmp80_;
			gchar* _tmp81_;
			gchar* _tmp82_;
			const gchar* _tmp83_;
			gchar* _tmp84_;
			gchar* _tmp85_;
			GtkListBox* _tmp86_;
			GtkListBoxRow* _tmp87_;
			_tmp55_ = self->priv->main_desc_label;
			_tmp56_ = dino_gettext ("This key is currently %s.");
			_tmp57_ = dino_gettext ("verified");
			_tmp58_ = g_strconcat ("<span color='#1A63D9'>", _tmp57_, NULL);
			_tmp59_ = _tmp58_;
			_tmp60_ = g_strconcat (_tmp59_, "</span>", NULL);
			_tmp61_ = _tmp60_;
			_tmp62_ = g_strdup_printf (_tmp56_, _tmp61_);
			_tmp63_ = _tmp62_;
			_tmp64_ = g_strconcat (_tmp63_, " ", NULL);
			_tmp65_ = _tmp64_;
			_tmp66_ = dino_gettext ("This means it can be used by %s to receive and send encrypted messages" \
".");
			_tmp67_ = self->priv->device;
			_tmp68_ = self->priv->db;
			_tmp69_ = dino_plugins_omemo_database_get_identity_meta (_tmp68_);
			_tmp70_ = _tmp69_;
			_tmp71_ = _tmp70_->address_name;
			_tmp72_ = qlite_row_get (_tmp67_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp71_);
			_tmp73_ = (gchar*) _tmp72_;
			_tmp74_ = string_to_string (_tmp73_);
			_tmp75_ = g_strconcat ("<b>", _tmp74_, "</b>", NULL);
			_tmp76_ = _tmp75_;
			_tmp77_ = g_strdup_printf (_tmp66_, _tmp76_);
			_tmp78_ = _tmp77_;
			_tmp79_ = g_strconcat (_tmp65_, _tmp78_, NULL);
			_tmp80_ = _tmp79_;
			_tmp81_ = g_strconcat (_tmp80_, " ", NULL);
			_tmp82_ = _tmp81_;
			_tmp83_ = dino_gettext ("Additionally it has been verified to match the key on the contact's de" \
"vice.");
			_tmp84_ = g_strconcat (_tmp82_, _tmp83_, NULL);
			_tmp85_ = _tmp84_;
			gtk_label_set_markup (_tmp55_, _tmp85_);
			_g_free0 (_tmp85_);
			_g_free0 (_tmp82_);
			_g_free0 (_tmp80_);
			_g_free0 (_tmp78_);
			_g_free0 (_tmp76_);
			_g_free0 (_tmp73_);
			_g_free0 (_tmp65_);
			_g_free0 (_tmp63_);
			_g_free0 (_tmp61_);
			_g_free0 (_tmp59_);
			_tmp86_ = self->priv->main_action_list;
			_tmp87_ = _data28_->reject_row;
			gtk_list_box_append (_tmp86_, (GtkWidget*) _tmp87_);
			break;
		}
		case DINO_PLUGINS_OMEMO_TRUST_LEVEL_UNTRUSTED:
		{
			GtkLabel* _tmp88_;
			const gchar* _tmp89_;
			const gchar* _tmp90_;
			gchar* _tmp91_;
			gchar* _tmp92_;
			gchar* _tmp93_;
			gchar* _tmp94_;
			gchar* _tmp95_;
			gchar* _tmp96_;
			gchar* _tmp97_;
			gchar* _tmp98_;
			const gchar* _tmp99_;
			QliteRow* _tmp100_;
			DinoPluginsOmemoDatabase* _tmp101_;
			DinoPluginsOmemoDatabaseIdentityMetaTable* _tmp102_;
			DinoPluginsOmemoDatabaseIdentityMetaTable* _tmp103_;
			QliteColumn* _tmp104_;
			gpointer _tmp105_;
			gchar* _tmp106_;
			const gchar* _tmp107_;
			gchar* _tmp108_;
			gchar* _tmp109_;
			gchar* _tmp110_;
			gchar* _tmp111_;
			gchar* _tmp112_;
			gchar* _tmp113_;
			GtkListBox* _tmp114_;
			GtkListBoxRow* _tmp115_;
			_tmp88_ = self->priv->main_desc_label;
			_tmp89_ = dino_gettext ("This key is currently %s.");
			_tmp90_ = dino_gettext ("rejected");
			_tmp91_ = g_strconcat ("<span color='#D91900'>", _tmp90_, NULL);
			_tmp92_ = _tmp91_;
			_tmp93_ = g_strconcat (_tmp92_, "</span>", NULL);
			_tmp94_ = _tmp93_;
			_tmp95_ = g_strdup_printf (_tmp89_, _tmp94_);
			_tmp96_ = _tmp95_;
			_tmp97_ = g_strconcat (_tmp96_, " ", NULL);
			_tmp98_ = _tmp97_;
			_tmp99_ = dino_gettext ("This means it cannot be used by %s to decipher your messages, and you " \
"won't see messages encrypted with it.");
			_tmp100_ = self->priv->device;
			_tmp101_ = self->priv->db;
			_tmp102_ = dino_plugins_omemo_database_get_identity_meta (_tmp101_);
			_tmp103_ = _tmp102_;
			_tmp104_ = _tmp103_->address_name;
			_tmp105_ = qlite_row_get (_tmp100_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp104_);
			_tmp106_ = (gchar*) _tmp105_;
			_tmp107_ = string_to_string (_tmp106_);
			_tmp108_ = g_strconcat ("<b>", _tmp107_, "</b>", NULL);
			_tmp109_ = _tmp108_;
			_tmp110_ = g_strdup_printf (_tmp99_, _tmp109_);
			_tmp111_ = _tmp110_;
			_tmp112_ = g_strconcat (_tmp98_, _tmp111_, NULL);
			_tmp113_ = _tmp112_;
			gtk_label_set_markup (_tmp88_, _tmp113_);
			_g_free0 (_tmp113_);
			_g_free0 (_tmp111_);
			_g_free0 (_tmp109_);
			_g_free0 (_tmp106_);
			_g_free0 (_tmp98_);
			_g_free0 (_tmp96_);
			_g_free0 (_tmp94_);
			_g_free0 (_tmp92_);
			_tmp114_ = self->priv->main_action_list;
			_tmp115_ = _data28_->accept_row;
			gtk_list_box_append (_tmp114_, (GtkWidget*) _tmp115_);
			break;
		}
		default:
		break;
	}
	_tmp116_ = self->priv->main_action_list;
	g_signal_connect_data (_tmp116_, "row-activated", (GCallback) ___lambda28__gtk_list_box_row_activated, block28_data_ref (_data28_), (GClosureNotify) block28_data_unref, 0);
	_tmp117_ = self->priv->manage_stack;
	gtk_stack_set_visible_child_name (_tmp117_, "main");
	block28_data_unref (_data28_);
	_data28_ = NULL;
}

static void
dino_plugins_omemo_manage_key_dialog_setup_verify_screen (DinoPluginsOmemoManageKeyDialog* self)
{
	GtkLabel* _tmp0_;
	QliteRow* _tmp1_;
	DinoPluginsOmemoDatabase* _tmp2_;
	DinoPluginsOmemoDatabaseIdentityMetaTable* _tmp3_;
	DinoPluginsOmemoDatabaseIdentityMetaTable* _tmp4_;
	QliteColumn* _tmp5_;
	gpointer _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->verify_label;
	_tmp1_ = self->priv->device;
	_tmp2_ = self->priv->db;
	_tmp3_ = dino_plugins_omemo_database_get_identity_meta (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = _tmp4_->identity_key_public_base64;
	_tmp6_ = qlite_row_get (_tmp1_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp5_);
	_tmp7_ = (gchar*) _tmp6_;
	_tmp8_ = dino_plugins_omemo_fingerprint_from_base64 (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = dino_plugins_omemo_fingerprint_markup (_tmp9_);
	_tmp11_ = _tmp10_;
	gtk_label_set_markup (_tmp0_, _tmp11_);
	_g_free0 (_tmp11_);
	_g_free0 (_tmp9_);
	_g_free0 (_tmp7_);
}

static GObject *
dino_plugins_omemo_manage_key_dialog_constructor (GType type,
                                                  guint n_construct_properties,
                                                  GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	DinoPluginsOmemoManageKeyDialog * self;
	const gchar* _tmp0_;
	GtkLabel* _tmp1_;
	const gchar* _tmp2_;
	GtkButton* _tmp3_;
	const gchar* _tmp4_;
	GtkButton* _tmp5_;
	const gchar* _tmp6_;
	GtkButton* _tmp7_;
	const gchar* _tmp8_;
	GtkButton* _tmp9_;
	const gchar* _tmp10_;
	parent_class = G_OBJECT_CLASS (dino_plugins_omemo_manage_key_dialog_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_PLUGINS_OMEMO_TYPE_MANAGE_KEY_DIALOG, DinoPluginsOmemoManageKeyDialog);
	_tmp0_ = dino_gettext ("Manage Key");
	gtk_window_set_title ((GtkWindow*) self, _tmp0_);
	_tmp1_ = self->priv->compare_fingerprint_label;
	_tmp2_ = dino_gettext ("Compare the fingerprint, character by character, with the one shown on" \
" your contact's device.");
	gtk_label_set_label (_tmp1_, _tmp2_);
	_tmp3_ = self->priv->verify_no_button;
	_tmp4_ = dino_gettext ("Fingerprints differ");
	gtk_button_set_label (_tmp3_, _tmp4_);
	_tmp5_ = self->priv->verify_yes_button;
	_tmp6_ = dino_gettext ("Fingerprints match");
	gtk_button_set_label (_tmp5_, _tmp6_);
	_tmp7_ = self->priv->cancel_button;
	_tmp8_ = dino_gettext ("Cancel");
	gtk_button_set_label (_tmp7_, _tmp8_);
	_tmp9_ = self->priv->ok_button;
	_tmp10_ = dino_gettext ("Confirm");
	gtk_button_set_label (_tmp9_, _tmp10_);
	return obj;
}

static void
dino_plugins_omemo_manage_key_dialog_class_init (DinoPluginsOmemoManageKeyDialogClass * klass,
                                                 gpointer klass_data)
{
	dino_plugins_omemo_manage_key_dialog_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoPluginsOmemoManageKeyDialog_private_offset);
	G_OBJECT_CLASS (klass)->constructor = dino_plugins_omemo_manage_key_dialog_constructor;
	G_OBJECT_CLASS (klass)->finalize = dino_plugins_omemo_manage_key_dialog_finalize;
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/im/dino/Dino/omemo/manage_key_dialog.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "manage_stack", FALSE, DinoPluginsOmemoManageKeyDialog_private_offset + G_STRUCT_OFFSET (DinoPluginsOmemoManageKeyDialogPrivate, manage_stack));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "cancel_button", FALSE, DinoPluginsOmemoManageKeyDialog_private_offset + G_STRUCT_OFFSET (DinoPluginsOmemoManageKeyDialogPrivate, cancel_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "ok_button", FALSE, DinoPluginsOmemoManageKeyDialog_private_offset + G_STRUCT_OFFSET (DinoPluginsOmemoManageKeyDialogPrivate, ok_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "main_desc_label", FALSE, DinoPluginsOmemoManageKeyDialog_private_offset + G_STRUCT_OFFSET (DinoPluginsOmemoManageKeyDialogPrivate, main_desc_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "main_action_list", FALSE, DinoPluginsOmemoManageKeyDialog_private_offset + G_STRUCT_OFFSET (DinoPluginsOmemoManageKeyDialogPrivate, main_action_list));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "confirm_image", FALSE, DinoPluginsOmemoManageKeyDialog_private_offset + G_STRUCT_OFFSET (DinoPluginsOmemoManageKeyDialogPrivate, confirm_image));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "confirm_title_label", FALSE, DinoPluginsOmemoManageKeyDialog_private_offset + G_STRUCT_OFFSET (DinoPluginsOmemoManageKeyDialogPrivate, confirm_title_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "confirm_desc_label", FALSE, DinoPluginsOmemoManageKeyDialog_private_offset + G_STRUCT_OFFSET (DinoPluginsOmemoManageKeyDialogPrivate, confirm_desc_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "verify_label", FALSE, DinoPluginsOmemoManageKeyDialog_private_offset + G_STRUCT_OFFSET (DinoPluginsOmemoManageKeyDialogPrivate, verify_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "compare_fingerprint_label", FALSE, DinoPluginsOmemoManageKeyDialog_private_offset + G_STRUCT_OFFSET (DinoPluginsOmemoManageKeyDialogPrivate, compare_fingerprint_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "verify_yes_button", FALSE, DinoPluginsOmemoManageKeyDialog_private_offset + G_STRUCT_OFFSET (DinoPluginsOmemoManageKeyDialogPrivate, verify_yes_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "verify_no_button", FALSE, DinoPluginsOmemoManageKeyDialog_private_offset + G_STRUCT_OFFSET (DinoPluginsOmemoManageKeyDialogPrivate, verify_no_button));
}

static void
dino_plugins_omemo_manage_key_dialog_instance_init (DinoPluginsOmemoManageKeyDialog * self,
                                                    gpointer klass)
{
	self->priv = dino_plugins_omemo_manage_key_dialog_get_instance_private (self);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
dino_plugins_omemo_manage_key_dialog_finalize (GObject * obj)
{
	DinoPluginsOmemoManageKeyDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_PLUGINS_OMEMO_TYPE_MANAGE_KEY_DIALOG, DinoPluginsOmemoManageKeyDialog);
	_qlite_row_unref0 (self->priv->device);
	_qlite_database_unref0 (self->priv->db);
	G_OBJECT_CLASS (dino_plugins_omemo_manage_key_dialog_parent_class)->finalize (obj);
}

static GType
dino_plugins_omemo_manage_key_dialog_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoPluginsOmemoManageKeyDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_plugins_omemo_manage_key_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoPluginsOmemoManageKeyDialog), 0, (GInstanceInitFunc) dino_plugins_omemo_manage_key_dialog_instance_init, NULL };
	GType dino_plugins_omemo_manage_key_dialog_type_id;
	dino_plugins_omemo_manage_key_dialog_type_id = g_type_register_static (gtk_dialog_get_type (), "DinoPluginsOmemoManageKeyDialog", &g_define_type_info, 0);
	DinoPluginsOmemoManageKeyDialog_private_offset = g_type_add_instance_private (dino_plugins_omemo_manage_key_dialog_type_id, sizeof (DinoPluginsOmemoManageKeyDialogPrivate));
	return dino_plugins_omemo_manage_key_dialog_type_id;
}

GType
dino_plugins_omemo_manage_key_dialog_get_type (void)
{
	static volatile gsize dino_plugins_omemo_manage_key_dialog_type_id__once = 0;
	if (g_once_init_enter (&dino_plugins_omemo_manage_key_dialog_type_id__once)) {
		GType dino_plugins_omemo_manage_key_dialog_type_id;
		dino_plugins_omemo_manage_key_dialog_type_id = dino_plugins_omemo_manage_key_dialog_get_type_once ();
		g_once_init_leave (&dino_plugins_omemo_manage_key_dialog_type_id__once, dino_plugins_omemo_manage_key_dialog_type_id);
	}
	return dino_plugins_omemo_manage_key_dialog_type_id__once;
}

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

