/* ListSettingsPopover.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from ListSettingsPopover.vala, do not modify */

/*
 * Copyright 2019-2023 elementary, Inc. (https://elementary.io)
 * SPDX-License-Identifier: GPL-3.0-or-later
 */

#include <gtk/gtk.h>
#include <glib-object.h>
#include <libedataserver/libedataserver.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>
#include <granite-7.h>
#include <glib/gi18n-lib.h>

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

#define TASKS_WIDGETS_TYPE_LIST_SETTINGS_POPOVER (tasks_widgets_list_settings_popover_get_type ())
#define TASKS_WIDGETS_LIST_SETTINGS_POPOVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TASKS_WIDGETS_TYPE_LIST_SETTINGS_POPOVER, TasksWidgetsListSettingsPopover))
#define TASKS_WIDGETS_LIST_SETTINGS_POPOVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TASKS_WIDGETS_TYPE_LIST_SETTINGS_POPOVER, TasksWidgetsListSettingsPopoverClass))
#define TASKS_WIDGETS_IS_LIST_SETTINGS_POPOVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TASKS_WIDGETS_TYPE_LIST_SETTINGS_POPOVER))
#define TASKS_WIDGETS_IS_LIST_SETTINGS_POPOVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TASKS_WIDGETS_TYPE_LIST_SETTINGS_POPOVER))
#define TASKS_WIDGETS_LIST_SETTINGS_POPOVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TASKS_WIDGETS_TYPE_LIST_SETTINGS_POPOVER, TasksWidgetsListSettingsPopoverClass))

typedef struct _TasksWidgetsListSettingsPopover TasksWidgetsListSettingsPopover;
typedef struct _TasksWidgetsListSettingsPopoverClass TasksWidgetsListSettingsPopoverClass;
typedef struct _TasksWidgetsListSettingsPopoverPrivate TasksWidgetsListSettingsPopoverPrivate;
enum  {
	TASKS_WIDGETS_LIST_SETTINGS_POPOVER_0_PROPERTY,
	TASKS_WIDGETS_LIST_SETTINGS_POPOVER_SOURCE_PROPERTY,
	TASKS_WIDGETS_LIST_SETTINGS_POPOVER_NUM_PROPERTIES
};
static GParamSpec* tasks_widgets_list_settings_popover_properties[TASKS_WIDGETS_LIST_SETTINGS_POPOVER_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block34Data Block34Data;
#define _g_free0(var) (var = (g_free (var), NULL))

#define TASKS_TYPE_TASK_MODEL (tasks_task_model_get_type ())
#define TASKS_TASK_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TASKS_TYPE_TASK_MODEL, TasksTaskModel))
#define TASKS_TASK_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TASKS_TYPE_TASK_MODEL, TasksTaskModelClass))
#define TASKS_IS_TASK_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TASKS_TYPE_TASK_MODEL))
#define TASKS_IS_TASK_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TASKS_TYPE_TASK_MODEL))
#define TASKS_TASK_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TASKS_TYPE_TASK_MODEL, TasksTaskModelClass))

typedef struct _TasksTaskModel TasksTaskModel;
typedef struct _TasksTaskModelClass TasksTaskModelClass;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _Block35Data Block35Data;

#define TASKS_TYPE_POPOVER_MENUITEM (tasks_popover_menuitem_get_type ())
#define TASKS_POPOVER_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TASKS_TYPE_POPOVER_MENUITEM, TasksPopoverMenuitem))
#define TASKS_POPOVER_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TASKS_TYPE_POPOVER_MENUITEM, TasksPopoverMenuitemClass))
#define TASKS_IS_POPOVER_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TASKS_TYPE_POPOVER_MENUITEM))
#define TASKS_IS_POPOVER_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TASKS_TYPE_POPOVER_MENUITEM))
#define TASKS_POPOVER_MENUITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TASKS_TYPE_POPOVER_MENUITEM, TasksPopoverMenuitemClass))

typedef struct _TasksPopoverMenuitem TasksPopoverMenuitem;
typedef struct _TasksPopoverMenuitemClass TasksPopoverMenuitemClass;

struct _TasksWidgetsListSettingsPopover {
	GtkPopover parent_instance;
	TasksWidgetsListSettingsPopoverPrivate * priv;
};

struct _TasksWidgetsListSettingsPopoverClass {
	GtkPopoverClass parent_class;
};

struct _TasksWidgetsListSettingsPopoverPrivate {
	ESource* _source;
	GtkCheckButton* color_button_red;
	GtkCheckButton* color_button_orange;
	GtkCheckButton* color_button_yellow;
	GtkCheckButton* color_button_green;
	GtkCheckButton* color_button_mint;
	GtkCheckButton* color_button_blue;
	GtkCheckButton* color_button_purple;
	GtkCheckButton* color_button_pink;
	GtkCheckButton* color_button_brown;
	GtkCheckButton* color_button_slate;
	GtkCheckButton* color_button_none;
};

struct _Block34Data {
	int _ref_count_;
	TasksWidgetsListSettingsPopover* self;
	gchar* old_color;
};

struct _Block35Data {
	int _ref_count_;
	TasksWidgetsListSettingsPopover* self;
	GraniteMessageDialog* error_dialog;
};

static gint TasksWidgetsListSettingsPopover_private_offset;
static gpointer tasks_widgets_list_settings_popover_parent_class = NULL;
VALA_EXTERN TasksTaskModel* tasks_application_model;
VALA_EXTERN GSettings* tasks_application_settings;

VALA_EXTERN GType tasks_widgets_list_settings_popover_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TasksWidgetsListSettingsPopover, g_object_unref)
VALA_EXTERN TasksWidgetsListSettingsPopover* tasks_widgets_list_settings_popover_new (ESource* source);
VALA_EXTERN TasksWidgetsListSettingsPopover* tasks_widgets_list_settings_popover_construct (GType object_type,
                                                                                ESource* source);
static void tasks_widgets_list_settings_popover_select_task_list_color (TasksWidgetsListSettingsPopover* self,
                                                                 const gchar* color);
static gchar* tasks_widgets_list_settings_popover_get_task_list_color (TasksWidgetsListSettingsPopover* self,
                                                                ESource* source);
static void tasks_widgets_list_settings_popover_update_task_list_color (TasksWidgetsListSettingsPopover* self,
                                                                 ESource* source,
                                                                 const gchar* color);
static Block34Data* block34_data_ref (Block34Data* _data34_);
static void block34_data_unref (void * _userdata_);
VALA_EXTERN GType tasks_task_model_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TasksTaskModel, g_object_unref)
VALA_EXTERN void tasks_task_model_update_task_list_color (TasksTaskModel* self,
                                              ESource* task_list,
                                              const gchar* color,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_);
VALA_EXTERN void tasks_task_model_update_task_list_color_finish (TasksTaskModel* self,
                                                     GAsyncResult* _res_,
                                                     GError** error);
static void __lambda77_ (Block34Data* _data34_,
                  GObject* obj,
                  GAsyncResult* res);
static void tasks_widgets_list_settings_popover_dialog_update_task_list_color_error (TasksWidgetsListSettingsPopover* self,
                                                                              GError* e);
