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

#include <gtk/gtk.h>
#include <glib-object.h>
#include "libdino.h"
#include <glib.h>
#include "dino_i18n.h"
#include <stdlib.h>
#include <string.h>
#include "xmpp-vala.h"

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define DINO_UI_TYPE_ADD_GROUPCHAT_DIALOG (dino_ui_add_groupchat_dialog_get_type ())
#define DINO_UI_ADD_GROUPCHAT_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_TYPE_ADD_GROUPCHAT_DIALOG, DinoUiAddGroupchatDialog))
#define DINO_UI_ADD_GROUPCHAT_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_TYPE_ADD_GROUPCHAT_DIALOG, DinoUiAddGroupchatDialogClass))
#define DINO_UI_IS_ADD_GROUPCHAT_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_TYPE_ADD_GROUPCHAT_DIALOG))
#define DINO_UI_IS_ADD_GROUPCHAT_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_TYPE_ADD_GROUPCHAT_DIALOG))
#define DINO_UI_ADD_GROUPCHAT_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_TYPE_ADD_GROUPCHAT_DIALOG, DinoUiAddGroupchatDialogClass))

typedef struct _DinoUiAddGroupchatDialog DinoUiAddGroupchatDialog;
typedef struct _DinoUiAddGroupchatDialogClass DinoUiAddGroupchatDialogClass;
typedef struct _DinoUiAddGroupchatDialogPrivate DinoUiAddGroupchatDialogPrivate;

#define DINO_UI_TYPE_ACCOUNT_COMBO_BOX (dino_ui_account_combo_box_get_type ())
#define DINO_UI_ACCOUNT_COMBO_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_TYPE_ACCOUNT_COMBO_BOX, DinoUiAccountComboBox))
#define DINO_UI_ACCOUNT_COMBO_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_TYPE_ACCOUNT_COMBO_BOX, DinoUiAccountComboBoxClass))
#define DINO_UI_IS_ACCOUNT_COMBO_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_TYPE_ACCOUNT_COMBO_BOX))
#define DINO_UI_IS_ACCOUNT_COMBO_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_TYPE_ACCOUNT_COMBO_BOX))
#define DINO_UI_ACCOUNT_COMBO_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_TYPE_ACCOUNT_COMBO_BOX, DinoUiAccountComboBoxClass))

typedef struct _DinoUiAccountComboBox DinoUiAccountComboBox;
typedef struct _DinoUiAccountComboBoxClass DinoUiAccountComboBoxClass;
enum  {
	DINO_UI_ADD_GROUPCHAT_DIALOG_0_PROPERTY,
	DINO_UI_ADD_GROUPCHAT_DIALOG_NUM_PROPERTIES
};
static GParamSpec* dino_ui_add_groupchat_dialog_properties[DINO_UI_ADD_GROUPCHAT_DIALOG_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _xmpp_jid_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_jid_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

struct _DinoUiAddGroupchatDialog {
	GtkDialog parent_instance;
	DinoUiAddGroupchatDialogPrivate * priv;
};

struct _DinoUiAddGroupchatDialogClass {
	GtkDialogClass parent_class;
};

struct _DinoUiAddGroupchatDialogPrivate {
	GtkStack* accounts_stack;
	DinoUiAccountComboBox* account_combobox;
	GtkButton* ok_button;
	GtkButton* cancel_button;
	GtkEntry* jid_entry;
	GtkEntry* alias_entry;
	GtkEntry* nick_entry;
	DinoStreamInteractor* stream_interactor;
	gboolean alias_entry_changed;
};

static gint DinoUiAddGroupchatDialog_private_offset;
static gpointer dino_ui_add_groupchat_dialog_parent_class = NULL;

VALA_EXTERN GType dino_ui_add_groupchat_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiAddGroupchatDialog, g_object_unref)
VALA_EXTERN GType dino_ui_account_combo_box_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiAccountComboBox, g_object_unref)
VALA_EXTERN DinoUiAddGroupchatDialog* dino_ui_add_groupchat_dialog_new (DinoStreamInteractor* stream_interactor);
VALA_EXTERN DinoUiAddGroupchatDialog* dino_ui_add_groupchat_dialog_construct (GType object_type,
                                                                  DinoStreamInteractor* stream_interactor);
VALA_EXTERN void dino_ui_account_combo_box_initialize (DinoUiAccountComboBox* self,
                                           DinoStreamInteractor* stream_interactor);
