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

#include <adwaita.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <gio/gio.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.h>
#include <libsoup/soup.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 TUBA_DIALOGS_ADMIN_TYPE_BASE (tuba_dialogs_admin_base_get_type ())
#define TUBA_DIALOGS_ADMIN_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_DIALOGS_ADMIN_TYPE_BASE, TubaDialogsAdminBase))
#define TUBA_DIALOGS_ADMIN_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_DIALOGS_ADMIN_TYPE_BASE, TubaDialogsAdminBaseClass))
#define TUBA_DIALOGS_ADMIN_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_DIALOGS_ADMIN_TYPE_BASE))
#define TUBA_DIALOGS_ADMIN_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_DIALOGS_ADMIN_TYPE_BASE))
#define TUBA_DIALOGS_ADMIN_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_DIALOGS_ADMIN_TYPE_BASE, TubaDialogsAdminBaseClass))

typedef struct _TubaDialogsAdminBase TubaDialogsAdminBase;
typedef struct _TubaDialogsAdminBaseClass TubaDialogsAdminBaseClass;
typedef struct _TubaDialogsAdminBasePrivate TubaDialogsAdminBasePrivate;

#define TUBA_DIALOGS_ADMIN_TYPE_ADD_IP_BLOCK (tuba_dialogs_admin_add_ip_block_get_type ())
#define TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_DIALOGS_ADMIN_TYPE_ADD_IP_BLOCK, TubaDialogsAdminAddIPBlock))
#define TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_DIALOGS_ADMIN_TYPE_ADD_IP_BLOCK, TubaDialogsAdminAddIPBlockClass))
#define TUBA_DIALOGS_ADMIN_IS_ADD_IP_BLOCK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_DIALOGS_ADMIN_TYPE_ADD_IP_BLOCK))
#define TUBA_DIALOGS_ADMIN_IS_ADD_IP_BLOCK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_DIALOGS_ADMIN_TYPE_ADD_IP_BLOCK))
#define TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_DIALOGS_ADMIN_TYPE_ADD_IP_BLOCK, TubaDialogsAdminAddIPBlockClass))

typedef struct _TubaDialogsAdminAddIPBlock TubaDialogsAdminAddIPBlock;
typedef struct _TubaDialogsAdminAddIPBlockClass TubaDialogsAdminAddIPBlockClass;
typedef struct _TubaDialogsAdminAddIPBlockPrivate TubaDialogsAdminAddIPBlockPrivate;
enum  {
	TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_0_PROPERTY,
	TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_NUM_PROPERTIES
};
static GParamSpec* tuba_dialogs_admin_add_ip_block_properties[TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_NUM_PROPERTIES];
typedef enum  {
	TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_DAY_1,
	TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_WEEK_2,
	TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_MONTH_1,
	TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_MONTH_6,
	TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_YEAR_1,
	TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_YEAR_3
} TubaDialogsAdminAddIPBlockExpiration;

#define TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_TYPE_EXPIRATION (tuba_dialogs_admin_add_ip_block_expiration_get_type ())
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef enum  {
	TUBA_API_ADMIN_IP_BLOCK_SEVERITY_NO_ACCESS,
	TUBA_API_ADMIN_IP_BLOCK_SEVERITY_SIGN_UP_BLOCK,
	TUBA_API_ADMIN_IP_BLOCK_SEVERITY_SIGN_UP_REQUIRES_APPROVAL
} TubaAPIAdminIPBlockSeverity;

#define TUBA_API_ADMIN_IP_BLOCK_TYPE_SEVERITY (tuba_api_admin_ip_block_severity_get_type ())

#define TUBA_TYPE_REQUEST_V2 (tuba_request_v2_get_type ())
#define TUBA_REQUEST_V2(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_REQUEST_V2, TubaRequestV2))
#define TUBA_REQUEST_V2_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_REQUEST_V2, TubaRequestV2Class))
#define TUBA_IS_REQUEST_V2(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_REQUEST_V2))
#define TUBA_IS_REQUEST_V2_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_REQUEST_V2))
#define TUBA_REQUEST_V2_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_REQUEST_V2, TubaRequestV2Class))

typedef struct _TubaRequestV2 TubaRequestV2;
typedef struct _TubaRequestV2Class TubaRequestV2Class;
typedef enum  {
	TUBA_REQUEST_V2_METHOD_GET,
	TUBA_REQUEST_V2_METHOD_POST,
	TUBA_REQUEST_V2_METHOD_PUT,
	TUBA_REQUEST_V2_METHOD_DELETE,
	TUBA_REQUEST_V2_METHOD_PATCH
} TubaRequestV2Method;

#define TUBA_REQUEST_V2_TYPE_METHOD (tuba_request_v2_method_get_type ())

#define TUBA_TYPE_ACCOUNT_STORE (tuba_account_store_get_type ())
#define TUBA_ACCOUNT_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_ACCOUNT_STORE, TubaAccountStore))
#define TUBA_ACCOUNT_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_ACCOUNT_STORE, TubaAccountStoreClass))
#define TUBA_IS_ACCOUNT_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_ACCOUNT_STORE))
#define TUBA_IS_ACCOUNT_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_ACCOUNT_STORE))
#define TUBA_ACCOUNT_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_ACCOUNT_STORE, TubaAccountStoreClass))

typedef struct _TubaAccountStore TubaAccountStore;
typedef struct _TubaAccountStoreClass TubaAccountStoreClass;

#define TUBA_TYPE_ENTITY (tuba_entity_get_type ())
#define TUBA_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_ENTITY, TubaEntity))
#define TUBA_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_ENTITY, TubaEntityClass))
#define TUBA_IS_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_ENTITY))
#define TUBA_IS_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_ENTITY))
#define TUBA_ENTITY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_ENTITY, TubaEntityClass))

typedef struct _TubaEntity TubaEntity;
typedef struct _TubaEntityClass TubaEntityClass;

#define TUBA_API_TYPE_ACCOUNT (tuba_api_account_get_type ())
#define TUBA_API_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_ACCOUNT, TubaAPIAccount))
#define TUBA_API_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_ACCOUNT, TubaAPIAccountClass))
#define TUBA_API_IS_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_ACCOUNT))
#define TUBA_API_IS_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_ACCOUNT))
#define TUBA_API_ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_ACCOUNT, TubaAPIAccountClass))

typedef struct _TubaAPIAccount TubaAPIAccount;
typedef struct _TubaAPIAccountClass TubaAPIAccountClass;

#define TUBA_TYPE_INSTANCE_ACCOUNT (tuba_instance_account_get_type ())
#define TUBA_INSTANCE_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_INSTANCE_ACCOUNT, TubaInstanceAccount))
#define TUBA_INSTANCE_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_INSTANCE_ACCOUNT, TubaInstanceAccountClass))
#define TUBA_IS_INSTANCE_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_INSTANCE_ACCOUNT))
#define TUBA_IS_INSTANCE_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_INSTANCE_ACCOUNT))
#define TUBA_INSTANCE_ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_INSTANCE_ACCOUNT, TubaInstanceAccountClass))

typedef struct _TubaInstanceAccount TubaInstanceAccount;
typedef struct _TubaInstanceAccountClass TubaInstanceAccountClass;
#define _g_free0(var) (var = (g_free (var), NULL))

#define TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_TYPE_EXPIRATION_OBJECT (tuba_dialogs_admin_add_ip_block_expiration_object_get_type ())
#define TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_TYPE_EXPIRATION_OBJECT, TubaDialogsAdminAddIPBlockExpirationObject))
#define TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_TYPE_EXPIRATION_OBJECT, TubaDialogsAdminAddIPBlockExpirationObjectClass))
#define TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_IS_EXPIRATION_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_TYPE_EXPIRATION_OBJECT))
#define TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_IS_EXPIRATION_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_TYPE_EXPIRATION_OBJECT))
#define TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_TYPE_EXPIRATION_OBJECT, TubaDialogsAdminAddIPBlockExpirationObjectClass))

typedef struct _TubaDialogsAdminAddIPBlockExpirationObject TubaDialogsAdminAddIPBlockExpirationObject;
typedef struct _TubaDialogsAdminAddIPBlockExpirationObjectClass TubaDialogsAdminAddIPBlockExpirationObjectClass;