static void ___lambda77__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static Block35Data* block35_data_ref (Block35Data* _data35_);
static void block35_data_unref (void * _userdata_);
static void __lambda78_ (Block35Data* _data35_);
static void ___lambda78__gtk_dialog_response (GtkDialog* _sender,
                                       gint response_id,
                                       gpointer self);
VALA_EXTERN ESource* tasks_widgets_list_settings_popover_get_source (TasksWidgetsListSettingsPopover* self);
VALA_EXTERN void tasks_widgets_list_settings_popover_set_source (TasksWidgetsListSettingsPopover* self,
                                                     ESource* value);
static GObject * tasks_widgets_list_settings_popover_constructor (GType type,
                                                           guint n_construct_properties,
                                                           GObjectConstructParam * construct_properties);
VALA_EXTERN GType tasks_popover_menuitem_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TasksPopoverMenuitem, g_object_unref)
VALA_EXTERN TasksPopoverMenuitem* tasks_popover_menuitem_new (void);
VALA_EXTERN TasksPopoverMenuitem* tasks_popover_menuitem_construct (GType object_type);
VALA_EXTERN void tasks_popover_menuitem_set_text (TasksPopoverMenuitem* self,
                                      const gchar* value);
static void _tasks_widgets_list_settings_popover___lambda79_ (TasksWidgetsListSettingsPopover* self);
static void __tasks_widgets_list_settings_popover___lambda79__gtk_check_button_toggled (GtkCheckButton* _sender,
                                                                                 gpointer self);
static void _tasks_widgets_list_settings_popover___lambda80_ (TasksWidgetsListSettingsPopover* self);
static void __tasks_widgets_list_settings_popover___lambda80__gtk_check_button_toggled (GtkCheckButton* _sender,
                                                                                 gpointer self);
static void _tasks_widgets_list_settings_popover___lambda81_ (TasksWidgetsListSettingsPopover* self);
static void __tasks_widgets_list_settings_popover___lambda81__gtk_check_button_toggled (GtkCheckButton* _sender,
                                                                                 gpointer self);
static void _tasks_widgets_list_settings_popover___lambda82_ (TasksWidgetsListSettingsPopover* self);
static void __tasks_widgets_list_settings_popover___lambda82__gtk_check_button_toggled (GtkCheckButton* _sender,
                                                                                 gpointer self);
static void _tasks_widgets_list_settings_popover___lambda83_ (TasksWidgetsListSettingsPopover* self);
static void __tasks_widgets_list_settings_popover___lambda83__gtk_check_button_toggled (GtkCheckButton* _sender,
                                                                                 gpointer self);
static void _tasks_widgets_list_settings_popover___lambda84_ (TasksWidgetsListSettingsPopover* self);
static void __tasks_widgets_list_settings_popover___lambda84__gtk_check_button_toggled (GtkCheckButton* _sender,
                                                                                 gpointer self);
static void _tasks_widgets_list_settings_popover___lambda85_ (TasksWidgetsListSettingsPopover* self);
static void __tasks_widgets_list_settings_popover___lambda85__gtk_check_button_toggled (GtkCheckButton* _sender,
                                                                                 gpointer self);
static void _tasks_widgets_list_settings_popover___lambda86_ (TasksWidgetsListSettingsPopover* self);
static void __tasks_widgets_list_settings_popover___lambda86__gtk_check_button_toggled (GtkCheckButton* _sender,
                                                                                 gpointer self);
static void _tasks_widgets_list_settings_popover___lambda87_ (TasksWidgetsListSettingsPopover* self);
static void __tasks_widgets_list_settings_popover___lambda87__gtk_check_button_toggled (GtkCheckButton* _sender,
                                                                                 gpointer self);
static void _tasks_widgets_list_settings_popover___lambda88_ (TasksWidgetsListSettingsPopover* self);
static void __tasks_widgets_list_settings_popover___lambda88__gtk_check_button_toggled (GtkCheckButton* _sender,
                                                                                 gpointer self);
static void _tasks_widgets_list_settings_popover___lambda89_ (TasksWidgetsListSettingsPopover* self);
static void __tasks_widgets_list_settings_popover___lambda89__g_object_notify (GObject* _sender,
                                                                        GParamSpec* pspec,
                                                                        gpointer self);
static void tasks_widgets_list_settings_popover_finalize (GObject * obj);
static GType tasks_widgets_list_settings_popover_get_type_once (void);
static void _vala_tasks_widgets_list_settings_popover_get_property (GObject * object,
                                                             guint property_id,
                                                             GValue * value,
                                                             GParamSpec * pspec);
static void _vala_tasks_widgets_list_settings_popover_set_property (GObject * object,
                                                             guint property_id,
                                                             const GValue * value,
                                                             GParamSpec * pspec);

static inline gpointer
tasks_widgets_list_settings_popover_get_instance_private (TasksWidgetsListSettingsPopover* self)
{
	return G_STRUCT_MEMBER_P (self, TasksWidgetsListSettingsPopover_private_offset);
}

TasksWidgetsListSettingsPopover*
tasks_widgets_list_settings_popover_construct (GType object_type,
                                               ESource* source)
{
	TasksWidgetsListSettingsPopover * self = NULL;
	g_return_val_if_fail (source != NULL, NULL);
	self = (TasksWidgetsListSettingsPopover*) g_object_new (object_type, "source", source, NULL);
	return self;
}

TasksWidgetsListSettingsPopover*
tasks_widgets_list_settings_popover_new (ESource* source)
{
	return tasks_widgets_list_settings_popover_construct (TASKS_WIDGETS_TYPE_LIST_SETTINGS_POPOVER, source);
}