static void __lambda304_ (DinoUiAddGroupchatDialog* self);
static void ___lambda304__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void dino_ui_add_groupchat_dialog_on_ok_button_clicked (DinoUiAddGroupchatDialog* self);
static void _dino_ui_add_groupchat_dialog_on_ok_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                            gpointer self);
static void dino_ui_add_groupchat_dialog_on_jid_key_release (DinoUiAddGroupchatDialog* self);
static void _dino_ui_add_groupchat_dialog_on_jid_key_release_gtk_editable_changed (GtkEditable* _sender,
                                                                            gpointer self);
static void dino_ui_add_groupchat_dialog_check_ok (DinoUiAddGroupchatDialog* self);
static void _dino_ui_add_groupchat_dialog_check_ok_gtk_editable_changed (GtkEditable* _sender,
                                                                  gpointer self);
VALA_EXTERN DinoEntitiesAccount* dino_ui_account_combo_box_get_selected (DinoUiAccountComboBox* self);
static void dino_ui_add_groupchat_dialog_finalize (GObject * obj);
static GType dino_ui_add_groupchat_dialog_get_type_once (void);

static inline gpointer
dino_ui_add_groupchat_dialog_get_instance_private (DinoUiAddGroupchatDialog* self)
{
	return G_STRUCT_MEMBER_P (self, DinoUiAddGroupchatDialog_private_offset);
}

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

static void
__lambda304_ (DinoUiAddGroupchatDialog* self)
{
	g_signal_emit_by_name ((GtkDialog*) self, "close");
}

static void
___lambda304__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda304_ ((DinoUiAddGroupchatDialog*) self);
}

static void
_dino_ui_add_groupchat_dialog_on_ok_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                       gpointer self)
{
	dino_ui_add_groupchat_dialog_on_ok_button_clicked ((DinoUiAddGroupchatDialog*) self);
}

static void
_dino_ui_add_groupchat_dialog_on_jid_key_release_gtk_editable_changed (GtkEditable* _sender,
                                                                       gpointer self)
{
	dino_ui_add_groupchat_dialog_on_jid_key_release ((DinoUiAddGroupchatDialog*) self);
}

static void
_dino_ui_add_groupchat_dialog_check_ok_gtk_editable_changed (GtkEditable* _sender,
                                                             gpointer self)
{
	dino_ui_add_groupchat_dialog_check_ok ((DinoUiAddGroupchatDialog*) self);
}

DinoUiAddGroupchatDialog*
dino_ui_add_groupchat_dialog_construct (GType object_type,
                                        DinoStreamInteractor* stream_interactor)
{
	DinoUiAddGroupchatDialog * self = NULL;
	DinoStreamInteractor* _tmp0_;
	GtkButton* _tmp1_;
	const gchar* _tmp2_;
	GtkButton* _tmp3_;
	GtkStack* _tmp4_;
	DinoUiAccountComboBox* _tmp5_;
	GtkButton* _tmp6_;
	GtkButton* _tmp7_;
	GtkEntry* _tmp8_;
	GtkEntry* _tmp9_;
	g_return_val_if_fail (stream_interactor != NULL, NULL);
	self = (DinoUiAddGroupchatDialog*) g_object_new (object_type, "use-header-bar", 1, NULL);
	_tmp0_ = _g_object_ref0 (stream_interactor);
	_g_object_unref0 (self->priv->stream_interactor);
	self->priv->stream_interactor = _tmp0_;
	_tmp1_ = self->priv->ok_button;
	_tmp2_ = dino_gettext ("Add");
	gtk_button_set_label (_tmp1_, _tmp2_);
	_tmp3_ = self->priv->ok_button;
	gtk_widget_add_css_class ((GtkWidget*) _tmp3_, "suggested-action");
	_tmp4_ = self->priv->accounts_stack;
	gtk_stack_set_visible_child_name (_tmp4_, "combobox");
	_tmp5_ = self->priv->account_combobox;
	dino_ui_account_combo_box_initialize (_tmp5_, stream_interactor);
	_tmp6_ = self->priv->cancel_button;
	g_signal_connect_object (_tmp6_, "clicked", (GCallback) ___lambda304__gtk_button_clicked, self, 0);
	_tmp7_ = self->priv->ok_button;
	g_signal_connect_object (_tmp7_, "clicked", (GCallback) _dino_ui_add_groupchat_dialog_on_ok_button_clicked_gtk_button_clicked, self, 0);
	_tmp8_ = self->priv->jid_entry;
	g_signal_connect_object ((GtkEditable*) _tmp8_, "changed", (GCallback) _dino_ui_add_groupchat_dialog_on_jid_key_release_gtk_editable_changed, self, 0);
	_tmp9_ = self->priv->nick_entry;
	g_signal_connect_object ((GtkEditable*) _tmp9_, "changed", (GCallback) _dino_ui_add_groupchat_dialog_check_ok_gtk_editable_changed, self, 0);
	return self;
}