#define TUBA_TYPE_OOPSIE (tuba_oopsie_get_type ())
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _TubaDialogsAdminAddIpBlockOnSaveRealData TubaDialogsAdminAddIpBlockOnSaveRealData;
typedef struct _TubaDialogsAdminAddIPBlockExpirationObjectPrivate TubaDialogsAdminAddIPBlockExpirationObjectPrivate;
enum  {
	TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_OBJECT_0_PROPERTY,
	TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_OBJECT_EXPIRATION_PROPERTY,
	TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_OBJECT_NUM_PROPERTIES
};
static GParamSpec* tuba_dialogs_admin_add_ip_block_expiration_object_properties[TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_OBJECT_NUM_PROPERTIES];
enum  {
	TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_ADDED_SIGNAL,
	TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_NUM_SIGNALS
};
static guint tuba_dialogs_admin_add_ip_block_signals[TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_NUM_SIGNALS] = {0};

struct _TubaDialogsAdminBase {
	AdwDialog parent_instance;
	TubaDialogsAdminBasePrivate * priv;
};

struct _TubaDialogsAdminBaseClass {
	AdwDialogClass parent_class;
};

struct _TubaDialogsAdminAddIPBlock {
	TubaDialogsAdminBase parent_instance;
	TubaDialogsAdminAddIPBlockPrivate * priv;
};

struct _TubaDialogsAdminAddIPBlockClass {
	TubaDialogsAdminBaseClass parent_class;
};

struct _TubaDialogsAdminAddIPBlockPrivate {
	GtkButton* save_button;
	AdwEntryRow* ip_row;
	AdwComboRow* exp_row;
	GListStore* exp_model;
	GtkCheckButton* rule_no_access;
	GtkCheckButton* rule_signup_block;
	GtkCheckButton* rule_signup_approve;
	AdwEntryRow* comment_row;
};

typedef enum  {
	TUBA_OOPSIE_USER,
	TUBA_OOPSIE_PARSING,
	TUBA_OOPSIE_INSTANCE,
	TUBA_OOPSIE_INTERNAL,
	TUBA_OOPSIE_HTTP_401 = 401,
	TUBA_OOPSIE_HTTP_403 = 403,
	TUBA_OOPSIE_HTTP_404 = 404,
	TUBA_OOPSIE_HTTP_410 = 410,
	TUBA_OOPSIE_HTTP_422 = 422,
	TUBA_OOPSIE_HTTP_429 = 429,
	TUBA_OOPSIE_HTTP_500 = 500,
	TUBA_OOPSIE_HTTP_503 = 503
} TubaOopsie;
#define TUBA_OOPSIE tuba_oopsie_quark ()

struct _TubaDialogsAdminAddIpBlockOnSaveRealData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	TubaDialogsAdminAddIPBlock* self;
	TubaAPIAdminIPBlockSeverity sev;
	GtkCheckButton* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	GtkCheckButton* _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	TubaRequestV2* req;
	TubaAccountStore* _tmp6_;
	TubaInstanceAccount* _tmp7_;
	TubaInstanceAccount* _tmp8_;
	TubaInstanceAccount* _tmp9_;
	TubaRequestV2* _tmp10_;
	AdwEntryRow* _tmp11_;
	const gchar* _tmp12_;
	const gchar* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	AdwComboRow* _tmp16_;
	GObject* _tmp17_;
	GObject* _tmp18_;
	TubaDialogsAdminAddIPBlockExpiration _tmp19_;
	TubaDialogsAdminAddIPBlockExpiration _tmp20_;
	gchar* _tmp21_;
	gchar* _tmp22_;
	AdwEntryRow* _tmp23_;
	const gchar* _tmp24_;
	const gchar* _tmp25_;
	GInputStream* _tmp26_;
	GInputStream* _tmp27_;
	GError* e;
	AdwEntryRow* _tmp28_;
	const gchar* _tmp29_;
	const gchar* _tmp30_;
	const gchar* _tmp31_;
	GError* _tmp32_;
	gchar* _tmp33_;
	gchar* _tmp34_;
	GError* _tmp35_;
	const gchar* _tmp36_;
	const gchar* _tmp37_;
	gchar* _tmp38_;
	gchar* _tmp39_;
	GError* _tmp40_;
	const gchar* _tmp41_;
	GError* _inner_error0_;
};

struct _TubaDialogsAdminAddIPBlockExpirationObject {
	GObject parent_instance;
	TubaDialogsAdminAddIPBlockExpirationObjectPrivate * priv;
};

struct _TubaDialogsAdminAddIPBlockExpirationObjectClass {
	GObjectClass parent_class;
};

struct _TubaDialogsAdminAddIPBlockExpirationObjectPrivate {
	TubaDialogsAdminAddIPBlockExpiration _expiration;
};

static gint TubaDialogsAdminAddIPBlock_private_offset;
static gpointer tuba_dialogs_admin_add_ip_block_parent_class = NULL;
VALA_EXTERN TubaAccountStore* tuba_accounts;
static gint TubaDialogsAdminAddIPBlockExpirationObject_private_offset;
static gpointer tuba_dialogs_admin_add_ip_block_expiration_object_parent_class = NULL;

VALA_EXTERN GType tuba_dialogs_admin_base_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaDialogsAdminBase, g_object_unref)
VALA_EXTERN GType tuba_dialogs_admin_add_ip_block_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaDialogsAdminAddIPBlock, g_object_unref)
static GType tuba_dialogs_admin_add_ip_block_expiration_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static gchar* tuba_dialogs_admin_add_ip_block_expiration_to_string (TubaDialogsAdminAddIPBlockExpiration self);
static gint tuba_dialogs_admin_add_ip_block_expiration_to_seconds (TubaDialogsAdminAddIPBlockExpiration self);
static void tuba_dialogs_admin_add_ip_block_on_ip_changed (TubaDialogsAdminAddIPBlock* self);
static void tuba_dialogs_admin_add_ip_block_on_cancel (TubaDialogsAdminAddIPBlock* self);
static void tuba_dialogs_admin_add_ip_block_on_save (TubaDialogsAdminAddIPBlock* self);
static void tuba_dialogs_admin_add_ip_block_on_save_real (TubaDialogsAdminAddIPBlock* self,
                                                   GAsyncReadyCallback _callback_,
                                                   gpointer _user_data_);
static void tuba_dialogs_admin_add_ip_block_on_save_real_finish (TubaDialogsAdminAddIPBlock* self,
                                                          GAsyncResult* _res_);
static void tuba_dialogs_admin_add_ip_block_on_save_real_data_free (gpointer _data);
static gboolean tuba_dialogs_admin_add_ip_block_on_save_real_co (TubaDialogsAdminAddIpBlockOnSaveRealData* _data_);
VALA_EXTERN GType tuba_api_admin_ip_block_severity_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType tuba_request_v2_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaRequestV2, g_object_unref)
VALA_EXTERN GType tuba_request_v2_method_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType tuba_account_store_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAccountStore, g_object_unref)
VALA_EXTERN GType tuba_entity_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaEntity, g_object_unref)
VALA_EXTERN GType tuba_api_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIAccount, g_object_unref)
VALA_EXTERN GType tuba_instance_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaInstanceAccount, g_object_unref)
VALA_EXTERN TubaInstanceAccount* tuba_account_store_get_active (TubaAccountStore* self);
VALA_EXTERN TubaRequestV2* tuba_request_v2_new (const gchar* url,
                                    TubaRequestV2Method method);
VALA_EXTERN TubaRequestV2* tuba_request_v2_construct (GType object_type,
                                          const gchar* url,
                                          TubaRequestV2Method method);
VALA_EXTERN void tuba_request_v2_set_account (TubaRequestV2* self,
                                  TubaInstanceAccount* value);
VALA_EXTERN void tuba_request_v2_add_form_data (TubaRequestV2* self,
                                    const gchar* name,
                                    const gchar* val);
VALA_EXTERN gchar* tuba_api_admin_ip_block_severity_to_api_string (TubaAPIAdminIPBlockSeverity self);
static GType tuba_dialogs_admin_add_ip_block_expiration_object_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaDialogsAdminAddIPBlockExpirationObject, g_object_unref)
static TubaDialogsAdminAddIPBlockExpiration tuba_dialogs_admin_add_ip_block_expiration_object_get_expiration (TubaDialogsAdminAddIPBlockExpirationObject* self);
VALA_EXTERN void tuba_request_v2_exec (TubaRequestV2* self,
                           GAsyncReadyCallback _callback_,
                           gpointer _user_data_);