static void
tasks_widgets_list_settings_popover_select_task_list_color (TasksWidgetsListSettingsPopover* self,
                                                            const gchar* color)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	GQuark _tmp3_ = 0U;
	static GQuark _tmp2_label0 = 0;
	static GQuark _tmp2_label1 = 0;
	static GQuark _tmp2_label2 = 0;
	static GQuark _tmp2_label3 = 0;
	static GQuark _tmp2_label4 = 0;
	static GQuark _tmp2_label5 = 0;
	static GQuark _tmp2_label6 = 0;
	static GQuark _tmp2_label7 = 0;
	static GQuark _tmp2_label8 = 0;
	static GQuark _tmp2_label9 = 0;
	g_return_if_fail (self != NULL);
	g_return_if_fail (color != NULL);
	g_debug ("ListSettingsPopover.vala:196: Select task list color: %s", color);
	_tmp0_ = g_utf8_strdown (color, (gssize) -1);
	_tmp1_ = _tmp0_;
	_tmp3_ = (NULL == _tmp1_) ? 0 : g_quark_from_string (_tmp1_);
	g_free (_tmp1_);
	if (_tmp3_ == ((0 != _tmp2_label0) ? _tmp2_label0 : (_tmp2_label0 = g_quark_from_static_string ("#c6262e")))) {
		switch (0) {
			default:
			{
				GtkCheckButton* _tmp4_;
				_tmp4_ = self->priv->color_button_red;
				gtk_check_button_set_active (_tmp4_, TRUE);
				break;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label1) ? _tmp2_label1 : (_tmp2_label1 = g_quark_from_static_string ("#f37329")))) {
		switch (0) {
			default:
			{
				GtkCheckButton* _tmp5_;
				_tmp5_ = self->priv->color_button_orange;
				gtk_check_button_set_active (_tmp5_, TRUE);
				break;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label2) ? _tmp2_label2 : (_tmp2_label2 = g_quark_from_static_string ("#e6a92a")))) {
		switch (0) {
			default:
			{
				GtkCheckButton* _tmp6_;
				_tmp6_ = self->priv->color_button_yellow;
				gtk_check_button_set_active (_tmp6_, TRUE);
				break;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label3) ? _tmp2_label3 : (_tmp2_label3 = g_quark_from_static_string ("#68b723")))) {
		switch (0) {
			default:
			{
				GtkCheckButton* _tmp7_;
				_tmp7_ = self->priv->color_button_green;
				gtk_check_button_set_active (_tmp7_, TRUE);
				break;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label4) ? _tmp2_label4 : (_tmp2_label4 = g_quark_from_static_string ("#0e9a83")))) {
		switch (0) {
			default:
			{
				GtkCheckButton* _tmp8_;
				_tmp8_ = self->priv->color_button_mint;
				gtk_check_button_set_active (_tmp8_, TRUE);
				break;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label5) ? _tmp2_label5 : (_tmp2_label5 = g_quark_from_static_string ("#3689e6")))) {
		switch (0) {
			default:
			{
				GtkCheckButton* _tmp9_;
				_tmp9_ = self->priv->color_button_blue;
				gtk_check_button_set_active (_tmp9_, TRUE);
				break;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label6) ? _tmp2_label6 : (_tmp2_label6 = g_quark_from_static_string ("#a56de2")))) {
		switch (0) {
			default:
			{
				GtkCheckButton* _tmp10_;
				_tmp10_ = self->priv->color_button_purple;
				gtk_check_button_set_active (_tmp10_, TRUE);
				break;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label7) ? _tmp2_label7 : (_tmp2_label7 = g_quark_from_static_string ("#de3e80")))) {
		switch (0) {
			default:
			{
				GtkCheckButton* _tmp11_;
				_tmp11_ = self->priv->color_button_pink;
				gtk_check_button_set_active (_tmp11_, TRUE);
				break;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label8) ? _tmp2_label8 : (_tmp2_label8 = g_quark_from_static_string ("#8a715e")))) {
		switch (0) {
			default:
			{
				GtkCheckButton* _tmp12_;
				_tmp12_ = self->priv->color_button_brown;
				gtk_check_button_set_active (_tmp12_, TRUE);
				break;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label9) ? _tmp2_label9 : (_tmp2_label9 = g_quark_from_static_string ("#667885")))) {
		switch (0) {
			default:
			{
				GtkCheckButton* _tmp13_;
				_tmp13_ = self->priv->color_button_slate;
				gtk_check_button_set_active (_tmp13_, TRUE);
				break;
			}
		}
	} else {
		switch (0) {
			default:
			{
				GtkCheckButton* _tmp14_;
				_tmp14_ = self->priv->color_button_none;
				gtk_check_button_set_active (_tmp14_, TRUE);
				break;
			}
		}
	}
}

static gchar*
tasks_widgets_list_settings_popover_get_task_list_color (TasksWidgetsListSettingsPopover* self,
                                                         ESource* source)
{
	gchar* _tmp3_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (source != NULL, NULL);
	if (e_source_has_extension (source, E_SOURCE_EXTENSION_TASK_LIST)) {
		ESourceTaskList* task_list = NULL;
		ESourceExtension* _tmp0_;
		ESourceTaskList* _tmp1_;
		gchar* _tmp2_;
		_tmp0_ = e_source_get_extension (source, E_SOURCE_EXTENSION_TASK_LIST);
		task_list = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, e_source_task_list_get_type (), ESourceTaskList);
		_tmp1_ = task_list;
		_tmp2_ = e_source_selectable_dup_color ((ESourceSelectable*) _tmp1_);
		result = _tmp2_;
		return result;
	}
	_tmp3_ = g_strdup ("");
	result = _tmp3_;
	return result;
}

static Block34Data*
block34_data_ref (Block34Data* _data34_)
{
	g_atomic_int_inc (&_data34_->_ref_count_);
	return _data34_;
}

static void
block34_data_unref (void * _userdata_)
{
	Block34Data* _data34_;
	_data34_ = (Block34Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data34_->_ref_count_)) {
		TasksWidgetsListSettingsPopover* self;
		self = _data34_->self;
		_g_free0 (_data34_->old_color);
		_g_object_unref0 (self);
		g_slice_free (Block34Data, _data34_);
	}
}

static void
__lambda77_ (Block34Data* _data34_,
             GObject* obj,
             GAsyncResult* res)
{
	TasksWidgetsListSettingsPopover* self;
	GError* _inner_error0_ = NULL;
	self = _data34_->self;
	g_return_if_fail (res != NULL);
	{
		TasksTaskModel* _tmp0_;
		_tmp0_ = tasks_application_model;
		tasks_task_model_update_task_list_color_finish (_tmp0_, res, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		const gchar* _tmp1_;
		GError* _tmp2_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp1_ = _data34_->old_color;
		tasks_widgets_list_settings_popover_select_task_list_color (self, _tmp1_);
		_tmp2_ = e;
		tasks_widgets_list_settings_popover_dialog_update_task_list_color_error (self, _tmp2_);
		_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
___lambda77__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda77_ (self, source_object, res);
	block34_data_unref (self);
}

static void
tasks_widgets_list_settings_popover_update_task_list_color (TasksWidgetsListSettingsPopover* self,
                                                            ESource* source,
                                                            const gchar* color)
{
	Block34Data* _data34_;
	gchar* _tmp0_;
	const gchar* _tmp1_;
	TasksTaskModel* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (source != NULL);
	g_return_if_fail (color != NULL);
	_data34_ = g_slice_new0 (Block34Data);
	_data34_->_ref_count_ = 1;
	_data34_->self = g_object_ref (self);
	_tmp0_ = tasks_widgets_list_settings_popover_get_task_list_color (self, source);
	_data34_->old_color = _tmp0_;
	_tmp1_ = _data34_->old_color;
	if (g_strcmp0 (_tmp1_, color) == 0) {
		block34_data_unref (_data34_);
		_data34_ = NULL;
		return;
	}
	_tmp2_ = tasks_application_model;
	tasks_task_model_update_task_list_color (_tmp2_, source, color, ___lambda77__gasync_ready_callback, block34_data_ref (_data34_));
	block34_data_unref (_data34_);
	_data34_ = NULL;
}

static Block35Data*
block35_data_ref (Block35Data* _data35_)
{
	g_atomic_int_inc (&_data35_->_ref_count_);
	return _data35_;
}

static void
block35_data_unref (void * _userdata_)
{
	Block35Data* _data35_;
	_data35_ = (Block35Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data35_->_ref_count_)) {
		TasksWidgetsListSettingsPopover* self;
		self = _data35_->self;
		_g_object_unref0 (_data35_->error_dialog);
		_g_object_unref0 (self);
		g_slice_free (Block35Data, _data35_);
	}
}

static void
__lambda78_ (Block35Data* _data35_)
{
	TasksWidgetsListSettingsPopover* self;
	self = _data35_->self;
	gtk_window_destroy ((GtkWindow*) _data35_->error_dialog);
}

static void
___lambda78__gtk_dialog_response (GtkDialog* _sender,
                                  gint response_id,
                                  gpointer self)
{
	__lambda78_ (self);
}

static void
tasks_widgets_list_settings_popover_dialog_update_task_list_color_error (TasksWidgetsListSettingsPopover* self,
                                                                         GError* e)
{
	Block35Data* _data35_;
	GThemedIcon* _tmp0_;
	GThemedIcon* _tmp1_;
	GraniteMessageDialog* _tmp2_;
	GraniteMessageDialog* _tmp3_;
	const gchar* _tmp4_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (e != NULL);
	_data35_ = g_slice_new0 (Block35Data);
	_data35_->_ref_count_ = 1;
	_data35_->self = g_object_ref (self);
	_tmp0_ = (GThemedIcon*) g_themed_icon_new ("dialog-error");
	_tmp1_ = _tmp0_;
	_tmp2_ = granite_message_dialog_new (_ ("Could not change the task list color"), _ ("The task list registry may be unavailable or write-protected."), (GIcon*) _tmp1_, GTK_BUTTONS_CLOSE);
	g_object_ref_sink (_tmp2_);
	_tmp3_ = _tmp2_;
	_g_object_unref0 (_tmp1_);
	_data35_->error_dialog = _tmp3_;
	_tmp4_ = e->message;
	granite_message_dialog_show_error_details (_data35_->error_dialog, _tmp4_);
	gtk_window_present ((GtkWindow*) _data35_->error_dialog);
	g_signal_connect_data ((GtkDialog*) _data35_->error_dialog, "response", (GCallback) ___lambda78__gtk_dialog_response, block35_data_ref (_data35_), (GClosureNotify) block35_data_unref, 0);
	block35_data_unref (_data35_);
	_data35_ = NULL;
}

ESource*
tasks_widgets_list_settings_popover_get_source (TasksWidgetsListSettingsPopover* self)
{
	ESource* result;
	ESource* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_source;
	result = _tmp0_;
	return result;
}

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

void
tasks_widgets_list_settings_popover_set_source (TasksWidgetsListSettingsPopover* self,
                                                ESource* value)
{
	ESource* old_value;
	g_return_if_fail (self != NULL);
	old_value = tasks_widgets_list_settings_popover_get_source (self);
	if (old_value != value) {
		ESource* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_source);
		self->priv->_source = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tasks_widgets_list_settings_popover_properties[TASKS_WIDGETS_LIST_SETTINGS_POPOVER_SOURCE_PROPERTY]);
	}
}

