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

#include <glib.h>
#include <glib-object.h>
#include <pango/pango.h>
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
#include <glib/gstdio.h>
#include <adwaita.h>
#include <gio/gio.h>
#include <gdk/gdk.h>
#include <json-glib/json-glib.h>
#include <float.h>
#include <math.h>

#define DC_FONT_SIZE_SYSTEM 0
#define DC_FONT_SIZE_MIN 6
#define DC_FONT_SIZE_MAX 32
#define DC_FONT_SIZE_FALLBACK 11
#define DC_AUTO_DOWNLOAD_NEVER (32 * 1024)
#define DC_AUTO_DOWNLOAD_DEFAULT (1024 * 1024)
#define DC_WEBXDC_SECURITY_SAFE_ALLOW_INTERNET FALSE
#define DC_WEBXDC_SECURITY_SAFE_ALLOW_WASM FALSE
#define DC_WEBXDC_SECURITY_SAFE_ALLOW_WEBGL FALSE
#define DC_WEBXDC_SECURITY_SAFE_ALLOW_HARDWARE_ACCELERATION FALSE
#define DC_SETTINGS_MANAGER_FONT_SAVE_DEBOUNCE_MS ((guint) 250)
#define PARLA_RPC_SERVER_PATH ""
#define DC_WEBXDC_AVAILABLE TRUE
#define DC_REMOVE_PARAM_FILTER_DEFAULT_URL "https://filters.adtidy.org/extension/ublock/filters/17.txt"
#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

typedef void (*DcSettingWriter) (GKeyFile* kf, gpointer user_data);
typedef enum  {
	DC_SIDEBAR_MODE_FULL = 0,
	DC_SIDEBAR_MODE_COMPACT = 1,
	DC_SIDEBAR_MODE_HIDDEN = 2
} DcSidebarMode;

#define DC_TYPE_SIDEBAR_MODE (dc_sidebar_mode_get_type ())
typedef enum  {
	DC_THEME_OVERRIDE_SYSTEM = 0,
	DC_THEME_OVERRIDE_LIGHT = 1,
	DC_THEME_OVERRIDE_DARK = 2
} DcThemeOverride;

#define DC_TYPE_THEME_OVERRIDE (dc_theme_override_get_type ())
typedef enum  {
	DC_MESSAGE_STYLE_BUBBLES = 0,
	DC_MESSAGE_STYLE_IRC = 1,
	DC_MESSAGE_STYLE_WORKSPACE = 2
} DcMessageStyle;

#define DC_TYPE_MESSAGE_STYLE (dc_message_style_get_type ())
typedef enum  {
	DC_BUBBLE_AVATAR_DISPLAY_NONE = 0,
	DC_BUBBLE_AVATAR_DISPLAY_OTHER = 1,
	DC_BUBBLE_AVATAR_DISPLAY_BOTH = 2
} DcBubbleAvatarDisplay;

#define DC_TYPE_BUBBLE_AVATAR_DISPLAY (dc_bubble_avatar_display_get_type ())
typedef enum  {
	DC_BACKGROUND_MODE_SYSTEM = 0,
	DC_BACKGROUND_MODE_SOLID = 1,
	DC_BACKGROUND_MODE_GRADIENT = 2
} DcBackgroundMode;

#define DC_TYPE_BACKGROUND_MODE (dc_background_mode_get_type ())
typedef enum  {
	DC_FONT_ATTRIBUTE_REGULAR = 0,
	DC_FONT_ATTRIBUTE_ITALIC = 1,
	DC_FONT_ATTRIBUTE_BOLD = 2,
	DC_FONT_ATTRIBUTE_BOLD_ITALIC = 3
} DcFontAttribute;

#define DC_TYPE_FONT_ATTRIBUTE (dc_font_attribute_get_type ())

#define DC_TYPE_SETTINGS_MANAGER (dc_settings_manager_get_type ())
#define DC_SETTINGS_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_SETTINGS_MANAGER, DcSettingsManager))
#define DC_SETTINGS_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_SETTINGS_MANAGER, DcSettingsManagerClass))
#define DC_IS_SETTINGS_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_SETTINGS_MANAGER))
#define DC_IS_SETTINGS_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_SETTINGS_MANAGER))
#define DC_SETTINGS_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_SETTINGS_MANAGER, DcSettingsManagerClass))

typedef struct _DcSettingsManager DcSettingsManager;
typedef struct _DcSettingsManagerClass DcSettingsManagerClass;
typedef struct _DcSettingsManagerPrivate DcSettingsManagerPrivate;
typedef enum  {
	DC_MARKDOWN_MODE_ENABLED = 0,
	DC_MARKDOWN_MODE_STRIPPED = 1,
	DC_MARKDOWN_MODE_DISABLED = 2
} DcMarkdownMode;

#define DC_TYPE_MARKDOWN_MODE (dc_markdown_mode_get_type ())
typedef enum  {
	DC_CODE_THEME_ADAPTIVE = 0,
	DC_CODE_THEME_SOLARIZED = 1,
	DC_CODE_THEME_MONOKAI = 2,
	DC_CODE_THEME_NORD = 3,
	DC_CODE_THEME_NONE = 4
} DcCodeTheme;

#define DC_TYPE_CODE_THEME (dc_code_theme_get_type ())
typedef enum  {
	DC_RPC_SERVER_SOURCE_AUTO = 0,
	DC_RPC_SERVER_SOURCE_CUSTOM = 1
} DcRpcServerSource;

#define DC_TYPE_RPC_SERVER_SOURCE (dc_rpc_server_source_get_type ())
enum  {
	DC_SETTINGS_MANAGER_0_PROPERTY,
	DC_SETTINGS_MANAGER_DOUBLE_CLICK_ACTION_PROPERTY,
	DC_SETTINGS_MANAGER_MARKDOWN_MODE_PROPERTY,
	DC_SETTINGS_MANAGER_CODE_THEME_PROPERTY,
	DC_SETTINGS_MANAGER_SHIFT_ENTER_SENDS_PROPERTY,
	DC_SETTINGS_MANAGER_CLEAN_PASTED_LINKS_PROPERTY,
	DC_SETTINGS_MANAGER_TRACKING_FILTER_ENABLED_PROPERTY,
	DC_SETTINGS_MANAGER_TRACKING_FILTER_URL_PROPERTY,
	DC_SETTINGS_MANAGER_LINK_PREVIEWS_PROPERTY,
	DC_SETTINGS_MANAGER_NOTIFICATIONS_ENABLED_PROPERTY,
	DC_SETTINGS_MANAGER_SHOW_NOTIFICATION_CONTENTS_PROPERTY,
	DC_SETTINGS_MANAGER_MINIMIZE_TO_TRAY_PROPERTY,
	DC_SETTINGS_MANAGER_SYSTEM_AUDIO_PLAYER_PROPERTY,
	DC_SETTINGS_MANAGER_ANIMATE_STICKERS_PROPERTY,
	DC_SETTINGS_MANAGER_WEBXDC_APPS_PROPERTY,
	DC_SETTINGS_MANAGER_WEBXDC_FOLLOW_CHAT_PROPERTY,
	DC_SETTINGS_MANAGER_WEBXDC_ALLOW_INTERNET_PROPERTY,
	DC_SETTINGS_MANAGER_WEBXDC_ALLOW_WASM_PROPERTY,
	DC_SETTINGS_MANAGER_WEBXDC_ALLOW_WEBGL_PROPERTY,
	DC_SETTINGS_MANAGER_WEBXDC_ALLOW_HARDWARE_ACCELERATION_PROPERTY,
	DC_SETTINGS_MANAGER_AUTO_DOWNLOAD_LIMIT_PROPERTY,
	DC_SETTINGS_MANAGER_RPC_SERVER_PATH_PROPERTY,
	DC_SETTINGS_MANAGER_ACCOUNTS_PATH_PROPERTY,
	DC_SETTINGS_MANAGER_RPC_SERVER_SOURCE_PROPERTY,
	DC_SETTINGS_MANAGER_RPC_CHECK_UPDATES_ON_STARTUP_PROPERTY,
	DC_SETTINGS_MANAGER_SIDEBAR_MODE_PROPERTY,
	DC_SETTINGS_MANAGER_DEFAULT_ACCOUNT_ADDR_PROPERTY,
	DC_SETTINGS_MANAGER_THEME_OVERRIDE_PROPERTY,
	DC_SETTINGS_MANAGER_MESSAGE_STYLE_PROPERTY,
	DC_SETTINGS_MANAGER_BUBBLE_AVATAR_DISPLAY_PROPERTY,
	DC_SETTINGS_MANAGER_BUBBLE_AVATARS_IN_DIRECT_CHATS_PROPERTY,
	DC_SETTINGS_MANAGER_ACCENT_COLOR_PROPERTY,
	DC_SETTINGS_MANAGER_BACKGROUND_MODE_PROPERTY,
	DC_SETTINGS_MANAGER_BACKGROUND_COLOR_PROPERTY,
	DC_SETTINGS_MANAGER_FONT_FAMILY_PROPERTY,
	DC_SETTINGS_MANAGER_FONT_ATTRIBUTE_PROPERTY,
	DC_SETTINGS_MANAGER_FONT_SIZE_PROPERTY,
	DC_SETTINGS_MANAGER_NUM_PROPERTIES
};
static GParamSpec* dc_settings_manager_properties[DC_SETTINGS_MANAGER_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_key_file_unref0(var) ((var == NULL) ? NULL : (var = (g_key_file_unref (var), NULL)))

#define DC_TYPE_REMOVE_PARAM_FILTER (dc_remove_param_filter_get_type ())
#define DC_REMOVE_PARAM_FILTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_REMOVE_PARAM_FILTER, DcRemoveParamFilter))
#define DC_REMOVE_PARAM_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_REMOVE_PARAM_FILTER, DcRemoveParamFilterClass))
#define DC_IS_REMOVE_PARAM_FILTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_REMOVE_PARAM_FILTER))
#define DC_IS_REMOVE_PARAM_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_REMOVE_PARAM_FILTER))
#define DC_REMOVE_PARAM_FILTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_REMOVE_PARAM_FILTER, DcRemoveParamFilterClass))

typedef struct _DcRemoveParamFilter DcRemoveParamFilter;
typedef struct _DcRemoveParamFilterClass DcRemoveParamFilterClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block68Data Block68Data;
#define __vala_PangoFontDescription_free0(var) ((var == NULL) ? NULL : (var = (_vala_PangoFontDescription_free (var), NULL)))
typedef struct _Block69Data Block69Data;
typedef struct _Block70Data Block70Data;
typedef struct _Block71Data Block71Data;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
enum  {
	DC_SETTINGS_MANAGER_APPEARANCE_CHANGED_SIGNAL,
	DC_SETTINGS_MANAGER_FONT_CHANGED_SIGNAL,
	DC_SETTINGS_MANAGER_NUM_SIGNALS
};
static guint dc_settings_manager_signals[DC_SETTINGS_MANAGER_NUM_SIGNALS] = {0};

#define DC_TYPE_SETTINGS_DIALOG (dc_settings_dialog_get_type ())
#define DC_SETTINGS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_SETTINGS_DIALOG, DcSettingsDialog))
#define DC_SETTINGS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_SETTINGS_DIALOG, DcSettingsDialogClass))
#define DC_IS_SETTINGS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_SETTINGS_DIALOG))
#define DC_IS_SETTINGS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_SETTINGS_DIALOG))
#define DC_SETTINGS_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_SETTINGS_DIALOG, DcSettingsDialogClass))

typedef struct _DcSettingsDialog DcSettingsDialog;
typedef struct _DcSettingsDialogClass DcSettingsDialogClass;
typedef struct _DcSettingsDialogPrivate DcSettingsDialogPrivate;

#define DC_TYPE_WINDOW (dc_window_get_type ())
#define DC_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_WINDOW, DcWindow))
#define DC_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_WINDOW, DcWindowClass))
#define DC_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_WINDOW))
#define DC_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_WINDOW))
#define DC_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_WINDOW, DcWindowClass))

typedef struct _DcWindow DcWindow;
typedef struct _DcWindowClass DcWindowClass;

#define DC_TYPE_RPC_CLIENT (dc_rpc_client_get_type ())
#define DC_RPC_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_RPC_CLIENT, DcRpcClient))
#define DC_RPC_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_RPC_CLIENT, DcRpcClientClass))
#define DC_IS_RPC_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_RPC_CLIENT))
#define DC_IS_RPC_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_RPC_CLIENT))
#define DC_RPC_CLIENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_RPC_CLIENT, DcRpcClientClass))

typedef struct _DcRpcClient DcRpcClient;
typedef struct _DcRpcClientClass DcRpcClientClass;
enum  {
	DC_SETTINGS_DIALOG_0_PROPERTY,
	DC_SETTINGS_DIALOG_NUM_PROPERTIES
};
static GParamSpec* dc_settings_dialog_properties[DC_SETTINGS_DIALOG_NUM_PROPERTIES];
typedef struct _Block72Data Block72Data;
typedef struct _DcWindowPrivate DcWindowPrivate;
typedef struct _Block73Data Block73Data;
typedef struct _Block74Data Block74Data;
typedef struct _Block75Data Block75Data;
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
typedef struct _DcSettingsDialogPromptTrackingFilterUrlData DcSettingsDialogPromptTrackingFilterUrlData;
typedef struct _DcSettingsDialogUpdateTrackingFilterData DcSettingsDialogUpdateTrackingFilterData;
#define _gtk_expression_unref0(var) ((var == NULL) ? NULL : (var = (gtk_expression_unref (var), NULL)))
typedef struct _DcSettingsDialogOnChooseFontData DcSettingsDialogOnChooseFontData;
typedef struct _DcSettingsDialogLoadProxySettingsData DcSettingsDialogLoadProxySettingsData;
#define _json_object_unref0(var) ((var == NULL) ? NULL : (var = (json_object_unref (var), NULL)))
typedef struct _DcSettingsDialogNormalizeProxyUrlData DcSettingsDialogNormalizeProxyUrlData;
typedef struct _DcSettingsDialogSaveProxySettingsData DcSettingsDialogSaveProxySettingsData;
typedef struct _DcSettingsDialogUpdateRpcVersionRowData DcSettingsDialogUpdateRpcVersionRowData;
typedef struct _DcSettingsDialogConfirmUpdateDialogData DcSettingsDialogConfirmUpdateDialogData;
typedef struct _DcSettingsDialogCheckRpcUpdatesData DcSettingsDialogCheckRpcUpdatesData;
typedef struct _DcSettingsDialogOnBrowseRpcServerData DcSettingsDialogOnBrowseRpcServerData;
typedef struct _DcSettingsDialogOnBrowseAccountsPathData DcSettingsDialogOnBrowseAccountsPathData;

#define DC_TYPE_RPC_INSTALLER (dc_rpc_installer_get_type ())
#define DC_RPC_INSTALLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_RPC_INSTALLER, DcRpcInstaller))
#define DC_RPC_INSTALLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_RPC_INSTALLER, DcRpcInstallerClass))
#define DC_IS_RPC_INSTALLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_RPC_INSTALLER))
#define DC_IS_RPC_INSTALLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_RPC_INSTALLER))
#define DC_RPC_INSTALLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_RPC_INSTALLER, DcRpcInstallerClass))

typedef struct _DcRpcInstaller DcRpcInstaller;
typedef struct _DcRpcInstallerClass DcRpcInstallerClass;
typedef struct _DcSettingsDialogInstallManagedServerData DcSettingsDialogInstallManagedServerData;
typedef struct _DcSettingsDialogOpenRpcDownloadPageData DcSettingsDialogOpenRpcDownloadPageData;
typedef struct _DcSettingsDialogOnResetSettingsData DcSettingsDialogOnResetSettingsData;

#define DC_TYPE_APPLICATION (dc_application_get_type ())
#define DC_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_APPLICATION, DcApplication))
#define DC_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_APPLICATION, DcApplicationClass))
#define DC_IS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_APPLICATION))
#define DC_IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_APPLICATION))
#define DC_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_APPLICATION, DcApplicationClass))

typedef struct _DcApplication DcApplication;
typedef struct _DcApplicationClass DcApplicationClass;

struct _DcSettingsManager {
	GObject parent_instance;
	DcSettingsManagerPrivate * priv;
};

struct _DcSettingsManagerClass {
	GObjectClass parent_class;
};

struct _DcSettingsManagerPrivate {
	gint _double_click_action;
	DcMarkdownMode _markdown_mode;
	DcCodeTheme _code_theme;
	gboolean _shift_enter_sends;
	gboolean _clean_pasted_links;
	gboolean _tracking_filter_enabled;
	gchar* _tracking_filter_url;
	gboolean _link_previews;
	gboolean _notifications_enabled;
	gboolean _show_notification_contents;
	gboolean _minimize_to_tray;
	gboolean _system_audio_player;
	gboolean _animate_stickers;
	gboolean _webxdc_apps;
	gboolean _webxdc_follow_chat;
	gboolean _webxdc_allow_internet;
	gboolean _webxdc_allow_wasm;
	gboolean _webxdc_allow_webgl;
	gboolean _webxdc_allow_hardware_acceleration;
	gint _auto_download_limit;
	gchar* _rpc_server_path;
	gchar* _accounts_path;
	DcRpcServerSource _rpc_server_source;
	gboolean _rpc_check_updates_on_startup;
	DcSidebarMode _sidebar_mode;
	gchar* _default_account_addr;
	DcThemeOverride _theme_override;
	DcMessageStyle _message_style;
	DcBubbleAvatarDisplay _bubble_avatar_display;
	gboolean _bubble_avatars_in_direct_chats;
	gchar* _accent_color;
	DcBackgroundMode _background_mode;
	gchar* _background_color;
	gchar* _font_family;
	DcFontAttribute _font_attribute;
	gint _font_size;
	guint font_save_source;
};

struct _Block68Data {
	int _ref_count_;
	GWeakRef settings_ref;
};

struct _Block69Data {
	int _ref_count_;
	DcSettingsManager* self;
	gchar* key;
	gint value;
};

struct _Block70Data {
	int _ref_count_;
	DcSettingsManager* self;
	gchar* key;
	gboolean value;
};

struct _Block71Data {
	int _ref_count_;
	DcSettingsManager* self;
	gchar* key;
	gchar* value;
};

struct _DcSettingsDialog {
	AdwPreferencesDialog parent_instance;
	DcSettingsDialogPrivate * priv;
};

struct _DcSettingsDialogClass {
	AdwPreferencesDialogClass parent_class;
};

struct _DcSettingsDialogPrivate {
	DcWindow* app_window;
	DcRpcClient* rpc;
	AdwActionRow* proxy_switch_row;
	AdwActionRow* proxy_url_row;
	GtkSwitch* proxy_switch;
	GtkEntry* proxy_entry;
	AdwActionRow* rpc_row;
	AdwComboRow* rpc_source_dropdown;
	GtkButton* rpc_choose_btn;
	GtkButton* rpc_check_btn;
	AdwActionRow* accounts_path_row;
	GtkButton* accounts_path_reset_btn;
	gboolean loading_proxy;
	gboolean saving_proxy;
	gboolean saved_proxy_enabled;
	gchar* saved_proxy_url;
	gboolean syncing_rpc_source;
	AdwActionRow* font_type_row;
	GtkButton* font_btn;
	guint rpc_version_request;
	gchar* rpc_current_version;
	AdwActionRow* tracking_filter_url_row;
	GtkButton* tracking_filter_refresh_btn;
};

struct _Block72Data {
	int _ref_count_;
	DcSettingsDialog* self;
	AdwComboRow* theme_combo;
	AdwComboRow* code_combo;
	AdwComboRow* style_combo;
	AdwComboRow* avatar_combo;
	GtkCheckButton* direct_avatar_check;
	GtkFontDialog* font_dialog;
	GtkColorDialogButton* accent_btn;
	AdwComboRow* bg_mode_combo;
	GtkColorDialogButton* bg_color_btn;
	AdwComboRow* dblclick_combo;
	AdwComboRow* md_combo;
	GtkSwitch* shift_switch;
	GtkSwitch* audio_switch;
	GtkSwitch* tray_switch;
	GtkSwitch* notif_switch;
	GtkSwitch* notification_contents_switch;
	GtkSwitch* autocheck_switch;
	GtkSwitch* sticker_switch;
	AdwComboRow* download_combo;
};

struct _DcWindow {
	AdwApplicationWindow parent_instance;
	DcWindowPrivate * priv;
	DcSettingsManager* settings;
};

struct _DcWindowClass {
	AdwApplicationWindowClass parent_class;
};

struct _Block73Data {
	int _ref_count_;
	DcSettingsDialog* self;
	GtkSwitch* enable_switch;
	GtkSwitch* behavior_switch;
	GtkSwitch* internet_switch;
	GtkSwitch* wasm_switch;
	GtkSwitch* webgl_switch;
	GtkSwitch* acceleration_switch;
};

struct _Block74Data {
	int _ref_count_;
	Block73Data * _data73_;
	GtkSwitch* acceleration;
};

struct _Block75Data {
	int _ref_count_;
	DcSettingsDialog* self;
	GtkSwitch* previews_switch;
	GtkSwitch* clean_links_switch;
	AdwActionRow* filter_row;
	GtkSwitch* filter_switch;
};

struct _DcSettingsDialogPromptTrackingFilterUrlData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcSettingsDialog* self;
	AdwAlertDialog* d;
	AdwAlertDialog* _tmp0_;
	AdwAlertDialog* _tmp1_;
	AdwAlertDialog* _tmp2_;
	AdwAlertDialog* _tmp3_;
	AdwAlertDialog* _tmp4_;
	AdwAlertDialog* _tmp5_;
	GtkEntry* entry;
	GtkEntry* _tmp6_;
	gchar* current;
	DcWindow* _tmp7_;
	DcSettingsManager* _tmp8_;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	gchar* _tmp11_;
	const gchar* _tmp12_;
	const gchar* _tmp13_;
	gint _tmp14_;
	gint _tmp15_;
	const gchar* _tmp16_;
	GtkEntry* _tmp17_;
	GtkEntry* _tmp18_;
	GtkEntry* _tmp19_;
	AdwAlertDialog* _tmp20_;
	GtkEntry* _tmp21_;
	gchar* response;
	AdwAlertDialog* _tmp22_;
	const gchar* _tmp23_;
	gchar* _tmp24_;
	const gchar* _tmp25_;
	gchar* url;
	GtkEntry* _tmp26_;
	const gchar* _tmp27_;
	const gchar* _tmp28_;
	gchar* _tmp29_;
	gboolean _tmp30_;
	const gchar* _tmp31_;
	const gchar* _tmp32_;
	DcWindow* _tmp33_;
	gboolean changed;
	const gchar* _tmp34_;
	const gchar* _tmp35_;
	DcWindow* _tmp36_;
	DcSettingsManager* _tmp37_;
	const gchar* _tmp38_;
};

struct _DcSettingsDialogUpdateTrackingFilterData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcSettingsDialog* self;
	GtkButton* _tmp0_;
	gchar* err;
	DcWindow* _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	DcWindow* _tmp4_;
	const gchar* _tmp5_;
	DcWindow* _tmp6_;
	DcSettingsManager* _tmp7_;
	DcRemoveParamFilter* f;
	DcRemoveParamFilter* _tmp8_;
	DcRemoveParamFilter* _tmp9_;
	gchar* _tmp10_;
	DcRemoveParamFilter* _tmp11_;
	DcRemoveParamFilter* _tmp12_;
	gint _tmp13_;
	gint _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	DcWindow* _tmp17_;
};

struct _DcSettingsDialogOnChooseFontData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcSettingsDialog* self;
	GtkFontDialog* dialog;
	PangoFontDescription* desc;
	DcWindow* _tmp0_;
	DcWindow* _tmp1_;
	DcSettingsManager* _tmp2_;
	PangoFontDescription* _tmp3_;
	PangoFontDescription* _tmp4_;
	PangoFontDescription* _tmp5_;
	PangoFontDescription* _tmp6_;
	DcWindow* _tmp7_;
	DcSettingsManager* _tmp8_;
	GError* e;
	GError* _tmp9_;
	DcWindow* _tmp10_;
	GError* _tmp11_;
	const gchar* _tmp12_;
	GError* _inner_error0_;
};

struct _DcSettingsDialogLoadProxySettingsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcSettingsDialog* self;
	gboolean _tmp0_;
	DcRpcClient* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	DcRpcClient* _tmp4_;
	gint _tmp5_;
	gint _tmp6_;
	AdwActionRow* _tmp7_;
	AdwActionRow* _tmp8_;
	gchar* enabled;
	DcRpcClient* _tmp9_;
	DcRpcClient* _tmp10_;
	gint _tmp11_;
	gint _tmp12_;
	gchar* _tmp13_;
	gchar* proxy_url;
	DcRpcClient* _tmp14_;
	DcRpcClient* _tmp15_;
	gint _tmp16_;
	gint _tmp17_;
	gchar* _tmp18_;
	const gchar* _tmp19_;
	const gchar* _tmp20_;
	gchar* first;
	gchar* _tmp21_;
	const gchar* _tmp22_;
	const gchar* _tmp23_;
	GtkSwitch* _tmp24_;
	GtkEntry* _tmp25_;
	const gchar* _tmp26_;
	GtkSwitch* _tmp27_;
	gboolean _tmp28_;
	gboolean _tmp29_;
	const gchar* _tmp30_;
	gchar* _tmp31_;
	const gchar* _tmp32_;
	GtkSwitch* _tmp33_;
	gboolean _tmp34_;
	gboolean _tmp35_;
	AdwActionRow* _tmp36_;
	AdwActionRow* _tmp37_;
	const gchar* _tmp38_;
	const gchar* _tmp39_;
	gint _tmp40_;
	gint _tmp41_;
	const gchar* _tmp42_;
	AdwActionRow* _tmp43_;
	GError* e;
	AdwActionRow* _tmp44_;
	AdwActionRow* _tmp45_;
	GError* _tmp46_;
	const gchar* _tmp47_;
	GError* _inner_error1_;
	GError* _inner_error0_;
};

struct _DcSettingsDialogNormalizeProxyUrlData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcSettingsDialog* self;
	gchar* url;
	gchar* result;
	JsonObject* qr;
	DcRpcClient* _tmp0_;
	DcRpcClient* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	JsonObject* _tmp4_;
	gboolean _tmp5_;
	gboolean _tmp6_;
	JsonObject* _tmp7_;
	JsonObject* _tmp8_;
	JsonObject* _tmp9_;
	const gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	const gchar* _tmp13_;
	JsonObject* _tmp14_;
	JsonObject* _tmp15_;
	const gchar* _tmp16_;
	gchar* _tmp17_;
	GError* e;
	GError* _tmp18_;
	const gchar* _tmp19_;
	gchar* _tmp20_;
	gchar* _tmp21_;
	GError* _inner_error0_;
};

struct _DcSettingsDialogSaveProxySettingsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcSettingsDialog* self;
	gboolean _tmp0_;
	gboolean _tmp1_;
	DcRpcClient* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	DcRpcClient* _tmp5_;
	gint _tmp6_;
	gint _tmp7_;
	DcWindow* _tmp8_;
	gchar* url;
	GtkEntry* _tmp9_;
	const gchar* _tmp10_;
	const gchar* _tmp11_;
	gchar* _tmp12_;
	gboolean enabled;
	GtkSwitch* _tmp13_;
	gboolean _tmp14_;
	gboolean _tmp15_;
	gboolean _tmp16_;
	const gchar* _tmp17_;
	const gchar* _tmp18_;
	gboolean _tmp19_;
	const gchar* _tmp20_;
	gint _tmp21_;
	gint _tmp22_;
	GtkSwitch* _tmp23_;
	gboolean _tmp24_;
	const gchar* _tmp25_;
	gint _tmp26_;
	gint _tmp27_;
	const gchar* _tmp28_;
	gint _tmp29_;
	gint _tmp30_;
	gchar* normalized;
	const gchar* _tmp31_;
	gchar* _tmp32_;
	const gchar* _tmp33_;
	const gchar* _tmp34_;
	gchar* _tmp35_;
	GtkEntry* _tmp36_;
	const gchar* _tmp37_;
	DcRpcClient* _tmp38_;
	const gchar* _tmp39_;
	DcRpcClient* _tmp40_;
	gint _tmp41_;
	gint _tmp42_;
	const gchar* _tmp43_;
	DcRpcClient* _tmp44_;
	DcRpcClient* _tmp45_;
	gint _tmp46_;
	gint _tmp47_;
	DcRpcClient* _tmp48_;
	DcRpcClient* _tmp49_;
	gint _tmp50_;
	gint _tmp51_;
	DcRpcClient* _tmp52_;
	DcRpcClient* _tmp53_;
	gint _tmp54_;
	gint _tmp55_;
	const gchar* _tmp56_;
	AdwActionRow* _tmp57_;
	const gchar* _tmp58_;
	const gchar* _tmp59_;
	gint _tmp60_;
	gint _tmp61_;
	const gchar* _tmp62_;
	AdwActionRow* _tmp63_;
	const gchar* _tmp64_;
	gchar* _tmp65_;
	DcWindow* _tmp66_;
	GError* e;
	GError* _tmp67_;
	const gchar* _tmp68_;
	gchar* _tmp69_;
	gchar* _tmp70_;
	GError* _inner_error1_;
	GError* _inner_error0_;
};

struct _DcSettingsDialogUpdateRpcVersionRowData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcSettingsDialog* self;
	gchar* rpc_path;
	guint request_id;
	guint _tmp0_;
	gboolean _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gchar* stdout_buf;
	gchar* stderr_buf;
	gboolean successful;
	GSubprocess* process;
	GSubprocess* _tmp4_;
	GSubprocess* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	GSubprocess* _tmp8_;
	gchar* _tmp9_;
	const gchar* _tmp10_;
	const gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gint _tmp14_;
	gint _tmp15_;
	gboolean _tmp16_;
	const gchar* _tmp17_;
	const gchar* _tmp18_;
	gchar* _tmp19_;
	const gchar* _tmp20_;
	const gchar* _tmp21_;
	gchar* _tmp22_;
	gchar* version;
	gchar* _tmp23_;
	gboolean _tmp24_;
	const gchar* _tmp25_;
	gint _tmp26_;
	gint _tmp27_;
	const gchar* _tmp28_;
	gchar* _tmp29_;
	const gchar* _tmp30_;
	const gchar* _tmp31_;
	const gchar* _tmp32_;
	AdwActionRow* _tmp33_;
	AdwActionRow* _tmp34_;
	GError* e;
	AdwActionRow* _tmp35_;
	AdwActionRow* _tmp36_;
	GError* _tmp37_;
	const gchar* _tmp38_;
	gchar* _tmp39_;
	gchar* _tmp40_;
	GError* _inner_error0_;
};

struct _DcSettingsDialogConfirmUpdateDialogData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcSettingsDialog* self;
	gchar* title;
	gchar* body;
	gchar* action_label;
	gboolean result;
	AdwAlertDialog* d;
	AdwAlertDialog* _tmp0_;
	DcWindow* _tmp1_;
	const gchar* _tmp2_;
};

struct _DcSettingsDialogCheckRpcUpdatesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcSettingsDialog* self;
	gboolean _tmp0_;
	GtkButton* _tmp1_;
	GtkButton* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	GtkButton* _tmp5_;
	gchar* previous_subtitle;
	AdwActionRow* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	gchar* _tmp9_;
	AdwActionRow* _tmp10_;
	gchar* latest_tag;
	gchar* _tmp11_;
	gchar* latest_version;
	const gchar* _tmp12_;
	gchar* _tmp13_;
	AdwActionRow* _tmp14_;
	const gchar* _tmp15_;
	const gchar* _tmp16_;
	DcWindow* _tmp17_;
	GtkButton* _tmp18_;
	gboolean _tmp19_;
	const gchar* _tmp20_;
	const gchar* _tmp21_;
	const gchar* _tmp22_;
	DcWindow* _tmp23_;
	const gchar* _tmp24_;
	gchar* _tmp25_;
	gchar* _tmp26_;
	GtkButton* _tmp27_;
	gboolean managed_active;
	DcWindow* _tmp28_;
	DcSettingsManager* _tmp29_;
	gchar* _tmp30_;
	gchar* _tmp31_;
	DcWindow* _tmp32_;
	DcSettingsManager* _tmp33_;
	gchar* _tmp34_;
	gchar* _tmp35_;
	gchar* _tmp36_;
	gchar* _tmp37_;
	gboolean _tmp38_;
	gboolean _tmp39_;
	const gchar* _tmp40_;
	const gchar* _tmp41_;
	gchar* _tmp42_;
	gchar* _tmp43_;
	gboolean _tmp44_;
	GtkButton* _tmp45_;
	const gchar* _tmp46_;
	gchar* _tmp47_;
	gchar* _tmp48_;
	gboolean _tmp49_;
	GtkButton* _tmp50_;
	gchar* _tmp51_;
	const gchar* _tmp52_;
	const gchar* _tmp53_;
	gchar* _tmp54_;
	const gchar* _tmp55_;
	const gchar* _tmp56_;
	gchar* _tmp57_;
	gchar* body;
	gchar* _tmp58_;
	const gchar* _tmp59_;
	const gchar* _tmp60_;
	const gchar* _tmp61_;
	GError* e;
	AdwActionRow* _tmp62_;
	const gchar* _tmp63_;
	DcWindow* _tmp64_;
	GError* _tmp65_;
	const gchar* _tmp66_;
	gchar* _tmp67_;
	gchar* _tmp68_;
	GError* _inner_error1_;
	GtkButton* _tmp69_;
	GError* _inner_error0_;
};

struct _DcSettingsDialogOnBrowseRpcServerData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcSettingsDialog* self;
	GtkFileDialog* dlg;
	GtkFileDialog* _tmp0_;
	GtkFileDialog* _tmp1_;
	GtkFileDialog* _tmp2_;
	gchar* start;
	DcWindow* _tmp3_;
	DcSettingsManager* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	const gchar* _tmp8_;
	gint _tmp9_;
	gint _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	const gchar* _tmp15_;
	gint _tmp16_;
	gint _tmp17_;
	GtkFileDialog* _tmp18_;
	const gchar* _tmp19_;
	GFile* _tmp20_;
	GFile* _tmp21_;
	GFile* file;
	GtkFileDialog* _tmp22_;
	DcWindow* _tmp23_;
	GFile* _tmp24_;
	gchar* path;
	gchar* _tmp25_;
	gboolean _tmp26_;
	const gchar* _tmp27_;
	const gchar* _tmp28_;
	DcWindow* _tmp29_;
	DcSettingsManager* _tmp30_;
	const gchar* _tmp31_;
	DcWindow* _tmp32_;
	DcSettingsManager* _tmp33_;
	DcWindow* _tmp34_;
	DcWindow* _tmp35_;
	DcWindow* _tmp36_;
	GError* e;
	GError* _tmp37_;
	DcWindow* _tmp38_;
	GError* _tmp39_;
	const gchar* _tmp40_;
	GError* _inner_error0_;
};

struct _DcSettingsDialogOnBrowseAccountsPathData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcSettingsDialog* self;
	GtkFileDialog* dlg;
	GtkFileDialog* _tmp0_;
	GtkFileDialog* _tmp1_;
	GtkFileDialog* _tmp2_;
	gchar* path;
	DcWindow* _tmp3_;
	DcSettingsManager* _tmp4_;
	gchar* _tmp5_;
	const gchar* _tmp6_;
	GtkFileDialog* _tmp7_;
	const gchar* _tmp8_;
	GFile* _tmp9_;
	GFile* _tmp10_;
	GFile* folder;
	GtkFileDialog* _tmp11_;
	DcWindow* _tmp12_;
	GFile* _tmp13_;
	gchar* selected_path;
	gchar* _tmp14_;
	const gchar* _tmp15_;
	DcWindow* _tmp16_;
	DcSettingsManager* _tmp17_;
	const gchar* _tmp18_;
	DcWindow* _tmp19_;
	DcWindow* _tmp20_;
	GError* e;
	GError* _tmp21_;
	DcWindow* _tmp22_;
	GError* _tmp23_;
	const gchar* _tmp24_;
	GError* _inner_error0_;
};

struct _DcSettingsDialogInstallManagedServerData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcSettingsDialog* self;
	GtkButton* _tmp0_;
	gchar* prev_subtitle;
	AdwActionRow* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	DcRpcInstaller* installer;
	DcRpcInstaller* _tmp5_;
	DcRpcInstaller* _tmp6_;
	DcRpcInstaller* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	DcWindow* _tmp10_;
	DcSettingsManager* _tmp11_;
	DcRpcServerSource _tmp12_;
	DcRpcServerSource _tmp13_;
	DcWindow* _tmp14_;
	DcSettingsManager* _tmp15_;
	DcWindow* _tmp16_;
	DcWindow* _tmp17_;
	GError* e;
	AdwActionRow* _tmp18_;
	const gchar* _tmp19_;
	DcWindow* _tmp20_;
	GError* _tmp21_;
	const gchar* _tmp22_;
	gchar* _tmp23_;
	gchar* _tmp24_;
	GError* _inner_error1_;
	GtkButton* _tmp25_;
	GError* _inner_error0_;
};

struct _DcSettingsDialogOpenRpcDownloadPageData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcSettingsDialog* self;
	GtkUriLauncher* _tmp0_;
	GtkUriLauncher* _tmp1_;
	DcWindow* _tmp2_;
	GError* e;
	DcWindow* _tmp3_;
	GError* _tmp4_;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	GError* _inner_error0_;
};

struct _DcSettingsDialogOnResetSettingsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcSettingsDialog* self;
	DcWindow* _tmp0_;
	DcWindow* _tmp1_;
};

static gint DcSettingsManager_private_offset;
static gpointer dc_settings_manager_parent_class = NULL;
VALA_EXTERN DcMarkdownMode dc_markdown_mode;
VALA_EXTERN DcCodeTheme dc_syntax_highlight_theme;
VALA_EXTERN gboolean dc_audio_player_prefer_system;
VALA_EXTERN DcRemoveParamFilter* dc_remove_param_filter_active;
static gint DcSettingsDialog_private_offset;
static gpointer dc_settings_dialog_parent_class = NULL;

VALA_EXTERN GType dc_sidebar_mode_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType dc_theme_override_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType dc_message_style_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType dc_bubble_avatar_display_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType dc_background_mode_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType dc_font_attribute_get_type (void) G_GNUC_CONST ;
VALA_EXTERN PangoStyle dc_font_attribute_pango_style (DcFontAttribute self);
VALA_EXTERN PangoWeight dc_font_attribute_pango_weight (DcFontAttribute self);
VALA_EXTERN gchar* dc_font_attribute_css_style (DcFontAttribute self);
VALA_EXTERN gchar* dc_font_attribute_css_weight (DcFontAttribute self);
VALA_EXTERN GType dc_settings_manager_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcSettingsManager, g_object_unref)
VALA_EXTERN GType dc_markdown_mode_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType dc_code_theme_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType dc_rpc_server_source_get_type (void) G_GNUC_CONST ;
VALA_EXTERN gchar* dc_settings_manager_get_config_path (void);
VALA_EXTERN gboolean dc_settings_manager_rpc_server_path_is_fixed (void);
VALA_EXTERN gchar* dc_settings_manager_effective_rpc_server_path (DcSettingsManager* self);
VALA_EXTERN const gchar* dc_settings_manager_get_rpc_server_path (DcSettingsManager* self);
VALA_EXTERN DcRpcServerSource dc_settings_manager_effective_rpc_server_source (DcSettingsManager* self);
VALA_EXTERN DcRpcServerSource dc_settings_manager_get_rpc_server_source (DcSettingsManager* self);
VALA_EXTERN gboolean dc_settings_manager_rpc_auto_update_enabled (DcSettingsManager* self);
VALA_EXTERN gboolean dc_settings_manager_get_rpc_check_updates_on_startup (DcSettingsManager* self);
VALA_EXTERN gchar* dc_settings_manager_default_accounts_path (DcSettingsManager* self);
VALA_EXTERN gchar* dc_account_finder_get_data_dir (void);
static gchar* dc_settings_manager_normalize_accounts_path (DcSettingsManager* self,
                                                    const gchar* value);
VALA_EXTERN gboolean dc_settings_manager_is_default_accounts_path (DcSettingsManager* self,
                                                       const gchar* value);
VALA_EXTERN gboolean dc_settings_manager_uses_default_accounts_path (DcSettingsManager* self);
VALA_EXTERN const gchar* dc_settings_manager_get_accounts_path (DcSettingsManager* self);
VALA_EXTERN gchar* dc_settings_manager_effective_accounts_path (DcSettingsManager* self);
VALA_EXTERN void dc_settings_manager_load (DcSettingsManager* self);
static gint dc_settings_manager_kf_enum (GKeyFile* kf,
                                  const gchar* k,
                                  gint d,
                                  gint max);
VALA_EXTERN void dc_settings_manager_set_double_click_action (DcSettingsManager* self,
                                                  gint value);
static DcMarkdownMode dc_settings_manager_kf_markdown_mode (GKeyFile* kf);
VALA_EXTERN void dc_settings_manager_set_markdown_mode (DcSettingsManager* self,
                                            DcMarkdownMode value);
VALA_EXTERN DcMarkdownMode dc_settings_manager_get_markdown_mode (DcSettingsManager* self);
VALA_EXTERN void dc_settings_manager_set_code_theme (DcSettingsManager* self,
                                         DcCodeTheme value);
VALA_EXTERN DcCodeTheme dc_settings_manager_get_code_theme (DcSettingsManager* self);
static gboolean dc_settings_manager_kf_bool (GKeyFile* kf,
                                      const gchar* k,
                                      gboolean d);
VALA_EXTERN void dc_settings_manager_set_shift_enter_sends (DcSettingsManager* self,
                                                gboolean value);
VALA_EXTERN void dc_settings_manager_set_clean_pasted_links (DcSettingsManager* self,
                                                 gboolean value);
VALA_EXTERN void dc_settings_manager_set_tracking_filter_enabled (DcSettingsManager* self,
                                                      gboolean value);
static gchar* dc_settings_manager_kf_str (GKeyFile* kf,
                                   const gchar* k,
                                   const gchar* d);
VALA_EXTERN void dc_settings_manager_set_tracking_filter_url (DcSettingsManager* self,
                                                  const gchar* value);
VALA_EXTERN void dc_settings_manager_apply_tracking_filter (DcSettingsManager* self);
VALA_EXTERN void dc_settings_manager_set_link_previews (DcSettingsManager* self,
                                            gboolean value);
VALA_EXTERN void dc_settings_manager_set_notifications_enabled (DcSettingsManager* self,
                                                    gboolean value);
VALA_EXTERN void dc_settings_manager_set_show_notification_contents (DcSettingsManager* self,
                                                         gboolean value);
VALA_EXTERN void dc_settings_manager_set_minimize_to_tray (DcSettingsManager* self,
                                               gboolean value);
VALA_EXTERN void dc_settings_manager_set_system_audio_player (DcSettingsManager* self,
                                                  gboolean value);
VALA_EXTERN gboolean dc_settings_manager_get_system_audio_player (DcSettingsManager* self);
VALA_EXTERN void dc_settings_manager_set_animate_stickers (DcSettingsManager* self,
                                               gboolean value);
VALA_EXTERN void dc_settings_manager_set_webxdc_apps (DcSettingsManager* self,
                                          gboolean value);
VALA_EXTERN void dc_settings_manager_set_webxdc_follow_chat (DcSettingsManager* self,
                                                 gboolean value);
VALA_EXTERN void dc_settings_manager_set_webxdc_allow_internet (DcSettingsManager* self,
                                                    gboolean value);
VALA_EXTERN void dc_settings_manager_set_webxdc_allow_wasm (DcSettingsManager* self,
                                                gboolean value);
VALA_EXTERN void dc_settings_manager_set_webxdc_allow_webgl (DcSettingsManager* self,
                                                 gboolean value);
VALA_EXTERN void dc_settings_manager_set_webxdc_allow_hardware_acceleration (DcSettingsManager* self,
                                                                 gboolean value);
VALA_EXTERN gint dc_settings_manager_normalize_auto_download_limit (gint bytes);
static gint dc_settings_manager_kf_int (GKeyFile* kf,
                                 const gchar* k,
                                 gint d);
VALA_EXTERN void dc_settings_manager_set_auto_download_limit (DcSettingsManager* self,
                                                  gint value);
VALA_EXTERN void dc_settings_manager_set_rpc_server_path (DcSettingsManager* self,
                                              const gchar* value);
VALA_EXTERN void dc_settings_manager_set_accounts_path (DcSettingsManager* self,
                                            const gchar* value);
VALA_EXTERN void dc_settings_manager_set_rpc_server_source (DcSettingsManager* self,
                                                DcRpcServerSource value);
VALA_EXTERN void dc_settings_manager_set_rpc_check_updates_on_startup (DcSettingsManager* self,
                                                           gboolean value);
VALA_EXTERN void dc_settings_manager_set_sidebar_mode (DcSettingsManager* self,
                                           DcSidebarMode value);
VALA_EXTERN void dc_settings_manager_set_default_account_addr (DcSettingsManager* self,
                                                   const gchar* value);
VALA_EXTERN void dc_settings_manager_set_theme_override (DcSettingsManager* self,
                                             DcThemeOverride value);
VALA_EXTERN void dc_settings_manager_set_message_style (DcSettingsManager* self,
                                            DcMessageStyle value);
VALA_EXTERN void dc_settings_manager_set_bubble_avatar_display (DcSettingsManager* self,
                                                    DcBubbleAvatarDisplay value);
VALA_EXTERN void dc_settings_manager_set_bubble_avatars_in_direct_chats (DcSettingsManager* self,
                                                             gboolean value);
VALA_EXTERN void dc_settings_manager_set_accent_color (DcSettingsManager* self,
                                           const gchar* value);
VALA_EXTERN void dc_settings_manager_set_background_mode (DcSettingsManager* self,
                                              DcBackgroundMode value);
VALA_EXTERN void dc_settings_manager_set_background_color (DcSettingsManager* self,
                                               const gchar* value);
VALA_EXTERN void dc_settings_manager_set_font_family (DcSettingsManager* self,
                                          const gchar* value);
VALA_EXTERN void dc_settings_manager_set_font_attribute (DcSettingsManager* self,
                                             DcFontAttribute value);
VALA_EXTERN gint dc_settings_manager_clamp_font_size (gint size);
VALA_EXTERN void dc_settings_manager_set_font_size (DcSettingsManager* self,
                                        gint value);
VALA_EXTERN void dc_settings_manager_save_double_click_action (DcSettingsManager* self,
                                                   gint v);
static void dc_settings_manager_save_int (DcSettingsManager* self,
                                   const gchar* key,
                                   gint value);
VALA_EXTERN void dc_settings_manager_save_markdown_mode (DcSettingsManager* self,
                                             DcMarkdownMode mode);
VALA_EXTERN void dc_settings_manager_save_code_theme (DcSettingsManager* self,
                                          DcCodeTheme theme);
VALA_EXTERN void dc_settings_manager_save_shift_enter_sends (DcSettingsManager* self,
                                                 gboolean v);
static void dc_settings_manager_save_bool (DcSettingsManager* self,
                                    const gchar* key,
                                    gboolean value);
VALA_EXTERN void dc_settings_manager_save_clean_pasted_links (DcSettingsManager* self,
                                                  gboolean v);
VALA_EXTERN void dc_settings_manager_save_tracking_filter_enabled (DcSettingsManager* self,
                                                       gboolean v);
VALA_EXTERN void dc_settings_manager_save_tracking_filter_url (DcSettingsManager* self,
                                                   const gchar* v);
static void dc_settings_manager_save_string (DcSettingsManager* self,
                                      const gchar* key,
                                      const gchar* value);
VALA_EXTERN const gchar* dc_settings_manager_get_tracking_filter_url (DcSettingsManager* self);
VALA_EXTERN GType dc_remove_param_filter_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcRemoveParamFilter, g_object_unref)
VALA_EXTERN gboolean dc_settings_manager_get_tracking_filter_enabled (DcSettingsManager* self);
VALA_EXTERN DcRemoveParamFilter* dc_remove_param_filter_load_cached (void);
VALA_EXTERN void dc_settings_manager_save_link_previews (DcSettingsManager* self,
                                             gboolean v);
VALA_EXTERN void dc_settings_manager_save_notifications_enabled (DcSettingsManager* self,
                                                     gboolean v);
VALA_EXTERN void dc_settings_manager_save_show_notification_contents (DcSettingsManager* self,
                                                          gboolean v);
VALA_EXTERN void dc_settings_manager_save_minimize_to_tray (DcSettingsManager* self,
                                                gboolean v);
VALA_EXTERN void dc_settings_manager_save_system_audio_player (DcSettingsManager* self,
                                                   gboolean v);
VALA_EXTERN void dc_settings_manager_save_animate_stickers (DcSettingsManager* self,
                                                gboolean v);
VALA_EXTERN void dc_settings_manager_save_webxdc_apps (DcSettingsManager* self,
                                           gboolean v);
VALA_EXTERN void dc_settings_manager_save_webxdc_follow_chat (DcSettingsManager* self,
                                                  gboolean v);
VALA_EXTERN void dc_settings_manager_save_webxdc_allow_internet (DcSettingsManager* self,
                                                     gboolean v);
VALA_EXTERN void dc_settings_manager_save_webxdc_allow_wasm (DcSettingsManager* self,
                                                 gboolean v);
VALA_EXTERN void dc_settings_manager_save_webxdc_allow_webgl (DcSettingsManager* self,
                                                  gboolean v);
VALA_EXTERN void dc_settings_manager_save_webxdc_allow_hardware_acceleration (DcSettingsManager* self,
                                                                  gboolean v);
VALA_EXTERN void dc_settings_manager_save_auto_download_limit (DcSettingsManager* self,
                                                   gint bytes);
VALA_EXTERN gint dc_settings_manager_get_auto_download_limit (DcSettingsManager* self);
VALA_EXTERN void dc_settings_manager_save_rpc_server_path (DcSettingsManager* self,
                                               const gchar* v);
VALA_EXTERN void dc_settings_manager_save_accounts_path (DcSettingsManager* self,
                                             const gchar* v);
VALA_EXTERN void dc_settings_manager_reset_accounts_path (DcSettingsManager* self);
VALA_EXTERN void dc_settings_manager_save_rpc_server_source (DcSettingsManager* self,
                                                 DcRpcServerSource v);
VALA_EXTERN void dc_settings_manager_save_rpc_check_updates_on_startup (DcSettingsManager* self,
                                                            gboolean v);
VALA_EXTERN void dc_settings_manager_save_sidebar_mode (DcSettingsManager* self,
                                            DcSidebarMode v);
VALA_EXTERN void dc_settings_manager_save_default_account_addr (DcSettingsManager* self,
                                                    const gchar* v);
VALA_EXTERN void dc_settings_manager_save_theme_override (DcSettingsManager* self,
                                              DcThemeOverride v);
VALA_EXTERN void dc_settings_manager_save_message_style (DcSettingsManager* self,
                                             DcMessageStyle v);
VALA_EXTERN void dc_settings_manager_save_bubble_avatar_display (DcSettingsManager* self,
                                                     DcBubbleAvatarDisplay v);
VALA_EXTERN void dc_settings_manager_save_bubble_avatars_in_direct_chats (DcSettingsManager* self,
                                                              gboolean v);
VALA_EXTERN void dc_settings_manager_save_accent_color (DcSettingsManager* self,
                                            const gchar* v);
VALA_EXTERN void dc_settings_manager_save_background_mode (DcSettingsManager* self,
                                               DcBackgroundMode v);
VALA_EXTERN void dc_settings_manager_save_background_color (DcSettingsManager* self,
                                                const gchar* v);
VALA_EXTERN void dc_settings_manager_save_font_size (DcSettingsManager* self,
                                         gint v);
static void dc_settings_manager_save_font (DcSettingsManager* self,
                                    const gchar* family,
                                    DcFontAttribute attr,
                                    gint size);
VALA_EXTERN const gchar* dc_settings_manager_get_font_family (DcSettingsManager* self);
VALA_EXTERN DcFontAttribute dc_settings_manager_get_font_attribute (DcSettingsManager* self);
VALA_EXTERN void dc_settings_manager_save_font_description (DcSettingsManager* self,
                                                PangoFontDescription* desc);
static DcFontAttribute dc_settings_manager_attribute_from_font_description (PangoFontDescription* desc);
static gint dc_settings_manager_size_from_font_description (PangoFontDescription* desc);
VALA_EXTERN void dc_settings_manager_reset_font_defaults (DcSettingsManager* self);
VALA_EXTERN gint dc_settings_manager_get_font_size (DcSettingsManager* self);
static void dc_settings_manager_schedule_font_save (DcSettingsManager* self);
static guint dc_settings_manager_add_font_save_timeout (DcSettingsManager* target);
static Block68Data* block68_data_ref (Block68Data* _data68_);
static void block68_data_unref (void * _userdata_);
static gboolean __lambda332_ (Block68Data* _data68_);
static void dc_settings_manager_write_font_settings (DcSettingsManager* self);
static gboolean ___lambda332__gsource_func (gpointer self);
VALA_EXTERN void dc_settings_manager_save_to_file (DcSettingsManager* self,
                                       DcSettingWriter writer,
                                       gpointer writer_target);
static void __lambda333_ (DcSettingsManager* self,
                   GKeyFile* kf);
static void ___lambda333__dc_setting_writer (GKeyFile* kf,
                                      gpointer self);
static void dc_settings_manager_real_dispose (GObject* base);
VALA_EXTERN gint dc_settings_manager_system_font_size (void);
static gchar* dc_settings_manager_system_font_name (void);
static void _vala_PangoFontDescription_free (PangoFontDescription* self);
VALA_EXTERN gint dc_settings_manager_effective_font_size (DcSettingsManager* self);
VALA_EXTERN PangoFontDescription* dc_settings_manager_effective_font_description (DcSettingsManager* self);
static Block69Data* block69_data_ref (Block69Data* _data69_);
static void block69_data_unref (void * _userdata_);
static void __lambda326_ (Block69Data* _data69_,
                   GKeyFile* kf);
static void ___lambda326__dc_setting_writer (GKeyFile* kf,
                                      gpointer self);
static Block70Data* block70_data_ref (Block70Data* _data70_);
static void block70_data_unref (void * _userdata_);
static void __lambda303_ (Block70Data* _data70_,
                   GKeyFile* kf);
static void ___lambda303__dc_setting_writer (GKeyFile* kf,
                                      gpointer self);
static Block71Data* block71_data_ref (Block71Data* _data71_);
static void block71_data_unref (void * _userdata_);
static void __lambda155_ (Block71Data* _data71_,
                   GKeyFile* kf);
static void ___lambda155__dc_setting_writer (GKeyFile* kf,
                                      gpointer self);
VALA_EXTERN DcSettingsManager* dc_settings_manager_new (void);
VALA_EXTERN DcSettingsManager* dc_settings_manager_construct (GType object_type);
VALA_EXTERN gint dc_settings_manager_get_double_click_action (DcSettingsManager* self);
VALA_EXTERN gboolean dc_settings_manager_get_shift_enter_sends (DcSettingsManager* self);
VALA_EXTERN gboolean dc_settings_manager_get_clean_pasted_links (DcSettingsManager* self);
VALA_EXTERN gboolean dc_settings_manager_get_link_previews (DcSettingsManager* self);
VALA_EXTERN gboolean dc_settings_manager_get_notifications_enabled (DcSettingsManager* self);
VALA_EXTERN gboolean dc_settings_manager_get_show_notification_contents (DcSettingsManager* self);
VALA_EXTERN gboolean dc_settings_manager_get_minimize_to_tray (DcSettingsManager* self);
VALA_EXTERN gboolean dc_settings_manager_get_animate_stickers (DcSettingsManager* self);
VALA_EXTERN gboolean dc_settings_manager_get_webxdc_apps (DcSettingsManager* self);
VALA_EXTERN gboolean dc_settings_manager_get_webxdc_follow_chat (DcSettingsManager* self);
VALA_EXTERN gboolean dc_settings_manager_get_webxdc_allow_internet (DcSettingsManager* self);
VALA_EXTERN gboolean dc_settings_manager_get_webxdc_allow_wasm (DcSettingsManager* self);
VALA_EXTERN gboolean dc_settings_manager_get_webxdc_allow_webgl (DcSettingsManager* self);
VALA_EXTERN gboolean dc_settings_manager_get_webxdc_allow_hardware_acceleration (DcSettingsManager* self);
VALA_EXTERN DcSidebarMode dc_settings_manager_get_sidebar_mode (DcSettingsManager* self);
VALA_EXTERN const gchar* dc_settings_manager_get_default_account_addr (DcSettingsManager* self);
VALA_EXTERN DcThemeOverride dc_settings_manager_get_theme_override (DcSettingsManager* self);
VALA_EXTERN DcMessageStyle dc_settings_manager_get_message_style (DcSettingsManager* self);
VALA_EXTERN DcBubbleAvatarDisplay dc_settings_manager_get_bubble_avatar_display (DcSettingsManager* self);
VALA_EXTERN gboolean dc_settings_manager_get_bubble_avatars_in_direct_chats (DcSettingsManager* self);
VALA_EXTERN const gchar* dc_settings_manager_get_accent_color (DcSettingsManager* self);
VALA_EXTERN DcBackgroundMode dc_settings_manager_get_background_mode (DcSettingsManager* self);
VALA_EXTERN const gchar* dc_settings_manager_get_background_color (DcSettingsManager* self);
static void dc_settings_manager_finalize (GObject * obj);
static GType dc_settings_manager_get_type_once (void);
static void _vala_dc_settings_manager_get_property (GObject * object,
                                             guint property_id,
                                             GValue * value,
                                             GParamSpec * pspec);
static void _vala_dc_settings_manager_set_property (GObject * object,
                                             guint property_id,
                                             const GValue * value,
                                             GParamSpec * pspec);
VALA_EXTERN GType dc_settings_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcSettingsDialog, g_object_unref)
VALA_EXTERN GType dc_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcWindow, g_object_unref)
VALA_EXTERN GType dc_rpc_client_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcRpcClient, g_object_unref)
VALA_EXTERN DcSettingsDialog* dc_settings_dialog_new (DcWindow* window,
                                          DcRpcClient* rpc);
VALA_EXTERN DcSettingsDialog* dc_settings_dialog_construct (GType object_type,
                                                DcWindow* window,
                                                DcRpcClient* rpc);
static Block72Data* block72_data_ref (Block72Data* _data72_);
static void block72_data_unref (void * _userdata_);
static AdwPreferencesGroup* dc_settings_dialog_settings_group (DcSettingsDialog* self,
                                                        AdwPreferencesPage* page,
                                                        const gchar* title);
static AdwComboRow* dc_settings_dialog_row_combo (AdwPreferencesGroup* group,
                                           const gchar* title,
                                           const gchar* subtitle,
                                           gchar** labels,
                                           gint labels_length1,
                                           guint selected);
static void __lambda325_ (Block72Data* _data72_);
static void dc_settings_dialog_apply_theme_override (DcSettingsDialog* self);
static void ___lambda325__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static void __lambda327_ (Block72Data* _data72_);
static void ___lambda327__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static void __lambda328_ (Block72Data* _data72_);
static void ___lambda328__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static void __lambda329_ (Block72Data* _data72_);
static void ___lambda329__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static AdwActionRow* dc_settings_dialog_action_row (const gchar* title,
                                             const gchar* subtitle);
static void __lambda330_ (Block72Data* _data72_);
static void ___lambda330__gtk_check_button_toggled (GtkCheckButton* _sender,
                                             gpointer self);
static void __lambda331_ (Block72Data* _data72_);
static void dc_settings_dialog_on_choose_font (DcSettingsDialog* self,
                                        GtkFontDialog* dialog,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_);
static void dc_settings_dialog_on_choose_font_finish (DcSettingsDialog* self,
                                               GAsyncResult* _res_);
static void ___lambda331__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void __lambda334_ (DcSettingsDialog* self);
static void dc_settings_dialog_sync_font_controls (DcSettingsDialog* self);
static void ___lambda334__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void dc_settings_dialog_apply_hex_to_button (GtkColorDialogButton* btn,
                                             const gchar* hex);
static void __lambda335_ (Block72Data* _data72_);
static gchar* dc_settings_dialog_hex_from_rgba (GdkRGBA* c);
static void ___lambda335__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static void __lambda336_ (Block72Data* _data72_);
static void ___lambda336__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void __lambda337_ (Block72Data* _data72_);
static void dc_settings_dialog_apply_background (DcSettingsDialog* self);
static void ___lambda337__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static void __lambda338_ (Block72Data* _data72_);
static void ___lambda338__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static void __lambda339_ (Block72Data* _data72_);
static void ___lambda339__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static void __lambda340_ (Block72Data* _data72_);
static void ___lambda340__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static GtkSwitch* dc_settings_dialog_row_switch (AdwActionRow* row,
                                          gboolean active);
static void __lambda341_ (Block72Data* _data72_);
static void ___lambda341__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static void __lambda342_ (Block72Data* _data72_);
static void ___lambda342__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
VALA_EXTERN gboolean dc_platform_is_macos (void);
static void __lambda343_ (Block72Data* _data72_);
VALA_EXTERN void dc_window_set_minimize_to_tray (DcWindow* self,
                                     gboolean enabled);
static void ___lambda343__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static void dc_settings_dialog_build_links_group (DcSettingsDialog* self,
                                           AdwPreferencesPage* page);
static void __lambda349_ (Block72Data* _data72_);
VALA_EXTERN void dc_window_set_notifications_enabled (DcWindow* self,
                                          gboolean enabled);
static void ___lambda349__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static void __lambda350_ (Block72Data* _data72_);
static void ___lambda350__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static void dc_settings_dialog_on_rpc_source_changed (DcSettingsDialog* self);
static void _dc_settings_dialog_on_rpc_source_changed_g_object_notify (GObject* _sender,
                                                                GParamSpec* pspec,
                                                                gpointer self);
static void __lambda369_ (DcSettingsDialog* self);
static void dc_settings_dialog_on_browse_rpc_server (DcSettingsDialog* self,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_);
static void dc_settings_dialog_on_browse_rpc_server_finish (DcSettingsDialog* self,
                                                     GAsyncResult* _res_);
static void ___lambda369__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void __lambda370_ (DcSettingsDialog* self);
static void dc_settings_dialog_check_rpc_updates (DcSettingsDialog* self,
                                           GAsyncReadyCallback _callback_,
                                           gpointer _user_data_);
static void dc_settings_dialog_check_rpc_updates_finish (DcSettingsDialog* self,
                                                  GAsyncResult* _res_);
static void ___lambda370__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void __lambda372_ (Block72Data* _data72_);
static void ___lambda372__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static void dc_settings_dialog_update_rpc_row (DcSettingsDialog* self);
static void __lambda373_ (DcSettingsDialog* self);
static void dc_settings_dialog_on_browse_accounts_path (DcSettingsDialog* self,
                                                 GAsyncReadyCallback _callback_,
                                                 gpointer _user_data_);
static void dc_settings_dialog_on_browse_accounts_path_finish (DcSettingsDialog* self,
                                                        GAsyncResult* _res_);
static void ___lambda373__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void __lambda374_ (DcSettingsDialog* self);
static void dc_settings_dialog_sync_accounts_path_row (DcSettingsDialog* self);
VALA_EXTERN void dc_window_reconnect_rpc_server (DcWindow* self,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_);
VALA_EXTERN void dc_window_reconnect_rpc_server_finish (DcWindow* self,
                                            GAsyncResult* _res_);
static void ___lambda374__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void __lambda375_ (DcSettingsDialog* self);
static void dc_settings_dialog_save_proxy_settings (DcSettingsDialog* self,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_);
static void dc_settings_dialog_save_proxy_settings_finish (DcSettingsDialog* self,
                                                    GAsyncResult* _res_);
static void ___lambda375__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static void __lambda376_ (DcSettingsDialog* self);
static void ___lambda376__gtk_entry_activate (GtkEntry* _sender,
                                       gpointer self);
static void __lambda377_ (DcSettingsDialog* self);
static void ___lambda377__gtk_event_controller_focus_leave (GtkEventControllerFocus* _sender,
                                                     gpointer self);
static void dc_settings_dialog_load_proxy_settings (DcSettingsDialog* self,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_);
static void dc_settings_dialog_load_proxy_settings_finish (DcSettingsDialog* self,
                                                    GAsyncResult* _res_);
static void __lambda378_ (Block72Data* _data72_);
static void ___lambda378__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static guint dc_settings_dialog_auto_download_limit_index (gint bytes);
static void __lambda379_ (Block72Data* _data72_);
VALA_EXTERN void dc_window_set_auto_download_limit (DcWindow* self,
                                        gint bytes,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_);
VALA_EXTERN void dc_window_set_auto_download_limit_finish (DcWindow* self,
                                               GAsyncResult* _res_);
static gint dc_settings_dialog_auto_download_limit_for_index (guint index);
static void ___lambda379__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
VALA_EXTERN gboolean dc_transcriber_available (void);
static void dc_settings_dialog_build_webxdc_section (DcSettingsDialog* self,
                                              AdwPreferencesPage* page);
static void __lambda387_ (DcSettingsDialog* self);
static void dc_settings_dialog_on_reset_settings (DcSettingsDialog* self,
                                           GAsyncReadyCallback _callback_,
                                           gpointer _user_data_);
static void dc_settings_dialog_on_reset_settings_finish (DcSettingsDialog* self,
                                                  GAsyncResult* _res_);
static void ___lambda387__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static Block73Data* block73_data_ref (Block73Data* _data73_);
static void block73_data_unref (void * _userdata_);
static void __lambda380_ (Block73Data* _data73_);
static void ___lambda380__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static void __lambda381_ (Block73Data* _data73_);
static void ___lambda381__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static void __lambda382_ (Block73Data* _data73_);
static void ___lambda382__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static void __lambda383_ (Block73Data* _data73_);
static void ___lambda383__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static void __lambda384_ (Block73Data* _data73_);
static void ___lambda384__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
VALA_EXTERN gboolean dc_platform_is_windows (void);
static Block74Data* block74_data_ref (Block74Data* _data74_);
static void block74_data_unref (void * _userdata_);
static void ___lambda385_ (Block74Data* _data74_);
static void ____lambda385__g_object_notify (GObject* _sender,
                                     GParamSpec* pspec,
                                     gpointer self);
static void __lambda386_ (Block73Data* _data73_);
VALA_EXTERN void dc_window_show_toast (DcWindow* self,
                           const gchar* message);
static void ___lambda386__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static Block75Data* block75_data_ref (Block75Data* _data75_);
static void block75_data_unref (void * _userdata_);
static void __lambda344_ (Block75Data* _data75_);
static void ___lambda344__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static void __lambda345_ (DcSettingsDialog* self);
static void dc_settings_dialog_prompt_tracking_filter_url (DcSettingsDialog* self,
                                                    GAsyncReadyCallback _callback_,
                                                    gpointer _user_data_);
static void dc_settings_dialog_prompt_tracking_filter_url_finish (DcSettingsDialog* self,
                                                           GAsyncResult* _res_);
static void ___lambda345__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void __lambda346_ (DcSettingsDialog* self);
static void dc_settings_dialog_update_tracking_filter (DcSettingsDialog* self,
                                                GAsyncReadyCallback _callback_,
                                                gpointer _user_data_);
static void dc_settings_dialog_update_tracking_filter_finish (DcSettingsDialog* self,
                                                       GAsyncResult* _res_);
static void ___lambda346__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void __lambda347_ (Block75Data* _data75_);
static void dc_settings_dialog_sync_tracking_filter_rows (DcSettingsDialog* self);
static void ___lambda347__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static void __lambda348_ (Block75Data* _data75_);
static void ___lambda348__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
VALA_EXTERN gint dc_remove_param_filter_get_rule_count (DcRemoveParamFilter* self);
VALA_EXTERN const gchar* dc_remove_param_filter_get_version (DcRemoveParamFilter* self);
VALA_EXTERN GDateTime* dc_remove_param_filter_cache_time (void);
static void dc_settings_dialog_prompt_tracking_filter_url_data_free (gpointer _data);
static gboolean dc_settings_dialog_prompt_tracking_filter_url_co (DcSettingsDialogPromptTrackingFilterUrlData* _data_);
static void dc_settings_dialog_prompt_tracking_filter_url_ready (GObject* source_object,
                                                          GAsyncResult* _res_,
                                                          gpointer _user_data_);
static void dc_settings_dialog_update_tracking_filter_data_free (gpointer _data);
static gboolean dc_settings_dialog_update_tracking_filter_co (DcSettingsDialogUpdateTrackingFilterData* _data_);
VALA_EXTERN void dc_window_refresh_tracking_filter (DcWindow* self,
                                        gboolean force,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_);
VALA_EXTERN gchar* dc_window_refresh_tracking_filter_finish (DcWindow* self,
                                                 GAsyncResult* _res_);
static void dc_settings_dialog_update_tracking_filter_ready (GObject* source_object,
                                                      GAsyncResult* _res_,
                                                      gpointer _user_data_);
static void dc_settings_dialog_on_choose_font_data_free (gpointer _data);
static gboolean dc_settings_dialog_on_choose_font_co (DcSettingsDialogOnChooseFontData* _data_);
static void dc_settings_dialog_on_choose_font_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_);
VALA_EXTERN gboolean dc_is_dialog_dismissal (GError* _error_);
VALA_EXTERN void dc_show_error (GtkWidget* parent,
                    const gchar* message);
static void dc_settings_dialog_load_proxy_settings_data_free (gpointer _data);
static gboolean dc_settings_dialog_load_proxy_settings_co (DcSettingsDialogLoadProxySettingsData* _data_);
VALA_EXTERN gboolean dc_rpc_client_get_is_connected (DcRpcClient* self);
VALA_EXTERN gint dc_rpc_client_get_account_id (DcRpcClient* self);
static void dc_settings_dialog_set_proxy_controls_sensitive (DcSettingsDialog* self,
                                                      gboolean sensitive);
VALA_EXTERN void dc_rpc_client_get_config (DcRpcClient* self,
                               const gchar* key,
                               gint acct_id,
                               GAsyncReadyCallback _callback_,
                               gpointer _user_data_);
VALA_EXTERN gchar* dc_rpc_client_get_config_finish (DcRpcClient* self,
                                        GAsyncResult* _res_,
                                        GError** error);
static void dc_settings_dialog_load_proxy_settings_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_);
static gchar* dc_settings_dialog_first_proxy_url (const gchar* urls);
static void dc_settings_dialog_normalize_proxy_url_data_free (gpointer _data);
static void dc_settings_dialog_normalize_proxy_url (DcSettingsDialog* self,
                                             const gchar* url,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_);
static gchar* dc_settings_dialog_normalize_proxy_url_finish (DcSettingsDialog* self,
                                                      GAsyncResult* _res_);
static gboolean dc_settings_dialog_normalize_proxy_url_co (DcSettingsDialogNormalizeProxyUrlData* _data_);
VALA_EXTERN void dc_rpc_client_check_qr (DcRpcClient* self,
                             gint acct_id,
                             const gchar* qr_text,
                             GAsyncReadyCallback _callback_,
                             gpointer _user_data_);
VALA_EXTERN JsonObject* dc_rpc_client_check_qr_finish (DcRpcClient* self,
                                           GAsyncResult* _res_,
                                           GError** error);
static void dc_settings_dialog_normalize_proxy_url_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_);
static void dc_settings_dialog_save_proxy_settings_data_free (gpointer _data);
static gboolean dc_settings_dialog_save_proxy_settings_co (DcSettingsDialogSaveProxySettingsData* _data_);
static void dc_settings_dialog_save_proxy_settings_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_batch_set_config (DcRpcClient* self,
                                     const gchar* key,
                                     const gchar* val,
                                     gint acct_id,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_batch_set_config_finish (DcRpcClient* self,
                                            GAsyncResult* _res_,
                                            GError** error);
VALA_EXTERN void dc_rpc_client_stop_io (DcRpcClient* self,
                            gint acct_id,
                            GAsyncReadyCallback _callback_,
                            gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_stop_io_finish (DcRpcClient* self,
                                   GAsyncResult* _res_,
                                   GError** error);
VALA_EXTERN void dc_rpc_client_start_io (DcRpcClient* self,
                             gint acct_id,
                             GAsyncReadyCallback _callback_,
                             gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_start_io_finish (DcRpcClient* self,
                                    GAsyncResult* _res_,
                                    GError** error);
static void dc_settings_dialog_sync_rpc_source_dropdown (DcSettingsDialog* self);
VALA_EXTERN gchar* dc_account_finder_find_rpc_server (const gchar* custom_path,
                                          DcRpcServerSource source);
static void dc_settings_dialog_update_rpc_version_row (DcSettingsDialog* self,
                                                const gchar* rpc_path,
                                                GAsyncReadyCallback _callback_,
                                                gpointer _user_data_);
static void dc_settings_dialog_update_rpc_version_row_finish (DcSettingsDialog* self,
                                                       GAsyncResult* _res_);
static void dc_settings_dialog_update_rpc_version_row_data_free (gpointer _data);
static gboolean dc_settings_dialog_update_rpc_version_row_co (DcSettingsDialogUpdateRpcVersionRowData* _data_);
static void dc_settings_dialog_update_rpc_version_row_ready (GObject* source_object,
                                                      GAsyncResult* _res_,
                                                      gpointer _user_data_);
VALA_EXTERN gchar* dc_rpc_installer_extract_version (const gchar* text);
static void dc_settings_dialog_confirm_update_dialog_data_free (gpointer _data);
static void dc_settings_dialog_confirm_update_dialog (DcSettingsDialog* self,
                                               const gchar* title,
                                               const gchar* body,
                                               const gchar* action_label,
                                               GAsyncReadyCallback _callback_,
                                               gpointer _user_data_);
static gboolean dc_settings_dialog_confirm_update_dialog_finish (DcSettingsDialog* self,
                                                          GAsyncResult* _res_);
static gboolean dc_settings_dialog_confirm_update_dialog_co (DcSettingsDialogConfirmUpdateDialogData* _data_);
static void dc_settings_dialog_confirm_update_dialog_ready (GObject* source_object,
                                                     GAsyncResult* _res_,
                                                     gpointer _user_data_);
static void dc_settings_dialog_check_rpc_updates_data_free (gpointer _data);
static gboolean dc_settings_dialog_check_rpc_updates_co (DcSettingsDialogCheckRpcUpdatesData* _data_);
VALA_EXTERN void dc_rpc_installer_fetch_latest_tag (GAsyncReadyCallback _callback_,
                                        gpointer _user_data_);
VALA_EXTERN gchar* dc_rpc_installer_fetch_latest_tag_finish (GAsyncResult* _res_,
                                                 GError** error);
static void dc_settings_dialog_check_rpc_updates_ready (GObject* source_object,
                                                 GAsyncResult* _res_,
                                                 gpointer _user_data_);
VALA_EXTERN gchar* dc_account_finder_get_managed_rpc_path (void);
static void dc_settings_dialog_open_rpc_download_page (DcSettingsDialog* self,
                                                GAsyncReadyCallback _callback_,
                                                gpointer _user_data_);
static void dc_settings_dialog_open_rpc_download_page_finish (DcSettingsDialog* self,
                                                       GAsyncResult* _res_);
VALA_EXTERN gboolean dc_rpc_installer_can_auto_install (void);
static void dc_settings_dialog_install_managed_server (DcSettingsDialog* self,
                                                GAsyncReadyCallback _callback_,
                                                gpointer _user_data_);
static void dc_settings_dialog_install_managed_server_finish (DcSettingsDialog* self,
                                                       GAsyncResult* _res_);
static void dc_settings_dialog_on_browse_rpc_server_data_free (gpointer _data);
static gboolean dc_settings_dialog_on_browse_rpc_server_co (DcSettingsDialogOnBrowseRpcServerData* _data_);
static void dc_settings_dialog_on_browse_rpc_server_ready (GObject* source_object,
                                                    GAsyncResult* _res_,
                                                    gpointer _user_data_);
static void dc_settings_dialog_on_browse_accounts_path_data_free (gpointer _data);
static gboolean dc_settings_dialog_on_browse_accounts_path_co (DcSettingsDialogOnBrowseAccountsPathData* _data_);
static void dc_settings_dialog_on_browse_accounts_path_ready (GObject* source_object,
                                                       GAsyncResult* _res_,
                                                       gpointer _user_data_);
static void dc_settings_dialog_install_managed_server_data_free (gpointer _data);
static gboolean dc_settings_dialog_install_managed_server_co (DcSettingsDialogInstallManagedServerData* _data_);
static void dc_settings_dialog_install_managed_server_ready (GObject* source_object,
                                                      GAsyncResult* _res_,
                                                      gpointer _user_data_);
VALA_EXTERN GType dc_rpc_installer_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcRpcInstaller, g_object_unref)
VALA_EXTERN DcRpcInstaller* dc_rpc_installer_new (void);
VALA_EXTERN DcRpcInstaller* dc_rpc_installer_construct (GType object_type);
static void __lambda371_ (DcSettingsDialog* self,
                   gint64 received,
                   gint64 total);
static void ___lambda371__dc_rpc_installer_progress (DcRpcInstaller* _sender,
                                              gint64 received,
                                              gint64 total,
                                              gpointer self);
VALA_EXTERN void dc_rpc_installer_download_latest (DcRpcInstaller* self,
                                       GAsyncReadyCallback _callback_,
                                       gpointer _user_data_);
VALA_EXTERN gchar* dc_rpc_installer_download_latest_finish (DcRpcInstaller* self,
                                                GAsyncResult* _res_,
                                                GError** error);
static void dc_settings_dialog_open_rpc_download_page_data_free (gpointer _data);
static gboolean dc_settings_dialog_open_rpc_download_page_co (DcSettingsDialogOpenRpcDownloadPageData* _data_);
static void dc_settings_dialog_open_rpc_download_page_ready (GObject* source_object,
                                                      GAsyncResult* _res_,
                                                      gpointer _user_data_);
static void dc_settings_dialog_on_reset_settings_data_free (gpointer _data);
static gboolean dc_settings_dialog_on_reset_settings_co (DcSettingsDialogOnResetSettingsData* _data_);
VALA_EXTERN void dc_confirm_action (GtkWidget* parent,
                        const gchar* title,
                        const gchar* body,
                        const gchar* action_id,
                        const gchar* action_label,
                        GAsyncReadyCallback _callback_,
                        gpointer _user_data_);
VALA_EXTERN gboolean dc_confirm_action_finish (GAsyncResult* _res_);
static void dc_settings_dialog_on_reset_settings_ready (GObject* source_object,
                                                 GAsyncResult* _res_,
                                                 gpointer _user_data_);
static void dc_settings_dialog_delete_parla_config (void);
VALA_EXTERN void dc_window_quit_application (DcWindow* self);
VALA_EXTERN GType dc_application_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcApplication, g_object_unref)
VALA_EXTERN void dc_application_apply_background (DcApplication* self,
                                      DcBackgroundMode mode,
                                      const gchar* hex);
VALA_EXTERN void dc_application_apply_theme_override (DcApplication* self,
                                          DcThemeOverride theme);
static void dc_settings_dialog_finalize (GObject * obj);
static GType dc_settings_dialog_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static GType
dc_sidebar_mode_get_type_once (void)
{
	static const GEnumValue values[] = {{DC_SIDEBAR_MODE_FULL, "DC_SIDEBAR_MODE_FULL", "full"}, {DC_SIDEBAR_MODE_COMPACT, "DC_SIDEBAR_MODE_COMPACT", "compact"}, {DC_SIDEBAR_MODE_HIDDEN, "DC_SIDEBAR_MODE_HIDDEN", "hidden"}, {0, NULL, NULL}};
	GType dc_sidebar_mode_type_id;
	dc_sidebar_mode_type_id = g_enum_register_static ("DcSidebarMode", values);
	return dc_sidebar_mode_type_id;
}

GType
dc_sidebar_mode_get_type (void)
{
	static volatile gsize dc_sidebar_mode_type_id__once = 0;
	if (g_once_init_enter (&dc_sidebar_mode_type_id__once)) {
		GType dc_sidebar_mode_type_id;
		dc_sidebar_mode_type_id = dc_sidebar_mode_get_type_once ();
		g_once_init_leave (&dc_sidebar_mode_type_id__once, dc_sidebar_mode_type_id);
	}
	return dc_sidebar_mode_type_id__once;
}

static GType
dc_theme_override_get_type_once (void)
{
	static const GEnumValue values[] = {{DC_THEME_OVERRIDE_SYSTEM, "DC_THEME_OVERRIDE_SYSTEM", "system"}, {DC_THEME_OVERRIDE_LIGHT, "DC_THEME_OVERRIDE_LIGHT", "light"}, {DC_THEME_OVERRIDE_DARK, "DC_THEME_OVERRIDE_DARK", "dark"}, {0, NULL, NULL}};
	GType dc_theme_override_type_id;
	dc_theme_override_type_id = g_enum_register_static ("DcThemeOverride", values);
	return dc_theme_override_type_id;
}

GType
dc_theme_override_get_type (void)
{
	static volatile gsize dc_theme_override_type_id__once = 0;
	if (g_once_init_enter (&dc_theme_override_type_id__once)) {
		GType dc_theme_override_type_id;
		dc_theme_override_type_id = dc_theme_override_get_type_once ();
		g_once_init_leave (&dc_theme_override_type_id__once, dc_theme_override_type_id);
	}
	return dc_theme_override_type_id__once;
}

static GType
dc_message_style_get_type_once (void)
{
	static const GEnumValue values[] = {{DC_MESSAGE_STYLE_BUBBLES, "DC_MESSAGE_STYLE_BUBBLES", "bubbles"}, {DC_MESSAGE_STYLE_IRC, "DC_MESSAGE_STYLE_IRC", "irc"}, {DC_MESSAGE_STYLE_WORKSPACE, "DC_MESSAGE_STYLE_WORKSPACE", "workspace"}, {0, NULL, NULL}};
	GType dc_message_style_type_id;
	dc_message_style_type_id = g_enum_register_static ("DcMessageStyle", values);
	return dc_message_style_type_id;
}

GType
dc_message_style_get_type (void)
{
	static volatile gsize dc_message_style_type_id__once = 0;
	if (g_once_init_enter (&dc_message_style_type_id__once)) {
		GType dc_message_style_type_id;
		dc_message_style_type_id = dc_message_style_get_type_once ();
		g_once_init_leave (&dc_message_style_type_id__once, dc_message_style_type_id);
	}
	return dc_message_style_type_id__once;
}

static GType
dc_bubble_avatar_display_get_type_once (void)
{
	static const GEnumValue values[] = {{DC_BUBBLE_AVATAR_DISPLAY_NONE, "DC_BUBBLE_AVATAR_DISPLAY_NONE", "none"}, {DC_BUBBLE_AVATAR_DISPLAY_OTHER, "DC_BUBBLE_AVATAR_DISPLAY_OTHER", "other"}, {DC_BUBBLE_AVATAR_DISPLAY_BOTH, "DC_BUBBLE_AVATAR_DISPLAY_BOTH", "both"}, {0, NULL, NULL}};
	GType dc_bubble_avatar_display_type_id;
	dc_bubble_avatar_display_type_id = g_enum_register_static ("DcBubbleAvatarDisplay", values);
	return dc_bubble_avatar_display_type_id;
}

GType
dc_bubble_avatar_display_get_type (void)
{
	static volatile gsize dc_bubble_avatar_display_type_id__once = 0;
	if (g_once_init_enter (&dc_bubble_avatar_display_type_id__once)) {
		GType dc_bubble_avatar_display_type_id;
		dc_bubble_avatar_display_type_id = dc_bubble_avatar_display_get_type_once ();
		g_once_init_leave (&dc_bubble_avatar_display_type_id__once, dc_bubble_avatar_display_type_id);
	}
	return dc_bubble_avatar_display_type_id__once;
}

static GType
dc_background_mode_get_type_once (void)
{
	static const GEnumValue values[] = {{DC_BACKGROUND_MODE_SYSTEM, "DC_BACKGROUND_MODE_SYSTEM", "system"}, {DC_BACKGROUND_MODE_SOLID, "DC_BACKGROUND_MODE_SOLID", "solid"}, {DC_BACKGROUND_MODE_GRADIENT, "DC_BACKGROUND_MODE_GRADIENT", "gradient"}, {0, NULL, NULL}};
	GType dc_background_mode_type_id;
	dc_background_mode_type_id = g_enum_register_static ("DcBackgroundMode", values);
	return dc_background_mode_type_id;
}

GType
dc_background_mode_get_type (void)
{
	static volatile gsize dc_background_mode_type_id__once = 0;
	if (g_once_init_enter (&dc_background_mode_type_id__once)) {
		GType dc_background_mode_type_id;
		dc_background_mode_type_id = dc_background_mode_get_type_once ();
		g_once_init_leave (&dc_background_mode_type_id__once, dc_background_mode_type_id);
	}
	return dc_background_mode_type_id__once;
}

PangoStyle
dc_font_attribute_pango_style (DcFontAttribute self)
{
	PangoStyle _tmp0_ = 0;
	gboolean _tmp1_ = FALSE;
	PangoStyle result;
	if (self == DC_FONT_ATTRIBUTE_ITALIC) {
		_tmp1_ = TRUE;
	} else {
		_tmp1_ = self == DC_FONT_ATTRIBUTE_BOLD_ITALIC;
	}
	if (_tmp1_) {
		_tmp0_ = PANGO_STYLE_ITALIC;
	} else {
		_tmp0_ = PANGO_STYLE_NORMAL;
	}
	result = _tmp0_;
	return result;
}

PangoWeight
dc_font_attribute_pango_weight (DcFontAttribute self)
{
	PangoWeight _tmp0_ = 0;
	gboolean _tmp1_ = FALSE;
	PangoWeight result;
	if (self == DC_FONT_ATTRIBUTE_BOLD) {
		_tmp1_ = TRUE;
	} else {
		_tmp1_ = self == DC_FONT_ATTRIBUTE_BOLD_ITALIC;
	}
	if (_tmp1_) {
		_tmp0_ = PANGO_WEIGHT_BOLD;
	} else {
		_tmp0_ = PANGO_WEIGHT_NORMAL;
	}
	result = _tmp0_;
	return result;
}

gchar*
dc_font_attribute_css_style (DcFontAttribute self)
{
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_;
	gchar* result;
	if (dc_font_attribute_pango_style (self) == PANGO_STYLE_ITALIC) {
		_tmp0_ = "italic";
	} else {
		_tmp0_ = "normal";
	}
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

gchar*
dc_font_attribute_css_weight (DcFontAttribute self)
{
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_;
	gchar* result;
	if (dc_font_attribute_pango_weight (self) == PANGO_WEIGHT_BOLD) {
		_tmp0_ = "bold";
	} else {
		_tmp0_ = "normal";
	}
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

static GType
dc_font_attribute_get_type_once (void)
{
	static const GEnumValue values[] = {{DC_FONT_ATTRIBUTE_REGULAR, "DC_FONT_ATTRIBUTE_REGULAR", "regular"}, {DC_FONT_ATTRIBUTE_ITALIC, "DC_FONT_ATTRIBUTE_ITALIC", "italic"}, {DC_FONT_ATTRIBUTE_BOLD, "DC_FONT_ATTRIBUTE_BOLD", "bold"}, {DC_FONT_ATTRIBUTE_BOLD_ITALIC, "DC_FONT_ATTRIBUTE_BOLD_ITALIC", "bold-italic"}, {0, NULL, NULL}};
	GType dc_font_attribute_type_id;
	dc_font_attribute_type_id = g_enum_register_static ("DcFontAttribute", values);
	return dc_font_attribute_type_id;
}

GType
dc_font_attribute_get_type (void)
{
	static volatile gsize dc_font_attribute_type_id__once = 0;
	if (g_once_init_enter (&dc_font_attribute_type_id__once)) {
		GType dc_font_attribute_type_id;
		dc_font_attribute_type_id = dc_font_attribute_get_type_once ();
		g_once_init_leave (&dc_font_attribute_type_id__once, dc_font_attribute_type_id);
	}
	return dc_font_attribute_type_id__once;
}

static inline gpointer
dc_settings_manager_get_instance_private (DcSettingsManager* self)
{
	return G_STRUCT_MEMBER_P (self, DcSettingsManager_private_offset);
}

gchar*
dc_settings_manager_get_config_path (void)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	_tmp0_ = g_get_user_config_dir ();
	_tmp1_ = g_build_filename (_tmp0_, "parla", "settings.ini", NULL);
	result = _tmp1_;
	return result;
}

/**
         * True when this build pins the deltachat-rpc-server to a fixed binary
         * (meson -Drpc_server_path=...). Such builds always use that binary as
         * the Custom server and never auto-update the engine.
         */
gboolean
dc_settings_manager_rpc_server_path_is_fixed (void)
{
	gint _tmp0_;
	gint _tmp1_;
	gboolean result;
	_tmp0_ = strlen (PARLA_RPC_SERVER_PATH);
	_tmp1_ = _tmp0_;
	result = _tmp1_ > 0;
	return result;
}

/** Server path to actually use: the pinned one if set, else the user's. */
gchar*
dc_settings_manager_effective_rpc_server_path (DcSettingsManager* self)
{
	const gchar* _tmp0_ = NULL;
	gchar* _tmp2_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	if (dc_settings_manager_rpc_server_path_is_fixed ()) {
		_tmp0_ = PARLA_RPC_SERVER_PATH;
	} else {
		const gchar* _tmp1_;
		_tmp1_ = self->priv->_rpc_server_path;
		_tmp0_ = _tmp1_;
	}
	_tmp2_ = g_strdup (_tmp0_);
	result = _tmp2_;
	return result;
}

/** Server source to actually use: Custom when pinned, else the user's. */
DcRpcServerSource
dc_settings_manager_effective_rpc_server_source (DcSettingsManager* self)
{
	DcRpcServerSource _tmp0_ = 0;
	DcRpcServerSource result;
	g_return_val_if_fail (self != NULL, 0);
	if (dc_settings_manager_rpc_server_path_is_fixed ()) {
		_tmp0_ = DC_RPC_SERVER_SOURCE_CUSTOM;
	} else {
		DcRpcServerSource _tmp1_;
		_tmp1_ = self->priv->_rpc_server_source;
		_tmp0_ = _tmp1_;
	}
	result = _tmp0_;
	return result;
}

/** Whether Parla may check for / install engine updates. */
gboolean
dc_settings_manager_rpc_auto_update_enabled (DcSettingsManager* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	if (!dc_settings_manager_rpc_server_path_is_fixed ()) {
		gboolean _tmp1_;
		_tmp1_ = self->priv->_rpc_check_updates_on_startup;
		_tmp0_ = _tmp1_;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

gchar*
dc_settings_manager_default_accounts_path (DcSettingsManager* self)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = dc_account_finder_get_data_dir ();
	_tmp1_ = _tmp0_;
	_tmp2_ = g_build_filename (_tmp1_, "accounts", NULL);
	_tmp3_ = _tmp2_;
	_g_free0 (_tmp1_);
	result = _tmp3_;
	return result;
}

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

static gchar
string_get (const gchar* self,
            glong index)
{
	gchar _tmp0_;
	gchar result;
	g_return_val_if_fail (self != NULL, '\0');
	_tmp0_ = ((gchar*) self)[index];
	result = _tmp0_;
	return result;
}

static gchar*
string_slice (const gchar* self,
              glong start,
              glong end)
{
	glong string_length = 0L;
	gint _tmp0_;
	gint _tmp1_;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	gchar* _tmp4_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = strlen (self);
	_tmp1_ = _tmp0_;
	string_length = (glong) _tmp1_;
	if (start < ((glong) 0)) {
		start = string_length + start;
	}
	if (end < ((glong) 0)) {
		end = string_length + end;
	}
	if (start >= ((glong) 0)) {
		_tmp2_ = start <= string_length;
	} else {
		_tmp2_ = FALSE;
	}
	g_return_val_if_fail (_tmp2_, NULL);
	if (end >= ((glong) 0)) {
		_tmp3_ = end <= string_length;
	} else {
		_tmp3_ = FALSE;
	}
	g_return_val_if_fail (_tmp3_, NULL);
	g_return_val_if_fail (start <= end, NULL);
	_tmp4_ = g_strndup (((gchar*) self) + start, (gsize) (end - start));
	result = _tmp4_;
	return result;
}

static gchar*
dc_settings_manager_normalize_accounts_path (DcSettingsManager* self,
                                             const gchar* value)
{
	gchar* path = NULL;
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (value != NULL, NULL);
	_tmp0_ = string_strip (value);
	path = _tmp0_;
	while (TRUE) {
		gboolean _tmp1_ = FALSE;
		const gchar* _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		gboolean _tmp8_ = FALSE;
		const gchar* _tmp9_;
		gint _tmp10_;
		gint _tmp11_;
		const gchar* _tmp13_;
		const gchar* _tmp14_;
		gint _tmp15_;
		gint _tmp16_;
		gchar* _tmp17_;
		_tmp2_ = path;
		_tmp3_ = strlen (_tmp2_);
		_tmp4_ = _tmp3_;
		if (_tmp4_ > 1) {
			gboolean _tmp5_ = FALSE;
			const gchar* _tmp6_;
			_tmp6_ = path;
			if (g_str_has_suffix (_tmp6_, "/")) {
				_tmp5_ = TRUE;
			} else {
				const gchar* _tmp7_;
				_tmp7_ = path;
				_tmp5_ = g_str_has_suffix (_tmp7_, "\\");
			}
			_tmp1_ = _tmp5_;
		} else {
			_tmp1_ = FALSE;
		}
		if (!_tmp1_) {
			break;
		}
		_tmp9_ = path;
		_tmp10_ = strlen (_tmp9_);
		_tmp11_ = _tmp10_;
		if (_tmp11_ == 3) {
			const gchar* _tmp12_;
			_tmp12_ = path;
			_tmp8_ = string_get (_tmp12_, (glong) 1) == ':';
		} else {
			_tmp8_ = FALSE;
		}
		if (_tmp8_) {
			break;
		}
		_tmp13_ = path;
		_tmp14_ = path;
		_tmp15_ = strlen (_tmp14_);
		_tmp16_ = _tmp15_;
		_tmp17_ = string_slice (_tmp13_, (glong) 0, (glong) (_tmp16_ - 1));
		_g_free0 (path);
		path = _tmp17_;
	}
	result = path;
	return result;
}

gboolean
dc_settings_manager_is_default_accounts_path (DcSettingsManager* self,
                                              const gchar* value)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gboolean _tmp4_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (value != NULL, FALSE);
	_tmp0_ = dc_settings_manager_normalize_accounts_path (self, value);
	_tmp1_ = _tmp0_;
	_tmp2_ = dc_settings_manager_default_accounts_path (self);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_strcmp0 (_tmp1_, _tmp3_) == 0;
	_g_free0 (_tmp3_);
	_g_free0 (_tmp1_);
	result = _tmp4_;
	return result;
}

gboolean
dc_settings_manager_uses_default_accounts_path (DcSettingsManager* self)
{
	const gchar* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_accounts_path;
	result = dc_settings_manager_is_default_accounts_path (self, _tmp0_);
	return result;
}

gchar*
dc_settings_manager_effective_accounts_path (DcSettingsManager* self)
{
	gchar* _tmp0_ = NULL;
	const gchar* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gchar* _tmp7_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp1_ = self->priv->_accounts_path;
	_tmp2_ = strlen (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_ > 0) {
		const gchar* _tmp4_;
		gchar* _tmp5_;
		_tmp4_ = self->priv->_accounts_path;
		_tmp5_ = g_strdup (_tmp4_);
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp5_;
	} else {
		gchar* _tmp6_;
		_tmp6_ = dc_settings_manager_default_accounts_path (self);
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp6_;
	}
	_tmp7_ = _tmp0_;
	_tmp0_ = NULL;
	result = _tmp7_;
	_g_free0 (_tmp0_);
	return result;
}

void
dc_settings_manager_load (DcSettingsManager* self)
{
	GKeyFile* kf = NULL;
	GKeyFile* _tmp0_;
	DcMarkdownMode _tmp3_;
	DcCodeTheme _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gboolean _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	const gchar* _tmp16_;
	gint source = 0;
	gint sb = 0;
	gchar* _tmp17_;
	gchar* _tmp18_;
	gint theme = 0;
	gint ms = 0;
	gint bad = 0;
	gchar* _tmp19_;
	gchar* _tmp20_;
	gint bm = 0;
	gchar* _tmp21_;
	gchar* _tmp22_;
	gchar* _tmp23_;
	gchar* _tmp24_;
	gchar* _tmp25_;
	gchar* _tmp26_;
	gint fa = 0;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_key_file_new ();
	kf = _tmp0_;
	{
		gchar* _tmp1_;
		gchar* _tmp2_;
		_tmp1_ = dc_settings_manager_get_config_path ();
		_tmp2_ = _tmp1_;
		g_key_file_load_from_file (kf, _tmp2_, G_KEY_FILE_NONE, &_inner_error0_);
		_g_free0 (_tmp2_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_key_file_unref0 (kf);
		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;
	}
	dc_settings_manager_set_double_click_action (self, dc_settings_manager_kf_enum (kf, "double_click_action", 0, 5));
	dc_settings_manager_set_markdown_mode (self, dc_settings_manager_kf_markdown_mode (kf));
	_tmp3_ = self->priv->_markdown_mode;
	dc_markdown_mode = _tmp3_;
	dc_settings_manager_set_code_theme (self, (DcCodeTheme) dc_settings_manager_kf_enum (kf, "code_theme", (gint) DC_CODE_THEME_ADAPTIVE, (gint) DC_CODE_THEME_NONE));
	_tmp4_ = self->priv->_code_theme;
	dc_syntax_highlight_theme = _tmp4_;
	dc_settings_manager_set_shift_enter_sends (self, dc_settings_manager_kf_bool (kf, "shift_enter_sends", FALSE));
	dc_settings_manager_set_clean_pasted_links (self, dc_settings_manager_kf_bool (kf, "clean_pasted_links", FALSE));
	dc_settings_manager_set_tracking_filter_enabled (self, dc_settings_manager_kf_bool (kf, "tracking_filter_enabled", FALSE));
	_tmp5_ = dc_settings_manager_kf_str (kf, "tracking_filter_url", "");
	_tmp6_ = _tmp5_;
	_tmp7_ = string_strip (_tmp6_);
	_tmp8_ = _tmp7_;
	dc_settings_manager_set_tracking_filter_url (self, _tmp8_);
	_g_free0 (_tmp8_);
	_g_free0 (_tmp6_);
	dc_settings_manager_apply_tracking_filter (self);
	dc_settings_manager_set_link_previews (self, dc_settings_manager_kf_bool (kf, "link_previews", FALSE));
	dc_settings_manager_set_notifications_enabled (self, dc_settings_manager_kf_bool (kf, "notifications_enabled", TRUE));
	dc_settings_manager_set_show_notification_contents (self, dc_settings_manager_kf_bool (kf, "show_notification_contents", TRUE));
	dc_settings_manager_set_minimize_to_tray (self, dc_settings_manager_kf_bool (kf, "minimize_to_tray", FALSE));
	dc_settings_manager_set_system_audio_player (self, dc_settings_manager_kf_bool (kf, "system_audio_player", FALSE));
	_tmp9_ = self->priv->_system_audio_player;
	dc_audio_player_prefer_system = _tmp9_;
	dc_settings_manager_set_animate_stickers (self, dc_settings_manager_kf_bool (kf, "animate_stickers", TRUE));
	dc_settings_manager_set_webxdc_apps (self, dc_settings_manager_kf_bool (kf, "webxdc_apps", TRUE));
	dc_settings_manager_set_webxdc_follow_chat (self, dc_settings_manager_kf_bool (kf, "webxdc_follow_chat", FALSE));
	dc_settings_manager_set_webxdc_allow_internet (self, dc_settings_manager_kf_bool (kf, "webxdc_allow_internet", DC_WEBXDC_SECURITY_SAFE_ALLOW_INTERNET));
	dc_settings_manager_set_webxdc_allow_wasm (self, dc_settings_manager_kf_bool (kf, "webxdc_allow_wasm", DC_WEBXDC_SECURITY_SAFE_ALLOW_WASM));
	dc_settings_manager_set_webxdc_allow_webgl (self, dc_settings_manager_kf_bool (kf, "webxdc_allow_webgl", DC_WEBXDC_SECURITY_SAFE_ALLOW_WEBGL));
	dc_settings_manager_set_webxdc_allow_hardware_acceleration (self, dc_settings_manager_kf_bool (kf, "webxdc_allow_hardware_acceleration", DC_WEBXDC_SECURITY_SAFE_ALLOW_HARDWARE_ACCELERATION));
	dc_settings_manager_set_auto_download_limit (self, dc_settings_manager_normalize_auto_download_limit (dc_settings_manager_kf_int (kf, "auto_download_limit", DC_AUTO_DOWNLOAD_DEFAULT)));
	_tmp10_ = dc_settings_manager_kf_str (kf, "rpc_server_path", "");
	_tmp11_ = _tmp10_;
	dc_settings_manager_set_rpc_server_path (self, _tmp11_);
	_g_free0 (_tmp11_);
	_tmp12_ = dc_settings_manager_kf_str (kf, "accounts_path", "");
	_tmp13_ = _tmp12_;
	_tmp14_ = dc_settings_manager_normalize_accounts_path (self, _tmp13_);
	_tmp15_ = _tmp14_;
	dc_settings_manager_set_accounts_path (self, _tmp15_);
	_g_free0 (_tmp15_);
	_g_free0 (_tmp13_);
	_tmp16_ = self->priv->_accounts_path;
	if (dc_settings_manager_is_default_accounts_path (self, _tmp16_)) {
		dc_settings_manager_set_accounts_path (self, "");
	}
	source = dc_settings_manager_kf_enum (kf, "rpc_server_source", (gint) DC_RPC_SERVER_SOURCE_AUTO, 1);
	dc_settings_manager_set_rpc_server_source (self, (DcRpcServerSource) source);
	dc_settings_manager_set_rpc_check_updates_on_startup (self, dc_settings_manager_kf_bool (kf, "rpc_check_updates_on_startup", TRUE));
	sb = dc_settings_manager_kf_enum (kf, "sidebar_mode", (gint) DC_SIDEBAR_MODE_FULL, 2);
	dc_settings_manager_set_sidebar_mode (self, (DcSidebarMode) sb);
	_tmp17_ = dc_settings_manager_kf_str (kf, "default_account_addr", "");
	_tmp18_ = _tmp17_;
	dc_settings_manager_set_default_account_addr (self, _tmp18_);
	_g_free0 (_tmp18_);
	theme = dc_settings_manager_kf_enum (kf, "theme_override", (gint) DC_THEME_OVERRIDE_SYSTEM, 2);
	dc_settings_manager_set_theme_override (self, (DcThemeOverride) theme);
	ms = dc_settings_manager_kf_enum (kf, "message_style", (gint) DC_MESSAGE_STYLE_BUBBLES, 2);
	dc_settings_manager_set_message_style (self, (DcMessageStyle) ms);
	bad = dc_settings_manager_kf_enum (kf, "bubble_avatar_display", (gint) DC_BUBBLE_AVATAR_DISPLAY_NONE, 2);
	dc_settings_manager_set_bubble_avatar_display (self, (DcBubbleAvatarDisplay) bad);
	dc_settings_manager_set_bubble_avatars_in_direct_chats (self, dc_settings_manager_kf_bool (kf, "bubble_avatars_in_direct_chats", FALSE));
	_tmp19_ = dc_settings_manager_kf_str (kf, "accent_color", "");
	_tmp20_ = _tmp19_;
	dc_settings_manager_set_accent_color (self, _tmp20_);
	_g_free0 (_tmp20_);
	bm = dc_settings_manager_kf_enum (kf, "background_mode", (gint) DC_BACKGROUND_MODE_SYSTEM, 2);
	dc_settings_manager_set_background_mode (self, (DcBackgroundMode) bm);
	_tmp21_ = dc_settings_manager_kf_str (kf, "background_color", "");
	_tmp22_ = _tmp21_;
	dc_settings_manager_set_background_color (self, _tmp22_);
	_g_free0 (_tmp22_);
	_tmp23_ = dc_settings_manager_kf_str (kf, "font_family", "");
	_tmp24_ = _tmp23_;
	_tmp25_ = string_strip (_tmp24_);
	_tmp26_ = _tmp25_;
	dc_settings_manager_set_font_family (self, _tmp26_);
	_g_free0 (_tmp26_);
	_g_free0 (_tmp24_);
	fa = dc_settings_manager_kf_enum (kf, "font_attribute", (gint) DC_FONT_ATTRIBUTE_REGULAR, 3);
	dc_settings_manager_set_font_attribute (self, (DcFontAttribute) fa);
	dc_settings_manager_set_font_size (self, dc_settings_manager_clamp_font_size (dc_settings_manager_kf_int (kf, "font_size", DC_FONT_SIZE_SYSTEM)));
	_g_key_file_unref0 (kf);
}

static gint
dc_settings_manager_kf_int (GKeyFile* kf,
                            const gchar* k,
                            gint d)
{
	gint _tmp1_ = -1;
	GError* _inner_error0_ = NULL;
	gint result;
	g_return_val_if_fail (kf != NULL, -1);
	g_return_val_if_fail (k != NULL, -1);
	{
		gint _tmp0_ = 0;
		_tmp0_ = g_key_file_get_integer (kf, "General", k, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		result = _tmp0_;
		return result;
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
		result = d;
		return result;
	}
	__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 _tmp1_;
}

static gboolean
dc_settings_manager_kf_bool (GKeyFile* kf,
                             const gchar* k,
                             gboolean d)
{
	gboolean _tmp1_ = FALSE;
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (kf != NULL, FALSE);
	g_return_val_if_fail (k != NULL, FALSE);
	{
		gboolean _tmp0_ = FALSE;
		_tmp0_ = g_key_file_get_boolean (kf, "General", k, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		result = _tmp0_;
		return result;
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
		result = d;
		return result;
	}
	__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 _tmp1_;
}

static gchar*
dc_settings_manager_kf_str (GKeyFile* kf,
                            const gchar* k,
                            const gchar* d)
{
	GError* _inner_error0_ = NULL;
	gchar* result;
	g_return_val_if_fail (kf != NULL, NULL);
	g_return_val_if_fail (k != NULL, NULL);
	g_return_val_if_fail (d != NULL, NULL);
	{
		gchar* _tmp0_ = NULL;
		gchar* _tmp1_;
		gchar* _tmp2_;
		_tmp1_ = g_key_file_get_string (kf, "General", k, &_inner_error0_);
		_tmp0_ = _tmp1_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp2_ = _tmp0_;
		_tmp0_ = NULL;
		result = _tmp2_;
		_g_free0 (_tmp0_);
		return result;
	}
	goto __finally0;
	__catch0_g_error:
	{
		gchar* _tmp3_;
		g_clear_error (&_inner_error0_);
		_tmp3_ = g_strdup (d);
		result = _tmp3_;
		return result;
	}
	__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 gint
dc_settings_manager_kf_enum (GKeyFile* kf,
                             const gchar* k,
                             gint d,
                             gint max)
{
	gint v = 0;
	gint _tmp0_ = 0;
	gboolean _tmp1_ = FALSE;
	gint result;
	g_return_val_if_fail (kf != NULL, -1);
	g_return_val_if_fail (k != NULL, -1);
	v = dc_settings_manager_kf_int (kf, k, d);
	if (v >= 0) {
		_tmp1_ = v <= max;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		_tmp0_ = v;
	} else {
		_tmp0_ = d;
	}
	result = _tmp0_;
	return result;
}

static DcMarkdownMode
dc_settings_manager_kf_markdown_mode (GKeyFile* kf)
{
	GError* _inner_error0_ = NULL;
	DcMarkdownMode result;
	g_return_val_if_fail (kf != NULL, 0);
	{
		gint value = 0;
		gboolean _tmp0_ = FALSE;
		value = g_key_file_get_integer (kf, "General", "markdown_rendering", &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		if (value >= ((gint) DC_MARKDOWN_MODE_ENABLED)) {
			_tmp0_ = value <= ((gint) DC_MARKDOWN_MODE_DISABLED);
		} else {
			_tmp0_ = FALSE;
		}
		if (_tmp0_) {
			result = (DcMarkdownMode) value;
			return result;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
	}
	__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 0;
	}
	{
		DcMarkdownMode _tmp1_ = 0;
		gboolean _tmp2_ = FALSE;
		_tmp2_ = g_key_file_get_boolean (kf, "General", "markdown_rendering", &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch1_g_error;
		}
		if (_tmp2_) {
			_tmp1_ = DC_MARKDOWN_MODE_ENABLED;
		} else {
			_tmp1_ = DC_MARKDOWN_MODE_DISABLED;
		}
		result = _tmp1_;
		return result;
	}
	goto __finally1;
	__catch1_g_error:
	{
		g_clear_error (&_inner_error0_);
		result = DC_MARKDOWN_MODE_ENABLED;
		return result;
	}
	__finally1:
	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 0;
}

void
dc_settings_manager_save_double_click_action (DcSettingsManager* self,
                                              gint v)
{
	g_return_if_fail (self != NULL);
	dc_settings_manager_set_double_click_action (self, v);
	dc_settings_manager_save_int (self, "double_click_action", v);
}

void
dc_settings_manager_save_markdown_mode (DcSettingsManager* self,
                                        DcMarkdownMode mode)
{
	g_return_if_fail (self != NULL);
	dc_settings_manager_set_markdown_mode (self, mode);
	dc_markdown_mode = mode;
	dc_settings_manager_save_int (self, "markdown_rendering", (gint) mode);
	g_signal_emit (self, dc_settings_manager_signals[DC_SETTINGS_MANAGER_APPEARANCE_CHANGED_SIGNAL], 0);
}

void
dc_settings_manager_save_code_theme (DcSettingsManager* self,
                                     DcCodeTheme theme)
{
	g_return_if_fail (self != NULL);
	dc_settings_manager_set_code_theme (self, theme);
	dc_syntax_highlight_theme = theme;
	dc_settings_manager_save_int (self, "code_theme", (gint) theme);
	g_signal_emit (self, dc_settings_manager_signals[DC_SETTINGS_MANAGER_APPEARANCE_CHANGED_SIGNAL], 0);
}

void
dc_settings_manager_save_shift_enter_sends (DcSettingsManager* self,
                                            gboolean v)
{
	g_return_if_fail (self != NULL);
	dc_settings_manager_set_shift_enter_sends (self, v);
	dc_settings_manager_save_bool (self, "shift_enter_sends", v);
}

void
dc_settings_manager_save_clean_pasted_links (DcSettingsManager* self,
                                             gboolean v)
{
	g_return_if_fail (self != NULL);
	dc_settings_manager_set_clean_pasted_links (self, v);
	dc_settings_manager_save_bool (self, "clean_pasted_links", v);
}

void
dc_settings_manager_save_tracking_filter_enabled (DcSettingsManager* self,
                                                  gboolean v)
{
	g_return_if_fail (self != NULL);
	dc_settings_manager_set_tracking_filter_enabled (self, v);
	dc_settings_manager_save_bool (self, "tracking_filter_enabled", v);
	dc_settings_manager_apply_tracking_filter (self);
}

void
dc_settings_manager_save_tracking_filter_url (DcSettingsManager* self,
                                              const gchar* v)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (v != NULL);
	_tmp0_ = string_strip (v);
	_tmp1_ = _tmp0_;
	dc_settings_manager_set_tracking_filter_url (self, _tmp1_);
	_g_free0 (_tmp1_);
	_tmp2_ = self->priv->_tracking_filter_url;
	dc_settings_manager_save_string (self, "tracking_filter_url", _tmp2_);
}

/** Installs the cached filter list as the active link cleaner
            when enabled, or reverts to the built-in rules. */
void
dc_settings_manager_apply_tracking_filter (DcSettingsManager* self)
{
	DcRemoveParamFilter* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_;
	DcRemoveParamFilter* _tmp7_;
	g_return_if_fail (self != NULL);
	_tmp2_ = self->priv->_tracking_filter_enabled;
	if (_tmp2_) {
		const gchar* _tmp3_;
		gint _tmp4_;
		gint _tmp5_;
		_tmp3_ = self->priv->_tracking_filter_url;
		_tmp4_ = strlen (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp1_ = _tmp5_ > 0;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		DcRemoveParamFilter* _tmp6_;
		_tmp6_ = dc_remove_param_filter_load_cached ();
		_g_object_unref0 (_tmp0_);
		_tmp0_ = _tmp6_;
	} else {
		_g_object_unref0 (_tmp0_);
		_tmp0_ = NULL;
	}
	_tmp7_ = _tmp0_;
	_tmp0_ = NULL;
	_g_object_unref0 (dc_remove_param_filter_active);
	dc_remove_param_filter_active = _tmp7_;
	_g_object_unref0 (_tmp0_);
}

void
dc_settings_manager_save_link_previews (DcSettingsManager* self,
                                        gboolean v)
{
	g_return_if_fail (self != NULL);
	dc_settings_manager_set_link_previews (self, v);
	dc_settings_manager_save_bool (self, "link_previews", v);
}

void
dc_settings_manager_save_notifications_enabled (DcSettingsManager* self,
                                                gboolean v)
{
	g_return_if_fail (self != NULL);
	dc_settings_manager_set_notifications_enabled (self, v);
	dc_settings_manager_save_bool (self, "notifications_enabled", v);
}

void
dc_settings_manager_save_show_notification_contents (DcSettingsManager* self,
                                                     gboolean v)
{
	g_return_if_fail (self != NULL);
	dc_settings_manager_set_show_notification_contents (self, v);
	dc_settings_manager_save_bool (self, "show_notification_contents", v);
}

void
dc_settings_manager_save_minimize_to_tray (DcSettingsManager* self,
                                           gboolean v)
{
	g_return_if_fail (self != NULL);
	dc_settings_manager_set_minimize_to_tray (self, v);
	dc_settings_manager_save_bool (self, "minimize_to_tray", v);
}

void
dc_settings_manager_save_system_audio_player (DcSettingsManager* self,
                                              gboolean v)
{
	g_return_if_fail (self != NULL);
	dc_settings_manager_set_system_audio_player (self, v);
	dc_audio_player_prefer_system = v;
	dc_settings_manager_save_bool (self, "system_audio_player", v);
}

void
dc_settings_manager_save_animate_stickers (DcSettingsManager* self,
                                           gboolean v)
{
	g_return_if_fail (self != NULL);
	dc_settings_manager_set_animate_stickers (self, v);
	dc_settings_manager_save_bool (self, "animate_stickers", v);
	g_signal_emit (self, dc_settings_manager_signals[DC_SETTINGS_MANAGER_APPEARANCE_CHANGED_SIGNAL], 0);
}

void
dc_settings_manager_save_webxdc_apps (DcSettingsManager* self,
                                      gboolean v)
{
	g_return_if_fail (self != NULL);
	dc_settings_manager_set_webxdc_apps (self, v);
	dc_settings_manager_save_bool (self, "webxdc_apps", v);
}

void
dc_settings_manager_save_webxdc_follow_chat (DcSettingsManager* self,
                                             gboolean v)
{
	g_return_if_fail (self != NULL);
	dc_settings_manager_set_webxdc_follow_chat (self, v);
	dc_settings_manager_save_bool (self, "webxdc_follow_chat", v);
}

void
dc_settings_manager_save_webxdc_allow_internet (DcSettingsManager* self,
                                                gboolean v)
{
	g_return_if_fail (self != NULL);
	dc_settings_manager_set_webxdc_allow_internet (self, v);
	dc_settings_manager_save_bool (self, "webxdc_allow_internet", v);
}

void
dc_settings_manager_save_webxdc_allow_wasm (DcSettingsManager* self,
                                            gboolean v)
{
	g_return_if_fail (self != NULL);
	dc_settings_manager_set_webxdc_allow_wasm (self, v);
	dc_settings_manager_save_bool (self, "webxdc_allow_wasm", v);
}

void
dc_settings_manager_save_webxdc_allow_webgl (DcSettingsManager* self,
                                             gboolean v)
{
	g_return_if_fail (self != NULL);
	dc_settings_manager_set_webxdc_allow_webgl (self, v);
	dc_settings_manager_save_bool (self, "webxdc_allow_webgl", v);
}

void
dc_settings_manager_save_webxdc_allow_hardware_acceleration (DcSettingsManager* self,
                                                             gboolean v)
{
	g_return_if_fail (self != NULL);
	dc_settings_manager_set_webxdc_allow_hardware_acceleration (self, v);
	dc_settings_manager_save_bool (self, "webxdc_allow_hardware_acceleration", v);
}

void
dc_settings_manager_save_auto_download_limit (DcSettingsManager* self,
                                              gint bytes)
{
	gint _tmp0_;
	g_return_if_fail (self != NULL);
	dc_settings_manager_set_auto_download_limit (self, dc_settings_manager_normalize_auto_download_limit (bytes));
	_tmp0_ = self->priv->_auto_download_limit;
	dc_settings_manager_save_int (self, "auto_download_limit", _tmp0_);
}

gint
dc_settings_manager_normalize_auto_download_limit (gint bytes)
{
	gint result;
	switch (bytes) {
		case 0:
		case DC_AUTO_DOWNLOAD_NEVER:
		case 256 * 1024:
		case 512 * 1024:
		case 1024 * 1024:
		case (2 * 1024) * 1024:
		case (5 * 1024) * 1024:
		{
			result = bytes;
			return result;
		}
		default:
		{
			result = DC_AUTO_DOWNLOAD_DEFAULT;
			return result;
		}
	}
}

void
dc_settings_manager_save_rpc_server_path (DcSettingsManager* self,
                                          const gchar* v)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (v != NULL);
	dc_settings_manager_set_rpc_server_path (self, v);
	dc_settings_manager_save_string (self, "rpc_server_path", v);
}

void
dc_settings_manager_save_accounts_path (DcSettingsManager* self,
                                        const gchar* v)
{
	gchar* clean_path = NULL;
	gchar* _tmp0_;
	const gchar* _tmp1_ = NULL;
	const gchar* _tmp2_;
	const gchar* _tmp4_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (v != NULL);
	_tmp0_ = dc_settings_manager_normalize_accounts_path (self, v);
	clean_path = _tmp0_;
	_tmp2_ = clean_path;
	if (dc_settings_manager_is_default_accounts_path (self, _tmp2_)) {
		_tmp1_ = "";
	} else {
		const gchar* _tmp3_;
		_tmp3_ = clean_path;
		_tmp1_ = _tmp3_;
	}
	dc_settings_manager_set_accounts_path (self, _tmp1_);
	_tmp4_ = self->priv->_accounts_path;
	dc_settings_manager_save_string (self, "accounts_path", _tmp4_);
	_g_free0 (clean_path);
}

void
dc_settings_manager_reset_accounts_path (DcSettingsManager* self)
{
	g_return_if_fail (self != NULL);
	dc_settings_manager_save_accounts_path (self, "");
}

void
dc_settings_manager_save_rpc_server_source (DcSettingsManager* self,
                                            DcRpcServerSource v)
{
	g_return_if_fail (self != NULL);
	dc_settings_manager_set_rpc_server_source (self, v);
	dc_settings_manager_save_int (self, "rpc_server_source", (gint) v);
}

void
dc_settings_manager_save_rpc_check_updates_on_startup (DcSettingsManager* self,
                                                       gboolean v)
{
	g_return_if_fail (self != NULL);
	dc_settings_manager_set_rpc_check_updates_on_startup (self, v);
	dc_settings_manager_save_bool (self, "rpc_check_updates_on_startup", v);
}

void
dc_settings_manager_save_sidebar_mode (DcSettingsManager* self,
                                       DcSidebarMode v)
{
	g_return_if_fail (self != NULL);
	dc_settings_manager_set_sidebar_mode (self, v);
	dc_settings_manager_save_int (self, "sidebar_mode", (gint) v);
}

void
dc_settings_manager_save_default_account_addr (DcSettingsManager* self,
                                               const gchar* v)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (v != NULL);
	dc_settings_manager_set_default_account_addr (self, v);
	dc_settings_manager_save_string (self, "default_account_addr", v);
}

void
dc_settings_manager_save_theme_override (DcSettingsManager* self,
                                         DcThemeOverride v)
{
	g_return_if_fail (self != NULL);
	dc_settings_manager_set_theme_override (self, v);
	dc_settings_manager_save_int (self, "theme_override", (gint) v);
}

void
dc_settings_manager_save_message_style (DcSettingsManager* self,
                                        DcMessageStyle v)
{
	g_return_if_fail (self != NULL);
	dc_settings_manager_set_message_style (self, v);
	dc_settings_manager_save_int (self, "message_style", (gint) v);
	g_signal_emit (self, dc_settings_manager_signals[DC_SETTINGS_MANAGER_APPEARANCE_CHANGED_SIGNAL], 0);
}

void
dc_settings_manager_save_bubble_avatar_display (DcSettingsManager* self,
                                                DcBubbleAvatarDisplay v)
{
	g_return_if_fail (self != NULL);
	dc_settings_manager_set_bubble_avatar_display (self, v);
	dc_settings_manager_save_int (self, "bubble_avatar_display", (gint) v);
	g_signal_emit (self, dc_settings_manager_signals[DC_SETTINGS_MANAGER_APPEARANCE_CHANGED_SIGNAL], 0);
}

void
dc_settings_manager_save_bubble_avatars_in_direct_chats (DcSettingsManager* self,
                                                         gboolean v)
{
	g_return_if_fail (self != NULL);
	dc_settings_manager_set_bubble_avatars_in_direct_chats (self, v);
	dc_settings_manager_save_bool (self, "bubble_avatars_in_direct_chats", v);
	g_signal_emit (self, dc_settings_manager_signals[DC_SETTINGS_MANAGER_APPEARANCE_CHANGED_SIGNAL], 0);
}

void
dc_settings_manager_save_accent_color (DcSettingsManager* self,
                                       const gchar* v)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (v != NULL);
	dc_settings_manager_set_accent_color (self, v);
	dc_settings_manager_save_string (self, "accent_color", v);
	g_signal_emit (self, dc_settings_manager_signals[DC_SETTINGS_MANAGER_APPEARANCE_CHANGED_SIGNAL], 0);
}

void
dc_settings_manager_save_background_mode (DcSettingsManager* self,
                                          DcBackgroundMode v)
{
	g_return_if_fail (self != NULL);
	dc_settings_manager_set_background_mode (self, v);
	dc_settings_manager_save_int (self, "background_mode", (gint) v);
}

void
dc_settings_manager_save_background_color (DcSettingsManager* self,
                                           const gchar* v)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (v != NULL);
	dc_settings_manager_set_background_color (self, v);
	dc_settings_manager_save_string (self, "background_color", v);
}

void
dc_settings_manager_save_font_size (DcSettingsManager* self,
                                    gint v)
{
	const gchar* _tmp0_;
	DcFontAttribute _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_font_family;
	_tmp1_ = self->priv->_font_attribute;
	dc_settings_manager_save_font (self, _tmp0_, _tmp1_, v);
}

void
dc_settings_manager_save_font_description (DcSettingsManager* self,
                                           PangoFontDescription* desc)
{
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_;
	gchar* family = NULL;
	gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (desc != NULL);
	_tmp1_ = pango_font_description_get_family (desc);
	_tmp0_ = _tmp1_;
	if (_tmp0_ == NULL) {
		_tmp0_ = "";
	}
	_tmp2_ = g_strdup (_tmp0_);
	family = _tmp2_;
	dc_settings_manager_save_font (self, family, dc_settings_manager_attribute_from_font_description (desc), dc_settings_manager_size_from_font_description (desc));
	_g_free0 (family);
}

void
dc_settings_manager_reset_font_defaults (DcSettingsManager* self)
{
	g_return_if_fail (self != NULL);
	dc_settings_manager_save_font (self, "", DC_FONT_ATTRIBUTE_REGULAR, DC_FONT_SIZE_SYSTEM);
}

static void
dc_settings_manager_save_font (DcSettingsManager* self,
                               const gchar* family,
                               DcFontAttribute attr,
                               gint size)
{
	gchar* clean_family = NULL;
	gchar* _tmp0_;
	gint clean_size = 0;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp7_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (family != NULL);
	_tmp0_ = string_strip (family);
	clean_family = _tmp0_;
	clean_size = dc_settings_manager_clamp_font_size (size);
	_tmp3_ = self->priv->_font_family;
	_tmp4_ = clean_family;
	if (g_strcmp0 (_tmp3_, _tmp4_) == 0) {
		DcFontAttribute _tmp5_;
		_tmp5_ = self->priv->_font_attribute;
		_tmp2_ = _tmp5_ == attr;
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		gint _tmp6_;
		_tmp6_ = self->priv->_font_size;
		_tmp1_ = _tmp6_ == clean_size;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		_g_free0 (clean_family);
		return;
	}
	_tmp7_ = clean_family;
	dc_settings_manager_set_font_family (self, _tmp7_);
	dc_settings_manager_set_font_attribute (self, attr);
	dc_settings_manager_set_font_size (self, clean_size);
	dc_settings_manager_schedule_font_save (self);
	g_signal_emit (self, dc_settings_manager_signals[DC_SETTINGS_MANAGER_FONT_CHANGED_SIGNAL], 0);
	_g_free0 (clean_family);
}

static void
dc_settings_manager_schedule_font_save (DcSettingsManager* self)
{
	g_return_if_fail (self != NULL);
	if (self->priv->font_save_source != ((guint) 0)) {
		g_source_remove (self->priv->font_save_source);
		self->priv->font_save_source = (guint) 0;
	}
	self->priv->font_save_source = dc_settings_manager_add_font_save_timeout (self);
}

static Block68Data*
block68_data_ref (Block68Data* _data68_)
{
	g_atomic_int_inc (&_data68_->_ref_count_);
	return _data68_;
}

static void
block68_data_unref (void * _userdata_)
{
	Block68Data* _data68_;
	_data68_ = (Block68Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data68_->_ref_count_)) {
		g_weak_ref_clear (&_data68_->settings_ref);
		g_slice_free (Block68Data, _data68_);
	}
}

static gboolean
__lambda332_ (Block68Data* _data68_)
{
	DcSettingsManager* settings = NULL;
	GObject* _tmp0_;
	DcSettingsManager* _tmp1_;
	DcSettingsManager* _tmp2_;
	gboolean result;
	_tmp0_ = g_weak_ref_get (&_data68_->settings_ref);
	_tmp1_ = DC_IS_SETTINGS_MANAGER (_tmp0_) ? ((DcSettingsManager*) _tmp0_) : NULL;
	if (_tmp1_ == NULL) {
		_g_object_unref0 (_tmp0_);
	}
	settings = _tmp1_;
	_tmp2_ = settings;
	if (_tmp2_ != NULL) {
		DcSettingsManager* _tmp3_;
		DcSettingsManager* _tmp4_;
		_tmp3_ = settings;
		_tmp3_->priv->font_save_source = (guint) 0;
		_tmp4_ = settings;
		dc_settings_manager_write_font_settings (_tmp4_);
	}
	result = G_SOURCE_REMOVE;
	_g_object_unref0 (settings);
	return result;
}

static gboolean
___lambda332__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda332_ (self);
	return result;
}

static guint
dc_settings_manager_add_font_save_timeout (DcSettingsManager* target)
{
	Block68Data* _data68_;
	guint result;
	g_return_val_if_fail (target != NULL, 0U);
	_data68_ = g_slice_new0 (Block68Data);
	_data68_->_ref_count_ = 1;
	g_weak_ref_init (&_data68_->settings_ref, (GObject*) target);
	result = g_timeout_add_full (G_PRIORITY_DEFAULT, DC_SETTINGS_MANAGER_FONT_SAVE_DEBOUNCE_MS, ___lambda332__gsource_func, block68_data_ref (_data68_), block68_data_unref);
	block68_data_unref (_data68_);
	_data68_ = NULL;
	return result;
}

static void
__lambda333_ (DcSettingsManager* self,
              GKeyFile* kf)
{
	const gchar* _tmp0_;
	DcFontAttribute _tmp1_;
	gint _tmp2_;
	g_return_if_fail (kf != NULL);
	_tmp0_ = self->priv->_font_family;
	g_key_file_set_string (kf, "General", "font_family", _tmp0_);
	_tmp1_ = self->priv->_font_attribute;
	g_key_file_set_integer (kf, "General", "font_attribute", (gint) _tmp1_);
	_tmp2_ = self->priv->_font_size;
	g_key_file_set_integer (kf, "General", "font_size", _tmp2_);
}

static void
___lambda333__dc_setting_writer (GKeyFile* kf,
                                 gpointer self)
{
	__lambda333_ ((DcSettingsManager*) self, kf);
}

static void
dc_settings_manager_write_font_settings (DcSettingsManager* self)
{
	g_return_if_fail (self != NULL);
	dc_settings_manager_save_to_file (self, ___lambda333__dc_setting_writer, self);
}

static void
dc_settings_manager_real_dispose (GObject* base)
{
	DcSettingsManager * self;
	self = (DcSettingsManager*) base;
	if (self->priv->font_save_source != ((guint) 0)) {
		g_source_remove (self->priv->font_save_source);
		self->priv->font_save_source = (guint) 0;
		dc_settings_manager_write_font_settings (self);
	}
	G_OBJECT_CLASS (dc_settings_manager_parent_class)->dispose (G_TYPE_CHECK_INSTANCE_CAST (self, G_TYPE_OBJECT, GObject));
}

gint
dc_settings_manager_clamp_font_size (gint size)
{
	gint result;
	if (size <= DC_FONT_SIZE_SYSTEM) {
		result = DC_FONT_SIZE_SYSTEM;
		return result;
	}
	if (size < DC_FONT_SIZE_MIN) {
		result = DC_FONT_SIZE_MIN;
		return result;
	}
	if (size > DC_FONT_SIZE_MAX) {
		result = DC_FONT_SIZE_MAX;
		return result;
	}
	result = size;
	return result;
}

static void
_vala_PangoFontDescription_free (PangoFontDescription* self)
{
	g_boxed_free (pango_font_description_get_type (), self);
}

gint
dc_settings_manager_system_font_size (void)
{
	gchar* font_name = NULL;
	gchar* _tmp0_;
	PangoFontDescription* desc = NULL;
	const gchar* _tmp1_;
	PangoFontDescription* _tmp2_;
	gint size = 0;
	PangoFontDescription* _tmp3_;
	gint _tmp4_ = 0;
	gint result;
	_tmp0_ = dc_settings_manager_system_font_name ();
	font_name = _tmp0_;
	_tmp1_ = font_name;
	_tmp2_ = pango_font_description_from_string (_tmp1_);
	desc = _tmp2_;
	_tmp3_ = desc;
	size = dc_settings_manager_size_from_font_description (_tmp3_);
	if (size > 0) {
		_tmp4_ = dc_settings_manager_clamp_font_size (size);
	} else {
		_tmp4_ = DC_FONT_SIZE_FALLBACK;
	}
	result = _tmp4_;
	__vala_PangoFontDescription_free0 (desc);
	_g_free0 (font_name);
	return result;
}

gint
dc_settings_manager_effective_font_size (DcSettingsManager* self)
{
	gint _tmp0_ = 0;
	gint _tmp1_;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	_tmp1_ = self->priv->_font_size;
	if (_tmp1_ > 0) {
		gint _tmp2_;
		_tmp2_ = self->priv->_font_size;
		_tmp0_ = _tmp2_;
	} else {
		_tmp0_ = dc_settings_manager_system_font_size ();
	}
	result = _tmp0_;
	return result;
}

PangoFontDescription*
dc_settings_manager_effective_font_description (DcSettingsManager* self)
{
	gchar* _tmp0_ = NULL;
	const gchar* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	PangoFontDescription* desc = NULL;
	PangoFontDescription* _tmp7_;
	DcFontAttribute _tmp8_;
	DcFontAttribute _tmp9_;
	PangoFontDescription* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp1_ = self->priv->_font_family;
	_tmp2_ = strlen (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_ > 0) {
		const gchar* _tmp4_;
		gchar* _tmp5_;
		_tmp4_ = self->priv->_font_family;
		_tmp5_ = g_strdup (_tmp4_);
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp5_;
	} else {
		gchar* _tmp6_;
		_tmp6_ = dc_settings_manager_system_font_name ();
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp6_;
	}
	_tmp7_ = pango_font_description_from_string (_tmp0_);
	desc = _tmp7_;
	_tmp8_ = self->priv->_font_attribute;
	pango_font_description_set_style (desc, dc_font_attribute_pango_style (_tmp8_));
	_tmp9_ = self->priv->_font_attribute;
	pango_font_description_set_weight (desc, dc_font_attribute_pango_weight (_tmp9_));
	pango_font_description_set_size (desc, dc_settings_manager_effective_font_size (self) * PANGO_SCALE);
	result = desc;
	_g_free0 (_tmp0_);
	return result;
}

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

static gchar*
dc_settings_manager_system_font_name (void)
{
	GtkSettings* gtk_settings = NULL;
	GtkSettings* _tmp0_;
	GtkSettings* _tmp1_;
	gboolean _tmp2_ = FALSE;
	GtkSettings* _tmp3_;
	GtkSettings* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* result;
	_tmp0_ = gtk_settings_get_default ();
	_tmp1_ = _g_object_ref0 (_tmp0_);
	gtk_settings = _tmp1_;
	_tmp3_ = gtk_settings;
	if (_tmp3_ == NULL) {
		_tmp2_ = TRUE;
	} else {
		GtkSettings* _tmp4_;
		gchar* _tmp5_;
		gchar* _tmp6_;
		gchar* _tmp7_;
		gint _tmp8_;
		gint _tmp9_;
		_tmp4_ = gtk_settings;
		g_object_get (_tmp4_, "gtk-font-name", &_tmp5_, NULL);
		_tmp6_ = _tmp5_;
		_tmp7_ = _tmp6_;
		_tmp8_ = strlen (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp2_ = _tmp9_ == 0;
		_g_free0 (_tmp7_);
	}
	if (_tmp2_) {
		gchar* _tmp10_;
		_tmp10_ = g_strdup_printf ("Sans %d", DC_FONT_SIZE_FALLBACK);
		result = _tmp10_;
		_g_object_unref0 (gtk_settings);
		return result;
	}
	_tmp11_ = gtk_settings;
	g_object_get (_tmp11_, "gtk-font-name", &_tmp12_, NULL);
	_tmp13_ = _tmp12_;
	result = _tmp13_;
	_g_object_unref0 (gtk_settings);
	return result;
}

static gint
dc_settings_manager_size_from_font_description (PangoFontDescription* desc)
{
	gint size = 0;
	gint result;
	g_return_val_if_fail (desc != NULL, -1);
	size = pango_font_description_get_size (desc);
	if (size <= 0) {
		result = DC_FONT_SIZE_SYSTEM;
		return result;
	}
	result = (size + (PANGO_SCALE / 2)) / PANGO_SCALE;
	return result;
}

static DcFontAttribute
dc_settings_manager_attribute_from_font_description (PangoFontDescription* desc)
{
	gboolean _tmp0_ = FALSE;
	gboolean italic = FALSE;
	gboolean bold = FALSE;
	gboolean _tmp1_ = FALSE;
	DcFontAttribute result;
	g_return_val_if_fail (desc != NULL, 0);
	if (pango_font_description_get_style (desc) == PANGO_STYLE_ITALIC) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = pango_font_description_get_style (desc) == PANGO_STYLE_OBLIQUE;
	}
	italic = _tmp0_;
	bold = ((gint) pango_font_description_get_weight (desc)) >= ((gint) PANGO_WEIGHT_BOLD);
	if (italic) {
		_tmp1_ = bold;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		result = DC_FONT_ATTRIBUTE_BOLD_ITALIC;
		return result;
	}
	if (italic) {
		result = DC_FONT_ATTRIBUTE_ITALIC;
		return result;
	}
	if (bold) {
		result = DC_FONT_ATTRIBUTE_BOLD;
		return result;
	}
	result = DC_FONT_ATTRIBUTE_REGULAR;
	return result;
}

static Block69Data*
block69_data_ref (Block69Data* _data69_)
{
	g_atomic_int_inc (&_data69_->_ref_count_);
	return _data69_;
}

static void
block69_data_unref (void * _userdata_)
{
	Block69Data* _data69_;
	_data69_ = (Block69Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data69_->_ref_count_)) {
		DcSettingsManager* self;
		self = _data69_->self;
		_g_free0 (_data69_->key);
		_g_object_unref0 (self);
		g_slice_free (Block69Data, _data69_);
	}
}

static void
__lambda326_ (Block69Data* _data69_,
              GKeyFile* kf)
{
	DcSettingsManager* self;
	self = _data69_->self;
	g_return_if_fail (kf != NULL);
	g_key_file_set_integer (kf, "General", _data69_->key, _data69_->value);
}

static void
___lambda326__dc_setting_writer (GKeyFile* kf,
                                 gpointer self)
{
	__lambda326_ (self, kf);
}

static void
dc_settings_manager_save_int (DcSettingsManager* self,
                              const gchar* key,
                              gint value)
{
	Block69Data* _data69_;
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (key != NULL);
	_data69_ = g_slice_new0 (Block69Data);
	_data69_->_ref_count_ = 1;
	_data69_->self = g_object_ref (self);
	_tmp0_ = g_strdup (key);
	_g_free0 (_data69_->key);
	_data69_->key = _tmp0_;
	_data69_->value = value;
	dc_settings_manager_save_to_file (self, ___lambda326__dc_setting_writer, _data69_);
	block69_data_unref (_data69_);
	_data69_ = NULL;
}

static Block70Data*
block70_data_ref (Block70Data* _data70_)
{
	g_atomic_int_inc (&_data70_->_ref_count_);
	return _data70_;
}

static void
block70_data_unref (void * _userdata_)
{
	Block70Data* _data70_;
	_data70_ = (Block70Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data70_->_ref_count_)) {
		DcSettingsManager* self;
		self = _data70_->self;
		_g_free0 (_data70_->key);
		_g_object_unref0 (self);
		g_slice_free (Block70Data, _data70_);
	}
}

static void
__lambda303_ (Block70Data* _data70_,
              GKeyFile* kf)
{
	DcSettingsManager* self;
	self = _data70_->self;
	g_return_if_fail (kf != NULL);
	g_key_file_set_boolean (kf, "General", _data70_->key, _data70_->value);
}

static void
___lambda303__dc_setting_writer (GKeyFile* kf,
                                 gpointer self)
{
	__lambda303_ (self, kf);
}

static void
dc_settings_manager_save_bool (DcSettingsManager* self,
                               const gchar* key,
                               gboolean value)
{
	Block70Data* _data70_;
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (key != NULL);
	_data70_ = g_slice_new0 (Block70Data);
	_data70_->_ref_count_ = 1;
	_data70_->self = g_object_ref (self);
	_tmp0_ = g_strdup (key);
	_g_free0 (_data70_->key);
	_data70_->key = _tmp0_;
	_data70_->value = value;
	dc_settings_manager_save_to_file (self, ___lambda303__dc_setting_writer, _data70_);
	block70_data_unref (_data70_);
	_data70_ = NULL;
}

static Block71Data*
block71_data_ref (Block71Data* _data71_)
{
	g_atomic_int_inc (&_data71_->_ref_count_);
	return _data71_;
}

static void
block71_data_unref (void * _userdata_)
{
	Block71Data* _data71_;
	_data71_ = (Block71Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data71_->_ref_count_)) {
		DcSettingsManager* self;
		self = _data71_->self;
		_g_free0 (_data71_->key);
		_g_free0 (_data71_->value);
		_g_object_unref0 (self);
		g_slice_free (Block71Data, _data71_);
	}
}

static void
__lambda155_ (Block71Data* _data71_,
              GKeyFile* kf)
{
	DcSettingsManager* self;
	self = _data71_->self;
	g_return_if_fail (kf != NULL);
	g_key_file_set_string (kf, "General", _data71_->key, _data71_->value);
}

static void
___lambda155__dc_setting_writer (GKeyFile* kf,
                                 gpointer self)
{
	__lambda155_ (self, kf);
}

static void
dc_settings_manager_save_string (DcSettingsManager* self,
                                 const gchar* key,
                                 const gchar* value)
{
	Block71Data* _data71_;
	gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (key != NULL);
	g_return_if_fail (value != NULL);
	_data71_ = g_slice_new0 (Block71Data);
	_data71_->_ref_count_ = 1;
	_data71_->self = g_object_ref (self);
	_tmp0_ = g_strdup (key);
	_g_free0 (_data71_->key);
	_data71_->key = _tmp0_;
	_tmp1_ = g_strdup (value);
	_g_free0 (_data71_->value);
	_data71_->value = _tmp1_;
	dc_settings_manager_save_to_file (self, ___lambda155__dc_setting_writer, _data71_);
	block71_data_unref (_data71_);
	_data71_ = NULL;
}

void
dc_settings_manager_save_to_file (DcSettingsManager* self,
                                  DcSettingWriter writer,
                                  gpointer writer_target)
{
	GKeyFile* kf = NULL;
	GKeyFile* _tmp0_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_key_file_new ();
	kf = _tmp0_;
	{
		gchar* _tmp1_;
		gchar* _tmp2_;
		_tmp1_ = dc_settings_manager_get_config_path ();
		_tmp2_ = _tmp1_;
		g_key_file_load_from_file (kf, _tmp2_, G_KEY_FILE_NONE, &_inner_error0_);
		_g_free0 (_tmp2_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_key_file_unref0 (kf);
		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;
	}
	writer (kf, writer_target);
	{
		gchar* dir = NULL;
		gchar* _tmp3_;
		gchar* _tmp4_;
		gchar* _tmp5_;
		gchar* _tmp6_;
		gchar* _tmp7_;
		gchar* _tmp8_;
		_tmp3_ = dc_settings_manager_get_config_path ();
		_tmp4_ = _tmp3_;
		_tmp5_ = g_path_get_dirname (_tmp4_);
		_tmp6_ = _tmp5_;
		_g_free0 (_tmp4_);
		dir = _tmp6_;
		g_mkdir_with_parents (dir, 0755);
		_tmp7_ = dc_settings_manager_get_config_path ();
		_tmp8_ = _tmp7_;
		g_key_file_save_to_file (kf, _tmp8_, &_inner_error0_);
		_g_free0 (_tmp8_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_free0 (dir);
			goto __catch1_g_error;
		}
		_g_free0 (dir);
	}
	goto __finally1;
	__catch1_g_error:
	{
		GError* e = NULL;
		GError* _tmp9_;
		const gchar* _tmp10_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp9_ = e;
		_tmp10_ = _tmp9_->message;
		g_warning ("settings_dialog.vala:648: Failed to save settings: %s", _tmp10_);
		_g_error_free0 (e);
	}
	__finally1:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_key_file_unref0 (kf);
		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;
	}
	_g_key_file_unref0 (kf);
}

DcSettingsManager*
dc_settings_manager_construct (GType object_type)
{
	DcSettingsManager * self = NULL;
	self = (DcSettingsManager*) g_object_new (object_type, NULL);
	return self;
}

DcSettingsManager*
dc_settings_manager_new (void)
{
	return dc_settings_manager_construct (DC_TYPE_SETTINGS_MANAGER);
}

gint
dc_settings_manager_get_double_click_action (DcSettingsManager* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_double_click_action;
	return result;
}

void
dc_settings_manager_set_double_click_action (DcSettingsManager* self,
                                             gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_settings_manager_get_double_click_action (self);
	if (old_value != value) {
		self->priv->_double_click_action = value;
		g_object_notify_by_pspec ((GObject *) self, dc_settings_manager_properties[DC_SETTINGS_MANAGER_DOUBLE_CLICK_ACTION_PROPERTY]);
	}
}

DcMarkdownMode
dc_settings_manager_get_markdown_mode (DcSettingsManager* self)
{
	DcMarkdownMode result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_markdown_mode;
	return result;
}

void
dc_settings_manager_set_markdown_mode (DcSettingsManager* self,
                                       DcMarkdownMode value)
{
	DcMarkdownMode old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_settings_manager_get_markdown_mode (self);
	if (old_value != value) {
		self->priv->_markdown_mode = value;
		g_object_notify_by_pspec ((GObject *) self, dc_settings_manager_properties[DC_SETTINGS_MANAGER_MARKDOWN_MODE_PROPERTY]);
	}
}

DcCodeTheme
dc_settings_manager_get_code_theme (DcSettingsManager* self)
{
	DcCodeTheme result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_code_theme;
	return result;
}

void
dc_settings_manager_set_code_theme (DcSettingsManager* self,
                                    DcCodeTheme value)
{
	DcCodeTheme old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_settings_manager_get_code_theme (self);
	if (old_value != value) {
		self->priv->_code_theme = value;
		g_object_notify_by_pspec ((GObject *) self, dc_settings_manager_properties[DC_SETTINGS_MANAGER_CODE_THEME_PROPERTY]);
	}
}

gboolean
dc_settings_manager_get_shift_enter_sends (DcSettingsManager* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_shift_enter_sends;
	return result;
}

void
dc_settings_manager_set_shift_enter_sends (DcSettingsManager* self,
                                           gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_settings_manager_get_shift_enter_sends (self);
	if (old_value != value) {
		self->priv->_shift_enter_sends = value;
		g_object_notify_by_pspec ((GObject *) self, dc_settings_manager_properties[DC_SETTINGS_MANAGER_SHIFT_ENTER_SENDS_PROPERTY]);
	}
}

gboolean
dc_settings_manager_get_clean_pasted_links (DcSettingsManager* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_clean_pasted_links;
	return result;
}

void
dc_settings_manager_set_clean_pasted_links (DcSettingsManager* self,
                                            gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_settings_manager_get_clean_pasted_links (self);
	if (old_value != value) {
		self->priv->_clean_pasted_links = value;
		g_object_notify_by_pspec ((GObject *) self, dc_settings_manager_properties[DC_SETTINGS_MANAGER_CLEAN_PASTED_LINKS_PROPERTY]);
	}
}

gboolean
dc_settings_manager_get_tracking_filter_enabled (DcSettingsManager* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_tracking_filter_enabled;
	return result;
}

void
dc_settings_manager_set_tracking_filter_enabled (DcSettingsManager* self,
                                                 gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_settings_manager_get_tracking_filter_enabled (self);
	if (old_value != value) {
		self->priv->_tracking_filter_enabled = value;
		g_object_notify_by_pspec ((GObject *) self, dc_settings_manager_properties[DC_SETTINGS_MANAGER_TRACKING_FILTER_ENABLED_PROPERTY]);
	}
}

const gchar*
dc_settings_manager_get_tracking_filter_url (DcSettingsManager* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_tracking_filter_url;
	result = _tmp0_;
	return result;
}

void
dc_settings_manager_set_tracking_filter_url (DcSettingsManager* self,
                                             const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_settings_manager_get_tracking_filter_url (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_tracking_filter_url);
		self->priv->_tracking_filter_url = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dc_settings_manager_properties[DC_SETTINGS_MANAGER_TRACKING_FILTER_URL_PROPERTY]);
	}
}

gboolean
dc_settings_manager_get_link_previews (DcSettingsManager* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_link_previews;
	return result;
}

void
dc_settings_manager_set_link_previews (DcSettingsManager* self,
                                       gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_settings_manager_get_link_previews (self);
	if (old_value != value) {
		self->priv->_link_previews = value;
		g_object_notify_by_pspec ((GObject *) self, dc_settings_manager_properties[DC_SETTINGS_MANAGER_LINK_PREVIEWS_PROPERTY]);
	}
}

gboolean
dc_settings_manager_get_notifications_enabled (DcSettingsManager* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_notifications_enabled;
	return result;
}

void
dc_settings_manager_set_notifications_enabled (DcSettingsManager* self,
                                               gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_settings_manager_get_notifications_enabled (self);
	if (old_value != value) {
		self->priv->_notifications_enabled = value;
		g_object_notify_by_pspec ((GObject *) self, dc_settings_manager_properties[DC_SETTINGS_MANAGER_NOTIFICATIONS_ENABLED_PROPERTY]);
	}
}

gboolean
dc_settings_manager_get_show_notification_contents (DcSettingsManager* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_show_notification_contents;
	return result;
}

void
dc_settings_manager_set_show_notification_contents (DcSettingsManager* self,
                                                    gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_settings_manager_get_show_notification_contents (self);
	if (old_value != value) {
		self->priv->_show_notification_contents = value;
		g_object_notify_by_pspec ((GObject *) self, dc_settings_manager_properties[DC_SETTINGS_MANAGER_SHOW_NOTIFICATION_CONTENTS_PROPERTY]);
	}
}

gboolean
dc_settings_manager_get_minimize_to_tray (DcSettingsManager* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_minimize_to_tray;
	return result;
}

void
dc_settings_manager_set_minimize_to_tray (DcSettingsManager* self,
                                          gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_settings_manager_get_minimize_to_tray (self);
	if (old_value != value) {
		self->priv->_minimize_to_tray = value;
		g_object_notify_by_pspec ((GObject *) self, dc_settings_manager_properties[DC_SETTINGS_MANAGER_MINIMIZE_TO_TRAY_PROPERTY]);
	}
}

gboolean
dc_settings_manager_get_system_audio_player (DcSettingsManager* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_system_audio_player;
	return result;
}

void
dc_settings_manager_set_system_audio_player (DcSettingsManager* self,
                                             gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_settings_manager_get_system_audio_player (self);
	if (old_value != value) {
		self->priv->_system_audio_player = value;
		g_object_notify_by_pspec ((GObject *) self, dc_settings_manager_properties[DC_SETTINGS_MANAGER_SYSTEM_AUDIO_PLAYER_PROPERTY]);
	}
}

gboolean
dc_settings_manager_get_animate_stickers (DcSettingsManager* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_animate_stickers;
	return result;
}

void
dc_settings_manager_set_animate_stickers (DcSettingsManager* self,
                                          gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_settings_manager_get_animate_stickers (self);
	if (old_value != value) {
		self->priv->_animate_stickers = value;
		g_object_notify_by_pspec ((GObject *) self, dc_settings_manager_properties[DC_SETTINGS_MANAGER_ANIMATE_STICKERS_PROPERTY]);
	}
}

gboolean
dc_settings_manager_get_webxdc_apps (DcSettingsManager* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_webxdc_apps;
	return result;
}

void
dc_settings_manager_set_webxdc_apps (DcSettingsManager* self,
                                     gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_settings_manager_get_webxdc_apps (self);
	if (old_value != value) {
		self->priv->_webxdc_apps = value;
		g_object_notify_by_pspec ((GObject *) self, dc_settings_manager_properties[DC_SETTINGS_MANAGER_WEBXDC_APPS_PROPERTY]);
	}
}

gboolean
dc_settings_manager_get_webxdc_follow_chat (DcSettingsManager* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_webxdc_follow_chat;
	return result;
}

void
dc_settings_manager_set_webxdc_follow_chat (DcSettingsManager* self,
                                            gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_settings_manager_get_webxdc_follow_chat (self);
	if (old_value != value) {
		self->priv->_webxdc_follow_chat = value;
		g_object_notify_by_pspec ((GObject *) self, dc_settings_manager_properties[DC_SETTINGS_MANAGER_WEBXDC_FOLLOW_CHAT_PROPERTY]);
	}
}

gboolean
dc_settings_manager_get_webxdc_allow_internet (DcSettingsManager* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_webxdc_allow_internet;
	return result;
}

void
dc_settings_manager_set_webxdc_allow_internet (DcSettingsManager* self,
                                               gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_settings_manager_get_webxdc_allow_internet (self);
	if (old_value != value) {
		self->priv->_webxdc_allow_internet = value;
		g_object_notify_by_pspec ((GObject *) self, dc_settings_manager_properties[DC_SETTINGS_MANAGER_WEBXDC_ALLOW_INTERNET_PROPERTY]);
	}
}

gboolean
dc_settings_manager_get_webxdc_allow_wasm (DcSettingsManager* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_webxdc_allow_wasm;
	return result;
}

void
dc_settings_manager_set_webxdc_allow_wasm (DcSettingsManager* self,
                                           gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_settings_manager_get_webxdc_allow_wasm (self);
	if (old_value != value) {
		self->priv->_webxdc_allow_wasm = value;
		g_object_notify_by_pspec ((GObject *) self, dc_settings_manager_properties[DC_SETTINGS_MANAGER_WEBXDC_ALLOW_WASM_PROPERTY]);
	}
}

gboolean
dc_settings_manager_get_webxdc_allow_webgl (DcSettingsManager* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_webxdc_allow_webgl;
	return result;
}

void
dc_settings_manager_set_webxdc_allow_webgl (DcSettingsManager* self,
                                            gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_settings_manager_get_webxdc_allow_webgl (self);
	if (old_value != value) {
		self->priv->_webxdc_allow_webgl = value;
		g_object_notify_by_pspec ((GObject *) self, dc_settings_manager_properties[DC_SETTINGS_MANAGER_WEBXDC_ALLOW_WEBGL_PROPERTY]);
	}
}

gboolean
dc_settings_manager_get_webxdc_allow_hardware_acceleration (DcSettingsManager* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_webxdc_allow_hardware_acceleration;
	return result;
}

void
dc_settings_manager_set_webxdc_allow_hardware_acceleration (DcSettingsManager* self,
                                                            gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_settings_manager_get_webxdc_allow_hardware_acceleration (self);
	if (old_value != value) {
		self->priv->_webxdc_allow_hardware_acceleration = value;
		g_object_notify_by_pspec ((GObject *) self, dc_settings_manager_properties[DC_SETTINGS_MANAGER_WEBXDC_ALLOW_HARDWARE_ACCELERATION_PROPERTY]);
	}
}

gint
dc_settings_manager_get_auto_download_limit (DcSettingsManager* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_auto_download_limit;
	return result;
}

void
dc_settings_manager_set_auto_download_limit (DcSettingsManager* self,
                                             gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_settings_manager_get_auto_download_limit (self);
	if (old_value != value) {
		self->priv->_auto_download_limit = value;
		g_object_notify_by_pspec ((GObject *) self, dc_settings_manager_properties[DC_SETTINGS_MANAGER_AUTO_DOWNLOAD_LIMIT_PROPERTY]);
	}
}

const gchar*
dc_settings_manager_get_rpc_server_path (DcSettingsManager* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_rpc_server_path;
	result = _tmp0_;
	return result;
}

void
dc_settings_manager_set_rpc_server_path (DcSettingsManager* self,
                                         const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_settings_manager_get_rpc_server_path (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_rpc_server_path);
		self->priv->_rpc_server_path = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dc_settings_manager_properties[DC_SETTINGS_MANAGER_RPC_SERVER_PATH_PROPERTY]);
	}
}

const gchar*
dc_settings_manager_get_accounts_path (DcSettingsManager* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_accounts_path;
	result = _tmp0_;
	return result;
}

void
dc_settings_manager_set_accounts_path (DcSettingsManager* self,
                                       const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_settings_manager_get_accounts_path (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_accounts_path);
		self->priv->_accounts_path = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dc_settings_manager_properties[DC_SETTINGS_MANAGER_ACCOUNTS_PATH_PROPERTY]);
	}
}

DcRpcServerSource
dc_settings_manager_get_rpc_server_source (DcSettingsManager* self)
{
	DcRpcServerSource result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_rpc_server_source;
	return result;
}

void
dc_settings_manager_set_rpc_server_source (DcSettingsManager* self,
                                           DcRpcServerSource value)
{
	DcRpcServerSource old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_settings_manager_get_rpc_server_source (self);
	if (old_value != value) {
		self->priv->_rpc_server_source = value;
		g_object_notify_by_pspec ((GObject *) self, dc_settings_manager_properties[DC_SETTINGS_MANAGER_RPC_SERVER_SOURCE_PROPERTY]);
	}
}

gboolean
dc_settings_manager_get_rpc_check_updates_on_startup (DcSettingsManager* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_rpc_check_updates_on_startup;
	return result;
}

void
dc_settings_manager_set_rpc_check_updates_on_startup (DcSettingsManager* self,
                                                      gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_settings_manager_get_rpc_check_updates_on_startup (self);
	if (old_value != value) {
		self->priv->_rpc_check_updates_on_startup = value;
		g_object_notify_by_pspec ((GObject *) self, dc_settings_manager_properties[DC_SETTINGS_MANAGER_RPC_CHECK_UPDATES_ON_STARTUP_PROPERTY]);
	}
}

DcSidebarMode
dc_settings_manager_get_sidebar_mode (DcSettingsManager* self)
{
	DcSidebarMode result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_sidebar_mode;
	return result;
}

void
dc_settings_manager_set_sidebar_mode (DcSettingsManager* self,
                                      DcSidebarMode value)
{
	DcSidebarMode old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_settings_manager_get_sidebar_mode (self);
	if (old_value != value) {
		self->priv->_sidebar_mode = value;
		g_object_notify_by_pspec ((GObject *) self, dc_settings_manager_properties[DC_SETTINGS_MANAGER_SIDEBAR_MODE_PROPERTY]);
	}
}

const gchar*
dc_settings_manager_get_default_account_addr (DcSettingsManager* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_default_account_addr;
	result = _tmp0_;
	return result;
}

void
dc_settings_manager_set_default_account_addr (DcSettingsManager* self,
                                              const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_settings_manager_get_default_account_addr (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_default_account_addr);
		self->priv->_default_account_addr = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dc_settings_manager_properties[DC_SETTINGS_MANAGER_DEFAULT_ACCOUNT_ADDR_PROPERTY]);
	}
}

DcThemeOverride
dc_settings_manager_get_theme_override (DcSettingsManager* self)
{
	DcThemeOverride result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_theme_override;
	return result;
}

void
dc_settings_manager_set_theme_override (DcSettingsManager* self,
                                        DcThemeOverride value)
{
	DcThemeOverride old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_settings_manager_get_theme_override (self);
	if (old_value != value) {
		self->priv->_theme_override = value;
		g_object_notify_by_pspec ((GObject *) self, dc_settings_manager_properties[DC_SETTINGS_MANAGER_THEME_OVERRIDE_PROPERTY]);
	}
}

DcMessageStyle
dc_settings_manager_get_message_style (DcSettingsManager* self)
{
	DcMessageStyle result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_message_style;
	return result;
}

void
dc_settings_manager_set_message_style (DcSettingsManager* self,
                                       DcMessageStyle value)
{
	DcMessageStyle old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_settings_manager_get_message_style (self);
	if (old_value != value) {
		self->priv->_message_style = value;
		g_object_notify_by_pspec ((GObject *) self, dc_settings_manager_properties[DC_SETTINGS_MANAGER_MESSAGE_STYLE_PROPERTY]);
	}
}

DcBubbleAvatarDisplay
dc_settings_manager_get_bubble_avatar_display (DcSettingsManager* self)
{
	DcBubbleAvatarDisplay result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_bubble_avatar_display;
	return result;
}

void
dc_settings_manager_set_bubble_avatar_display (DcSettingsManager* self,
                                               DcBubbleAvatarDisplay value)
{
	DcBubbleAvatarDisplay old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_settings_manager_get_bubble_avatar_display (self);
	if (old_value != value) {
		self->priv->_bubble_avatar_display = value;
		g_object_notify_by_pspec ((GObject *) self, dc_settings_manager_properties[DC_SETTINGS_MANAGER_BUBBLE_AVATAR_DISPLAY_PROPERTY]);
	}
}

gboolean
dc_settings_manager_get_bubble_avatars_in_direct_chats (DcSettingsManager* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_bubble_avatars_in_direct_chats;
	return result;
}

void
dc_settings_manager_set_bubble_avatars_in_direct_chats (DcSettingsManager* self,
                                                        gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_settings_manager_get_bubble_avatars_in_direct_chats (self);
	if (old_value != value) {
		self->priv->_bubble_avatars_in_direct_chats = value;
		g_object_notify_by_pspec ((GObject *) self, dc_settings_manager_properties[DC_SETTINGS_MANAGER_BUBBLE_AVATARS_IN_DIRECT_CHATS_PROPERTY]);
	}
}

const gchar*
dc_settings_manager_get_accent_color (DcSettingsManager* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_accent_color;
	result = _tmp0_;
	return result;
}

void
dc_settings_manager_set_accent_color (DcSettingsManager* self,
                                      const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_settings_manager_get_accent_color (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_accent_color);
		self->priv->_accent_color = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dc_settings_manager_properties[DC_SETTINGS_MANAGER_ACCENT_COLOR_PROPERTY]);
	}
}

DcBackgroundMode
dc_settings_manager_get_background_mode (DcSettingsManager* self)
{
	DcBackgroundMode result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_background_mode;
	return result;
}

void
dc_settings_manager_set_background_mode (DcSettingsManager* self,
                                         DcBackgroundMode value)
{
	DcBackgroundMode old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_settings_manager_get_background_mode (self);
	if (old_value != value) {
		self->priv->_background_mode = value;
		g_object_notify_by_pspec ((GObject *) self, dc_settings_manager_properties[DC_SETTINGS_MANAGER_BACKGROUND_MODE_PROPERTY]);
	}
}

const gchar*
dc_settings_manager_get_background_color (DcSettingsManager* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_background_color;
	result = _tmp0_;
	return result;
}

void
dc_settings_manager_set_background_color (DcSettingsManager* self,
                                          const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_settings_manager_get_background_color (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_background_color);
		self->priv->_background_color = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dc_settings_manager_properties[DC_SETTINGS_MANAGER_BACKGROUND_COLOR_PROPERTY]);
	}
}

const gchar*
dc_settings_manager_get_font_family (DcSettingsManager* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_font_family;
	result = _tmp0_;
	return result;
}

void
dc_settings_manager_set_font_family (DcSettingsManager* self,
                                     const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_settings_manager_get_font_family (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_font_family);
		self->priv->_font_family = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dc_settings_manager_properties[DC_SETTINGS_MANAGER_FONT_FAMILY_PROPERTY]);
	}
}

DcFontAttribute
dc_settings_manager_get_font_attribute (DcSettingsManager* self)
{
	DcFontAttribute result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_font_attribute;
	return result;
}

void
dc_settings_manager_set_font_attribute (DcSettingsManager* self,
                                        DcFontAttribute value)
{
	DcFontAttribute old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_settings_manager_get_font_attribute (self);
	if (old_value != value) {
		self->priv->_font_attribute = value;
		g_object_notify_by_pspec ((GObject *) self, dc_settings_manager_properties[DC_SETTINGS_MANAGER_FONT_ATTRIBUTE_PROPERTY]);
	}
}

gint
dc_settings_manager_get_font_size (DcSettingsManager* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_font_size;
	return result;
}

void
dc_settings_manager_set_font_size (DcSettingsManager* self,
                                   gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_settings_manager_get_font_size (self);
	if (old_value != value) {
		self->priv->_font_size = value;
		g_object_notify_by_pspec ((GObject *) self, dc_settings_manager_properties[DC_SETTINGS_MANAGER_FONT_SIZE_PROPERTY]);
	}
}

static void
dc_settings_manager_class_init (DcSettingsManagerClass * klass,
                                gpointer klass_data)
{
	dc_settings_manager_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DcSettingsManager_private_offset);
	((GObjectClass *) klass)->dispose = (void (*) (GObject*)) dc_settings_manager_real_dispose;
	G_OBJECT_CLASS (klass)->get_property = _vala_dc_settings_manager_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_dc_settings_manager_set_property;
	G_OBJECT_CLASS (klass)->finalize = dc_settings_manager_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_SETTINGS_MANAGER_DOUBLE_CLICK_ACTION_PROPERTY, dc_settings_manager_properties[DC_SETTINGS_MANAGER_DOUBLE_CLICK_ACTION_PROPERTY] = g_param_spec_int ("double-click-action", "double-click-action", "double-click-action", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_SETTINGS_MANAGER_MARKDOWN_MODE_PROPERTY, dc_settings_manager_properties[DC_SETTINGS_MANAGER_MARKDOWN_MODE_PROPERTY] = g_param_spec_enum ("markdown-mode", "markdown-mode", "markdown-mode", DC_TYPE_MARKDOWN_MODE, DC_MARKDOWN_MODE_ENABLED, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_SETTINGS_MANAGER_CODE_THEME_PROPERTY, dc_settings_manager_properties[DC_SETTINGS_MANAGER_CODE_THEME_PROPERTY] = g_param_spec_enum ("code-theme", "code-theme", "code-theme", DC_TYPE_CODE_THEME, DC_CODE_THEME_ADAPTIVE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_SETTINGS_MANAGER_SHIFT_ENTER_SENDS_PROPERTY, dc_settings_manager_properties[DC_SETTINGS_MANAGER_SHIFT_ENTER_SENDS_PROPERTY] = g_param_spec_boolean ("shift-enter-sends", "shift-enter-sends", "shift-enter-sends", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_SETTINGS_MANAGER_CLEAN_PASTED_LINKS_PROPERTY, dc_settings_manager_properties[DC_SETTINGS_MANAGER_CLEAN_PASTED_LINKS_PROPERTY] = g_param_spec_boolean ("clean-pasted-links", "clean-pasted-links", "clean-pasted-links", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_SETTINGS_MANAGER_TRACKING_FILTER_ENABLED_PROPERTY, dc_settings_manager_properties[DC_SETTINGS_MANAGER_TRACKING_FILTER_ENABLED_PROPERTY] = g_param_spec_boolean ("tracking-filter-enabled", "tracking-filter-enabled", "tracking-filter-enabled", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_SETTINGS_MANAGER_TRACKING_FILTER_URL_PROPERTY, dc_settings_manager_properties[DC_SETTINGS_MANAGER_TRACKING_FILTER_URL_PROPERTY] = g_param_spec_string ("tracking-filter-url", "tracking-filter-url", "tracking-filter-url", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_SETTINGS_MANAGER_LINK_PREVIEWS_PROPERTY, dc_settings_manager_properties[DC_SETTINGS_MANAGER_LINK_PREVIEWS_PROPERTY] = g_param_spec_boolean ("link-previews", "link-previews", "link-previews", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_SETTINGS_MANAGER_NOTIFICATIONS_ENABLED_PROPERTY, dc_settings_manager_properties[DC_SETTINGS_MANAGER_NOTIFICATIONS_ENABLED_PROPERTY] = g_param_spec_boolean ("notifications-enabled", "notifications-enabled", "notifications-enabled", TRUE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_SETTINGS_MANAGER_SHOW_NOTIFICATION_CONTENTS_PROPERTY, dc_settings_manager_properties[DC_SETTINGS_MANAGER_SHOW_NOTIFICATION_CONTENTS_PROPERTY] = g_param_spec_boolean ("show-notification-contents", "show-notification-contents", "show-notification-contents", TRUE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_SETTINGS_MANAGER_MINIMIZE_TO_TRAY_PROPERTY, dc_settings_manager_properties[DC_SETTINGS_MANAGER_MINIMIZE_TO_TRAY_PROPERTY] = g_param_spec_boolean ("minimize-to-tray", "minimize-to-tray", "minimize-to-tray", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_SETTINGS_MANAGER_SYSTEM_AUDIO_PLAYER_PROPERTY, dc_settings_manager_properties[DC_SETTINGS_MANAGER_SYSTEM_AUDIO_PLAYER_PROPERTY] = g_param_spec_boolean ("system-audio-player", "system-audio-player", "system-audio-player", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_SETTINGS_MANAGER_ANIMATE_STICKERS_PROPERTY, dc_settings_manager_properties[DC_SETTINGS_MANAGER_ANIMATE_STICKERS_PROPERTY] = g_param_spec_boolean ("animate-stickers", "animate-stickers", "animate-stickers", TRUE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_SETTINGS_MANAGER_WEBXDC_APPS_PROPERTY, dc_settings_manager_properties[DC_SETTINGS_MANAGER_WEBXDC_APPS_PROPERTY] = g_param_spec_boolean ("webxdc-apps", "webxdc-apps", "webxdc-apps", TRUE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_SETTINGS_MANAGER_WEBXDC_FOLLOW_CHAT_PROPERTY, dc_settings_manager_properties[DC_SETTINGS_MANAGER_WEBXDC_FOLLOW_CHAT_PROPERTY] = g_param_spec_boolean ("webxdc-follow-chat", "webxdc-follow-chat", "webxdc-follow-chat", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_SETTINGS_MANAGER_WEBXDC_ALLOW_INTERNET_PROPERTY, dc_settings_manager_properties[DC_SETTINGS_MANAGER_WEBXDC_ALLOW_INTERNET_PROPERTY] = g_param_spec_boolean ("webxdc-allow-internet", "webxdc-allow-internet", "webxdc-allow-internet", DC_WEBXDC_SECURITY_SAFE_ALLOW_INTERNET, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_SETTINGS_MANAGER_WEBXDC_ALLOW_WASM_PROPERTY, dc_settings_manager_properties[DC_SETTINGS_MANAGER_WEBXDC_ALLOW_WASM_PROPERTY] = g_param_spec_boolean ("webxdc-allow-wasm", "webxdc-allow-wasm", "webxdc-allow-wasm", DC_WEBXDC_SECURITY_SAFE_ALLOW_WASM, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_SETTINGS_MANAGER_WEBXDC_ALLOW_WEBGL_PROPERTY, dc_settings_manager_properties[DC_SETTINGS_MANAGER_WEBXDC_ALLOW_WEBGL_PROPERTY] = g_param_spec_boolean ("webxdc-allow-webgl", "webxdc-allow-webgl", "webxdc-allow-webgl", DC_WEBXDC_SECURITY_SAFE_ALLOW_WEBGL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_SETTINGS_MANAGER_WEBXDC_ALLOW_HARDWARE_ACCELERATION_PROPERTY, dc_settings_manager_properties[DC_SETTINGS_MANAGER_WEBXDC_ALLOW_HARDWARE_ACCELERATION_PROPERTY] = g_param_spec_boolean ("webxdc-allow-hardware-acceleration", "webxdc-allow-hardware-acceleration", "webxdc-allow-hardware-acceleration", DC_WEBXDC_SECURITY_SAFE_ALLOW_HARDWARE_ACCELERATION, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_SETTINGS_MANAGER_AUTO_DOWNLOAD_LIMIT_PROPERTY, dc_settings_manager_properties[DC_SETTINGS_MANAGER_AUTO_DOWNLOAD_LIMIT_PROPERTY] = g_param_spec_int ("auto-download-limit", "auto-download-limit", "auto-download-limit", G_MININT, G_MAXINT, DC_AUTO_DOWNLOAD_DEFAULT, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_SETTINGS_MANAGER_RPC_SERVER_PATH_PROPERTY, dc_settings_manager_properties[DC_SETTINGS_MANAGER_RPC_SERVER_PATH_PROPERTY] = g_param_spec_string ("rpc-server-path", "rpc-server-path", "rpc-server-path", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_SETTINGS_MANAGER_ACCOUNTS_PATH_PROPERTY, dc_settings_manager_properties[DC_SETTINGS_MANAGER_ACCOUNTS_PATH_PROPERTY] = g_param_spec_string ("accounts-path", "accounts-path", "accounts-path", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_SETTINGS_MANAGER_RPC_SERVER_SOURCE_PROPERTY, dc_settings_manager_properties[DC_SETTINGS_MANAGER_RPC_SERVER_SOURCE_PROPERTY] = g_param_spec_enum ("rpc-server-source", "rpc-server-source", "rpc-server-source", DC_TYPE_RPC_SERVER_SOURCE, DC_RPC_SERVER_SOURCE_AUTO, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_SETTINGS_MANAGER_RPC_CHECK_UPDATES_ON_STARTUP_PROPERTY, dc_settings_manager_properties[DC_SETTINGS_MANAGER_RPC_CHECK_UPDATES_ON_STARTUP_PROPERTY] = g_param_spec_boolean ("rpc-check-updates-on-startup", "rpc-check-updates-on-startup", "rpc-check-updates-on-startup", TRUE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_SETTINGS_MANAGER_SIDEBAR_MODE_PROPERTY, dc_settings_manager_properties[DC_SETTINGS_MANAGER_SIDEBAR_MODE_PROPERTY] = g_param_spec_enum ("sidebar-mode", "sidebar-mode", "sidebar-mode", DC_TYPE_SIDEBAR_MODE, DC_SIDEBAR_MODE_FULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_SETTINGS_MANAGER_DEFAULT_ACCOUNT_ADDR_PROPERTY, dc_settings_manager_properties[DC_SETTINGS_MANAGER_DEFAULT_ACCOUNT_ADDR_PROPERTY] = g_param_spec_string ("default-account-addr", "default-account-addr", "default-account-addr", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_SETTINGS_MANAGER_THEME_OVERRIDE_PROPERTY, dc_settings_manager_properties[DC_SETTINGS_MANAGER_THEME_OVERRIDE_PROPERTY] = g_param_spec_enum ("theme-override", "theme-override", "theme-override", DC_TYPE_THEME_OVERRIDE, DC_THEME_OVERRIDE_SYSTEM, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_SETTINGS_MANAGER_MESSAGE_STYLE_PROPERTY, dc_settings_manager_properties[DC_SETTINGS_MANAGER_MESSAGE_STYLE_PROPERTY] = g_param_spec_enum ("message-style", "message-style", "message-style", DC_TYPE_MESSAGE_STYLE, DC_MESSAGE_STYLE_BUBBLES, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_SETTINGS_MANAGER_BUBBLE_AVATAR_DISPLAY_PROPERTY, dc_settings_manager_properties[DC_SETTINGS_MANAGER_BUBBLE_AVATAR_DISPLAY_PROPERTY] = g_param_spec_enum ("bubble-avatar-display", "bubble-avatar-display", "bubble-avatar-display", DC_TYPE_BUBBLE_AVATAR_DISPLAY, DC_BUBBLE_AVATAR_DISPLAY_NONE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_SETTINGS_MANAGER_BUBBLE_AVATARS_IN_DIRECT_CHATS_PROPERTY, dc_settings_manager_properties[DC_SETTINGS_MANAGER_BUBBLE_AVATARS_IN_DIRECT_CHATS_PROPERTY] = g_param_spec_boolean ("bubble-avatars-in-direct-chats", "bubble-avatars-in-direct-chats", "bubble-avatars-in-direct-chats", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_SETTINGS_MANAGER_ACCENT_COLOR_PROPERTY, dc_settings_manager_properties[DC_SETTINGS_MANAGER_ACCENT_COLOR_PROPERTY] = g_param_spec_string ("accent-color", "accent-color", "accent-color", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_SETTINGS_MANAGER_BACKGROUND_MODE_PROPERTY, dc_settings_manager_properties[DC_SETTINGS_MANAGER_BACKGROUND_MODE_PROPERTY] = g_param_spec_enum ("background-mode", "background-mode", "background-mode", DC_TYPE_BACKGROUND_MODE, DC_BACKGROUND_MODE_SYSTEM, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_SETTINGS_MANAGER_BACKGROUND_COLOR_PROPERTY, dc_settings_manager_properties[DC_SETTINGS_MANAGER_BACKGROUND_COLOR_PROPERTY] = g_param_spec_string ("background-color", "background-color", "background-color", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_SETTINGS_MANAGER_FONT_FAMILY_PROPERTY, dc_settings_manager_properties[DC_SETTINGS_MANAGER_FONT_FAMILY_PROPERTY] = g_param_spec_string ("font-family", "font-family", "font-family", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_SETTINGS_MANAGER_FONT_ATTRIBUTE_PROPERTY, dc_settings_manager_properties[DC_SETTINGS_MANAGER_FONT_ATTRIBUTE_PROPERTY] = g_param_spec_enum ("font-attribute", "font-attribute", "font-attribute", DC_TYPE_FONT_ATTRIBUTE, DC_FONT_ATTRIBUTE_REGULAR, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_SETTINGS_MANAGER_FONT_SIZE_PROPERTY, dc_settings_manager_properties[DC_SETTINGS_MANAGER_FONT_SIZE_PROPERTY] = g_param_spec_int ("font-size", "font-size", "font-size", G_MININT, G_MAXINT, DC_FONT_SIZE_SYSTEM, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	dc_settings_manager_signals[DC_SETTINGS_MANAGER_APPEARANCE_CHANGED_SIGNAL] = g_signal_new ("appearance-changed", DC_TYPE_SETTINGS_MANAGER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	dc_settings_manager_signals[DC_SETTINGS_MANAGER_FONT_CHANGED_SIGNAL] = g_signal_new ("font-changed", DC_TYPE_SETTINGS_MANAGER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
dc_settings_manager_instance_init (DcSettingsManager * self,
                                   gpointer klass)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	self->priv = dc_settings_manager_get_instance_private (self);
	self->priv->_double_click_action = 0;
	self->priv->_markdown_mode = DC_MARKDOWN_MODE_ENABLED;
	self->priv->_code_theme = DC_CODE_THEME_ADAPTIVE;
	self->priv->_shift_enter_sends = FALSE;
	self->priv->_clean_pasted_links = FALSE;
	self->priv->_tracking_filter_enabled = FALSE;
	_tmp0_ = g_strdup ("");
	self->priv->_tracking_filter_url = _tmp0_;
	self->priv->_link_previews = FALSE;
	self->priv->_notifications_enabled = TRUE;
	self->priv->_show_notification_contents = TRUE;
	self->priv->_minimize_to_tray = FALSE;
	self->priv->_system_audio_player = FALSE;
	self->priv->_animate_stickers = TRUE;
	self->priv->_webxdc_apps = TRUE;
	self->priv->_webxdc_follow_chat = FALSE;
	self->priv->_webxdc_allow_internet = DC_WEBXDC_SECURITY_SAFE_ALLOW_INTERNET;
	self->priv->_webxdc_allow_wasm = DC_WEBXDC_SECURITY_SAFE_ALLOW_WASM;
	self->priv->_webxdc_allow_webgl = DC_WEBXDC_SECURITY_SAFE_ALLOW_WEBGL;
	self->priv->_webxdc_allow_hardware_acceleration = DC_WEBXDC_SECURITY_SAFE_ALLOW_HARDWARE_ACCELERATION;
	self->priv->_auto_download_limit = DC_AUTO_DOWNLOAD_DEFAULT;
	_tmp1_ = g_strdup ("");
	self->priv->_rpc_server_path = _tmp1_;
	_tmp2_ = g_strdup ("");
	self->priv->_accounts_path = _tmp2_;
	self->priv->_rpc_server_source = DC_RPC_SERVER_SOURCE_AUTO;
	self->priv->_rpc_check_updates_on_startup = TRUE;
	self->priv->_sidebar_mode = DC_SIDEBAR_MODE_FULL;
	_tmp3_ = g_strdup ("");
	self->priv->_default_account_addr = _tmp3_;
	self->priv->_theme_override = DC_THEME_OVERRIDE_SYSTEM;
	self->priv->_message_style = DC_MESSAGE_STYLE_BUBBLES;
	self->priv->_bubble_avatar_display = DC_BUBBLE_AVATAR_DISPLAY_NONE;
	self->priv->_bubble_avatars_in_direct_chats = FALSE;
	_tmp4_ = g_strdup ("");
	self->priv->_accent_color = _tmp4_;
	self->priv->_background_mode = DC_BACKGROUND_MODE_SYSTEM;
	_tmp5_ = g_strdup ("");
	self->priv->_background_color = _tmp5_;
	_tmp6_ = g_strdup ("");
	self->priv->_font_family = _tmp6_;
	self->priv->_font_attribute = DC_FONT_ATTRIBUTE_REGULAR;
	self->priv->_font_size = DC_FONT_SIZE_SYSTEM;
	self->priv->font_save_source = (guint) 0;
}

static void
dc_settings_manager_finalize (GObject * obj)
{
	DcSettingsManager * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DC_TYPE_SETTINGS_MANAGER, DcSettingsManager);
	_g_free0 (self->priv->_tracking_filter_url);
	_g_free0 (self->priv->_rpc_server_path);
	_g_free0 (self->priv->_accounts_path);
	_g_free0 (self->priv->_default_account_addr);
	_g_free0 (self->priv->_accent_color);
	_g_free0 (self->priv->_background_color);
	_g_free0 (self->priv->_font_family);
	G_OBJECT_CLASS (dc_settings_manager_parent_class)->finalize (obj);
}

static GType
dc_settings_manager_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DcSettingsManagerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dc_settings_manager_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DcSettingsManager), 0, (GInstanceInitFunc) dc_settings_manager_instance_init, NULL };
	GType dc_settings_manager_type_id;
	dc_settings_manager_type_id = g_type_register_static (G_TYPE_OBJECT, "DcSettingsManager", &g_define_type_info, 0);
	DcSettingsManager_private_offset = g_type_add_instance_private (dc_settings_manager_type_id, sizeof (DcSettingsManagerPrivate));
	return dc_settings_manager_type_id;
}

GType
dc_settings_manager_get_type (void)
{
	static volatile gsize dc_settings_manager_type_id__once = 0;
	if (g_once_init_enter (&dc_settings_manager_type_id__once)) {
		GType dc_settings_manager_type_id;
		dc_settings_manager_type_id = dc_settings_manager_get_type_once ();
		g_once_init_leave (&dc_settings_manager_type_id__once, dc_settings_manager_type_id);
	}
	return dc_settings_manager_type_id__once;
}

static void
_vala_dc_settings_manager_get_property (GObject * object,
                                        guint property_id,
                                        GValue * value,
                                        GParamSpec * pspec)
{
	DcSettingsManager * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DC_TYPE_SETTINGS_MANAGER, DcSettingsManager);
	switch (property_id) {
		case DC_SETTINGS_MANAGER_DOUBLE_CLICK_ACTION_PROPERTY:
		g_value_set_int (value, dc_settings_manager_get_double_click_action (self));
		break;
		case DC_SETTINGS_MANAGER_MARKDOWN_MODE_PROPERTY:
		g_value_set_enum (value, dc_settings_manager_get_markdown_mode (self));
		break;
		case DC_SETTINGS_MANAGER_CODE_THEME_PROPERTY:
		g_value_set_enum (value, dc_settings_manager_get_code_theme (self));
		break;
		case DC_SETTINGS_MANAGER_SHIFT_ENTER_SENDS_PROPERTY:
		g_value_set_boolean (value, dc_settings_manager_get_shift_enter_sends (self));
		break;
		case DC_SETTINGS_MANAGER_CLEAN_PASTED_LINKS_PROPERTY:
		g_value_set_boolean (value, dc_settings_manager_get_clean_pasted_links (self));
		break;
		case DC_SETTINGS_MANAGER_TRACKING_FILTER_ENABLED_PROPERTY:
		g_value_set_boolean (value, dc_settings_manager_get_tracking_filter_enabled (self));
		break;
		case DC_SETTINGS_MANAGER_TRACKING_FILTER_URL_PROPERTY:
		g_value_set_string (value, dc_settings_manager_get_tracking_filter_url (self));
		break;
		case DC_SETTINGS_MANAGER_LINK_PREVIEWS_PROPERTY:
		g_value_set_boolean (value, dc_settings_manager_get_link_previews (self));
		break;
		case DC_SETTINGS_MANAGER_NOTIFICATIONS_ENABLED_PROPERTY:
		g_value_set_boolean (value, dc_settings_manager_get_notifications_enabled (self));
		break;
		case DC_SETTINGS_MANAGER_SHOW_NOTIFICATION_CONTENTS_PROPERTY:
		g_value_set_boolean (value, dc_settings_manager_get_show_notification_contents (self));
		break;
		case DC_SETTINGS_MANAGER_MINIMIZE_TO_TRAY_PROPERTY:
		g_value_set_boolean (value, dc_settings_manager_get_minimize_to_tray (self));
		break;
		case DC_SETTINGS_MANAGER_SYSTEM_AUDIO_PLAYER_PROPERTY:
		g_value_set_boolean (value, dc_settings_manager_get_system_audio_player (self));
		break;
		case DC_SETTINGS_MANAGER_ANIMATE_STICKERS_PROPERTY:
		g_value_set_boolean (value, dc_settings_manager_get_animate_stickers (self));
		break;
		case DC_SETTINGS_MANAGER_WEBXDC_APPS_PROPERTY:
		g_value_set_boolean (value, dc_settings_manager_get_webxdc_apps (self));
		break;
		case DC_SETTINGS_MANAGER_WEBXDC_FOLLOW_CHAT_PROPERTY:
		g_value_set_boolean (value, dc_settings_manager_get_webxdc_follow_chat (self));
		break;
		case DC_SETTINGS_MANAGER_WEBXDC_ALLOW_INTERNET_PROPERTY:
		g_value_set_boolean (value, dc_settings_manager_get_webxdc_allow_internet (self));
		break;
		case DC_SETTINGS_MANAGER_WEBXDC_ALLOW_WASM_PROPERTY:
		g_value_set_boolean (value, dc_settings_manager_get_webxdc_allow_wasm (self));
		break;
		case DC_SETTINGS_MANAGER_WEBXDC_ALLOW_WEBGL_PROPERTY:
		g_value_set_boolean (value, dc_settings_manager_get_webxdc_allow_webgl (self));
		break;
		case DC_SETTINGS_MANAGER_WEBXDC_ALLOW_HARDWARE_ACCELERATION_PROPERTY:
		g_value_set_boolean (value, dc_settings_manager_get_webxdc_allow_hardware_acceleration (self));
		break;
		case DC_SETTINGS_MANAGER_AUTO_DOWNLOAD_LIMIT_PROPERTY:
		g_value_set_int (value, dc_settings_manager_get_auto_download_limit (self));
		break;
		case DC_SETTINGS_MANAGER_RPC_SERVER_PATH_PROPERTY:
		g_value_set_string (value, dc_settings_manager_get_rpc_server_path (self));
		break;
		case DC_SETTINGS_MANAGER_ACCOUNTS_PATH_PROPERTY:
		g_value_set_string (value, dc_settings_manager_get_accounts_path (self));
		break;
		case DC_SETTINGS_MANAGER_RPC_SERVER_SOURCE_PROPERTY:
		g_value_set_enum (value, dc_settings_manager_get_rpc_server_source (self));
		break;
		case DC_SETTINGS_MANAGER_RPC_CHECK_UPDATES_ON_STARTUP_PROPERTY:
		g_value_set_boolean (value, dc_settings_manager_get_rpc_check_updates_on_startup (self));
		break;
		case DC_SETTINGS_MANAGER_SIDEBAR_MODE_PROPERTY:
		g_value_set_enum (value, dc_settings_manager_get_sidebar_mode (self));
		break;
		case DC_SETTINGS_MANAGER_DEFAULT_ACCOUNT_ADDR_PROPERTY:
		g_value_set_string (value, dc_settings_manager_get_default_account_addr (self));
		break;
		case DC_SETTINGS_MANAGER_THEME_OVERRIDE_PROPERTY:
		g_value_set_enum (value, dc_settings_manager_get_theme_override (self));
		break;
		case DC_SETTINGS_MANAGER_MESSAGE_STYLE_PROPERTY:
		g_value_set_enum (value, dc_settings_manager_get_message_style (self));
		break;
		case DC_SETTINGS_MANAGER_BUBBLE_AVATAR_DISPLAY_PROPERTY:
		g_value_set_enum (value, dc_settings_manager_get_bubble_avatar_display (self));
		break;
		case DC_SETTINGS_MANAGER_BUBBLE_AVATARS_IN_DIRECT_CHATS_PROPERTY:
		g_value_set_boolean (value, dc_settings_manager_get_bubble_avatars_in_direct_chats (self));
		break;
		case DC_SETTINGS_MANAGER_ACCENT_COLOR_PROPERTY:
		g_value_set_string (value, dc_settings_manager_get_accent_color (self));
		break;
		case DC_SETTINGS_MANAGER_BACKGROUND_MODE_PROPERTY:
		g_value_set_enum (value, dc_settings_manager_get_background_mode (self));
		break;
		case DC_SETTINGS_MANAGER_BACKGROUND_COLOR_PROPERTY:
		g_value_set_string (value, dc_settings_manager_get_background_color (self));
		break;
		case DC_SETTINGS_MANAGER_FONT_FAMILY_PROPERTY:
		g_value_set_string (value, dc_settings_manager_get_font_family (self));
		break;
		case DC_SETTINGS_MANAGER_FONT_ATTRIBUTE_PROPERTY:
		g_value_set_enum (value, dc_settings_manager_get_font_attribute (self));
		break;
		case DC_SETTINGS_MANAGER_FONT_SIZE_PROPERTY:
		g_value_set_int (value, dc_settings_manager_get_font_size (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_dc_settings_manager_set_property (GObject * object,
                                        guint property_id,
                                        const GValue * value,
                                        GParamSpec * pspec)
{
	DcSettingsManager * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DC_TYPE_SETTINGS_MANAGER, DcSettingsManager);
	switch (property_id) {
		case DC_SETTINGS_MANAGER_DOUBLE_CLICK_ACTION_PROPERTY:
		dc_settings_manager_set_double_click_action (self, g_value_get_int (value));
		break;
		case DC_SETTINGS_MANAGER_MARKDOWN_MODE_PROPERTY:
		dc_settings_manager_set_markdown_mode (self, g_value_get_enum (value));
		break;
		case DC_SETTINGS_MANAGER_CODE_THEME_PROPERTY:
		dc_settings_manager_set_code_theme (self, g_value_get_enum (value));
		break;
		case DC_SETTINGS_MANAGER_SHIFT_ENTER_SENDS_PROPERTY:
		dc_settings_manager_set_shift_enter_sends (self, g_value_get_boolean (value));
		break;
		case DC_SETTINGS_MANAGER_CLEAN_PASTED_LINKS_PROPERTY:
		dc_settings_manager_set_clean_pasted_links (self, g_value_get_boolean (value));
		break;
		case DC_SETTINGS_MANAGER_TRACKING_FILTER_ENABLED_PROPERTY:
		dc_settings_manager_set_tracking_filter_enabled (self, g_value_get_boolean (value));
		break;
		case DC_SETTINGS_MANAGER_TRACKING_FILTER_URL_PROPERTY:
		dc_settings_manager_set_tracking_filter_url (self, g_value_get_string (value));
		break;
		case DC_SETTINGS_MANAGER_LINK_PREVIEWS_PROPERTY:
		dc_settings_manager_set_link_previews (self, g_value_get_boolean (value));
		break;
		case DC_SETTINGS_MANAGER_NOTIFICATIONS_ENABLED_PROPERTY:
		dc_settings_manager_set_notifications_enabled (self, g_value_get_boolean (value));
		break;
		case DC_SETTINGS_MANAGER_SHOW_NOTIFICATION_CONTENTS_PROPERTY:
		dc_settings_manager_set_show_notification_contents (self, g_value_get_boolean (value));
		break;
		case DC_SETTINGS_MANAGER_MINIMIZE_TO_TRAY_PROPERTY:
		dc_settings_manager_set_minimize_to_tray (self, g_value_get_boolean (value));
		break;
		case DC_SETTINGS_MANAGER_SYSTEM_AUDIO_PLAYER_PROPERTY:
		dc_settings_manager_set_system_audio_player (self, g_value_get_boolean (value));
		break;
		case DC_SETTINGS_MANAGER_ANIMATE_STICKERS_PROPERTY:
		dc_settings_manager_set_animate_stickers (self, g_value_get_boolean (value));
		break;
		case DC_SETTINGS_MANAGER_WEBXDC_APPS_PROPERTY:
		dc_settings_manager_set_webxdc_apps (self, g_value_get_boolean (value));
		break;
		case DC_SETTINGS_MANAGER_WEBXDC_FOLLOW_CHAT_PROPERTY:
		dc_settings_manager_set_webxdc_follow_chat (self, g_value_get_boolean (value));
		break;
		case DC_SETTINGS_MANAGER_WEBXDC_ALLOW_INTERNET_PROPERTY:
		dc_settings_manager_set_webxdc_allow_internet (self, g_value_get_boolean (value));
		break;
		case DC_SETTINGS_MANAGER_WEBXDC_ALLOW_WASM_PROPERTY:
		dc_settings_manager_set_webxdc_allow_wasm (self, g_value_get_boolean (value));
		break;
		case DC_SETTINGS_MANAGER_WEBXDC_ALLOW_WEBGL_PROPERTY:
		dc_settings_manager_set_webxdc_allow_webgl (self, g_value_get_boolean (value));
		break;
		case DC_SETTINGS_MANAGER_WEBXDC_ALLOW_HARDWARE_ACCELERATION_PROPERTY:
		dc_settings_manager_set_webxdc_allow_hardware_acceleration (self, g_value_get_boolean (value));
		break;
		case DC_SETTINGS_MANAGER_AUTO_DOWNLOAD_LIMIT_PROPERTY:
		dc_settings_manager_set_auto_download_limit (self, g_value_get_int (value));
		break;
		case DC_SETTINGS_MANAGER_RPC_SERVER_PATH_PROPERTY:
		dc_settings_manager_set_rpc_server_path (self, g_value_get_string (value));
		break;
		case DC_SETTINGS_MANAGER_ACCOUNTS_PATH_PROPERTY:
		dc_settings_manager_set_accounts_path (self, g_value_get_string (value));
		break;
		case DC_SETTINGS_MANAGER_RPC_SERVER_SOURCE_PROPERTY:
		dc_settings_manager_set_rpc_server_source (self, g_value_get_enum (value));
		break;
		case DC_SETTINGS_MANAGER_RPC_CHECK_UPDATES_ON_STARTUP_PROPERTY:
		dc_settings_manager_set_rpc_check_updates_on_startup (self, g_value_get_boolean (value));
		break;
		case DC_SETTINGS_MANAGER_SIDEBAR_MODE_PROPERTY:
		dc_settings_manager_set_sidebar_mode (self, g_value_get_enum (value));
		break;
		case DC_SETTINGS_MANAGER_DEFAULT_ACCOUNT_ADDR_PROPERTY:
		dc_settings_manager_set_default_account_addr (self, g_value_get_string (value));
		break;
		case DC_SETTINGS_MANAGER_THEME_OVERRIDE_PROPERTY:
		dc_settings_manager_set_theme_override (self, g_value_get_enum (value));
		break;
		case DC_SETTINGS_MANAGER_MESSAGE_STYLE_PROPERTY:
		dc_settings_manager_set_message_style (self, g_value_get_enum (value));
		break;
		case DC_SETTINGS_MANAGER_BUBBLE_AVATAR_DISPLAY_PROPERTY:
		dc_settings_manager_set_bubble_avatar_display (self, g_value_get_enum (value));
		break;
		case DC_SETTINGS_MANAGER_BUBBLE_AVATARS_IN_DIRECT_CHATS_PROPERTY:
		dc_settings_manager_set_bubble_avatars_in_direct_chats (self, g_value_get_boolean (value));
		break;
		case DC_SETTINGS_MANAGER_ACCENT_COLOR_PROPERTY:
		dc_settings_manager_set_accent_color (self, g_value_get_string (value));
		break;
		case DC_SETTINGS_MANAGER_BACKGROUND_MODE_PROPERTY:
		dc_settings_manager_set_background_mode (self, g_value_get_enum (value));
		break;
		case DC_SETTINGS_MANAGER_BACKGROUND_COLOR_PROPERTY:
		dc_settings_manager_set_background_color (self, g_value_get_string (value));
		break;
		case DC_SETTINGS_MANAGER_FONT_FAMILY_PROPERTY:
		dc_settings_manager_set_font_family (self, g_value_get_string (value));
		break;
		case DC_SETTINGS_MANAGER_FONT_ATTRIBUTE_PROPERTY:
		dc_settings_manager_set_font_attribute (self, g_value_get_enum (value));
		break;
		case DC_SETTINGS_MANAGER_FONT_SIZE_PROPERTY:
		dc_settings_manager_set_font_size (self, g_value_get_int (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
dc_settings_dialog_get_instance_private (DcSettingsDialog* self)
{
	return G_STRUCT_MEMBER_P (self, DcSettingsDialog_private_offset);
}

static Block72Data*
block72_data_ref (Block72Data* _data72_)
{
	g_atomic_int_inc (&_data72_->_ref_count_);
	return _data72_;
}

static void
block72_data_unref (void * _userdata_)
{
	Block72Data* _data72_;
	_data72_ = (Block72Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data72_->_ref_count_)) {
		DcSettingsDialog* self;
		self = _data72_->self;
		_g_object_unref0 (_data72_->download_combo);
		_g_object_unref0 (_data72_->sticker_switch);
		_g_object_unref0 (_data72_->autocheck_switch);
		_g_object_unref0 (_data72_->notification_contents_switch);
		_g_object_unref0 (_data72_->notif_switch);
		_g_object_unref0 (_data72_->tray_switch);
		_g_object_unref0 (_data72_->audio_switch);
		_g_object_unref0 (_data72_->shift_switch);
		_g_object_unref0 (_data72_->md_combo);
		_g_object_unref0 (_data72_->dblclick_combo);
		_g_object_unref0 (_data72_->bg_color_btn);
		_g_object_unref0 (_data72_->bg_mode_combo);
		_g_object_unref0 (_data72_->accent_btn);
		_g_object_unref0 (_data72_->font_dialog);
		_g_object_unref0 (_data72_->direct_avatar_check);
		_g_object_unref0 (_data72_->avatar_combo);
		_g_object_unref0 (_data72_->style_combo);
		_g_object_unref0 (_data72_->code_combo);
		_g_object_unref0 (_data72_->theme_combo);
		_g_object_unref0 (self);
		g_slice_free (Block72Data, _data72_);
	}
}

static void
__lambda325_ (Block72Data* _data72_)
{
	DcSettingsDialog* self;
	DcWindow* _tmp0_;
	DcSettingsManager* _tmp1_;
	AdwComboRow* _tmp2_;
	guint _tmp3_;
	guint _tmp4_;
	self = _data72_->self;
	_tmp0_ = self->priv->app_window;
	_tmp1_ = _tmp0_->settings;
	_tmp2_ = _data72_->theme_combo;
	_tmp3_ = adw_combo_row_get_selected (_tmp2_);
	_tmp4_ = _tmp3_;
	dc_settings_manager_save_theme_override (_tmp1_, (DcThemeOverride) _tmp4_);
	dc_settings_dialog_apply_theme_override (self);
}

static void
___lambda325__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda325_ (self);
}

static void
__lambda327_ (Block72Data* _data72_)
{
	DcSettingsDialog* self;
	DcWindow* _tmp0_;
	DcSettingsManager* _tmp1_;
	AdwComboRow* _tmp2_;
	guint _tmp3_;
	guint _tmp4_;
	self = _data72_->self;
	_tmp0_ = self->priv->app_window;
	_tmp1_ = _tmp0_->settings;
	_tmp2_ = _data72_->code_combo;
	_tmp3_ = adw_combo_row_get_selected (_tmp2_);
	_tmp4_ = _tmp3_;
	dc_settings_manager_save_code_theme (_tmp1_, (DcCodeTheme) _tmp4_);
}

static void
___lambda327__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda327_ (self);
}

static void
__lambda328_ (Block72Data* _data72_)
{
	DcSettingsDialog* self;
	DcWindow* _tmp0_;
	DcSettingsManager* _tmp1_;
	AdwComboRow* _tmp2_;
	guint _tmp3_;
	guint _tmp4_;
	self = _data72_->self;
	_tmp0_ = self->priv->app_window;
	_tmp1_ = _tmp0_->settings;
	_tmp2_ = _data72_->style_combo;
	_tmp3_ = adw_combo_row_get_selected (_tmp2_);
	_tmp4_ = _tmp3_;
	dc_settings_manager_save_message_style (_tmp1_, (DcMessageStyle) _tmp4_);
}

static void
___lambda328__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda328_ (self);
}

static void
__lambda329_ (Block72Data* _data72_)
{
	DcSettingsDialog* self;
	DcWindow* _tmp0_;
	DcSettingsManager* _tmp1_;
	AdwComboRow* _tmp2_;
	guint _tmp3_;
	guint _tmp4_;
	self = _data72_->self;
	_tmp0_ = self->priv->app_window;
	_tmp1_ = _tmp0_->settings;
	_tmp2_ = _data72_->avatar_combo;
	_tmp3_ = adw_combo_row_get_selected (_tmp2_);
	_tmp4_ = _tmp3_;
	dc_settings_manager_save_bubble_avatar_display (_tmp1_, (DcBubbleAvatarDisplay) _tmp4_);
}

static void
___lambda329__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda329_ (self);
}

static void
__lambda330_ (Block72Data* _data72_)
{
	DcSettingsDialog* self;
	DcWindow* _tmp0_;
	DcSettingsManager* _tmp1_;
	GtkCheckButton* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	self = _data72_->self;
	_tmp0_ = self->priv->app_window;
	_tmp1_ = _tmp0_->settings;
	_tmp2_ = _data72_->direct_avatar_check;
	_tmp3_ = gtk_check_button_get_active (_tmp2_);
	_tmp4_ = _tmp3_;
	dc_settings_manager_save_bubble_avatars_in_direct_chats (_tmp1_, _tmp4_);
}

static void
___lambda330__gtk_check_button_toggled (GtkCheckButton* _sender,
                                        gpointer self)
{
	__lambda330_ (self);
}

static void
__lambda331_ (Block72Data* _data72_)
{
	DcSettingsDialog* self;
	GtkFontDialog* _tmp0_;
	self = _data72_->self;
	_tmp0_ = _data72_->font_dialog;
	dc_settings_dialog_on_choose_font (self, _tmp0_, NULL, NULL);
}

static void
___lambda331__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda331_ (self);
}

static void
__lambda334_ (DcSettingsDialog* self)
{
	DcWindow* _tmp0_;
	DcSettingsManager* _tmp1_;
	_tmp0_ = self->priv->app_window;
	_tmp1_ = _tmp0_->settings;
	dc_settings_manager_reset_font_defaults (_tmp1_);
	dc_settings_dialog_sync_font_controls (self);
}

static void
___lambda334__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda334_ ((DcSettingsDialog*) self);
}

static void
__lambda335_ (Block72Data* _data72_)
{
	DcSettingsDialog* self;
	DcWindow* _tmp0_;
	DcSettingsManager* _tmp1_;
	GtkColorDialogButton* _tmp2_;
	GdkRGBA _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	self = _data72_->self;
	_tmp0_ = self->priv->app_window;
	_tmp1_ = _tmp0_->settings;
	_tmp2_ = _data72_->accent_btn;
	_tmp3_ = *gtk_color_dialog_button_get_rgba (_tmp2_);
	_tmp4_ = dc_settings_dialog_hex_from_rgba (&_tmp3_);
	_tmp5_ = _tmp4_;
	dc_settings_manager_save_accent_color (_tmp1_, _tmp5_);
	_g_free0 (_tmp5_);
}

static void
___lambda335__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda335_ (self);
}

static void
__lambda336_ (Block72Data* _data72_)
{
	DcSettingsDialog* self;
	DcWindow* _tmp0_;
	DcSettingsManager* _tmp1_;
	GtkColorDialogButton* _tmp2_;
	self = _data72_->self;
	_tmp0_ = self->priv->app_window;
	_tmp1_ = _tmp0_->settings;
	dc_settings_manager_save_accent_color (_tmp1_, "");
	_tmp2_ = _data72_->accent_btn;
	dc_settings_dialog_apply_hex_to_button (_tmp2_, "");
}

static void
___lambda336__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda336_ (self);
}

static void
__lambda337_ (Block72Data* _data72_)
{
	DcSettingsDialog* self;
	DcBackgroundMode mode = 0;
	AdwComboRow* _tmp0_;
	guint _tmp1_;
	guint _tmp2_;
	GtkColorDialogButton* _tmp3_;
	DcWindow* _tmp4_;
	DcSettingsManager* _tmp5_;
	self = _data72_->self;
	_tmp0_ = _data72_->bg_mode_combo;
	_tmp1_ = adw_combo_row_get_selected (_tmp0_);
	_tmp2_ = _tmp1_;
	mode = (DcBackgroundMode) _tmp2_;
	_tmp3_ = _data72_->bg_color_btn;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp3_, mode != DC_BACKGROUND_MODE_SYSTEM);
	_tmp4_ = self->priv->app_window;
	_tmp5_ = _tmp4_->settings;
	dc_settings_manager_save_background_mode (_tmp5_, mode);
	dc_settings_dialog_apply_background (self);
}

static void
___lambda337__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda337_ (self);
}

static void
__lambda338_ (Block72Data* _data72_)
{
	DcSettingsDialog* self;
	DcWindow* _tmp0_;
	DcSettingsManager* _tmp1_;
	GtkColorDialogButton* _tmp2_;
	GdkRGBA _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	self = _data72_->self;
	_tmp0_ = self->priv->app_window;
	_tmp1_ = _tmp0_->settings;
	_tmp2_ = _data72_->bg_color_btn;
	_tmp3_ = *gtk_color_dialog_button_get_rgba (_tmp2_);
	_tmp4_ = dc_settings_dialog_hex_from_rgba (&_tmp3_);
	_tmp5_ = _tmp4_;
	dc_settings_manager_save_background_color (_tmp1_, _tmp5_);
	_g_free0 (_tmp5_);
	dc_settings_dialog_apply_background (self);
}

static void
___lambda338__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda338_ (self);
}

static void
__lambda339_ (Block72Data* _data72_)
{
	DcSettingsDialog* self;
	guint selected = 0U;
	AdwComboRow* _tmp0_;
	guint _tmp1_;
	guint _tmp2_;
	gint action = 0;
	DcWindow* _tmp3_;
	DcSettingsManager* _tmp4_;
	self = _data72_->self;
	_tmp0_ = _data72_->dblclick_combo;
	_tmp1_ = adw_combo_row_get_selected (_tmp0_);
	_tmp2_ = _tmp1_;
	selected = _tmp2_;
	action = (gint) selected;
	if (selected == ((guint) 4)) {
		action = 5;
	} else {
		if (selected == ((guint) 5)) {
			action = 4;
		}
	}
	_tmp3_ = self->priv->app_window;
	_tmp4_ = _tmp3_->settings;
	dc_settings_manager_save_double_click_action (_tmp4_, action);
}

static void
___lambda339__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda339_ (self);
}

static void
__lambda340_ (Block72Data* _data72_)
{
	DcSettingsDialog* self;
	DcWindow* _tmp0_;
	DcSettingsManager* _tmp1_;
	AdwComboRow* _tmp2_;
	guint _tmp3_;
	guint _tmp4_;
	self = _data72_->self;
	_tmp0_ = self->priv->app_window;
	_tmp1_ = _tmp0_->settings;
	_tmp2_ = _data72_->md_combo;
	_tmp3_ = adw_combo_row_get_selected (_tmp2_);
	_tmp4_ = _tmp3_;
	dc_settings_manager_save_markdown_mode (_tmp1_, (DcMarkdownMode) _tmp4_);
}

static void
___lambda340__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda340_ (self);
}

static void
__lambda341_ (Block72Data* _data72_)
{
	DcSettingsDialog* self;
	DcWindow* _tmp0_;
	DcSettingsManager* _tmp1_;
	GtkSwitch* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	self = _data72_->self;
	_tmp0_ = self->priv->app_window;
	_tmp1_ = _tmp0_->settings;
	_tmp2_ = _data72_->shift_switch;
	_tmp3_ = gtk_switch_get_active (_tmp2_);
	_tmp4_ = _tmp3_;
	dc_settings_manager_save_shift_enter_sends (_tmp1_, _tmp4_);
}

static void
___lambda341__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda341_ (self);
}

static void
__lambda342_ (Block72Data* _data72_)
{
	DcSettingsDialog* self;
	DcWindow* _tmp0_;
	DcSettingsManager* _tmp1_;
	GtkSwitch* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	self = _data72_->self;
	_tmp0_ = self->priv->app_window;
	_tmp1_ = _tmp0_->settings;
	_tmp2_ = _data72_->audio_switch;
	_tmp3_ = gtk_switch_get_active (_tmp2_);
	_tmp4_ = _tmp3_;
	dc_settings_manager_save_system_audio_player (_tmp1_, _tmp4_);
}

static void
___lambda342__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda342_ (self);
}

static void
__lambda343_ (Block72Data* _data72_)
{
	DcSettingsDialog* self;
	DcWindow* _tmp0_;
	GtkSwitch* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	self = _data72_->self;
	_tmp0_ = self->priv->app_window;
	_tmp1_ = _data72_->tray_switch;
	_tmp2_ = gtk_switch_get_active (_tmp1_);
	_tmp3_ = _tmp2_;
	dc_window_set_minimize_to_tray (_tmp0_, _tmp3_);
}

static void
___lambda343__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda343_ (self);
}

static void
__lambda349_ (Block72Data* _data72_)
{
	DcSettingsDialog* self;
	DcWindow* _tmp0_;
	GtkSwitch* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	self = _data72_->self;
	_tmp0_ = self->priv->app_window;
	_tmp1_ = _data72_->notif_switch;
	_tmp2_ = gtk_switch_get_active (_tmp1_);
	_tmp3_ = _tmp2_;
	dc_window_set_notifications_enabled (_tmp0_, _tmp3_);
}

static void
___lambda349__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda349_ (self);
}

static void
__lambda350_ (Block72Data* _data72_)
{
	DcSettingsDialog* self;
	DcWindow* _tmp0_;
	DcSettingsManager* _tmp1_;
	GtkSwitch* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	self = _data72_->self;
	_tmp0_ = self->priv->app_window;
	_tmp1_ = _tmp0_->settings;
	_tmp2_ = _data72_->notification_contents_switch;
	_tmp3_ = gtk_switch_get_active (_tmp2_);
	_tmp4_ = _tmp3_;
	dc_settings_manager_save_show_notification_contents (_tmp1_, _tmp4_);
}

static void
___lambda350__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda350_ (self);
}

static void
_dc_settings_dialog_on_rpc_source_changed_g_object_notify (GObject* _sender,
                                                           GParamSpec* pspec,
                                                           gpointer self)
{
	dc_settings_dialog_on_rpc_source_changed ((DcSettingsDialog*) self);
}

static void
__lambda369_ (DcSettingsDialog* self)
{
	dc_settings_dialog_on_browse_rpc_server (self, NULL, NULL);
}

static void
___lambda369__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda369_ ((DcSettingsDialog*) self);
}

static void
__lambda370_ (DcSettingsDialog* self)
{
	dc_settings_dialog_check_rpc_updates (self, NULL, NULL);
}

static void
___lambda370__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda370_ ((DcSettingsDialog*) self);
}

static void
__lambda372_ (Block72Data* _data72_)
{
	DcSettingsDialog* self;
	DcWindow* _tmp0_;
	DcSettingsManager* _tmp1_;
	GtkSwitch* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	self = _data72_->self;
	_tmp0_ = self->priv->app_window;
	_tmp1_ = _tmp0_->settings;
	_tmp2_ = _data72_->autocheck_switch;
	_tmp3_ = gtk_switch_get_active (_tmp2_);
	_tmp4_ = _tmp3_;
	dc_settings_manager_save_rpc_check_updates_on_startup (_tmp1_, _tmp4_);
}

static void
___lambda372__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda372_ (self);
}

static void
__lambda373_ (DcSettingsDialog* self)
{
	dc_settings_dialog_on_browse_accounts_path (self, NULL, NULL);
}

static void
___lambda373__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda373_ ((DcSettingsDialog*) self);
}

static void
__lambda374_ (DcSettingsDialog* self)
{
	DcWindow* _tmp0_;
	DcSettingsManager* _tmp1_;
	DcWindow* _tmp2_;
	_tmp0_ = self->priv->app_window;
	_tmp1_ = _tmp0_->settings;
	dc_settings_manager_reset_accounts_path (_tmp1_);
	dc_settings_dialog_sync_accounts_path_row (self);
	_tmp2_ = self->priv->app_window;
	dc_window_reconnect_rpc_server (_tmp2_, NULL, NULL);
}

static void
___lambda374__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda374_ ((DcSettingsDialog*) self);
}

static void
__lambda375_ (DcSettingsDialog* self)
{
	if (!self->priv->loading_proxy) {
		dc_settings_dialog_save_proxy_settings (self, NULL, NULL);
	}
}

static void
___lambda375__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda375_ ((DcSettingsDialog*) self);
}

static void
__lambda376_ (DcSettingsDialog* self)
{
	dc_settings_dialog_save_proxy_settings (self, NULL, NULL);
}

static void
___lambda376__gtk_entry_activate (GtkEntry* _sender,
                                  gpointer self)
{
	__lambda376_ ((DcSettingsDialog*) self);
}

static void
__lambda377_ (DcSettingsDialog* self)
{
	dc_settings_dialog_save_proxy_settings (self, NULL, NULL);
}

static void
___lambda377__gtk_event_controller_focus_leave (GtkEventControllerFocus* _sender,
                                                gpointer self)
{
	__lambda377_ ((DcSettingsDialog*) self);
}

static void
__lambda378_ (Block72Data* _data72_)
{
	DcSettingsDialog* self;
	DcWindow* _tmp0_;
	DcSettingsManager* _tmp1_;
	GtkSwitch* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	self = _data72_->self;
	_tmp0_ = self->priv->app_window;
	_tmp1_ = _tmp0_->settings;
	_tmp2_ = _data72_->sticker_switch;
	_tmp3_ = gtk_switch_get_active (_tmp2_);
	_tmp4_ = _tmp3_;
	dc_settings_manager_save_animate_stickers (_tmp1_, _tmp4_);
}

static void
___lambda378__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda378_ (self);
}

static void
__lambda379_ (Block72Data* _data72_)
{
	DcSettingsDialog* self;
	DcWindow* _tmp0_;
	AdwComboRow* _tmp1_;
	guint _tmp2_;
	guint _tmp3_;
	self = _data72_->self;
	_tmp0_ = self->priv->app_window;
	_tmp1_ = _data72_->download_combo;
	_tmp2_ = adw_combo_row_get_selected (_tmp1_);
	_tmp3_ = _tmp2_;
	dc_window_set_auto_download_limit (_tmp0_, dc_settings_dialog_auto_download_limit_for_index (_tmp3_), NULL, NULL);
}

static void
___lambda379__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda379_ (self);
}

static void
__lambda387_ (DcSettingsDialog* self)
{
	dc_settings_dialog_on_reset_settings (self, NULL, NULL);
}

static void
___lambda387__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda387_ ((DcSettingsDialog*) self);
}

DcSettingsDialog*
dc_settings_dialog_construct (GType object_type,
                              DcWindow* window,
                              DcRpcClient* rpc)
{
	DcSettingsDialog * self = NULL;
	Block72Data* _data72_;
	DcRpcClient* _tmp0_;
	AdwPreferencesPage* general_page = NULL;
	AdwPreferencesPage* _tmp1_;
	AdwPreferencesPage* _tmp2_;
	AdwPreferencesPage* _tmp3_;
	AdwPreferencesPage* _tmp4_;
	AdwPreferencesPage* advanced_page = NULL;
	AdwPreferencesPage* _tmp5_;
	AdwPreferencesPage* _tmp6_;
	AdwPreferencesPage* _tmp7_;
	AdwPreferencesPage* _tmp8_;
	AdwPreferencesGroup* appearance_group = NULL;
	AdwPreferencesPage* _tmp9_;
	AdwPreferencesGroup* _tmp10_;
	gchar** theme_labels = NULL;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar** _tmp14_;
	gint theme_labels_length1;
	gint _theme_labels_size_;
	AdwPreferencesGroup* _tmp15_;
	gchar** _tmp16_;
	gint _tmp16__length1;
	DcWindow* _tmp17_;
	DcSettingsManager* _tmp18_;
	DcThemeOverride _tmp19_;
	DcThemeOverride _tmp20_;
	AdwComboRow* _tmp21_;
	AdwComboRow* _tmp22_;
	gchar** code_labels = NULL;
	gchar* _tmp23_;
	gchar* _tmp24_;
	gchar* _tmp25_;
	gchar* _tmp26_;
	gchar* _tmp27_;
	gchar** _tmp28_;
	gint code_labels_length1;
	gint _code_labels_size_;
	AdwPreferencesGroup* _tmp29_;
	gchar** _tmp30_;
	gint _tmp30__length1;
	DcWindow* _tmp31_;
	DcSettingsManager* _tmp32_;
	DcCodeTheme _tmp33_;
	DcCodeTheme _tmp34_;
	AdwComboRow* _tmp35_;
	AdwComboRow* _tmp36_;
	gchar** style_labels = NULL;
	gchar* _tmp37_;
	gchar* _tmp38_;
	gchar* _tmp39_;
	gchar** _tmp40_;
	gint style_labels_length1;
	gint _style_labels_size_;
	AdwPreferencesGroup* _tmp41_;
	gchar** _tmp42_;
	gint _tmp42__length1;
	DcWindow* _tmp43_;
	DcSettingsManager* _tmp44_;
	DcMessageStyle _tmp45_;
	DcMessageStyle _tmp46_;
	AdwComboRow* _tmp47_;
	AdwComboRow* _tmp48_;
	gchar** avatar_labels = NULL;
	gchar* _tmp49_;
	gchar* _tmp50_;
	gchar* _tmp51_;
	gchar** _tmp52_;
	gint avatar_labels_length1;
	gint _avatar_labels_size_;
	AdwPreferencesGroup* _tmp53_;
	gchar** _tmp54_;
	gint _tmp54__length1;
	DcWindow* _tmp55_;
	DcSettingsManager* _tmp56_;
	DcBubbleAvatarDisplay _tmp57_;
	DcBubbleAvatarDisplay _tmp58_;
	AdwComboRow* _tmp59_;
	AdwComboRow* _tmp60_;
	AdwActionRow* direct_avatar_row = NULL;
	AdwActionRow* _tmp61_;
	GtkCheckButton* _tmp62_;
	GtkCheckButton* _tmp63_;
	DcWindow* _tmp64_;
	DcSettingsManager* _tmp65_;
	gboolean _tmp66_;
	gboolean _tmp67_;
	GtkCheckButton* _tmp68_;
	AdwActionRow* _tmp69_;
	GtkCheckButton* _tmp70_;
	AdwActionRow* _tmp71_;
	GtkCheckButton* _tmp72_;
	AdwPreferencesGroup* _tmp73_;
	AdwActionRow* _tmp74_;
	AdwActionRow* _tmp75_;
	AdwActionRow* _tmp76_;
	AdwActionRow* _tmp77_;
	GtkFontDialog* _tmp78_;
	GtkFontDialog* _tmp79_;
	GtkFontDialog* _tmp80_;
	GtkButton* _tmp81_;
	GtkButton* _tmp82_;
	GtkButton* _tmp83_;
	GtkButton* _tmp84_;
	GtkButton* _tmp85_;
	AdwActionRow* _tmp86_;
	GtkButton* _tmp87_;
	GtkButton* font_reset_btn = NULL;
	GtkButton* _tmp88_;
	GtkButton* _tmp89_;
	GtkButton* _tmp90_;
	GtkButton* _tmp91_;
	GtkButton* _tmp92_;
	AdwActionRow* _tmp93_;
	GtkButton* _tmp94_;
	AdwPreferencesGroup* _tmp95_;
	AdwActionRow* _tmp96_;
	AdwActionRow* accent_row = NULL;
	AdwActionRow* _tmp97_;
	GtkColorDialog* _tmp98_;
	GtkColorDialogButton* _tmp99_;
	GtkColorDialogButton* _tmp100_;
	GtkColorDialogButton* _tmp101_;
	DcWindow* _tmp102_;
	DcSettingsManager* _tmp103_;
	const gchar* _tmp104_;
	const gchar* _tmp105_;
	GtkColorDialogButton* _tmp106_;
	GtkButton* accent_reset_btn = NULL;
	GtkButton* _tmp107_;
	GtkButton* _tmp108_;
	GtkButton* _tmp109_;
	GtkButton* _tmp110_;
	GtkButton* _tmp111_;
	AdwActionRow* _tmp112_;
	GtkColorDialogButton* _tmp113_;
	AdwActionRow* _tmp114_;
	GtkButton* _tmp115_;
	AdwPreferencesGroup* _tmp116_;
	AdwActionRow* _tmp117_;
	gchar** bg_mode_labels = NULL;
	gchar* _tmp118_;
	gchar* _tmp119_;
	gchar* _tmp120_;
	gchar** _tmp121_;
	gint bg_mode_labels_length1;
	gint _bg_mode_labels_size_;
	AdwPreferencesGroup* _tmp122_;
	gchar** _tmp123_;
	gint _tmp123__length1;
	DcWindow* _tmp124_;
	DcSettingsManager* _tmp125_;
	DcBackgroundMode _tmp126_;
	DcBackgroundMode _tmp127_;
	AdwComboRow* _tmp128_;
	GtkColorDialog* _tmp129_;
	GtkColorDialogButton* _tmp130_;
	GtkColorDialogButton* _tmp131_;
	GtkColorDialogButton* _tmp132_;
	DcWindow* _tmp133_;
	DcSettingsManager* _tmp134_;
	const gchar* _tmp135_;
	const gchar* _tmp136_;
	GtkColorDialogButton* _tmp137_;
	DcWindow* _tmp138_;
	DcSettingsManager* _tmp139_;
	DcBackgroundMode _tmp140_;
	DcBackgroundMode _tmp141_;
	AdwComboRow* _tmp142_;
	GtkColorDialogButton* _tmp143_;
	AdwComboRow* _tmp144_;
	GtkColorDialogButton* _tmp145_;
	AdwPreferencesGroup* behavior_group = NULL;
	AdwPreferencesPage* _tmp146_;
	AdwPreferencesGroup* _tmp147_;
	gchar** dblclick_labels = NULL;
	gchar* _tmp148_;
	gchar* _tmp149_;
	gchar* _tmp150_;
	gchar* _tmp151_;
	gchar* _tmp152_;
	gchar* _tmp153_;
	gchar** _tmp154_;
	gint dblclick_labels_length1;
	gint _dblclick_labels_size_;
	guint dblclick_selected = 0U;
	DcWindow* _tmp155_;
	DcSettingsManager* _tmp156_;
	gint _tmp157_;
	gint _tmp158_;
	AdwPreferencesGroup* _tmp159_;
	gchar** _tmp160_;
	gint _tmp160__length1;
	AdwComboRow* _tmp161_;
	AdwComboRow* _tmp162_;
	gchar** md_labels = NULL;
	gchar* _tmp163_;
	gchar* _tmp164_;
	gchar* _tmp165_;
	gchar** _tmp166_;
	gint md_labels_length1;
	gint _md_labels_size_;
	AdwPreferencesGroup* _tmp167_;
	gchar** _tmp168_;
	gint _tmp168__length1;
	DcWindow* _tmp169_;
	DcSettingsManager* _tmp170_;
	DcMarkdownMode _tmp171_;
	DcMarkdownMode _tmp172_;
	AdwComboRow* _tmp173_;
	AdwComboRow* _tmp174_;
	AdwActionRow* shift_row = NULL;
	AdwActionRow* _tmp175_;
	AdwActionRow* _tmp176_;
	DcWindow* _tmp177_;
	DcSettingsManager* _tmp178_;
	gboolean _tmp179_;
	gboolean _tmp180_;
	GtkSwitch* _tmp181_;
	GtkSwitch* _tmp182_;
	AdwPreferencesGroup* _tmp183_;
	AdwActionRow* _tmp184_;
	AdwActionRow* audio_row = NULL;
	AdwActionRow* _tmp185_;
	AdwActionRow* _tmp186_;
	DcWindow* _tmp187_;
	DcSettingsManager* _tmp188_;
	gboolean _tmp189_;
	gboolean _tmp190_;
	GtkSwitch* _tmp191_;
	GtkSwitch* _tmp192_;
	const gchar* _tmp193_ = NULL;
	const gchar* _tmp194_ = NULL;
	AdwActionRow* tray_row = NULL;
	AdwActionRow* _tmp195_;
	AdwActionRow* _tmp196_;
	DcWindow* _tmp197_;
	DcSettingsManager* _tmp198_;
	gboolean _tmp199_;
	gboolean _tmp200_;
	GtkSwitch* _tmp201_;
	GtkSwitch* _tmp202_;
	AdwPreferencesGroup* _tmp203_;
	AdwActionRow* _tmp204_;
	AdwPreferencesPage* _tmp205_;
	AdwPreferencesGroup* notifications_group = NULL;
	AdwPreferencesPage* _tmp206_;
	AdwPreferencesGroup* _tmp207_;
	AdwActionRow* notif_row = NULL;
	AdwActionRow* _tmp208_;
	AdwActionRow* _tmp209_;
	DcWindow* _tmp210_;
	DcSettingsManager* _tmp211_;
	gboolean _tmp212_;
	gboolean _tmp213_;
	GtkSwitch* _tmp214_;
	GtkSwitch* _tmp215_;
	AdwPreferencesGroup* _tmp216_;
	AdwActionRow* _tmp217_;
	AdwActionRow* notification_contents_row = NULL;
	AdwActionRow* _tmp218_;
	AdwActionRow* _tmp219_;
	DcWindow* _tmp220_;
	DcSettingsManager* _tmp221_;
	gboolean _tmp222_;
	gboolean _tmp223_;
	GtkSwitch* _tmp224_;
	GtkSwitch* _tmp225_;
	AdwPreferencesGroup* _tmp226_;
	AdwActionRow* _tmp227_;
	AdwPreferencesGroup* chatmail_group = NULL;
	AdwPreferencesPage* _tmp228_;
	AdwPreferencesGroup* _tmp229_;
	gchar** rpc_source_labels = NULL;
	gchar* _tmp230_;
	gchar* _tmp231_;
	gchar** _tmp232_;
	gint rpc_source_labels_length1;
	gint _rpc_source_labels_size_;
	AdwPreferencesGroup* _tmp233_;
	gchar** _tmp234_;
	gint _tmp234__length1;
	DcWindow* _tmp235_;
	DcSettingsManager* _tmp236_;
	AdwComboRow* _tmp237_;
	AdwComboRow* _tmp238_;
	AdwActionRow* _tmp239_;
	AdwComboRow* _tmp240_;
	GtkButton* _tmp241_;
	GtkButton* _tmp242_;
	GtkButton* _tmp243_;
	GtkButton* _tmp244_;
	GtkButton* _tmp245_;
	AdwActionRow* _tmp246_;
	GtkButton* _tmp247_;
	GtkButton* _tmp248_;
	GtkButton* _tmp249_;
	GtkButton* _tmp250_;
	GtkButton* _tmp251_;
	GtkButton* _tmp252_;
	AdwActionRow* _tmp253_;
	GtkButton* _tmp254_;
	AdwActionRow* rpc_autocheck_row = NULL;
	AdwActionRow* _tmp255_;
	AdwActionRow* _tmp256_;
	DcWindow* _tmp257_;
	DcSettingsManager* _tmp258_;
	gboolean _tmp259_;
	gboolean _tmp260_;
	GtkSwitch* _tmp261_;
	GtkSwitch* _tmp262_;
	AdwActionRow* _tmp263_;
	AdwPreferencesGroup* _tmp264_;
	AdwActionRow* _tmp265_;
	AdwActionRow* _tmp266_;
	AdwActionRow* _tmp267_;
	GtkButton* accounts_path_change_btn = NULL;
	GtkButton* _tmp268_;
	GtkButton* _tmp269_;
	GtkButton* _tmp270_;
	GtkButton* _tmp271_;
	GtkButton* _tmp272_;
	AdwActionRow* _tmp273_;
	GtkButton* _tmp274_;
	GtkButton* _tmp275_;
	GtkButton* _tmp276_;
	GtkButton* _tmp277_;
	GtkButton* _tmp278_;
	GtkButton* _tmp279_;
	AdwActionRow* _tmp280_;
	GtkButton* _tmp281_;
	AdwPreferencesGroup* _tmp282_;
	AdwActionRow* _tmp283_;
	AdwPreferencesGroup* network_group = NULL;
	AdwPreferencesPage* _tmp284_;
	AdwPreferencesGroup* _tmp285_;
	AdwActionRow* _tmp286_;
	AdwActionRow* _tmp287_;
	GtkSwitch* _tmp288_;
	GtkSwitch* _tmp289_;
	AdwPreferencesGroup* _tmp290_;
	AdwActionRow* _tmp291_;
	AdwActionRow* _tmp292_;
	GtkEntry* _tmp293_;
	GtkEntry* _tmp294_;
	GtkEntry* _tmp295_;
	GtkEntry* _tmp296_;
	GtkEntry* _tmp297_;
	GtkEntry* _tmp298_;
	GtkEventControllerFocus* proxy_focus = NULL;
	GtkEventControllerFocus* _tmp299_;
	GtkEventControllerFocus* _tmp300_;
	GtkEntry* _tmp301_;
	GtkEventControllerFocus* _tmp302_;
	GtkEventController* _tmp303_;
	AdwActionRow* _tmp304_;
	GtkEntry* _tmp305_;
	AdwActionRow* _tmp306_;
	GtkEntry* _tmp307_;
	AdwPreferencesGroup* _tmp308_;
	AdwActionRow* _tmp309_;
	AdwActionRow* sticker_row = NULL;
	AdwActionRow* _tmp310_;
	AdwActionRow* _tmp311_;
	DcWindow* _tmp312_;
	DcSettingsManager* _tmp313_;
	gboolean _tmp314_;
	gboolean _tmp315_;
	GtkSwitch* _tmp316_;
	GtkSwitch* _tmp317_;
	gchar** download_labels = NULL;
	gchar* _tmp318_;
	gchar* _tmp319_;
	gchar* _tmp320_;
	gchar* _tmp321_;
	gchar* _tmp322_;
	gchar* _tmp323_;
	gchar* _tmp324_;
	gchar** _tmp325_;
	gint download_labels_length1;
	gint _download_labels_size_;
	AdwPreferencesGroup* _tmp326_;
	gchar** _tmp327_;
	gint _tmp327__length1;
	DcWindow* _tmp328_;
	DcSettingsManager* _tmp329_;
	gint _tmp330_;
	gint _tmp331_;
	AdwComboRow* _tmp332_;
	AdwComboRow* _tmp333_;
	gboolean whisper_found = FALSE;
	const gchar* _tmp334_ = NULL;
	AdwActionRow* transcription_row = NULL;
	AdwActionRow* _tmp335_;
	const gchar* _tmp336_ = NULL;
	GtkLabel* transcription_status = NULL;
	GtkLabel* _tmp337_;
	AdwActionRow* _tmp338_;
	AdwPreferencesGroup* _tmp339_;
	AdwActionRow* _tmp340_;
	AdwPreferencesGroup* _tmp341_;
	AdwActionRow* _tmp342_;
	AdwPreferencesGroup* _tmp343_;
	AdwActionRow* _tmp344_;
	AdwPreferencesPage* _tmp345_;
	AdwPreferencesGroup* reset_group = NULL;
	AdwPreferencesPage* _tmp346_;
	AdwPreferencesGroup* _tmp347_;
	AdwActionRow* reset_row = NULL;
	AdwActionRow* _tmp348_;
	GtkButton* reset_btn = NULL;
	GtkButton* _tmp349_;
	g_return_val_if_fail (window != NULL, NULL);
	g_return_val_if_fail (rpc != NULL, NULL);
	_data72_ = g_slice_new0 (Block72Data);
	_data72_->_ref_count_ = 1;
	self = (DcSettingsDialog*) g_object_new (object_type, NULL);
	_data72_->self = g_object_ref (self);
	self->priv->app_window = window;
	_tmp0_ = _g_object_ref0 (rpc);
	_g_object_unref0 (self->priv->rpc);
	self->priv->rpc = _tmp0_;
	adw_dialog_set_content_width ((AdwDialog*) self, 640);
	adw_dialog_set_content_height ((AdwDialog*) self, 576);
	_tmp1_ = (AdwPreferencesPage*) adw_preferences_page_new ();
	g_object_ref_sink (_tmp1_);
	general_page = _tmp1_;
	_tmp2_ = general_page;
	adw_preferences_page_set_title (_tmp2_, "General");
	_tmp3_ = general_page;
	adw_preferences_page_set_icon_name (_tmp3_, "preferences-system-symbolic");
	_tmp4_ = general_page;
	adw_preferences_dialog_add ((AdwPreferencesDialog*) self, _tmp4_);
	_tmp5_ = (AdwPreferencesPage*) adw_preferences_page_new ();
	g_object_ref_sink (_tmp5_);
	advanced_page = _tmp5_;
	_tmp6_ = advanced_page;
	adw_preferences_page_set_title (_tmp6_, "Advanced");
	_tmp7_ = advanced_page;
	adw_preferences_page_set_icon_name (_tmp7_, "preferences-other-symbolic");
	_tmp8_ = advanced_page;
	adw_preferences_dialog_add ((AdwPreferencesDialog*) self, _tmp8_);
	_tmp9_ = general_page;
	_tmp10_ = dc_settings_dialog_settings_group (self, _tmp9_, "Appearance");
	appearance_group = _tmp10_;
	_tmp11_ = g_strdup ("System");
	_tmp12_ = g_strdup ("Light");
	_tmp13_ = g_strdup ("Dark");
	_tmp14_ = g_new0 (gchar*, 3 + 1);
	_tmp14_[0] = _tmp11_;
	_tmp14_[1] = _tmp12_;
	_tmp14_[2] = _tmp13_;
	theme_labels = _tmp14_;
	theme_labels_length1 = 3;
	_theme_labels_size_ = theme_labels_length1;
	_tmp15_ = appearance_group;
	_tmp16_ = theme_labels;
	_tmp16__length1 = theme_labels_length1;
	_tmp17_ = self->priv->app_window;
	_tmp18_ = _tmp17_->settings;
	_tmp19_ = dc_settings_manager_get_theme_override (_tmp18_);
	_tmp20_ = _tmp19_;
	_tmp21_ = dc_settings_dialog_row_combo (_tmp15_, "GTK theme", "Override the system light or dark theme", _tmp16_, (gint) _tmp16__length1, (guint) _tmp20_);
	_data72_->theme_combo = _tmp21_;
	_tmp22_ = _data72_->theme_combo;
	g_signal_connect_data ((GObject*) _tmp22_, "notify::selected", (GCallback) ___lambda325__g_object_notify, block72_data_ref (_data72_), (GClosureNotify) block72_data_unref, 0);
	_tmp23_ = g_strdup ("Adaptive");
	_tmp24_ = g_strdup ("Solarized");
	_tmp25_ = g_strdup ("Monokai");
	_tmp26_ = g_strdup ("Nord");
	_tmp27_ = g_strdup ("None");
	_tmp28_ = g_new0 (gchar*, 5 + 1);
	_tmp28_[0] = _tmp23_;
	_tmp28_[1] = _tmp24_;
	_tmp28_[2] = _tmp25_;
	_tmp28_[3] = _tmp26_;
	_tmp28_[4] = _tmp27_;
	code_labels = _tmp28_;
	code_labels_length1 = 5;
	_code_labels_size_ = code_labels_length1;
	_tmp29_ = appearance_group;
	_tmp30_ = code_labels;
	_tmp30__length1 = code_labels_length1;
	_tmp31_ = self->priv->app_window;
	_tmp32_ = _tmp31_->settings;
	_tmp33_ = dc_settings_manager_get_code_theme (_tmp32_);
	_tmp34_ = _tmp33_;
	_tmp35_ = dc_settings_dialog_row_combo (_tmp29_, "Code highlighting", "Color scheme for code blocks in messages", _tmp30_, (gint) _tmp30__length1, (guint) _tmp34_);
	_data72_->code_combo = _tmp35_;
	_tmp36_ = _data72_->code_combo;
	g_signal_connect_data ((GObject*) _tmp36_, "notify::selected", (GCallback) ___lambda327__g_object_notify, block72_data_ref (_data72_), (GClosureNotify) block72_data_unref, 0);
	_tmp37_ = g_strdup ("Bubbles");
	_tmp38_ = g_strdup ("IRC");
	_tmp39_ = g_strdup ("Workspace");
	_tmp40_ = g_new0 (gchar*, 3 + 1);
	_tmp40_[0] = _tmp37_;
	_tmp40_[1] = _tmp38_;
	_tmp40_[2] = _tmp39_;
	style_labels = _tmp40_;
	style_labels_length1 = 3;
	_style_labels_size_ = style_labels_length1;
	_tmp41_ = appearance_group;
	_tmp42_ = style_labels;
	_tmp42__length1 = style_labels_length1;
	_tmp43_ = self->priv->app_window;
	_tmp44_ = _tmp43_->settings;
	_tmp45_ = dc_settings_manager_get_message_style (_tmp44_);
	_tmp46_ = _tmp45_;
	_tmp47_ = dc_settings_dialog_row_combo (_tmp41_, "Message style", "Chat bubbles, compact IRC lines or workspace rows", _tmp42_, (gint) _tmp42__length1, (guint) _tmp46_);
	_data72_->style_combo = _tmp47_;
	_tmp48_ = _data72_->style_combo;
	g_signal_connect_data ((GObject*) _tmp48_, "notify::selected", (GCallback) ___lambda328__g_object_notify, block72_data_ref (_data72_), (GClosureNotify) block72_data_unref, 0);
	_tmp49_ = g_strdup ("none");
	_tmp50_ = g_strdup ("other");
	_tmp51_ = g_strdup ("both");
	_tmp52_ = g_new0 (gchar*, 3 + 1);
	_tmp52_[0] = _tmp49_;
	_tmp52_[1] = _tmp50_;
	_tmp52_[2] = _tmp51_;
	avatar_labels = _tmp52_;
	avatar_labels_length1 = 3;
	_avatar_labels_size_ = avatar_labels_length1;
	_tmp53_ = appearance_group;
	_tmp54_ = avatar_labels;
	_tmp54__length1 = avatar_labels_length1;
	_tmp55_ = self->priv->app_window;
	_tmp56_ = _tmp55_->settings;
	_tmp57_ = dc_settings_manager_get_bubble_avatar_display (_tmp56_);
	_tmp58_ = _tmp57_;
	_tmp59_ = dc_settings_dialog_row_combo (_tmp53_, "Bubble avatars", "Show small avatars beside message bubbles", _tmp54_, (gint) _tmp54__length1, (guint) _tmp58_);
	_data72_->avatar_combo = _tmp59_;
	_tmp60_ = _data72_->avatar_combo;
	g_signal_connect_data ((GObject*) _tmp60_, "notify::selected", (GCallback) ___lambda329__g_object_notify, block72_data_ref (_data72_), (GClosureNotify) block72_data_unref, 0);
	_tmp61_ = dc_settings_dialog_action_row ("Use avatars in 1:1 chats", "Use the bubble avatar setting in direct conversations");
	direct_avatar_row = _tmp61_;
	_tmp62_ = (GtkCheckButton*) gtk_check_button_new ();
	g_object_ref_sink (_tmp62_);
	_data72_->direct_avatar_check = _tmp62_;
	_tmp63_ = _data72_->direct_avatar_check;
	_tmp64_ = self->priv->app_window;
	_tmp65_ = _tmp64_->settings;
	_tmp66_ = dc_settings_manager_get_bubble_avatars_in_direct_chats (_tmp65_);
	_tmp67_ = _tmp66_;
	gtk_check_button_set_active (_tmp63_, _tmp67_);
	_tmp68_ = _data72_->direct_avatar_check;
	g_signal_connect_data (_tmp68_, "toggled", (GCallback) ___lambda330__gtk_check_button_toggled, block72_data_ref (_data72_), (GClosureNotify) block72_data_unref, 0);
	_tmp69_ = direct_avatar_row;
	_tmp70_ = _data72_->direct_avatar_check;
	adw_action_row_add_suffix (_tmp69_, (GtkWidget*) _tmp70_);
	_tmp71_ = direct_avatar_row;
	_tmp72_ = _data72_->direct_avatar_check;
	adw_action_row_set_activatable_widget (_tmp71_, (GtkWidget*) _tmp72_);
	_tmp73_ = appearance_group;
	_tmp74_ = direct_avatar_row;
	adw_preferences_group_add (_tmp73_, (GtkWidget*) _tmp74_);
	_tmp75_ = dc_settings_dialog_action_row ("Conversation font", "Use the system font or choose another family, style and size");
	_g_object_unref0 (self->priv->font_type_row);
	self->priv->font_type_row = _tmp75_;
	_tmp76_ = self->priv->font_type_row;
	adw_action_row_set_title_lines (_tmp76_, 1);
	_tmp77_ = self->priv->font_type_row;
	adw_action_row_set_subtitle_lines (_tmp77_, 2);
	_tmp78_ = gtk_font_dialog_new ();
	_data72_->font_dialog = _tmp78_;
	_tmp79_ = _data72_->font_dialog;
	gtk_font_dialog_set_title (_tmp79_, "Choose Font");
	_tmp80_ = _data72_->font_dialog;
	gtk_font_dialog_set_modal (_tmp80_, TRUE);
	_tmp81_ = (GtkButton*) gtk_button_new_with_label ("Choose");
	g_object_ref_sink (_tmp81_);
	_g_object_unref0 (self->priv->font_btn);
	self->priv->font_btn = _tmp81_;
	_tmp82_ = self->priv->font_btn;
	gtk_widget_set_valign ((GtkWidget*) _tmp82_, GTK_ALIGN_CENTER);
	_tmp83_ = self->priv->font_btn;
	gtk_widget_add_css_class ((GtkWidget*) _tmp83_, "flat");
	_tmp84_ = self->priv->font_btn;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp84_, "Choose a font family, style and size");
	_tmp85_ = self->priv->font_btn;
	g_signal_connect_data (_tmp85_, "clicked", (GCallback) ___lambda331__gtk_button_clicked, block72_data_ref (_data72_), (GClosureNotify) block72_data_unref, 0);
	_tmp86_ = self->priv->font_type_row;
	_tmp87_ = self->priv->font_btn;
	adw_action_row_add_suffix (_tmp86_, (GtkWidget*) _tmp87_);
	_tmp88_ = (GtkButton*) gtk_button_new_from_icon_name ("edit-undo-symbolic");
	g_object_ref_sink (_tmp88_);
	font_reset_btn = _tmp88_;
	_tmp89_ = font_reset_btn;
	gtk_widget_set_valign ((GtkWidget*) _tmp89_, GTK_ALIGN_CENTER);
	_tmp90_ = font_reset_btn;
	gtk_widget_add_css_class ((GtkWidget*) _tmp90_, "flat");
	_tmp91_ = font_reset_btn;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp91_, "Reset font settings to defaults");
	_tmp92_ = font_reset_btn;
	g_signal_connect_object (_tmp92_, "clicked", (GCallback) ___lambda334__gtk_button_clicked, self, 0);
	_tmp93_ = self->priv->font_type_row;
	_tmp94_ = font_reset_btn;
	adw_action_row_add_suffix (_tmp93_, (GtkWidget*) _tmp94_);
	_tmp95_ = appearance_group;
	_tmp96_ = self->priv->font_type_row;
	adw_preferences_group_add (_tmp95_, (GtkWidget*) _tmp96_);
	dc_settings_dialog_sync_font_controls (self);
	_tmp97_ = dc_settings_dialog_action_row ("Accent color", "Override the system accent color");
	accent_row = _tmp97_;
	_tmp98_ = gtk_color_dialog_new ();
	_tmp99_ = (GtkColorDialogButton*) gtk_color_dialog_button_new (_tmp98_);
	g_object_ref_sink (_tmp99_);
	_data72_->accent_btn = _tmp99_;
	_tmp100_ = _data72_->accent_btn;
	gtk_widget_set_valign ((GtkWidget*) _tmp100_, GTK_ALIGN_CENTER);
	_tmp101_ = _data72_->accent_btn;
	_tmp102_ = self->priv->app_window;
	_tmp103_ = _tmp102_->settings;
	_tmp104_ = dc_settings_manager_get_accent_color (_tmp103_);
	_tmp105_ = _tmp104_;
	dc_settings_dialog_apply_hex_to_button (_tmp101_, _tmp105_);
	_tmp106_ = _data72_->accent_btn;
	g_signal_connect_data ((GObject*) _tmp106_, "notify::rgba", (GCallback) ___lambda335__g_object_notify, block72_data_ref (_data72_), (GClosureNotify) block72_data_unref, 0);
	_tmp107_ = (GtkButton*) gtk_button_new_from_icon_name ("edit-undo-symbolic");
	g_object_ref_sink (_tmp107_);
	accent_reset_btn = _tmp107_;
	_tmp108_ = accent_reset_btn;
	gtk_widget_set_valign ((GtkWidget*) _tmp108_, GTK_ALIGN_CENTER);
	_tmp109_ = accent_reset_btn;
	gtk_widget_add_css_class ((GtkWidget*) _tmp109_, "flat");
	_tmp110_ = accent_reset_btn;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp110_, "Use system accent color");
	_tmp111_ = accent_reset_btn;
	g_signal_connect_data (_tmp111_, "clicked", (GCallback) ___lambda336__gtk_button_clicked, block72_data_ref (_data72_), (GClosureNotify) block72_data_unref, 0);
	_tmp112_ = accent_row;
	_tmp113_ = _data72_->accent_btn;
	adw_action_row_add_suffix (_tmp112_, (GtkWidget*) _tmp113_);
	_tmp114_ = accent_row;
	_tmp115_ = accent_reset_btn;
	adw_action_row_add_suffix (_tmp114_, (GtkWidget*) _tmp115_);
	_tmp116_ = appearance_group;
	_tmp117_ = accent_row;
	adw_preferences_group_add (_tmp116_, (GtkWidget*) _tmp117_);
	_tmp118_ = g_strdup ("System");
	_tmp119_ = g_strdup ("Solid");
	_tmp120_ = g_strdup ("Gradient");
	_tmp121_ = g_new0 (gchar*, 3 + 1);
	_tmp121_[0] = _tmp118_;
	_tmp121_[1] = _tmp119_;
	_tmp121_[2] = _tmp120_;
	bg_mode_labels = _tmp121_;
	bg_mode_labels_length1 = 3;
	_bg_mode_labels_size_ = bg_mode_labels_length1;
	_tmp122_ = appearance_group;
	_tmp123_ = bg_mode_labels;
	_tmp123__length1 = bg_mode_labels_length1;
	_tmp124_ = self->priv->app_window;
	_tmp125_ = _tmp124_->settings;
	_tmp126_ = dc_settings_manager_get_background_mode (_tmp125_);
	_tmp127_ = _tmp126_;
	_tmp128_ = dc_settings_dialog_row_combo (_tmp122_, "Background color", "Tint the window background with a solid color or a gradient", _tmp123_, (gint) _tmp123__length1, (guint) _tmp127_);
	_data72_->bg_mode_combo = _tmp128_;
	_tmp129_ = gtk_color_dialog_new ();
	_tmp130_ = (GtkColorDialogButton*) gtk_color_dialog_button_new (_tmp129_);
	g_object_ref_sink (_tmp130_);
	_data72_->bg_color_btn = _tmp130_;
	_tmp131_ = _data72_->bg_color_btn;
	gtk_widget_set_valign ((GtkWidget*) _tmp131_, GTK_ALIGN_CENTER);
	_tmp132_ = _data72_->bg_color_btn;
	_tmp133_ = self->priv->app_window;
	_tmp134_ = _tmp133_->settings;
	_tmp135_ = dc_settings_manager_get_background_color (_tmp134_);
	_tmp136_ = _tmp135_;
	dc_settings_dialog_apply_hex_to_button (_tmp132_, _tmp136_);
	_tmp137_ = _data72_->bg_color_btn;
	_tmp138_ = self->priv->app_window;
	_tmp139_ = _tmp138_->settings;
	_tmp140_ = dc_settings_manager_get_background_mode (_tmp139_);
	_tmp141_ = _tmp140_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp137_, _tmp141_ != DC_BACKGROUND_MODE_SYSTEM);
	_tmp142_ = _data72_->bg_mode_combo;
	g_signal_connect_data ((GObject*) _tmp142_, "notify::selected", (GCallback) ___lambda337__g_object_notify, block72_data_ref (_data72_), (GClosureNotify) block72_data_unref, 0);
	_tmp143_ = _data72_->bg_color_btn;
	g_signal_connect_data ((GObject*) _tmp143_, "notify::rgba", (GCallback) ___lambda338__g_object_notify, block72_data_ref (_data72_), (GClosureNotify) block72_data_unref, 0);
	_tmp144_ = _data72_->bg_mode_combo;
	_tmp145_ = _data72_->bg_color_btn;
	adw_action_row_add_suffix ((AdwActionRow*) _tmp144_, (GtkWidget*) _tmp145_);
	_tmp146_ = general_page;
	_tmp147_ = dc_settings_dialog_settings_group (self, _tmp146_, "Behavior");
	behavior_group = _tmp147_;
	_tmp148_ = g_strdup ("Reply to message");
	_tmp149_ = g_strdup ("React with ❤️");
	_tmp150_ = g_strdup ("React with 👍");
	_tmp151_ = g_strdup ("Open user profile");
	_tmp152_ = g_strdup ("Open context menu");
	_tmp153_ = g_strdup ("Do nothing");
	_tmp154_ = g_new0 (gchar*, 6 + 1);
	_tmp154_[0] = _tmp148_;
	_tmp154_[1] = _tmp149_;
	_tmp154_[2] = _tmp150_;
	_tmp154_[3] = _tmp151_;
	_tmp154_[4] = _tmp152_;
	_tmp154_[5] = _tmp153_;
	dblclick_labels = _tmp154_;
	dblclick_labels_length1 = 6;
	_dblclick_labels_size_ = dblclick_labels_length1;
	_tmp155_ = self->priv->app_window;
	_tmp156_ = _tmp155_->settings;
	_tmp157_ = dc_settings_manager_get_double_click_action (_tmp156_);
	_tmp158_ = _tmp157_;
	dblclick_selected = (guint) _tmp158_;
	if (dblclick_selected == ((guint) 4)) {
		dblclick_selected = (guint) 5;
	} else {
		if (dblclick_selected == ((guint) 5)) {
			dblclick_selected = (guint) 4;
		}
	}
	_tmp159_ = behavior_group;
	_tmp160_ = dblclick_labels;
	_tmp160__length1 = dblclick_labels_length1;
	_tmp161_ = dc_settings_dialog_row_combo (_tmp159_, "Double-click on message", "Action when a message is double-clicked", _tmp160_, (gint) _tmp160__length1, dblclick_selected);
	_data72_->dblclick_combo = _tmp161_;
	_tmp162_ = _data72_->dblclick_combo;
	g_signal_connect_data ((GObject*) _tmp162_, "notify::selected", (GCallback) ___lambda339__g_object_notify, block72_data_ref (_data72_), (GClosureNotify) block72_data_unref, 0);
	_tmp163_ = g_strdup ("Enabled");
	_tmp164_ = g_strdup ("Stripped");
	_tmp165_ = g_strdup ("Disabled");
	_tmp166_ = g_new0 (gchar*, 3 + 1);
	_tmp166_[0] = _tmp163_;
	_tmp166_[1] = _tmp164_;
	_tmp166_[2] = _tmp165_;
	md_labels = _tmp166_;
	md_labels_length1 = 3;
	_md_labels_size_ = md_labels_length1;
	_tmp167_ = behavior_group;
	_tmp168_ = md_labels;
	_tmp168__length1 = md_labels_length1;
	_tmp169_ = self->priv->app_window;
	_tmp170_ = _tmp169_->settings;
	_tmp171_ = dc_settings_manager_get_markdown_mode (_tmp170_);
	_tmp172_ = _tmp171_;
	_tmp173_ = dc_settings_dialog_row_combo (_tmp167_, "Markdown rendering", "Render, strip, or preserve markdown syntax", _tmp168_, (gint) _tmp168__length1, (guint) _tmp172_);
	_data72_->md_combo = _tmp173_;
	_tmp174_ = _data72_->md_combo;
	g_signal_connect_data ((GObject*) _tmp174_, "notify::selected", (GCallback) ___lambda340__g_object_notify, block72_data_ref (_data72_), (GClosureNotify) block72_data_unref, 0);
	_tmp175_ = dc_settings_dialog_action_row ("Shift+Return sends message", "When on, Return inserts a newline and Shift+Return sends");
	shift_row = _tmp175_;
	_tmp176_ = shift_row;
	_tmp177_ = self->priv->app_window;
	_tmp178_ = _tmp177_->settings;
	_tmp179_ = dc_settings_manager_get_shift_enter_sends (_tmp178_);
	_tmp180_ = _tmp179_;
	_tmp181_ = dc_settings_dialog_row_switch (_tmp176_, _tmp180_);
	_data72_->shift_switch = _tmp181_;
	_tmp182_ = _data72_->shift_switch;
	g_signal_connect_data ((GObject*) _tmp182_, "notify::active", (GCallback) ___lambda341__g_object_notify, block72_data_ref (_data72_), (GClosureNotify) block72_data_unref, 0);
	_tmp183_ = behavior_group;
	_tmp184_ = shift_row;
	adw_preferences_group_add (_tmp183_, (GtkWidget*) _tmp184_);
	_tmp185_ = dc_settings_dialog_action_row ("System audio tools", "Prefer system programs for voice playback and recording " "instead of Parla's GTK/GStreamer media path");
	audio_row = _tmp185_;
	_tmp186_ = audio_row;
	_tmp187_ = self->priv->app_window;
	_tmp188_ = _tmp187_->settings;
	_tmp189_ = dc_settings_manager_get_system_audio_player (_tmp188_);
	_tmp190_ = _tmp189_;
	_tmp191_ = dc_settings_dialog_row_switch (_tmp186_, _tmp190_);
	_data72_->audio_switch = _tmp191_;
	_tmp192_ = _data72_->audio_switch;
	g_signal_connect_data ((GObject*) _tmp192_, "notify::active", (GCallback) ___lambda342__g_object_notify, block72_data_ref (_data72_), (GClosureNotify) block72_data_unref, 0);
	if (dc_platform_is_macos ()) {
		_tmp193_ = "Minimize to menu bar";
	} else {
		_tmp193_ = "Minimize to status bar";
	}
	if (dc_platform_is_macos ()) {
		_tmp194_ = "Closing the window keeps Parla running as a menu bar " "icon; the Dock icon stays visible and notifications " "still appear";
	} else {
		_tmp194_ = "Closing the window keeps Parla running in the status " "bar; notifications still appear";
	}
	_tmp195_ = dc_settings_dialog_action_row (_tmp193_, _tmp194_);
	tray_row = _tmp195_;
	_tmp196_ = tray_row;
	_tmp197_ = self->priv->app_window;
	_tmp198_ = _tmp197_->settings;
	_tmp199_ = dc_settings_manager_get_minimize_to_tray (_tmp198_);
	_tmp200_ = _tmp199_;
	_tmp201_ = dc_settings_dialog_row_switch (_tmp196_, _tmp200_);
	_data72_->tray_switch = _tmp201_;
	_tmp202_ = _data72_->tray_switch;
	g_signal_connect_data ((GObject*) _tmp202_, "notify::active", (GCallback) ___lambda343__g_object_notify, block72_data_ref (_data72_), (GClosureNotify) block72_data_unref, 0);
	_tmp203_ = behavior_group;
	_tmp204_ = tray_row;
	adw_preferences_group_add (_tmp203_, (GtkWidget*) _tmp204_);
	_tmp205_ = general_page;
	dc_settings_dialog_build_links_group (self, _tmp205_);
	_tmp206_ = general_page;
	_tmp207_ = dc_settings_dialog_settings_group (self, _tmp206_, "Notifications");
	notifications_group = _tmp207_;
	_tmp208_ = dc_settings_dialog_action_row ("Desktop notifications", "Notify on incoming messages when the window is not focused");
	notif_row = _tmp208_;
	_tmp209_ = notif_row;
	_tmp210_ = self->priv->app_window;
	_tmp211_ = _tmp210_->settings;
	_tmp212_ = dc_settings_manager_get_notifications_enabled (_tmp211_);
	_tmp213_ = _tmp212_;
	_tmp214_ = dc_settings_dialog_row_switch (_tmp209_, _tmp213_);
	_data72_->notif_switch = _tmp214_;
	_tmp215_ = _data72_->notif_switch;
	g_signal_connect_data ((GObject*) _tmp215_, "notify::active", (GCallback) ___lambda349__g_object_notify, block72_data_ref (_data72_), (GClosureNotify) block72_data_unref, 0);
	_tmp216_ = notifications_group;
	_tmp217_ = notif_row;
	adw_preferences_group_add (_tmp216_, (GtkWidget*) _tmp217_);
	_tmp218_ = dc_settings_dialog_action_row ("Show message contents in notifications", "Include sender text and attachment names in desktop notifications");
	notification_contents_row = _tmp218_;
	_tmp219_ = notification_contents_row;
	_tmp220_ = self->priv->app_window;
	_tmp221_ = _tmp220_->settings;
	_tmp222_ = dc_settings_manager_get_show_notification_contents (_tmp221_);
	_tmp223_ = _tmp222_;
	_tmp224_ = dc_settings_dialog_row_switch (_tmp219_, _tmp223_);
	_data72_->notification_contents_switch = _tmp224_;
	_tmp225_ = _data72_->notification_contents_switch;
	g_signal_connect_data ((GObject*) _tmp225_, "notify::active", (GCallback) ___lambda350__g_object_notify, block72_data_ref (_data72_), (GClosureNotify) block72_data_unref, 0);
	_tmp226_ = notifications_group;
	_tmp227_ = notification_contents_row;
	adw_preferences_group_add (_tmp226_, (GtkWidget*) _tmp227_);
	_tmp228_ = advanced_page;
	_tmp229_ = dc_settings_dialog_settings_group (self, _tmp228_, "Chatmail Core");
	chatmail_group = _tmp229_;
	_tmp230_ = g_strdup ("Auto");
	_tmp231_ = g_strdup ("Custom");
	_tmp232_ = g_new0 (gchar*, 2 + 1);
	_tmp232_[0] = _tmp230_;
	_tmp232_[1] = _tmp231_;
	rpc_source_labels = _tmp232_;
	rpc_source_labels_length1 = 2;
	_rpc_source_labels_size_ = rpc_source_labels_length1;
	_tmp233_ = chatmail_group;
	_tmp234_ = rpc_source_labels;
	_tmp234__length1 = rpc_source_labels_length1;
	_tmp235_ = self->priv->app_window;
	_tmp236_ = _tmp235_->settings;
	_tmp237_ = dc_settings_dialog_row_combo (_tmp233_, "Source", NULL, _tmp234_, (gint) _tmp234__length1, (guint) dc_settings_manager_effective_rpc_server_source (_tmp236_));
	_g_object_unref0 (self->priv->rpc_source_dropdown);
	self->priv->rpc_source_dropdown = _tmp237_;
	_tmp238_ = self->priv->rpc_source_dropdown;
	_tmp239_ = _g_object_ref0 ((AdwActionRow*) _tmp238_);
	_g_object_unref0 (self->priv->rpc_row);
	self->priv->rpc_row = _tmp239_;
	_tmp240_ = self->priv->rpc_source_dropdown;
	g_signal_connect_object ((GObject*) _tmp240_, "notify::selected", (GCallback) _dc_settings_dialog_on_rpc_source_changed_g_object_notify, self, 0);
	_tmp241_ = (GtkButton*) gtk_button_new_with_label ("Choose");
	g_object_ref_sink (_tmp241_);
	_g_object_unref0 (self->priv->rpc_choose_btn);
	self->priv->rpc_choose_btn = _tmp241_;
	_tmp242_ = self->priv->rpc_choose_btn;
	gtk_widget_set_valign ((GtkWidget*) _tmp242_, GTK_ALIGN_CENTER);
	_tmp243_ = self->priv->rpc_choose_btn;
	gtk_widget_add_css_class ((GtkWidget*) _tmp243_, "flat");
	_tmp244_ = self->priv->rpc_choose_btn;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp244_, "Choose a Chatmail Core binary");
	_tmp245_ = self->priv->rpc_choose_btn;
	g_signal_connect_object (_tmp245_, "clicked", (GCallback) ___lambda369__gtk_button_clicked, self, 0);
	_tmp246_ = self->priv->rpc_row;
	_tmp247_ = self->priv->rpc_choose_btn;
	adw_action_row_add_suffix (_tmp246_, (GtkWidget*) _tmp247_);
	_tmp248_ = (GtkButton*) gtk_button_new_with_label ("Check");
	g_object_ref_sink (_tmp248_);
	_g_object_unref0 (self->priv->rpc_check_btn);
	self->priv->rpc_check_btn = _tmp248_;
	_tmp249_ = self->priv->rpc_check_btn;
	gtk_widget_set_valign ((GtkWidget*) _tmp249_, GTK_ALIGN_CENTER);
	_tmp250_ = self->priv->rpc_check_btn;
	gtk_widget_add_css_class ((GtkWidget*) _tmp250_, "flat");
	_tmp251_ = self->priv->rpc_check_btn;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp251_, "Check for the latest Chatmail Core release");
	_tmp252_ = self->priv->rpc_check_btn;
	g_signal_connect_object (_tmp252_, "clicked", (GCallback) ___lambda370__gtk_button_clicked, self, 0);
	_tmp253_ = self->priv->rpc_row;
	_tmp254_ = self->priv->rpc_check_btn;
	adw_action_row_add_suffix (_tmp253_, (GtkWidget*) _tmp254_);
	_tmp255_ = dc_settings_dialog_action_row ("Check for updates on startup", "Notify when a newer Chatmail Core version is available");
	rpc_autocheck_row = _tmp255_;
	_tmp256_ = rpc_autocheck_row;
	_tmp257_ = self->priv->app_window;
	_tmp258_ = _tmp257_->settings;
	_tmp259_ = dc_settings_manager_get_rpc_check_updates_on_startup (_tmp258_);
	_tmp260_ = _tmp259_;
	_tmp261_ = dc_settings_dialog_row_switch (_tmp256_, _tmp260_);
	_data72_->autocheck_switch = _tmp261_;
	_tmp262_ = _data72_->autocheck_switch;
	g_signal_connect_data ((GObject*) _tmp262_, "notify::active", (GCallback) ___lambda372__g_object_notify, block72_data_ref (_data72_), (GClosureNotify) block72_data_unref, 0);
	_tmp263_ = rpc_autocheck_row;
	gtk_widget_set_visible ((GtkWidget*) _tmp263_, !dc_settings_manager_rpc_server_path_is_fixed ());
	_tmp264_ = chatmail_group;
	_tmp265_ = rpc_autocheck_row;
	adw_preferences_group_add (_tmp264_, (GtkWidget*) _tmp265_);
	dc_settings_dialog_update_rpc_row (self);
	_tmp266_ = dc_settings_dialog_action_row ("Accounts Path", NULL);
	_g_object_unref0 (self->priv->accounts_path_row);
	self->priv->accounts_path_row = _tmp266_;
	_tmp267_ = self->priv->accounts_path_row;
	adw_action_row_set_subtitle_lines (_tmp267_, 2);
	_tmp268_ = (GtkButton*) gtk_button_new_from_icon_name ("folder-symbolic");
	g_object_ref_sink (_tmp268_);
	accounts_path_change_btn = _tmp268_;
	_tmp269_ = accounts_path_change_btn;
	gtk_widget_set_valign ((GtkWidget*) _tmp269_, GTK_ALIGN_CENTER);
	_tmp270_ = accounts_path_change_btn;
	gtk_widget_add_css_class ((GtkWidget*) _tmp270_, "flat");
	_tmp271_ = accounts_path_change_btn;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp271_, "Choose a different folder");
	_tmp272_ = accounts_path_change_btn;
	g_signal_connect_object (_tmp272_, "clicked", (GCallback) ___lambda373__gtk_button_clicked, self, 0);
	_tmp273_ = self->priv->accounts_path_row;
	_tmp274_ = accounts_path_change_btn;
	adw_action_row_add_suffix (_tmp273_, (GtkWidget*) _tmp274_);
	_tmp275_ = (GtkButton*) gtk_button_new_from_icon_name ("edit-undo-symbolic");
	g_object_ref_sink (_tmp275_);
	_g_object_unref0 (self->priv->accounts_path_reset_btn);
	self->priv->accounts_path_reset_btn = _tmp275_;
	_tmp276_ = self->priv->accounts_path_reset_btn;
	gtk_widget_set_valign ((GtkWidget*) _tmp276_, GTK_ALIGN_CENTER);
	_tmp277_ = self->priv->accounts_path_reset_btn;
	gtk_widget_add_css_class ((GtkWidget*) _tmp277_, "flat");
	_tmp278_ = self->priv->accounts_path_reset_btn;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp278_, "Use the default folder");
	_tmp279_ = self->priv->accounts_path_reset_btn;
	g_signal_connect_object (_tmp279_, "clicked", (GCallback) ___lambda374__gtk_button_clicked, self, 0);
	_tmp280_ = self->priv->accounts_path_row;
	_tmp281_ = self->priv->accounts_path_reset_btn;
	adw_action_row_add_suffix (_tmp280_, (GtkWidget*) _tmp281_);
	_tmp282_ = chatmail_group;
	_tmp283_ = self->priv->accounts_path_row;
	adw_preferences_group_add (_tmp282_, (GtkWidget*) _tmp283_);
	dc_settings_dialog_sync_accounts_path_row (self);
	_tmp284_ = advanced_page;
	_tmp285_ = dc_settings_dialog_settings_group (self, _tmp284_, "Network");
	network_group = _tmp285_;
	_tmp286_ = dc_settings_dialog_action_row ("Use Proxy", "Route this profile through the configured proxy");
	_g_object_unref0 (self->priv->proxy_switch_row);
	self->priv->proxy_switch_row = _tmp286_;
	_tmp287_ = self->priv->proxy_switch_row;
	_tmp288_ = dc_settings_dialog_row_switch (_tmp287_, FALSE);
	_g_object_unref0 (self->priv->proxy_switch);
	self->priv->proxy_switch = _tmp288_;
	_tmp289_ = self->priv->proxy_switch;
	g_signal_connect_object ((GObject*) _tmp289_, "notify::active", (GCallback) ___lambda375__g_object_notify, self, 0);
	_tmp290_ = network_group;
	_tmp291_ = self->priv->proxy_switch_row;
	adw_preferences_group_add (_tmp290_, (GtkWidget*) _tmp291_);
	_tmp292_ = dc_settings_dialog_action_row ("Proxy URL", "socks5://, http://, https://, or ss://");
	_g_object_unref0 (self->priv->proxy_url_row);
	self->priv->proxy_url_row = _tmp292_;
	_tmp293_ = (GtkEntry*) gtk_entry_new ();
	g_object_ref_sink (_tmp293_);
	_g_object_unref0 (self->priv->proxy_entry);
	self->priv->proxy_entry = _tmp293_;
	_tmp294_ = self->priv->proxy_entry;
	gtk_entry_set_placeholder_text (_tmp294_, "socks5://127.0.0.1:9050");
	_tmp295_ = self->priv->proxy_entry;
	gtk_entry_set_input_purpose (_tmp295_, GTK_INPUT_PURPOSE_URL);
	_tmp296_ = self->priv->proxy_entry;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp296_, TRUE);
	_tmp297_ = self->priv->proxy_entry;
	gtk_widget_set_valign ((GtkWidget*) _tmp297_, GTK_ALIGN_CENTER);
	_tmp298_ = self->priv->proxy_entry;
	g_signal_connect_object (_tmp298_, "activate", (GCallback) ___lambda376__gtk_entry_activate, self, 0);
	_tmp299_ = (GtkEventControllerFocus*) gtk_event_controller_focus_new ();
	proxy_focus = _tmp299_;
	_tmp300_ = proxy_focus;
	g_signal_connect_object (_tmp300_, "leave", (GCallback) ___lambda377__gtk_event_controller_focus_leave, self, 0);
	_tmp301_ = self->priv->proxy_entry;
	_tmp302_ = proxy_focus;
	_tmp303_ = _g_object_ref0 ((GtkEventController*) _tmp302_);
	gtk_widget_add_controller ((GtkWidget*) _tmp301_, _tmp303_);
	_tmp304_ = self->priv->proxy_url_row;
	_tmp305_ = self->priv->proxy_entry;
	adw_action_row_add_suffix (_tmp304_, (GtkWidget*) _tmp305_);
	_tmp306_ = self->priv->proxy_url_row;
	_tmp307_ = self->priv->proxy_entry;
	adw_action_row_set_activatable_widget (_tmp306_, (GtkWidget*) _tmp307_);
	_tmp308_ = network_group;
	_tmp309_ = self->priv->proxy_url_row;
	adw_preferences_group_add (_tmp308_, (GtkWidget*) _tmp309_);
	dc_settings_dialog_load_proxy_settings (self, NULL, NULL);
	_tmp310_ = dc_settings_dialog_action_row ("Sticker animations", "Auto-play GIF, WebP and WebM stickers; " "clicking a sticker toggles playback");
	sticker_row = _tmp310_;
	_tmp311_ = sticker_row;
	_tmp312_ = self->priv->app_window;
	_tmp313_ = _tmp312_->settings;
	_tmp314_ = dc_settings_manager_get_animate_stickers (_tmp313_);
	_tmp315_ = _tmp314_;
	_tmp316_ = dc_settings_dialog_row_switch (_tmp311_, _tmp315_);
	_data72_->sticker_switch = _tmp316_;
	_tmp317_ = _data72_->sticker_switch;
	g_signal_connect_data ((GObject*) _tmp317_, "notify::active", (GCallback) ___lambda378__g_object_notify, block72_data_ref (_data72_), (GClosureNotify) block72_data_unref, 0);
	_tmp318_ = g_strdup ("Never");
	_tmp319_ = g_strdup ("256 KB");
	_tmp320_ = g_strdup ("512 KB");
	_tmp321_ = g_strdup ("1 MB");
	_tmp322_ = g_strdup ("2 MB");
	_tmp323_ = g_strdup ("5 MB");
	_tmp324_ = g_strdup ("Unlimited");
	_tmp325_ = g_new0 (gchar*, 7 + 1);
	_tmp325_[0] = _tmp318_;
	_tmp325_[1] = _tmp319_;
	_tmp325_[2] = _tmp320_;
	_tmp325_[3] = _tmp321_;
	_tmp325_[4] = _tmp322_;
	_tmp325_[5] = _tmp323_;
	_tmp325_[6] = _tmp324_;
	download_labels = _tmp325_;
	download_labels_length1 = 7;
	_download_labels_size_ = download_labels_length1;
	_tmp326_ = behavior_group;
	_tmp327_ = download_labels;
	_tmp327__length1 = download_labels_length1;
	_tmp328_ = self->priv->app_window;
	_tmp329_ = _tmp328_->settings;
	_tmp330_ = dc_settings_manager_get_auto_download_limit (_tmp329_);
	_tmp331_ = _tmp330_;
	_tmp332_ = dc_settings_dialog_row_combo (_tmp326_, "Auto-download attachments", "Larger attachments wait for approval; applies to all profiles", _tmp327_, (gint) _tmp327__length1, dc_settings_dialog_auto_download_limit_index (_tmp331_));
	_data72_->download_combo = _tmp332_;
	_tmp333_ = _data72_->download_combo;
	g_signal_connect_data ((GObject*) _tmp333_, "notify::selected", (GCallback) ___lambda379__g_object_notify, block72_data_ref (_data72_), (GClosureNotify) block72_data_unref, 0);
	whisper_found = dc_transcriber_available ();
	if (whisper_found) {
		_tmp334_ = "Whisper is available in PATH";
	} else {
		_tmp334_ = "Whisper was not found in PATH";
	}
	_tmp335_ = dc_settings_dialog_action_row ("Voice transcription", _tmp334_);
	transcription_row = _tmp335_;
	if (whisper_found) {
		_tmp336_ = "Available";
	} else {
		_tmp336_ = "Not found";
	}
	_tmp337_ = (GtkLabel*) gtk_label_new (_tmp336_);
	g_object_ref_sink (_tmp337_);
	transcription_status = _tmp337_;
	gtk_widget_set_valign ((GtkWidget*) transcription_status, GTK_ALIGN_CENTER);
	gtk_widget_add_css_class ((GtkWidget*) transcription_status, "dim-label");
	_tmp338_ = transcription_row;
	adw_action_row_add_suffix (_tmp338_, (GtkWidget*) transcription_status);
	_tmp339_ = behavior_group;
	_tmp340_ = audio_row;
	adw_preferences_group_add (_tmp339_, (GtkWidget*) _tmp340_);
	_tmp341_ = behavior_group;
	_tmp342_ = transcription_row;
	adw_preferences_group_add (_tmp341_, (GtkWidget*) _tmp342_);
	_tmp343_ = behavior_group;
	_tmp344_ = sticker_row;
	adw_preferences_group_add (_tmp343_, (GtkWidget*) _tmp344_);
	_tmp345_ = advanced_page;
	dc_settings_dialog_build_webxdc_section (self, _tmp345_);
	_tmp346_ = advanced_page;
	_tmp347_ = dc_settings_dialog_settings_group (self, _tmp346_, "Factory Reset");
	reset_group = _tmp347_;
	_tmp348_ = dc_settings_dialog_action_row ("Factory Reset", "Remove all settings and close the app");
	reset_row = _tmp348_;
	_tmp349_ = (GtkButton*) gtk_button_new_with_label ("Factory Reset");
	g_object_ref_sink (_tmp349_);
	reset_btn = _tmp349_;
	gtk_widget_set_valign ((GtkWidget*) reset_btn, GTK_ALIGN_CENTER);
	gtk_widget_add_css_class ((GtkWidget*) reset_btn, "destructive-action");
	gtk_widget_set_tooltip_text ((GtkWidget*) reset_btn, "Delete all Parla configuration and start fresh");
	g_signal_connect_object (reset_btn, "clicked", (GCallback) ___lambda387__gtk_button_clicked, self, 0);
	adw_action_row_add_suffix (reset_row, (GtkWidget*) reset_btn);
	adw_preferences_group_add (reset_group, (GtkWidget*) reset_row);
	_g_object_unref0 (reset_btn);
	_g_object_unref0 (reset_row);
	_g_object_unref0 (reset_group);
	_g_object_unref0 (transcription_status);
	_g_object_unref0 (transcription_row);
	download_labels = (_vala_array_free (download_labels, download_labels_length1, (GDestroyNotify) g_free), NULL);
	_g_object_unref0 (sticker_row);
	_g_object_unref0 (proxy_focus);
	_g_object_unref0 (network_group);
	_g_object_unref0 (accounts_path_change_btn);
	_g_object_unref0 (rpc_autocheck_row);
	rpc_source_labels = (_vala_array_free (rpc_source_labels, rpc_source_labels_length1, (GDestroyNotify) g_free), NULL);
	_g_object_unref0 (chatmail_group);
	_g_object_unref0 (notification_contents_row);
	_g_object_unref0 (notif_row);
	_g_object_unref0 (notifications_group);
	_g_object_unref0 (tray_row);
	_g_object_unref0 (audio_row);
	_g_object_unref0 (shift_row);
	md_labels = (_vala_array_free (md_labels, md_labels_length1, (GDestroyNotify) g_free), NULL);
	dblclick_labels = (_vala_array_free (dblclick_labels, dblclick_labels_length1, (GDestroyNotify) g_free), NULL);
	_g_object_unref0 (behavior_group);
	bg_mode_labels = (_vala_array_free (bg_mode_labels, bg_mode_labels_length1, (GDestroyNotify) g_free), NULL);
	_g_object_unref0 (accent_reset_btn);
	_g_object_unref0 (accent_row);
	_g_object_unref0 (font_reset_btn);
	_g_object_unref0 (direct_avatar_row);
	avatar_labels = (_vala_array_free (avatar_labels, avatar_labels_length1, (GDestroyNotify) g_free), NULL);
	style_labels = (_vala_array_free (style_labels, style_labels_length1, (GDestroyNotify) g_free), NULL);
	code_labels = (_vala_array_free (code_labels, code_labels_length1, (GDestroyNotify) g_free), NULL);
	theme_labels = (_vala_array_free (theme_labels, theme_labels_length1, (GDestroyNotify) g_free), NULL);
	_g_object_unref0 (appearance_group);
	_g_object_unref0 (advanced_page);
	_g_object_unref0 (general_page);
	block72_data_unref (_data72_);
	_data72_ = NULL;
	return self;
}

DcSettingsDialog*
dc_settings_dialog_new (DcWindow* window,
                        DcRpcClient* rpc)
{
	return dc_settings_dialog_construct (DC_TYPE_SETTINGS_DIALOG, window, rpc);
}

/** All Webxdc switches in one place: the enable toggle and how the
            app windows behave. Builds without -Dwebxdc=true say so instead
            of offering switches that cannot work. */
static Block73Data*
block73_data_ref (Block73Data* _data73_)
{
	g_atomic_int_inc (&_data73_->_ref_count_);
	return _data73_;
}

static void
block73_data_unref (void * _userdata_)
{
	Block73Data* _data73_;
	_data73_ = (Block73Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data73_->_ref_count_)) {
		DcSettingsDialog* self;
		self = _data73_->self;
		_g_object_unref0 (_data73_->acceleration_switch);
		_g_object_unref0 (_data73_->webgl_switch);
		_g_object_unref0 (_data73_->wasm_switch);
		_g_object_unref0 (_data73_->internet_switch);
		_g_object_unref0 (_data73_->behavior_switch);
		_g_object_unref0 (_data73_->enable_switch);
		_g_object_unref0 (self);
		g_slice_free (Block73Data, _data73_);
	}
}

static void
__lambda380_ (Block73Data* _data73_)
{
	DcSettingsDialog* self;
	DcWindow* _tmp0_;
	DcSettingsManager* _tmp1_;
	GtkSwitch* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	self = _data73_->self;
	_tmp0_ = self->priv->app_window;
	_tmp1_ = _tmp0_->settings;
	_tmp2_ = _data73_->enable_switch;
	_tmp3_ = gtk_switch_get_active (_tmp2_);
	_tmp4_ = _tmp3_;
	dc_settings_manager_save_webxdc_apps (_tmp1_, _tmp4_);
}

static void
___lambda380__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda380_ (self);
}

static void
__lambda381_ (Block73Data* _data73_)
{
	DcSettingsDialog* self;
	DcWindow* _tmp0_;
	DcSettingsManager* _tmp1_;
	GtkSwitch* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	self = _data73_->self;
	_tmp0_ = self->priv->app_window;
	_tmp1_ = _tmp0_->settings;
	_tmp2_ = _data73_->behavior_switch;
	_tmp3_ = gtk_switch_get_active (_tmp2_);
	_tmp4_ = _tmp3_;
	dc_settings_manager_save_webxdc_follow_chat (_tmp1_, _tmp4_);
}

static void
___lambda381__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda381_ (self);
}

static void
__lambda382_ (Block73Data* _data73_)
{
	DcSettingsDialog* self;
	DcWindow* _tmp0_;
	DcSettingsManager* _tmp1_;
	GtkSwitch* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	self = _data73_->self;
	_tmp0_ = self->priv->app_window;
	_tmp1_ = _tmp0_->settings;
	_tmp2_ = _data73_->internet_switch;
	_tmp3_ = gtk_switch_get_active (_tmp2_);
	_tmp4_ = _tmp3_;
	dc_settings_manager_save_webxdc_allow_internet (_tmp1_, _tmp4_);
}

static void
___lambda382__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda382_ (self);
}

static void
__lambda383_ (Block73Data* _data73_)
{
	DcSettingsDialog* self;
	DcWindow* _tmp0_;
	DcSettingsManager* _tmp1_;
	GtkSwitch* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	self = _data73_->self;
	_tmp0_ = self->priv->app_window;
	_tmp1_ = _tmp0_->settings;
	_tmp2_ = _data73_->wasm_switch;
	_tmp3_ = gtk_switch_get_active (_tmp2_);
	_tmp4_ = _tmp3_;
	dc_settings_manager_save_webxdc_allow_wasm (_tmp1_, _tmp4_);
}

static void
___lambda383__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda383_ (self);
}

static void
__lambda384_ (Block73Data* _data73_)
{
	DcSettingsDialog* self;
	DcWindow* _tmp0_;
	DcSettingsManager* _tmp1_;
	GtkSwitch* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	self = _data73_->self;
	_tmp0_ = self->priv->app_window;
	_tmp1_ = _tmp0_->settings;
	_tmp2_ = _data73_->webgl_switch;
	_tmp3_ = gtk_switch_get_active (_tmp2_);
	_tmp4_ = _tmp3_;
	dc_settings_manager_save_webxdc_allow_webgl (_tmp1_, _tmp4_);
}

static void
___lambda384__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda384_ (self);
}

static Block74Data*
block74_data_ref (Block74Data* _data74_)
{
	g_atomic_int_inc (&_data74_->_ref_count_);
	return _data74_;
}

static void
block74_data_unref (void * _userdata_)
{
	Block74Data* _data74_;
	_data74_ = (Block74Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data74_->_ref_count_)) {
		DcSettingsDialog* self;
		self = _data74_->_data73_->self;
		_g_object_unref0 (_data74_->acceleration);
		block73_data_unref (_data74_->_data73_);
		_data74_->_data73_ = NULL;
		g_slice_free (Block74Data, _data74_);
	}
}

static void
___lambda385_ (Block74Data* _data74_)
{
	Block73Data* _data73_;
	DcSettingsDialog* self;
	DcWindow* _tmp0_;
	DcSettingsManager* _tmp1_;
	GtkSwitch* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	_data73_ = _data74_->_data73_;
	self = _data73_->self;
	_tmp0_ = self->priv->app_window;
	_tmp1_ = _tmp0_->settings;
	_tmp2_ = _data74_->acceleration;
	_tmp3_ = gtk_switch_get_active (_tmp2_);
	_tmp4_ = _tmp3_;
	dc_settings_manager_save_webxdc_allow_hardware_acceleration (_tmp1_, _tmp4_);
}

static void
____lambda385__g_object_notify (GObject* _sender,
                                GParamSpec* pspec,
                                gpointer self)
{
	___lambda385_ (self);
}

static void
__lambda386_ (Block73Data* _data73_)
{
	DcSettingsDialog* self;
	GtkSwitch* _tmp0_;
	GtkSwitch* _tmp1_;
	GtkSwitch* _tmp2_;
	GtkSwitch* _tmp3_;
	DcWindow* _tmp7_;
	self = _data73_->self;
	_tmp0_ = _data73_->internet_switch;
	gtk_switch_set_active (_tmp0_, DC_WEBXDC_SECURITY_SAFE_ALLOW_INTERNET);
	_tmp1_ = _data73_->wasm_switch;
	gtk_switch_set_active (_tmp1_, DC_WEBXDC_SECURITY_SAFE_ALLOW_WASM);
	_tmp2_ = _data73_->webgl_switch;
	gtk_switch_set_active (_tmp2_, DC_WEBXDC_SECURITY_SAFE_ALLOW_WEBGL);
	_tmp3_ = _data73_->acceleration_switch;
	if (_tmp3_ != NULL) {
		GtkSwitch* _tmp4_;
		_tmp4_ = _data73_->acceleration_switch;
		gtk_switch_set_active (_tmp4_, DC_WEBXDC_SECURITY_SAFE_ALLOW_HARDWARE_ACCELERATION);
	} else {
		DcWindow* _tmp5_;
		DcSettingsManager* _tmp6_;
		_tmp5_ = self->priv->app_window;
		_tmp6_ = _tmp5_->settings;
		dc_settings_manager_save_webxdc_allow_hardware_acceleration (_tmp6_, DC_WEBXDC_SECURITY_SAFE_ALLOW_HARDWARE_ACCELERATION);
	}
	_tmp7_ = self->priv->app_window;
	dc_window_show_toast (_tmp7_, "Webxdc safest defaults restored");
}

static void
___lambda386__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda386_ (self);
}

static void
dc_settings_dialog_build_webxdc_section (DcSettingsDialog* self,
                                         AdwPreferencesPage* page)
{
	Block73Data* _data73_;
	AdwPreferencesGroup* webxdc_group = NULL;
	AdwPreferencesGroup* _tmp0_;
	AdwActionRow* enable_row = NULL;
	AdwActionRow* _tmp9_;
	AdwActionRow* _tmp10_;
	DcWindow* _tmp11_;
	DcSettingsManager* _tmp12_;
	gboolean _tmp13_;
	gboolean _tmp14_;
	GtkSwitch* _tmp15_;
	GtkSwitch* _tmp16_;
	AdwPreferencesGroup* _tmp17_;
	AdwActionRow* _tmp18_;
	AdwActionRow* behavior_row = NULL;
	AdwActionRow* _tmp19_;
	AdwActionRow* _tmp20_;
	DcWindow* _tmp21_;
	DcSettingsManager* _tmp22_;
	gboolean _tmp23_;
	gboolean _tmp24_;
	GtkSwitch* _tmp25_;
	GtkSwitch* _tmp26_;
	AdwPreferencesGroup* _tmp27_;
	AdwActionRow* _tmp28_;
	AdwActionRow* internet_row = NULL;
	AdwActionRow* _tmp29_;
	AdwActionRow* _tmp30_;
	DcWindow* _tmp31_;
	DcSettingsManager* _tmp32_;
	gboolean _tmp33_;
	gboolean _tmp34_;
	GtkSwitch* _tmp35_;
	GtkSwitch* _tmp36_;
	AdwPreferencesGroup* _tmp37_;
	AdwActionRow* _tmp38_;
	AdwActionRow* wasm_row = NULL;
	AdwActionRow* _tmp39_;
	AdwActionRow* _tmp40_;
	DcWindow* _tmp41_;
	DcSettingsManager* _tmp42_;
	gboolean _tmp43_;
	gboolean _tmp44_;
	GtkSwitch* _tmp45_;
	GtkSwitch* _tmp46_;
	AdwPreferencesGroup* _tmp47_;
	AdwActionRow* _tmp48_;
	const gchar* _tmp49_ = NULL;
	AdwActionRow* webgl_row = NULL;
	AdwActionRow* _tmp50_;
	AdwActionRow* _tmp51_;
	DcWindow* _tmp52_;
	DcSettingsManager* _tmp53_;
	gboolean _tmp54_;
	gboolean _tmp55_;
	GtkSwitch* _tmp56_;
	GtkSwitch* _tmp57_;
	AdwPreferencesGroup* _tmp58_;
	AdwActionRow* _tmp59_;
	gboolean _tmp60_ = FALSE;
	AdwActionRow* safest_row = NULL;
	AdwActionRow* _tmp73_;
	GtkButton* safest_button = NULL;
	GtkButton* _tmp74_;
	GtkButton* _tmp75_;
	GtkButton* _tmp76_;
	AdwActionRow* _tmp77_;
	GtkButton* _tmp78_;
	AdwPreferencesGroup* _tmp79_;
	AdwActionRow* _tmp80_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (page != NULL);
	_data73_ = g_slice_new0 (Block73Data);
	_data73_->_ref_count_ = 1;
	_data73_->self = g_object_ref (self);
	_tmp0_ = dc_settings_dialog_settings_group (self, page, "Webxdc Apps");
	webxdc_group = _tmp0_;
	if (!DC_WEBXDC_AVAILABLE) {
		AdwActionRow* unavailable_row = NULL;
		AdwActionRow* _tmp1_;
		GtkLabel* status = NULL;
		GtkLabel* _tmp2_;
		GtkLabel* _tmp3_;
		GtkLabel* _tmp4_;
		AdwActionRow* _tmp5_;
		GtkLabel* _tmp6_;
		AdwPreferencesGroup* _tmp7_;
		AdwActionRow* _tmp8_;
		_tmp1_ = dc_settings_dialog_action_row ("Webxdc apps", "This build of Parla was compiled without Webxdc " "support");
		unavailable_row = _tmp1_;
		_tmp2_ = (GtkLabel*) gtk_label_new ("Unavailable");
		g_object_ref_sink (_tmp2_);
		status = _tmp2_;
		_tmp3_ = status;
		gtk_widget_set_valign ((GtkWidget*) _tmp3_, GTK_ALIGN_CENTER);
		_tmp4_ = status;
		gtk_widget_add_css_class ((GtkWidget*) _tmp4_, "dim-label");
		_tmp5_ = unavailable_row;
		_tmp6_ = status;
		adw_action_row_add_suffix (_tmp5_, (GtkWidget*) _tmp6_);
		_tmp7_ = webxdc_group;
		_tmp8_ = unavailable_row;
		adw_preferences_group_add (_tmp7_, (GtkWidget*) _tmp8_);
		_g_object_unref0 (status);
		_g_object_unref0 (unavailable_row);
		_g_object_unref0 (webxdc_group);
		block73_data_unref (_data73_);
		_data73_ = NULL;
		return;
	}
	_tmp9_ = dc_settings_dialog_action_row ("Webxdc apps", "Run Delta Chat mini-apps shared in chats (experimental)");
	enable_row = _tmp9_;
	_tmp10_ = enable_row;
	_tmp11_ = self->priv->app_window;
	_tmp12_ = _tmp11_->settings;
	_tmp13_ = dc_settings_manager_get_webxdc_apps (_tmp12_);
	_tmp14_ = _tmp13_;
	_tmp15_ = dc_settings_dialog_row_switch (_tmp10_, _tmp14_);
	_data73_->enable_switch = _tmp15_;
	_tmp16_ = _data73_->enable_switch;
	g_signal_connect_data ((GObject*) _tmp16_, "notify::active", (GCallback) ___lambda380__g_object_notify, block73_data_ref (_data73_), (GClosureNotify) block73_data_unref, 0);
	_tmp17_ = webxdc_group;
	_tmp18_ = enable_row;
	adw_preferences_group_add (_tmp17_, (GtkWidget*) _tmp18_);
	_tmp19_ = dc_settings_dialog_action_row ("Keep apps with their chat", "Hide app windows when you leave the chat");
	behavior_row = _tmp19_;
	_tmp20_ = behavior_row;
	_tmp21_ = self->priv->app_window;
	_tmp22_ = _tmp21_->settings;
	_tmp23_ = dc_settings_manager_get_webxdc_follow_chat (_tmp22_);
	_tmp24_ = _tmp23_;
	_tmp25_ = dc_settings_dialog_row_switch (_tmp20_, _tmp24_);
	_data73_->behavior_switch = _tmp25_;
	_tmp26_ = _data73_->behavior_switch;
	g_signal_connect_data ((GObject*) _tmp26_, "notify::active", (GCallback) ___lambda381__g_object_notify, block73_data_ref (_data73_), (GClosureNotify) block73_data_unref, 0);
	_tmp27_ = webxdc_group;
	_tmp28_ = behavior_row;
	adw_preferences_group_add (_tmp27_, (GtkWidget*) _tmp28_);
	_tmp29_ = dc_settings_dialog_action_row ("Internet access", "Allow apps to make direct network requests (unsafe)");
	internet_row = _tmp29_;
	_tmp30_ = internet_row;
	_tmp31_ = self->priv->app_window;
	_tmp32_ = _tmp31_->settings;
	_tmp33_ = dc_settings_manager_get_webxdc_allow_internet (_tmp32_);
	_tmp34_ = _tmp33_;
	_tmp35_ = dc_settings_dialog_row_switch (_tmp30_, _tmp34_);
	_data73_->internet_switch = _tmp35_;
	_tmp36_ = _data73_->internet_switch;
	g_signal_connect_data ((GObject*) _tmp36_, "notify::active", (GCallback) ___lambda382__g_object_notify, block73_data_ref (_data73_), (GClosureNotify) block73_data_unref, 0);
	_tmp37_ = webxdc_group;
	_tmp38_ = internet_row;
	adw_preferences_group_add (_tmp37_, (GtkWidget*) _tmp38_);
	_tmp39_ = dc_settings_dialog_action_row ("WebAssembly", "Allow apps to compile and run WebAssembly");
	wasm_row = _tmp39_;
	_tmp40_ = wasm_row;
	_tmp41_ = self->priv->app_window;
	_tmp42_ = _tmp41_->settings;
	_tmp43_ = dc_settings_manager_get_webxdc_allow_wasm (_tmp42_);
	_tmp44_ = _tmp43_;
	_tmp45_ = dc_settings_dialog_row_switch (_tmp40_, _tmp44_);
	_data73_->wasm_switch = _tmp45_;
	_tmp46_ = _data73_->wasm_switch;
	g_signal_connect_data ((GObject*) _tmp46_, "notify::active", (GCallback) ___lambda383__g_object_notify, block73_data_ref (_data73_), (GClosureNotify) block73_data_unref, 0);
	_tmp47_ = webxdc_group;
	_tmp48_ = wasm_row;
	adw_preferences_group_add (_tmp47_, (GtkWidget*) _tmp48_);
	if (dc_platform_is_macos ()) {
		_tmp49_ = "Best-effort restriction on macOS; WKWebView has no " "public hard-disable API";
	} else {
		_tmp49_ = "Allow apps to access accelerated 3D graphics";
	}
	_tmp50_ = dc_settings_dialog_action_row ("WebGL", _tmp49_);
	webgl_row = _tmp50_;
	_tmp51_ = webgl_row;
	_tmp52_ = self->priv->app_window;
	_tmp53_ = _tmp52_->settings;
	_tmp54_ = dc_settings_manager_get_webxdc_allow_webgl (_tmp53_);
	_tmp55_ = _tmp54_;
	_tmp56_ = dc_settings_dialog_row_switch (_tmp51_, _tmp55_);
	_data73_->webgl_switch = _tmp56_;
	_tmp57_ = _data73_->webgl_switch;
	g_signal_connect_data ((GObject*) _tmp57_, "notify::active", (GCallback) ___lambda384__g_object_notify, block73_data_ref (_data73_), (GClosureNotify) block73_data_unref, 0);
	_tmp58_ = webxdc_group;
	_tmp59_ = webgl_row;
	adw_preferences_group_add (_tmp58_, (GtkWidget*) _tmp59_);
	_data73_->acceleration_switch = NULL;
	if (!dc_platform_is_macos ()) {
		_tmp60_ = !dc_platform_is_windows ();
	} else {
		_tmp60_ = FALSE;
	}
	if (_tmp60_) {
		Block74Data* _data74_;
		AdwActionRow* acceleration_row = NULL;
		AdwActionRow* _tmp61_;
		AdwActionRow* _tmp62_;
		DcWindow* _tmp63_;
		DcSettingsManager* _tmp64_;
		gboolean _tmp65_;
		gboolean _tmp66_;
		GtkSwitch* _tmp67_;
		GtkSwitch* _tmp68_;
		GtkSwitch* _tmp69_;
		GtkSwitch* _tmp70_;
		AdwPreferencesGroup* _tmp71_;
		AdwActionRow* _tmp72_;
		_data74_ = g_slice_new0 (Block74Data);
		_data74_->_ref_count_ = 1;
		_data74_->_data73_ = block73_data_ref (_data73_);
		_tmp61_ = dc_settings_dialog_action_row ("Hardware acceleration", "Allow WebKit to use GPU-accelerated rendering");
		acceleration_row = _tmp61_;
		_tmp62_ = acceleration_row;
		_tmp63_ = self->priv->app_window;
		_tmp64_ = _tmp63_->settings;
		_tmp65_ = dc_settings_manager_get_webxdc_allow_hardware_acceleration (_tmp64_);
		_tmp66_ = _tmp65_;
		_tmp67_ = dc_settings_dialog_row_switch (_tmp62_, _tmp66_);
		_data74_->acceleration = _tmp67_;
		_tmp68_ = _data74_->acceleration;
		g_signal_connect_data ((GObject*) _tmp68_, "notify::active", (GCallback) ____lambda385__g_object_notify, block74_data_ref (_data74_), (GClosureNotify) block74_data_unref, 0);
		_tmp69_ = _data74_->acceleration;
		_tmp70_ = _g_object_ref0 (_tmp69_);
		_g_object_unref0 (_data73_->acceleration_switch);
		_data73_->acceleration_switch = _tmp70_;
		_tmp71_ = webxdc_group;
		_tmp72_ = acceleration_row;
		adw_preferences_group_add (_tmp71_, (GtkWidget*) _tmp72_);
		_g_object_unref0 (acceleration_row);
		block74_data_unref (_data74_);
		_data74_ = NULL;
	}
	_tmp73_ = dc_settings_dialog_action_row ("Safest defaults", "Turn off extra access and close running apps");
	safest_row = _tmp73_;
	_tmp74_ = (GtkButton*) gtk_button_new_with_label ("Use safest");
	g_object_ref_sink (_tmp74_);
	safest_button = _tmp74_;
	_tmp75_ = safest_button;
	gtk_widget_set_valign ((GtkWidget*) _tmp75_, GTK_ALIGN_CENTER);
	_tmp76_ = safest_button;
	g_signal_connect_data (_tmp76_, "clicked", (GCallback) ___lambda386__gtk_button_clicked, block73_data_ref (_data73_), (GClosureNotify) block73_data_unref, 0);
	_tmp77_ = safest_row;
	_tmp78_ = safest_button;
	adw_action_row_add_suffix (_tmp77_, (GtkWidget*) _tmp78_);
	_tmp79_ = webxdc_group;
	_tmp80_ = safest_row;
	adw_preferences_group_add (_tmp79_, (GtkWidget*) _tmp80_);
	_g_object_unref0 (safest_button);
	_g_object_unref0 (safest_row);
	_g_object_unref0 (webgl_row);
	_g_object_unref0 (wasm_row);
	_g_object_unref0 (internet_row);
	_g_object_unref0 (behavior_row);
	_g_object_unref0 (enable_row);
	_g_object_unref0 (webxdc_group);
	block73_data_unref (_data73_);
	_data73_ = NULL;
}

static Block75Data*
block75_data_ref (Block75Data* _data75_)
{
	g_atomic_int_inc (&_data75_->_ref_count_);
	return _data75_;
}

static void
block75_data_unref (void * _userdata_)
{
	Block75Data* _data75_;
	_data75_ = (Block75Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data75_->_ref_count_)) {
		DcSettingsDialog* self;
		self = _data75_->self;
		_g_object_unref0 (_data75_->filter_switch);
		_g_object_unref0 (_data75_->filter_row);
		_g_object_unref0 (_data75_->clean_links_switch);
		_g_object_unref0 (_data75_->previews_switch);
		_g_object_unref0 (self);
		g_slice_free (Block75Data, _data75_);
	}
}

static void
__lambda344_ (Block75Data* _data75_)
{
	DcSettingsDialog* self;
	DcWindow* _tmp0_;
	DcSettingsManager* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	self = _data75_->self;
	_tmp0_ = self->priv->app_window;
	_tmp1_ = _tmp0_->settings;
	_tmp2_ = gtk_switch_get_active (_data75_->previews_switch);
	_tmp3_ = _tmp2_;
	dc_settings_manager_save_link_previews (_tmp1_, _tmp3_);
}

static void
___lambda344__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda344_ (self);
}

static void
__lambda345_ (DcSettingsDialog* self)
{
	dc_settings_dialog_prompt_tracking_filter_url (self, NULL, NULL);
}

static void
___lambda345__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda345_ ((DcSettingsDialog*) self);
}

static void
__lambda346_ (DcSettingsDialog* self)
{
	dc_settings_dialog_update_tracking_filter (self, NULL, NULL);
}

static void
___lambda346__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda346_ ((DcSettingsDialog*) self);
}

static void
__lambda347_ (Block75Data* _data75_)
{
	DcSettingsDialog* self;
	DcWindow* _tmp0_;
	DcSettingsManager* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	self = _data75_->self;
	_tmp0_ = self->priv->app_window;
	_tmp1_ = _tmp0_->settings;
	_tmp2_ = gtk_switch_get_active (_data75_->filter_switch);
	_tmp3_ = _tmp2_;
	dc_settings_manager_save_tracking_filter_enabled (_tmp1_, _tmp3_);
	dc_settings_dialog_sync_tracking_filter_rows (self);
	_tmp4_ = gtk_switch_get_active (_data75_->filter_switch);
	_tmp5_ = _tmp4_;
	if (_tmp5_) {
		DcWindow* _tmp6_;
		DcSettingsManager* _tmp7_;
		const gchar* _tmp8_;
		const gchar* _tmp9_;
		gint _tmp10_;
		gint _tmp11_;
		_tmp6_ = self->priv->app_window;
		_tmp7_ = _tmp6_->settings;
		_tmp8_ = dc_settings_manager_get_tracking_filter_url (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp10_ = strlen (_tmp9_);
		_tmp11_ = _tmp10_;
		if (_tmp11_ == 0) {
			dc_settings_dialog_prompt_tracking_filter_url (self, NULL, NULL);
		} else {
			dc_settings_dialog_update_tracking_filter (self, NULL, NULL);
		}
	}
}

static void
___lambda347__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda347_ (self);
}

static void
__lambda348_ (Block75Data* _data75_)
{
	DcSettingsDialog* self;
	DcWindow* _tmp0_;
	DcSettingsManager* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	self = _data75_->self;
	_tmp0_ = self->priv->app_window;
	_tmp1_ = _tmp0_->settings;
	_tmp2_ = gtk_switch_get_active (_data75_->clean_links_switch);
	_tmp3_ = _tmp2_;
	dc_settings_manager_save_clean_pasted_links (_tmp1_, _tmp3_);
	_tmp4_ = gtk_switch_get_active (_data75_->clean_links_switch);
	_tmp5_ = _tmp4_;
	gtk_widget_set_sensitive ((GtkWidget*) _data75_->filter_row, _tmp5_);
	dc_settings_dialog_sync_tracking_filter_rows (self);
}

static void
___lambda348__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda348_ (self);
}

static void
dc_settings_dialog_build_links_group (DcSettingsDialog* self,
                                      AdwPreferencesPage* page)
{
	Block75Data* _data75_;
	AdwPreferencesGroup* links_group = NULL;
	AdwPreferencesGroup* _tmp0_;
	AdwActionRow* previews_row = NULL;
	AdwActionRow* _tmp1_;
	DcWindow* _tmp2_;
	DcSettingsManager* _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	GtkSwitch* _tmp6_;
	AdwActionRow* clean_links_row = NULL;
	AdwActionRow* _tmp7_;
	DcWindow* _tmp8_;
	DcSettingsManager* _tmp9_;
	gboolean _tmp10_;
	gboolean _tmp11_;
	GtkSwitch* _tmp12_;
	AdwActionRow* _tmp13_;
	DcWindow* _tmp14_;
	DcSettingsManager* _tmp15_;
	gboolean _tmp16_;
	gboolean _tmp17_;
	GtkSwitch* _tmp18_;
	AdwActionRow* _tmp19_;
	AdwActionRow* _tmp20_;
	GtkButton* url_btn = NULL;
	GtkButton* _tmp21_;
	AdwActionRow* _tmp22_;
	AdwActionRow* _tmp23_;
	GtkButton* _tmp24_;
	GtkButton* _tmp25_;
	GtkButton* _tmp26_;
	GtkButton* _tmp27_;
	GtkButton* _tmp28_;
	AdwActionRow* _tmp29_;
	GtkButton* _tmp30_;
	AdwActionRow* _tmp31_;
	gboolean _tmp32_;
	gboolean _tmp33_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (page != NULL);
	_data75_ = g_slice_new0 (Block75Data);
	_data75_->_ref_count_ = 1;
	_data75_->self = g_object_ref (self);
	_tmp0_ = dc_settings_dialog_settings_group (self, page, "Links");
	links_group = _tmp0_;
	_tmp1_ = dc_settings_dialog_action_row ("Link previews", "Attach the picture and title a page advertises (Open " "Graph tags) when a link is pasted into the message field. " "Each pasted link becomes one image; remove it before " "sending if unwanted. The page is fetched from this device");
	previews_row = _tmp1_;
	_tmp2_ = self->priv->app_window;
	_tmp3_ = _tmp2_->settings;
	_tmp4_ = dc_settings_manager_get_link_previews (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = dc_settings_dialog_row_switch (previews_row, _tmp5_);
	_data75_->previews_switch = _tmp6_;
	g_signal_connect_data ((GObject*) _data75_->previews_switch, "notify::active", (GCallback) ___lambda344__g_object_notify, block75_data_ref (_data75_), (GClosureNotify) block75_data_unref, 0);
	adw_preferences_group_add (links_group, (GtkWidget*) previews_row);
	_tmp7_ = dc_settings_dialog_action_row ("Remove tracking from pasted links", "Strip known tracking parameters (YouTube, X, Instagram, " "Facebook, LinkedIn and others) from links pasted into " "the message field");
	clean_links_row = _tmp7_;
	_tmp8_ = self->priv->app_window;
	_tmp9_ = _tmp8_->settings;
	_tmp10_ = dc_settings_manager_get_clean_pasted_links (_tmp9_);
	_tmp11_ = _tmp10_;
	_tmp12_ = dc_settings_dialog_row_switch (clean_links_row, _tmp11_);
	_data75_->clean_links_switch = _tmp12_;
	adw_preferences_group_add (links_group, (GtkWidget*) clean_links_row);
	_tmp13_ = dc_settings_dialog_action_row ("Use a uBlock removeparam filter list", "Replace the built-in rules with the $removeparam rules of " "a uBlock Origin / AdGuard filter list, downloaded through " "the active account and refreshed when it expires");
	_data75_->filter_row = _tmp13_;
	_tmp14_ = self->priv->app_window;
	_tmp15_ = _tmp14_->settings;
	_tmp16_ = dc_settings_manager_get_tracking_filter_enabled (_tmp15_);
	_tmp17_ = _tmp16_;
	_tmp18_ = dc_settings_dialog_row_switch (_data75_->filter_row, _tmp17_);
	_data75_->filter_switch = _tmp18_;
	adw_preferences_group_add (links_group, (GtkWidget*) _data75_->filter_row);
	_tmp19_ = dc_settings_dialog_action_row ("Filter list URL", NULL);
	_g_object_unref0 (self->priv->tracking_filter_url_row);
	self->priv->tracking_filter_url_row = _tmp19_;
	_tmp20_ = self->priv->tracking_filter_url_row;
	adw_action_row_set_subtitle_lines (_tmp20_, 2);
	_tmp21_ = (GtkButton*) gtk_button_new_with_label ("Set URL…");
	g_object_ref_sink (_tmp21_);
	url_btn = _tmp21_;
	gtk_widget_set_valign ((GtkWidget*) url_btn, GTK_ALIGN_CENTER);
	g_signal_connect_object (url_btn, "clicked", (GCallback) ___lambda345__gtk_button_clicked, self, 0);
	_tmp22_ = self->priv->tracking_filter_url_row;
	adw_action_row_add_suffix (_tmp22_, (GtkWidget*) url_btn);
	_tmp23_ = self->priv->tracking_filter_url_row;
	adw_action_row_set_activatable_widget (_tmp23_, (GtkWidget*) url_btn);
	_tmp24_ = (GtkButton*) gtk_button_new_from_icon_name ("view-refresh-symbolic");
	g_object_ref_sink (_tmp24_);
	_g_object_unref0 (self->priv->tracking_filter_refresh_btn);
	self->priv->tracking_filter_refresh_btn = _tmp24_;
	_tmp25_ = self->priv->tracking_filter_refresh_btn;
	gtk_widget_set_valign ((GtkWidget*) _tmp25_, GTK_ALIGN_CENTER);
	_tmp26_ = self->priv->tracking_filter_refresh_btn;
	gtk_widget_add_css_class ((GtkWidget*) _tmp26_, "flat");
	_tmp27_ = self->priv->tracking_filter_refresh_btn;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp27_, "Download the list again");
	_tmp28_ = self->priv->tracking_filter_refresh_btn;
	g_signal_connect_object (_tmp28_, "clicked", (GCallback) ___lambda346__gtk_button_clicked, self, 0);
	_tmp29_ = self->priv->tracking_filter_url_row;
	_tmp30_ = self->priv->tracking_filter_refresh_btn;
	adw_action_row_add_suffix (_tmp29_, (GtkWidget*) _tmp30_);
	_tmp31_ = self->priv->tracking_filter_url_row;
	adw_preferences_group_add (links_group, (GtkWidget*) _tmp31_);
	g_signal_connect_data ((GObject*) _data75_->filter_switch, "notify::active", (GCallback) ___lambda347__g_object_notify, block75_data_ref (_data75_), (GClosureNotify) block75_data_unref, 0);
	g_signal_connect_data ((GObject*) _data75_->clean_links_switch, "notify::active", (GCallback) ___lambda348__g_object_notify, block75_data_ref (_data75_), (GClosureNotify) block75_data_unref, 0);
	_tmp32_ = gtk_switch_get_active (_data75_->clean_links_switch);
	_tmp33_ = _tmp32_;
	gtk_widget_set_sensitive ((GtkWidget*) _data75_->filter_row, _tmp33_);
	dc_settings_dialog_sync_tracking_filter_rows (self);
	_g_object_unref0 (url_btn);
	_g_object_unref0 (clean_links_row);
	_g_object_unref0 (previews_row);
	_g_object_unref0 (links_group);
	block75_data_unref (_data75_);
	_data75_ = NULL;
}

static void
dc_settings_dialog_sync_tracking_filter_rows (DcSettingsDialog* self)
{
	DcSettingsManager* settings = NULL;
	DcWindow* _tmp0_;
	DcSettingsManager* _tmp1_;
	DcSettingsManager* _tmp2_;
	gboolean _tmp3_ = FALSE;
	DcSettingsManager* _tmp4_;
	gboolean _tmp5_;
	gboolean _tmp6_;
	AdwActionRow* _tmp10_;
	gchar* url = NULL;
	DcSettingsManager* _tmp11_;
	const gchar* _tmp12_;
	const gchar* _tmp13_;
	gchar* _tmp14_;
	const gchar* _tmp15_;
	gint _tmp16_;
	gint _tmp17_;
	GtkButton* _tmp21_;
	DcRemoveParamFilter* filter = NULL;
	DcRemoveParamFilter* _tmp22_;
	DcRemoveParamFilter* _tmp23_;
	gchar* status = NULL;
	DcRemoveParamFilter* _tmp24_;
	AdwActionRow* _tmp53_;
	const gchar* _tmp54_;
	gchar* _tmp55_;
	gchar* _tmp56_;
	gchar* _tmp57_;
	gchar* _tmp58_;
	const gchar* _tmp59_;
	gchar* _tmp60_;
	gchar* _tmp61_;
	AdwActionRow* _tmp62_;
	const gchar* _tmp63_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->app_window;
	_tmp1_ = _tmp0_->settings;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	settings = _tmp2_;
	_tmp4_ = settings;
	_tmp5_ = dc_settings_manager_get_clean_pasted_links (_tmp4_);
	_tmp6_ = _tmp5_;
	if (_tmp6_) {
		DcSettingsManager* _tmp7_;
		gboolean _tmp8_;
		gboolean _tmp9_;
		_tmp7_ = settings;
		_tmp8_ = dc_settings_manager_get_tracking_filter_enabled (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp3_ = _tmp9_;
	} else {
		_tmp3_ = FALSE;
	}
	_tmp10_ = self->priv->tracking_filter_url_row;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp10_, _tmp3_);
	_tmp11_ = settings;
	_tmp12_ = dc_settings_manager_get_tracking_filter_url (_tmp11_);
	_tmp13_ = _tmp12_;
	_tmp14_ = g_strdup (_tmp13_);
	url = _tmp14_;
	_tmp15_ = url;
	_tmp16_ = strlen (_tmp15_);
	_tmp17_ = _tmp16_;
	if (_tmp17_ == 0) {
		AdwActionRow* _tmp18_;
		AdwActionRow* _tmp19_;
		GtkButton* _tmp20_;
		_tmp18_ = self->priv->tracking_filter_url_row;
		adw_action_row_set_subtitle (_tmp18_, "No list configured");
		_tmp19_ = self->priv->tracking_filter_url_row;
		gtk_widget_set_tooltip_text ((GtkWidget*) _tmp19_, NULL);
		_tmp20_ = self->priv->tracking_filter_refresh_btn;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp20_, FALSE);
		_g_free0 (url);
		_g_object_unref0 (settings);
		return;
	}
	_tmp21_ = self->priv->tracking_filter_refresh_btn;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp21_, TRUE);
	_tmp22_ = dc_remove_param_filter_active;
	_tmp23_ = _g_object_ref0 (_tmp22_);
	filter = _tmp23_;
	_tmp24_ = filter;
	if (_tmp24_ == NULL) {
		gchar* _tmp25_;
		_tmp25_ = g_strdup ("Not downloaded yet");
		_g_free0 (status);
		status = _tmp25_;
	} else {
		DcRemoveParamFilter* _tmp26_;
		gint _tmp27_;
		gint _tmp28_;
		gchar* _tmp29_;
		DcRemoveParamFilter* _tmp30_;
		const gchar* _tmp31_;
		const gchar* _tmp32_;
		gint _tmp33_;
		gint _tmp34_;
		GDateTime* when = NULL;
		GDateTime* _tmp42_;
		GDateTime* _tmp43_;
		_tmp26_ = filter;
		_tmp27_ = dc_remove_param_filter_get_rule_count (_tmp26_);
		_tmp28_ = _tmp27_;
		_tmp29_ = g_strdup_printf ("%d rules", _tmp28_);
		_g_free0 (status);
		status = _tmp29_;
		_tmp30_ = filter;
		_tmp31_ = dc_remove_param_filter_get_version (_tmp30_);
		_tmp32_ = _tmp31_;
		_tmp33_ = strlen (_tmp32_);
		_tmp34_ = _tmp33_;
		if (_tmp34_ > 0) {
			const gchar* _tmp35_;
			DcRemoveParamFilter* _tmp36_;
			const gchar* _tmp37_;
			const gchar* _tmp38_;
			gchar* _tmp39_;
			gchar* _tmp40_;
			gchar* _tmp41_;
			_tmp35_ = status;
			_tmp36_ = filter;
			_tmp37_ = dc_remove_param_filter_get_version (_tmp36_);
			_tmp38_ = _tmp37_;
			_tmp39_ = g_strconcat (", version ", _tmp38_, NULL);
			_tmp40_ = _tmp39_;
			_tmp41_ = g_strconcat (_tmp35_, _tmp40_, NULL);
			_g_free0 (status);
			status = _tmp41_;
			_g_free0 (_tmp40_);
		}
		_tmp42_ = dc_remove_param_filter_cache_time ();
		when = _tmp42_;
		_tmp43_ = when;
		if (_tmp43_ != NULL) {
			const gchar* _tmp44_;
			GDateTime* _tmp45_;
			GDateTime* _tmp46_;
			GDateTime* _tmp47_;
			gchar* _tmp48_;
			gchar* _tmp49_;
			gchar* _tmp50_;
			gchar* _tmp51_;
			gchar* _tmp52_;
			_tmp44_ = status;
			_tmp45_ = when;
			_tmp46_ = g_date_time_to_local (_tmp45_);
			_tmp47_ = _tmp46_;
			_tmp48_ = g_date_time_format (_tmp47_, "%x %H:%M");
			_tmp49_ = _tmp48_;
			_tmp50_ = g_strconcat (", updated ", _tmp49_, NULL);
			_tmp51_ = _tmp50_;
			_tmp52_ = g_strconcat (_tmp44_, _tmp51_, NULL);
			_g_free0 (status);
			status = _tmp52_;
			_g_free0 (_tmp51_);
			_g_free0 (_tmp49_);
			_g_date_time_unref0 (_tmp47_);
		}
		_g_date_time_unref0 (when);
	}
	_tmp53_ = self->priv->tracking_filter_url_row;
	_tmp54_ = url;
	_tmp55_ = g_markup_escape_text (_tmp54_, (gssize) -1);
	_tmp56_ = _tmp55_;
	_tmp57_ = g_strconcat (_tmp56_, "\n", NULL);
	_tmp58_ = _tmp57_;
	_tmp59_ = status;
	_tmp60_ = g_strconcat (_tmp58_, _tmp59_, NULL);
	_tmp61_ = _tmp60_;
	adw_action_row_set_subtitle (_tmp53_, _tmp61_);
	_g_free0 (_tmp61_);
	_g_free0 (_tmp58_);
	_g_free0 (_tmp56_);
	_tmp62_ = self->priv->tracking_filter_url_row;
	_tmp63_ = url;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp62_, _tmp63_);
	_g_free0 (status);
	_g_object_unref0 (filter);
	_g_free0 (url);
	_g_object_unref0 (settings);
}

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

static void
dc_settings_dialog_prompt_tracking_filter_url (DcSettingsDialog* self,
                                               GAsyncReadyCallback _callback_,
                                               gpointer _user_data_)
{
	DcSettingsDialogPromptTrackingFilterUrlData* _data_;
	DcSettingsDialog* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcSettingsDialogPromptTrackingFilterUrlData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_settings_dialog_prompt_tracking_filter_url_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	dc_settings_dialog_prompt_tracking_filter_url_co (_data_);
}

static void
dc_settings_dialog_prompt_tracking_filter_url_finish (DcSettingsDialog* self,
                                                      GAsyncResult* _res_)
{
	DcSettingsDialogPromptTrackingFilterUrlData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dc_settings_dialog_prompt_tracking_filter_url_ready (GObject* source_object,
                                                     GAsyncResult* _res_,
                                                     gpointer _user_data_)
{
	DcSettingsDialogPromptTrackingFilterUrlData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_settings_dialog_prompt_tracking_filter_url_co (_data_);
}

static gboolean
dc_settings_dialog_prompt_tracking_filter_url_co (DcSettingsDialogPromptTrackingFilterUrlData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = (AdwAlertDialog*) adw_alert_dialog_new ("Filter List URL", "Address of a uBlock Origin or AdGuard filter list with " "$removeparam rules, for example the AdGuard URL Tracking " "filter.");
	g_object_ref_sink (_data_->_tmp0_);
	_data_->d = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->d;
	adw_alert_dialog_add_response (_data_->_tmp1_, "cancel", "Cancel");
	_data_->_tmp2_ = _data_->d;
	adw_alert_dialog_add_response (_data_->_tmp2_, "set", "Download");
	_data_->_tmp3_ = _data_->d;
	adw_alert_dialog_set_response_appearance (_data_->_tmp3_, "set", ADW_RESPONSE_SUGGESTED);
	_data_->_tmp4_ = _data_->d;
	adw_alert_dialog_set_default_response (_data_->_tmp4_, "set");
	_data_->_tmp5_ = _data_->d;
	adw_alert_dialog_set_close_response (_data_->_tmp5_, "cancel");
	_data_->_tmp6_ = (GtkEntry*) gtk_entry_new ();
	g_object_ref_sink (_data_->_tmp6_);
	_data_->entry = _data_->_tmp6_;
	_data_->_tmp7_ = _data_->self->priv->app_window;
	_data_->_tmp8_ = _data_->_tmp7_->settings;
	_data_->_tmp9_ = dc_settings_manager_get_tracking_filter_url (_data_->_tmp8_);
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_tmp11_ = g_strdup (_data_->_tmp10_);
	_data_->current = _data_->_tmp11_;
	_data_->_tmp13_ = _data_->current;
	_data_->_tmp14_ = strlen (_data_->_tmp13_);
	_data_->_tmp15_ = _data_->_tmp14_;
	if (_data_->_tmp15_ > 0) {
		_data_->_tmp16_ = _data_->current;
		_data_->_tmp12_ = _data_->_tmp16_;
	} else {
		_data_->_tmp12_ = DC_REMOVE_PARAM_FILTER_DEFAULT_URL;
	}
	_data_->_tmp17_ = _data_->entry;
	gtk_editable_set_text ((GtkEditable*) _data_->_tmp17_, _data_->_tmp12_);
	_data_->_tmp18_ = _data_->entry;
	gtk_entry_set_placeholder_text (_data_->_tmp18_, DC_REMOVE_PARAM_FILTER_DEFAULT_URL);
	_data_->_tmp19_ = _data_->entry;
	gtk_entry_set_activates_default (_data_->_tmp19_, TRUE);
	_data_->_tmp20_ = _data_->d;
	_data_->_tmp21_ = _data_->entry;
	adw_alert_dialog_set_extra_child (_data_->_tmp20_, (GtkWidget*) _data_->_tmp21_);
	_data_->_tmp22_ = _data_->d;
	_data_->_state_ = 1;
	adw_alert_dialog_choose (_data_->_tmp22_, (GtkWidget*) _data_->self, NULL, dc_settings_dialog_prompt_tracking_filter_url_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp23_ = adw_alert_dialog_choose_finish (_data_->_tmp22_, _data_->_res_);
	_data_->_tmp24_ = g_strdup (_data_->_tmp23_);
	_data_->response = _data_->_tmp24_;
	_data_->_tmp25_ = _data_->response;
	if (g_strcmp0 (_data_->_tmp25_, "set") != 0) {
		_g_free0 (_data_->response);
		_g_free0 (_data_->current);
		_g_object_unref0 (_data_->entry);
		_g_object_unref0 (_data_->d);
		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;
	}
	_data_->_tmp26_ = _data_->entry;
	_data_->_tmp27_ = gtk_editable_get_text ((GtkEditable*) _data_->_tmp26_);
	_data_->_tmp28_ = _data_->_tmp27_;
	_data_->_tmp29_ = string_strip (_data_->_tmp28_);
	_data_->url = _data_->_tmp29_;
	_data_->_tmp31_ = _data_->url;
	if (!g_str_has_prefix (_data_->_tmp31_, "https://")) {
		_data_->_tmp32_ = _data_->url;
		_data_->_tmp30_ = !g_str_has_prefix (_data_->_tmp32_, "http://");
	} else {
		_data_->_tmp30_ = FALSE;
	}
	if (_data_->_tmp30_) {
		_data_->_tmp33_ = _data_->self->priv->app_window;
		dc_window_show_toast (_data_->_tmp33_, "The filter list URL must start with http(s)://");
		_g_free0 (_data_->url);
		_g_free0 (_data_->response);
		_g_free0 (_data_->current);
		_g_object_unref0 (_data_->entry);
		_g_object_unref0 (_data_->d);
		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;
	}
	_data_->_tmp34_ = _data_->url;
	_data_->_tmp35_ = _data_->current;
	_data_->changed = g_strcmp0 (_data_->_tmp34_, _data_->_tmp35_) != 0;
	_data_->_tmp36_ = _data_->self->priv->app_window;
	_data_->_tmp37_ = _data_->_tmp36_->settings;
	_data_->_tmp38_ = _data_->url;
	dc_settings_manager_save_tracking_filter_url (_data_->_tmp37_, _data_->_tmp38_);
	if (_data_->changed) {
		_g_object_unref0 (dc_remove_param_filter_active);
		dc_remove_param_filter_active = NULL;
		dc_settings_dialog_sync_tracking_filter_rows (_data_->self);
	}
	_data_->_state_ = 2;
	dc_settings_dialog_update_tracking_filter (_data_->self, dc_settings_dialog_prompt_tracking_filter_url_ready, _data_);
	return FALSE;
	_state_2:
	dc_settings_dialog_update_tracking_filter_finish (_data_->self, _data_->_res_);
	_g_free0 (_data_->url);
	_g_free0 (_data_->response);
	_g_free0 (_data_->current);
	_g_object_unref0 (_data_->entry);
	_g_object_unref0 (_data_->d);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

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

static void
dc_settings_dialog_update_tracking_filter (DcSettingsDialog* self,
                                           GAsyncReadyCallback _callback_,
                                           gpointer _user_data_)
{
	DcSettingsDialogUpdateTrackingFilterData* _data_;
	DcSettingsDialog* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcSettingsDialogUpdateTrackingFilterData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_settings_dialog_update_tracking_filter_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	dc_settings_dialog_update_tracking_filter_co (_data_);
}

static void
dc_settings_dialog_update_tracking_filter_finish (DcSettingsDialog* self,
                                                  GAsyncResult* _res_)
{
	DcSettingsDialogUpdateTrackingFilterData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dc_settings_dialog_update_tracking_filter_ready (GObject* source_object,
                                                 GAsyncResult* _res_,
                                                 gpointer _user_data_)
{
	DcSettingsDialogUpdateTrackingFilterData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_settings_dialog_update_tracking_filter_co (_data_);
}

static gboolean
dc_settings_dialog_update_tracking_filter_co (DcSettingsDialogUpdateTrackingFilterData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->tracking_filter_refresh_btn;
	gtk_widget_set_sensitive ((GtkWidget*) _data_->_tmp0_, FALSE);
	_data_->_tmp1_ = _data_->self->priv->app_window;
	_data_->_state_ = 1;
	dc_window_refresh_tracking_filter (_data_->_tmp1_, TRUE, dc_settings_dialog_update_tracking_filter_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp2_ = dc_window_refresh_tracking_filter_finish (_data_->_tmp1_, _data_->_res_);
	_data_->err = _data_->_tmp2_;
	_data_->_tmp3_ = _data_->err;
	if (_data_->_tmp3_ != NULL) {
		_data_->_tmp4_ = _data_->self->priv->app_window;
		_data_->_tmp5_ = _data_->err;
		dc_window_show_toast (_data_->_tmp4_, _data_->_tmp5_);
		_data_->_tmp6_ = _data_->self->priv->app_window;
		_data_->_tmp7_ = _data_->_tmp6_->settings;
		dc_settings_manager_apply_tracking_filter (_data_->_tmp7_);
	} else {
		_data_->_tmp8_ = dc_remove_param_filter_active;
		_data_->_tmp9_ = _g_object_ref0 (_data_->_tmp8_);
		_data_->f = _data_->_tmp9_;
		_data_->_tmp11_ = _data_->f;
		if (_data_->_tmp11_ != NULL) {
			_data_->_tmp12_ = _data_->f;
			_data_->_tmp13_ = dc_remove_param_filter_get_rule_count (_data_->_tmp12_);
			_data_->_tmp14_ = _data_->_tmp13_;
			_data_->_tmp15_ = g_strdup_printf ("Filter list updated: %d rules", _data_->_tmp14_);
			_g_free0 (_data_->_tmp10_);
			_data_->_tmp10_ = _data_->_tmp15_;
		} else {
			_data_->_tmp16_ = g_strdup ("Filter list updated");
			_g_free0 (_data_->_tmp10_);
			_data_->_tmp10_ = _data_->_tmp16_;
		}
		_data_->_tmp17_ = _data_->self->priv->app_window;
		dc_window_show_toast (_data_->_tmp17_, _data_->_tmp10_);
		_g_free0 (_data_->_tmp10_);
		_g_object_unref0 (_data_->f);
	}
	dc_settings_dialog_sync_tracking_filter_rows (_data_->self);
	_g_free0 (_data_->err);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static AdwPreferencesGroup*
dc_settings_dialog_settings_group (DcSettingsDialog* self,
                                   AdwPreferencesPage* page,
                                   const gchar* title)
{
	AdwPreferencesGroup* group = NULL;
	AdwPreferencesGroup* _tmp0_;
	AdwPreferencesGroup* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (page != NULL, NULL);
	g_return_val_if_fail (title != NULL, NULL);
	_tmp0_ = (AdwPreferencesGroup*) adw_preferences_group_new ();
	g_object_ref_sink (_tmp0_);
	group = _tmp0_;
	adw_preferences_group_set_title (group, title);
	adw_preferences_page_add (page, group);
	result = group;
	return result;
}

static guint
dc_settings_dialog_auto_download_limit_index (gint bytes)
{
	guint result;
	switch (bytes) {
		case DC_AUTO_DOWNLOAD_NEVER:
		{
			result = (guint) 0;
			return result;
		}
		case 256 * 1024:
		{
			result = (guint) 1;
			return result;
		}
		case 512 * 1024:
		{
			result = (guint) 2;
			return result;
		}
		case 1024 * 1024:
		{
			result = (guint) 3;
			return result;
		}
		case (2 * 1024) * 1024:
		{
			result = (guint) 4;
			return result;
		}
		case (5 * 1024) * 1024:
		{
			result = (guint) 5;
			return result;
		}
		case 0:
		{
			result = (guint) 6;
			return result;
		}
		default:
		{
			result = (guint) 3;
			return result;
		}
	}
}

static gint
dc_settings_dialog_auto_download_limit_for_index (guint index)
{
	gint result;
	switch (index) {
		case 0:
		{
			result = DC_AUTO_DOWNLOAD_NEVER;
			return result;
		}
		case 1:
		{
			result = 256 * 1024;
			return result;
		}
		case 2:
		{
			result = 512 * 1024;
			return result;
		}
		case 3:
		{
			result = 1024 * 1024;
			return result;
		}
		case 4:
		{
			result = (2 * 1024) * 1024;
			return result;
		}
		case 5:
		{
			result = (5 * 1024) * 1024;
			return result;
		}
		case 6:
		{
			result = 0;
			return result;
		}
		default:
		{
			result = DC_AUTO_DOWNLOAD_DEFAULT;
			return result;
		}
	}
}

static AdwActionRow*
dc_settings_dialog_action_row (const gchar* title,
                               const gchar* subtitle)
{
	AdwActionRow* row = NULL;
	AdwActionRow* _tmp0_;
	AdwActionRow* _tmp1_;
	AdwActionRow* result;
	g_return_val_if_fail (title != NULL, NULL);
	_tmp0_ = (AdwActionRow*) adw_action_row_new ();
	g_object_ref_sink (_tmp0_);
	row = _tmp0_;
	_tmp1_ = row;
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp1_, title);
	if (subtitle != NULL) {
		AdwActionRow* _tmp2_;
		_tmp2_ = row;
		adw_action_row_set_subtitle (_tmp2_, subtitle);
	}
	result = row;
	return result;
}

static GtkSwitch*
dc_settings_dialog_row_switch (AdwActionRow* row,
                               gboolean active)
{
	GtkSwitch* sw = NULL;
	GtkSwitch* _tmp0_;
	GtkSwitch* result;
	g_return_val_if_fail (row != NULL, NULL);
	_tmp0_ = (GtkSwitch*) gtk_switch_new ();
	g_object_ref_sink (_tmp0_);
	sw = _tmp0_;
	gtk_switch_set_active (sw, active);
	gtk_widget_set_valign ((GtkWidget*) sw, GTK_ALIGN_CENTER);
	adw_action_row_add_suffix (row, (GtkWidget*) sw);
	adw_action_row_set_activatable_widget (row, (GtkWidget*) sw);
	result = sw;
	return result;
}

static AdwComboRow*
dc_settings_dialog_row_combo (AdwPreferencesGroup* group,
                              const gchar* title,
                              const gchar* subtitle,
                              gchar** labels,
                              gint labels_length1,
                              guint selected)
{
	AdwComboRow* row = NULL;
	AdwComboRow* _tmp0_;
	AdwComboRow* _tmp1_;
	AdwComboRow* _tmp3_;
	GtkStringList* _tmp4_;
	GtkStringList* _tmp5_;
	AdwComboRow* _tmp6_;
	GtkPropertyExpression* _tmp7_;
	GtkPropertyExpression* _tmp8_;
	AdwComboRow* _tmp9_;
	AdwComboRow* _tmp10_;
	AdwComboRow* result;
	g_return_val_if_fail (group != NULL, NULL);
	g_return_val_if_fail (title != NULL, NULL);
	_tmp0_ = (AdwComboRow*) adw_combo_row_new ();
	g_object_ref_sink (_tmp0_);
	row = _tmp0_;
	_tmp1_ = row;
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp1_, title);
	if (subtitle != NULL) {
		AdwComboRow* _tmp2_;
		_tmp2_ = row;
		adw_action_row_set_subtitle ((AdwActionRow*) _tmp2_, subtitle);
	}
	_tmp3_ = row;
	_tmp4_ = gtk_string_list_new (labels);
	_tmp5_ = _tmp4_;
	adw_combo_row_set_model (_tmp3_, (GListModel*) _tmp5_);
	_g_object_unref0 (_tmp5_);
	_tmp6_ = row;
	_tmp7_ = (GtkPropertyExpression*) gtk_property_expression_new (gtk_string_object_get_type (), NULL, "string");
	_tmp8_ = _tmp7_;
	adw_combo_row_set_expression (_tmp6_, (GtkExpression*) _tmp8_);
	_gtk_expression_unref0 (_tmp8_);
	_tmp9_ = row;
	adw_combo_row_set_selected (_tmp9_, selected);
	_tmp10_ = row;
	adw_preferences_group_add (group, (GtkWidget*) _tmp10_);
	result = row;
	return result;
}

static void
dc_settings_dialog_sync_font_controls (DcSettingsDialog* self)
{
	gchar* family = NULL;
	DcWindow* _tmp0_;
	DcSettingsManager* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	const gchar* _tmp5_ = NULL;
	const gchar* _tmp6_;
	gint _tmp7_;
	gint _tmp8_;
	AdwActionRow* _tmp10_;
	const gchar* _tmp11_ = NULL;
	const gchar* _tmp12_;
	gint _tmp13_;
	gint _tmp14_;
	AdwActionRow* _tmp16_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->app_window;
	_tmp1_ = _tmp0_->settings;
	_tmp2_ = dc_settings_manager_get_font_family (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_strdup (_tmp3_);
	family = _tmp4_;
	_tmp6_ = family;
	_tmp7_ = strlen (_tmp6_);
	_tmp8_ = _tmp7_;
	if (_tmp8_ > 0) {
		const gchar* _tmp9_;
		_tmp9_ = family;
		_tmp5_ = _tmp9_;
	} else {
		_tmp5_ = "System default";
	}
	_tmp10_ = self->priv->font_type_row;
	adw_action_row_set_subtitle (_tmp10_, _tmp5_);
	_tmp12_ = family;
	_tmp13_ = strlen (_tmp12_);
	_tmp14_ = _tmp13_;
	if (_tmp14_ > 0) {
		const gchar* _tmp15_;
		_tmp15_ = family;
		_tmp11_ = _tmp15_;
	} else {
		_tmp11_ = NULL;
	}
	_tmp16_ = self->priv->font_type_row;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp16_, _tmp11_);
	_g_free0 (family);
}

static void
dc_settings_dialog_on_choose_font_data_free (gpointer _data)
{
	DcSettingsDialogOnChooseFontData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->dialog);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcSettingsDialogOnChooseFontData, _data_);
}

static void
dc_settings_dialog_on_choose_font (DcSettingsDialog* self,
                                   GtkFontDialog* dialog,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_)
{
	DcSettingsDialogOnChooseFontData* _data_;
	DcSettingsDialog* _tmp0_;
	GtkFontDialog* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (dialog != NULL);
	_data_ = g_slice_new0 (DcSettingsDialogOnChooseFontData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_settings_dialog_on_choose_font_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (dialog);
	_g_object_unref0 (_data_->dialog);
	_data_->dialog = _tmp1_;
	dc_settings_dialog_on_choose_font_co (_data_);
}

static void
dc_settings_dialog_on_choose_font_finish (DcSettingsDialog* self,
                                          GAsyncResult* _res_)
{
	DcSettingsDialogOnChooseFontData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dc_settings_dialog_on_choose_font_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_)
{
	DcSettingsDialogOnChooseFontData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_settings_dialog_on_choose_font_co (_data_);
}

static gboolean
dc_settings_dialog_on_choose_font_co (DcSettingsDialogOnChooseFontData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		_data_->_tmp0_ = _data_->self->priv->app_window;
		_data_->_tmp1_ = _data_->self->priv->app_window;
		_data_->_tmp2_ = _data_->_tmp1_->settings;
		_data_->_tmp3_ = dc_settings_manager_effective_font_description (_data_->_tmp2_);
		_data_->_tmp4_ = _data_->_tmp3_;
		_data_->_state_ = 1;
		gtk_font_dialog_choose_font (_data_->dialog, (GtkWindow*) _data_->_tmp0_, _data_->_tmp4_, NULL, dc_settings_dialog_on_choose_font_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp5_ = gtk_font_dialog_choose_font_finish (_data_->dialog, _data_->_res_, &_data_->_inner_error0_);
		_data_->_tmp6_ = _data_->_tmp5_;
		__vala_PangoFontDescription_free0 (_data_->_tmp4_);
		_data_->desc = _data_->_tmp6_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		if (_data_->desc != NULL) {
			_data_->_tmp7_ = _data_->self->priv->app_window;
			_data_->_tmp8_ = _data_->_tmp7_->settings;
			dc_settings_manager_save_font_description (_data_->_tmp8_, _data_->desc);
			dc_settings_dialog_sync_font_controls (_data_->self);
		}
		__vala_PangoFontDescription_free0 (_data_->desc);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp9_ = _data_->e;
		if (!dc_is_dialog_dismissal (_data_->_tmp9_)) {
			_data_->_tmp10_ = _data_->self->priv->app_window;
			_data_->_tmp11_ = _data_->e;
			_data_->_tmp12_ = _data_->_tmp11_->message;
			dc_show_error ((GtkWidget*) _data_->_tmp10_, _data_->_tmp12_);
		}
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static gchar*
dc_settings_dialog_hex_from_rgba (GdkRGBA* c)
{
	GdkRGBA _tmp0_;
	GdkRGBA _tmp1_;
	GdkRGBA _tmp2_;
	gchar* _tmp3_;
	gchar* result;
	g_return_val_if_fail (c != NULL, NULL);
	_tmp0_ = *c;
	_tmp1_ = *c;
	_tmp2_ = *c;
	_tmp3_ = g_strdup_printf ("#%02x%02x%02x", (guint) (_tmp0_.red * 255), (guint) (_tmp1_.green * 255), (guint) (_tmp2_.blue * 255));
	result = _tmp3_;
	return result;
}

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

static void
dc_settings_dialog_load_proxy_settings (DcSettingsDialog* self,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_)
{
	DcSettingsDialogLoadProxySettingsData* _data_;
	DcSettingsDialog* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcSettingsDialogLoadProxySettingsData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_settings_dialog_load_proxy_settings_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	dc_settings_dialog_load_proxy_settings_co (_data_);
}

static void
dc_settings_dialog_load_proxy_settings_finish (DcSettingsDialog* self,
                                               GAsyncResult* _res_)
{
	DcSettingsDialogLoadProxySettingsData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dc_settings_dialog_load_proxy_settings_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_)
{
	DcSettingsDialogLoadProxySettingsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_settings_dialog_load_proxy_settings_co (_data_);
}

static gboolean
dc_settings_dialog_load_proxy_settings_co (DcSettingsDialogLoadProxySettingsData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp1_ = _data_->self->priv->rpc;
	_data_->_tmp2_ = dc_rpc_client_get_is_connected (_data_->_tmp1_);
	_data_->_tmp3_ = _data_->_tmp2_;
	if (!_data_->_tmp3_) {
		_data_->_tmp0_ = TRUE;
	} else {
		_data_->_tmp4_ = _data_->self->priv->rpc;
		_data_->_tmp5_ = dc_rpc_client_get_account_id (_data_->_tmp4_);
		_data_->_tmp6_ = _data_->_tmp5_;
		_data_->_tmp0_ = _data_->_tmp6_ <= 0;
	}
	if (_data_->_tmp0_) {
		dc_settings_dialog_set_proxy_controls_sensitive (_data_->self, FALSE);
		_data_->_tmp7_ = _data_->self->priv->proxy_switch_row;
		adw_action_row_set_subtitle (_data_->_tmp7_, "No active profile");
		_data_->_tmp8_ = _data_->self->priv->proxy_url_row;
		adw_action_row_set_subtitle (_data_->_tmp8_, "No active profile");
		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;
	}
	_data_->self->priv->loading_proxy = TRUE;
	dc_settings_dialog_set_proxy_controls_sensitive (_data_->self, FALSE);
	{
		_data_->_tmp9_ = _data_->self->priv->rpc;
		_data_->_tmp10_ = _data_->self->priv->rpc;
		_data_->_tmp11_ = dc_rpc_client_get_account_id (_data_->_tmp10_);
		_data_->_tmp12_ = _data_->_tmp11_;
		_data_->_state_ = 1;
		dc_rpc_client_get_config (_data_->_tmp9_, "proxy_enabled", _data_->_tmp12_, dc_settings_dialog_load_proxy_settings_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp13_ = dc_rpc_client_get_config_finish (_data_->_tmp9_, _data_->_res_, &_data_->_inner_error0_);
		_data_->enabled = _data_->_tmp13_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_tmp14_ = _data_->self->priv->rpc;
		_data_->_tmp15_ = _data_->self->priv->rpc;
		_data_->_tmp16_ = dc_rpc_client_get_account_id (_data_->_tmp15_);
		_data_->_tmp17_ = _data_->_tmp16_;
		_data_->_state_ = 2;
		dc_rpc_client_get_config (_data_->_tmp14_, "proxy_url", _data_->_tmp17_, dc_settings_dialog_load_proxy_settings_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp18_ = dc_rpc_client_get_config_finish (_data_->_tmp14_, _data_->_res_, &_data_->_inner_error0_);
		_data_->proxy_url = _data_->_tmp18_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_free0 (_data_->enabled);
			goto __catch0_g_error;
		}
		_data_->_tmp20_ = _data_->proxy_url;
		_data_->_tmp19_ = _data_->_tmp20_;
		if (_data_->_tmp19_ == NULL) {
			_data_->_tmp19_ = "";
		}
		_data_->_tmp21_ = dc_settings_dialog_first_proxy_url (_data_->_tmp19_);
		_data_->first = _data_->_tmp21_;
		_data_->_tmp23_ = _data_->enabled;
		_data_->_tmp22_ = _data_->_tmp23_;
		if (_data_->_tmp22_ == NULL) {
			_data_->_tmp22_ = "";
		}
		_data_->_tmp24_ = _data_->self->priv->proxy_switch;
		gtk_switch_set_active (_data_->_tmp24_, g_strcmp0 (_data_->_tmp22_, "1") == 0);
		_data_->_tmp25_ = _data_->self->priv->proxy_entry;
		_data_->_tmp26_ = _data_->first;
		gtk_editable_set_text ((GtkEditable*) _data_->_tmp25_, _data_->_tmp26_);
		_data_->_tmp27_ = _data_->self->priv->proxy_switch;
		_data_->_tmp28_ = gtk_switch_get_active (_data_->_tmp27_);
		_data_->_tmp29_ = _data_->_tmp28_;
		_data_->self->priv->saved_proxy_enabled = _data_->_tmp29_;
		_data_->_tmp30_ = _data_->first;
		_data_->_tmp31_ = g_strdup (_data_->_tmp30_);
		_g_free0 (_data_->self->priv->saved_proxy_url);
		_data_->self->priv->saved_proxy_url = _data_->_tmp31_;
		_data_->_tmp33_ = _data_->self->priv->proxy_switch;
		_data_->_tmp34_ = gtk_switch_get_active (_data_->_tmp33_);
		_data_->_tmp35_ = _data_->_tmp34_;
		if (_data_->_tmp35_) {
			_data_->_tmp32_ = "Enabled for current profile";
		} else {
			_data_->_tmp32_ = "Disabled for current profile";
		}
		_data_->_tmp36_ = _data_->self->priv->proxy_switch_row;
		adw_action_row_set_subtitle (_data_->_tmp36_, _data_->_tmp32_);
		_data_->_tmp37_ = _data_->self->priv->proxy_url_row;
		adw_action_row_set_subtitle (_data_->_tmp37_, "socks5://, http://, https://, or ss://");
		_data_->_tmp39_ = _data_->first;
		_data_->_tmp40_ = strlen (_data_->_tmp39_);
		_data_->_tmp41_ = _data_->_tmp40_;
		if (_data_->_tmp41_ > 0) {
			_data_->_tmp42_ = _data_->first;
			_data_->_tmp38_ = _data_->_tmp42_;
		} else {
			_data_->_tmp38_ = NULL;
		}
		_data_->_tmp43_ = _data_->self->priv->proxy_url_row;
		gtk_widget_set_tooltip_text ((GtkWidget*) _data_->_tmp43_, _data_->_tmp38_);
		_g_free0 (_data_->first);
		_g_free0 (_data_->proxy_url);
		_g_free0 (_data_->enabled);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp44_ = _data_->self->priv->proxy_switch_row;
		adw_action_row_set_subtitle (_data_->_tmp44_, "Unable to read proxy settings");
		_data_->_tmp45_ = _data_->self->priv->proxy_url_row;
		_data_->_tmp46_ = _data_->e;
		_data_->_tmp47_ = _data_->_tmp46_->message;
		gtk_widget_set_tooltip_text ((GtkWidget*) _data_->_tmp45_, _data_->_tmp47_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	{
		_data_->self->priv->loading_proxy = FALSE;
		dc_settings_dialog_set_proxy_controls_sensitive (_data_->self, TRUE);
	}
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
dc_settings_dialog_set_proxy_controls_sensitive (DcSettingsDialog* self,
                                                 gboolean sensitive)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean active = FALSE;
	GtkSwitch* _tmp8_;
	GtkEntry* _tmp9_;
	g_return_if_fail (self != NULL);
	if (sensitive) {
		DcRpcClient* _tmp2_;
		gboolean _tmp3_;
		gboolean _tmp4_;
		_tmp2_ = self->priv->rpc;
		_tmp3_ = dc_rpc_client_get_is_connected (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp1_ = _tmp4_;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		DcRpcClient* _tmp5_;
		gint _tmp6_;
		gint _tmp7_;
		_tmp5_ = self->priv->rpc;
		_tmp6_ = dc_rpc_client_get_account_id (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp0_ = _tmp7_ > 0;
	} else {
		_tmp0_ = FALSE;
	}
	active = _tmp0_;
	_tmp8_ = self->priv->proxy_switch;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp8_, active);
	_tmp9_ = self->priv->proxy_entry;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp9_, active);
}

static gchar*
dc_settings_dialog_first_proxy_url (const gchar* urls)
{
	gchar** _tmp0_;
	gchar** _tmp1_;
	gchar* _tmp8_;
	gchar* result;
	g_return_val_if_fail (urls != NULL, NULL);
	_tmp1_ = _tmp0_ = g_strsplit (urls, "\n", 0);
	{
		gchar** line_collection = NULL;
		gint line_collection_length1 = 0;
		gint _line_collection_size_ = 0;
		gint line_it = 0;
		line_collection = _tmp1_;
		line_collection_length1 = _vala_array_length (_tmp0_);
		for (line_it = 0; line_it < line_collection_length1; line_it = line_it + 1) {
			gchar* _tmp2_;
			gchar* line = NULL;
			_tmp2_ = g_strdup (line_collection[line_it]);
			line = _tmp2_;
			{
				gchar* s = NULL;
				const gchar* _tmp3_;
				gchar* _tmp4_;
				const gchar* _tmp5_;
				gint _tmp6_;
				gint _tmp7_;
				_tmp3_ = line;
				_tmp4_ = string_strip (_tmp3_);
				s = _tmp4_;
				_tmp5_ = s;
				_tmp6_ = strlen (_tmp5_);
				_tmp7_ = _tmp6_;
				if (_tmp7_ > 0) {
					result = s;
					_g_free0 (line);
					line_collection = (_vala_array_free (line_collection, line_collection_length1, (GDestroyNotify) g_free), NULL);
					return result;
				}
				_g_free0 (s);
				_g_free0 (line);
			}
		}
		line_collection = (_vala_array_free (line_collection, line_collection_length1, (GDestroyNotify) g_free), NULL);
	}
	_tmp8_ = g_strdup ("");
	result = _tmp8_;
	return result;
}

static void
dc_settings_dialog_normalize_proxy_url_data_free (gpointer _data)
{
	DcSettingsDialogNormalizeProxyUrlData* _data_;
	_data_ = _data;
	_g_free0 (_data_->url);
	_g_free0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcSettingsDialogNormalizeProxyUrlData, _data_);
}

static void
dc_settings_dialog_normalize_proxy_url (DcSettingsDialog* self,
                                        const gchar* url,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_)
{
	DcSettingsDialogNormalizeProxyUrlData* _data_;
	DcSettingsDialog* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (url != NULL);
	_data_ = g_slice_new0 (DcSettingsDialogNormalizeProxyUrlData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_settings_dialog_normalize_proxy_url_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (url);
	_g_free0 (_data_->url);
	_data_->url = _tmp1_;
	dc_settings_dialog_normalize_proxy_url_co (_data_);
}

static gchar*
dc_settings_dialog_normalize_proxy_url_finish (DcSettingsDialog* self,
                                               GAsyncResult* _res_)
{
	gchar* result;
	DcSettingsDialogNormalizeProxyUrlData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
dc_settings_dialog_normalize_proxy_url_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_)
{
	DcSettingsDialogNormalizeProxyUrlData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_settings_dialog_normalize_proxy_url_co (_data_);
}

static gboolean
dc_settings_dialog_normalize_proxy_url_co (DcSettingsDialogNormalizeProxyUrlData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		_data_->_tmp0_ = _data_->self->priv->rpc;
		_data_->_tmp1_ = _data_->self->priv->rpc;
		_data_->_tmp2_ = dc_rpc_client_get_account_id (_data_->_tmp1_);
		_data_->_tmp3_ = _data_->_tmp2_;
		_data_->_state_ = 1;
		dc_rpc_client_check_qr (_data_->_tmp0_, _data_->_tmp3_, _data_->url, dc_settings_dialog_normalize_proxy_url_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp4_ = dc_rpc_client_check_qr_finish (_data_->_tmp0_, _data_->_res_, &_data_->_inner_error0_);
		_data_->qr = _data_->_tmp4_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_tmp7_ = _data_->qr;
		if (_data_->_tmp7_ == NULL) {
			_data_->_tmp6_ = TRUE;
		} else {
			_data_->_tmp8_ = _data_->qr;
			_data_->_tmp6_ = !json_object_has_member (_data_->_tmp8_, "kind");
		}
		if (_data_->_tmp6_) {
			_data_->_tmp5_ = TRUE;
		} else {
			_data_->_tmp9_ = _data_->qr;
			_data_->_tmp10_ = json_object_get_string_member (_data_->_tmp9_, "kind");
			_data_->_tmp5_ = g_strcmp0 (_data_->_tmp10_, "proxy") != 0;
		}
		if (_data_->_tmp5_) {
			_data_->_tmp11_ = g_strconcat ("Invalid proxy URL: ", _data_->url, NULL);
			_data_->_tmp12_ = _data_->_tmp11_;
			dc_show_error ((GtkWidget*) _data_->self, _data_->_tmp12_);
			_g_free0 (_data_->_tmp12_);
			_data_->result = NULL;
			_json_object_unref0 (_data_->qr);
			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;
		}
		_data_->_tmp14_ = _data_->qr;
		if (json_object_has_member (_data_->_tmp14_, "url")) {
			_data_->_tmp15_ = _data_->qr;
			_data_->_tmp16_ = json_object_get_string_member (_data_->_tmp15_, "url");
			_data_->_tmp13_ = _data_->_tmp16_;
		} else {
			_data_->_tmp13_ = _data_->url;
		}
		_data_->_tmp17_ = g_strdup (_data_->_tmp13_);
		_data_->result = _data_->_tmp17_;
		_json_object_unref0 (_data_->qr);
		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;
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp18_ = _data_->e;
		_data_->_tmp19_ = _data_->_tmp18_->message;
		_data_->_tmp20_ = g_strdup_printf ("Invalid proxy URL: %s\n%s", _data_->url, _data_->_tmp19_);
		_data_->_tmp21_ = _data_->_tmp20_;
		dc_show_error ((GtkWidget*) _data_->self, _data_->_tmp21_);
		_g_free0 (_data_->_tmp21_);
		_data_->result = NULL;
		_g_error_free0 (_data_->e);
		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;
	}
	__finally0:
	g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
	g_clear_error (&_data_->_inner_error0_);
	g_object_unref (_data_->_async_result);
	return FALSE;
}

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

static void
dc_settings_dialog_save_proxy_settings (DcSettingsDialog* self,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_)
{
	DcSettingsDialogSaveProxySettingsData* _data_;
	DcSettingsDialog* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcSettingsDialogSaveProxySettingsData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_settings_dialog_save_proxy_settings_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	dc_settings_dialog_save_proxy_settings_co (_data_);
}

static void
dc_settings_dialog_save_proxy_settings_finish (DcSettingsDialog* self,
                                               GAsyncResult* _res_)
{
	DcSettingsDialogSaveProxySettingsData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dc_settings_dialog_save_proxy_settings_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_)
{
	DcSettingsDialogSaveProxySettingsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_settings_dialog_save_proxy_settings_co (_data_);
}

static gboolean
dc_settings_dialog_save_proxy_settings_co (DcSettingsDialogSaveProxySettingsData* _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;
		case 5:
		goto _state_5;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (_data_->self->priv->loading_proxy) {
		_data_->_tmp0_ = TRUE;
	} else {
		_data_->_tmp0_ = _data_->self->priv->saving_proxy;
	}
	if (_data_->_tmp0_) {
		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;
	}
	_data_->_tmp2_ = _data_->self->priv->rpc;
	_data_->_tmp3_ = dc_rpc_client_get_is_connected (_data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	if (!_data_->_tmp4_) {
		_data_->_tmp1_ = TRUE;
	} else {
		_data_->_tmp5_ = _data_->self->priv->rpc;
		_data_->_tmp6_ = dc_rpc_client_get_account_id (_data_->_tmp5_);
		_data_->_tmp7_ = _data_->_tmp6_;
		_data_->_tmp1_ = _data_->_tmp7_ <= 0;
	}
	if (_data_->_tmp1_) {
		_data_->_tmp8_ = _data_->self->priv->app_window;
		dc_window_show_toast (_data_->_tmp8_, "No active profile");
		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;
	}
	_data_->_tmp9_ = _data_->self->priv->proxy_entry;
	_data_->_tmp10_ = gtk_editable_get_text ((GtkEditable*) _data_->_tmp9_);
	_data_->_tmp11_ = _data_->_tmp10_;
	_data_->_tmp12_ = string_strip (_data_->_tmp11_);
	_data_->url = _data_->_tmp12_;
	_data_->_tmp13_ = _data_->self->priv->proxy_switch;
	_data_->_tmp14_ = gtk_switch_get_active (_data_->_tmp13_);
	_data_->_tmp15_ = _data_->_tmp14_;
	_data_->enabled = _data_->_tmp15_;
	if (_data_->enabled == _data_->self->priv->saved_proxy_enabled) {
		_data_->_tmp17_ = _data_->url;
		_data_->_tmp18_ = _data_->self->priv->saved_proxy_url;
		_data_->_tmp16_ = g_strcmp0 (_data_->_tmp17_, _data_->_tmp18_) == 0;
	} else {
		_data_->_tmp16_ = FALSE;
	}
	if (_data_->_tmp16_) {
		_g_free0 (_data_->url);
		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;
	}
	if (_data_->enabled) {
		_data_->_tmp20_ = _data_->url;
		_data_->_tmp21_ = strlen (_data_->_tmp20_);
		_data_->_tmp22_ = _data_->_tmp21_;
		_data_->_tmp19_ = _data_->_tmp22_ == 0;
	} else {
		_data_->_tmp19_ = FALSE;
	}
	if (_data_->_tmp19_) {
		dc_show_error ((GtkWidget*) _data_->self, "Enter a proxy URL before enabling the proxy.");
		_data_->self->priv->loading_proxy = TRUE;
		_data_->_tmp23_ = _data_->self->priv->proxy_switch;
		gtk_switch_set_active (_data_->_tmp23_, FALSE);
		_data_->self->priv->loading_proxy = FALSE;
		_data_->enabled = FALSE;
		if (!_data_->self->priv->saved_proxy_enabled) {
			_data_->_tmp25_ = _data_->self->priv->saved_proxy_url;
			_data_->_tmp26_ = strlen (_data_->_tmp25_);
			_data_->_tmp27_ = _data_->_tmp26_;
			_data_->_tmp24_ = _data_->_tmp27_ == 0;
		} else {
			_data_->_tmp24_ = FALSE;
		}
		if (_data_->_tmp24_) {
			_g_free0 (_data_->url);
			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;
		}
	}
	_data_->self->priv->saving_proxy = TRUE;
	dc_settings_dialog_set_proxy_controls_sensitive (_data_->self, FALSE);
	_data_->_tmp28_ = _data_->url;
	_data_->_tmp29_ = strlen (_data_->_tmp28_);
	_data_->_tmp30_ = _data_->_tmp29_;
	if (_data_->_tmp30_ > 0) {
		_data_->_tmp31_ = _data_->url;
		_data_->_state_ = 1;
		dc_settings_dialog_normalize_proxy_url (_data_->self, _data_->_tmp31_, dc_settings_dialog_save_proxy_settings_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp32_ = dc_settings_dialog_normalize_proxy_url_finish (_data_->self, _data_->_res_);
		_data_->normalized = _data_->_tmp32_;
		_data_->_tmp33_ = _data_->normalized;
		if (_data_->_tmp33_ == NULL) {
			_data_->self->priv->saving_proxy = FALSE;
			dc_settings_dialog_set_proxy_controls_sensitive (_data_->self, TRUE);
			_g_free0 (_data_->normalized);
			_g_free0 (_data_->url);
			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;
		}
		_data_->_tmp34_ = _data_->normalized;
		_data_->_tmp35_ = g_strdup (_data_->_tmp34_);
		_g_free0 (_data_->url);
		_data_->url = _data_->_tmp35_;
		_data_->_tmp36_ = _data_->self->priv->proxy_entry;
		_data_->_tmp37_ = _data_->url;
		gtk_editable_set_text ((GtkEditable*) _data_->_tmp36_, _data_->_tmp37_);
		_g_free0 (_data_->normalized);
	}
	{
		_data_->_tmp38_ = _data_->self->priv->rpc;
		_data_->_tmp39_ = _data_->url;
		_data_->_tmp40_ = _data_->self->priv->rpc;
		_data_->_tmp41_ = dc_rpc_client_get_account_id (_data_->_tmp40_);
		_data_->_tmp42_ = _data_->_tmp41_;
		_data_->_state_ = 2;
		dc_rpc_client_batch_set_config (_data_->_tmp38_, "proxy_url", _data_->_tmp39_, _data_->_tmp42_, dc_settings_dialog_save_proxy_settings_ready, _data_);
		return FALSE;
		_state_2:
		dc_rpc_client_batch_set_config_finish (_data_->_tmp38_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		if (_data_->enabled) {
			_data_->_tmp43_ = "1";
		} else {
			_data_->_tmp43_ = "0";
		}
		_data_->_tmp44_ = _data_->self->priv->rpc;
		_data_->_tmp45_ = _data_->self->priv->rpc;
		_data_->_tmp46_ = dc_rpc_client_get_account_id (_data_->_tmp45_);
		_data_->_tmp47_ = _data_->_tmp46_;
		_data_->_state_ = 3;
		dc_rpc_client_batch_set_config (_data_->_tmp44_, "proxy_enabled", _data_->_tmp43_, _data_->_tmp47_, dc_settings_dialog_save_proxy_settings_ready, _data_);
		return FALSE;
		_state_3:
		dc_rpc_client_batch_set_config_finish (_data_->_tmp44_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_tmp48_ = _data_->self->priv->rpc;
		_data_->_tmp49_ = _data_->self->priv->rpc;
		_data_->_tmp50_ = dc_rpc_client_get_account_id (_data_->_tmp49_);
		_data_->_tmp51_ = _data_->_tmp50_;
		_data_->_state_ = 4;
		dc_rpc_client_stop_io (_data_->_tmp48_, _data_->_tmp51_, dc_settings_dialog_save_proxy_settings_ready, _data_);
		return FALSE;
		_state_4:
		dc_rpc_client_stop_io_finish (_data_->_tmp48_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_tmp52_ = _data_->self->priv->rpc;
		_data_->_tmp53_ = _data_->self->priv->rpc;
		_data_->_tmp54_ = dc_rpc_client_get_account_id (_data_->_tmp53_);
		_data_->_tmp55_ = _data_->_tmp54_;
		_data_->_state_ = 5;
		dc_rpc_client_start_io (_data_->_tmp52_, _data_->_tmp55_, dc_settings_dialog_save_proxy_settings_ready, _data_);
		return FALSE;
		_state_5:
		dc_rpc_client_start_io_finish (_data_->_tmp52_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		if (_data_->enabled) {
			_data_->_tmp56_ = "Enabled for current profile";
		} else {
			_data_->_tmp56_ = "Disabled for current profile";
		}
		_data_->_tmp57_ = _data_->self->priv->proxy_switch_row;
		adw_action_row_set_subtitle (_data_->_tmp57_, _data_->_tmp56_);
		_data_->_tmp59_ = _data_->url;
		_data_->_tmp60_ = strlen (_data_->_tmp59_);
		_data_->_tmp61_ = _data_->_tmp60_;
		if (_data_->_tmp61_ > 0) {
			_data_->_tmp62_ = _data_->url;
			_data_->_tmp58_ = _data_->_tmp62_;
		} else {
			_data_->_tmp58_ = NULL;
		}
		_data_->_tmp63_ = _data_->self->priv->proxy_url_row;
		gtk_widget_set_tooltip_text ((GtkWidget*) _data_->_tmp63_, _data_->_tmp58_);
		_data_->self->priv->saved_proxy_enabled = _data_->enabled;
		_data_->_tmp64_ = _data_->url;
		_data_->_tmp65_ = g_strdup (_data_->_tmp64_);
		_g_free0 (_data_->self->priv->saved_proxy_url);
		_data_->self->priv->saved_proxy_url = _data_->_tmp65_;
		_data_->_tmp66_ = _data_->self->priv->app_window;
		dc_window_show_toast (_data_->_tmp66_, "Proxy settings saved");
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp67_ = _data_->e;
		_data_->_tmp68_ = _data_->_tmp67_->message;
		_data_->_tmp69_ = g_strconcat ("Failed to save proxy settings: ", _data_->_tmp68_, NULL);
		_data_->_tmp70_ = _data_->_tmp69_;
		dc_show_error ((GtkWidget*) _data_->self, _data_->_tmp70_);
		_g_free0 (_data_->_tmp70_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	{
		_data_->self->priv->saving_proxy = FALSE;
		dc_settings_dialog_set_proxy_controls_sensitive (_data_->self, TRUE);
	}
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_free0 (_data_->url);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_g_free0 (_data_->url);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
dc_settings_dialog_update_rpc_row (DcSettingsDialog* self)
{
	gboolean pinned = FALSE;
	gchar* custom = NULL;
	DcWindow* _tmp0_;
	DcSettingsManager* _tmp1_;
	gchar* _tmp2_;
	DcRpcServerSource source = 0;
	DcWindow* _tmp3_;
	DcSettingsManager* _tmp4_;
	gchar* found = NULL;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	AdwComboRow* _tmp7_;
	gboolean _tmp8_ = FALSE;
	GtkButton* _tmp9_;
	gboolean _tmp10_ = FALSE;
	GtkButton* _tmp11_;
	gboolean _tmp12_ = FALSE;
	GtkButton* _tmp13_;
	GtkButton* _tmp14_;
	const gchar* _tmp33_;
	g_return_if_fail (self != NULL);
	dc_settings_dialog_sync_rpc_source_dropdown (self);
	pinned = dc_settings_manager_rpc_server_path_is_fixed ();
	_tmp0_ = self->priv->app_window;
	_tmp1_ = _tmp0_->settings;
	_tmp2_ = dc_settings_manager_effective_rpc_server_path (_tmp1_);
	custom = _tmp2_;
	_tmp3_ = self->priv->app_window;
	_tmp4_ = _tmp3_->settings;
	source = dc_settings_manager_effective_rpc_server_source (_tmp4_);
	_tmp5_ = custom;
	_tmp6_ = dc_account_finder_find_rpc_server (_tmp5_, source);
	found = _tmp6_;
	_tmp7_ = self->priv->rpc_source_dropdown;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp7_, !pinned);
	if (source == DC_RPC_SERVER_SOURCE_CUSTOM) {
		_tmp8_ = !pinned;
	} else {
		_tmp8_ = FALSE;
	}
	_tmp9_ = self->priv->rpc_choose_btn;
	gtk_widget_set_visible ((GtkWidget*) _tmp9_, _tmp8_);
	if (source == DC_RPC_SERVER_SOURCE_CUSTOM) {
		_tmp10_ = !pinned;
	} else {
		_tmp10_ = FALSE;
	}
	_tmp11_ = self->priv->rpc_choose_btn;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp11_, _tmp10_);
	if (source == DC_RPC_SERVER_SOURCE_AUTO) {
		_tmp12_ = !pinned;
	} else {
		_tmp12_ = FALSE;
	}
	_tmp13_ = self->priv->rpc_check_btn;
	gtk_widget_set_visible ((GtkWidget*) _tmp13_, _tmp12_);
	_tmp14_ = self->priv->rpc_check_btn;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp14_, !pinned);
	switch (source) {
		case DC_RPC_SERVER_SOURCE_CUSTOM:
		{
			const gchar* _tmp15_;
			gint _tmp16_;
			gint _tmp17_;
			_tmp15_ = custom;
			_tmp16_ = strlen (_tmp15_);
			_tmp17_ = _tmp16_;
			if (_tmp17_ == 0) {
				AdwActionRow* _tmp18_;
				AdwActionRow* _tmp19_;
				_tmp18_ = self->priv->rpc_row;
				adw_action_row_set_subtitle (_tmp18_, "No custom binary selected");
				_tmp19_ = self->priv->rpc_row;
				gtk_widget_set_tooltip_text ((GtkWidget*) _tmp19_, "Choose a Chatmail Core binary");
			} else {
				const gchar* _tmp20_;
				_tmp20_ = found;
				if (_tmp20_ == NULL) {
					AdwActionRow* _tmp21_;
					AdwActionRow* _tmp22_;
					const gchar* _tmp23_;
					_tmp21_ = self->priv->rpc_row;
					adw_action_row_set_subtitle (_tmp21_, "Custom path is not executable");
					_tmp22_ = self->priv->rpc_row;
					_tmp23_ = custom;
					gtk_widget_set_tooltip_text ((GtkWidget*) _tmp22_, _tmp23_);
				} else {
					AdwActionRow* _tmp24_;
					AdwActionRow* _tmp25_;
					const gchar* _tmp26_;
					_tmp24_ = self->priv->rpc_row;
					adw_action_row_set_subtitle (_tmp24_, "Checking version…");
					_tmp25_ = self->priv->rpc_row;
					_tmp26_ = custom;
					gtk_widget_set_tooltip_text ((GtkWidget*) _tmp25_, _tmp26_);
				}
			}
			break;
		}
		default:
		case DC_RPC_SERVER_SOURCE_AUTO:
		{
			const gchar* _tmp27_ = NULL;
			const gchar* _tmp28_;
			AdwActionRow* _tmp29_;
			const gchar* _tmp30_ = NULL;
			const gchar* _tmp31_;
			AdwActionRow* _tmp32_;
			_tmp28_ = found;
			if (_tmp28_ != NULL) {
				_tmp27_ = "Checking version…";
			} else {
				_tmp27_ = "Chatmail Core not found";
			}
			_tmp29_ = self->priv->rpc_row;
			adw_action_row_set_subtitle (_tmp29_, _tmp27_);
			_tmp31_ = found;
			_tmp30_ = _tmp31_;
			if (_tmp30_ == NULL) {
				_tmp30_ = "Install Chatmail Core or choose a custom binary";
			}
			_tmp32_ = self->priv->rpc_row;
			gtk_widget_set_tooltip_text ((GtkWidget*) _tmp32_, _tmp30_);
			break;
		}
	}
	_tmp33_ = found;
	dc_settings_dialog_update_rpc_version_row (self, _tmp33_, NULL, NULL);
	_g_free0 (found);
	_g_free0 (custom);
}

static void
dc_settings_dialog_update_rpc_version_row_data_free (gpointer _data)
{
	DcSettingsDialogUpdateRpcVersionRowData* _data_;
	_data_ = _data;
	_g_free0 (_data_->rpc_path);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcSettingsDialogUpdateRpcVersionRowData, _data_);
}

static void
dc_settings_dialog_update_rpc_version_row (DcSettingsDialog* self,
                                           const gchar* rpc_path,
                                           GAsyncReadyCallback _callback_,
                                           gpointer _user_data_)
{
	DcSettingsDialogUpdateRpcVersionRowData* _data_;
	DcSettingsDialog* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcSettingsDialogUpdateRpcVersionRowData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_settings_dialog_update_rpc_version_row_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (rpc_path);
	_g_free0 (_data_->rpc_path);
	_data_->rpc_path = _tmp1_;
	dc_settings_dialog_update_rpc_version_row_co (_data_);
}

static void
dc_settings_dialog_update_rpc_version_row_finish (DcSettingsDialog* self,
                                                  GAsyncResult* _res_)
{
	DcSettingsDialogUpdateRpcVersionRowData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dc_settings_dialog_update_rpc_version_row_ready (GObject* source_object,
                                                 GAsyncResult* _res_,
                                                 gpointer _user_data_)
{
	DcSettingsDialogUpdateRpcVersionRowData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_settings_dialog_update_rpc_version_row_co (_data_);
}

static gboolean
dc_settings_dialog_update_rpc_version_row_co (DcSettingsDialogUpdateRpcVersionRowData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->self->priv->rpc_version_request = _data_->self->priv->rpc_version_request + 1;
	_data_->_tmp0_ = _data_->self->priv->rpc_version_request;
	_data_->request_id = _data_->_tmp0_;
	_g_free0 (_data_->self->priv->rpc_current_version);
	_data_->self->priv->rpc_current_version = NULL;
	if (_data_->rpc_path == NULL) {
		_data_->_tmp1_ = TRUE;
	} else {
		_data_->_tmp2_ = strlen (_data_->rpc_path);
		_data_->_tmp3_ = _data_->_tmp2_;
		_data_->_tmp1_ = _data_->_tmp3_ == 0;
	}
	if (_data_->_tmp1_) {
		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;
	}
	{
		_data_->_tmp4_ = g_subprocess_new (G_SUBPROCESS_FLAGS_STDOUT_PIPE | G_SUBPROCESS_FLAGS_STDERR_PIPE, &_data_->_inner_error0_, _data_->rpc_path, "--version", NULL);
		_data_->process = _data_->_tmp4_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_free0 (_data_->stderr_buf);
			_g_free0 (_data_->stdout_buf);
			goto __catch0_g_error;
		}
		_data_->_tmp5_ = _data_->process;
		_data_->_tmp6_ = NULL;
		_data_->_tmp7_ = NULL;
		_data_->_state_ = 1;
		g_subprocess_communicate_utf8_async (_data_->_tmp5_, NULL, NULL, dc_settings_dialog_update_rpc_version_row_ready, _data_);
		return FALSE;
		_state_1:
		g_subprocess_communicate_utf8_finish (_data_->_tmp5_, _data_->_res_, &_data_->_tmp6_, &_data_->_tmp7_, &_data_->_inner_error0_);
		_g_free0 (_data_->stdout_buf);
		_data_->stdout_buf = _data_->_tmp6_;
		_g_free0 (_data_->stderr_buf);
		_data_->stderr_buf = _data_->_tmp7_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->process);
			_g_free0 (_data_->stderr_buf);
			_g_free0 (_data_->stdout_buf);
			goto __catch0_g_error;
		}
		_data_->_tmp8_ = _data_->process;
		_data_->successful = g_subprocess_get_successful (_data_->_tmp8_);
		if (_data_->request_id != _data_->self->priv->rpc_version_request) {
			_g_object_unref0 (_data_->process);
			_g_free0 (_data_->stderr_buf);
			_g_free0 (_data_->stdout_buf);
			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;
		}
		_data_->_tmp11_ = _data_->stdout_buf;
		_data_->_tmp10_ = _data_->_tmp11_;
		if (_data_->_tmp10_ == NULL) {
			_data_->_tmp10_ = "";
		}
		_data_->_tmp12_ = string_strip (_data_->_tmp10_);
		_data_->_tmp13_ = _data_->_tmp12_;
		_data_->_tmp14_ = strlen (_data_->_tmp13_);
		_data_->_tmp15_ = _data_->_tmp14_;
		_data_->_tmp16_ = _data_->_tmp15_ > 0;
		_g_free0 (_data_->_tmp13_);
		if (_data_->_tmp16_) {
			_data_->_tmp18_ = _data_->stdout_buf;
			_data_->_tmp17_ = _data_->_tmp18_;
			if (_data_->_tmp17_ == NULL) {
				_data_->_tmp17_ = "";
			}
			_data_->_tmp19_ = string_strip (_data_->_tmp17_);
			_g_free0 (_data_->_tmp9_);
			_data_->_tmp9_ = _data_->_tmp19_;
		} else {
			_data_->_tmp21_ = _data_->stderr_buf;
			_data_->_tmp20_ = _data_->_tmp21_;
			if (_data_->_tmp20_ == NULL) {
				_data_->_tmp20_ = "";
			}
			_data_->_tmp22_ = string_strip (_data_->_tmp20_);
			_g_free0 (_data_->_tmp9_);
			_data_->_tmp9_ = _data_->_tmp22_;
		}
		_data_->_tmp23_ = _data_->_tmp9_;
		_data_->_tmp9_ = NULL;
		_data_->version = _data_->_tmp23_;
		if (_data_->successful) {
			_data_->_tmp25_ = _data_->version;
			_data_->_tmp26_ = strlen (_data_->_tmp25_);
			_data_->_tmp27_ = _data_->_tmp26_;
			_data_->_tmp24_ = _data_->_tmp27_ > 0;
		} else {
			_data_->_tmp24_ = FALSE;
		}
		if (_data_->_tmp24_) {
			_data_->_tmp28_ = _data_->version;
			_data_->_tmp29_ = dc_rpc_installer_extract_version (_data_->_tmp28_);
			_g_free0 (_data_->self->priv->rpc_current_version);
			_data_->self->priv->rpc_current_version = _data_->_tmp29_;
			_data_->_tmp31_ = _data_->self->priv->rpc_current_version;
			_data_->_tmp30_ = _data_->_tmp31_;
			if (_data_->_tmp30_ == NULL) {
				_data_->_tmp32_ = _data_->version;
				_data_->_tmp30_ = _data_->_tmp32_;
			}
			_data_->_tmp33_ = _data_->self->priv->rpc_row;
			adw_action_row_set_subtitle (_data_->_tmp33_, _data_->_tmp30_);
		} else {
			_data_->_tmp34_ = _data_->self->priv->rpc_row;
			adw_action_row_set_subtitle (_data_->_tmp34_, "Unable to read version");
		}
		_g_free0 (_data_->version);
		_g_free0 (_data_->_tmp9_);
		_g_object_unref0 (_data_->process);
		_g_free0 (_data_->stderr_buf);
		_g_free0 (_data_->stdout_buf);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		if (_data_->request_id != _data_->self->priv->rpc_version_request) {
			_g_error_free0 (_data_->e);
			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;
		}
		_data_->_tmp35_ = _data_->self->priv->rpc_row;
		adw_action_row_set_subtitle (_data_->_tmp35_, "Unable to read version");
		_data_->_tmp36_ = _data_->self->priv->rpc_row;
		_data_->_tmp37_ = _data_->e;
		_data_->_tmp38_ = _data_->_tmp37_->message;
		_data_->_tmp39_ = g_strdup_printf ("%s\n%s", _data_->rpc_path, _data_->_tmp38_);
		_data_->_tmp40_ = _data_->_tmp39_;
		gtk_widget_set_tooltip_text ((GtkWidget*) _data_->_tmp36_, _data_->_tmp40_);
		_g_free0 (_data_->_tmp40_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
dc_settings_dialog_confirm_update_dialog_data_free (gpointer _data)
{
	DcSettingsDialogConfirmUpdateDialogData* _data_;
	_data_ = _data;
	_g_free0 (_data_->title);
	_g_free0 (_data_->body);
	_g_free0 (_data_->action_label);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcSettingsDialogConfirmUpdateDialogData, _data_);
}

static void
dc_settings_dialog_confirm_update_dialog (DcSettingsDialog* self,
                                          const gchar* title,
                                          const gchar* body,
                                          const gchar* action_label,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_)
{
	DcSettingsDialogConfirmUpdateDialogData* _data_;
	DcSettingsDialog* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (title != NULL);
	g_return_if_fail (body != NULL);
	g_return_if_fail (action_label != NULL);
	_data_ = g_slice_new0 (DcSettingsDialogConfirmUpdateDialogData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_settings_dialog_confirm_update_dialog_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (title);
	_g_free0 (_data_->title);
	_data_->title = _tmp1_;
	_tmp2_ = g_strdup (body);
	_g_free0 (_data_->body);
	_data_->body = _tmp2_;
	_tmp3_ = g_strdup (action_label);
	_g_free0 (_data_->action_label);
	_data_->action_label = _tmp3_;
	dc_settings_dialog_confirm_update_dialog_co (_data_);
}

static gboolean
dc_settings_dialog_confirm_update_dialog_finish (DcSettingsDialog* self,
                                                 GAsyncResult* _res_)
{
	gboolean result;
	DcSettingsDialogConfirmUpdateDialogData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
dc_settings_dialog_confirm_update_dialog_ready (GObject* source_object,
                                                GAsyncResult* _res_,
                                                gpointer _user_data_)
{
	DcSettingsDialogConfirmUpdateDialogData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_settings_dialog_confirm_update_dialog_co (_data_);
}

static gboolean
dc_settings_dialog_confirm_update_dialog_co (DcSettingsDialogConfirmUpdateDialogData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = (AdwAlertDialog*) adw_alert_dialog_new (_data_->title, _data_->body);
	g_object_ref_sink (_data_->_tmp0_);
	_data_->d = _data_->_tmp0_;
	adw_alert_dialog_add_response (_data_->d, "dismiss", "Dismiss");
	adw_alert_dialog_add_response (_data_->d, "update", _data_->action_label);
	adw_alert_dialog_set_response_appearance (_data_->d, "update", ADW_RESPONSE_SUGGESTED);
	adw_alert_dialog_set_default_response (_data_->d, "update");
	adw_alert_dialog_set_close_response (_data_->d, "dismiss");
	_data_->_tmp1_ = _data_->self->priv->app_window;
	_data_->_state_ = 1;
	adw_alert_dialog_choose (_data_->d, (GtkWidget*) _data_->_tmp1_, NULL, dc_settings_dialog_confirm_update_dialog_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp2_ = adw_alert_dialog_choose_finish (_data_->d, _data_->_res_);
	_data_->result = g_strcmp0 (_data_->_tmp2_, "update") == 0;
	_g_object_unref0 (_data_->d);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

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

static void
dc_settings_dialog_check_rpc_updates (DcSettingsDialog* self,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_)
{
	DcSettingsDialogCheckRpcUpdatesData* _data_;
	DcSettingsDialog* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcSettingsDialogCheckRpcUpdatesData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_settings_dialog_check_rpc_updates_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	dc_settings_dialog_check_rpc_updates_co (_data_);
}

static void
dc_settings_dialog_check_rpc_updates_finish (DcSettingsDialog* self,
                                             GAsyncResult* _res_)
{
	DcSettingsDialogCheckRpcUpdatesData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dc_settings_dialog_check_rpc_updates_ready (GObject* source_object,
                                            GAsyncResult* _res_,
                                            gpointer _user_data_)
{
	DcSettingsDialogCheckRpcUpdatesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_settings_dialog_check_rpc_updates_co (_data_);
}

static gboolean
dc_settings_dialog_check_rpc_updates_co (DcSettingsDialogCheckRpcUpdatesData* _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;
		case 5:
		goto _state_5;
		case 6:
		goto _state_6;
		case 7:
		goto _state_7;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp1_ = _data_->self->priv->rpc_check_btn;
	if (_data_->_tmp1_ == NULL) {
		_data_->_tmp0_ = TRUE;
	} else {
		_data_->_tmp2_ = _data_->self->priv->rpc_check_btn;
		_data_->_tmp3_ = gtk_widget_get_sensitive ((GtkWidget*) _data_->_tmp2_);
		_data_->_tmp4_ = _data_->_tmp3_;
		_data_->_tmp0_ = !_data_->_tmp4_;
	}
	if (_data_->_tmp0_) {
		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;
	}
	_data_->_tmp5_ = _data_->self->priv->rpc_check_btn;
	gtk_widget_set_sensitive ((GtkWidget*) _data_->_tmp5_, FALSE);
	_data_->_tmp6_ = _data_->self->priv->rpc_row;
	_data_->_tmp7_ = adw_action_row_get_subtitle (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = g_strdup (_data_->_tmp8_);
	_data_->previous_subtitle = _data_->_tmp9_;
	_data_->_tmp10_ = _data_->self->priv->rpc_row;
	adw_action_row_set_subtitle (_data_->_tmp10_, "Checking for updates…");
	{
		_data_->_state_ = 1;
		dc_rpc_installer_fetch_latest_tag (dc_settings_dialog_check_rpc_updates_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp11_ = dc_rpc_installer_fetch_latest_tag_finish (_data_->_res_, &_data_->_inner_error0_);
		_data_->latest_tag = _data_->_tmp11_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_tmp12_ = _data_->latest_tag;
		_data_->_tmp13_ = dc_rpc_installer_extract_version (_data_->_tmp12_);
		_data_->latest_version = _data_->_tmp13_;
		_data_->_tmp14_ = _data_->self->priv->rpc_row;
		_data_->_tmp15_ = _data_->previous_subtitle;
		adw_action_row_set_subtitle (_data_->_tmp14_, _data_->_tmp15_);
		_data_->_tmp16_ = _data_->latest_version;
		if (_data_->_tmp16_ == NULL) {
			_data_->_tmp17_ = _data_->self->priv->app_window;
			dc_window_show_toast (_data_->_tmp17_, "Could not parse the latest Chatmail Core version");
			_g_free0 (_data_->latest_version);
			_g_free0 (_data_->latest_tag);
			{
				_data_->_tmp18_ = _data_->self->priv->rpc_check_btn;
				gtk_widget_set_sensitive ((GtkWidget*) _data_->_tmp18_, !dc_settings_manager_rpc_server_path_is_fixed ());
			}
			_g_free0 (_data_->previous_subtitle);
			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;
		}
		_data_->_tmp20_ = _data_->self->priv->rpc_current_version;
		if (_data_->_tmp20_ != NULL) {
			_data_->_tmp21_ = _data_->self->priv->rpc_current_version;
			_data_->_tmp22_ = _data_->latest_version;
			_data_->_tmp19_ = g_strcmp0 (_data_->_tmp21_, _data_->_tmp22_) == 0;
		} else {
			_data_->_tmp19_ = FALSE;
		}
		if (_data_->_tmp19_) {
			_data_->_tmp23_ = _data_->self->priv->app_window;
			_data_->_tmp24_ = _data_->latest_version;
			_data_->_tmp25_ = g_strconcat ("Chatmail Core is up to date: ", _data_->_tmp24_, NULL);
			_data_->_tmp26_ = _data_->_tmp25_;
			dc_window_show_toast (_data_->_tmp23_, _data_->_tmp26_);
			_g_free0 (_data_->_tmp26_);
			_g_free0 (_data_->latest_version);
			_g_free0 (_data_->latest_tag);
			{
				_data_->_tmp27_ = _data_->self->priv->rpc_check_btn;
				gtk_widget_set_sensitive ((GtkWidget*) _data_->_tmp27_, !dc_settings_manager_rpc_server_path_is_fixed ());
			}
			_g_free0 (_data_->previous_subtitle);
			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;
		}
		_data_->_tmp28_ = _data_->self->priv->app_window;
		_data_->_tmp29_ = _data_->_tmp28_->settings;
		_data_->_tmp30_ = dc_settings_manager_effective_rpc_server_path (_data_->_tmp29_);
		_data_->_tmp31_ = _data_->_tmp30_;
		_data_->_tmp32_ = _data_->self->priv->app_window;
		_data_->_tmp33_ = _data_->_tmp32_->settings;
		_data_->_tmp34_ = dc_account_finder_find_rpc_server (_data_->_tmp31_, dc_settings_manager_effective_rpc_server_source (_data_->_tmp33_));
		_data_->_tmp35_ = _data_->_tmp34_;
		_data_->_tmp36_ = dc_account_finder_get_managed_rpc_path ();
		_data_->_tmp37_ = _data_->_tmp36_;
		_data_->_tmp38_ = g_strcmp0 (_data_->_tmp35_, _data_->_tmp37_) == 0;
		_g_free0 (_data_->_tmp37_);
		_g_free0 (_data_->_tmp35_);
		_g_free0 (_data_->_tmp31_);
		_data_->managed_active = _data_->_tmp38_;
		if (!_data_->managed_active) {
			_data_->_tmp40_ = _data_->self->priv->rpc_current_version;
			_data_->_tmp39_ = _data_->_tmp40_ != NULL;
		} else {
			_data_->_tmp39_ = FALSE;
		}
		if (_data_->_tmp39_) {
			_data_->_tmp41_ = _data_->latest_version;
			_data_->_tmp42_ = g_strdup_printf ("Chatmail Core %s is available. Parla doesn't manage the active binary," \
" so open its release page to update it manually.", _data_->_tmp41_);
			_data_->_tmp43_ = _data_->_tmp42_;
			_data_->_state_ = 2;
			dc_settings_dialog_confirm_update_dialog (_data_->self, "Update Available", _data_->_tmp43_, "View Release", dc_settings_dialog_check_rpc_updates_ready, _data_);
			return FALSE;
			_state_2:
			_data_->_tmp44_ = dc_settings_dialog_confirm_update_dialog_finish (_data_->self, _data_->_res_);
			_g_free0 (_data_->_tmp43_);
			if (_data_->_tmp44_) {
				_data_->_state_ = 3;
				dc_settings_dialog_open_rpc_download_page (_data_->self, dc_settings_dialog_check_rpc_updates_ready, _data_);
				return FALSE;
				_state_3:
				dc_settings_dialog_open_rpc_download_page_finish (_data_->self, _data_->_res_);
			}
			_g_free0 (_data_->latest_version);
			_g_free0 (_data_->latest_tag);
			{
				_data_->_tmp45_ = _data_->self->priv->rpc_check_btn;
				gtk_widget_set_sensitive ((GtkWidget*) _data_->_tmp45_, !dc_settings_manager_rpc_server_path_is_fixed ());
			}
			_g_free0 (_data_->previous_subtitle);
			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;
		}
		if (!dc_rpc_installer_can_auto_install ()) {
			_data_->_tmp46_ = _data_->latest_version;
			_data_->_tmp47_ = g_strdup_printf ("Chatmail Core %s is available, but no prebuilt binary exists for this " \
"platform.", _data_->_tmp46_);
			_data_->_tmp48_ = _data_->_tmp47_;
			_data_->_state_ = 4;
			dc_settings_dialog_confirm_update_dialog (_data_->self, "Update Available", _data_->_tmp48_, "View Release", dc_settings_dialog_check_rpc_updates_ready, _data_);
			return FALSE;
			_state_4:
			_data_->_tmp49_ = dc_settings_dialog_confirm_update_dialog_finish (_data_->self, _data_->_res_);
			_g_free0 (_data_->_tmp48_);
			if (_data_->_tmp49_) {
				_data_->_state_ = 5;
				dc_settings_dialog_open_rpc_download_page (_data_->self, dc_settings_dialog_check_rpc_updates_ready, _data_);
				return FALSE;
				_state_5:
				dc_settings_dialog_open_rpc_download_page_finish (_data_->self, _data_->_res_);
			}
			_g_free0 (_data_->latest_version);
			_g_free0 (_data_->latest_tag);
			{
				_data_->_tmp50_ = _data_->self->priv->rpc_check_btn;
				gtk_widget_set_sensitive ((GtkWidget*) _data_->_tmp50_, !dc_settings_manager_rpc_server_path_is_fixed ());
			}
			_g_free0 (_data_->previous_subtitle);
			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;
		}
		_data_->_tmp52_ = _data_->self->priv->rpc_current_version;
		if (_data_->_tmp52_ == NULL) {
			_data_->_tmp53_ = _data_->latest_version;
			_data_->_tmp54_ = g_strdup_printf ("Chatmail Core %s is available to install.", _data_->_tmp53_);
			_g_free0 (_data_->_tmp51_);
			_data_->_tmp51_ = _data_->_tmp54_;
		} else {
			_data_->_tmp55_ = _data_->latest_version;
			_data_->_tmp56_ = _data_->self->priv->rpc_current_version;
			_data_->_tmp57_ = g_strdup_printf ("Chatmail Core %s is available (installed: %s).", _data_->_tmp55_, _data_->_tmp56_);
			_g_free0 (_data_->_tmp51_);
			_data_->_tmp51_ = _data_->_tmp57_;
		}
		_data_->_tmp58_ = _data_->_tmp51_;
		_data_->_tmp51_ = NULL;
		_data_->body = _data_->_tmp58_;
		_data_->_tmp60_ = _data_->self->priv->rpc_current_version;
		if (_data_->_tmp60_ == NULL) {
			_data_->_tmp59_ = "Install";
		} else {
			_data_->_tmp59_ = "Update";
		}
		_data_->_tmp61_ = _data_->body;
		_data_->_state_ = 6;
		dc_settings_dialog_confirm_update_dialog (_data_->self, "Update Available", _data_->_tmp61_, _data_->_tmp59_, dc_settings_dialog_check_rpc_updates_ready, _data_);
		return FALSE;
		_state_6:
		if (dc_settings_dialog_confirm_update_dialog_finish (_data_->self, _data_->_res_)) {
			_data_->_state_ = 7;
			dc_settings_dialog_install_managed_server (_data_->self, dc_settings_dialog_check_rpc_updates_ready, _data_);
			return FALSE;
			_state_7:
			dc_settings_dialog_install_managed_server_finish (_data_->self, _data_->_res_);
		}
		_g_free0 (_data_->body);
		_g_free0 (_data_->_tmp51_);
		_g_free0 (_data_->latest_version);
		_g_free0 (_data_->latest_tag);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp62_ = _data_->self->priv->rpc_row;
		_data_->_tmp63_ = _data_->previous_subtitle;
		adw_action_row_set_subtitle (_data_->_tmp62_, _data_->_tmp63_);
		_data_->_tmp64_ = _data_->self->priv->app_window;
		_data_->_tmp65_ = _data_->e;
		_data_->_tmp66_ = _data_->_tmp65_->message;
		_data_->_tmp67_ = g_strconcat ("Update check failed: ", _data_->_tmp66_, NULL);
		_data_->_tmp68_ = _data_->_tmp67_;
		dc_window_show_toast (_data_->_tmp64_, _data_->_tmp68_);
		_g_free0 (_data_->_tmp68_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	{
		_data_->_tmp69_ = _data_->self->priv->rpc_check_btn;
		gtk_widget_set_sensitive ((GtkWidget*) _data_->_tmp69_, !dc_settings_manager_rpc_server_path_is_fixed ());
	}
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_free0 (_data_->previous_subtitle);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_g_free0 (_data_->previous_subtitle);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
dc_settings_dialog_sync_rpc_source_dropdown (DcSettingsDialog* self)
{
	AdwComboRow* _tmp0_;
	DcWindow* _tmp1_;
	DcSettingsManager* _tmp2_;
	g_return_if_fail (self != NULL);
	self->priv->syncing_rpc_source = TRUE;
	_tmp0_ = self->priv->rpc_source_dropdown;
	_tmp1_ = self->priv->app_window;
	_tmp2_ = _tmp1_->settings;
	adw_combo_row_set_selected (_tmp0_, (guint) dc_settings_manager_effective_rpc_server_source (_tmp2_));
	self->priv->syncing_rpc_source = FALSE;
}

static void
dc_settings_dialog_on_rpc_source_changed (DcSettingsDialog* self)
{
	DcRpcServerSource source = 0;
	AdwComboRow* _tmp0_;
	guint _tmp1_;
	guint _tmp2_;
	gboolean _tmp3_ = FALSE;
	DcWindow* _tmp10_;
	DcSettingsManager* _tmp11_;
	DcWindow* _tmp12_;
	DcWindow* _tmp13_;
	g_return_if_fail (self != NULL);
	if (self->priv->syncing_rpc_source) {
		return;
	}
	_tmp0_ = self->priv->rpc_source_dropdown;
	_tmp1_ = adw_combo_row_get_selected (_tmp0_);
	_tmp2_ = _tmp1_;
	source = (DcRpcServerSource) _tmp2_;
	if (source == DC_RPC_SERVER_SOURCE_CUSTOM) {
		DcWindow* _tmp4_;
		DcSettingsManager* _tmp5_;
		const gchar* _tmp6_;
		const gchar* _tmp7_;
		gint _tmp8_;
		gint _tmp9_;
		_tmp4_ = self->priv->app_window;
		_tmp5_ = _tmp4_->settings;
		_tmp6_ = dc_settings_manager_get_rpc_server_path (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp8_ = strlen (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp3_ = _tmp9_ == 0;
	} else {
		_tmp3_ = FALSE;
	}
	if (_tmp3_) {
		dc_settings_dialog_on_browse_rpc_server (self, NULL, NULL);
		return;
	}
	_tmp10_ = self->priv->app_window;
	_tmp11_ = _tmp10_->settings;
	dc_settings_manager_save_rpc_server_source (_tmp11_, source);
	_tmp12_ = self->priv->app_window;
	dc_window_show_toast (_tmp12_, "Chatmail Core source saved");
	dc_settings_dialog_update_rpc_row (self);
	_tmp13_ = self->priv->app_window;
	dc_window_reconnect_rpc_server (_tmp13_, NULL, NULL);
}

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

static void
dc_settings_dialog_on_browse_rpc_server (DcSettingsDialog* self,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_)
{
	DcSettingsDialogOnBrowseRpcServerData* _data_;
	DcSettingsDialog* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcSettingsDialogOnBrowseRpcServerData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_settings_dialog_on_browse_rpc_server_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	dc_settings_dialog_on_browse_rpc_server_co (_data_);
}

static void
dc_settings_dialog_on_browse_rpc_server_finish (DcSettingsDialog* self,
                                                GAsyncResult* _res_)
{
	DcSettingsDialogOnBrowseRpcServerData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dc_settings_dialog_on_browse_rpc_server_ready (GObject* source_object,
                                               GAsyncResult* _res_,
                                               gpointer _user_data_)
{
	DcSettingsDialogOnBrowseRpcServerData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_settings_dialog_on_browse_rpc_server_co (_data_);
}

static gboolean
dc_settings_dialog_on_browse_rpc_server_co (DcSettingsDialogOnBrowseRpcServerData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = gtk_file_dialog_new ();
	_data_->dlg = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->dlg;
	gtk_file_dialog_set_title (_data_->_tmp1_, "Locate a Chatmail Core binary");
	_data_->_tmp2_ = _data_->dlg;
	gtk_file_dialog_set_modal (_data_->_tmp2_, TRUE);
	_data_->_tmp3_ = _data_->self->priv->app_window;
	_data_->_tmp4_ = _data_->_tmp3_->settings;
	_data_->_tmp5_ = dc_settings_manager_get_rpc_server_path (_data_->_tmp4_);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = g_strdup (_data_->_tmp6_);
	_data_->start = _data_->_tmp7_;
	_data_->_tmp8_ = _data_->start;
	_data_->_tmp9_ = strlen (_data_->_tmp8_);
	_data_->_tmp10_ = _data_->_tmp9_;
	if (_data_->_tmp10_ == 0) {
		_data_->_tmp12_ = dc_account_finder_find_rpc_server (NULL, DC_RPC_SERVER_SOURCE_AUTO);
		_data_->_tmp11_ = _data_->_tmp12_;
		if (_data_->_tmp11_ == NULL) {
			_data_->_tmp13_ = g_strdup ("");
			_g_free0 (_data_->_tmp11_);
			_data_->_tmp11_ = _data_->_tmp13_;
		}
		_data_->_tmp14_ = _data_->_tmp11_;
		_data_->_tmp11_ = NULL;
		_g_free0 (_data_->start);
		_data_->start = _data_->_tmp14_;
		_g_free0 (_data_->_tmp11_);
	}
	_data_->_tmp15_ = _data_->start;
	_data_->_tmp16_ = strlen (_data_->_tmp15_);
	_data_->_tmp17_ = _data_->_tmp16_;
	if (_data_->_tmp17_ > 0) {
		_data_->_tmp18_ = _data_->dlg;
		_data_->_tmp19_ = _data_->start;
		_data_->_tmp20_ = g_file_new_for_path (_data_->_tmp19_);
		_data_->_tmp21_ = _data_->_tmp20_;
		gtk_file_dialog_set_initial_file (_data_->_tmp18_, _data_->_tmp21_);
		_g_object_unref0 (_data_->_tmp21_);
	}
	{
		_data_->_tmp22_ = _data_->dlg;
		_data_->_tmp23_ = _data_->self->priv->app_window;
		_data_->_state_ = 1;
		gtk_file_dialog_open (_data_->_tmp22_, (GtkWindow*) _data_->_tmp23_, NULL, dc_settings_dialog_on_browse_rpc_server_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp24_ = gtk_file_dialog_open_finish (_data_->_tmp22_, _data_->_res_, &_data_->_inner_error0_);
		_data_->file = _data_->_tmp24_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		if (_data_->file != NULL) {
			_data_->_tmp25_ = g_file_get_path (_data_->file);
			_data_->path = _data_->_tmp25_;
			_data_->_tmp27_ = _data_->path;
			if (_data_->_tmp27_ != NULL) {
				_data_->_tmp28_ = _data_->path;
				_data_->_tmp26_ = g_file_test (_data_->_tmp28_, G_FILE_TEST_IS_EXECUTABLE);
			} else {
				_data_->_tmp26_ = FALSE;
			}
			if (_data_->_tmp26_) {
				_data_->_tmp29_ = _data_->self->priv->app_window;
				_data_->_tmp30_ = _data_->_tmp29_->settings;
				_data_->_tmp31_ = _data_->path;
				dc_settings_manager_save_rpc_server_path (_data_->_tmp30_, _data_->_tmp31_);
				_data_->_tmp32_ = _data_->self->priv->app_window;
				_data_->_tmp33_ = _data_->_tmp32_->settings;
				dc_settings_manager_save_rpc_server_source (_data_->_tmp33_, DC_RPC_SERVER_SOURCE_CUSTOM);
				dc_settings_dialog_sync_rpc_source_dropdown (_data_->self);
				_data_->_tmp34_ = _data_->self->priv->app_window;
				dc_window_show_toast (_data_->_tmp34_, "Chatmail Core binary saved");
				_data_->_tmp35_ = _data_->self->priv->app_window;
				dc_window_reconnect_rpc_server (_data_->_tmp35_, NULL, NULL);
			} else {
				_data_->_tmp36_ = _data_->self->priv->app_window;
				dc_show_error ((GtkWidget*) _data_->_tmp36_, "Selected file is not an executable binary.");
			}
			_g_free0 (_data_->path);
		}
		_g_object_unref0 (_data_->file);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp37_ = _data_->e;
		if (!dc_is_dialog_dismissal (_data_->_tmp37_)) {
			_data_->_tmp38_ = _data_->self->priv->app_window;
			_data_->_tmp39_ = _data_->e;
			_data_->_tmp40_ = _data_->_tmp39_->message;
			dc_show_error ((GtkWidget*) _data_->_tmp38_, _data_->_tmp40_);
		}
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_free0 (_data_->start);
		_g_object_unref0 (_data_->dlg);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	dc_settings_dialog_update_rpc_row (_data_->self);
	_g_free0 (_data_->start);
	_g_object_unref0 (_data_->dlg);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
dc_settings_dialog_sync_accounts_path_row (DcSettingsDialog* self)
{
	gchar* path = NULL;
	DcWindow* _tmp0_;
	DcSettingsManager* _tmp1_;
	gchar* _tmp2_;
	AdwActionRow* _tmp3_;
	AdwActionRow* _tmp4_;
	GtkButton* _tmp5_;
	DcWindow* _tmp6_;
	DcSettingsManager* _tmp7_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->app_window;
	_tmp1_ = _tmp0_->settings;
	_tmp2_ = dc_settings_manager_effective_accounts_path (_tmp1_);
	path = _tmp2_;
	_tmp3_ = self->priv->accounts_path_row;
	adw_action_row_set_subtitle (_tmp3_, path);
	_tmp4_ = self->priv->accounts_path_row;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp4_, path);
	_tmp5_ = self->priv->accounts_path_reset_btn;
	_tmp6_ = self->priv->app_window;
	_tmp7_ = _tmp6_->settings;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp5_, !dc_settings_manager_uses_default_accounts_path (_tmp7_));
	_g_free0 (path);
}

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

static void
dc_settings_dialog_on_browse_accounts_path (DcSettingsDialog* self,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_)
{
	DcSettingsDialogOnBrowseAccountsPathData* _data_;
	DcSettingsDialog* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcSettingsDialogOnBrowseAccountsPathData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_settings_dialog_on_browse_accounts_path_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	dc_settings_dialog_on_browse_accounts_path_co (_data_);
}

static void
dc_settings_dialog_on_browse_accounts_path_finish (DcSettingsDialog* self,
                                                   GAsyncResult* _res_)
{
	DcSettingsDialogOnBrowseAccountsPathData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dc_settings_dialog_on_browse_accounts_path_ready (GObject* source_object,
                                                  GAsyncResult* _res_,
                                                  gpointer _user_data_)
{
	DcSettingsDialogOnBrowseAccountsPathData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_settings_dialog_on_browse_accounts_path_co (_data_);
}

static gboolean
dc_settings_dialog_on_browse_accounts_path_co (DcSettingsDialogOnBrowseAccountsPathData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = gtk_file_dialog_new ();
	_data_->dlg = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->dlg;
	gtk_file_dialog_set_title (_data_->_tmp1_, "Choose accounts folder");
	_data_->_tmp2_ = _data_->dlg;
	gtk_file_dialog_set_modal (_data_->_tmp2_, TRUE);
	_data_->_tmp3_ = _data_->self->priv->app_window;
	_data_->_tmp4_ = _data_->_tmp3_->settings;
	_data_->_tmp5_ = dc_settings_manager_effective_accounts_path (_data_->_tmp4_);
	_data_->path = _data_->_tmp5_;
	_data_->_tmp6_ = _data_->path;
	if (g_file_test (_data_->_tmp6_, G_FILE_TEST_IS_DIR)) {
		_data_->_tmp7_ = _data_->dlg;
		_data_->_tmp8_ = _data_->path;
		_data_->_tmp9_ = g_file_new_for_path (_data_->_tmp8_);
		_data_->_tmp10_ = _data_->_tmp9_;
		gtk_file_dialog_set_initial_folder (_data_->_tmp7_, _data_->_tmp10_);
		_g_object_unref0 (_data_->_tmp10_);
	}
	{
		_data_->_tmp11_ = _data_->dlg;
		_data_->_tmp12_ = _data_->self->priv->app_window;
		_data_->_state_ = 1;
		gtk_file_dialog_select_folder (_data_->_tmp11_, (GtkWindow*) _data_->_tmp12_, NULL, dc_settings_dialog_on_browse_accounts_path_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp13_ = gtk_file_dialog_select_folder_finish (_data_->_tmp11_, _data_->_res_, &_data_->_inner_error0_);
		_data_->folder = _data_->_tmp13_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		if (_data_->folder != NULL) {
			_data_->_tmp14_ = g_file_get_path (_data_->folder);
			_data_->selected_path = _data_->_tmp14_;
			_data_->_tmp15_ = _data_->selected_path;
			if (_data_->_tmp15_ != NULL) {
				_data_->_tmp16_ = _data_->self->priv->app_window;
				_data_->_tmp17_ = _data_->_tmp16_->settings;
				_data_->_tmp18_ = _data_->selected_path;
				dc_settings_manager_save_accounts_path (_data_->_tmp17_, _data_->_tmp18_);
				dc_settings_dialog_sync_accounts_path_row (_data_->self);
				_data_->_tmp19_ = _data_->self->priv->app_window;
				dc_window_show_toast (_data_->_tmp19_, "Accounts path saved");
				_data_->_tmp20_ = _data_->self->priv->app_window;
				dc_window_reconnect_rpc_server (_data_->_tmp20_, NULL, NULL);
			}
			_g_free0 (_data_->selected_path);
		}
		_g_object_unref0 (_data_->folder);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp21_ = _data_->e;
		if (!dc_is_dialog_dismissal (_data_->_tmp21_)) {
			_data_->_tmp22_ = _data_->self->priv->app_window;
			_data_->_tmp23_ = _data_->e;
			_data_->_tmp24_ = _data_->_tmp23_->message;
			dc_show_error ((GtkWidget*) _data_->_tmp22_, _data_->_tmp24_);
		}
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_free0 (_data_->path);
		_g_object_unref0 (_data_->dlg);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_g_free0 (_data_->path);
	_g_object_unref0 (_data_->dlg);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

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

static void
dc_settings_dialog_install_managed_server (DcSettingsDialog* self,
                                           GAsyncReadyCallback _callback_,
                                           gpointer _user_data_)
{
	DcSettingsDialogInstallManagedServerData* _data_;
	DcSettingsDialog* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcSettingsDialogInstallManagedServerData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_settings_dialog_install_managed_server_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	dc_settings_dialog_install_managed_server_co (_data_);
}

static void
dc_settings_dialog_install_managed_server_finish (DcSettingsDialog* self,
                                                  GAsyncResult* _res_)
{
	DcSettingsDialogInstallManagedServerData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dc_settings_dialog_install_managed_server_ready (GObject* source_object,
                                                 GAsyncResult* _res_,
                                                 gpointer _user_data_)
{
	DcSettingsDialogInstallManagedServerData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_settings_dialog_install_managed_server_co (_data_);
}

static void
__lambda371_ (DcSettingsDialog* self,
              gint64 received,
              gint64 total)
{
	if (total > ((gint64) 0)) {
		AdwActionRow* _tmp0_;
		gchar* _tmp1_;
		gchar* _tmp2_;
		_tmp0_ = self->priv->rpc_row;
		_tmp1_ = g_strdup_printf ("Downloading… %.0f%%", (((gdouble) received) / ((gdouble) total)) * 100.0);
		_tmp2_ = _tmp1_;
		adw_action_row_set_subtitle (_tmp0_, _tmp2_);
		_g_free0 (_tmp2_);
	} else {
		AdwActionRow* _tmp3_;
		gchar* _tmp4_;
		gchar* _tmp5_;
		_tmp3_ = self->priv->rpc_row;
		_tmp4_ = g_strdup_printf ("Downloading… %.1f MB", received / 1048576.0);
		_tmp5_ = _tmp4_;
		adw_action_row_set_subtitle (_tmp3_, _tmp5_);
		_g_free0 (_tmp5_);
	}
}

static void
___lambda371__dc_rpc_installer_progress (DcRpcInstaller* _sender,
                                         gint64 received,
                                         gint64 total,
                                         gpointer self)
{
	__lambda371_ ((DcSettingsDialog*) self, received, total);
}

static gboolean
dc_settings_dialog_install_managed_server_co (DcSettingsDialogInstallManagedServerData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (!dc_rpc_installer_can_auto_install ()) {
		_data_->_state_ = 1;
		dc_settings_dialog_open_rpc_download_page (_data_->self, dc_settings_dialog_install_managed_server_ready, _data_);
		return FALSE;
		_state_1:
		dc_settings_dialog_open_rpc_download_page_finish (_data_->self, _data_->_res_);
		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;
	}
	_data_->_tmp0_ = _data_->self->priv->rpc_check_btn;
	gtk_widget_set_sensitive ((GtkWidget*) _data_->_tmp0_, FALSE);
	_data_->_tmp1_ = _data_->self->priv->rpc_row;
	_data_->_tmp2_ = adw_action_row_get_subtitle (_data_->_tmp1_);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = g_strdup (_data_->_tmp3_);
	_data_->prev_subtitle = _data_->_tmp4_;
	_data_->_tmp5_ = dc_rpc_installer_new ();
	_data_->installer = _data_->_tmp5_;
	_data_->_tmp6_ = _data_->installer;
	g_signal_connect_object (_data_->_tmp6_, "progress", (GCallback) ___lambda371__dc_rpc_installer_progress, _data_->self, 0);
	{
		_data_->_tmp7_ = _data_->installer;
		_data_->_state_ = 2;
		dc_rpc_installer_download_latest (_data_->_tmp7_, dc_settings_dialog_install_managed_server_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp8_ = dc_rpc_installer_download_latest_finish (_data_->_tmp7_, _data_->_res_, &_data_->_inner_error0_);
		_data_->_tmp9_ = _data_->_tmp8_;
		_g_free0 (_data_->_tmp9_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_tmp10_ = _data_->self->priv->app_window;
		_data_->_tmp11_ = _data_->_tmp10_->settings;
		_data_->_tmp12_ = dc_settings_manager_get_rpc_server_source (_data_->_tmp11_);
		_data_->_tmp13_ = _data_->_tmp12_;
		if (_data_->_tmp13_ != DC_RPC_SERVER_SOURCE_AUTO) {
			_data_->_tmp14_ = _data_->self->priv->app_window;
			_data_->_tmp15_ = _data_->_tmp14_->settings;
			dc_settings_manager_save_rpc_server_source (_data_->_tmp15_, DC_RPC_SERVER_SOURCE_AUTO);
			dc_settings_dialog_sync_rpc_source_dropdown (_data_->self);
		}
		_data_->_tmp16_ = _data_->self->priv->app_window;
		dc_window_show_toast (_data_->_tmp16_, "Chatmail Core installed");
		_data_->_tmp17_ = _data_->self->priv->app_window;
		_data_->_state_ = 3;
		dc_window_reconnect_rpc_server (_data_->_tmp17_, dc_settings_dialog_install_managed_server_ready, _data_);
		return FALSE;
		_state_3:
		dc_window_reconnect_rpc_server_finish (_data_->_tmp17_, _data_->_res_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp18_ = _data_->self->priv->rpc_row;
		_data_->_tmp19_ = _data_->prev_subtitle;
		adw_action_row_set_subtitle (_data_->_tmp18_, _data_->_tmp19_);
		_data_->_tmp20_ = _data_->self->priv->app_window;
		_data_->_tmp21_ = _data_->e;
		_data_->_tmp22_ = _data_->_tmp21_->message;
		_data_->_tmp23_ = g_strconcat ("Download failed: ", _data_->_tmp22_, NULL);
		_data_->_tmp24_ = _data_->_tmp23_;
		dc_window_show_toast (_data_->_tmp20_, _data_->_tmp24_);
		_g_free0 (_data_->_tmp24_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	{
		_data_->_tmp25_ = _data_->self->priv->rpc_check_btn;
		gtk_widget_set_sensitive ((GtkWidget*) _data_->_tmp25_, !dc_settings_manager_rpc_server_path_is_fixed ());
	}
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_object_unref0 (_data_->installer);
		_g_free0 (_data_->prev_subtitle);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	dc_settings_dialog_update_rpc_row (_data_->self);
	_g_object_unref0 (_data_->installer);
	_g_free0 (_data_->prev_subtitle);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

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

static void
dc_settings_dialog_open_rpc_download_page (DcSettingsDialog* self,
                                           GAsyncReadyCallback _callback_,
                                           gpointer _user_data_)
{
	DcSettingsDialogOpenRpcDownloadPageData* _data_;
	DcSettingsDialog* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcSettingsDialogOpenRpcDownloadPageData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_settings_dialog_open_rpc_download_page_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	dc_settings_dialog_open_rpc_download_page_co (_data_);
}

static void
dc_settings_dialog_open_rpc_download_page_finish (DcSettingsDialog* self,
                                                  GAsyncResult* _res_)
{
	DcSettingsDialogOpenRpcDownloadPageData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dc_settings_dialog_open_rpc_download_page_ready (GObject* source_object,
                                                 GAsyncResult* _res_,
                                                 gpointer _user_data_)
{
	DcSettingsDialogOpenRpcDownloadPageData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_settings_dialog_open_rpc_download_page_co (_data_);
}

static gboolean
dc_settings_dialog_open_rpc_download_page_co (DcSettingsDialogOpenRpcDownloadPageData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		_data_->_tmp0_ = gtk_uri_launcher_new ("https://github.com/chatmail/core/releases/latest");
		_data_->_tmp1_ = _data_->_tmp0_;
		_data_->_tmp2_ = _data_->self->priv->app_window;
		_data_->_state_ = 1;
		gtk_uri_launcher_launch (_data_->_tmp1_, (GtkWindow*) _data_->_tmp2_, NULL, dc_settings_dialog_open_rpc_download_page_ready, _data_);
		return FALSE;
		_state_1:
		gtk_uri_launcher_launch_finish (_data_->_tmp1_, _data_->_res_, &_data_->_inner_error0_);
		_g_object_unref0 (_data_->_tmp1_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp3_ = _data_->self->priv->app_window;
		_data_->_tmp4_ = _data_->e;
		_data_->_tmp5_ = _data_->_tmp4_->message;
		_data_->_tmp6_ = g_strconcat ("Unable to open download page: ", _data_->_tmp5_, NULL);
		_data_->_tmp7_ = _data_->_tmp6_;
		dc_show_error ((GtkWidget*) _data_->_tmp3_, _data_->_tmp7_);
		_g_free0 (_data_->_tmp7_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

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

static void
dc_settings_dialog_on_reset_settings (DcSettingsDialog* self,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_)
{
	DcSettingsDialogOnResetSettingsData* _data_;
	DcSettingsDialog* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcSettingsDialogOnResetSettingsData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_settings_dialog_on_reset_settings_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	dc_settings_dialog_on_reset_settings_co (_data_);
}

static void
dc_settings_dialog_on_reset_settings_finish (DcSettingsDialog* self,
                                             GAsyncResult* _res_)
{
	DcSettingsDialogOnResetSettingsData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dc_settings_dialog_on_reset_settings_ready (GObject* source_object,
                                            GAsyncResult* _res_,
                                            gpointer _user_data_)
{
	DcSettingsDialogOnResetSettingsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_settings_dialog_on_reset_settings_co (_data_);
}

static gboolean
dc_settings_dialog_on_reset_settings_co (DcSettingsDialogOnResetSettingsData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->app_window;
	_data_->_state_ = 1;
	dc_confirm_action ((GtkWidget*) _data_->_tmp0_, "Factory Reset", "This will delete all Parla configuration files and close the applicati" \
"on. " "Your Delta Chat accounts and messages are not affected.", "reset", "Reset & Close", dc_settings_dialog_on_reset_settings_ready, _data_);
	return FALSE;
	_state_1:
	if (dc_confirm_action_finish (_data_->_res_)) {
		dc_settings_dialog_delete_parla_config ();
		_data_->_tmp1_ = _data_->self->priv->app_window;
		dc_window_quit_application (_data_->_tmp1_);
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
dc_settings_dialog_apply_background (DcSettingsDialog* self)
{
	DcWindow* _tmp0_;
	GtkApplication* _tmp1_;
	GtkApplication* _tmp2_;
	DcWindow* _tmp3_;
	DcSettingsManager* _tmp4_;
	DcBackgroundMode _tmp5_;
	DcBackgroundMode _tmp6_;
	DcWindow* _tmp7_;
	DcSettingsManager* _tmp8_;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->app_window;
	_tmp1_ = gtk_window_get_application ((GtkWindow*) _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = self->priv->app_window;
	_tmp4_ = _tmp3_->settings;
	_tmp5_ = dc_settings_manager_get_background_mode (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = self->priv->app_window;
	_tmp8_ = _tmp7_->settings;
	_tmp9_ = dc_settings_manager_get_background_color (_tmp8_);
	_tmp10_ = _tmp9_;
	dc_application_apply_background (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, DC_TYPE_APPLICATION, DcApplication), _tmp6_, _tmp10_);
}

static void
dc_settings_dialog_apply_theme_override (DcSettingsDialog* self)
{
	DcWindow* _tmp0_;
	GtkApplication* _tmp1_;
	GtkApplication* _tmp2_;
	DcWindow* _tmp3_;
	DcSettingsManager* _tmp4_;
	DcThemeOverride _tmp5_;
	DcThemeOverride _tmp6_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->app_window;
	_tmp1_ = gtk_window_get_application ((GtkWindow*) _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = self->priv->app_window;
	_tmp4_ = _tmp3_->settings;
	_tmp5_ = dc_settings_manager_get_theme_override (_tmp4_);
	_tmp6_ = _tmp5_;
	dc_application_apply_theme_override (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, DC_TYPE_APPLICATION, DcApplication), _tmp6_);
}

static void
dc_settings_dialog_apply_hex_to_button (GtkColorDialogButton* btn,
                                        const gchar* hex)
{
	GdkRGBA rgba = {0};
	gboolean _tmp0_ = FALSE;
	gint _tmp1_;
	gint _tmp2_;
	GdkRGBA _tmp3_;
	g_return_if_fail (btn != NULL);
	g_return_if_fail (hex != NULL);
	memset (&rgba, 0, sizeof (GdkRGBA));
	_tmp1_ = strlen (hex);
	_tmp2_ = _tmp1_;
	if (_tmp2_ == 0) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = !gdk_rgba_parse (&rgba, hex);
	}
	if (_tmp0_) {
		gdk_rgba_parse (&rgba, "#3584e4");
	}
	_tmp3_ = rgba;
	gtk_color_dialog_button_set_rgba (btn, &_tmp3_);
}

static void
dc_settings_dialog_delete_parla_config (void)
{
	gchar* dir = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	_tmp0_ = g_get_user_config_dir ();
	_tmp1_ = g_build_filename (_tmp0_, "parla", NULL);
	dir = _tmp1_;
	_tmp2_ = g_build_filename (dir, "settings.ini", NULL);
	_tmp3_ = _tmp2_;
	g_unlink (_tmp3_);
	_g_free0 (_tmp3_);
	g_rmdir (dir);
	_g_free0 (dir);
}

static void
dc_settings_dialog_class_init (DcSettingsDialogClass * klass,
                               gpointer klass_data)
{
	dc_settings_dialog_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DcSettingsDialog_private_offset);
	G_OBJECT_CLASS (klass)->finalize = dc_settings_dialog_finalize;
}

static void
dc_settings_dialog_instance_init (DcSettingsDialog * self,
                                  gpointer klass)
{
	gchar* _tmp0_;
	self->priv = dc_settings_dialog_get_instance_private (self);
	self->priv->loading_proxy = FALSE;
	self->priv->saving_proxy = FALSE;
	self->priv->saved_proxy_enabled = FALSE;
	_tmp0_ = g_strdup ("");
	self->priv->saved_proxy_url = _tmp0_;
	self->priv->syncing_rpc_source = FALSE;
	self->priv->rpc_version_request = (guint) 0;
	self->priv->rpc_current_version = NULL;
}

static void
dc_settings_dialog_finalize (GObject * obj)
{
	DcSettingsDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DC_TYPE_SETTINGS_DIALOG, DcSettingsDialog);
	_g_object_unref0 (self->priv->rpc);
	_g_object_unref0 (self->priv->proxy_switch_row);
	_g_object_unref0 (self->priv->proxy_url_row);
	_g_object_unref0 (self->priv->proxy_switch);
	_g_object_unref0 (self->priv->proxy_entry);
	_g_object_unref0 (self->priv->rpc_row);
	_g_object_unref0 (self->priv->rpc_source_dropdown);
	_g_object_unref0 (self->priv->rpc_choose_btn);
	_g_object_unref0 (self->priv->rpc_check_btn);
	_g_object_unref0 (self->priv->accounts_path_row);
	_g_object_unref0 (self->priv->accounts_path_reset_btn);
	_g_free0 (self->priv->saved_proxy_url);
	_g_object_unref0 (self->priv->font_type_row);
	_g_object_unref0 (self->priv->font_btn);
	_g_free0 (self->priv->rpc_current_version);
	_g_object_unref0 (self->priv->tracking_filter_url_row);
	_g_object_unref0 (self->priv->tracking_filter_refresh_btn);
	G_OBJECT_CLASS (dc_settings_dialog_parent_class)->finalize (obj);
}

static GType
dc_settings_dialog_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DcSettingsDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dc_settings_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DcSettingsDialog), 0, (GInstanceInitFunc) dc_settings_dialog_instance_init, NULL };
	GType dc_settings_dialog_type_id;
	dc_settings_dialog_type_id = g_type_register_static (adw_preferences_dialog_get_type (), "DcSettingsDialog", &g_define_type_info, 0);
	DcSettingsDialog_private_offset = g_type_add_instance_private (dc_settings_dialog_type_id, sizeof (DcSettingsDialogPrivate));
	return dc_settings_dialog_type_id;
}

GType
dc_settings_dialog_get_type (void)
{
	static volatile gsize dc_settings_dialog_type_id__once = 0;
	if (g_once_init_enter (&dc_settings_dialog_type_id__once)) {
		GType dc_settings_dialog_type_id;
		dc_settings_dialog_type_id = dc_settings_dialog_get_type_once ();
		g_once_init_leave (&dc_settings_dialog_type_id__once, dc_settings_dialog_type_id);
	}
	return dc_settings_dialog_type_id__once;
}

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

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

static gssize
_vala_array_length (gpointer array)
{
	gssize length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}

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