VALA_EXTERN GQuark tuba_oopsie_quark (void);
VALA_EXTERN GType tuba_oopsie_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GInputStream* tuba_request_v2_exec_finish (TubaRequestV2* self,
                                           GAsyncResult* _res_,
                                           SoupMessageHeaders** response_headers,
                                           GError** error);
static void tuba_dialogs_admin_add_ip_block_on_save_real_ready (GObject* source_object,
                                                         GAsyncResult* _res_,
                                                         gpointer _user_data_);
VALA_EXTERN void tuba_dialogs_admin_base_add_toast (TubaDialogsAdminBase* self,
                                        const gchar* content);
static void tuba_dialogs_admin_add_ip_block_exp_signal (TubaDialogsAdminAddIPBlock* self,
                                                 GObject* item);
VALA_EXTERN TubaDialogsAdminAddIPBlock* tuba_dialogs_admin_add_ip_block_new (void);
VALA_EXTERN TubaDialogsAdminAddIPBlock* tuba_dialogs_admin_add_ip_block_construct (GType object_type);
VALA_EXTERN TubaDialogsAdminBase* tuba_dialogs_admin_base_new (void);
VALA_EXTERN TubaDialogsAdminBase* tuba_dialogs_admin_base_construct (GType object_type);
static TubaDialogsAdminAddIPBlockExpirationObject* tuba_dialogs_admin_add_ip_block_expiration_object_new (TubaDialogsAdminAddIPBlockExpiration exp);
static TubaDialogsAdminAddIPBlockExpirationObject* tuba_dialogs_admin_add_ip_block_expiration_object_construct (GType object_type,
                                                                                                         TubaDialogsAdminAddIPBlockExpiration exp);
static void tuba_dialogs_admin_add_ip_block_expiration_object_set_expiration (TubaDialogsAdminAddIPBlockExpirationObject* self,
                                                                       TubaDialogsAdminAddIPBlockExpiration value);
static void tuba_dialogs_admin_add_ip_block_expiration_object_finalize (GObject * obj);
static GType tuba_dialogs_admin_add_ip_block_expiration_object_get_type_once (void);
static void _vala_tuba_dialogs_admin_add_ip_block_expiration_object_get_property (GObject * object,
                                                                           guint property_id,
                                                                           GValue * value,
                                                                           GParamSpec * pspec);
static void _vala_tuba_dialogs_admin_add_ip_block_expiration_object_set_property (GObject * object,
                                                                           guint property_id,
                                                                           const GValue * value,
                                                                           GParamSpec * pspec);
static GObject * tuba_dialogs_admin_add_ip_block_constructor (GType type,
                                                       guint n_construct_properties,
                                                       GObjectConstructParam * construct_properties);
VALA_EXTERN AdwHeaderBar* tuba_dialogs_admin_base_get_headerbar (TubaDialogsAdminBase* self);
static void _tuba_dialogs_admin_add_ip_block_on_cancel_gtk_button_clicked (GtkButton* _sender,
                                                                    gpointer self);
static void _tuba_dialogs_admin_add_ip_block_on_save_gtk_button_clicked (GtkButton* _sender,
                                                                  gpointer self);
static void _tuba_dialogs_admin_add_ip_block_on_ip_changed_gtk_editable_changed (GtkEditable* _sender,
                                                                          gpointer self);
static void _tuba_dialogs_admin_add_ip_block_exp_signal_gtk_signal_list_item_factory_bind (GtkSignalListItemFactory* _sender,
                                                                                    GObject* object,
                                                                                    gpointer self);
VALA_EXTERN gchar* tuba_api_admin_ip_block_severity_to_title (TubaAPIAdminIPBlockSeverity self);
VALA_EXTERN gchar* tuba_api_admin_ip_block_severity_to_descritpion (TubaAPIAdminIPBlockSeverity self);
VALA_EXTERN AdwPreferencesPage* tuba_dialogs_admin_base_get_page (TubaDialogsAdminBase* self);
static void tuba_dialogs_admin_add_ip_block_finalize (GObject * obj);
static GType tuba_dialogs_admin_add_ip_block_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

static inline gpointer
tuba_dialogs_admin_add_ip_block_get_instance_private (TubaDialogsAdminAddIPBlock* self)
{
	return G_STRUCT_MEMBER_P (self, TubaDialogsAdminAddIPBlock_private_offset);
}

static gchar*
tuba_dialogs_admin_add_ip_block_expiration_to_string (TubaDialogsAdminAddIPBlockExpiration self)
{
	gchar* result;
	switch (self) {
		case TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_YEAR_3:
		{
			gchar* _tmp0_;
			_tmp0_ = g_strdup_printf (ngettext ("%d Year", "%d Years", (gulong) 3), 3);
			result = _tmp0_;
			return result;
		}
		case TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_YEAR_1:
		{
			gchar* _tmp1_;
			_tmp1_ = g_strdup_printf (ngettext ("%d Year", "%d Years", (gulong) 1), 1);
			result = _tmp1_;
			return result;
		}
		case TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_MONTH_6:
		{
			gchar* _tmp2_;
			_tmp2_ = g_strdup_printf (ngettext ("%d Month", "%d Months", (gulong) 6), 6);
			result = _tmp2_;
			return result;
		}
		case TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_MONTH_1:
		{
			gchar* _tmp3_;
			_tmp3_ = g_strdup_printf (ngettext ("%d Month", "%d Months", (gulong) 1), 1);
			result = _tmp3_;
			return result;
		}
		case TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_WEEK_2:
		{
			gchar* _tmp4_;
			_tmp4_ = g_strdup_printf (ngettext ("%d Week", "%d Weeks", (gulong) 2), 2);
			result = _tmp4_;
			return result;
		}
		default:
		{
			gchar* _tmp5_;
			_tmp5_ = g_strdup_printf (ngettext ("%d Day", "%d Days", (gulong) 1), 1);
			result = _tmp5_;
			return result;
		}
	}
}

static gint
tuba_dialogs_admin_add_ip_block_expiration_to_seconds (TubaDialogsAdminAddIPBlockExpiration self)
{
	gint result;
	switch (self) {
		case TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_YEAR_3:
		{
			result = 94608000;
			return result;
		}
		case TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_YEAR_1:
		{
			result = 31536000;
			return result;
		}
		case TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_MONTH_6:
		{
			result = 15780000;
			return result;
		}
		case TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_MONTH_1:
		{
			result = 2630000;
			return result;
		}
		case TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_WEEK_2:
		{
			result = 1209600;
			return result;
		}
		default:
		{
			result = 86400;
			return result;
		}
	}
}

 G_GNUC_NO_INLINE static GType
tuba_dialogs_admin_add_ip_block_expiration_get_type_once (void)
{
	static const GEnumValue values[] = {{TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_DAY_1, "TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_DAY_1", "day-1"}, {TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_WEEK_2, "TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_WEEK_2", "week-2"}, {TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_MONTH_1, "TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_MONTH_1", "month-1"}, {TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_MONTH_6, "TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_MONTH_6", "month-6"}, {TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_YEAR_1, "TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_YEAR_1", "year-1"}, {TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_YEAR_3, "TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_YEAR_3", "year-3"}, {0, NULL, NULL}};
	GType tuba_dialogs_admin_add_ip_block_expiration_type_id;
	tuba_dialogs_admin_add_ip_block_expiration_type_id = g_enum_register_static ("TubaDialogsAdminAddIPBlockExpiration", values);
	return tuba_dialogs_admin_add_ip_block_expiration_type_id;
}

static GType
tuba_dialogs_admin_add_ip_block_expiration_get_type (void)
{
	static GType tuba_dialogs_admin_add_ip_block_expiration_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_dialogs_admin_add_ip_block_expiration_type_id__once)) {
		GType tuba_dialogs_admin_add_ip_block_expiration_type_id;
		tuba_dialogs_admin_add_ip_block_expiration_type_id = tuba_dialogs_admin_add_ip_block_expiration_get_type_once ();
		g_once_init_leave_pointer (&tuba_dialogs_admin_add_ip_block_expiration_type_id__once, tuba_dialogs_admin_add_ip_block_expiration_type_id);
	}
	return tuba_dialogs_admin_add_ip_block_expiration_type_id__once;
}

