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

#include <handy.h>
#include <glib-object.h>
#include <gee.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <libsoup/soup.h>
#include <gtk/gtk.h>
#include <glib/gi18n-lib.h>
#include <json-glib/json-glib.h>
#include <gio/gio.h>

#define TOOTLE_DIALOGS_TYPE_LIST_EDITOR (tootle_dialogs_list_editor_get_type ())
#define TOOTLE_DIALOGS_LIST_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_DIALOGS_TYPE_LIST_EDITOR, TootleDialogsListEditor))
#define TOOTLE_DIALOGS_LIST_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_DIALOGS_TYPE_LIST_EDITOR, TootleDialogsListEditorClass))
#define TOOTLE_DIALOGS_IS_LIST_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_DIALOGS_TYPE_LIST_EDITOR))
#define TOOTLE_DIALOGS_IS_LIST_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_DIALOGS_TYPE_LIST_EDITOR))
#define TOOTLE_DIALOGS_LIST_EDITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_DIALOGS_TYPE_LIST_EDITOR, TootleDialogsListEditorClass))

typedef struct _TootleDialogsListEditor TootleDialogsListEditor;
typedef struct _TootleDialogsListEditorClass TootleDialogsListEditorClass;
typedef struct _TootleDialogsListEditorPrivate TootleDialogsListEditorPrivate;

#define TOOTLE_TYPE_ENTITY (tootle_entity_get_type ())
#define TOOTLE_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_TYPE_ENTITY, TootleEntity))
#define TOOTLE_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_TYPE_ENTITY, TootleEntityClass))
#define TOOTLE_IS_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_TYPE_ENTITY))
#define TOOTLE_IS_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_TYPE_ENTITY))
#define TOOTLE_ENTITY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_TYPE_ENTITY, TootleEntityClass))

typedef struct _TootleEntity TootleEntity;
typedef struct _TootleEntityClass TootleEntityClass;

#define TOOTLE_API_TYPE_LIST (tootle_api_list_get_type ())
#define TOOTLE_API_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_API_TYPE_LIST, TootleAPIList))
#define TOOTLE_API_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_API_TYPE_LIST, TootleAPIListClass))
#define TOOTLE_API_IS_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_API_TYPE_LIST))
#define TOOTLE_API_IS_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_API_TYPE_LIST))
#define TOOTLE_API_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_API_TYPE_LIST, TootleAPIListClass))

typedef struct _TootleAPIList TootleAPIList;
typedef struct _TootleAPIListClass TootleAPIListClass;
enum  {
	TOOTLE_DIALOGS_LIST_EDITOR_0_PROPERTY,
	TOOTLE_DIALOGS_LIST_EDITOR_LIST_PROPERTY,
	TOOTLE_DIALOGS_LIST_EDITOR_WORKING_PROPERTY,
	TOOTLE_DIALOGS_LIST_EDITOR_EXISTS_PROPERTY,
	TOOTLE_DIALOGS_LIST_EDITOR_DIRTY_PROPERTY,
	TOOTLE_DIALOGS_LIST_EDITOR_NUM_PROPERTIES
};
static GParamSpec* tootle_dialogs_list_editor_properties[TOOTLE_DIALOGS_LIST_EDITOR_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

#define TOOTLE_TYPE_REQUEST (tootle_request_get_type ())
#define TOOTLE_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_TYPE_REQUEST, TootleRequest))
#define TOOTLE_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_TYPE_REQUEST, TootleRequestClass))
#define TOOTLE_IS_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_TYPE_REQUEST))
#define TOOTLE_IS_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_TYPE_REQUEST))
#define TOOTLE_REQUEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_TYPE_REQUEST, TootleRequestClass))

typedef struct _TootleRequest TootleRequest;
typedef struct _TootleRequestClass TootleRequestClass;

#define TOOTLE_API_TYPE_ACCOUNT (tootle_api_account_get_type ())
#define TOOTLE_API_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_API_TYPE_ACCOUNT, TootleAPIAccount))
#define TOOTLE_API_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_API_TYPE_ACCOUNT, TootleAPIAccountClass))
#define TOOTLE_API_IS_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_API_TYPE_ACCOUNT))
#define TOOTLE_API_IS_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_API_TYPE_ACCOUNT))
#define TOOTLE_API_ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_API_TYPE_ACCOUNT, TootleAPIAccountClass))

typedef struct _TootleAPIAccount TootleAPIAccount;
typedef struct _TootleAPIAccountClass TootleAPIAccountClass;

#define TOOTLE_TYPE_INSTANCE_ACCOUNT (tootle_instance_account_get_type ())
#define TOOTLE_INSTANCE_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_TYPE_INSTANCE_ACCOUNT, TootleInstanceAccount))
#define TOOTLE_INSTANCE_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_TYPE_INSTANCE_ACCOUNT, TootleInstanceAccountClass))
#define TOOTLE_IS_INSTANCE_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_TYPE_INSTANCE_ACCOUNT))
#define TOOTLE_IS_INSTANCE_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_TYPE_INSTANCE_ACCOUNT))
#define TOOTLE_INSTANCE_ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_TYPE_INSTANCE_ACCOUNT, TootleInstanceAccountClass))

typedef struct _TootleInstanceAccount TootleInstanceAccount;
typedef struct _TootleInstanceAccountClass TootleInstanceAccountClass;

#define TOOTLE_TYPE_ACCOUNTS (tootle_accounts_get_type ())
#define TOOTLE_ACCOUNTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_TYPE_ACCOUNTS, TootleAccounts))
#define TOOTLE_ACCOUNTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_TYPE_ACCOUNTS, TootleAccountsClass))
#define TOOTLE_IS_ACCOUNTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_TYPE_ACCOUNTS))
#define TOOTLE_IS_ACCOUNTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_TYPE_ACCOUNTS))
#define TOOTLE_ACCOUNTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_TYPE_ACCOUNTS, TootleAccountsClass))

typedef struct _TootleAccounts TootleAccounts;
typedef struct _TootleAccountsClass TootleAccountsClass;
typedef void (*TootleNetworkErrorCallback) (gint32 code, const gchar* reason, gpointer user_data);
typedef void (*TootleNetworkSuccessCallback) (SoupSession* session, SoupMessage* msg, gpointer user_data, GError** error);
typedef void (*TootleNetworkNodeCallback) (JsonNode* node, SoupMessage* msg, gpointer user_data, GError** error);
typedef struct _Block32Data Block32Data;

#define TOOTLE_TYPE_NETWORK (tootle_network_get_type ())
#define TOOTLE_NETWORK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_TYPE_NETWORK, TootleNetwork))
#define TOOTLE_NETWORK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_TYPE_NETWORK, TootleNetworkClass))
#define TOOTLE_IS_NETWORK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_TYPE_NETWORK))
#define TOOTLE_IS_NETWORK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_TYPE_NETWORK))
#define TOOTLE_NETWORK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_TYPE_NETWORK, TootleNetworkClass))

typedef struct _TootleNetwork TootleNetwork;
typedef struct _TootleNetworkClass TootleNetworkClass;
typedef struct _Block33Data Block33Data;

#define TOOTLE_DIALOGS_LIST_EDITOR_TYPE_ITEM (tootle_dialogs_list_editor_item_get_type ())
#define TOOTLE_DIALOGS_LIST_EDITOR_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_DIALOGS_LIST_EDITOR_TYPE_ITEM, TootleDialogsListEditorItem))
#define TOOTLE_DIALOGS_LIST_EDITOR_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_DIALOGS_LIST_EDITOR_TYPE_ITEM, TootleDialogsListEditorItemClass))
#define TOOTLE_DIALOGS_LIST_EDITOR_IS_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_DIALOGS_LIST_EDITOR_TYPE_ITEM))
#define TOOTLE_DIALOGS_LIST_EDITOR_IS_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_DIALOGS_LIST_EDITOR_TYPE_ITEM))
#define TOOTLE_DIALOGS_LIST_EDITOR_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_DIALOGS_LIST_EDITOR_TYPE_ITEM, TootleDialogsListEditorItemClass))

typedef struct _TootleDialogsListEditorItem TootleDialogsListEditorItem;
typedef struct _TootleDialogsListEditorItemClass TootleDialogsListEditorItemClass;
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))

#define TOOTLE_TYPE_APPLICATION (tootle_application_get_type ())
#define TOOTLE_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_TYPE_APPLICATION, TootleApplication))
#define TOOTLE_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_TYPE_APPLICATION, TootleApplicationClass))
#define TOOTLE_IS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_TYPE_APPLICATION))
#define TOOTLE_IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_TYPE_APPLICATION))
#define TOOTLE_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_TYPE_APPLICATION, TootleApplicationClass))

typedef struct _TootleApplication TootleApplication;
typedef struct _TootleApplicationClass TootleApplicationClass;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define __vala_JsonNode_free0(var) ((var == NULL) ? NULL : (var = (_vala_JsonNode_free (var), NULL)))
typedef struct _TootleDialogsListEditorTransactionData TootleDialogsListEditorTransactionData;
typedef struct _TootleDialogsListEditorItemPrivate TootleDialogsListEditorItemPrivate;

#define TOOTLE_WIDGETS_TYPE_RICH_LABEL (tootle_widgets_rich_label_get_type ())
#define TOOTLE_WIDGETS_RICH_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_WIDGETS_TYPE_RICH_LABEL, TootleWidgetsRichLabel))
#define TOOTLE_WIDGETS_RICH_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_WIDGETS_TYPE_RICH_LABEL, TootleWidgetsRichLabelClass))
#define TOOTLE_WIDGETS_IS_RICH_LABEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_WIDGETS_TYPE_RICH_LABEL))
#define TOOTLE_WIDGETS_IS_RICH_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_WIDGETS_TYPE_RICH_LABEL))
#define TOOTLE_WIDGETS_RICH_LABEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_WIDGETS_TYPE_RICH_LABEL, TootleWidgetsRichLabelClass))

typedef struct _TootleWidgetsRichLabel TootleWidgetsRichLabel;
typedef struct _TootleWidgetsRichLabelClass TootleWidgetsRichLabelClass;
enum  {
	TOOTLE_DIALOGS_LIST_EDITOR_ITEM_0_PROPERTY,
	TOOTLE_DIALOGS_LIST_EDITOR_ITEM_EDITOR_PROPERTY,
	TOOTLE_DIALOGS_LIST_EDITOR_ITEM_ACC_PROPERTY,
	TOOTLE_DIALOGS_LIST_EDITOR_ITEM_COMMITTED_PROPERTY,
	TOOTLE_DIALOGS_LIST_EDITOR_ITEM_NUM_PROPERTIES
};
static GParamSpec* tootle_dialogs_list_editor_item_properties[TOOTLE_DIALOGS_LIST_EDITOR_ITEM_NUM_PROPERTIES];

#define TOOTLE_DIALOGS_TYPE_MAIN_WINDOW (tootle_dialogs_main_window_get_type ())
#define TOOTLE_DIALOGS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_DIALOGS_TYPE_MAIN_WINDOW, TootleDialogsMainWindow))
#define TOOTLE_DIALOGS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_DIALOGS_TYPE_MAIN_WINDOW, TootleDialogsMainWindowClass))
#define TOOTLE_DIALOGS_IS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_DIALOGS_TYPE_MAIN_WINDOW))
#define TOOTLE_DIALOGS_IS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_DIALOGS_TYPE_MAIN_WINDOW))
#define TOOTLE_DIALOGS_MAIN_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_DIALOGS_TYPE_MAIN_WINDOW, TootleDialogsMainWindowClass))