static void
_tasks_widgets_list_settings_popover___lambda79_ (TasksWidgetsListSettingsPopover* self)
{
	GtkCheckButton* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	_tmp0_ = self->priv->color_button_red;
	_tmp1_ = gtk_check_button_get_active (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		ESource* _tmp3_;
		_tmp3_ = self->priv->_source;
		tasks_widgets_list_settings_popover_update_task_list_color (self, _tmp3_, "#c6262e");
	}
}

static void
__tasks_widgets_list_settings_popover___lambda79__gtk_check_button_toggled (GtkCheckButton* _sender,
                                                                            gpointer self)
{
	_tasks_widgets_list_settings_popover___lambda79_ ((TasksWidgetsListSettingsPopover*) self);
}

static void
_tasks_widgets_list_settings_popover___lambda80_ (TasksWidgetsListSettingsPopover* self)
{
	GtkCheckButton* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	_tmp0_ = self->priv->color_button_orange;
	_tmp1_ = gtk_check_button_get_active (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		ESource* _tmp3_;
		_tmp3_ = self->priv->_source;
		tasks_widgets_list_settings_popover_update_task_list_color (self, _tmp3_, "#f37329");
	}
}

static void
__tasks_widgets_list_settings_popover___lambda80__gtk_check_button_toggled (GtkCheckButton* _sender,
                                                                            gpointer self)
{
	_tasks_widgets_list_settings_popover___lambda80_ ((TasksWidgetsListSettingsPopover*) self);
}

static void
_tasks_widgets_list_settings_popover___lambda81_ (TasksWidgetsListSettingsPopover* self)
{
	GtkCheckButton* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	_tmp0_ = self->priv->color_button_yellow;
	_tmp1_ = gtk_check_button_get_active (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		ESource* _tmp3_;
		_tmp3_ = self->priv->_source;
		tasks_widgets_list_settings_popover_update_task_list_color (self, _tmp3_, "#e6a92a");
	}
}

static void
__tasks_widgets_list_settings_popover___lambda81__gtk_check_button_toggled (GtkCheckButton* _sender,
                                                                            gpointer self)
{
	_tasks_widgets_list_settings_popover___lambda81_ ((TasksWidgetsListSettingsPopover*) self);
}

static void
_tasks_widgets_list_settings_popover___lambda82_ (TasksWidgetsListSettingsPopover* self)
{
	GtkCheckButton* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	_tmp0_ = self->priv->color_button_mint;
	_tmp1_ = gtk_check_button_get_active (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		ESource* _tmp3_;
		_tmp3_ = self->priv->_source;
		tasks_widgets_list_settings_popover_update_task_list_color (self, _tmp3_, "#0e9a83");
	}
}

static void
__tasks_widgets_list_settings_popover___lambda82__gtk_check_button_toggled (GtkCheckButton* _sender,
                                                                            gpointer self)
{
	_tasks_widgets_list_settings_popover___lambda82_ ((TasksWidgetsListSettingsPopover*) self);
}

static void
_tasks_widgets_list_settings_popover___lambda83_ (TasksWidgetsListSettingsPopover* self)
{
	GtkCheckButton* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	_tmp0_ = self->priv->color_button_green;
	_tmp1_ = gtk_check_button_get_active (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		ESource* _tmp3_;
		_tmp3_ = self->priv->_source;
		tasks_widgets_list_settings_popover_update_task_list_color (self, _tmp3_, "#68b723");
	}
}

static void
__tasks_widgets_list_settings_popover___lambda83__gtk_check_button_toggled (GtkCheckButton* _sender,
                                                                            gpointer self)
{
	_tasks_widgets_list_settings_popover___lambda83_ ((TasksWidgetsListSettingsPopover*) self);
}

static void
_tasks_widgets_list_settings_popover___lambda84_ (TasksWidgetsListSettingsPopover* self)
{
	GtkCheckButton* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	_tmp0_ = self->priv->color_button_blue;
	_tmp1_ = gtk_check_button_get_active (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		ESource* _tmp3_;
		_tmp3_ = self->priv->_source;
		tasks_widgets_list_settings_popover_update_task_list_color (self, _tmp3_, "#3689e6");
	}
}

static void
__tasks_widgets_list_settings_popover___lambda84__gtk_check_button_toggled (GtkCheckButton* _sender,
                                                                            gpointer self)
{
	_tasks_widgets_list_settings_popover___lambda84_ ((TasksWidgetsListSettingsPopover*) self);
}

static void
_tasks_widgets_list_settings_popover___lambda85_ (TasksWidgetsListSettingsPopover* self)
{
	GtkCheckButton* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	_tmp0_ = self->priv->color_button_purple;
	_tmp1_ = gtk_check_button_get_active (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		ESource* _tmp3_;
		_tmp3_ = self->priv->_source;
		tasks_widgets_list_settings_popover_update_task_list_color (self, _tmp3_, "#a56de2");
	}
}