static void
tuba_dialogs_admin_add_ip_block_on_ip_changed (TubaDialogsAdminAddIPBlock* self)
{
	AdwEntryRow* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->ip_row;
	_tmp1_ = gtk_editable_get_text ((GtkEditable*) _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = strlen (_tmp2_);
	_tmp4_ = _tmp3_;
	if (_tmp4_ > 0) {
		AdwEntryRow* _tmp5_;
		GtkButton* _tmp6_;
		_tmp5_ = self->priv->ip_row;
		gtk_widget_remove_css_class ((GtkWidget*) _tmp5_, "error");
		_tmp6_ = self->priv->save_button;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp6_, TRUE);
	} else {
		AdwEntryRow* _tmp7_;
		GtkButton* _tmp8_;
		_tmp7_ = self->priv->ip_row;
		gtk_widget_add_css_class ((GtkWidget*) _tmp7_, "error");
		_tmp8_ = self->priv->save_button;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp8_, FALSE);
	}
}

static void
tuba_dialogs_admin_add_ip_block_on_cancel (TubaDialogsAdminAddIPBlock* self)
{
	g_return_if_fail (self != NULL);
	adw_dialog_force_close ((AdwDialog*) self);
}

static void
tuba_dialogs_admin_add_ip_block_on_save (TubaDialogsAdminAddIPBlock* self)
{
	GtkButton* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->save_button;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp0_, FALSE);
	tuba_dialogs_admin_add_ip_block_on_save_real (self, NULL, NULL);
}

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

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