typedef struct _TootleDialogsMainWindow TootleDialogsMainWindow;
typedef struct _TootleDialogsMainWindowClass TootleDialogsMainWindowClass;
enum  {
	TOOTLE_DIALOGS_LIST_EDITOR_DONE_SIGNAL,
	TOOTLE_DIALOGS_LIST_EDITOR_NUM_SIGNALS
};
static guint tootle_dialogs_list_editor_signals[TOOTLE_DIALOGS_LIST_EDITOR_NUM_SIGNALS] = {0};

struct _TootleDialogsListEditor {
	HdyWindow parent_instance;
	TootleDialogsListEditorPrivate * priv;
	GeeArrayList* to_add;
	GeeArrayList* to_remove;
};

struct _TootleDialogsListEditorClass {
	HdyWindowClass parent_class;
};

struct _TootleDialogsListEditorPrivate {
	TootleAPIList* _list;
	gboolean _working;
	gboolean _exists;
	gboolean _dirty;
	SoupMessage* search_req;
	GtkButton* save_btn;
	GtkStack* save_btn_stack;
	GtkEntry* name_entry;
	GtkSearchEntry* search_entry;
	GtkListBox* listbox;
	GtkInfoBar* infobar;
	GtkLabel* infobar_label;
};

struct _Block32Data {
	int _ref_count_;
	TootleDialogsListEditor* self;
	gulong dirty_sigid;
};

struct _Block33Data {
	int _ref_count_;
	TootleDialogsListEditor* self;
	gboolean exists;
	TootleAPIAccount* acc;
};

struct _TootleDialogsListEditorTransactionData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	TootleDialogsListEditor* self;
	gboolean _tmp0_;
	TootleRequest* req;
	TootleRequest* _tmp1_;
	TootleRequest* _tmp2_;
	TootleAccounts* _tmp3_;
	TootleInstanceAccount* _tmp4_;
	TootleInstanceAccount* _tmp5_;
	TootleRequest* _tmp6_;
	TootleRequest* _tmp7_;
	GtkEntry* _tmp8_;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	TootleRequest* _tmp11_;
	TootleRequest* _tmp12_;
	TootleRequest* _tmp13_;
	TootleRequest* _tmp14_;
	TootleRequest* _tmp15_;
	JsonNode* node;
	TootleNetwork* _tmp16_;
	TootleRequest* _tmp17_;
	JsonNode* _tmp18_;
	TootleAPIList* _tmp19_;
	JsonNode* _tmp20_;
	TootleAPIList* _tmp21_;
	TootleAPIList* _tmp22_;
	const gchar* _tmp23_;
	const gchar* _tmp24_;
	const gchar* _tmp25_;
	gchar* _tmp26_;
	gchar* _tmp27_;
	TootleRequest* _tmp28_;
	TootleRequest* _tmp29_;
	TootleAccounts* _tmp30_;
	TootleInstanceAccount* _tmp31_;
	TootleInstanceAccount* _tmp32_;
	TootleRequest* _tmp33_;
	TootleRequest* _tmp34_;
	GtkEntry* _tmp35_;
	const gchar* _tmp36_;
	const gchar* _tmp37_;
	TootleRequest* _tmp38_;
	TootleRequest* _tmp39_;
	TootleRequest* _tmp40_;
	TootleRequest* _tmp41_;
	GeeArrayList* _tmp42_;
	gboolean _tmp43_;
	gboolean _tmp44_;
	gchar* id_array;
	GeeArrayList* _tmp45_;
	gchar* _tmp46_;
	TootleAPIList* _tmp47_;
	const gchar* _tmp48_;
	const gchar* _tmp49_;
	const gchar* _tmp50_;
	const gchar* _tmp51_;
	const gchar* _tmp52_;
	gchar* _tmp53_;
	gchar* _tmp54_;
	TootleRequest* _tmp55_;
	TootleRequest* _tmp56_;
	TootleAccounts* _tmp57_;
	TootleInstanceAccount* _tmp58_;
	TootleInstanceAccount* _tmp59_;
	TootleRequest* _tmp60_;
	TootleRequest* _tmp61_;
	TootleRequest* _tmp62_;
	TootleRequest* _tmp63_;
	GeeArrayList* _tmp64_;
	gboolean _tmp65_;
	gboolean _tmp66_;
	gchar* _vala1_id_array;
	GeeArrayList* _tmp67_;
	gchar* _tmp68_;
	TootleAPIList* _tmp69_;
	const gchar* _tmp70_;
	const gchar* _tmp71_;
	const gchar* _tmp72_;
	const gchar* _tmp73_;
	const gchar* _tmp74_;
	gchar* _tmp75_;
	gchar* _tmp76_;
	TootleRequest* _tmp77_;
	TootleRequest* _tmp78_;
	TootleAccounts* _tmp79_;
	TootleInstanceAccount* _tmp80_;
	TootleInstanceAccount* _tmp81_;
	TootleRequest* _tmp82_;
	TootleRequest* _tmp83_;
	TootleRequest* _tmp84_;
	TootleRequest* _tmp85_;
	TootleAPIList* _tmp86_;
	GtkEntry* _tmp87_;
	const gchar* _tmp88_;
	const gchar* _tmp89_;
	GError* _inner_error0_;
};

struct _TootleDialogsListEditorItem {
	GtkListBoxRow parent_instance;
	TootleDialogsListEditorItemPrivate * priv;
};

struct _TootleDialogsListEditorItemClass {
	GtkListBoxRowClass parent_class;
};

struct _TootleDialogsListEditorItemPrivate {
	TootleDialogsListEditor* _editor;
	TootleAPIAccount* _acc;
	gboolean _committed;
	TootleWidgetsRichLabel* label;
	TootleWidgetsRichLabel* handle;
	GtkToggleButton* status;
};

static gint TootleDialogsListEditor_private_offset;
static gpointer tootle_dialogs_list_editor_parent_class = NULL;
extern TootleAccounts* tootle_accounts;
extern TootleNetwork* tootle_network;
extern TootleApplication* tootle_app;
static gint TootleDialogsListEditorItem_private_offset;
static gpointer tootle_dialogs_list_editor_item_parent_class = NULL;
extern TootleDialogsMainWindow* tootle_window;

GType tootle_dialogs_list_editor_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleDialogsListEditor, g_object_unref)
GType tootle_entity_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleEntity, g_object_unref)
GType tootle_api_list_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleAPIList, g_object_unref)
TootleDialogsListEditor* tootle_dialogs_list_editor_new_empty (void);
TootleDialogsListEditor* tootle_dialogs_list_editor_construct_empty (GType object_type);
TootleAPIList* tootle_api_list_new (void);
TootleAPIList* tootle_api_list_construct (GType object_type);
void tootle_api_list_set_title (TootleAPIList* self,
                                const gchar* value);
static void tootle_dialogs_list_editor_init (TootleDialogsListEditor* self);
TootleDialogsListEditor* tootle_dialogs_list_editor_new (TootleAPIList* list);
TootleDialogsListEditor* tootle_dialogs_list_editor_construct (GType object_type,
                                                               TootleAPIList* list);
const gchar* tootle_api_list_get_id (TootleAPIList* self);
TootleRequest* tootle_request_new_GET (const gchar* url);
TootleRequest* tootle_request_construct_GET (GType object_type,
                                             const gchar* url);
GType tootle_request_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleRequest, g_object_unref)
GType tootle_api_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleAPIAccount, g_object_unref)
GType tootle_instance_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleInstanceAccount, g_object_unref)
TootleRequest* tootle_request_with_account (TootleRequest* self,
                                            TootleInstanceAccount* account);
GType tootle_accounts_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleAccounts, g_object_unref)
TootleInstanceAccount* tootle_accounts_get_active (TootleAccounts* self);
TootleRequest* tootle_request_with_ctx (TootleRequest* self,
                                        GtkWidget* ctx);
TootleRequest* tootle_request_on_error (TootleRequest* self,
                                        TootleNetworkErrorCallback cb,
                                        gpointer cb_target,
                                        GDestroyNotify cb_target_destroy_notify);
static void tootle_dialogs_list_editor_on_error (TootleDialogsListEditor* self,
                                          gint32 code,
                                          const gchar* msg);
static void _tootle_dialogs_list_editor_on_error_tootle_network_error_callback (gint32 code,
                                                                         const gchar* reason,
                                                                         gpointer self);
TootleRequest* tootle_request_then (TootleRequest* self,
                                    TootleNetworkSuccessCallback cb,
                                    gpointer cb_target,
                                    GDestroyNotify cb_target_destroy_notify);
static void __lambda115_ (TootleDialogsListEditor* self,
                   SoupSession* sess,
                   SoupMessage* msg,
                   GError** error);
void tootle_network_parse_array (SoupMessage* msg,
                                 TootleNetworkNodeCallback cb,
                                 gpointer cb_target,
                                 GDestroyNotify cb_target_destroy_notify,
                                 GError** error);
static void __lambda116_ (TootleDialogsListEditor* self,
                   JsonNode* node,
                   GError** error);
TootleAPIAccount* tootle_api_account_from (JsonNode* node,
                                           GError** error);
static void tootle_dialogs_list_editor_add_account (TootleDialogsListEditor* self,
                                             TootleAPIAccount* acc,
                                             gboolean added,
                                             gint order);
static void ___lambda116__tootle_network_node_callback (JsonNode* node,
                                                 SoupMessage* msg,
                                                 gpointer self,
                                                 GError** error);
void tootle_dialogs_list_editor_set_working (TootleDialogsListEditor* self,
                                             gboolean value);
static void ___lambda115__tootle_network_success_callback (SoupSession* session,
                                                    SoupMessage* msg,
                                                    gpointer self,
                                                    GError** error);
TootleRequest* tootle_request_exec (TootleRequest* self);
static Block32Data* block32_data_ref (Block32Data* _data32_);
static void block32_data_unref (void * _userdata_);
static void tootle_dialogs_list_editor_on_state_changed (TootleDialogsListEditor* self,
                                                  GParamSpec* p);
static void _tootle_dialogs_list_editor_on_state_changed_g_object_notify (GObject* _sender,
                                                                   GParamSpec* pspec,
                                                                   gpointer self);
TootleAPIList* tootle_dialogs_list_editor_get_list (TootleDialogsListEditor* self);
static void __lambda114_ (Block32Data* _data32_);
void tootle_dialogs_list_editor_set_dirty (TootleDialogsListEditor* self,
                                           gboolean value);
static void ___lambda114__gtk_editable_changed (GtkEditable* _sender,
                                         gpointer self);
gboolean tootle_dialogs_list_editor_get_working (TootleDialogsListEditor* self);
static void tootle_dialogs_list_editor_infobar_response (TootleDialogsListEditor* self,
                                                  gint i);
static void _tootle_dialogs_list_editor_infobar_response_gtk_info_bar_response (GtkInfoBar* _sender,
                                                                         gint response_id,
                                                                         gpointer self);
static void tootle_dialogs_list_editor_request_search (TootleDialogsListEditor* self,
                                                const gchar* q);
GType tootle_network_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleNetwork, g_object_unref)
void tootle_network_cancel (TootleNetwork* self,
                            SoupMessage* msg);
TootleRequest* tootle_request_with_param (TootleRequest* self,
                                          const gchar* name,
                                          const gchar* val);
static void __lambda118_ (TootleDialogsListEditor* self,
                   SoupSession* sess,
                   SoupMessage* msg,
                   GError** error);
static void __lambda119_ (TootleDialogsListEditor* self,
                   JsonNode* node,
                   GError** error);