static void
__tasks_widgets_list_settings_popover___lambda85__gtk_check_button_toggled (GtkCheckButton* _sender,
                                                                            gpointer self)
{
	_tasks_widgets_list_settings_popover___lambda85_ ((TasksWidgetsListSettingsPopover*) self);
}

static void
_tasks_widgets_list_settings_popover___lambda86_ (TasksWidgetsListSettingsPopover* self)
{
	GtkCheckButton* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	_tmp0_ = self->priv->color_button_pink;
	_tmp1_ = gtk_check_button_get_active (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		ESource* _tmp3_;
		_tmp3_ = self->priv->_source;
		tasks_widgets_list_settings_popover_update_task_list_color (self, _tmp3_, "#de3e80");
	}
}

static void
__tasks_widgets_list_settings_popover___lambda86__gtk_check_button_toggled (GtkCheckButton* _sender,
                                                                            gpointer self)
{
	_tasks_widgets_list_settings_popover___lambda86_ ((TasksWidgetsListSettingsPopover*) self);
}

static void
_tasks_widgets_list_settings_popover___lambda87_ (TasksWidgetsListSettingsPopover* self)
{
	GtkCheckButton* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	_tmp0_ = self->priv->color_button_brown;
	_tmp1_ = gtk_check_button_get_active (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		ESource* _tmp3_;
		_tmp3_ = self->priv->_source;
		tasks_widgets_list_settings_popover_update_task_list_color (self, _tmp3_, "#8a715e");
	}
}

static void
__tasks_widgets_list_settings_popover___lambda87__gtk_check_button_toggled (GtkCheckButton* _sender,
                                                                            gpointer self)
{
	_tasks_widgets_list_settings_popover___lambda87_ ((TasksWidgetsListSettingsPopover*) self);
}

static void
_tasks_widgets_list_settings_popover___lambda88_ (TasksWidgetsListSettingsPopover* self)
{
	GtkCheckButton* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	_tmp0_ = self->priv->color_button_slate;
	_tmp1_ = gtk_check_button_get_active (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		ESource* _tmp3_;
		_tmp3_ = self->priv->_source;
		tasks_widgets_list_settings_popover_update_task_list_color (self, _tmp3_, "#667885");
	}
}

static void
__tasks_widgets_list_settings_popover___lambda88__gtk_check_button_toggled (GtkCheckButton* _sender,
                                                                            gpointer self)
{
	_tasks_widgets_list_settings_popover___lambda88_ ((TasksWidgetsListSettingsPopover*) self);
}

static void
_tasks_widgets_list_settings_popover___lambda89_ (TasksWidgetsListSettingsPopover* self)
{
	ESource* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	_tmp0_ = self->priv->_source;
	_tmp1_ = tasks_widgets_list_settings_popover_get_task_list_color (self, _tmp0_);
	_tmp2_ = _tmp1_;
	tasks_widgets_list_settings_popover_select_task_list_color (self, _tmp2_);
	_g_free0 (_tmp2_);
}

static void
__tasks_widgets_list_settings_popover___lambda89__g_object_notify (GObject* _sender,
                                                                   GParamSpec* pspec,
                                                                   gpointer self)
{
	_tasks_widgets_list_settings_popover___lambda89_ ((TasksWidgetsListSettingsPopover*) self);
}