DinoUiAddGroupchatDialog*
dino_ui_add_groupchat_dialog_new (DinoStreamInteractor* stream_interactor)
{
	return dino_ui_add_groupchat_dialog_construct (DINO_UI_TYPE_ADD_GROUPCHAT_DIALOG, stream_interactor);
}

static void
dino_ui_add_groupchat_dialog_on_jid_key_release (DinoUiAddGroupchatDialog* self)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	dino_ui_add_groupchat_dialog_check_ok (self);
	if (!self->priv->alias_entry_changed) {
		{
			XmppJid* parsed_jid = NULL;
			GtkEntry* _tmp0_;
			const gchar* _tmp1_;
			const gchar* _tmp2_;
			XmppJid* _tmp3_;
			const gchar* _tmp4_ = NULL;
			gboolean _tmp5_ = FALSE;
			XmppJid* _tmp6_;
			GtkEntry* _tmp14_;
			_tmp0_ = self->priv->jid_entry;
			_tmp1_ = gtk_editable_get_text ((GtkEditable*) _tmp0_);
			_tmp2_ = _tmp1_;
			_tmp3_ = xmpp_jid_new (_tmp2_, &_inner_error0_);
			parsed_jid = _tmp3_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				if (_inner_error0_->domain == XMPP_INVALID_JID_ERROR) {
					goto __catch0_xmpp_invalid_jid_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;
			}
			_tmp6_ = parsed_jid;
			if (_tmp6_ != NULL) {
				XmppJid* _tmp7_;
				const gchar* _tmp8_;
				_tmp7_ = parsed_jid;
				_tmp8_ = _tmp7_->localpart;
				_tmp5_ = _tmp8_ != NULL;
			} else {
				_tmp5_ = FALSE;
			}
			if (_tmp5_) {
				XmppJid* _tmp9_;
				const gchar* _tmp10_;
				_tmp9_ = parsed_jid;
				_tmp10_ = _tmp9_->localpart;
				_tmp4_ = _tmp10_;
			} else {
				GtkEntry* _tmp11_;
				const gchar* _tmp12_;
				const gchar* _tmp13_;
				_tmp11_ = self->priv->jid_entry;
				_tmp12_ = gtk_editable_get_text ((GtkEditable*) _tmp11_);
				_tmp13_ = _tmp12_;
				_tmp4_ = _tmp13_;
			}
			_tmp14_ = self->priv->alias_entry;
			gtk_editable_set_text ((GtkEditable*) _tmp14_, _tmp4_);
			_xmpp_jid_unref0 (parsed_jid);
		}
		goto __finally0;
		__catch0_xmpp_invalid_jid_error:
		{
			GtkEntry* _tmp15_;
			GtkEntry* _tmp16_;
			const gchar* _tmp17_;
			const gchar* _tmp18_;
			g_clear_error (&_inner_error0_);
			_tmp15_ = self->priv->alias_entry;
			_tmp16_ = self->priv->jid_entry;
			_tmp17_ = gtk_editable_get_text ((GtkEditable*) _tmp16_);
			_tmp18_ = _tmp17_;
			gtk_editable_set_text ((GtkEditable*) _tmp15_, _tmp18_);
		}
		__finally0:
		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
dino_ui_add_groupchat_dialog_check_ok (DinoUiAddGroupchatDialog* self)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	{
		XmppJid* parsed_jid = NULL;
		GtkEntry* _tmp0_;
		const gchar* _tmp1_;
		const gchar* _tmp2_;
		XmppJid* _tmp3_;
		gboolean _tmp4_ = FALSE;
		gboolean _tmp5_ = FALSE;
		GtkButton* _tmp8_;
		_tmp0_ = self->priv->jid_entry;
		_tmp1_ = gtk_editable_get_text ((GtkEditable*) _tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = xmpp_jid_new (_tmp2_, &_inner_error0_);
		parsed_jid = _tmp3_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == XMPP_INVALID_JID_ERROR) {
				goto __catch0_xmpp_invalid_jid_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;
		}
		if (parsed_jid != NULL) {
			const gchar* _tmp6_;
			_tmp6_ = parsed_jid->localpart;
			_tmp5_ = _tmp6_ != NULL;
		} else {
			_tmp5_ = FALSE;
		}
		if (_tmp5_) {
			const gchar* _tmp7_;
			_tmp7_ = parsed_jid->resourcepart;
			_tmp4_ = _tmp7_ == NULL;
		} else {
			_tmp4_ = FALSE;
		}
		_tmp8_ = self->priv->ok_button;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp8_, _tmp4_);
		_xmpp_jid_unref0 (parsed_jid);
	}
	goto __finally0;
	__catch0_xmpp_invalid_jid_error:
	{
		GtkButton* _tmp9_;
		g_clear_error (&_inner_error0_);
		_tmp9_ = self->priv->ok_button;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp9_, FALSE);
	}
	__finally0:
	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