static void ___lambda119__tootle_network_node_callback (JsonNode* node,
                                                 SoupMessage* msg,
                                                 gpointer self,
                                                 GError** error);
static void ___lambda118__tootle_network_success_callback (SoupSession* session,
                                                    SoupMessage* msg,
                                                    gpointer self,
                                                    GError** error);
static Block33Data* block33_data_ref (Block33Data* _data33_);
static void block33_data_unref (void * _userdata_);
static void __lambda117_ (Block33Data* _data33_,
                   GtkWidget* w);
static GType tootle_dialogs_list_editor_item_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleDialogsListEditorItem, g_object_unref)
static TootleAPIAccount* tootle_dialogs_list_editor_item_get_acc (TootleDialogsListEditorItem* self);
const gchar* tootle_api_account_get_id (TootleAPIAccount* self);
static void ___lambda117__gtk_callback (GtkWidget* widget,
                                 gpointer self);
static TootleDialogsListEditorItem* tootle_dialogs_list_editor_item_new (TootleDialogsListEditor* editor,
                                                                  TootleAPIAccount* acc,
                                                                  gboolean committed);
static TootleDialogsListEditorItem* tootle_dialogs_list_editor_item_construct (GType object_type,
                                                                        TootleDialogsListEditor* editor,
                                                                        TootleAPIAccount* acc,
                                                                        gboolean committed);
static void tootle_dialogs_list_editor_invalidate (TootleDialogsListEditor* self);
static void __lambda120_ (TootleDialogsListEditor* self,
                   GtkWidget* w);
static gboolean tootle_dialogs_list_editor_item_get_committed (TootleDialogsListEditorItem* self);
static void ___lambda120__gtk_callback (GtkWidget* widget,
                                 gpointer self);
static void tootle_dialogs_list_editor_validate (TootleDialogsListEditor* self);
static void _tootle_dialogs_list_editor_validate_gtk_editable_changed (GtkEditable* _sender,
                                                                gpointer self);
static void tootle_dialogs_list_editor_on_cancel_clicked (TootleDialogsListEditor* self);
gboolean tootle_dialogs_list_editor_get_dirty (TootleDialogsListEditor* self);
GType tootle_application_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleApplication, g_object_unref)
gboolean tootle_application_question (TootleApplication* self,
                                      const gchar* text,
                                      const gchar* msg,
                                      GtkWindow* win);
static void _tootle_dialogs_list_editor_on_cancel_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                       gpointer self);
static void tootle_dialogs_list_editor_on_search_changed (TootleDialogsListEditor* self);
static void _tootle_dialogs_list_editor_on_search_changed_gtk_search_entry_search_changed (GtkSearchEntry* _sender,
                                                                                    gpointer self);
static void tootle_dialogs_list_editor_on_save_clicked (TootleDialogsListEditor* self);
static void tootle_dialogs_list_editor_transaction (TootleDialogsListEditor* self,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_);
static void tootle_dialogs_list_editor_transaction_finish (TootleDialogsListEditor* self,
                                                    GAsyncResult* _res_,
                                                    GError** error);
static void __lambda121_ (TootleDialogsListEditor* self,
                   GObject* obj,
                   GAsyncResult* res);
static void ___lambda121__gasync_ready_callback (GObject* source_object,
                                          GAsyncResult* res,
                                          gpointer self);
static void _tootle_dialogs_list_editor_on_save_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                     gpointer self);
static void tootle_dialogs_list_editor_transaction_data_free (gpointer _data);
static gboolean tootle_dialogs_list_editor_transaction_co (TootleDialogsListEditorTransactionData* _data_);
gboolean tootle_dialogs_list_editor_get_exists (TootleDialogsListEditor* self);
TootleRequest* tootle_request_new_POST (const gchar* url);
TootleRequest* tootle_request_construct_POST (GType object_type,
                                              const gchar* url);
void tootle_request_await (TootleRequest* self,
                           GAsyncReadyCallback _callback_,
                           gpointer _user_data_);
TootleRequest* tootle_request_await_finish (TootleRequest* self,
                                            GAsyncResult* _res_,
                                            GError** error);
static void tootle_dialogs_list_editor_transaction_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_);
JsonNode* tootle_network_parse_node (TootleNetwork* self,
                                     SoupMessage* msg,
                                     GError** error);
TootleAPIList* tootle_api_list_from (JsonNode* node,
                                     GError** error);
static void _vala_JsonNode_free (JsonNode* self);
void tootle_dialogs_list_editor_set_list (TootleDialogsListEditor* self,
                                          TootleAPIList* value);
TootleRequest* tootle_request_new_PUT (const gchar* url);
TootleRequest* tootle_request_construct_PUT (GType object_type,
                                             const gchar* url);
gchar* tootle_request_array2string (GeeArrayList* array,
                                    const gchar* key);
TootleRequest* tootle_request_new_DELETE (const gchar* url);
TootleRequest* tootle_request_construct_DELETE (GType object_type,
                                                const gchar* url);
void tootle_dialogs_list_editor_set_exists (TootleDialogsListEditor* self,
                                            gboolean value);
GType tootle_widgets_rich_label_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleWidgetsRichLabel, g_object_unref)
static void tootle_dialogs_list_editor_item_set_editor (TootleDialogsListEditorItem* self,
                                                 TootleDialogsListEditor* value);
static void tootle_dialogs_list_editor_item_set_acc (TootleDialogsListEditorItem* self,
                                              TootleAPIAccount* value);
static void tootle_dialogs_list_editor_item_set_committed (TootleDialogsListEditorItem* self,
                                                    gboolean value);
static void tootle_dialogs_list_editor_item_on_toggled (TootleDialogsListEditorItem* self);
static TootleDialogsListEditor* tootle_dialogs_list_editor_item_get_editor (TootleDialogsListEditorItem* self);
static void _tootle_dialogs_list_editor_item_on_toggled_gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                                            gpointer self);
static void tootle_dialogs_list_editor_item_finalize (GObject * obj);
static GType tootle_dialogs_list_editor_item_get_type_once (void);
static void _vala_tootle_dialogs_list_editor_item_get_property (GObject * object,
                                                         guint property_id,
                                                         GValue * value,
                                                         GParamSpec * pspec);
static void _vala_tootle_dialogs_list_editor_item_set_property (GObject * object,
                                                         guint property_id,
                                                         const GValue * value,
                                                         GParamSpec * pspec);
static GObject * tootle_dialogs_list_editor_constructor (GType type,
                                                  guint n_construct_properties,
                                                  GObjectConstructParam * construct_properties);
GType tootle_dialogs_main_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleDialogsMainWindow, g_object_unref)
static void tootle_dialogs_list_editor_finalize (GObject * obj);
static GType tootle_dialogs_list_editor_get_type_once (void);
static void _vala_tootle_dialogs_list_editor_get_property (GObject * object,
                                                    guint property_id,
                                                    GValue * value,
                                                    GParamSpec * pspec);