static GObject *
tasks_widgets_list_settings_popover_constructor (GType type,
                                                 guint n_construct_properties,
                                                 GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	TasksWidgetsListSettingsPopover * self;
	GtkCheckButton* _tmp0_;
	GtkCheckButton* _tmp1_;
	GtkCheckButton* _tmp2_;
	GtkCheckButton* _tmp3_;
	GtkCheckButton* _tmp4_;
	GtkCheckButton* _tmp5_ = NULL;
	GtkCheckButton* _tmp6_;
	GtkCheckButton* _tmp7_;
	GtkCheckButton* _tmp8_;
	GtkCheckButton* _tmp9_;
	GtkCheckButton* _tmp10_ = NULL;
	GtkCheckButton* _tmp11_;
	GtkCheckButton* _tmp12_;
	GtkCheckButton* _tmp13_;
	GtkCheckButton* _tmp14_;
	GtkCheckButton* _tmp15_ = NULL;
	GtkCheckButton* _tmp16_;
	GtkCheckButton* _tmp17_;
	GtkCheckButton* _tmp18_;
	GtkCheckButton* _tmp19_;
	GtkCheckButton* _tmp20_ = NULL;
	GtkCheckButton* _tmp21_;
	GtkCheckButton* _tmp22_;
	GtkCheckButton* _tmp23_;
	GtkCheckButton* _tmp24_;
	GtkCheckButton* _tmp25_ = NULL;
	GtkCheckButton* _tmp26_;
	GtkCheckButton* _tmp27_;
	GtkCheckButton* _tmp28_;
	GtkCheckButton* _tmp29_;
	GtkCheckButton* _tmp30_ = NULL;
	GtkCheckButton* _tmp31_;
	GtkCheckButton* _tmp32_;
	GtkCheckButton* _tmp33_;
	GtkCheckButton* _tmp34_;
	GtkCheckButton* _tmp35_ = NULL;
	GtkCheckButton* _tmp36_;
	GtkCheckButton* _tmp37_;
	GtkCheckButton* _tmp38_;
	GtkCheckButton* _tmp39_;
	GtkCheckButton* _tmp40_ = NULL;
	GtkCheckButton* _tmp41_;
	GtkCheckButton* _tmp42_;
	GtkCheckButton* _tmp43_;
	GtkCheckButton* _tmp44_;
	GtkCheckButton* _tmp45_ = NULL;
	GtkCheckButton* _tmp46_;
	GtkCheckButton* _tmp47_;
	GtkCheckButton* _tmp48_;
	GtkCheckButton* _tmp49_;
	GtkCheckButton* _tmp50_ = NULL;
	GtkBox* color_box = NULL;
	GtkBox* _tmp51_ = NULL;
	GtkBox* _tmp52_;
	GtkCheckButton* _tmp53_;
	GtkBox* _tmp54_;
	GtkCheckButton* _tmp55_;
	GtkBox* _tmp56_;
	GtkCheckButton* _tmp57_;
	GtkBox* _tmp58_;
	GtkCheckButton* _tmp59_;
	GtkBox* _tmp60_;
	GtkCheckButton* _tmp61_;
	GtkBox* _tmp62_;
	GtkCheckButton* _tmp63_;
	GtkBox* _tmp64_;
	GtkCheckButton* _tmp65_;
	GtkBox* _tmp66_;
	GtkCheckButton* _tmp67_;
	GtkBox* _tmp68_;
	GtkCheckButton* _tmp69_;
	GtkBox* _tmp70_;
	GtkCheckButton* _tmp71_;
	GraniteSwitchModelButton* show_completed_button = NULL;
	GraniteSwitchModelButton* _tmp72_ = NULL;
	TasksPopoverMenuitem* delete_list_menuitem = NULL;
	gchar* _tmp73_;
	gchar* _tmp74_;
	TasksPopoverMenuitem* _tmp75_ = NULL;
	TasksPopoverMenuitem* _tmp76_;
	GtkBox* box = NULL;
	GtkBox* _tmp77_ = NULL;
	GtkBox* _tmp78_;
	GtkBox* _tmp79_;
	GtkBox* _tmp80_;
	GtkSeparator* _tmp81_;
	GtkSeparator* _tmp82_;
	GtkBox* _tmp83_;
	GraniteSwitchModelButton* _tmp84_;
	GtkBox* _tmp85_;
	TasksPopoverMenuitem* _tmp86_;
	GtkBox* _tmp87_;
	GtkCheckButton* _tmp88_;
	GtkCheckButton* _tmp89_;
	GtkCheckButton* _tmp90_;
	GtkCheckButton* _tmp91_;
	GtkCheckButton* _tmp92_;
	GtkCheckButton* _tmp93_;
	GtkCheckButton* _tmp94_;
	GtkCheckButton* _tmp95_;
	GtkCheckButton* _tmp96_;
	GtkCheckButton* _tmp97_;
	ESource* _tmp98_;
	gchar* _tmp99_;
	gchar* _tmp100_;
	GSettings* _tmp101_;
	GraniteSwitchModelButton* _tmp102_;
	parent_class = G_OBJECT_CLASS (tasks_widgets_list_settings_popover_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TASKS_WIDGETS_TYPE_LIST_SETTINGS_POPOVER, TasksWidgetsListSettingsPopover);
	_tmp0_ = (GtkCheckButton*) gtk_check_button_new ();
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->color_button_blue);
	self->priv->color_button_blue = _tmp0_;
	_tmp1_ = self->priv->color_button_blue;
	gtk_widget_add_css_class ((GtkWidget*) _tmp1_, GRANITE_STYLE_CLASS_COLOR_BUTTON);
	_tmp2_ = self->priv->color_button_blue;
	gtk_widget_add_css_class ((GtkWidget*) _tmp2_, "blue");
	_tmp3_ = self->priv->color_button_blue;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_tmp5_ = (GtkCheckButton*) gtk_check_button_new ();
	gtk_check_button_set_group (_tmp5_, _tmp4_);
	_g_object_unref0 (_tmp4_);
	g_object_ref_sink (_tmp5_);
	_g_object_unref0 (self->priv->color_button_mint);
	self->priv->color_button_mint = _tmp5_;
	_tmp6_ = self->priv->color_button_mint;
	gtk_widget_add_css_class ((GtkWidget*) _tmp6_, GRANITE_STYLE_CLASS_COLOR_BUTTON);
	_tmp7_ = self->priv->color_button_mint;
	gtk_widget_add_css_class ((GtkWidget*) _tmp7_, "mint");
	_tmp8_ = self->priv->color_button_blue;
	_tmp9_ = _g_object_ref0 (_tmp8_);
	_tmp10_ = (GtkCheckButton*) gtk_check_button_new ();
	gtk_check_button_set_group (_tmp10_, _tmp9_);
	_g_object_unref0 (_tmp9_);
	g_object_ref_sink (_tmp10_);
	_g_object_unref0 (self->priv->color_button_green);
	self->priv->color_button_green = _tmp10_;
	_tmp11_ = self->priv->color_button_green;
	gtk_widget_add_css_class ((GtkWidget*) _tmp11_, GRANITE_STYLE_CLASS_COLOR_BUTTON);
	_tmp12_ = self->priv->color_button_green;
	gtk_widget_add_css_class ((GtkWidget*) _tmp12_, "green");
	_tmp13_ = self->priv->color_button_blue;
	_tmp14_ = _g_object_ref0 (_tmp13_);
	_tmp15_ = (GtkCheckButton*) gtk_check_button_new ();
	gtk_check_button_set_group (_tmp15_, _tmp14_);
	_g_object_unref0 (_tmp14_);
	g_object_ref_sink (_tmp15_);
	_g_object_unref0 (self->priv->color_button_yellow);
	self->priv->color_button_yellow = _tmp15_;
	_tmp16_ = self->priv->color_button_yellow;
	gtk_widget_add_css_class ((GtkWidget*) _tmp16_, GRANITE_STYLE_CLASS_COLOR_BUTTON);
	_tmp17_ = self->priv->color_button_yellow;
	gtk_widget_add_css_class ((GtkWidget*) _tmp17_, "yellow");
	_tmp18_ = self->priv->color_button_blue;
	_tmp19_ = _g_object_ref0 (_tmp18_);
	_tmp20_ = (GtkCheckButton*) gtk_check_button_new ();
	gtk_check_button_set_group (_tmp20_, _tmp19_);
	_g_object_unref0 (_tmp19_);
	g_object_ref_sink (_tmp20_);
	_g_object_unref0 (self->priv->color_button_orange);
	self->priv->color_button_orange = _tmp20_;
	_tmp21_ = self->priv->color_button_orange;
	gtk_widget_add_css_class ((GtkWidget*) _tmp21_, GRANITE_STYLE_CLASS_COLOR_BUTTON);
	_tmp22_ = self->priv->color_button_orange;
	gtk_widget_add_css_class ((GtkWidget*) _tmp22_, "orange");
	_tmp23_ = self->priv->color_button_blue;
	_tmp24_ = _g_object_ref0 (_tmp23_);
	_tmp25_ = (GtkCheckButton*) gtk_check_button_new ();
	gtk_check_button_set_group (_tmp25_, _tmp24_);
	_g_object_unref0 (_tmp24_);
	g_object_ref_sink (_tmp25_);
	_g_object_unref0 (self->priv->color_button_red);
	self->priv->color_button_red = _tmp25_;
	_tmp26_ = self->priv->color_button_red;
	gtk_widget_add_css_class ((GtkWidget*) _tmp26_, GRANITE_STYLE_CLASS_COLOR_BUTTON);
	_tmp27_ = self->priv->color_button_red;
	gtk_widget_add_css_class ((GtkWidget*) _tmp27_, "red");
	_tmp28_ = self->priv->color_button_blue;
	_tmp29_ = _g_object_ref0 (_tmp28_);
	_tmp30_ = (GtkCheckButton*) gtk_check_button_new ();
	gtk_check_button_set_group (_tmp30_, _tmp29_);
	_g_object_unref0 (_tmp29_);
	g_object_ref_sink (_tmp30_);
	_g_object_unref0 (self->priv->color_button_pink);
	self->priv->color_button_pink = _tmp30_;
	_tmp31_ = self->priv->color_button_pink;
	gtk_widget_add_css_class ((GtkWidget*) _tmp31_, GRANITE_STYLE_CLASS_COLOR_BUTTON);
	_tmp32_ = self->priv->color_button_pink;
	gtk_widget_add_css_class ((GtkWidget*) _tmp32_, "pink");
	_tmp33_ = self->priv->color_button_blue;
	_tmp34_ = _g_object_ref0 (_tmp33_);
	_tmp35_ = (GtkCheckButton*) gtk_check_button_new ();
	gtk_check_button_set_group (_tmp35_, _tmp34_);
	_g_object_unref0 (_tmp34_);
	g_object_ref_sink (_tmp35_);
	_g_object_unref0 (self->priv->color_button_purple);
	self->priv->color_button_purple = _tmp35_;
	_tmp36_ = self->priv->color_button_purple;
	gtk_widget_add_css_class ((GtkWidget*) _tmp36_, GRANITE_STYLE_CLASS_COLOR_BUTTON);
	_tmp37_ = self->priv->color_button_purple;
	gtk_widget_add_css_class ((GtkWidget*) _tmp37_, "purple");
	_tmp38_ = self->priv->color_button_blue;
	_tmp39_ = _g_object_ref0 (_tmp38_);
	_tmp40_ = (GtkCheckButton*) gtk_check_button_new ();
	gtk_check_button_set_group (_tmp40_, _tmp39_);
	_g_object_unref0 (_tmp39_);
	g_object_ref_sink (_tmp40_);
	_g_object_unref0 (self->priv->color_button_brown);
	self->priv->color_button_brown = _tmp40_;
	_tmp41_ = self->priv->color_button_brown;
	gtk_widget_add_css_class ((GtkWidget*) _tmp41_, GRANITE_STYLE_CLASS_COLOR_BUTTON);
	_tmp42_ = self->priv->color_button_brown;
	gtk_widget_add_css_class ((GtkWidget*) _tmp42_, "brown");
	_tmp43_ = self->priv->color_button_blue;
	_tmp44_ = _g_object_ref0 (_tmp43_);
	_tmp45_ = (GtkCheckButton*) gtk_check_button_new ();
	gtk_check_button_set_group (_tmp45_, _tmp44_);
	_g_object_unref0 (_tmp44_);
	g_object_ref_sink (_tmp45_);
	_g_object_unref0 (self->priv->color_button_slate);
	self->priv->color_button_slate = _tmp45_;
	_tmp46_ = self->priv->color_button_slate;
	gtk_widget_add_css_class ((GtkWidget*) _tmp46_, GRANITE_STYLE_CLASS_COLOR_BUTTON);
	_tmp47_ = self->priv->color_button_slate;
	gtk_widget_add_css_class ((GtkWidget*) _tmp47_, "slate");
	_tmp48_ = self->priv->color_button_blue;
	_tmp49_ = _g_object_ref0 (_tmp48_);
	_tmp50_ = (GtkCheckButton*) gtk_check_button_new ();
	gtk_check_button_set_group (_tmp50_, _tmp49_);
	_g_object_unref0 (_tmp49_);
	g_object_ref_sink (_tmp50_);
	_g_object_unref0 (self->priv->color_button_none);
	self->priv->color_button_none = _tmp50_;
	_tmp51_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp51_, 12);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp51_, 12);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp51_, 12);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp51_, 12);
	g_object_ref_sink (_tmp51_);
	color_box = _tmp51_;
	_tmp52_ = color_box;
	_tmp53_ = self->priv->color_button_blue;
	gtk_box_append (_tmp52_, (GtkWidget*) _tmp53_);
	_tmp54_ = color_box;
	_tmp55_ = self->priv->color_button_mint;
	gtk_box_append (_tmp54_, (GtkWidget*) _tmp55_);
	_tmp56_ = color_box;
	_tmp57_ = self->priv->color_button_green;
	gtk_box_append (_tmp56_, (GtkWidget*) _tmp57_);
	_tmp58_ = color_box;
	_tmp59_ = self->priv->color_button_yellow;
	gtk_box_append (_tmp58_, (GtkWidget*) _tmp59_);
	_tmp60_ = color_box;
	_tmp61_ = self->priv->color_button_orange;
	gtk_box_append (_tmp60_, (GtkWidget*) _tmp61_);
	_tmp62_ = color_box;
	_tmp63_ = self->priv->color_button_red;
	gtk_box_append (_tmp62_, (GtkWidget*) _tmp63_);
	_tmp64_ = color_box;
	_tmp65_ = self->priv->color_button_pink;
	gtk_box_append (_tmp64_, (GtkWidget*) _tmp65_);
	_tmp66_ = color_box;
	_tmp67_ = self->priv->color_button_purple;
	gtk_box_append (_tmp66_, (GtkWidget*) _tmp67_);
	_tmp68_ = color_box;
	_tmp69_ = self->priv->color_button_brown;
	gtk_box_append (_tmp68_, (GtkWidget*) _tmp69_);
	_tmp70_ = color_box;
	_tmp71_ = self->priv->color_button_slate;
	gtk_box_append (_tmp70_, (GtkWidget*) _tmp71_);
	_tmp72_ = granite_switch_model_button_new (_ ("Show Completed"));
	gtk_widget_set_margin_top ((GtkWidget*) _tmp72_, 3);
	g_object_ref_sink (_tmp72_);
	show_completed_button = _tmp72_;
	_tmp73_ = g_strdup (TASKS_MAIN_WINDOW_ACTION_PREFIX TASKS_MAIN_WINDOW_ACTION_DELETE_SELECTED_LIST);
	_tmp74_ = g_strdup (_ ("Delete List…"));
	_tmp75_ = tasks_popover_menuitem_new ();
	gtk_actionable_set_action_name ((GtkActionable*) _tmp75_, _tmp73_);
	_g_free0 (_tmp73_);
	tasks_popover_menuitem_set_text (_tmp75_, _tmp74_);
	_g_free0 (_tmp74_);
	g_object_ref_sink (_tmp75_);
	delete_list_menuitem = _tmp75_;
	_tmp76_ = delete_list_menuitem;
	gtk_widget_add_css_class ((GtkWidget*) _tmp76_, GRANITE_STYLE_CLASS_DESTRUCTIVE_ACTION);
	_tmp77_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp77_, 3);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp77_, 3);
	g_object_ref_sink (_tmp77_);
	box = _tmp77_;
	_tmp78_ = box;
	_tmp79_ = color_box;
	gtk_box_append (_tmp78_, (GtkWidget*) _tmp79_);
	_tmp80_ = box;
	_tmp81_ = (GtkSeparator*) gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
	g_object_ref_sink (_tmp81_);
	_tmp82_ = _tmp81_;
	gtk_box_append (_tmp80_, (GtkWidget*) _tmp82_);
	_g_object_unref0 (_tmp82_);
	_tmp83_ = box;
	_tmp84_ = show_completed_button;
	gtk_box_append (_tmp83_, (GtkWidget*) _tmp84_);
	_tmp85_ = box;
	_tmp86_ = delete_list_menuitem;
	gtk_box_append (_tmp85_, (GtkWidget*) _tmp86_);
	gtk_popover_set_autohide ((GtkPopover*) self, TRUE);
	_tmp87_ = box;
	gtk_popover_set_child ((GtkPopover*) self, (GtkWidget*) _tmp87_);
	_tmp88_ = self->priv->color_button_red;
	g_signal_connect_object (_tmp88_, "toggled", (GCallback) __tasks_widgets_list_settings_popover___lambda79__gtk_check_button_toggled, self, 0);
	_tmp89_ = self->priv->color_button_orange;
	g_signal_connect_object (_tmp89_, "toggled", (GCallback) __tasks_widgets_list_settings_popover___lambda80__gtk_check_button_toggled, self, 0);
	_tmp90_ = self->priv->color_button_yellow;
	g_signal_connect_object (_tmp90_, "toggled", (GCallback) __tasks_widgets_list_settings_popover___lambda81__gtk_check_button_toggled, self, 0);
	_tmp91_ = self->priv->color_button_mint;
	g_signal_connect_object (_tmp91_, "toggled", (GCallback) __tasks_widgets_list_settings_popover___lambda82__gtk_check_button_toggled, self, 0);
	_tmp92_ = self->priv->color_button_green;
	g_signal_connect_object (_tmp92_, "toggled", (GCallback) __tasks_widgets_list_settings_popover___lambda83__gtk_check_button_toggled, self, 0);
	_tmp93_ = self->priv->color_button_blue;
	g_signal_connect_object (_tmp93_, "toggled", (GCallback) __tasks_widgets_list_settings_popover___lambda84__gtk_check_button_toggled, self, 0);
	_tmp94_ = self->priv->color_button_purple;
	g_signal_connect_object (_tmp94_, "toggled", (GCallback) __tasks_widgets_list_settings_popover___lambda85__gtk_check_button_toggled, self, 0);
	_tmp95_ = self->priv->color_button_pink;
	g_signal_connect_object (_tmp95_, "toggled", (GCallback) __tasks_widgets_list_settings_popover___lambda86__gtk_check_button_toggled, self, 0);
	_tmp96_ = self->priv->color_button_brown;
	g_signal_connect_object (_tmp96_, "toggled", (GCallback) __tasks_widgets_list_settings_popover___lambda87__gtk_check_button_toggled, self, 0);
	_tmp97_ = self->priv->color_button_slate;
	g_signal_connect_object (_tmp97_, "toggled", (GCallback) __tasks_widgets_list_settings_popover___lambda88__gtk_check_button_toggled, self, 0);
	_tmp98_ = self->priv->_source;
	_tmp99_ = tasks_widgets_list_settings_popover_get_task_list_color (self, _tmp98_);
	_tmp100_ = _tmp99_;
	tasks_widgets_list_settings_popover_select_task_list_color (self, _tmp100_);
	_g_free0 (_tmp100_);
	g_signal_connect_object ((GObject*) self, "notify::source", (GCallback) __tasks_widgets_list_settings_popover___lambda89__g_object_notify, self, 0);
	_tmp101_ = tasks_application_settings;
	_tmp102_ = show_completed_button;
	g_settings_bind (_tmp101_, "show-completed", (GObject*) _tmp102_, "active", G_SETTINGS_BIND_DEFAULT);
	_g_object_unref0 (box);
	_g_object_unref0 (delete_list_menuitem);
	_g_object_unref0 (show_completed_button);
	_g_object_unref0 (color_box);
	return obj;
}