dino_ui_add_groupchat_dialog_on_ok_button_clicked (DinoUiAddGroupchatDialog* self)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	{
		XmppConference* conference = NULL;
		XmppConference* _tmp0_;
		XmppJid* _tmp1_ = NULL;
		GtkEntry* _tmp2_;
		const gchar* _tmp3_;
		const gchar* _tmp4_;
		XmppJid* _tmp5_;
		const gchar* _tmp6_ = NULL;
		GtkEntry* _tmp7_;
		const gchar* _tmp8_;
		const gchar* _tmp9_;
		GtkEntry* _tmp13_;
		const gchar* _tmp14_;
		const gchar* _tmp15_;
		DinoStreamInteractor* _tmp16_;
		DinoModuleIdentity* _tmp17_;
		gpointer _tmp18_;
		DinoMucManager* _tmp19_;
		DinoUiAccountComboBox* _tmp20_;
		DinoEntitiesAccount* _tmp21_;
		DinoEntitiesAccount* _tmp22_;
		_tmp0_ = xmpp_conference_new ();
		conference = _tmp0_;
		_tmp2_ = self->priv->jid_entry;
		_tmp3_ = gtk_editable_get_text ((GtkEditable*) _tmp2_);
		_tmp4_ = _tmp3_;
		_tmp5_ = xmpp_jid_new (_tmp4_, &_inner_error0_);
		_tmp1_ = _tmp5_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (conference);
			if (_inner_error0_->domain == XMPP_INVALID_JID_ERROR) {
				goto __catch0_xmpp_invalid_jid_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;
		}
		xmpp_conference_set_jid (conference, _tmp1_);
		_tmp7_ = self->priv->nick_entry;
		_tmp8_ = gtk_editable_get_text ((GtkEditable*) _tmp7_);
		_tmp9_ = _tmp8_;
		if (g_strcmp0 (_tmp9_, "") != 0) {
			GtkEntry* _tmp10_;
			const gchar* _tmp11_;
			const gchar* _tmp12_;
			_tmp10_ = self->priv->nick_entry;
			_tmp11_ = gtk_editable_get_text ((GtkEditable*) _tmp10_);
			_tmp12_ = _tmp11_;
			_tmp6_ = _tmp12_;
		} else {
			_tmp6_ = NULL;
		}
		xmpp_conference_set_nick (conference, _tmp6_);
		_tmp13_ = self->priv->alias_entry;
		_tmp14_ = gtk_editable_get_text ((GtkEditable*) _tmp13_);
		_tmp15_ = _tmp14_;
		xmpp_conference_set_name (conference, _tmp15_);
		_tmp16_ = self->priv->stream_interactor;
		_tmp17_ = dino_muc_manager_IDENTITY;
		_tmp18_ = dino_stream_interactor_get_module (_tmp16_, DINO_TYPE_MUC_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp17_);
		_tmp19_ = (DinoMucManager*) _tmp18_;
		_tmp20_ = self->priv->account_combobox;
		_tmp21_ = dino_ui_account_combo_box_get_selected (_tmp20_);
		_tmp22_ = _tmp21_;
		dino_muc_manager_add_bookmark (_tmp19_, _tmp22_, conference);
		_g_object_unref0 (_tmp19_);
		g_signal_emit_by_name ((GtkDialog*) self, "close");
		_xmpp_jid_unref0 (_tmp1_);
		_g_object_unref0 (conference);
	}
	goto __finally0;
	__catch0_xmpp_invalid_jid_error:
	{
		GError* e = NULL;
		GError* _tmp23_;
		const gchar* _tmp24_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp23_ = e;
		_tmp24_ = _tmp23_->message;
		g_warning ("add_groupchat_dialog.vala:68: Ignoring invalid conference Jid: %s", _tmp24_);
		_g_error_free0 (e);
	}
	__finally0:
	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