static void _vala_tootle_dialogs_list_editor_set_property (GObject * object,
                                                    guint property_id,
                                                    const GValue * value,
                                                    GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
tootle_dialogs_list_editor_get_instance_private (TootleDialogsListEditor* self)
{
	return G_STRUCT_MEMBER_P (self, TootleDialogsListEditor_private_offset);
}

TootleDialogsListEditor*
tootle_dialogs_list_editor_construct_empty (GType object_type)
{
	TootleDialogsListEditor * self = NULL;
	TootleAPIList* obj = NULL;
	gchar* _tmp0_;
	TootleAPIList* _tmp1_ = NULL;
	_tmp0_ = g_strdup (_ ("Untitled"));
	_tmp1_ = tootle_api_list_new ();
	tootle_api_list_set_title (_tmp1_, _tmp0_);
	_g_free0 (_tmp0_);
	obj = _tmp1_;
	self = (TootleDialogsListEditor*) g_object_new (object_type, "list", obj, NULL);
	tootle_dialogs_list_editor_init (self);
	_g_object_unref0 (obj);
	return self;
}

TootleDialogsListEditor*
tootle_dialogs_list_editor_new_empty (void)
{
	return tootle_dialogs_list_editor_construct_empty (TOOTLE_DIALOGS_TYPE_LIST_EDITOR);
}

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

static void
_tootle_dialogs_list_editor_on_error_tootle_network_error_callback (gint32 code,
                                                                    const gchar* reason,
                                                                    gpointer self)
{
	tootle_dialogs_list_editor_on_error ((TootleDialogsListEditor*) self, code, reason);
}

static void
__lambda116_ (TootleDialogsListEditor* self,
              JsonNode* node,
              GError** error)
{
	TootleAPIAccount* acc = NULL;
	TootleAPIAccount* _tmp0_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (node != NULL);
	_tmp0_ = tootle_api_account_from (node, &_inner_error0_);
	acc = _tmp0_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
	tootle_dialogs_list_editor_add_account (self, acc, TRUE, -1);
	_g_object_unref0 (acc);
}

static void
___lambda116__tootle_network_node_callback (JsonNode* node,
                                            SoupMessage* msg,
                                            gpointer self,
                                            GError** error)
{
	__lambda116_ ((TootleDialogsListEditor*) self, node, error);
}

static void
__lambda115_ (TootleDialogsListEditor* self,
              SoupSession* sess,
              SoupMessage* msg,
              GError** error)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (sess != NULL);
	g_return_if_fail (msg != NULL);
	tootle_network_parse_array (msg, ___lambda116__tootle_network_node_callback, g_object_ref (self), g_object_unref, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
	tootle_dialogs_list_editor_set_working (self, FALSE);
}

static void
___lambda115__tootle_network_success_callback (SoupSession* session,
                                               SoupMessage* msg,
                                               gpointer self,
                                               GError** error)
{
	__lambda115_ ((TootleDialogsListEditor*) self, session, msg, error);
}

TootleDialogsListEditor*
tootle_dialogs_list_editor_construct (GType object_type,
                                      TootleAPIList* list)
{
	TootleDialogsListEditor * self = NULL;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	TootleRequest* _tmp5_;
	TootleRequest* _tmp6_;
	TootleAccounts* _tmp7_;
	TootleInstanceAccount* _tmp8_;
	TootleInstanceAccount* _tmp9_;
	TootleRequest* _tmp10_;
	TootleRequest* _tmp11_;
	TootleRequest* _tmp12_;
	TootleRequest* _tmp13_;
	TootleRequest* _tmp14_;
	TootleRequest* _tmp15_;
	TootleRequest* _tmp16_;
	TootleRequest* _tmp17_;
	TootleRequest* _tmp18_;
	TootleRequest* _tmp19_;
	g_return_val_if_fail (list != NULL, NULL);
	self = (TootleDialogsListEditor*) g_object_new (object_type, "list", list, "working", TRUE, "exists", TRUE, NULL);
	tootle_dialogs_list_editor_init (self);
	_tmp0_ = tootle_api_list_get_id (list);
	_tmp1_ = _tmp0_;
	_tmp2_ = string_to_string (_tmp1_);
	_tmp3_ = g_strconcat ("/api/v1/lists/", _tmp2_, "/accounts", NULL);
	_tmp4_ = _tmp3_;
	_tmp5_ = tootle_request_new_GET (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = tootle_accounts;
	_tmp8_ = tootle_accounts_get_active (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = tootle_request_with_account (_tmp6_, _tmp9_);
	_tmp11_ = _tmp10_;
	_tmp12_ = tootle_request_with_ctx (_tmp11_, (GtkWidget*) self);
	_tmp13_ = _tmp12_;
	_tmp14_ = tootle_request_on_error (_tmp13_, _tootle_dialogs_list_editor_on_error_tootle_network_error_callback, g_object_ref (self), g_object_unref);
	_tmp15_ = _tmp14_;
	_tmp16_ = tootle_request_then (_tmp15_, ___lambda115__tootle_network_success_callback, g_object_ref (self), g_object_unref);
	_tmp17_ = _tmp16_;
	_tmp18_ = tootle_request_exec (_tmp17_);
	_tmp19_ = _tmp18_;
	_g_object_unref0 (_tmp19_);
	_g_object_unref0 (_tmp17_);
	_g_object_unref0 (_tmp15_);
	_g_object_unref0 (_tmp13_);
	_g_object_unref0 (_tmp11_);
	_g_object_unref0 (_tmp6_);
	_g_free0 (_tmp4_);
	return self;
}

TootleDialogsListEditor*
tootle_dialogs_list_editor_new (TootleAPIList* list)
{
	return tootle_dialogs_list_editor_construct (TOOTLE_DIALOGS_TYPE_LIST_EDITOR, list);
}

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

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

static void
_tootle_dialogs_list_editor_on_state_changed_g_object_notify (GObject* _sender,
                                                              GParamSpec* pspec,
                                                              gpointer self)
{
	tootle_dialogs_list_editor_on_state_changed ((TootleDialogsListEditor*) self, pspec);
}

static void
__lambda114_ (Block32Data* _data32_)
{
	TootleDialogsListEditor* self;
	GtkEntry* _tmp0_;
	self = _data32_->self;
	tootle_dialogs_list_editor_set_dirty (self, TRUE);
	_tmp0_ = self->priv->name_entry;
	g_signal_handler_disconnect ((GObject*) _tmp0_, _data32_->dirty_sigid);
}

static void
___lambda114__gtk_editable_changed (GtkEditable* _sender,
                                    gpointer self)
{
	__lambda114_ (self);
}

static void
tootle_dialogs_list_editor_init (TootleDialogsListEditor* self)
{
	Block32Data* _data32_;
	TootleAPIList* _tmp0_;
	GtkEntry* _tmp1_;
	GtkEntry* _tmp2_;
	gulong _tmp3_;
	g_return_if_fail (self != NULL);
	_data32_ = g_slice_new0 (Block32Data);
	_data32_->_ref_count_ = 1;
	_data32_->self = g_object_ref (self);
	g_signal_connect_object ((GObject*) self, "notify::working", (GCallback) _tootle_dialogs_list_editor_on_state_changed_g_object_notify, self, 0);
	_tmp0_ = self->priv->_list;
	_tmp1_ = self->priv->name_entry;
	g_object_bind_property_with_closures ((GObject*) _tmp0_, "title", (GObject*) _tmp1_, "text", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_data32_->dirty_sigid = (gulong) 0;
	_tmp2_ = self->priv->name_entry;
	_tmp3_ = g_signal_connect_data ((GtkEditable*) _tmp2_, "changed", (GCallback) ___lambda114__gtk_editable_changed, block32_data_ref (_data32_), (GClosureNotify) block32_data_unref, 0);
	_data32_->dirty_sigid = _tmp3_;
	tootle_dialogs_list_editor_on_state_changed (self, NULL);
	block32_data_unref (_data32_);
	_data32_ = NULL;
}

static void
tootle_dialogs_list_editor_on_state_changed (TootleDialogsListEditor* self,
                                             GParamSpec* p)
{
	const gchar* _tmp0_ = NULL;
	gboolean _tmp1_;
	GtkStack* _tmp2_;
	GtkButton* _tmp3_;
	GtkSearchEntry* _tmp4_;
	GtkEntry* _tmp5_;
	gboolean _tmp6_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->_working;
	if (_tmp1_) {
		_tmp0_ = "working";
	} else {
		_tmp0_ = "done";
	}
	_tmp2_ = self->priv->save_btn_stack;
	gtk_stack_set_visible_child_name (_tmp2_, _tmp0_);
	_tmp3_ = self->priv->save_btn;
	_tmp4_ = self->priv->search_entry;
	_tmp5_ = self->priv->name_entry;
	_tmp6_ = self->priv->_working;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp5_, !_tmp6_);
	gtk_widget_set_sensitive ((GtkWidget*) _tmp4_, !_tmp6_);
	gtk_widget_set_sensitive ((GtkWidget*) _tmp3_, !_tmp6_);
}

static void
tootle_dialogs_list_editor_on_error (TootleDialogsListEditor* self,
                                     gint32 code,
                                     const gchar* msg)
{
	GtkLabel* _tmp0_;
	GtkInfoBar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (msg != NULL);
	g_warning ("ListEditor.vala:130: %s", msg);
	_tmp0_ = self->priv->infobar_label;
	gtk_label_set_label (_tmp0_, msg);
	_tmp1_ = self->priv->infobar;
	gtk_info_bar_set_revealed (_tmp1_, TRUE);
}

static void
tootle_dialogs_list_editor_infobar_response (TootleDialogsListEditor* self,
                                             gint i)
{
	GtkInfoBar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->infobar;
	gtk_info_bar_set_revealed (_tmp0_, FALSE);
}

static void
_tootle_dialogs_list_editor_infobar_response_gtk_info_bar_response (GtkInfoBar* _sender,
                                                                    gint response_id,
                                                                    gpointer self)
{
	tootle_dialogs_list_editor_infobar_response ((TootleDialogsListEditor*) self, response_id);
}

static void
__lambda119_ (TootleDialogsListEditor* self,
              JsonNode* node,
              GError** error)
{
	TootleAPIAccount* acc = NULL;
	TootleAPIAccount* _tmp0_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (node != NULL);
	_tmp0_ = tootle_api_account_from (node, &_inner_error0_);
	acc = _tmp0_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
	tootle_dialogs_list_editor_add_account (self, acc, FALSE, 0);
	_g_object_unref0 (acc);
}

static void
___lambda119__tootle_network_node_callback (JsonNode* node,
                                            SoupMessage* msg,
                                            gpointer self,
                                            GError** error)
{
	__lambda119_ ((TootleDialogsListEditor*) self, node, error);
}

static void
__lambda118_ (TootleDialogsListEditor* self,
              SoupSession* sess,
              SoupMessage* msg,
              GError** error)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (sess != NULL);
	g_return_if_fail (msg != NULL);
	tootle_network_parse_array (msg, ___lambda119__tootle_network_node_callback, g_object_ref (self), g_object_unref, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
}

static void
___lambda118__tootle_network_success_callback (SoupSession* session,
                                               SoupMessage* msg,
                                               gpointer self,
                                               GError** error)
{
	__lambda118_ ((TootleDialogsListEditor*) self, session, msg, error);
}

static void
tootle_dialogs_list_editor_request_search (TootleDialogsListEditor* self,
                                           const gchar* q)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	SoupMessage* _tmp3_;
	TootleRequest* _tmp6_;
	TootleRequest* _tmp7_;
	TootleAccounts* _tmp8_;
	TootleInstanceAccount* _tmp9_;
	TootleInstanceAccount* _tmp10_;
	TootleRequest* _tmp11_;
	TootleRequest* _tmp12_;
	TootleRequest* _tmp13_;
	TootleRequest* _tmp14_;
	TootleRequest* _tmp15_;
	TootleRequest* _tmp16_;
	TootleRequest* _tmp17_;
	TootleRequest* _tmp18_;
	TootleRequest* _tmp19_;
	TootleRequest* _tmp20_;
	TootleRequest* _tmp21_;
	TootleRequest* _tmp22_;
	TootleRequest* _tmp23_;
	TootleRequest* _tmp24_;
	TootleRequest* _tmp25_;
	TootleRequest* _tmp26_;
	TootleRequest* _tmp27_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (q != NULL);
	_tmp0_ = string_to_string (q);
	_tmp1_ = g_strconcat ("Searching for: \"", _tmp0_, "\"...", NULL);
	_tmp2_ = _tmp1_;
	g_debug ("ListEditor.vala:141: %s", _tmp2_);
	_g_free0 (_tmp2_);
	_tmp3_ = self->priv->search_req;
	if (_tmp3_ != NULL) {
		TootleNetwork* _tmp4_;
		SoupMessage* _tmp5_;
		_tmp4_ = tootle_network;
		_tmp5_ = self->priv->search_req;
		tootle_network_cancel (_tmp4_, _tmp5_);
		_g_object_unref0 (self->priv->search_req);
		self->priv->search_req = NULL;
	}
	_tmp6_ = tootle_request_new_GET ("/api/v1/accounts/search");
	_tmp7_ = _tmp6_;
	_tmp8_ = tootle_accounts;
	_tmp9_ = tootle_accounts_get_active (_tmp8_);
	_tmp10_ = _tmp9_;
	_tmp11_ = tootle_request_with_account (_tmp7_, _tmp10_);
	_tmp12_ = _tmp11_;
	_tmp13_ = tootle_request_with_ctx (_tmp12_, (GtkWidget*) self);
	_tmp14_ = _tmp13_;
	_tmp15_ = tootle_request_with_param (_tmp14_, "resolve", "false");
	_tmp16_ = _tmp15_;
	_tmp17_ = tootle_request_with_param (_tmp16_, "limit", "8");
	_tmp18_ = _tmp17_;
	_tmp19_ = tootle_request_with_param (_tmp18_, "following", "true");
	_tmp20_ = _tmp19_;
	_tmp21_ = tootle_request_with_param (_tmp20_, "q", q);
	_tmp22_ = _tmp21_;
	_tmp23_ = tootle_request_then (_tmp22_, ___lambda118__tootle_network_success_callback, g_object_ref (self), g_object_unref);
	_tmp24_ = _tmp23_;
	_tmp25_ = tootle_request_on_error (_tmp24_, _tootle_dialogs_list_editor_on_error_tootle_network_error_callback, g_object_ref (self), g_object_unref);
	_tmp26_ = _tmp25_;
	_tmp27_ = tootle_request_exec (_tmp26_);
	_g_object_unref0 (self->priv->search_req);
	self->priv->search_req = (SoupMessage*) _tmp27_;
	_g_object_unref0 (_tmp26_);
	_g_object_unref0 (_tmp24_);
	_g_object_unref0 (_tmp22_);
	_g_object_unref0 (_tmp20_);
	_g_object_unref0 (_tmp18_);
	_g_object_unref0 (_tmp16_);
	_g_object_unref0 (_tmp14_);
	_g_object_unref0 (_tmp12_);
	_g_object_unref0 (_tmp7_);
}

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

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

static void
block33_data_unref (void * _userdata_)
{
	Block33Data* _data33_;
	_data33_ = (Block33Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data33_->_ref_count_)) {
		TootleDialogsListEditor* self;
		self = _data33_->self;
		_g_object_unref0 (_data33_->acc);
		_g_object_unref0 (self);
		g_slice_free (Block33Data, _data33_);
	}
}

static void
__lambda117_ (Block33Data* _data33_,
              GtkWidget* w)
{
	TootleDialogsListEditor* self;
	TootleDialogsListEditorItem* i = NULL;
	TootleDialogsListEditorItem* _tmp0_;
	TootleDialogsListEditorItem* _tmp1_;
	self = _data33_->self;
	g_return_if_fail (w != NULL);
	_tmp0_ = _g_object_ref0 (TOOTLE_DIALOGS_LIST_EDITOR_IS_ITEM (w) ? ((TootleDialogsListEditorItem*) w) : NULL);
	i = _tmp0_;
	_tmp1_ = i;
	if (_tmp1_ != NULL) {
		TootleDialogsListEditorItem* _tmp2_;
		TootleAPIAccount* _tmp3_;
		TootleAPIAccount* _tmp4_;
		const gchar* _tmp5_;
		const gchar* _tmp6_;
		const gchar* _tmp7_;
		const gchar* _tmp8_;
		_tmp2_ = i;
		_tmp3_ = tootle_dialogs_list_editor_item_get_acc (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp5_ = tootle_api_account_get_id (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = tootle_api_account_get_id (_data33_->acc);
		_tmp8_ = _tmp7_;
		if (g_strcmp0 (_tmp6_, _tmp8_) == 0) {
			_data33_->exists = TRUE;
		}
	}
	_g_object_unref0 (i);
}

static void
___lambda117__gtk_callback (GtkWidget* widget,
                            gpointer self)
{
	__lambda117_ (self, widget);
}

static void
tootle_dialogs_list_editor_add_account (TootleDialogsListEditor* self,
                                        TootleAPIAccount* acc,
                                        gboolean added,
                                        gint order)
{
	Block33Data* _data33_;
	TootleAPIAccount* _tmp0_;
	GtkListBox* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (acc != NULL);
	_data33_ = g_slice_new0 (Block33Data);
	_data33_->_ref_count_ = 1;
	_data33_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (acc);
	_g_object_unref0 (_data33_->acc);
	_data33_->acc = _tmp0_;
	_data33_->exists = FALSE;
	_tmp1_ = self->priv->listbox;
	gtk_container_foreach ((GtkContainer*) _tmp1_, ___lambda117__gtk_callback, _data33_);
	if (!_data33_->exists) {
		TootleDialogsListEditorItem* item = NULL;
		TootleDialogsListEditorItem* _tmp2_;
		GtkListBox* _tmp3_;
		TootleDialogsListEditorItem* _tmp4_;
		_tmp2_ = tootle_dialogs_list_editor_item_new (self, _data33_->acc, added);
		g_object_ref_sink (_tmp2_);
		item = _tmp2_;
		_tmp3_ = self->priv->listbox;
		_tmp4_ = item;
		gtk_list_box_insert (_tmp3_, (GtkWidget*) _tmp4_, order);
		_g_object_unref0 (item);
	}
	block33_data_unref (_data33_);
	_data33_ = NULL;
}

static void
__lambda120_ (TootleDialogsListEditor* self,
              GtkWidget* w)
{
	TootleDialogsListEditorItem* i = NULL;
	TootleDialogsListEditorItem* _tmp0_;
	TootleDialogsListEditorItem* _tmp1_;
	g_return_if_fail (w != NULL);
	_tmp0_ = _g_object_ref0 (TOOTLE_DIALOGS_LIST_EDITOR_IS_ITEM (w) ? ((TootleDialogsListEditorItem*) w) : NULL);
	i = _tmp0_;
	_tmp1_ = i;
	if (_tmp1_ != NULL) {
		TootleDialogsListEditorItem* _tmp2_;
		gboolean _tmp3_;
		gboolean _tmp4_;
		_tmp2_ = i;
		_tmp3_ = tootle_dialogs_list_editor_item_get_committed (_tmp2_);
		_tmp4_ = _tmp3_;
		if (!_tmp4_) {
			TootleDialogsListEditorItem* _tmp5_;
			_tmp5_ = i;
			gtk_widget_destroy ((GtkWidget*) _tmp5_);
		}
	}
	_g_object_unref0 (i);
}

static void
___lambda120__gtk_callback (GtkWidget* widget,
                            gpointer self)
{
	__lambda120_ ((TootleDialogsListEditor*) self, widget);
}

static void
tootle_dialogs_list_editor_invalidate (TootleDialogsListEditor* self)
{
	GtkListBox* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->listbox;
	gtk_container_foreach ((GtkContainer*) _tmp0_, ___lambda120__gtk_callback, self);
}

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

static void
tootle_dialogs_list_editor_validate (TootleDialogsListEditor* self)
{
	gboolean has_title = FALSE;
	GtkEntry* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gboolean _tmp5_;
	GtkButton* _tmp6_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->name_entry;
	_tmp1_ = gtk_entry_get_text (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = string_replace (_tmp2_, " ", "");
	_tmp4_ = _tmp3_;
	_tmp5_ = g_strcmp0 (_tmp4_, "") != 0;
	_g_free0 (_tmp4_);
	has_title = _tmp5_;
	_tmp6_ = self->priv->save_btn;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp6_, has_title);
}

static void
_tootle_dialogs_list_editor_validate_gtk_editable_changed (GtkEditable* _sender,
                                                           gpointer self)
{
	tootle_dialogs_list_editor_validate ((TootleDialogsListEditor*) self);
}

static void
tootle_dialogs_list_editor_on_cancel_clicked (TootleDialogsListEditor* self)
{
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_dirty;
	if (_tmp0_) {
		gboolean yes = FALSE;
		TootleApplication* _tmp1_;
		_tmp1_ = tootle_app;
		yes = tootle_application_question (_tmp1_, _ ("Discard changes?"), _ ("You need to save the list if you want to keep them."), (GtkWindow*) self);
		if (yes) {
			gtk_widget_destroy ((GtkWidget*) self);
		}
	} else {
		gtk_widget_destroy ((GtkWidget*) self);
	}
}

static void
_tootle_dialogs_list_editor_on_cancel_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                  gpointer self)
{
	tootle_dialogs_list_editor_on_cancel_clicked ((TootleDialogsListEditor*) self);
}

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

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

static void
tootle_dialogs_list_editor_on_search_changed (TootleDialogsListEditor* self)
{
	gchar* q = NULL;
	GtkSearchEntry* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	const gchar* _tmp7_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->search_entry;
	_tmp1_ = gtk_entry_get_text ((GtkEntry*) _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = string_chug (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = string_chomp (_tmp4_);
	_tmp6_ = _tmp5_;
	_g_free0 (_tmp4_);
	q = _tmp6_;
	_tmp7_ = q;
	if (g_utf8_strlen (_tmp7_, (gssize) -1) < 3) {
		tootle_dialogs_list_editor_invalidate (self);
	} else {
		const gchar* _tmp8_;
		_tmp8_ = q;
		if (g_strcmp0 (_tmp8_, "") != 0) {
			const gchar* _tmp9_;
			tootle_dialogs_list_editor_invalidate (self);
			_tmp9_ = q;
			tootle_dialogs_list_editor_request_search (self, _tmp9_);
		}
	}
	_g_free0 (q);
}

static void
_tootle_dialogs_list_editor_on_search_changed_gtk_search_entry_search_changed (GtkSearchEntry* _sender,
                                                                               gpointer self)
{
	tootle_dialogs_list_editor_on_search_changed ((TootleDialogsListEditor*) self);
}

static void
__lambda121_ (TootleDialogsListEditor* self,
              GObject* obj,
              GAsyncResult* res)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (res != NULL);
	{
		tootle_dialogs_list_editor_transaction_finish (self, res, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		g_signal_emit (self, tootle_dialogs_list_editor_signals[TOOTLE_DIALOGS_LIST_EDITOR_DONE_SIGNAL], 0);
		gtk_widget_destroy ((GtkWidget*) self);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp0_;
		const gchar* _tmp1_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		tootle_dialogs_list_editor_set_working (self, FALSE);
		_tmp0_ = e;
		_tmp1_ = _tmp0_->message;
		tootle_dialogs_list_editor_on_error (self, (gint32) 0, _tmp1_);
		_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
___lambda121__gasync_ready_callback (GObject* source_object,
                                     GAsyncResult* res,
                                     gpointer self)
{
	__lambda121_ ((TootleDialogsListEditor*) self, source_object, res);
	g_object_unref (self);
}

static void
tootle_dialogs_list_editor_on_save_clicked (TootleDialogsListEditor* self)
{
	g_return_if_fail (self != NULL);
	tootle_dialogs_list_editor_set_working (self, TRUE);
	tootle_dialogs_list_editor_transaction (self, ___lambda121__gasync_ready_callback, g_object_ref (self));
}

static void
_tootle_dialogs_list_editor_on_save_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                gpointer self)
{
	tootle_dialogs_list_editor_on_save_clicked ((TootleDialogsListEditor*) self);
}

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

static void
tootle_dialogs_list_editor_transaction (TootleDialogsListEditor* self,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_)
{
	TootleDialogsListEditorTransactionData* _data_;
	TootleDialogsListEditor* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (TootleDialogsListEditorTransactionData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, tootle_dialogs_list_editor_transaction_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	tootle_dialogs_list_editor_transaction_co (_data_);
}

static void
tootle_dialogs_list_editor_transaction_finish (TootleDialogsListEditor* self,
                                               GAsyncResult* _res_,
                                               GError** error)
{
	TootleDialogsListEditorTransactionData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
tootle_dialogs_list_editor_transaction_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_)
{
	TootleDialogsListEditorTransactionData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	tootle_dialogs_list_editor_transaction_co (_data_);
}

static void
_vala_JsonNode_free (JsonNode* self)
{
	g_boxed_free (json_node_get_type (), self);
}

static gboolean
tootle_dialogs_list_editor_transaction_co (TootleDialogsListEditorTransactionData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		case 4:
		goto _state_4;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->_exists;
	if (!_data_->_tmp0_) {
		g_message ("ListEditor.vala:243: Creating list...");
		_data_->_tmp1_ = tootle_request_new_POST ("/api/v1/lists");
		_data_->_tmp2_ = _data_->_tmp1_;
		_data_->_tmp3_ = tootle_accounts;
		_data_->_tmp4_ = tootle_accounts_get_active (_data_->_tmp3_);
		_data_->_tmp5_ = _data_->_tmp4_;
		_data_->_tmp6_ = tootle_request_with_account (_data_->_tmp2_, _data_->_tmp5_);
		_data_->_tmp7_ = _data_->_tmp6_;
		_data_->_tmp8_ = _data_->self->priv->name_entry;
		_data_->_tmp9_ = gtk_entry_get_text (_data_->_tmp8_);
		_data_->_tmp10_ = _data_->_tmp9_;
		_data_->_tmp11_ = tootle_request_with_param (_data_->_tmp7_, "title", _data_->_tmp10_);
		_data_->_tmp12_ = _data_->_tmp11_;
		_g_object_unref0 (_data_->_tmp7_);
		_g_object_unref0 (_data_->_tmp2_);
		_data_->req = _data_->_tmp12_;
		_data_->_tmp13_ = _data_->req;
		_data_->_state_ = 1;
		tootle_request_await (_data_->_tmp13_, tootle_dialogs_list_editor_transaction_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp14_ = tootle_request_await_finish (_data_->_tmp13_, _data_->_res_, &_data_->_inner_error0_);
		_data_->_tmp15_ = _data_->_tmp14_;
		_g_object_unref0 (_data_->_tmp15_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->req);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		g_message ("ListEditor.vala:249: Received new List entity");
		_data_->_tmp16_ = tootle_network;
		_data_->_tmp17_ = _data_->req;
		_data_->_tmp18_ = tootle_network_parse_node (_data_->_tmp16_, (SoupMessage*) _data_->_tmp17_, &_data_->_inner_error0_);
		_data_->node = _data_->_tmp18_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->req);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp20_ = _data_->node;
		_data_->_tmp21_ = tootle_api_list_from (_data_->_tmp20_, &_data_->_inner_error0_);
		_data_->_tmp19_ = _data_->_tmp21_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			__vala_JsonNode_free0 (_data_->node);
			_g_object_unref0 (_data_->req);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		tootle_dialogs_list_editor_set_list (_data_->self, _data_->_tmp19_);
		_g_object_unref0 (_data_->_tmp19_);
		__vala_JsonNode_free0 (_data_->node);
		_g_object_unref0 (_data_->req);
	} else {
		g_message ("ListEditor.vala:254: Updating list title...");
		_data_->_tmp22_ = _data_->self->priv->_list;
		_data_->_tmp23_ = tootle_api_list_get_id (_data_->_tmp22_);
		_data_->_tmp24_ = _data_->_tmp23_;
		_data_->_tmp25_ = string_to_string (_data_->_tmp24_);
		_data_->_tmp26_ = g_strconcat ("/api/v1/lists/", _data_->_tmp25_, NULL);
		_data_->_tmp27_ = _data_->_tmp26_;
		_data_->_tmp28_ = tootle_request_new_PUT (_data_->_tmp27_);
		_data_->_tmp29_ = _data_->_tmp28_;
		_data_->_tmp30_ = tootle_accounts;
		_data_->_tmp31_ = tootle_accounts_get_active (_data_->_tmp30_);
		_data_->_tmp32_ = _data_->_tmp31_;
		_data_->_tmp33_ = tootle_request_with_account (_data_->_tmp29_, _data_->_tmp32_);
		_data_->_tmp34_ = _data_->_tmp33_;
		_data_->_tmp35_ = _data_->self->priv->name_entry;
		_data_->_tmp36_ = gtk_entry_get_text (_data_->_tmp35_);
		_data_->_tmp37_ = _data_->_tmp36_;
		_data_->_tmp38_ = tootle_request_with_param (_data_->_tmp34_, "title", _data_->_tmp37_);
		_data_->_tmp39_ = _data_->_tmp38_;
		_data_->_state_ = 2;
		tootle_request_await (_data_->_tmp39_, tootle_dialogs_list_editor_transaction_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp40_ = tootle_request_await_finish (_data_->_tmp39_, _data_->_res_, &_data_->_inner_error0_);
		_data_->_tmp41_ = _data_->_tmp40_;
		_g_object_unref0 (_data_->_tmp41_);
		_g_object_unref0 (_data_->_tmp39_);
		_g_object_unref0 (_data_->_tmp34_);
		_g_object_unref0 (_data_->_tmp29_);
		_g_free0 (_data_->_tmp27_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	_data_->_tmp42_ = _data_->self->to_add;
	_data_->_tmp43_ = gee_collection_get_is_empty ((GeeCollection*) _data_->_tmp42_);
	_data_->_tmp44_ = _data_->_tmp43_;
	if (!_data_->_tmp44_) {
		g_message ("ListEditor.vala:262: Adding accounts to list...");
		_data_->_tmp45_ = _data_->self->to_add;
		_data_->_tmp46_ = tootle_request_array2string (_data_->_tmp45_, "account_ids");
		_data_->id_array = _data_->_tmp46_;
		_data_->_tmp47_ = _data_->self->priv->_list;
		_data_->_tmp48_ = tootle_api_list_get_id (_data_->_tmp47_);
		_data_->_tmp49_ = _data_->_tmp48_;
		_data_->_tmp50_ = string_to_string (_data_->_tmp49_);
		_data_->_tmp51_ = _data_->id_array;
		_data_->_tmp52_ = string_to_string (_data_->_tmp51_);
		_data_->_tmp53_ = g_strconcat ("/api/v1/lists/", _data_->_tmp50_, "/accounts/?", _data_->_tmp52_, NULL);
		_data_->_tmp54_ = _data_->_tmp53_;
		_data_->_tmp55_ = tootle_request_new_POST (_data_->_tmp54_);
		_data_->_tmp56_ = _data_->_tmp55_;
		_data_->_tmp57_ = tootle_accounts;
		_data_->_tmp58_ = tootle_accounts_get_active (_data_->_tmp57_);
		_data_->_tmp59_ = _data_->_tmp58_;
		_data_->_tmp60_ = tootle_request_with_account (_data_->_tmp56_, _data_->_tmp59_);
		_data_->_tmp61_ = _data_->_tmp60_;
		_data_->_state_ = 3;
		tootle_request_await (_data_->_tmp61_, tootle_dialogs_list_editor_transaction_ready, _data_);
		return FALSE;
		_state_3:
		_data_->_tmp62_ = tootle_request_await_finish (_data_->_tmp61_, _data_->_res_, &_data_->_inner_error0_);
		_data_->_tmp63_ = _data_->_tmp62_;
		_g_object_unref0 (_data_->_tmp63_);
		_g_object_unref0 (_data_->_tmp61_);
		_g_object_unref0 (_data_->_tmp56_);
		_g_free0 (_data_->_tmp54_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_free0 (_data_->id_array);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_g_free0 (_data_->id_array);
	}
	_data_->_tmp64_ = _data_->self->to_remove;
	_data_->_tmp65_ = gee_collection_get_is_empty ((GeeCollection*) _data_->_tmp64_);
	_data_->_tmp66_ = _data_->_tmp65_;
	if (!_data_->_tmp66_) {
		g_message ("ListEditor.vala:270: Removing accounts from list...");
		_data_->_tmp67_ = _data_->self->to_remove;
		_data_->_tmp68_ = tootle_request_array2string (_data_->_tmp67_, "account_ids");
		_data_->_vala1_id_array = _data_->_tmp68_;
		_data_->_tmp69_ = _data_->self->priv->_list;
		_data_->_tmp70_ = tootle_api_list_get_id (_data_->_tmp69_);
		_data_->_tmp71_ = _data_->_tmp70_;
		_data_->_tmp72_ = string_to_string (_data_->_tmp71_);
		_data_->_tmp73_ = _data_->_vala1_id_array;
		_data_->_tmp74_ = string_to_string (_data_->_tmp73_);
		_data_->_tmp75_ = g_strconcat ("/api/v1/lists/", _data_->_tmp72_, "/accounts/?", _data_->_tmp74_, NULL);
		_data_->_tmp76_ = _data_->_tmp75_;
		_data_->_tmp77_ = tootle_request_new_DELETE (_data_->_tmp76_);
		_data_->_tmp78_ = _data_->_tmp77_;
		_data_->_tmp79_ = tootle_accounts;
		_data_->_tmp80_ = tootle_accounts_get_active (_data_->_tmp79_);
		_data_->_tmp81_ = _data_->_tmp80_;
		_data_->_tmp82_ = tootle_request_with_account (_data_->_tmp78_, _data_->_tmp81_);
		_data_->_tmp83_ = _data_->_tmp82_;
		_data_->_state_ = 4;
		tootle_request_await (_data_->_tmp83_, tootle_dialogs_list_editor_transaction_ready, _data_);
		return FALSE;
		_state_4:
		_data_->_tmp84_ = tootle_request_await_finish (_data_->_tmp83_, _data_->_res_, &_data_->_inner_error0_);
		_data_->_tmp85_ = _data_->_tmp84_;
		_g_object_unref0 (_data_->_tmp85_);
		_g_object_unref0 (_data_->_tmp83_);
		_g_object_unref0 (_data_->_tmp78_);
		_g_free0 (_data_->_tmp76_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_free0 (_data_->_vala1_id_array);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_g_free0 (_data_->_vala1_id_array);
	}
	g_message ("ListEditor.vala:277: OK: List updated");
	_data_->_tmp86_ = _data_->self->priv->_list;
	_data_->_tmp87_ = _data_->self->priv->name_entry;
	_data_->_tmp88_ = gtk_entry_get_text (_data_->_tmp87_);
	_data_->_tmp89_ = _data_->_tmp88_;
	tootle_api_list_set_title (_data_->_tmp86_, _data_->_tmp89_);
	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;
}

TootleAPIList*
tootle_dialogs_list_editor_get_list (TootleDialogsListEditor* self)
{
	TootleAPIList* result;
	TootleAPIList* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_list;
	result = _tmp0_;
	return result;
}

void
tootle_dialogs_list_editor_set_list (TootleDialogsListEditor* self,
                                     TootleAPIList* value)
{
	TootleAPIList* old_value;
	g_return_if_fail (self != NULL);
	old_value = tootle_dialogs_list_editor_get_list (self);
	if (old_value != value) {
		TootleAPIList* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_list);
		self->priv->_list = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tootle_dialogs_list_editor_properties[TOOTLE_DIALOGS_LIST_EDITOR_LIST_PROPERTY]);
	}
}

gboolean
tootle_dialogs_list_editor_get_working (TootleDialogsListEditor* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_working;
	return result;
}

void
tootle_dialogs_list_editor_set_working (TootleDialogsListEditor* self,
                                        gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = tootle_dialogs_list_editor_get_working (self);
	if (old_value != value) {
		self->priv->_working = value;
		g_object_notify_by_pspec ((GObject *) self, tootle_dialogs_list_editor_properties[TOOTLE_DIALOGS_LIST_EDITOR_WORKING_PROPERTY]);
	}
}

gboolean
tootle_dialogs_list_editor_get_exists (TootleDialogsListEditor* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_exists;
	return result;
}

void
tootle_dialogs_list_editor_set_exists (TootleDialogsListEditor* self,
                                       gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = tootle_dialogs_list_editor_get_exists (self);
	if (old_value != value) {
		self->priv->_exists = value;
		g_object_notify_by_pspec ((GObject *) self, tootle_dialogs_list_editor_properties[TOOTLE_DIALOGS_LIST_EDITOR_EXISTS_PROPERTY]);
	}
}

gboolean
tootle_dialogs_list_editor_get_dirty (TootleDialogsListEditor* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_dirty;
	return result;
}

void
tootle_dialogs_list_editor_set_dirty (TootleDialogsListEditor* self,
                                      gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = tootle_dialogs_list_editor_get_dirty (self);
	if (old_value != value) {
		self->priv->_dirty = value;
		g_object_notify_by_pspec ((GObject *) self, tootle_dialogs_list_editor_properties[TOOTLE_DIALOGS_LIST_EDITOR_DIRTY_PROPERTY]);
	}
}

static inline gpointer
tootle_dialogs_list_editor_item_get_instance_private (TootleDialogsListEditorItem* self)
{
	return G_STRUCT_MEMBER_P (self, TootleDialogsListEditorItem_private_offset);
}

static TootleDialogsListEditorItem*
tootle_dialogs_list_editor_item_construct (GType object_type,
                                           TootleDialogsListEditor* editor,
                                           TootleAPIAccount* acc,
                                           gboolean committed)
{
	TootleDialogsListEditorItem * self = NULL;
	TootleWidgetsRichLabel* _tmp0_;
	TootleWidgetsRichLabel* _tmp1_;
	GtkToggleButton* _tmp2_;
	GtkToggleButton* _tmp3_;
	g_return_val_if_fail (editor != NULL, NULL);
	g_return_val_if_fail (acc != NULL, NULL);
	self = (TootleDialogsListEditorItem*) g_object_new (object_type, NULL);
	tootle_dialogs_list_editor_item_set_editor (self, editor);
	tootle_dialogs_list_editor_item_set_acc (self, acc);
	tootle_dialogs_list_editor_item_set_committed (self, committed);
	_tmp0_ = self->priv->label;
	g_object_bind_property_with_closures ((GObject*) acc, "display-name", (GObject*) _tmp0_, "text", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp1_ = self->priv->handle;
	g_object_bind_property_with_closures ((GObject*) acc, "handle", (GObject*) _tmp1_, "text", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp2_ = self->priv->status;
	gtk_toggle_button_set_active (_tmp2_, committed);
	_tmp3_ = self->priv->status;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp3_, TRUE);
	return self;
}

static TootleDialogsListEditorItem*
tootle_dialogs_list_editor_item_new (TootleDialogsListEditor* editor,
                                     TootleAPIAccount* acc,
                                     gboolean committed)
{
	return tootle_dialogs_list_editor_item_construct (TOOTLE_DIALOGS_LIST_EDITOR_TYPE_ITEM, editor, acc, committed);
}

static void
tootle_dialogs_list_editor_item_on_toggled (TootleDialogsListEditorItem* self)
{
	GtkToggleButton* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	GtkToggleButton* _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	GtkToggleButton* _tmp38_;
	gboolean _tmp39_;
	gboolean _tmp40_;
	TootleDialogsListEditor* _tmp41_;
	gboolean _tmp42_;
	gboolean _tmp43_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->status;
	_tmp1_ = gtk_widget_get_sensitive ((GtkWidget*) _tmp0_);
	_tmp2_ = _tmp1_;
	if (!_tmp2_) {
		return;
	}
	_tmp3_ = self->priv->status;
	_tmp4_ = gtk_toggle_button_get_active (_tmp3_);
	_tmp5_ = _tmp4_;
	if (_tmp5_) {
		TootleAPIAccount* _tmp6_;
		const gchar* _tmp7_;
		const gchar* _tmp8_;
		const gchar* _tmp9_;
		gchar* _tmp10_;
		gchar* _tmp11_;
		TootleDialogsListEditor* _tmp12_;
		GeeArrayList* _tmp13_;
		TootleAPIAccount* _tmp14_;
		const gchar* _tmp15_;
		const gchar* _tmp16_;
		TootleDialogsListEditor* _tmp17_;
		GeeArrayList* _tmp18_;
		TootleAPIAccount* _tmp19_;
		const gchar* _tmp20_;
		const gchar* _tmp21_;
		_tmp6_ = self->priv->_acc;
		_tmp7_ = tootle_api_account_get_id (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = string_to_string (_tmp8_);
		_tmp10_ = g_strconcat ("To add: ", _tmp9_, NULL);
		_tmp11_ = _tmp10_;
		g_debug ("ListEditor.vala:36: %s", _tmp11_);
		_g_free0 (_tmp11_);
		_tmp12_ = self->priv->_editor;
		_tmp13_ = _tmp12_->to_add;
		_tmp14_ = self->priv->_acc;
		_tmp15_ = tootle_api_account_get_id (_tmp14_);
		_tmp16_ = _tmp15_;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp13_, _tmp16_);
		_tmp17_ = self->priv->_editor;
		_tmp18_ = _tmp17_->to_remove;
		_tmp19_ = self->priv->_acc;
		_tmp20_ = tootle_api_account_get_id (_tmp19_);
		_tmp21_ = _tmp20_;
		gee_abstract_collection_remove ((GeeAbstractCollection*) _tmp18_, _tmp21_);
	} else {
		TootleAPIAccount* _tmp22_;
		const gchar* _tmp23_;
		const gchar* _tmp24_;
		const gchar* _tmp25_;
		gchar* _tmp26_;
		gchar* _tmp27_;
		TootleDialogsListEditor* _tmp28_;
		GeeArrayList* _tmp29_;
		TootleAPIAccount* _tmp30_;
		const gchar* _tmp31_;
		const gchar* _tmp32_;
		TootleDialogsListEditor* _tmp33_;
		GeeArrayList* _tmp34_;
		TootleAPIAccount* _tmp35_;
		const gchar* _tmp36_;
		const gchar* _tmp37_;
		_tmp22_ = self->priv->_acc;
		_tmp23_ = tootle_api_account_get_id (_tmp22_);
		_tmp24_ = _tmp23_;
		_tmp25_ = string_to_string (_tmp24_);
		_tmp26_ = g_strconcat ("To remove: ", _tmp25_, NULL);
		_tmp27_ = _tmp26_;
		g_debug ("ListEditor.vala:41: %s", _tmp27_);
		_g_free0 (_tmp27_);
		_tmp28_ = self->priv->_editor;
		_tmp29_ = _tmp28_->to_add;
		_tmp30_ = self->priv->_acc;
		_tmp31_ = tootle_api_account_get_id (_tmp30_);
		_tmp32_ = _tmp31_;
		gee_abstract_collection_remove ((GeeAbstractCollection*) _tmp29_, _tmp32_);
		_tmp33_ = self->priv->_editor;
		_tmp34_ = _tmp33_->to_remove;
		_tmp35_ = self->priv->_acc;
		_tmp36_ = tootle_api_account_get_id (_tmp35_);
		_tmp37_ = _tmp36_;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp34_, _tmp37_);
	}
	_tmp38_ = self->priv->status;
	_tmp39_ = gtk_toggle_button_get_active (_tmp38_);
	_tmp40_ = _tmp39_;
	tootle_dialogs_list_editor_item_set_committed (self, _tmp40_);
	_tmp41_ = self->priv->_editor;
	_tmp42_ = tootle_dialogs_list_editor_get_working (_tmp41_);
	_tmp43_ = _tmp42_;
	if (!_tmp43_) {
		TootleDialogsListEditor* _tmp44_;
		_tmp44_ = self->priv->_editor;
		tootle_dialogs_list_editor_set_dirty (_tmp44_, TRUE);
	}
}

static void
_tootle_dialogs_list_editor_item_on_toggled_gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                                       gpointer self)
{
	tootle_dialogs_list_editor_item_on_toggled ((TootleDialogsListEditorItem*) self);
}

static TootleDialogsListEditor*
tootle_dialogs_list_editor_item_get_editor (TootleDialogsListEditorItem* self)
{
	TootleDialogsListEditor* result;
	TootleDialogsListEditor* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_editor;
	result = _tmp0_;
	return result;
}

static void
tootle_dialogs_list_editor_item_set_editor (TootleDialogsListEditorItem* self,
                                            TootleDialogsListEditor* value)
{
	TootleDialogsListEditor* old_value;
	g_return_if_fail (self != NULL);
	old_value = tootle_dialogs_list_editor_item_get_editor (self);
	if (old_value != value) {
		TootleDialogsListEditor* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_editor);
		self->priv->_editor = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tootle_dialogs_list_editor_item_properties[TOOTLE_DIALOGS_LIST_EDITOR_ITEM_EDITOR_PROPERTY]);
	}
}

static TootleAPIAccount*
tootle_dialogs_list_editor_item_get_acc (TootleDialogsListEditorItem* self)
{
	TootleAPIAccount* result;
	TootleAPIAccount* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_acc;
	result = _tmp0_;
	return result;
}

static void
tootle_dialogs_list_editor_item_set_acc (TootleDialogsListEditorItem* self,
                                         TootleAPIAccount* value)
{
	TootleAPIAccount* old_value;
	g_return_if_fail (self != NULL);
	old_value = tootle_dialogs_list_editor_item_get_acc (self);
	if (old_value != value) {
		TootleAPIAccount* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_acc);
		self->priv->_acc = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tootle_dialogs_list_editor_item_properties[TOOTLE_DIALOGS_LIST_EDITOR_ITEM_ACC_PROPERTY]);
	}
}

static gboolean
tootle_dialogs_list_editor_item_get_committed (TootleDialogsListEditorItem* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_committed;
	return result;
}

static void
tootle_dialogs_list_editor_item_set_committed (TootleDialogsListEditorItem* self,
                                               gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = tootle_dialogs_list_editor_item_get_committed (self);
	if (old_value != value) {
		self->priv->_committed = value;
		g_object_notify_by_pspec ((GObject *) self, tootle_dialogs_list_editor_item_properties[TOOTLE_DIALOGS_LIST_EDITOR_ITEM_COMMITTED_PROPERTY]);
	}
}

static void
tootle_dialogs_list_editor_item_class_init (TootleDialogsListEditorItemClass * klass,
                                            gpointer klass_data)
{
	tootle_dialogs_list_editor_item_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TootleDialogsListEditorItem_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_tootle_dialogs_list_editor_item_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tootle_dialogs_list_editor_item_set_property;
	G_OBJECT_CLASS (klass)->finalize = tootle_dialogs_list_editor_item_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TOOTLE_DIALOGS_LIST_EDITOR_ITEM_EDITOR_PROPERTY, tootle_dialogs_list_editor_item_properties[TOOTLE_DIALOGS_LIST_EDITOR_ITEM_EDITOR_PROPERTY] = g_param_spec_object ("editor", "editor", "editor", TOOTLE_DIALOGS_TYPE_LIST_EDITOR, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TOOTLE_DIALOGS_LIST_EDITOR_ITEM_ACC_PROPERTY, tootle_dialogs_list_editor_item_properties[TOOTLE_DIALOGS_LIST_EDITOR_ITEM_ACC_PROPERTY] = g_param_spec_object ("acc", "acc", "acc", TOOTLE_API_TYPE_ACCOUNT, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TOOTLE_DIALOGS_LIST_EDITOR_ITEM_COMMITTED_PROPERTY, tootle_dialogs_list_editor_item_properties[TOOTLE_DIALOGS_LIST_EDITOR_ITEM_COMMITTED_PROPERTY] = g_param_spec_boolean ("committed", "committed", "committed", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/com/github/bleakgrey/tootle/ui/widgets/list_editor_item.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "label", FALSE, TootleDialogsListEditorItem_private_offset + G_STRUCT_OFFSET (TootleDialogsListEditorItemPrivate, label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "handle", FALSE, TootleDialogsListEditorItem_private_offset + G_STRUCT_OFFSET (TootleDialogsListEditorItemPrivate, handle));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "status", FALSE, TootleDialogsListEditorItem_private_offset + G_STRUCT_OFFSET (TootleDialogsListEditorItemPrivate, status));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_toggled", G_CALLBACK(_tootle_dialogs_list_editor_item_on_toggled_gtk_toggle_button_toggled));
}

static void
tootle_dialogs_list_editor_item_instance_init (TootleDialogsListEditorItem * self,
                                               gpointer klass)
{
	self->priv = tootle_dialogs_list_editor_item_get_instance_private (self);
	g_type_ensure (TOOTLE_WIDGETS_TYPE_RICH_LABEL);
	g_type_ensure (TOOTLE_WIDGETS_TYPE_RICH_LABEL);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
tootle_dialogs_list_editor_item_finalize (GObject * obj)
{
	TootleDialogsListEditorItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TOOTLE_DIALOGS_LIST_EDITOR_TYPE_ITEM, TootleDialogsListEditorItem);
	_g_object_unref0 (self->priv->_editor);
	_g_object_unref0 (self->priv->_acc);
	G_OBJECT_CLASS (tootle_dialogs_list_editor_item_parent_class)->finalize (obj);
}

static GType
tootle_dialogs_list_editor_item_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TootleDialogsListEditorItemClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tootle_dialogs_list_editor_item_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TootleDialogsListEditorItem), 0, (GInstanceInitFunc) tootle_dialogs_list_editor_item_instance_init, NULL };
	GType tootle_dialogs_list_editor_item_type_id;
	tootle_dialogs_list_editor_item_type_id = g_type_register_static (gtk_list_box_row_get_type (), "TootleDialogsListEditorItem", &g_define_type_info, 0);
	TootleDialogsListEditorItem_private_offset = g_type_add_instance_private (tootle_dialogs_list_editor_item_type_id, sizeof (TootleDialogsListEditorItemPrivate));
	return tootle_dialogs_list_editor_item_type_id;
}

static GType
tootle_dialogs_list_editor_item_get_type (void)
{
	static volatile gsize tootle_dialogs_list_editor_item_type_id__volatile = 0;
	if (g_once_init_enter (&tootle_dialogs_list_editor_item_type_id__volatile)) {
		GType tootle_dialogs_list_editor_item_type_id;
		tootle_dialogs_list_editor_item_type_id = tootle_dialogs_list_editor_item_get_type_once ();
		g_once_init_leave (&tootle_dialogs_list_editor_item_type_id__volatile, tootle_dialogs_list_editor_item_type_id);
	}
	return tootle_dialogs_list_editor_item_type_id__volatile;
}

static void
_vala_tootle_dialogs_list_editor_item_get_property (GObject * object,
                                                    guint property_id,
                                                    GValue * value,
                                                    GParamSpec * pspec)
{
	TootleDialogsListEditorItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TOOTLE_DIALOGS_LIST_EDITOR_TYPE_ITEM, TootleDialogsListEditorItem);
	switch (property_id) {
		case TOOTLE_DIALOGS_LIST_EDITOR_ITEM_EDITOR_PROPERTY:
		g_value_set_object (value, tootle_dialogs_list_editor_item_get_editor (self));
		break;
		case TOOTLE_DIALOGS_LIST_EDITOR_ITEM_ACC_PROPERTY:
		g_value_set_object (value, tootle_dialogs_list_editor_item_get_acc (self));
		break;
		case TOOTLE_DIALOGS_LIST_EDITOR_ITEM_COMMITTED_PROPERTY:
		g_value_set_boolean (value, tootle_dialogs_list_editor_item_get_committed (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tootle_dialogs_list_editor_item_set_property (GObject * object,
                                                    guint property_id,
                                                    const GValue * value,
                                                    GParamSpec * pspec)
{
	TootleDialogsListEditorItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TOOTLE_DIALOGS_LIST_EDITOR_TYPE_ITEM, TootleDialogsListEditorItem);
	switch (property_id) {
		case TOOTLE_DIALOGS_LIST_EDITOR_ITEM_EDITOR_PROPERTY:
		tootle_dialogs_list_editor_item_set_editor (self, g_value_get_object (value));
		break;
		case TOOTLE_DIALOGS_LIST_EDITOR_ITEM_ACC_PROPERTY:
		tootle_dialogs_list_editor_item_set_acc (self, g_value_get_object (value));
		break;
		case TOOTLE_DIALOGS_LIST_EDITOR_ITEM_COMMITTED_PROPERTY:
		tootle_dialogs_list_editor_item_set_committed (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static GObject *
tootle_dialogs_list_editor_constructor (GType type,
                                        guint n_construct_properties,
                                        GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	TootleDialogsListEditor * self;
	TootleDialogsMainWindow* _tmp0_;
	parent_class = G_OBJECT_CLASS (tootle_dialogs_list_editor_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TOOTLE_DIALOGS_TYPE_LIST_EDITOR, TootleDialogsListEditor);
	_tmp0_ = tootle_window;
	gtk_window_set_transient_for ((GtkWindow*) self, (GtkWindow*) _tmp0_);
	gtk_widget_show ((GtkWidget*) self);
	return obj;
}

static void
tootle_dialogs_list_editor_class_init (TootleDialogsListEditorClass * klass,
                                       gpointer klass_data)
{
	tootle_dialogs_list_editor_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TootleDialogsListEditor_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_tootle_dialogs_list_editor_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tootle_dialogs_list_editor_set_property;
	G_OBJECT_CLASS (klass)->constructor = tootle_dialogs_list_editor_constructor;
	G_OBJECT_CLASS (klass)->finalize = tootle_dialogs_list_editor_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TOOTLE_DIALOGS_LIST_EDITOR_LIST_PROPERTY, tootle_dialogs_list_editor_properties[TOOTLE_DIALOGS_LIST_EDITOR_LIST_PROPERTY] = g_param_spec_object ("list", "list", "list", TOOTLE_API_TYPE_LIST, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TOOTLE_DIALOGS_LIST_EDITOR_WORKING_PROPERTY, tootle_dialogs_list_editor_properties[TOOTLE_DIALOGS_LIST_EDITOR_WORKING_PROPERTY] = g_param_spec_boolean ("working", "working", "working", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TOOTLE_DIALOGS_LIST_EDITOR_EXISTS_PROPERTY, tootle_dialogs_list_editor_properties[TOOTLE_DIALOGS_LIST_EDITOR_EXISTS_PROPERTY] = g_param_spec_boolean ("exists", "exists", "exists", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TOOTLE_DIALOGS_LIST_EDITOR_DIRTY_PROPERTY, tootle_dialogs_list_editor_properties[TOOTLE_DIALOGS_LIST_EDITOR_DIRTY_PROPERTY] = g_param_spec_boolean ("dirty", "dirty", "dirty", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/com/github/bleakgrey/tootle/ui/dialogs/list_editor.ui");
	tootle_dialogs_list_editor_signals[TOOTLE_DIALOGS_LIST_EDITOR_DONE_SIGNAL] = g_signal_new ("done", TOOTLE_DIALOGS_TYPE_LIST_EDITOR, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "save_btn", FALSE, TootleDialogsListEditor_private_offset + G_STRUCT_OFFSET (TootleDialogsListEditorPrivate, save_btn));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "save_btn_stack", FALSE, TootleDialogsListEditor_private_offset + G_STRUCT_OFFSET (TootleDialogsListEditorPrivate, save_btn_stack));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "name_entry", FALSE, TootleDialogsListEditor_private_offset + G_STRUCT_OFFSET (TootleDialogsListEditorPrivate, name_entry));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "search_entry", FALSE, TootleDialogsListEditor_private_offset + G_STRUCT_OFFSET (TootleDialogsListEditorPrivate, search_entry));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "listbox", FALSE, TootleDialogsListEditor_private_offset + G_STRUCT_OFFSET (TootleDialogsListEditorPrivate, listbox));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "infobar", FALSE, TootleDialogsListEditor_private_offset + G_STRUCT_OFFSET (TootleDialogsListEditorPrivate, infobar));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "infobar_label", FALSE, TootleDialogsListEditor_private_offset + G_STRUCT_OFFSET (TootleDialogsListEditorPrivate, infobar_label));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "infobar_response", G_CALLBACK(_tootle_dialogs_list_editor_infobar_response_gtk_info_bar_response));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "validate", G_CALLBACK(_tootle_dialogs_list_editor_validate_gtk_editable_changed));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_cancel_clicked", G_CALLBACK(_tootle_dialogs_list_editor_on_cancel_clicked_gtk_button_clicked));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_search_changed", G_CALLBACK(_tootle_dialogs_list_editor_on_search_changed_gtk_search_entry_search_changed));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_save_clicked", G_CALLBACK(_tootle_dialogs_list_editor_on_save_clicked_gtk_button_clicked));
}

static void
tootle_dialogs_list_editor_instance_init (TootleDialogsListEditor * self,
                                          gpointer klass)
{
	GeeArrayList* _tmp0_;
	GeeArrayList* _tmp1_;
	self->priv = tootle_dialogs_list_editor_get_instance_private (self);
	self->priv->_working = FALSE;
	self->priv->_exists = FALSE;
	self->priv->_dirty = FALSE;
	self->priv->search_req = NULL;
	_tmp0_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL);
	self->to_add = _tmp0_;
	_tmp1_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL);
	self->to_remove = _tmp1_;
	g_type_ensure (TOOTLE_WIDGETS_TYPE_RICH_LABEL);
	g_type_ensure (TOOTLE_WIDGETS_TYPE_RICH_LABEL);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
tootle_dialogs_list_editor_finalize (GObject * obj)
{
	TootleDialogsListEditor * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TOOTLE_DIALOGS_TYPE_LIST_EDITOR, TootleDialogsListEditor);
	_g_object_unref0 (self->priv->_list);
	_g_object_unref0 (self->priv->search_req);
	_g_object_unref0 (self->to_add);
	_g_object_unref0 (self->to_remove);
	G_OBJECT_CLASS (tootle_dialogs_list_editor_parent_class)->finalize (obj);
}

static GType
tootle_dialogs_list_editor_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TootleDialogsListEditorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tootle_dialogs_list_editor_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TootleDialogsListEditor), 0, (GInstanceInitFunc) tootle_dialogs_list_editor_instance_init, NULL };
	GType tootle_dialogs_list_editor_type_id;
	tootle_dialogs_list_editor_type_id = g_type_register_static (hdy_window_get_type (), "TootleDialogsListEditor", &g_define_type_info, 0);
	TootleDialogsListEditor_private_offset = g_type_add_instance_private (tootle_dialogs_list_editor_type_id, sizeof (TootleDialogsListEditorPrivate));
	return tootle_dialogs_list_editor_type_id;
}