static void
tuba_dialogs_admin_add_ip_block_on_save_real (TubaDialogsAdminAddIPBlock* self,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_)
{
	TubaDialogsAdminAddIpBlockOnSaveRealData* _data_;
	TubaDialogsAdminAddIPBlock* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (TubaDialogsAdminAddIpBlockOnSaveRealData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, tuba_dialogs_admin_add_ip_block_on_save_real_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	tuba_dialogs_admin_add_ip_block_on_save_real_co (_data_);
}

static void
tuba_dialogs_admin_add_ip_block_on_save_real_finish (TubaDialogsAdminAddIPBlock* self,
                                                     GAsyncResult* _res_)
{
	TubaDialogsAdminAddIpBlockOnSaveRealData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
tuba_dialogs_admin_add_ip_block_on_save_real_ready (GObject* source_object,
                                                    GAsyncResult* _res_,
                                                    gpointer _user_data_)
{
	TubaDialogsAdminAddIpBlockOnSaveRealData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	tuba_dialogs_admin_add_ip_block_on_save_real_co (_data_);
}

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 gboolean
tuba_dialogs_admin_add_ip_block_on_save_real_co (TubaDialogsAdminAddIpBlockOnSaveRealData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->sev = TUBA_API_ADMIN_IP_BLOCK_SEVERITY_NO_ACCESS;
	_data_->_tmp0_ = _data_->self->priv->rule_signup_approve;
	_data_->_tmp1_ = gtk_check_button_get_active (_data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	if (_data_->_tmp2_) {
		_data_->sev = TUBA_API_ADMIN_IP_BLOCK_SEVERITY_SIGN_UP_REQUIRES_APPROVAL;
	} else {
		_data_->_tmp3_ = _data_->self->priv->rule_signup_block;
		_data_->_tmp4_ = gtk_check_button_get_active (_data_->_tmp3_);
		_data_->_tmp5_ = _data_->_tmp4_;
		if (_data_->_tmp5_) {
			_data_->sev = TUBA_API_ADMIN_IP_BLOCK_SEVERITY_SIGN_UP_BLOCK;
		}
	}
	_data_->_tmp6_ = tuba_accounts;
	_data_->_tmp7_ = tuba_account_store_get_active (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = _g_object_ref0 (_data_->_tmp8_);
	_data_->_tmp10_ = NULL;
	_data_->_tmp10_ = tuba_request_v2_new ("/api/v1/admin/ip_blocks", TUBA_REQUEST_V2_METHOD_POST);
	tuba_request_v2_set_account (_data_->_tmp10_, _data_->_tmp9_);
	_g_object_unref0 (_data_->_tmp9_);
	_data_->req = _data_->_tmp10_;
	_data_->_tmp11_ = _data_->self->priv->ip_row;
	_data_->_tmp12_ = gtk_editable_get_text ((GtkEditable*) _data_->_tmp11_);
	_data_->_tmp13_ = _data_->_tmp12_;
	tuba_request_v2_add_form_data (_data_->req, "ip", _data_->_tmp13_);
	_data_->_tmp14_ = tuba_api_admin_ip_block_severity_to_api_string (_data_->sev);
	_data_->_tmp15_ = _data_->_tmp14_;
	tuba_request_v2_add_form_data (_data_->req, "severity", _data_->_tmp15_);
	_g_free0 (_data_->_tmp15_);
	_data_->_tmp16_ = _data_->self->priv->exp_row;
	_data_->_tmp17_ = adw_combo_row_get_selected_item (_data_->_tmp16_);
	_data_->_tmp18_ = _data_->_tmp17_;
	_data_->_tmp19_ = tuba_dialogs_admin_add_ip_block_expiration_object_get_expiration (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp18_, TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_TYPE_EXPIRATION_OBJECT, TubaDialogsAdminAddIPBlockExpirationObject));
	_data_->_tmp20_ = _data_->_tmp19_;
	_data_->_tmp21_ = g_strdup_printf ("%i", tuba_dialogs_admin_add_ip_block_expiration_to_seconds (_data_->_tmp20_));
	_data_->_tmp22_ = _data_->_tmp21_;
	tuba_request_v2_add_form_data (_data_->req, "expires_in", _data_->_tmp22_);
	_g_free0 (_data_->_tmp22_);
	_data_->_tmp23_ = _data_->self->priv->comment_row;
	_data_->_tmp24_ = gtk_editable_get_text ((GtkEditable*) _data_->_tmp23_);
	_data_->_tmp25_ = _data_->_tmp24_;
	tuba_request_v2_add_form_data (_data_->req, "comment", _data_->_tmp25_);
	{
		_data_->_state_ = 1;
		tuba_request_v2_exec (_data_->req, tuba_dialogs_admin_add_ip_block_on_save_real_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp26_ = tuba_request_v2_exec_finish (_data_->req, _data_->_res_, NULL, &_data_->_inner_error0_);
		_data_->_tmp27_ = _data_->_tmp26_;
		_g_object_unref0 (_data_->_tmp27_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		tuba_dialogs_admin_add_ip_block_on_ip_changed (_data_->self);
		g_signal_emit (_data_->self, tuba_dialogs_admin_add_ip_block_signals[TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_ADDED_SIGNAL], 0);
		tuba_dialogs_admin_add_ip_block_on_cancel (_data_->self);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp28_ = _data_->self->priv->ip_row;
		_data_->_tmp29_ = gtk_editable_get_text ((GtkEditable*) _data_->_tmp28_);
		_data_->_tmp30_ = _data_->_tmp29_;
		_data_->_tmp31_ = string_to_string (_data_->_tmp30_);
		_data_->_tmp32_ = _data_->e;
		_data_->_tmp33_ = g_strdup_printf ("%i", _data_->_tmp32_->code);
		_data_->_tmp34_ = _data_->_tmp33_;
		_data_->_tmp35_ = _data_->e;
		_data_->_tmp36_ = _data_->_tmp35_->message;
		_data_->_tmp37_ = string_to_string (_data_->_tmp36_);
		_data_->_tmp38_ = g_strconcat ("Couldn't create IP block ", _data_->_tmp31_, ": ", _data_->_tmp34_, " ", _data_->_tmp37_, NULL);
		_data_->_tmp39_ = _data_->_tmp38_;
		g_warning ("AddIPBlock.vala:218: %s", _data_->_tmp39_);
		_g_free0 (_data_->_tmp39_);
		_g_free0 (_data_->_tmp34_);
		_data_->_tmp40_ = _data_->e;
		_data_->_tmp41_ = _data_->_tmp40_->message;
		tuba_dialogs_admin_base_add_toast ((TubaDialogsAdminBase*) _data_->self, _data_->_tmp41_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_object_unref0 (_data_->req);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_g_object_unref0 (_data_->req);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
tuba_dialogs_admin_add_ip_block_exp_signal (TubaDialogsAdminAddIPBlock* self,
                                            GObject* item)
{
	GObject* _tmp0_;
	GObject* _tmp1_;
	TubaDialogsAdminAddIPBlockExpiration _tmp2_;
	TubaDialogsAdminAddIPBlockExpiration _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	GtkLabel* _tmp6_;
	GtkLabel* _tmp7_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (item != NULL);
	_tmp0_ = gtk_list_item_get_item (G_TYPE_CHECK_INSTANCE_CAST (item, gtk_list_item_get_type (), GtkListItem));
	_tmp1_ = _tmp0_;
	_tmp2_ = tuba_dialogs_admin_add_ip_block_expiration_object_get_expiration (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_TYPE_EXPIRATION_OBJECT, TubaDialogsAdminAddIPBlockExpirationObject));
	_tmp3_ = _tmp2_;
	_tmp4_ = tuba_dialogs_admin_add_ip_block_expiration_to_string (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = (GtkLabel*) gtk_label_new (_tmp5_);
	g_object_ref_sink (_tmp6_);
	_tmp7_ = _tmp6_;
	gtk_list_item_set_child (G_TYPE_CHECK_INSTANCE_CAST (item, gtk_list_item_get_type (), GtkListItem), (GtkWidget*) _tmp7_);
	_g_object_unref0 (_tmp7_);
	_g_free0 (_tmp5_);
}

TubaDialogsAdminAddIPBlock*
tuba_dialogs_admin_add_ip_block_construct (GType object_type)
{
	TubaDialogsAdminAddIPBlock * self = NULL;
	self = (TubaDialogsAdminAddIPBlock*) tuba_dialogs_admin_base_construct (object_type);
	return self;
}

TubaDialogsAdminAddIPBlock*
tuba_dialogs_admin_add_ip_block_new (void)
{
	return tuba_dialogs_admin_add_ip_block_construct (TUBA_DIALOGS_ADMIN_TYPE_ADD_IP_BLOCK);
}

static inline gpointer
tuba_dialogs_admin_add_ip_block_expiration_object_get_instance_private (TubaDialogsAdminAddIPBlockExpirationObject* self)
{
	return G_STRUCT_MEMBER_P (self, TubaDialogsAdminAddIPBlockExpirationObject_private_offset);
}

static TubaDialogsAdminAddIPBlockExpirationObject*
tuba_dialogs_admin_add_ip_block_expiration_object_construct (GType object_type,
                                                             TubaDialogsAdminAddIPBlockExpiration exp)
{
	TubaDialogsAdminAddIPBlockExpirationObject * self = NULL;
	self = (TubaDialogsAdminAddIPBlockExpirationObject*) g_object_new (object_type, NULL);
	tuba_dialogs_admin_add_ip_block_expiration_object_set_expiration (self, exp);
	return self;
}

static TubaDialogsAdminAddIPBlockExpirationObject*
tuba_dialogs_admin_add_ip_block_expiration_object_new (TubaDialogsAdminAddIPBlockExpiration exp)
{
	return tuba_dialogs_admin_add_ip_block_expiration_object_construct (TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_TYPE_EXPIRATION_OBJECT, exp);
}

static TubaDialogsAdminAddIPBlockExpiration
tuba_dialogs_admin_add_ip_block_expiration_object_get_expiration (TubaDialogsAdminAddIPBlockExpirationObject* self)
{
	TubaDialogsAdminAddIPBlockExpiration result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_expiration;
	return result;
}

static void
tuba_dialogs_admin_add_ip_block_expiration_object_set_expiration (TubaDialogsAdminAddIPBlockExpirationObject* self,
                                                                  TubaDialogsAdminAddIPBlockExpiration value)
{
	TubaDialogsAdminAddIPBlockExpiration old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_dialogs_admin_add_ip_block_expiration_object_get_expiration (self);
	if (old_value != value) {
		self->priv->_expiration = value;
		g_object_notify_by_pspec ((GObject *) self, tuba_dialogs_admin_add_ip_block_expiration_object_properties[TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_OBJECT_EXPIRATION_PROPERTY]);
	}
}

static void
tuba_dialogs_admin_add_ip_block_expiration_object_class_init (TubaDialogsAdminAddIPBlockExpirationObjectClass * klass,
                                                              gpointer klass_data)
{
	tuba_dialogs_admin_add_ip_block_expiration_object_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaDialogsAdminAddIPBlockExpirationObject_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_tuba_dialogs_admin_add_ip_block_expiration_object_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tuba_dialogs_admin_add_ip_block_expiration_object_set_property;
	G_OBJECT_CLASS (klass)->finalize = tuba_dialogs_admin_add_ip_block_expiration_object_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_OBJECT_EXPIRATION_PROPERTY, tuba_dialogs_admin_add_ip_block_expiration_object_properties[TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_OBJECT_EXPIRATION_PROPERTY] = g_param_spec_enum ("expiration", "expiration", "expiration", TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_TYPE_EXPIRATION, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
tuba_dialogs_admin_add_ip_block_expiration_object_instance_init (TubaDialogsAdminAddIPBlockExpirationObject * self,
                                                                 gpointer klass)
{
	self->priv = tuba_dialogs_admin_add_ip_block_expiration_object_get_instance_private (self);
}

static void
tuba_dialogs_admin_add_ip_block_expiration_object_finalize (GObject * obj)
{
	TubaDialogsAdminAddIPBlockExpirationObject * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_TYPE_EXPIRATION_OBJECT, TubaDialogsAdminAddIPBlockExpirationObject);
	G_OBJECT_CLASS (tuba_dialogs_admin_add_ip_block_expiration_object_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_dialogs_admin_add_ip_block_expiration_object_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaDialogsAdminAddIPBlockExpirationObjectClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_dialogs_admin_add_ip_block_expiration_object_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaDialogsAdminAddIPBlockExpirationObject), 0, (GInstanceInitFunc) tuba_dialogs_admin_add_ip_block_expiration_object_instance_init, NULL };
	GType tuba_dialogs_admin_add_ip_block_expiration_object_type_id;
	tuba_dialogs_admin_add_ip_block_expiration_object_type_id = g_type_register_static (G_TYPE_OBJECT, "TubaDialogsAdminAddIPBlockExpirationObject", &g_define_type_info, G_TYPE_FLAG_NONE);
	TubaDialogsAdminAddIPBlockExpirationObject_private_offset = g_type_add_instance_private (tuba_dialogs_admin_add_ip_block_expiration_object_type_id, sizeof (TubaDialogsAdminAddIPBlockExpirationObjectPrivate));
	return tuba_dialogs_admin_add_ip_block_expiration_object_type_id;
}

static GType
tuba_dialogs_admin_add_ip_block_expiration_object_get_type (void)
{
	static GType tuba_dialogs_admin_add_ip_block_expiration_object_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_dialogs_admin_add_ip_block_expiration_object_type_id__once)) {
		GType tuba_dialogs_admin_add_ip_block_expiration_object_type_id;
		tuba_dialogs_admin_add_ip_block_expiration_object_type_id = tuba_dialogs_admin_add_ip_block_expiration_object_get_type_once ();
		g_once_init_leave_pointer (&tuba_dialogs_admin_add_ip_block_expiration_object_type_id__once, tuba_dialogs_admin_add_ip_block_expiration_object_type_id);
	}
	return tuba_dialogs_admin_add_ip_block_expiration_object_type_id__once;
}

static void
_vala_tuba_dialogs_admin_add_ip_block_expiration_object_get_property (GObject * object,
                                                                      guint property_id,
                                                                      GValue * value,
                                                                      GParamSpec * pspec)
{
	TubaDialogsAdminAddIPBlockExpirationObject * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_TYPE_EXPIRATION_OBJECT, TubaDialogsAdminAddIPBlockExpirationObject);
	switch (property_id) {
		case TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_OBJECT_EXPIRATION_PROPERTY:
		g_value_set_enum (value, tuba_dialogs_admin_add_ip_block_expiration_object_get_expiration (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tuba_dialogs_admin_add_ip_block_expiration_object_set_property (GObject * object,
                                                                      guint property_id,
                                                                      const GValue * value,
                                                                      GParamSpec * pspec)
{
	TubaDialogsAdminAddIPBlockExpirationObject * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_TYPE_EXPIRATION_OBJECT, TubaDialogsAdminAddIPBlockExpirationObject);
	switch (property_id) {
		case TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_OBJECT_EXPIRATION_PROPERTY:
		tuba_dialogs_admin_add_ip_block_expiration_object_set_expiration (self, g_value_get_enum (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_tuba_dialogs_admin_add_ip_block_on_cancel_gtk_button_clicked (GtkButton* _sender,
                                                               gpointer self)
{
	tuba_dialogs_admin_add_ip_block_on_cancel ((TubaDialogsAdminAddIPBlock*) self);
}

static void
_tuba_dialogs_admin_add_ip_block_on_save_gtk_button_clicked (GtkButton* _sender,
                                                             gpointer self)
{
	tuba_dialogs_admin_add_ip_block_on_save ((TubaDialogsAdminAddIPBlock*) self);
}

static void
_tuba_dialogs_admin_add_ip_block_on_ip_changed_gtk_editable_changed (GtkEditable* _sender,
                                                                     gpointer self)
{
	tuba_dialogs_admin_add_ip_block_on_ip_changed ((TubaDialogsAdminAddIPBlock*) self);
}

static void
_tuba_dialogs_admin_add_ip_block_exp_signal_gtk_signal_list_item_factory_bind (GtkSignalListItemFactory* _sender,
                                                                               GObject* object,
                                                                               gpointer self)
{
	tuba_dialogs_admin_add_ip_block_exp_signal ((TubaDialogsAdminAddIPBlock*) self, object);
}

static GObject *
tuba_dialogs_admin_add_ip_block_constructor (GType type,
                                             guint n_construct_properties,
                                             GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	TubaDialogsAdminAddIPBlock * self;
	AdwHeaderBar* _tmp0_;
	AdwHeaderBar* _tmp1_;
	AdwHeaderBar* _tmp2_;
	AdwHeaderBar* _tmp3_;
	GtkButton* cancel_button = NULL;
	GtkButton* _tmp4_;
	GtkButton* _tmp5_;
	gchar* _tmp6_;
	gchar** _tmp7_;
	GtkButton* _tmp8_ = NULL;
	GtkButton* _tmp9_;
	AdwHeaderBar* _tmp10_;
	AdwHeaderBar* _tmp11_;
	GtkButton* _tmp12_;
	AdwHeaderBar* _tmp13_;
	AdwHeaderBar* _tmp14_;
	GtkButton* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	gchar** _tmp18_;
	AdwEntryRow* _tmp19_ = NULL;
	AdwEntryRow* _tmp20_;
	gchar* _tmp21_;
	AdwEntryRow* _tmp22_ = NULL;
	AdwPreferencesGroup* ip_group = NULL;
	AdwPreferencesGroup* _tmp23_;
	AdwPreferencesGroup* _tmp24_;
	AdwEntryRow* _tmp25_;
	AdwPreferencesGroup* _tmp26_;
	AdwEntryRow* _tmp27_;
	GtkSignalListItemFactory* signallistitemfactory = NULL;
	GtkSignalListItemFactory* _tmp28_;
	GtkSignalListItemFactory* _tmp29_;
	GListStore* _tmp30_;
	GListStore* _tmp31_;
	TubaDialogsAdminAddIPBlockExpirationObject* _tmp32_;
	TubaDialogsAdminAddIPBlockExpirationObject* _tmp33_;
	TubaDialogsAdminAddIPBlockExpirationObject* _tmp34_;
	TubaDialogsAdminAddIPBlockExpirationObject* _tmp35_;
	TubaDialogsAdminAddIPBlockExpirationObject* _tmp36_;
	TubaDialogsAdminAddIPBlockExpirationObject* _tmp37_;
	GObject** _tmp38_;
	GObject** _tmp39_;
	gint _tmp39__length1;
	gchar* _tmp40_;
	GListStore* _tmp41_;
	GListModel* _tmp42_;
	GtkSignalListItemFactory* _tmp43_;
	GtkListItemFactory* _tmp44_;
	AdwComboRow* _tmp45_ = NULL;
	AdwPreferencesGroup* _tmp46_;
	AdwComboRow* _tmp47_;
	AdwPreferencesGroup* rule_group = NULL;
	gchar* _tmp48_;
	gchar* _tmp49_;
	AdwPreferencesGroup* _tmp50_ = NULL;
	gchar* _tmp51_;
	gchar** _tmp52_;
	GtkCheckButton* _tmp53_ = NULL;
	GtkCheckButton* _tmp54_;
	GtkCheckButton* _tmp55_;
	gchar* _tmp56_;
	gchar** _tmp57_;
	GtkCheckButton* _tmp58_ = NULL;
	GtkCheckButton* _tmp59_;
	GtkCheckButton* _tmp60_;
	gchar* _tmp61_;
	gchar** _tmp62_;
	GtkCheckButton* _tmp63_ = NULL;
	AdwActionRow* action_row = NULL;
	gchar* _tmp64_;
	gchar* _tmp65_;
	GtkCheckButton* _tmp66_;
	GtkWidget* _tmp67_;
	AdwActionRow* _tmp68_ = NULL;
	AdwActionRow* _tmp69_;
	GtkCheckButton* _tmp70_;
	AdwPreferencesGroup* _tmp71_;
	AdwActionRow* _tmp72_;
	gchar* _tmp73_;
	gchar* _tmp74_;
	GtkCheckButton* _tmp75_;
	GtkWidget* _tmp76_;
	AdwActionRow* _tmp77_ = NULL;
	AdwActionRow* _tmp78_;
	GtkCheckButton* _tmp79_;
	AdwPreferencesGroup* _tmp80_;
	AdwActionRow* _tmp81_;
	gchar* _tmp82_;
	gchar* _tmp83_;
	GtkCheckButton* _tmp84_;
	GtkWidget* _tmp85_;
	AdwActionRow* _tmp86_ = NULL;
	AdwActionRow* _tmp87_;
	GtkCheckButton* _tmp88_;
	AdwPreferencesGroup* _tmp89_;
	AdwActionRow* _tmp90_;
	AdwPreferencesPage* _tmp91_;
	AdwPreferencesPage* _tmp92_;
	AdwPreferencesGroup* _tmp93_;
	AdwPreferencesPage* _tmp94_;
	AdwPreferencesPage* _tmp95_;
	AdwPreferencesGroup* _tmp96_;
	parent_class = G_OBJECT_CLASS (tuba_dialogs_admin_add_ip_block_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_DIALOGS_ADMIN_TYPE_ADD_IP_BLOCK, TubaDialogsAdminAddIPBlock);
	adw_dialog_set_title ((AdwDialog*) self, _ ("Add IP Block"));
	adw_dialog_set_content_width ((AdwDialog*) self, 460);
	adw_dialog_set_content_height ((AdwDialog*) self, 502);
	adw_dialog_set_can_close ((AdwDialog*) self, FALSE);
	_tmp0_ = tuba_dialogs_admin_base_get_headerbar ((TubaDialogsAdminBase*) self);
	_tmp1_ = _tmp0_;
	adw_header_bar_set_show_end_title_buttons (_tmp1_, FALSE);
	_tmp2_ = tuba_dialogs_admin_base_get_headerbar ((TubaDialogsAdminBase*) self);
	_tmp3_ = _tmp2_;
	adw_header_bar_set_show_start_title_buttons (_tmp3_, FALSE);
	_tmp4_ = (GtkButton*) gtk_button_new_with_label (_ ("Cancel"));
	g_object_ref_sink (_tmp4_);
	cancel_button = _tmp4_;
	_tmp5_ = cancel_button;
	g_signal_connect_object (_tmp5_, "clicked", (GCallback) _tuba_dialogs_admin_add_ip_block_on_cancel_gtk_button_clicked, self, 0);
	_tmp6_ = g_strdup ("suggested-action");
	_tmp7_ = g_new0 (gchar*, 1 + 1);
	_tmp7_[0] = _tmp6_;
	_tmp8_ = (GtkButton*) gtk_button_new_with_label (_ ("Add"));
	gtk_widget_set_css_classes ((GtkWidget*) _tmp8_, _tmp7_);
	_tmp7_ = (_vala_array_free (_tmp7_, 1, (GDestroyNotify) g_free), NULL);
	gtk_widget_set_sensitive ((GtkWidget*) _tmp8_, FALSE);
	g_object_ref_sink (_tmp8_);
	_g_object_unref0 (self->priv->save_button);
	self->priv->save_button = _tmp8_;
	_tmp9_ = self->priv->save_button;
	g_signal_connect_object (_tmp9_, "clicked", (GCallback) _tuba_dialogs_admin_add_ip_block_on_save_gtk_button_clicked, self, 0);
	_tmp10_ = tuba_dialogs_admin_base_get_headerbar ((TubaDialogsAdminBase*) self);
	_tmp11_ = _tmp10_;
	_tmp12_ = cancel_button;
	adw_header_bar_pack_start (_tmp11_, (GtkWidget*) _tmp12_);
	_tmp13_ = tuba_dialogs_admin_base_get_headerbar ((TubaDialogsAdminBase*) self);
	_tmp14_ = _tmp13_;
	_tmp15_ = self->priv->save_button;
	adw_header_bar_pack_end (_tmp14_, (GtkWidget*) _tmp15_);
	_tmp16_ = g_strdup ("192.0.2.0/24");
	_tmp17_ = g_strdup ("error");
	_tmp18_ = g_new0 (gchar*, 1 + 1);
	_tmp18_[0] = _tmp17_;
	_tmp19_ = (AdwEntryRow*) adw_entry_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp19_, _tmp16_);
	_g_free0 (_tmp16_);
	adw_entry_row_set_input_hints (_tmp19_, GTK_INPUT_HINT_NO_EMOJI | GTK_INPUT_HINT_NO_SPELLCHECK);
	adw_entry_row_set_show_apply_button (_tmp19_, FALSE);
	adw_entry_row_set_input_purpose (_tmp19_, GTK_INPUT_PURPOSE_FREE_FORM);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp19_, _tmp18_);
	_tmp18_ = (_vala_array_free (_tmp18_, 1, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp19_);
	_g_object_unref0 (self->priv->ip_row);
	self->priv->ip_row = _tmp19_;
	_tmp20_ = self->priv->ip_row;
	g_signal_connect_object ((GtkEditable*) _tmp20_, "changed", (GCallback) _tuba_dialogs_admin_add_ip_block_on_ip_changed_gtk_editable_changed, self, 0);
	_tmp21_ = g_strdup (_ ("Comment"));
	_tmp22_ = (AdwEntryRow*) adw_entry_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp22_, _tmp21_);
	_g_free0 (_tmp21_);
	adw_entry_row_set_input_purpose (_tmp22_, GTK_INPUT_PURPOSE_FREE_FORM);
	adw_entry_row_set_show_apply_button (_tmp22_, FALSE);
	g_object_ref_sink (_tmp22_);
	_g_object_unref0 (self->priv->comment_row);
	self->priv->comment_row = _tmp22_;
	_tmp23_ = (AdwPreferencesGroup*) adw_preferences_group_new ();
	g_object_ref_sink (_tmp23_);
	ip_group = _tmp23_;
	_tmp24_ = ip_group;
	_tmp25_ = self->priv->ip_row;
	adw_preferences_group_add (_tmp24_, (GtkWidget*) _tmp25_);
	_tmp26_ = ip_group;
	_tmp27_ = self->priv->comment_row;
	adw_preferences_group_add (_tmp26_, (GtkWidget*) _tmp27_);
	_tmp28_ = (GtkSignalListItemFactory*) gtk_signal_list_item_factory_new ();
	signallistitemfactory = _tmp28_;
	_tmp29_ = signallistitemfactory;
	g_signal_connect_object (_tmp29_, "bind", (GCallback) _tuba_dialogs_admin_add_ip_block_exp_signal_gtk_signal_list_item_factory_bind, self, 0);
	_tmp30_ = g_list_store_new (TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_TYPE_EXPIRATION_OBJECT);
	_g_object_unref0 (self->priv->exp_model);
	self->priv->exp_model = _tmp30_;
	_tmp31_ = self->priv->exp_model;
	_tmp32_ = tuba_dialogs_admin_add_ip_block_expiration_object_new (TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_DAY_1);
	_tmp33_ = tuba_dialogs_admin_add_ip_block_expiration_object_new (TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_WEEK_2);
	_tmp34_ = tuba_dialogs_admin_add_ip_block_expiration_object_new (TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_MONTH_1);
	_tmp35_ = tuba_dialogs_admin_add_ip_block_expiration_object_new (TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_MONTH_6);
	_tmp36_ = tuba_dialogs_admin_add_ip_block_expiration_object_new (TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_YEAR_1);
	_tmp37_ = tuba_dialogs_admin_add_ip_block_expiration_object_new (TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_EXPIRATION_YEAR_3);
	_tmp38_ = g_new0 (GObject*, 6 + 1);
	_tmp38_[0] = (GObject*) _tmp32_;
	_tmp38_[1] = (GObject*) _tmp33_;
	_tmp38_[2] = (GObject*) _tmp34_;
	_tmp38_[3] = (GObject*) _tmp35_;
	_tmp38_[4] = (GObject*) _tmp36_;
	_tmp38_[5] = (GObject*) _tmp37_;
	_tmp39_ = _tmp38_;
	_tmp39__length1 = 6;
	g_list_store_splice (_tmp31_, (guint) 0, (guint) 0, _tmp39_, (guint) 6);
	_tmp39_ = (_vala_array_free (_tmp39_, _tmp39__length1, (GDestroyNotify) g_object_unref), NULL);
	_tmp40_ = g_strdup (_ ("Expiration"));
	_tmp41_ = self->priv->exp_model;
	_tmp42_ = _g_object_ref0 ((GListModel*) _tmp41_);
	_tmp43_ = signallistitemfactory;
	_tmp44_ = _g_object_ref0 ((GtkListItemFactory*) _tmp43_);
	_tmp45_ = (AdwComboRow*) adw_combo_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp45_, _tmp40_);
	_g_free0 (_tmp40_);
	adw_combo_row_set_model (_tmp45_, _tmp42_);
	_g_object_unref0 (_tmp42_);
	adw_combo_row_set_factory (_tmp45_, _tmp44_);
	_g_object_unref0 (_tmp44_);
	g_object_ref_sink (_tmp45_);
	_g_object_unref0 (self->priv->exp_row);
	self->priv->exp_row = _tmp45_;
	_tmp46_ = ip_group;
	_tmp47_ = self->priv->exp_row;
	adw_preferences_group_add (_tmp46_, (GtkWidget*) _tmp47_);
	_tmp48_ = g_strdup (_ ("Rule"));
	_tmp49_ = g_strdup (_ ("Choose what will happen with requests from this IP"));
	_tmp50_ = (AdwPreferencesGroup*) adw_preferences_group_new ();
	adw_preferences_group_set_title (_tmp50_, _tmp48_);
	_g_free0 (_tmp48_);
	adw_preferences_group_set_description (_tmp50_, _tmp49_);
	_g_free0 (_tmp49_);
	g_object_ref_sink (_tmp50_);
	rule_group = _tmp50_;
	_tmp51_ = g_strdup ("selection-mode");
	_tmp52_ = g_new0 (gchar*, 1 + 1);
	_tmp52_[0] = _tmp51_;
	_tmp53_ = (GtkCheckButton*) gtk_check_button_new ();
	gtk_check_button_set_active (_tmp53_, TRUE);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp53_, _tmp52_);
	_tmp52_ = (_vala_array_free (_tmp52_, 1, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp53_);
	_g_object_unref0 (self->priv->rule_no_access);
	self->priv->rule_no_access = _tmp53_;
	_tmp54_ = self->priv->rule_no_access;
	_tmp55_ = _g_object_ref0 (_tmp54_);
	_tmp56_ = g_strdup ("selection-mode");
	_tmp57_ = g_new0 (gchar*, 1 + 1);
	_tmp57_[0] = _tmp56_;
	_tmp58_ = (GtkCheckButton*) gtk_check_button_new ();
	gtk_check_button_set_group (_tmp58_, _tmp55_);
	_g_object_unref0 (_tmp55_);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp58_, _tmp57_);
	_tmp57_ = (_vala_array_free (_tmp57_, 1, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp58_);
	_g_object_unref0 (self->priv->rule_signup_block);
	self->priv->rule_signup_block = _tmp58_;
	_tmp59_ = self->priv->rule_no_access;
	_tmp60_ = _g_object_ref0 (_tmp59_);
	_tmp61_ = g_strdup ("selection-mode");
	_tmp62_ = g_new0 (gchar*, 1 + 1);
	_tmp62_[0] = _tmp61_;
	_tmp63_ = (GtkCheckButton*) gtk_check_button_new ();
	gtk_check_button_set_group (_tmp63_, _tmp60_);
	_g_object_unref0 (_tmp60_);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp63_, _tmp62_);
	_tmp62_ = (_vala_array_free (_tmp62_, 1, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp63_);
	_g_object_unref0 (self->priv->rule_signup_approve);
	self->priv->rule_signup_approve = _tmp63_;
	_tmp64_ = tuba_api_admin_ip_block_severity_to_title (TUBA_API_ADMIN_IP_BLOCK_SEVERITY_NO_ACCESS);
	_tmp65_ = tuba_api_admin_ip_block_severity_to_descritpion (TUBA_API_ADMIN_IP_BLOCK_SEVERITY_NO_ACCESS);
	_tmp66_ = self->priv->rule_no_access;
	_tmp67_ = _g_object_ref0 ((GtkWidget*) _tmp66_);
	_tmp68_ = (AdwActionRow*) adw_action_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp68_, _tmp64_);
	_g_free0 (_tmp64_);
	adw_action_row_set_subtitle (_tmp68_, _tmp65_);
	_g_free0 (_tmp65_);
	adw_action_row_set_activatable_widget (_tmp68_, _tmp67_);
	_g_object_unref0 (_tmp67_);
	g_object_ref_sink (_tmp68_);
	action_row = _tmp68_;
	_tmp69_ = action_row;
	_tmp70_ = self->priv->rule_no_access;
	adw_action_row_add_prefix (_tmp69_, (GtkWidget*) _tmp70_);
	_tmp71_ = rule_group;
	_tmp72_ = action_row;
	adw_preferences_group_add (_tmp71_, (GtkWidget*) _tmp72_);
	_tmp73_ = tuba_api_admin_ip_block_severity_to_title (TUBA_API_ADMIN_IP_BLOCK_SEVERITY_SIGN_UP_BLOCK);
	_tmp74_ = tuba_api_admin_ip_block_severity_to_descritpion (TUBA_API_ADMIN_IP_BLOCK_SEVERITY_SIGN_UP_BLOCK);
	_tmp75_ = self->priv->rule_signup_block;
	_tmp76_ = _g_object_ref0 ((GtkWidget*) _tmp75_);
	_tmp77_ = (AdwActionRow*) adw_action_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp77_, _tmp73_);
	_g_free0 (_tmp73_);
	adw_action_row_set_subtitle (_tmp77_, _tmp74_);
	_g_free0 (_tmp74_);
	adw_action_row_set_activatable_widget (_tmp77_, _tmp76_);
	_g_object_unref0 (_tmp76_);
	g_object_ref_sink (_tmp77_);
	_g_object_unref0 (action_row);
	action_row = _tmp77_;
	_tmp78_ = action_row;
	_tmp79_ = self->priv->rule_signup_block;
	adw_action_row_add_prefix (_tmp78_, (GtkWidget*) _tmp79_);
	_tmp80_ = rule_group;
	_tmp81_ = action_row;
	adw_preferences_group_add (_tmp80_, (GtkWidget*) _tmp81_);
	_tmp82_ = tuba_api_admin_ip_block_severity_to_title (TUBA_API_ADMIN_IP_BLOCK_SEVERITY_SIGN_UP_REQUIRES_APPROVAL);
	_tmp83_ = tuba_api_admin_ip_block_severity_to_descritpion (TUBA_API_ADMIN_IP_BLOCK_SEVERITY_SIGN_UP_REQUIRES_APPROVAL);
	_tmp84_ = self->priv->rule_signup_approve;
	_tmp85_ = _g_object_ref0 ((GtkWidget*) _tmp84_);
	_tmp86_ = (AdwActionRow*) adw_action_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp86_, _tmp82_);
	_g_free0 (_tmp82_);
	adw_action_row_set_subtitle (_tmp86_, _tmp83_);
	_g_free0 (_tmp83_);
	adw_action_row_set_activatable_widget (_tmp86_, _tmp85_);
	_g_object_unref0 (_tmp85_);
	g_object_ref_sink (_tmp86_);
	_g_object_unref0 (action_row);
	action_row = _tmp86_;
	_tmp87_ = action_row;
	_tmp88_ = self->priv->rule_signup_approve;
	adw_action_row_add_prefix (_tmp87_, (GtkWidget*) _tmp88_);
	_tmp89_ = rule_group;
	_tmp90_ = action_row;
	adw_preferences_group_add (_tmp89_, (GtkWidget*) _tmp90_);
	_tmp91_ = tuba_dialogs_admin_base_get_page ((TubaDialogsAdminBase*) self);
	_tmp92_ = _tmp91_;
	_tmp93_ = ip_group;
	adw_preferences_page_add (_tmp92_, _tmp93_);
	_tmp94_ = tuba_dialogs_admin_base_get_page ((TubaDialogsAdminBase*) self);
	_tmp95_ = _tmp94_;
	_tmp96_ = rule_group;
	adw_preferences_page_add (_tmp95_, _tmp96_);
	_g_object_unref0 (action_row);
	_g_object_unref0 (rule_group);
	_g_object_unref0 (signallistitemfactory);
	_g_object_unref0 (ip_group);
	_g_object_unref0 (cancel_button);
	return obj;
}

static void
tuba_dialogs_admin_add_ip_block_class_init (TubaDialogsAdminAddIPBlockClass * klass,
                                            gpointer klass_data)
{
	tuba_dialogs_admin_add_ip_block_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaDialogsAdminAddIPBlock_private_offset);
	G_OBJECT_CLASS (klass)->constructor = tuba_dialogs_admin_add_ip_block_constructor;
	G_OBJECT_CLASS (klass)->finalize = tuba_dialogs_admin_add_ip_block_finalize;
	tuba_dialogs_admin_add_ip_block_signals[TUBA_DIALOGS_ADMIN_ADD_IP_BLOCK_ADDED_SIGNAL] = g_signal_new ("added", TUBA_DIALOGS_ADMIN_TYPE_ADD_IP_BLOCK, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
tuba_dialogs_admin_add_ip_block_instance_init (TubaDialogsAdminAddIPBlock * self,
                                               gpointer klass)
{
	self->priv = tuba_dialogs_admin_add_ip_block_get_instance_private (self);
}

static void
tuba_dialogs_admin_add_ip_block_finalize (GObject * obj)
{
	TubaDialogsAdminAddIPBlock * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_DIALOGS_ADMIN_TYPE_ADD_IP_BLOCK, TubaDialogsAdminAddIPBlock);
	g_debug ("AddIPBlock.vala:3: Destroying AddIPBlock");
	_g_object_unref0 (self->priv->save_button);
	_g_object_unref0 (self->priv->ip_row);
	_g_object_unref0 (self->priv->exp_row);
	_g_object_unref0 (self->priv->exp_model);
	_g_object_unref0 (self->priv->rule_no_access);
	_g_object_unref0 (self->priv->rule_signup_block);
	_g_object_unref0 (self->priv->rule_signup_approve);
	_g_object_unref0 (self->priv->comment_row);
	G_OBJECT_CLASS (tuba_dialogs_admin_add_ip_block_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_dialogs_admin_add_ip_block_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaDialogsAdminAddIPBlockClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_dialogs_admin_add_ip_block_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaDialogsAdminAddIPBlock), 0, (GInstanceInitFunc) tuba_dialogs_admin_add_ip_block_instance_init, NULL };
	GType tuba_dialogs_admin_add_ip_block_type_id;
	tuba_dialogs_admin_add_ip_block_type_id = g_type_register_static (TUBA_DIALOGS_ADMIN_TYPE_BASE, "TubaDialogsAdminAddIPBlock", &g_define_type_info, G_TYPE_FLAG_NONE);
	TubaDialogsAdminAddIPBlock_private_offset = g_type_add_instance_private (tuba_dialogs_admin_add_ip_block_type_id, sizeof (TubaDialogsAdminAddIPBlockPrivate));
	return tuba_dialogs_admin_add_ip_block_type_id;
}

GType
tuba_dialogs_admin_add_ip_block_get_type (void)
{
	static GType tuba_dialogs_admin_add_ip_block_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_dialogs_admin_add_ip_block_type_id__once)) {
		GType tuba_dialogs_admin_add_ip_block_type_id;
		tuba_dialogs_admin_add_ip_block_type_id = tuba_dialogs_admin_add_ip_block_get_type_once ();
		g_once_init_leave_pointer (&tuba_dialogs_admin_add_ip_block_type_id__once, tuba_dialogs_admin_add_ip_block_type_id);
	}
	return tuba_dialogs_admin_add_ip_block_type_id__once;
}

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

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