dino_ui_add_groupchat_dialog_class_init (DinoUiAddGroupchatDialogClass * klass,
                                         gpointer klass_data)
{
	dino_ui_add_groupchat_dialog_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoUiAddGroupchatDialog_private_offset);
	G_OBJECT_CLASS (klass)->finalize = dino_ui_add_groupchat_dialog_finalize;
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/im/dino/Dino/add_conversation/add_groupchat_dialog.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "accounts_stack", FALSE, DinoUiAddGroupchatDialog_private_offset + G_STRUCT_OFFSET (DinoUiAddGroupchatDialogPrivate, accounts_stack));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "account_combobox", FALSE, DinoUiAddGroupchatDialog_private_offset + G_STRUCT_OFFSET (DinoUiAddGroupchatDialogPrivate, account_combobox));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "ok_button", FALSE, DinoUiAddGroupchatDialog_private_offset + G_STRUCT_OFFSET (DinoUiAddGroupchatDialogPrivate, ok_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "cancel_button", FALSE, DinoUiAddGroupchatDialog_private_offset + G_STRUCT_OFFSET (DinoUiAddGroupchatDialogPrivate, cancel_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "jid_entry", FALSE, DinoUiAddGroupchatDialog_private_offset + G_STRUCT_OFFSET (DinoUiAddGroupchatDialogPrivate, jid_entry));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "alias_entry", FALSE, DinoUiAddGroupchatDialog_private_offset + G_STRUCT_OFFSET (DinoUiAddGroupchatDialogPrivate, alias_entry));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "nick_entry", FALSE, DinoUiAddGroupchatDialog_private_offset + G_STRUCT_OFFSET (DinoUiAddGroupchatDialogPrivate, nick_entry));
}

static void
dino_ui_add_groupchat_dialog_instance_init (DinoUiAddGroupchatDialog * self,
                                            gpointer klass)
{
	self->priv = dino_ui_add_groupchat_dialog_get_instance_private (self);
	self->priv->alias_entry_changed = FALSE;
	g_type_ensure (DINO_UI_TYPE_ACCOUNT_COMBO_BOX);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
dino_ui_add_groupchat_dialog_finalize (GObject * obj)
{
	DinoUiAddGroupchatDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_UI_TYPE_ADD_GROUPCHAT_DIALOG, DinoUiAddGroupchatDialog);
	_g_object_unref0 (self->priv->stream_interactor);
	G_OBJECT_CLASS (dino_ui_add_groupchat_dialog_parent_class)->finalize (obj);
}

static GType
dino_ui_add_groupchat_dialog_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoUiAddGroupchatDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_ui_add_groupchat_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoUiAddGroupchatDialog), 0, (GInstanceInitFunc) dino_ui_add_groupchat_dialog_instance_init, NULL };
	GType dino_ui_add_groupchat_dialog_type_id;
	dino_ui_add_groupchat_dialog_type_id = g_type_register_static (gtk_dialog_get_type (), "DinoUiAddGroupchatDialog", &g_define_type_info, 0);
	DinoUiAddGroupchatDialog_private_offset = g_type_add_instance_private (dino_ui_add_groupchat_dialog_type_id, sizeof (DinoUiAddGroupchatDialogPrivate));
	return dino_ui_add_groupchat_dialog_type_id;
}

GType
dino_ui_add_groupchat_dialog_get_type (void)
{
	static volatile gsize dino_ui_add_groupchat_dialog_type_id__once = 0;
	if (g_once_init_enter (&dino_ui_add_groupchat_dialog_type_id__once)) {
		GType dino_ui_add_groupchat_dialog_type_id;
		dino_ui_add_groupchat_dialog_type_id = dino_ui_add_groupchat_dialog_get_type_once ();
		g_once_init_leave (&dino_ui_add_groupchat_dialog_type_id__once, dino_ui_add_groupchat_dialog_type_id);
	}
	return dino_ui_add_groupchat_dialog_type_id__once;
}