GType
tootle_dialogs_list_editor_get_type (void)
{
	static volatile gsize tootle_dialogs_list_editor_type_id__volatile = 0;
	if (g_once_init_enter (&tootle_dialogs_list_editor_type_id__volatile)) {
		GType tootle_dialogs_list_editor_type_id;
		tootle_dialogs_list_editor_type_id = tootle_dialogs_list_editor_get_type_once ();
		g_once_init_leave (&tootle_dialogs_list_editor_type_id__volatile, tootle_dialogs_list_editor_type_id);
	}
	return tootle_dialogs_list_editor_type_id__volatile;
}

static void
_vala_tootle_dialogs_list_editor_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec)
{
	TootleDialogsListEditor * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TOOTLE_DIALOGS_TYPE_LIST_EDITOR, TootleDialogsListEditor);
	switch (property_id) {
		case TOOTLE_DIALOGS_LIST_EDITOR_LIST_PROPERTY:
		g_value_set_object (value, tootle_dialogs_list_editor_get_list (self));
		break;
		case TOOTLE_DIALOGS_LIST_EDITOR_WORKING_PROPERTY:
		g_value_set_boolean (value, tootle_dialogs_list_editor_get_working (self));
		break;
		case TOOTLE_DIALOGS_LIST_EDITOR_EXISTS_PROPERTY:
		g_value_set_boolean (value, tootle_dialogs_list_editor_get_exists (self));
		break;
		case TOOTLE_DIALOGS_LIST_EDITOR_DIRTY_PROPERTY:
		g_value_set_boolean (value, tootle_dialogs_list_editor_get_dirty (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tootle_dialogs_list_editor_set_property (GObject * object,
                                               guint property_id,
                                               const GValue * value,
                                               GParamSpec * pspec)
{
	TootleDialogsListEditor * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TOOTLE_DIALOGS_TYPE_LIST_EDITOR, TootleDialogsListEditor);
	switch (property_id) {
		case TOOTLE_DIALOGS_LIST_EDITOR_LIST_PROPERTY:
		tootle_dialogs_list_editor_set_list (self, g_value_get_object (value));
		break;
		case TOOTLE_DIALOGS_LIST_EDITOR_WORKING_PROPERTY:
		tootle_dialogs_list_editor_set_working (self, g_value_get_boolean (value));
		break;
		case TOOTLE_DIALOGS_LIST_EDITOR_EXISTS_PROPERTY:
		tootle_dialogs_list_editor_set_exists (self, g_value_get_boolean (value));
		break;
		case TOOTLE_DIALOGS_LIST_EDITOR_DIRTY_PROPERTY:
		tootle_dialogs_list_editor_set_dirty (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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;
}