static void
tasks_widgets_list_settings_popover_class_init (TasksWidgetsListSettingsPopoverClass * klass,
                                                gpointer klass_data)
{
	tasks_widgets_list_settings_popover_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TasksWidgetsListSettingsPopover_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_tasks_widgets_list_settings_popover_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tasks_widgets_list_settings_popover_set_property;
	G_OBJECT_CLASS (klass)->constructor = tasks_widgets_list_settings_popover_constructor;
	G_OBJECT_CLASS (klass)->finalize = tasks_widgets_list_settings_popover_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TASKS_WIDGETS_LIST_SETTINGS_POPOVER_SOURCE_PROPERTY, tasks_widgets_list_settings_popover_properties[TASKS_WIDGETS_LIST_SETTINGS_POPOVER_SOURCE_PROPERTY] = g_param_spec_object ("source", "source", "source", e_source_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
}

static void
tasks_widgets_list_settings_popover_instance_init (TasksWidgetsListSettingsPopover * self,
                                                   gpointer klass)
{
	self->priv = tasks_widgets_list_settings_popover_get_instance_private (self);
}

static void
tasks_widgets_list_settings_popover_finalize (GObject * obj)
{
	TasksWidgetsListSettingsPopover * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TASKS_WIDGETS_TYPE_LIST_SETTINGS_POPOVER, TasksWidgetsListSettingsPopover);
	_g_object_unref0 (self->priv->_source);
	_g_object_unref0 (self->priv->color_button_red);
	_g_object_unref0 (self->priv->color_button_orange);
	_g_object_unref0 (self->priv->color_button_yellow);
	_g_object_unref0 (self->priv->color_button_green);
	_g_object_unref0 (self->priv->color_button_mint);
	_g_object_unref0 (self->priv->color_button_blue);
	_g_object_unref0 (self->priv->color_button_purple);
	_g_object_unref0 (self->priv->color_button_pink);
	_g_object_unref0 (self->priv->color_button_brown);
	_g_object_unref0 (self->priv->color_button_slate);
	_g_object_unref0 (self->priv->color_button_none);
	G_OBJECT_CLASS (tasks_widgets_list_settings_popover_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tasks_widgets_list_settings_popover_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TasksWidgetsListSettingsPopoverClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tasks_widgets_list_settings_popover_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TasksWidgetsListSettingsPopover), 0, (GInstanceInitFunc) tasks_widgets_list_settings_popover_instance_init, NULL };
	GType tasks_widgets_list_settings_popover_type_id;
	tasks_widgets_list_settings_popover_type_id = g_type_register_static (gtk_popover_get_type (), "TasksWidgetsListSettingsPopover", &g_define_type_info, 0);
	TasksWidgetsListSettingsPopover_private_offset = g_type_add_instance_private (tasks_widgets_list_settings_popover_type_id, sizeof (TasksWidgetsListSettingsPopoverPrivate));
	return tasks_widgets_list_settings_popover_type_id;
}

GType
tasks_widgets_list_settings_popover_get_type (void)
{
	static gsize tasks_widgets_list_settings_popover_type_id__once = 0;
	if (g_once_init_enter (&tasks_widgets_list_settings_popover_type_id__once)) {
		GType tasks_widgets_list_settings_popover_type_id;
		tasks_widgets_list_settings_popover_type_id = tasks_widgets_list_settings_popover_get_type_once ();
		g_once_init_leave (&tasks_widgets_list_settings_popover_type_id__once, tasks_widgets_list_settings_popover_type_id);
	}
	return tasks_widgets_list_settings_popover_type_id__once;
}

static void
_vala_tasks_widgets_list_settings_popover_get_property (GObject * object,
                                                        guint property_id,
                                                        GValue * value,
                                                        GParamSpec * pspec)
{
	TasksWidgetsListSettingsPopover * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TASKS_WIDGETS_TYPE_LIST_SETTINGS_POPOVER, TasksWidgetsListSettingsPopover);
	switch (property_id) {
		case TASKS_WIDGETS_LIST_SETTINGS_POPOVER_SOURCE_PROPERTY:
		g_value_set_object (value, tasks_widgets_list_settings_popover_get_source (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tasks_widgets_list_settings_popover_set_property (GObject * object,
                                                        guint property_id,
                                                        const GValue * value,
                                                        GParamSpec * pspec)
{
	TasksWidgetsListSettingsPopover * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TASKS_WIDGETS_TYPE_LIST_SETTINGS_POPOVER, TasksWidgetsListSettingsPopover);
	switch (property_id) {
		case TASKS_WIDGETS_LIST_SETTINGS_POPOVER_SOURCE_PROPERTY:
		tasks_widgets_list_settings_popover_set_source (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

