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

#include "protonplus_core.h"
#include <adwaita.h>
#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <gee.h>
#include <glib/gi18n-lib.h>
#include <gtk/gtk.h>
#include <gio/gio.h>
#include <float.h>
#include <math.h>

#define PROTON_PLUS_WIDGETS_PREFERENCES_PREFERENCES_DIALOG_KILOBYTE ((gint64) 1000)
#define PROTON_PLUS_WIDGETS_PREFERENCES_PREFERENCES_DIALOG_DOWNLOAD_SPEED_LIMIT_KEY "download-speed-limit-bps"
#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

enum  {
	PROTON_PLUS_WIDGETS_PREFERENCES_PREFERENCES_DIALOG_0_PROPERTY,
	PROTON_PLUS_WIDGETS_PREFERENCES_PREFERENCES_DIALOG_NUM_PROPERTIES
};
static GParamSpec* proton_plus_widgets_preferences_preferences_dialog_properties[PROTON_PLUS_WIDGETS_PREFERENCES_PREFERENCES_DIALOG_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block2Data Block2Data;
#define _g_free0(var) (var = (g_free (var), NULL))

#define PROTON_PLUS_WIDGETS_INTRODUCTION_TYPE_INTRODUCTION (proton_plus_widgets_introduction_introduction_get_type ())
#define PROTON_PLUS_WIDGETS_INTRODUCTION_INTRODUCTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_WIDGETS_INTRODUCTION_TYPE_INTRODUCTION, ProtonPlusWidgetsIntroductionIntroduction))
#define PROTON_PLUS_WIDGETS_INTRODUCTION_INTRODUCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_WIDGETS_INTRODUCTION_TYPE_INTRODUCTION, ProtonPlusWidgetsIntroductionIntroductionClass))
#define PROTON_PLUS_WIDGETS_INTRODUCTION_IS_INTRODUCTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_WIDGETS_INTRODUCTION_TYPE_INTRODUCTION))
#define PROTON_PLUS_WIDGETS_INTRODUCTION_IS_INTRODUCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_WIDGETS_INTRODUCTION_TYPE_INTRODUCTION))
#define PROTON_PLUS_WIDGETS_INTRODUCTION_INTRODUCTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_WIDGETS_INTRODUCTION_TYPE_INTRODUCTION, ProtonPlusWidgetsIntroductionIntroductionClass))

typedef struct _ProtonPlusWidgetsIntroductionIntroduction ProtonPlusWidgetsIntroductionIntroduction;
typedef struct _ProtonPlusWidgetsIntroductionIntroductionClass ProtonPlusWidgetsIntroductionIntroductionClass;
typedef struct _Block3Data Block3Data;
typedef struct _Block4Data Block4Data;
#define _gtk_expression_unref0(var) ((var == NULL) ? NULL : (var = (gtk_expression_unref (var), NULL)))

struct _ProtonPlusWidgetsPreferencesPreferencesDialogPrivate {
	AdwPreferencesPage** controller_pages;
	gint controller_pages_length1;
	gint _controller_pages_size_;
	AdwEntryRow* proxy_url_row;
	AdwSpinRow* download_speed_limit_row;
	gulong proxy_mode_changed_handler;
	gulong download_speed_limit_changed_handler;
};

struct _Block2Data {
	int _ref_count_;
	ProtonPlusWidgetsPreferencesPreferencesDialog* self;
	AdwComboRow* confirm_button_row;
};

struct _Block3Data {
	int _ref_count_;
	Block2Data * _data2_;
	ProtonPlusModelsLaunchersSteam* steam_launcher;
	ProtonPlusWidgetsPreferencesToolRow* compatibility_tool_row;
};

struct _Block4Data {
	int _ref_count_;
	Block3Data * _data3_;
	ProtonPlusWidgetsPreferencesSteamProfileRow* profile_row;
	ProtonPlusWidgetsPreferencesSteamShortcutRow* shortcut_row;
};

static gint ProtonPlusWidgetsPreferencesPreferencesDialog_private_offset;
static gpointer proton_plus_widgets_preferences_preferences_dialog_parent_class = NULL;
static ProtonPlusUtilsControllerNavigationHostIface * proton_plus_widgets_preferences_preferences_dialog_proton_plus_utils_controller_navigation_host_parent_iface = NULL;

static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (void * _userdata_);
static void proton_plus_widgets_preferences_preferences_dialog_add_controller_page (ProtonPlusWidgetsPreferencesPreferencesDialog* self,
                                                                             AdwPreferencesPage* page);
static void __lambda29_ (Block2Data* _data2_);
static void ___lambda29__g_object_notify (GObject* _sender,
                                   GParamSpec* pspec,
                                   gpointer self);
static void __lambda30_ (ProtonPlusWidgetsPreferencesPreferencesDialog* self);
VALA_EXTERN GType proton_plus_widgets_introduction_introduction_get_type (void) G_GNUC_CONST ;
VALA_EXTERN ProtonPlusWidgetsIntroductionIntroduction* proton_plus_widgets_introduction_introduction_new (void);
VALA_EXTERN ProtonPlusWidgetsIntroductionIntroduction* proton_plus_widgets_introduction_introduction_construct (GType object_type);
static void ___lambda30__adw_button_row_activated (AdwButtonRow* _sender,
                                            gpointer self);
static Block3Data* block3_data_ref (Block3Data* _data3_);
static void block3_data_unref (void * _userdata_);
static gint _____lambda345_ (ProtonPlusWidgetsPreferencesPreferencesDialog* self,
                      ProtonPlusModelsCompatibilityTool* a,
                      ProtonPlusModelsCompatibilityTool* b);
static gint ______lambda345__gcompare_data_func (gconstpointer a,
                                          gconstpointer b,
                                          gpointer self);
static void _____lambda348_ (Block3Data* _data3_);
static void ______lambda348__g_object_notify (GObject* _sender,
                                       GParamSpec* pspec,
                                       gpointer self);
static Block4Data* block4_data_ref (Block4Data* _data4_);
static void block4_data_unref (void * _userdata_);
static void ______lambda351_ (Block4Data* _data4_);
static void _______lambda351__g_object_notify (GObject* _sender,
                                        GParamSpec* pspec,
                                        gpointer self);
static void proton_plus_widgets_preferences_preferences_dialog_update_proxy_url_sensitivity (ProtonPlusWidgetsPreferencesPreferencesDialog* self);
static void _proton_plus_widgets_preferences_preferences_dialog_update_proxy_url_sensitivity_g_settings_changed (GSettings* _sender,
                                                                                                          const gchar* key,
                                                                                                          gpointer self);
static void proton_plus_widgets_preferences_preferences_dialog_update_download_speed_limit_row (ProtonPlusWidgetsPreferencesPreferencesDialog* self);
static void __lambda353_ (ProtonPlusWidgetsPreferencesPreferencesDialog* self);
static void ___lambda353__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static void _proton_plus_widgets_preferences_preferences_dialog_update_download_speed_limit_row_g_settings_changed (GSettings* _sender,
                                                                                                             const gchar* key,
                                                                                                             gpointer self);
static void _vala_array_add1 (AdwPreferencesPage** * array,
                       gint* length,
                       gint* size,
                       AdwPreferencesPage* value);
static void proton_plus_widgets_preferences_preferences_dialog_real_dispose (GObject* base);
static gboolean proton_plus_widgets_preferences_preferences_dialog_real_controller_switch_page (ProtonPlusUtilsControllerNavigationHost* base,
                                                                                         gint delta);
static gboolean proton_plus_widgets_preferences_preferences_dialog_real_controller_can_switch_page (ProtonPlusUtilsControllerNavigationHost* base);
static gboolean proton_plus_widgets_preferences_preferences_dialog_real_controller_prefers_initial_focus_after_switch (ProtonPlusUtilsControllerNavigationHost* base);
static gchar* proton_plus_widgets_preferences_preferences_dialog_real_get_controller_page_id (ProtonPlusUtilsControllerNavigationHost* base);
static GObject* proton_plus_widgets_preferences_preferences_dialog_real_get_controller_page_root (ProtonPlusUtilsControllerNavigationHost* base);
static GObject* proton_plus_widgets_preferences_preferences_dialog_real_get_controller_initial_focus (ProtonPlusUtilsControllerNavigationHost* base);
static GtkWidget* proton_plus_widgets_preferences_preferences_dialog_find_first_preferences_row (ProtonPlusWidgetsPreferencesPreferencesDialog* self,
                                                                                          GtkWidget* root);
static gboolean proton_plus_widgets_preferences_preferences_dialog_real_controller_navigate_back (ProtonPlusUtilsControllerNavigationHost* base);
static gboolean proton_plus_widgets_preferences_preferences_dialog_real_controller_can_navigate_back (ProtonPlusUtilsControllerNavigationHost* base);
static void proton_plus_widgets_preferences_preferences_dialog_finalize (GObject * obj);
static GType proton_plus_widgets_preferences_preferences_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 inline gpointer
proton_plus_widgets_preferences_preferences_dialog_get_instance_private (ProtonPlusWidgetsPreferencesPreferencesDialog* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusWidgetsPreferencesPreferencesDialog_private_offset);
}

static Block2Data*
block2_data_ref (Block2Data* _data2_)
{
	g_atomic_int_inc (&_data2_->_ref_count_);
	return _data2_;
}

static void
block2_data_unref (void * _userdata_)
{
	Block2Data* _data2_;
	_data2_ = (Block2Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
		ProtonPlusWidgetsPreferencesPreferencesDialog* self;
		self = _data2_->self;
		_g_object_unref0 (_data2_->confirm_button_row);
		_g_object_unref0 (self);
		g_slice_free (Block2Data, _data2_);
	}
}

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

static void
__lambda29_ (Block2Data* _data2_)
{
	ProtonPlusWidgetsPreferencesPreferencesDialog* self;
	gint selected = 0;
	AdwComboRow* _tmp0_;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	self = _data2_->self;
	_tmp0_ = _data2_->confirm_button_row;
	selected = (gint) adw_combo_row_get_selected (_tmp0_);
	if (selected >= 0) {
		_tmp2_ = selected <= 1;
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		GSettings* _tmp3_;
		_tmp3_ = proton_plus_globals_SETTINGS;
		_tmp1_ = g_settings_get_enum (_tmp3_, "controller-confirm-button") != selected;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		GSettings* _tmp4_;
		_tmp4_ = proton_plus_globals_SETTINGS;
		g_settings_set_enum (_tmp4_, "controller-confirm-button", selected);
	}
}

static void
___lambda29__g_object_notify (GObject* _sender,
                              GParamSpec* pspec,
                              gpointer self)
{
	__lambda29_ (self);
}

static void
__lambda30_ (ProtonPlusWidgetsPreferencesPreferencesDialog* self)
{
	ProtonPlusWidgetsWindow* window = NULL;
	GtkRoot* _tmp0_;
	ProtonPlusWidgetsWindow* _tmp1_;
	ProtonPlusWidgetsIntroductionIntroduction* dialog = NULL;
	ProtonPlusWidgetsIntroductionIntroduction* _tmp2_;
	_tmp0_ = gtk_widget_get_root ((GtkWidget*) self);
	_tmp1_ = _g_object_ref0 (PROTON_PLUS_WIDGETS_IS_WINDOW (_tmp0_) ? ((ProtonPlusWidgetsWindow*) _tmp0_) : NULL);
	window = _tmp1_;
	_tmp2_ = proton_plus_widgets_introduction_introduction_new ();
	g_object_ref_sink (_tmp2_);
	dialog = _tmp2_;
	proton_plus_widgets_window_present_dialog_for_controller ((AdwDialog*) dialog, (GtkWidget*) window);
	_g_object_unref0 (dialog);
	_g_object_unref0 (window);
}

static void
___lambda30__adw_button_row_activated (AdwButtonRow* _sender,
                                       gpointer self)
{
	__lambda30_ ((ProtonPlusWidgetsPreferencesPreferencesDialog*) self);
}

static Block3Data*
block3_data_ref (Block3Data* _data3_)
{
	g_atomic_int_inc (&_data3_->_ref_count_);
	return _data3_;
}

static void
block3_data_unref (void * _userdata_)
{
	Block3Data* _data3_;
	_data3_ = (Block3Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data3_->_ref_count_)) {
		ProtonPlusWidgetsPreferencesPreferencesDialog* self;
		self = _data3_->_data2_->self;
		_g_object_unref0 (_data3_->compatibility_tool_row);
		_g_object_unref0 (_data3_->steam_launcher);
		block2_data_unref (_data3_->_data2_);
		_data3_->_data2_ = NULL;
		g_slice_free (Block3Data, _data3_);
	}
}

static gint
_____lambda345_ (ProtonPlusWidgetsPreferencesPreferencesDialog* self,
                 ProtonPlusModelsCompatibilityTool* a,
                 ProtonPlusModelsCompatibilityTool* b)
{
	GCompareFunc _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gint _tmp9_;
	gint result;
	g_return_val_if_fail (a != NULL, -1);
	g_return_val_if_fail (b != NULL, -1);
	_tmp0_ = ((GCompareFunc) g_strcmp0);
	_tmp1_ = proton_plus_models_compatibility_tool_get_display_title (b);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_utf8_collate_key_for_filename (_tmp2_, (gssize) -1);
	_tmp4_ = _tmp3_;
	_tmp5_ = proton_plus_models_compatibility_tool_get_display_title (a);
	_tmp6_ = _tmp5_;
	_tmp7_ = g_utf8_collate_key_for_filename (_tmp6_, (gssize) -1);
	_tmp8_ = _tmp7_;
	_tmp9_ = _tmp0_ (_tmp4_, _tmp8_);
	_g_free0 (_tmp8_);
	_g_free0 (_tmp4_);
	result = _tmp9_;
	return result;
}

static gint
______lambda345__gcompare_data_func (gconstpointer a,
                                     gconstpointer b,
                                     gpointer self)
{
	gint result;
	result = _____lambda345_ ((ProtonPlusWidgetsPreferencesPreferencesDialog*) self, (ProtonPlusModelsCompatibilityTool*) a, (ProtonPlusModelsCompatibilityTool*) b);
	return result;
}

static void
_____lambda348_ (Block3Data* _data3_)
{
	Block2Data* _data2_;
	ProtonPlusWidgetsPreferencesPreferencesDialog* self;
	ProtonPlusModelsCompatibilityTool* selected_tool = NULL;
	ProtonPlusWidgetsPreferencesToolRow* _tmp0_;
	GObject* _tmp1_;
	ProtonPlusModelsCompatibilityTool* _tmp2_;
	ProtonPlusModelsCompatibilityTool* _tmp3_;
	_data2_ = _data3_->_data2_;
	self = _data2_->self;
	_tmp0_ = _data3_->compatibility_tool_row;
	_tmp1_ = adw_combo_row_get_selected_item ((AdwComboRow*) _tmp0_);
	_tmp2_ = _g_object_ref0 (PROTON_PLUS_MODELS_IS_COMPATIBILITY_TOOL (_tmp1_) ? ((ProtonPlusModelsCompatibilityTool*) _tmp1_) : NULL);
	selected_tool = _tmp2_;
	_tmp3_ = selected_tool;
	if (_tmp3_ != NULL) {
		ProtonPlusModelsLaunchersSteam* _tmp4_;
		ProtonPlusModelsCompatibilityTool* _tmp5_;
		const gchar* _tmp6_;
		const gchar* _tmp7_;
		_tmp4_ = _data3_->steam_launcher;
		_tmp5_ = selected_tool;
		_tmp6_ = proton_plus_models_compatibility_tool_get_internal_title (_tmp5_);
		_tmp7_ = _tmp6_;
		proton_plus_models_launchers_steam_change_default_compatibility_tool (_tmp4_, _tmp7_);
	}
	_g_object_unref0 (selected_tool);
}

static void
______lambda348__g_object_notify (GObject* _sender,
                                  GParamSpec* pspec,
                                  gpointer self)
{
	_____lambda348_ (self);
}

static Block4Data*
block4_data_ref (Block4Data* _data4_)
{
	g_atomic_int_inc (&_data4_->_ref_count_);
	return _data4_;
}

static void
block4_data_unref (void * _userdata_)
{
	Block4Data* _data4_;
	_data4_ = (Block4Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data4_->_ref_count_)) {
		ProtonPlusWidgetsPreferencesPreferencesDialog* self;
		self = _data4_->_data3_->_data2_->self;
		_g_object_unref0 (_data4_->shortcut_row);
		_g_object_unref0 (_data4_->profile_row);
		block3_data_unref (_data4_->_data3_);
		_data4_->_data3_ = NULL;
		g_slice_free (Block4Data, _data4_);
	}
}

static void
______lambda351_ (Block4Data* _data4_)
{
	Block3Data* _data3_;
	Block2Data* _data2_;
	ProtonPlusWidgetsPreferencesPreferencesDialog* self;
	ProtonPlusModelsSteamProfile* selected_profile = NULL;
	ProtonPlusWidgetsPreferencesSteamProfileRow* _tmp0_;
	GObject* _tmp1_;
	ProtonPlusModelsSteamProfile* _tmp2_;
	ProtonPlusModelsSteamProfile* _tmp3_;
	_data3_ = _data4_->_data3_;
	_data2_ = _data3_->_data2_;
	self = _data2_->self;
	_tmp0_ = _data4_->profile_row;
	_tmp1_ = adw_combo_row_get_selected_item ((AdwComboRow*) _tmp0_);
	_tmp2_ = _g_object_ref0 (PROTON_PLUS_MODELS_IS_STEAM_PROFILE (_tmp1_) ? ((ProtonPlusModelsSteamProfile*) _tmp1_) : NULL);
	selected_profile = _tmp2_;
	_tmp3_ = selected_profile;
	if (_tmp3_ != NULL) {
		GSettings* _tmp4_;
		ProtonPlusModelsSteamProfile* _tmp5_;
		const gchar* _tmp6_;
		const gchar* _tmp7_;
		ProtonPlusWidgetsPreferencesSteamShortcutRow* _tmp8_;
		ProtonPlusModelsSteamProfile* _tmp9_;
		ProtonPlusModelsLaunchersSteam* _tmp10_;
		ProtonPlusModelsSteamProfile* _tmp11_;
		_tmp4_ = proton_plus_globals_SETTINGS;
		_tmp5_ = selected_profile;
		_tmp6_ = proton_plus_models_steam_profile_get_steam_id (_tmp5_);
		_tmp7_ = _tmp6_;
		g_settings_set_string (_tmp4_, "steam-selected-profile-id", _tmp7_);
		_tmp8_ = _data4_->shortcut_row;
		_tmp9_ = selected_profile;
		proton_plus_widgets_preferences_steam_shortcut_row_load (_tmp8_, _tmp9_);
		_tmp10_ = _data3_->steam_launcher;
		_tmp11_ = selected_profile;
		proton_plus_models_launchers_steam_switch_profile (_tmp10_, _tmp11_, NULL, NULL);
	}
	_g_object_unref0 (selected_profile);
}

static void
_______lambda351__g_object_notify (GObject* _sender,
                                   GParamSpec* pspec,
                                   gpointer self)
{
	______lambda351_ (self);
}

static void
_proton_plus_widgets_preferences_preferences_dialog_update_proxy_url_sensitivity_g_settings_changed (GSettings* _sender,
                                                                                                     const gchar* key,
                                                                                                     gpointer self)
{
	proton_plus_widgets_preferences_preferences_dialog_update_proxy_url_sensitivity ((ProtonPlusWidgetsPreferencesPreferencesDialog*) self);
}

static void
__lambda353_ (ProtonPlusWidgetsPreferencesPreferencesDialog* self)
{
	gint64 limit_kib = 0LL;
	AdwSpinRow* _tmp0_;
	gint64 limit_bps = 0LL;
	GSettings* _tmp1_;
	_tmp0_ = self->priv->download_speed_limit_row;
	limit_kib = (gint64) round (adw_spin_row_get_value (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, adw_spin_row_get_type (), AdwSpinRow)));
	if (limit_kib < ((gint64) 0)) {
		limit_kib = (gint64) 0;
	}
	limit_bps = limit_kib * PROTON_PLUS_WIDGETS_PREFERENCES_PREFERENCES_DIALOG_KILOBYTE;
	_tmp1_ = proton_plus_globals_SETTINGS;
	if (g_settings_get_int64 (_tmp1_, PROTON_PLUS_WIDGETS_PREFERENCES_PREFERENCES_DIALOG_DOWNLOAD_SPEED_LIMIT_KEY) != limit_bps) {
		GSettings* _tmp2_;
		_tmp2_ = proton_plus_globals_SETTINGS;
		g_settings_set_int64 (_tmp2_, PROTON_PLUS_WIDGETS_PREFERENCES_PREFERENCES_DIALOG_DOWNLOAD_SPEED_LIMIT_KEY, limit_bps);
	}
}

static void
___lambda353__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda353_ ((ProtonPlusWidgetsPreferencesPreferencesDialog*) self);
}

static void
_proton_plus_widgets_preferences_preferences_dialog_update_download_speed_limit_row_g_settings_changed (GSettings* _sender,
                                                                                                        const gchar* key,
                                                                                                        gpointer self)
{
	proton_plus_widgets_preferences_preferences_dialog_update_download_speed_limit_row ((ProtonPlusWidgetsPreferencesPreferencesDialog*) self);
}

ProtonPlusWidgetsPreferencesPreferencesDialog*
proton_plus_widgets_preferences_preferences_dialog_construct (GType object_type,
                                                              GeeLinkedList* launchers)
{
	ProtonPlusWidgetsPreferencesPreferencesDialog * self = NULL;
	Block2Data* _data2_;
	AdwPreferencesPage* general_page = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	AdwPreferencesPage* _tmp2_ = NULL;
	AdwPreferencesPage* _tmp3_;
	AdwPreferencesGroup* appearance_group = NULL;
	gchar* _tmp4_;
	AdwPreferencesGroup* _tmp5_ = NULL;
	AdwPreferencesPage* _tmp6_;
	AdwPreferencesGroup* _tmp7_;
	ProtonPlusWidgetsPreferencesThemeRow* theme_row = NULL;
	ProtonPlusWidgetsPreferencesThemeRow* _tmp8_;
	ProtonPlusWidgetsPreferencesThemeRow* _tmp9_;
	GtkImage* _tmp10_;
	GtkImage* _tmp11_;
	AdwPreferencesGroup* _tmp12_;
	ProtonPlusWidgetsPreferencesThemeRow* _tmp13_;
	ProtonPlusWidgetsPreferencesLanguageRow* language_row = NULL;
	ProtonPlusWidgetsPreferencesLanguageRow* _tmp14_;
	ProtonPlusWidgetsPreferencesLanguageRow* _tmp15_;
	GtkImage* _tmp16_;
	GtkImage* _tmp17_;
	AdwPreferencesGroup* _tmp18_;
	ProtonPlusWidgetsPreferencesLanguageRow* _tmp19_;
	AdwPreferencesGroup* controller_group = NULL;
	gchar* _tmp20_;
	AdwPreferencesGroup* _tmp21_ = NULL;
	AdwPreferencesPage* _tmp22_;
	AdwPreferencesGroup* _tmp23_;
	GtkStringList* confirm_button_choices = NULL;
	GtkStringList* _tmp24_;
	GtkStringList* _tmp25_;
	GtkStringList* _tmp26_;
	gchar* _tmp27_;
	gchar* _tmp28_;
	GtkStringList* _tmp29_;
	GListModel* _tmp30_;
	AdwComboRow* _tmp31_ = NULL;
	AdwComboRow* _tmp32_;
	GSettings* _tmp33_;
	AdwComboRow* _tmp34_;
	AdwPreferencesGroup* _tmp35_;
	AdwComboRow* _tmp36_;
	AdwSwitchRow* controller_haptics_row = NULL;
	gchar* _tmp37_;
	gchar* _tmp38_;
	AdwSwitchRow* _tmp39_ = NULL;
	GSettings* _tmp40_;
	AdwSwitchRow* _tmp41_;
	AdwPreferencesGroup* _tmp42_;
	AdwSwitchRow* _tmp43_;
	AdwPreferencesGroup* help_page = NULL;
	gchar* _tmp44_;
	AdwPreferencesGroup* _tmp45_ = NULL;
	AdwButtonRow* introduction_btn = NULL;
	gchar* _tmp46_;
	AdwButtonRow* _tmp47_ = NULL;
	AdwButtonRow* _tmp48_;
	AdwButtonRow* _tmp49_;
	AdwPreferencesGroup* _tmp50_;
	AdwButtonRow* _tmp51_;
	AdwPreferencesPage* _tmp52_;
	AdwPreferencesGroup* _tmp53_;
	AdwPreferencesPage* tools_page = NULL;
	gchar* _tmp54_;
	gchar* _tmp55_;
	AdwPreferencesPage* _tmp56_ = NULL;
	AdwPreferencesPage* _tmp57_;
	AdwPreferencesGroup* updates_group = NULL;
	gchar* _tmp58_;
	AdwPreferencesGroup* _tmp59_ = NULL;
	AdwPreferencesPage* _tmp60_;
	AdwPreferencesGroup* _tmp61_;
	AdwSwitchRow* background_updates_row = NULL;
	gchar* _tmp62_;
	gchar* _tmp63_;
	AdwSwitchRow* _tmp64_ = NULL;
	GSettings* _tmp65_;
	AdwSwitchRow* _tmp66_;
	AdwPreferencesGroup* _tmp67_;
	AdwSwitchRow* _tmp68_;
	ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRow* background_updates_frequency_row = NULL;
	gchar* _tmp69_;
	ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRow* _tmp70_ = NULL;
	AdwSwitchRow* _tmp71_;
	ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRow* _tmp72_;
	AdwPreferencesGroup* _tmp73_;
	ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRow* _tmp74_;
	AdwSwitchRow* check_updates_on_boot_row = NULL;
	gchar* _tmp75_;
	gchar* _tmp76_;
	AdwSwitchRow* _tmp77_ = NULL;
	GSettings* _tmp78_;
	AdwSwitchRow* _tmp79_;
	AdwPreferencesGroup* _tmp80_;
	AdwSwitchRow* _tmp81_;
	AdwSwitchRow* check_updates_on_launch_row = NULL;
	gchar* _tmp82_;
	gchar* _tmp83_;
	AdwSwitchRow* _tmp84_ = NULL;
	GSettings* _tmp85_;
	AdwSwitchRow* _tmp86_;
	AdwPreferencesGroup* _tmp87_;
	AdwSwitchRow* _tmp88_;
	AdwSwitchRow* migrate_default_prefix_row = NULL;
	gchar* _tmp89_;
	gchar* _tmp90_;
	AdwSwitchRow* _tmp91_ = NULL;
	GSettings* _tmp92_;
	AdwSwitchRow* _tmp93_;
	AdwPreferencesGroup* _tmp94_;
	AdwSwitchRow* _tmp95_;
	AdwPreferencesGroup* tools_behavior_group = NULL;
	gchar* _tmp96_;
	AdwPreferencesGroup* _tmp97_ = NULL;
	AdwPreferencesPage* _tmp98_;
	AdwPreferencesGroup* _tmp99_;
	AdwSwitchRow* legacy_tools_row = NULL;
	gchar* _tmp100_;
	gchar* _tmp101_;
	AdwSwitchRow* _tmp102_ = NULL;
	AdwSwitchRow* _tmp103_;
	GtkImage* _tmp104_;
	GtkImage* _tmp105_;
	GSettings* _tmp106_;
	AdwSwitchRow* _tmp107_;
	AdwPreferencesGroup* _tmp108_;
	AdwSwitchRow* _tmp109_;
	AdwPreferencesPage* launchers_page = NULL;
	gchar* _tmp110_;
	gchar* _tmp111_;
	AdwPreferencesPage* _tmp112_ = NULL;
	gboolean has_launchers = FALSE;
	AdwPreferencesPage* advanced_page = NULL;
	gchar* _tmp238_;
	gchar* _tmp239_;
	AdwPreferencesPage* _tmp240_ = NULL;
	AdwPreferencesPage* _tmp241_;
	AdwPreferencesGroup* tokens_group = NULL;
	gchar* _tmp242_;
	AdwPreferencesGroup* _tmp243_ = NULL;
	AdwPreferencesPage* _tmp244_;
	AdwPreferencesGroup* _tmp245_;
	ProtonPlusWidgetsPreferencesAccessTokenRow* github_access_token_row = NULL;
	ProtonPlusWidgetsPreferencesAccessTokenRow* _tmp246_;
	GSettings* _tmp247_;
	ProtonPlusWidgetsPreferencesAccessTokenRow* _tmp248_;
	AdwPreferencesGroup* _tmp249_;
	ProtonPlusWidgetsPreferencesAccessTokenRow* _tmp250_;
	ProtonPlusWidgetsPreferencesAccessTokenRow* gitlab_access_token_row = NULL;
	ProtonPlusWidgetsPreferencesAccessTokenRow* _tmp251_;
	GSettings* _tmp252_;
	ProtonPlusWidgetsPreferencesAccessTokenRow* _tmp253_;
	AdwPreferencesGroup* _tmp254_;
	ProtonPlusWidgetsPreferencesAccessTokenRow* _tmp255_;
	AdwPreferencesGroup* network_group = NULL;
	gchar* _tmp256_;
	AdwPreferencesGroup* _tmp257_ = NULL;
	AdwPreferencesPage* _tmp258_;
	AdwPreferencesGroup* _tmp259_;
	ProtonPlusWidgetsPreferencesProxyModeRow* proxy_mode_row = NULL;
	ProtonPlusWidgetsPreferencesProxyModeRow* _tmp260_;
	AdwPreferencesGroup* _tmp261_;
	ProtonPlusWidgetsPreferencesProxyModeRow* _tmp262_;
	gchar* _tmp263_;
	AdwEntryRow* _tmp264_ = NULL;
	AdwEntryRow* _tmp265_;
	AdwEntryRow* _tmp266_;
	AdwEntryRow* _tmp267_;
	GSettings* _tmp268_;
	GSettings* _tmp269_;
	AdwEntryRow* _tmp270_;
	GSettings* _tmp271_;
	gulong _tmp272_;
	AdwPreferencesGroup* _tmp273_;
	AdwEntryRow* _tmp274_;
	gchar* _tmp275_;
	gchar* _tmp276_;
	AdwSpinRow* _tmp277_ = NULL;
	AdwSpinRow* _tmp278_;
	AdwSpinRow* _tmp279_;
	AdwSpinRow* _tmp280_;
	GSettings* _tmp281_;
	gchar* _tmp282_;
	gulong _tmp283_;
	AdwPreferencesGroup* _tmp284_;
	AdwSpinRow* _tmp285_;
	AdwPreferencesGroup* experimental_group = NULL;
	gchar* _tmp286_;
	AdwPreferencesGroup* _tmp287_ = NULL;
	AdwPreferencesPage* _tmp288_;
	AdwPreferencesGroup* _tmp289_;
	AdwSwitchRow* experimental_features_row = NULL;
	gchar* _tmp290_;
	gchar* _tmp291_;
	AdwSwitchRow* _tmp292_ = NULL;
	AdwSwitchRow* _tmp293_;
	GtkImage* _tmp294_;
	GtkImage* _tmp295_;
	GSettings* _tmp296_;
	AdwSwitchRow* _tmp297_;
	AdwPreferencesGroup* _tmp298_;
	AdwSwitchRow* _tmp299_;
	AdwPreferencesGroup* maintenance_group = NULL;
	gchar* _tmp300_;
	AdwPreferencesGroup* _tmp301_ = NULL;
	AdwPreferencesPage* _tmp302_;
	AdwPreferencesGroup* _tmp303_;
	AdwPreferencesGroup* _tmp304_;
	ProtonPlusWidgetsPreferencesRefreshApplicationDataRow* _tmp305_;
	ProtonPlusWidgetsPreferencesRefreshApplicationDataRow* _tmp306_;
	AdwPreferencesGroup* _tmp307_;
	ProtonPlusWidgetsPreferencesDeleteCacheRow* _tmp308_;
	ProtonPlusWidgetsPreferencesDeleteCacheRow* _tmp309_;
	AdwPreferencesPage* system_page = NULL;
	gchar* _tmp310_;
	gchar* _tmp311_;
	AdwPreferencesPage* _tmp312_ = NULL;
	AdwPreferencesPage* _tmp313_;
	AdwPreferencesGroup* environment_group = NULL;
	gchar* _tmp314_;
	AdwPreferencesGroup* _tmp315_ = NULL;
	AdwPreferencesPage* _tmp316_;
	AdwPreferencesGroup* _tmp317_;
	const gchar* _tmp318_ = NULL;
	AdwPreferencesGroup* _tmp319_;
	gchar* _tmp320_;
	gchar* _tmp321_;
	AdwActionRow* _tmp322_ = NULL;
	AdwActionRow* _tmp323_;
	const gchar* _tmp324_ = NULL;
	AdwPreferencesGroup* _tmp325_;
	gchar* _tmp326_;
	gchar* _tmp327_;
	AdwActionRow* _tmp328_ = NULL;
	AdwActionRow* _tmp329_;
	AdwPreferencesGroup* hardware_group = NULL;
	gchar* _tmp330_;
	AdwPreferencesGroup* _tmp331_ = NULL;
	AdwPreferencesPage* _tmp332_;
	AdwPreferencesGroup* _tmp333_;
	gchar* hwcaps_str = NULL;
	gchar* _tmp334_;
	GList* _tmp335_;
	AdwPreferencesGroup* _tmp343_;
	gchar* _tmp344_;
	const gchar* _tmp345_;
	gchar* _tmp346_;
	AdwActionRow* _tmp347_ = NULL;
	AdwActionRow* _tmp348_;
	AdwPreferencesGroup* dependencies_group = NULL;
	gchar* _tmp349_;
	AdwPreferencesGroup* _tmp350_ = NULL;
	AdwPreferencesPage* _tmp351_;
	AdwPreferencesGroup* _tmp352_;
	const gchar* _tmp353_ = NULL;
	AdwPreferencesGroup* _tmp354_;
	gchar* _tmp355_;
	gchar* _tmp356_;
	AdwActionRow* _tmp357_ = NULL;
	AdwActionRow* _tmp358_;
	const gchar* _tmp359_ = NULL;
	AdwPreferencesGroup* _tmp360_;
	gchar* _tmp361_;
	gchar* _tmp362_;
	AdwActionRow* _tmp363_ = NULL;
	AdwActionRow* _tmp364_;
	const gchar* _tmp365_ = NULL;
	AdwPreferencesGroup* _tmp366_;
	gchar* _tmp367_;
	gchar* _tmp368_;
	AdwActionRow* _tmp369_ = NULL;
	AdwActionRow* _tmp370_;
	const gchar* _tmp371_ = NULL;
	AdwPreferencesGroup* _tmp372_;
	gchar* _tmp373_;
	gchar* _tmp374_;
	AdwActionRow* _tmp375_ = NULL;
	AdwActionRow* _tmp376_;
	const gchar* _tmp377_ = NULL;
	AdwPreferencesGroup* _tmp378_;
	gchar* _tmp379_;
	gchar* _tmp380_;
	AdwActionRow* _tmp381_ = NULL;
	AdwActionRow* _tmp382_;
	const gchar* _tmp383_ = NULL;
	AdwPreferencesGroup* _tmp384_;
	gchar* _tmp385_;
	gchar* _tmp386_;
	AdwActionRow* _tmp387_ = NULL;
	AdwActionRow* _tmp388_;
	const gchar* _tmp389_ = NULL;
	AdwPreferencesGroup* _tmp390_;
	gchar* _tmp391_;
	gchar* _tmp392_;
	AdwActionRow* _tmp393_ = NULL;
	AdwActionRow* _tmp394_;
	AdwPreferencesGroup* detected_launchers_group = NULL;
	gchar* _tmp395_;
	AdwPreferencesGroup* _tmp396_ = NULL;
	AdwPreferencesPage* _tmp397_;
	AdwPreferencesGroup* _tmp398_;
	ProtonPlusModelsLauncher** all_launchers = NULL;
	ProtonPlusModelsLaunchersSteam* _tmp399_;
	ProtonPlusModelsLaunchersSteam* _tmp400_;
	ProtonPlusModelsLaunchersSteam* _tmp401_;
	ProtonPlusModelsLaunchersFaugusLauncher* _tmp402_;
	ProtonPlusModelsLaunchersFaugusLauncher* _tmp403_;
	ProtonPlusModelsLaunchersLutris* _tmp404_;
	ProtonPlusModelsLaunchersLutris* _tmp405_;
	ProtonPlusModelsLaunchersBottles* _tmp406_;
	ProtonPlusModelsLaunchersBottles* _tmp407_;
	ProtonPlusModelsLaunchersHeroicGamesLauncher* _tmp408_;
	ProtonPlusModelsLaunchersHeroicGamesLauncher* _tmp409_;
	ProtonPlusModelsLaunchersWineZGUI* _tmp410_;
	ProtonPlusModelsLaunchersWineZGUI* _tmp411_;
	ProtonPlusModelsLauncher** _tmp412_;
	gint all_launchers_length1;
	gint _all_launchers_size_;
	ProtonPlusModelsLauncher** _tmp413_;
	gint _tmp413__length1;
	g_return_val_if_fail (launchers != NULL, NULL);
	_data2_ = g_slice_new0 (Block2Data);
	_data2_->_ref_count_ = 1;
	self = (ProtonPlusWidgetsPreferencesPreferencesDialog*) g_object_new (object_type, NULL);
	_data2_->self = g_object_ref (self);
	adw_preferences_dialog_set_search_enabled ((AdwPreferencesDialog*) self, TRUE);
	_tmp0_ = g_strdup (_ ("General"));
	_tmp1_ = g_strdup ("preferences-system-symbolic");
	_tmp2_ = (AdwPreferencesPage*) adw_preferences_page_new ();
	adw_preferences_page_set_title (_tmp2_, _tmp0_);
	_g_free0 (_tmp0_);
	adw_preferences_page_set_icon_name (_tmp2_, _tmp1_);
	_g_free0 (_tmp1_);
	g_object_ref_sink (_tmp2_);
	general_page = _tmp2_;
	_tmp3_ = general_page;
	proton_plus_widgets_preferences_preferences_dialog_add_controller_page (self, _tmp3_);
	_tmp4_ = g_strdup (_ ("Appearance"));
	_tmp5_ = (AdwPreferencesGroup*) adw_preferences_group_new ();
	adw_preferences_group_set_title (_tmp5_, _tmp4_);
	_g_free0 (_tmp4_);
	g_object_ref_sink (_tmp5_);
	appearance_group = _tmp5_;
	_tmp6_ = general_page;
	_tmp7_ = appearance_group;
	adw_preferences_page_add (_tmp6_, _tmp7_);
	_tmp8_ = proton_plus_widgets_preferences_theme_row_new ();
	g_object_ref_sink (_tmp8_);
	theme_row = _tmp8_;
	_tmp9_ = theme_row;
	_tmp10_ = (GtkImage*) gtk_image_new_from_icon_name ("palette-symbolic");
	g_object_ref_sink (_tmp10_);
	_tmp11_ = _tmp10_;
	adw_action_row_add_prefix ((AdwActionRow*) _tmp9_, (GtkWidget*) _tmp11_);
	_g_object_unref0 (_tmp11_);
	_tmp12_ = appearance_group;
	_tmp13_ = theme_row;
	adw_preferences_group_add (_tmp12_, (GtkWidget*) _tmp13_);
	_tmp14_ = proton_plus_widgets_preferences_language_row_new ();
	g_object_ref_sink (_tmp14_);
	language_row = _tmp14_;
	_tmp15_ = language_row;
	_tmp16_ = (GtkImage*) gtk_image_new_from_icon_name ("globe-symbolic");
	g_object_ref_sink (_tmp16_);
	_tmp17_ = _tmp16_;
	adw_action_row_add_prefix ((AdwActionRow*) _tmp15_, (GtkWidget*) _tmp17_);
	_g_object_unref0 (_tmp17_);
	_tmp18_ = appearance_group;
	_tmp19_ = language_row;
	adw_preferences_group_add (_tmp18_, (GtkWidget*) _tmp19_);
	_tmp20_ = g_strdup (_ ("Controller"));
	_tmp21_ = (AdwPreferencesGroup*) adw_preferences_group_new ();
	adw_preferences_group_set_title (_tmp21_, _tmp20_);
	_g_free0 (_tmp20_);
	g_object_ref_sink (_tmp21_);
	controller_group = _tmp21_;
	_tmp22_ = general_page;
	_tmp23_ = controller_group;
	adw_preferences_page_add (_tmp22_, _tmp23_);
	_tmp24_ = gtk_string_list_new (NULL);
	confirm_button_choices = _tmp24_;
	_tmp25_ = confirm_button_choices;
	gtk_string_list_append (_tmp25_, _ ("Bottom face button"));
	_tmp26_ = confirm_button_choices;
	gtk_string_list_append (_tmp26_, _ ("Right face button"));
	_tmp27_ = g_strdup (_ ("Confirm button"));
	_tmp28_ = g_strdup (_ ("Choose which face button activates the selected control"));
	_tmp29_ = confirm_button_choices;
	_tmp30_ = _g_object_ref0 ((GListModel*) _tmp29_);
	_tmp31_ = (AdwComboRow*) adw_combo_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp31_, _tmp27_);
	_g_free0 (_tmp27_);
	adw_action_row_set_subtitle ((AdwActionRow*) _tmp31_, _tmp28_);
	_g_free0 (_tmp28_);
	adw_combo_row_set_model (_tmp31_, _tmp30_);
	_g_object_unref0 (_tmp30_);
	g_object_ref_sink (_tmp31_);
	_data2_->confirm_button_row = _tmp31_;
	_tmp32_ = _data2_->confirm_button_row;
	_tmp33_ = proton_plus_globals_SETTINGS;
	adw_combo_row_set_selected (_tmp32_, (guint) g_settings_get_enum (_tmp33_, "controller-confirm-button"));
	_tmp34_ = _data2_->confirm_button_row;
	g_signal_connect_data ((GObject*) _tmp34_, "notify::selected", (GCallback) ___lambda29__g_object_notify, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
	_tmp35_ = controller_group;
	_tmp36_ = _data2_->confirm_button_row;
	adw_preferences_group_add (_tmp35_, (GtkWidget*) _tmp36_);
	_tmp37_ = g_strdup (_ ("Controller vibration"));
	_tmp38_ = g_strdup (_ ("Use subtle vibration for controller actions and navigation limits"));
	_tmp39_ = (AdwSwitchRow*) adw_switch_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp39_, _tmp37_);
	_g_free0 (_tmp37_);
	adw_action_row_set_subtitle ((AdwActionRow*) _tmp39_, _tmp38_);
	_g_free0 (_tmp38_);
	g_object_ref_sink (_tmp39_);
	controller_haptics_row = _tmp39_;
	_tmp40_ = proton_plus_globals_SETTINGS;
	_tmp41_ = controller_haptics_row;
	g_settings_bind (_tmp40_, "controller-haptics-enabled", (GObject*) _tmp41_, "active", G_SETTINGS_BIND_DEFAULT);
	_tmp42_ = controller_group;
	_tmp43_ = controller_haptics_row;
	adw_preferences_group_add (_tmp42_, (GtkWidget*) _tmp43_);
	_tmp44_ = g_strdup (_ ("Help"));
	_tmp45_ = (AdwPreferencesGroup*) adw_preferences_group_new ();
	adw_preferences_group_set_title (_tmp45_, _tmp44_);
	_g_free0 (_tmp44_);
	g_object_ref_sink (_tmp45_);
	help_page = _tmp45_;
	_tmp46_ = g_strdup (_ ("Show Introduction"));
	_tmp47_ = (AdwButtonRow*) adw_button_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp47_, _tmp46_);
	_g_free0 (_tmp46_);
	g_object_ref_sink (_tmp47_);
	introduction_btn = _tmp47_;
	_tmp48_ = introduction_btn;
	adw_button_row_set_start_icon_name (_tmp48_, "help-about-symbolic");
	_tmp49_ = introduction_btn;
	g_signal_connect_object (_tmp49_, "activated", (GCallback) ___lambda30__adw_button_row_activated, self, 0);
	_tmp50_ = help_page;
	_tmp51_ = introduction_btn;
	adw_preferences_group_add (_tmp50_, (GtkWidget*) _tmp51_);
	_tmp52_ = general_page;
	_tmp53_ = help_page;
	adw_preferences_page_add (_tmp52_, _tmp53_);
	_tmp54_ = g_strdup (_ ("Tools"));
	_tmp55_ = g_strdup ("toolbox-symbolic");
	_tmp56_ = (AdwPreferencesPage*) adw_preferences_page_new ();
	adw_preferences_page_set_title (_tmp56_, _tmp54_);
	_g_free0 (_tmp54_);
	adw_preferences_page_set_icon_name (_tmp56_, _tmp55_);
	_g_free0 (_tmp55_);
	g_object_ref_sink (_tmp56_);
	tools_page = _tmp56_;
	_tmp57_ = tools_page;
	proton_plus_widgets_preferences_preferences_dialog_add_controller_page (self, _tmp57_);
	_tmp58_ = g_strdup (_ ("Updates"));
	_tmp59_ = (AdwPreferencesGroup*) adw_preferences_group_new ();
	adw_preferences_group_set_title (_tmp59_, _tmp58_);
	_g_free0 (_tmp58_);
	g_object_ref_sink (_tmp59_);
	updates_group = _tmp59_;
	_tmp60_ = tools_page;
	_tmp61_ = updates_group;
	adw_preferences_page_add (_tmp60_, _tmp61_);
	_tmp62_ = g_strdup (_ ("Background updates"));
	_tmp63_ = g_strdup (_ ("Automatically update the tools in the background"));
	_tmp64_ = (AdwSwitchRow*) adw_switch_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp64_, _tmp62_);
	_g_free0 (_tmp62_);
	adw_action_row_set_subtitle ((AdwActionRow*) _tmp64_, _tmp63_);
	_g_free0 (_tmp63_);
	g_object_ref_sink (_tmp64_);
	background_updates_row = _tmp64_;
	_tmp65_ = proton_plus_globals_SETTINGS;
	_tmp66_ = background_updates_row;
	g_settings_bind (_tmp65_, "background-updates", (GObject*) _tmp66_, "active", G_SETTINGS_BIND_DEFAULT);
	_tmp67_ = updates_group;
	_tmp68_ = background_updates_row;
	adw_preferences_group_add (_tmp67_, (GtkWidget*) _tmp68_);
	_tmp69_ = g_strdup (_ ("Set how often to check for updates in the background"));
	_tmp70_ = proton_plus_widgets_preferences_background_updates_frequency_row_new ();
	adw_action_row_set_subtitle ((AdwActionRow*) _tmp70_, _tmp69_);
	_g_free0 (_tmp69_);
	g_object_ref_sink (_tmp70_);
	background_updates_frequency_row = _tmp70_;
	_tmp71_ = background_updates_row;
	_tmp72_ = background_updates_frequency_row;
	g_object_bind_property_with_closures ((GObject*) _tmp71_, "active", (GObject*) _tmp72_, "sensitive", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp73_ = updates_group;
	_tmp74_ = background_updates_frequency_row;
	adw_preferences_group_add (_tmp73_, (GtkWidget*) _tmp74_);
	_tmp75_ = g_strdup (_ ("Check updates on boot"));
	_tmp76_ = g_strdup (_ ("Check for tool updates when the system starts"));
	_tmp77_ = (AdwSwitchRow*) adw_switch_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp77_, _tmp75_);
	_g_free0 (_tmp75_);
	adw_action_row_set_subtitle ((AdwActionRow*) _tmp77_, _tmp76_);
	_g_free0 (_tmp76_);
	g_object_ref_sink (_tmp77_);
	check_updates_on_boot_row = _tmp77_;
	_tmp78_ = proton_plus_globals_SETTINGS;
	_tmp79_ = check_updates_on_boot_row;
	g_settings_bind (_tmp78_, "check-updates-on-boot", (GObject*) _tmp79_, "active", G_SETTINGS_BIND_DEFAULT);
	_tmp80_ = updates_group;
	_tmp81_ = check_updates_on_boot_row;
	adw_preferences_group_add (_tmp80_, (GtkWidget*) _tmp81_);
	_tmp82_ = g_strdup (_ ("Check updates on launch"));
	_tmp83_ = g_strdup (_ ("Update the tools when the application is launched"));
	_tmp84_ = (AdwSwitchRow*) adw_switch_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp84_, _tmp82_);
	_g_free0 (_tmp82_);
	adw_action_row_set_subtitle ((AdwActionRow*) _tmp84_, _tmp83_);
	_g_free0 (_tmp83_);
	g_object_ref_sink (_tmp84_);
	check_updates_on_launch_row = _tmp84_;
	_tmp85_ = proton_plus_globals_SETTINGS;
	_tmp86_ = check_updates_on_launch_row;
	g_settings_bind (_tmp85_, "check-updates-on-launch", (GObject*) _tmp86_, "active", G_SETTINGS_BIND_DEFAULT);
	_tmp87_ = updates_group;
	_tmp88_ = check_updates_on_launch_row;
	adw_preferences_group_add (_tmp87_, (GtkWidget*) _tmp88_);
	_tmp89_ = g_strdup (_ ("Migrate default prefix"));
	_tmp90_ = g_strdup (_ ("Automatically migrate the default prefix when updating"));
	_tmp91_ = (AdwSwitchRow*) adw_switch_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp91_, _tmp89_);
	_g_free0 (_tmp89_);
	adw_action_row_set_subtitle ((AdwActionRow*) _tmp91_, _tmp90_);
	_g_free0 (_tmp90_);
	g_object_ref_sink (_tmp91_);
	migrate_default_prefix_row = _tmp91_;
	_tmp92_ = proton_plus_globals_SETTINGS;
	_tmp93_ = migrate_default_prefix_row;
	g_settings_bind (_tmp92_, "migrate-default-prefix", (GObject*) _tmp93_, "active", G_SETTINGS_BIND_DEFAULT);
	_tmp94_ = updates_group;
	_tmp95_ = migrate_default_prefix_row;
	adw_preferences_group_add (_tmp94_, (GtkWidget*) _tmp95_);
	_tmp96_ = g_strdup (_ ("Behavior"));
	_tmp97_ = (AdwPreferencesGroup*) adw_preferences_group_new ();
	adw_preferences_group_set_title (_tmp97_, _tmp96_);
	_g_free0 (_tmp96_);
	g_object_ref_sink (_tmp97_);
	tools_behavior_group = _tmp97_;
	_tmp98_ = tools_page;
	_tmp99_ = tools_behavior_group;
	adw_preferences_page_add (_tmp98_, _tmp99_);
	_tmp100_ = g_strdup (_ ("Show legacy tools"));
	_tmp101_ = g_strdup (_ ("Display older tools that are no longer actively maintained"));
	_tmp102_ = (AdwSwitchRow*) adw_switch_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp102_, _tmp100_);
	_g_free0 (_tmp100_);
	adw_action_row_set_subtitle ((AdwActionRow*) _tmp102_, _tmp101_);
	_g_free0 (_tmp101_);
	g_object_ref_sink (_tmp102_);
	legacy_tools_row = _tmp102_;
	_tmp103_ = legacy_tools_row;
	_tmp104_ = (GtkImage*) gtk_image_new_from_icon_name ("box-archive-symbolic");
	g_object_ref_sink (_tmp104_);
	_tmp105_ = _tmp104_;
	adw_action_row_add_prefix ((AdwActionRow*) _tmp103_, (GtkWidget*) _tmp105_);
	_g_object_unref0 (_tmp105_);
	_tmp106_ = proton_plus_globals_SETTINGS;
	_tmp107_ = legacy_tools_row;
	g_settings_bind (_tmp106_, "show-legacy-tools", (GObject*) _tmp107_, "active", G_SETTINGS_BIND_DEFAULT);
	_tmp108_ = tools_behavior_group;
	_tmp109_ = legacy_tools_row;
	adw_preferences_group_add (_tmp108_, (GtkWidget*) _tmp109_);
	_tmp110_ = g_strdup (_ ("Launchers"));
	_tmp111_ = g_strdup ("grip-symbolic");
	_tmp112_ = (AdwPreferencesPage*) adw_preferences_page_new ();
	adw_preferences_page_set_title (_tmp112_, _tmp110_);
	_g_free0 (_tmp110_);
	adw_preferences_page_set_icon_name (_tmp112_, _tmp111_);
	_g_free0 (_tmp111_);
	g_object_ref_sink (_tmp112_);
	launchers_page = _tmp112_;
	has_launchers = FALSE;
	{
		GeeLinkedList* _launcher_list = NULL;
		gint _launcher_size = 0;
		GeeLinkedList* _tmp113_;
		gint _tmp114_;
		gint _tmp115_;
		gint _launcher_index = 0;
		_launcher_list = launchers;
		_tmp113_ = _launcher_list;
		_tmp114_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp113_);
		_tmp115_ = _tmp114_;
		_launcher_size = _tmp115_;
		_launcher_index = -1;
		while (TRUE) {
			gint _tmp116_;
			gint _tmp117_;
			ProtonPlusModelsLauncher* launcher = NULL;
			GeeLinkedList* _tmp118_;
			gpointer _tmp119_;
			ProtonPlusModelsLauncher* _tmp120_;
			_launcher_index = _launcher_index + 1;
			_tmp116_ = _launcher_index;
			_tmp117_ = _launcher_size;
			if (!(_tmp116_ < _tmp117_)) {
				break;
			}
			_tmp118_ = _launcher_list;
			_tmp119_ = gee_abstract_list_get ((GeeAbstractList*) _tmp118_, _launcher_index);
			launcher = (ProtonPlusModelsLauncher*) _tmp119_;
			_tmp120_ = launcher;
			if (PROTON_PLUS_MODELS_LAUNCHERS_IS_STEAM (_tmp120_)) {
				Block3Data* _data3_;
				ProtonPlusModelsLauncher* _tmp121_;
				ProtonPlusModelsLaunchersSteam* _tmp122_;
				AdwPreferencesGroup* steam_group = NULL;
				gchar* _tmp123_;
				AdwPreferencesGroup* _tmp124_ = NULL;
				GeeArrayList* compatibility_tools = NULL;
				GeeArrayList* _tmp125_;
				GeeArrayList* _tmp151_;
				GListStore* model = NULL;
				GListStore* _tmp152_;
				GtkPropertyExpression* expression = NULL;
				GtkPropertyExpression* _tmp163_;
				GListStore* _tmp164_;
				GtkPropertyExpression* _tmp165_;
				gchar* _tmp166_;
				gchar* _tmp167_;
				ProtonPlusWidgetsPreferencesToolRow* _tmp168_ = NULL;
				ProtonPlusWidgetsPreferencesToolRow* _tmp169_;
				GtkImage* _tmp170_;
				GtkImage* _tmp171_;
				ProtonPlusWidgetsPreferencesToolRow* _tmp187_;
				AdwPreferencesGroup* _tmp188_;
				ProtonPlusWidgetsPreferencesToolRow* _tmp189_;
				gboolean _tmp190_ = FALSE;
				ProtonPlusModelsLaunchersSteam* _tmp191_;
				gboolean _tmp192_;
				gboolean _tmp193_;
				AdwPreferencesPage* _tmp235_;
				AdwPreferencesGroup* _tmp236_;
				_data3_ = g_slice_new0 (Block3Data);
				_data3_->_ref_count_ = 1;
				_data3_->_data2_ = block2_data_ref (_data2_);
				_tmp121_ = launcher;
				_tmp122_ = _g_object_ref0 (PROTON_PLUS_MODELS_LAUNCHERS_IS_STEAM (_tmp121_) ? ((ProtonPlusModelsLaunchersSteam*) _tmp121_) : NULL);
				_data3_->steam_launcher = _tmp122_;
				_tmp123_ = g_strdup ("Steam");
				_tmp124_ = (AdwPreferencesGroup*) adw_preferences_group_new ();
				adw_preferences_group_set_title (_tmp124_, _tmp123_);
				_g_free0 (_tmp123_);
				g_object_ref_sink (_tmp124_);
				steam_group = _tmp124_;
				_tmp125_ = gee_array_list_new (PROTON_PLUS_MODELS_TYPE_COMPATIBILITY_TOOL, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
				compatibility_tools = _tmp125_;
				{
					GeeLinkedList* _compatibility_tool_list = NULL;
					ProtonPlusModelsLaunchersSteam* _tmp126_;
					GeeLinkedList* _tmp127_;
					gint _compatibility_tool_size = 0;
					GeeLinkedList* _tmp128_;
					gint _tmp129_;
					gint _tmp130_;
					gint _compatibility_tool_index = 0;
					_tmp126_ = _data3_->steam_launcher;
					_tmp127_ = ((ProtonPlusModelsLauncher*) _tmp126_)->compatibility_tools;
					_compatibility_tool_list = _tmp127_;
					_tmp128_ = _compatibility_tool_list;
					_tmp129_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp128_);
					_tmp130_ = _tmp129_;
					_compatibility_tool_size = _tmp130_;
					_compatibility_tool_index = -1;
					while (TRUE) {
						gint _tmp131_;
						gint _tmp132_;
						ProtonPlusModelsCompatibilityTool* compatibility_tool = NULL;
						GeeLinkedList* _tmp133_;
						gpointer _tmp134_;
						gboolean _tmp135_ = FALSE;
						gboolean _tmp136_ = FALSE;
						ProtonPlusModelsCompatibilityTool* _tmp137_;
						gboolean _tmp138_;
						gboolean _tmp139_;
						_compatibility_tool_index = _compatibility_tool_index + 1;
						_tmp131_ = _compatibility_tool_index;
						_tmp132_ = _compatibility_tool_size;
						if (!(_tmp131_ < _tmp132_)) {
							break;
						}
						_tmp133_ = _compatibility_tool_list;
						_tmp134_ = gee_abstract_list_get ((GeeAbstractList*) _tmp133_, _compatibility_tool_index);
						compatibility_tool = (ProtonPlusModelsCompatibilityTool*) _tmp134_;
						_tmp137_ = compatibility_tool;
						_tmp138_ = proton_plus_models_compatibility_tool_get_is_assignable (_tmp137_);
						_tmp139_ = _tmp138_;
						if (_tmp139_) {
							ProtonPlusModelsCompatibilityTool* _tmp140_;
							gboolean _tmp141_;
							gboolean _tmp142_;
							_tmp140_ = compatibility_tool;
							_tmp141_ = proton_plus_models_compatibility_tool_get_is_available (_tmp140_);
							_tmp142_ = _tmp141_;
							_tmp136_ = _tmp142_;
						} else {
							_tmp136_ = FALSE;
						}
						if (_tmp136_) {
							ProtonPlusModelsCompatibilityTool* _tmp143_;
							const gchar* _tmp144_;
							const gchar* _tmp145_;
							ProtonPlusModelsCompatibilityTool* _tmp146_;
							const gchar* _tmp147_;
							const gchar* _tmp148_;
							_tmp143_ = compatibility_tool;
							_tmp144_ = proton_plus_models_compatibility_tool_get_display_title (_tmp143_);
							_tmp145_ = _tmp144_;
							_tmp146_ = compatibility_tool;
							_tmp147_ = proton_plus_models_compatibility_tool_get_internal_title (_tmp146_);
							_tmp148_ = _tmp147_;
							_tmp135_ = !proton_plus_models_launchers_steam_is_steam_linux_runtime (_tmp145_, _tmp148_);
						} else {
							_tmp135_ = FALSE;
						}
						if (_tmp135_) {
							GeeArrayList* _tmp149_;
							ProtonPlusModelsCompatibilityTool* _tmp150_;
							_tmp149_ = compatibility_tools;
							_tmp150_ = compatibility_tool;
							gee_abstract_collection_add ((GeeAbstractCollection*) _tmp149_, _tmp150_);
						}
						_g_object_unref0 (compatibility_tool);
					}
				}
				_tmp151_ = compatibility_tools;
				gee_list_sort ((GeeList*) _tmp151_, ______lambda345__gcompare_data_func, g_object_ref (self), g_object_unref);
				_tmp152_ = g_list_store_new (PROTON_PLUS_MODELS_TYPE_COMPATIBILITY_TOOL);
				model = _tmp152_;
				{
					GeeArrayList* _compatibility_tool_list = NULL;
					GeeArrayList* _tmp153_;
					gint _compatibility_tool_size = 0;
					GeeArrayList* _tmp154_;
					gint _tmp155_;
					gint _tmp156_;
					gint _compatibility_tool_index = 0;
					_tmp153_ = compatibility_tools;
					_compatibility_tool_list = _tmp153_;
					_tmp154_ = _compatibility_tool_list;
					_tmp155_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp154_);
					_tmp156_ = _tmp155_;
					_compatibility_tool_size = _tmp156_;
					_compatibility_tool_index = -1;
					while (TRUE) {
						gint _tmp157_;
						gint _tmp158_;
						ProtonPlusModelsCompatibilityTool* compatibility_tool = NULL;
						GeeArrayList* _tmp159_;
						gpointer _tmp160_;
						GListStore* _tmp161_;
						ProtonPlusModelsCompatibilityTool* _tmp162_;
						_compatibility_tool_index = _compatibility_tool_index + 1;
						_tmp157_ = _compatibility_tool_index;
						_tmp158_ = _compatibility_tool_size;
						if (!(_tmp157_ < _tmp158_)) {
							break;
						}
						_tmp159_ = _compatibility_tool_list;
						_tmp160_ = gee_abstract_list_get ((GeeAbstractList*) _tmp159_, _compatibility_tool_index);
						compatibility_tool = (ProtonPlusModelsCompatibilityTool*) _tmp160_;
						_tmp161_ = model;
						_tmp162_ = compatibility_tool;
						g_list_store_append (_tmp161_, (GObject*) _tmp162_);
						_g_object_unref0 (compatibility_tool);
					}
				}
				_tmp163_ = (GtkPropertyExpression*) gtk_property_expression_new (PROTON_PLUS_MODELS_TYPE_COMPATIBILITY_TOOL, NULL, "display_title");
				expression = _tmp163_;
				_tmp164_ = model;
				_tmp165_ = expression;
				_tmp166_ = g_strdup (_ ("Default compatibility tool"));
				_tmp167_ = g_strdup (_ ("The compatibility tool games will use by default"));
				_tmp168_ = proton_plus_widgets_preferences_tool_row_new (_tmp164_, _tmp165_);
				adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp168_, _tmp166_);
				_g_free0 (_tmp166_);
				adw_action_row_set_subtitle ((AdwActionRow*) _tmp168_, _tmp167_);
				_g_free0 (_tmp167_);
				g_object_ref_sink (_tmp168_);
				_data3_->compatibility_tool_row = _tmp168_;
				_tmp169_ = _data3_->compatibility_tool_row;
				_tmp170_ = (GtkImage*) gtk_image_new_from_icon_name ("screwdriver-wrench-symbolic");
				g_object_ref_sink (_tmp170_);
				_tmp171_ = _tmp170_;
				adw_action_row_add_prefix ((AdwActionRow*) _tmp169_, (GtkWidget*) _tmp171_);
				_g_object_unref0 (_tmp171_);
				{
					gint i = 0;
					i = 0;
					{
						gboolean _tmp172_ = FALSE;
						_tmp172_ = TRUE;
						while (TRUE) {
							GeeArrayList* _tmp174_;
							gint _tmp175_;
							gint _tmp176_;
							GeeArrayList* _tmp177_;
							gpointer _tmp178_;
							ProtonPlusModelsCompatibilityTool* _tmp179_;
							const gchar* _tmp180_;
							const gchar* _tmp181_;
							ProtonPlusModelsLaunchersSteam* _tmp182_;
							const gchar* _tmp183_;
							const gchar* _tmp184_;
							gboolean _tmp185_;
							if (!_tmp172_) {
								gint _tmp173_;
								_tmp173_ = i;
								i = _tmp173_ + 1;
							}
							_tmp172_ = FALSE;
							_tmp174_ = compatibility_tools;
							_tmp175_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp174_);
							_tmp176_ = _tmp175_;
							if (!(i < ((gint) _tmp176_))) {
								break;
							}
							_tmp177_ = compatibility_tools;
							_tmp178_ = gee_abstract_list_get ((GeeAbstractList*) _tmp177_, i);
							_tmp179_ = (ProtonPlusModelsCompatibilityTool*) _tmp178_;
							_tmp180_ = proton_plus_models_compatibility_tool_get_internal_title (_tmp179_);
							_tmp181_ = _tmp180_;
							_tmp182_ = _data3_->steam_launcher;
							_tmp183_ = proton_plus_models_launchers_steam_get_default_compatibility_tool (_tmp182_);
							_tmp184_ = _tmp183_;
							_tmp185_ = g_strcmp0 (_tmp181_, _tmp184_) == 0;
							_g_object_unref0 (_tmp179_);
							if (_tmp185_) {
								ProtonPlusWidgetsPreferencesToolRow* _tmp186_;
								_tmp186_ = _data3_->compatibility_tool_row;
								adw_combo_row_set_selected ((AdwComboRow*) _tmp186_, (guint) i);
								break;
							}
						}
					}
				}
				_tmp187_ = _data3_->compatibility_tool_row;
				g_signal_connect_data ((GObject*) _tmp187_, "notify::selected-item", (GCallback) ______lambda348__g_object_notify, block3_data_ref (_data3_), (GClosureNotify) block3_data_unref, 0);
				_tmp188_ = steam_group;
				_tmp189_ = _data3_->compatibility_tool_row;
				adw_preferences_group_add (_tmp188_, (GtkWidget*) _tmp189_);
				_tmp191_ = _data3_->steam_launcher;
				_tmp192_ = proton_plus_models_launcher_get_game_library_available ((ProtonPlusModelsLauncher*) _tmp191_);
				_tmp193_ = _tmp192_;
				if (_tmp193_) {
					ProtonPlusModelsLaunchersSteam* _tmp194_;
					ProtonPlusModelsSteamProfile* _tmp195_;
					ProtonPlusModelsSteamProfile* _tmp196_;
					_tmp194_ = _data3_->steam_launcher;
					_tmp195_ = proton_plus_models_launchers_steam_get_profile (_tmp194_);
					_tmp196_ = _tmp195_;
					_tmp190_ = _tmp196_ != NULL;
				} else {
					_tmp190_ = FALSE;
				}
				if (_tmp190_) {
					Block4Data* _data4_;
					GListStore* profiles_model = NULL;
					GListStore* _tmp197_;
					ProtonPlusModelsLaunchersSteam* _tmp198_;
					GList* _tmp199_;
					GListStore* _tmp203_;
					gchar* _tmp204_;
					gchar* _tmp205_;
					ProtonPlusWidgetsPreferencesSteamProfileRow* _tmp206_ = NULL;
					ProtonPlusWidgetsPreferencesSteamProfileRow* _tmp207_;
					GtkImage* _tmp208_;
					GtkImage* _tmp209_;
					ProtonPlusWidgetsPreferencesSteamProfileRow* _tmp210_;
					ProtonPlusModelsLaunchersSteam* _tmp211_;
					GList* _tmp212_;
					ProtonPlusModelsLaunchersSteam* _tmp213_;
					ProtonPlusModelsSteamProfile* _tmp214_;
					ProtonPlusModelsSteamProfile* _tmp215_;
					ProtonPlusWidgetsPreferencesSteamShortcutRow* _tmp216_;
					gchar* last_profile_id = NULL;
					GSettings* _tmp217_;
					gchar* _tmp218_;
					ProtonPlusWidgetsPreferencesSteamProfileRow* _tmp230_;
					AdwPreferencesGroup* _tmp231_;
					ProtonPlusWidgetsPreferencesSteamProfileRow* _tmp232_;
					AdwPreferencesGroup* _tmp233_;
					ProtonPlusWidgetsPreferencesSteamShortcutRow* _tmp234_;
					_data4_ = g_slice_new0 (Block4Data);
					_data4_->_ref_count_ = 1;
					_data4_->_data3_ = block3_data_ref (_data3_);
					_tmp197_ = g_list_store_new (PROTON_PLUS_MODELS_TYPE_STEAM_PROFILE);
					profiles_model = _tmp197_;
					_tmp198_ = _data3_->steam_launcher;
					_tmp199_ = _tmp198_->profiles;
					{
						GList* profile_collection = NULL;
						GList* profile_it = NULL;
						profile_collection = _tmp199_;
						for (profile_it = profile_collection; profile_it != NULL; profile_it = profile_it->next) {
							ProtonPlusModelsSteamProfile* _tmp200_;
							ProtonPlusModelsSteamProfile* profile = NULL;
							_tmp200_ = _g_object_ref0 ((ProtonPlusModelsSteamProfile*) profile_it->data);
							profile = _tmp200_;
							{
								GListStore* _tmp201_;
								ProtonPlusModelsSteamProfile* _tmp202_;
								_tmp201_ = profiles_model;
								_tmp202_ = profile;
								g_list_store_append (_tmp201_, (GObject*) _tmp202_);
								_g_object_unref0 (profile);
							}
						}
					}
					_tmp203_ = profiles_model;
					_tmp204_ = g_strdup (_ ("Selected profile"));
					_tmp205_ = g_strdup (_ ("Currently selected profile for Steam"));
					_tmp206_ = proton_plus_widgets_preferences_steam_profile_row_new (_tmp203_);
					adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp206_, _tmp204_);
					_g_free0 (_tmp204_);
					adw_action_row_set_subtitle ((AdwActionRow*) _tmp206_, _tmp205_);
					_g_free0 (_tmp205_);
					g_object_ref_sink (_tmp206_);
					_data4_->profile_row = _tmp206_;
					_tmp207_ = _data4_->profile_row;
					_tmp208_ = (GtkImage*) gtk_image_new_from_icon_name ("avatar-default-symbolic");
					g_object_ref_sink (_tmp208_);
					_tmp209_ = _tmp208_;
					adw_action_row_add_prefix ((AdwActionRow*) _tmp207_, (GtkWidget*) _tmp209_);
					_g_object_unref0 (_tmp209_);
					_tmp210_ = _data4_->profile_row;
					_tmp211_ = _data3_->steam_launcher;
					_tmp212_ = _tmp211_->profiles;
					gtk_widget_set_sensitive ((GtkWidget*) _tmp210_, g_list_length (_tmp212_) > ((guint) 1));
					_tmp213_ = _data3_->steam_launcher;
					_tmp214_ = proton_plus_models_launchers_steam_get_profile (_tmp213_);
					_tmp215_ = _tmp214_;
					_tmp216_ = proton_plus_widgets_preferences_steam_shortcut_row_new (_tmp215_);
					g_object_ref_sink (_tmp216_);
					_data4_->shortcut_row = _tmp216_;
					_tmp217_ = proton_plus_globals_SETTINGS;
					_tmp218_ = g_settings_get_string (_tmp217_, "steam-selected-profile-id");
					last_profile_id = _tmp218_;
					{
						gint i = 0;
						i = 0;
						{
							gboolean _tmp219_ = FALSE;
							_tmp219_ = TRUE;
							while (TRUE) {
								ProtonPlusModelsLaunchersSteam* _tmp221_;
								GList* _tmp222_;
								ProtonPlusModelsLaunchersSteam* _tmp223_;
								GList* _tmp224_;
								gconstpointer _tmp225_;
								const gchar* _tmp226_;
								const gchar* _tmp227_;
								const gchar* _tmp228_;
								if (!_tmp219_) {
									gint _tmp220_;
									_tmp220_ = i;
									i = _tmp220_ + 1;
								}
								_tmp219_ = FALSE;
								_tmp221_ = _data3_->steam_launcher;
								_tmp222_ = _tmp221_->profiles;
								if (!(i < ((gint) g_list_length (_tmp222_)))) {
									break;
								}
								_tmp223_ = _data3_->steam_launcher;
								_tmp224_ = _tmp223_->profiles;
								_tmp225_ = g_list_nth_data (_tmp224_, (guint) i);
								_tmp226_ = proton_plus_models_steam_profile_get_steam_id ((ProtonPlusModelsSteamProfile*) _tmp225_);
								_tmp227_ = _tmp226_;
								_tmp228_ = last_profile_id;
								if (g_strcmp0 (_tmp227_, _tmp228_) == 0) {
									ProtonPlusWidgetsPreferencesSteamProfileRow* _tmp229_;
									_tmp229_ = _data4_->profile_row;
									adw_combo_row_set_selected ((AdwComboRow*) _tmp229_, (guint) i);
									break;
								}
							}
						}
					}
					_tmp230_ = _data4_->profile_row;
					g_signal_connect_data ((GObject*) _tmp230_, "notify::selected-item", (GCallback) _______lambda351__g_object_notify, block4_data_ref (_data4_), (GClosureNotify) block4_data_unref, 0);
					_tmp231_ = steam_group;
					_tmp232_ = _data4_->profile_row;
					adw_preferences_group_add (_tmp231_, (GtkWidget*) _tmp232_);
					_tmp233_ = steam_group;
					_tmp234_ = _data4_->shortcut_row;
					adw_preferences_group_add (_tmp233_, (GtkWidget*) _tmp234_);
					_g_free0 (last_profile_id);
					_g_object_unref0 (profiles_model);
					block4_data_unref (_data4_);
					_data4_ = NULL;
				}
				_tmp235_ = launchers_page;
				_tmp236_ = steam_group;
				adw_preferences_page_add (_tmp235_, _tmp236_);
				has_launchers = TRUE;
				_gtk_expression_unref0 (expression);
				_g_object_unref0 (model);
				_g_object_unref0 (compatibility_tools);
				_g_object_unref0 (steam_group);
				block3_data_unref (_data3_);
				_data3_ = NULL;
				_g_object_unref0 (launcher);
				break;
			}
			_g_object_unref0 (launcher);
		}
	}
	if (has_launchers) {
		AdwPreferencesPage* _tmp237_;
		_tmp237_ = launchers_page;
		proton_plus_widgets_preferences_preferences_dialog_add_controller_page (self, _tmp237_);
	}
	_tmp238_ = g_strdup (_ ("Advanced"));
	_tmp239_ = g_strdup ("preferences-other-symbolic");
	_tmp240_ = (AdwPreferencesPage*) adw_preferences_page_new ();
	adw_preferences_page_set_title (_tmp240_, _tmp238_);
	_g_free0 (_tmp238_);
	adw_preferences_page_set_icon_name (_tmp240_, _tmp239_);
	_g_free0 (_tmp239_);
	g_object_ref_sink (_tmp240_);
	advanced_page = _tmp240_;
	_tmp241_ = advanced_page;
	proton_plus_widgets_preferences_preferences_dialog_add_controller_page (self, _tmp241_);
	_tmp242_ = g_strdup (_ ("API Tokens"));
	_tmp243_ = (AdwPreferencesGroup*) adw_preferences_group_new ();
	adw_preferences_group_set_title (_tmp243_, _tmp242_);
	_g_free0 (_tmp242_);
	g_object_ref_sink (_tmp243_);
	tokens_group = _tmp243_;
	_tmp244_ = advanced_page;
	_tmp245_ = tokens_group;
	adw_preferences_page_add (_tmp244_, _tmp245_);
	_tmp246_ = proton_plus_widgets_preferences_access_token_row_new ("GitHub", "github-symbolic", "https://github.com/settings/tokens");
	g_object_ref_sink (_tmp246_);
	github_access_token_row = _tmp246_;
	_tmp247_ = proton_plus_globals_SETTINGS;
	_tmp248_ = github_access_token_row;
	g_settings_bind (_tmp247_, "github-api-key", (GObject*) _tmp248_, "text", G_SETTINGS_BIND_DEFAULT);
	_tmp249_ = tokens_group;
	_tmp250_ = github_access_token_row;
	adw_preferences_group_add (_tmp249_, (GtkWidget*) _tmp250_);
	_tmp251_ = proton_plus_widgets_preferences_access_token_row_new ("GitLab", "gitlab-symbolic", "https://gitlab.com/-/user_settings/personal_access_tokens");
	g_object_ref_sink (_tmp251_);
	gitlab_access_token_row = _tmp251_;
	_tmp252_ = proton_plus_globals_SETTINGS;
	_tmp253_ = gitlab_access_token_row;
	g_settings_bind (_tmp252_, "gitlab-api-key", (GObject*) _tmp253_, "text", G_SETTINGS_BIND_DEFAULT);
	_tmp254_ = tokens_group;
	_tmp255_ = gitlab_access_token_row;
	adw_preferences_group_add (_tmp254_, (GtkWidget*) _tmp255_);
	_tmp256_ = g_strdup (_ ("Network"));
	_tmp257_ = (AdwPreferencesGroup*) adw_preferences_group_new ();
	adw_preferences_group_set_title (_tmp257_, _tmp256_);
	_g_free0 (_tmp256_);
	g_object_ref_sink (_tmp257_);
	network_group = _tmp257_;
	_tmp258_ = advanced_page;
	_tmp259_ = network_group;
	adw_preferences_page_add (_tmp258_, _tmp259_);
	_tmp260_ = proton_plus_widgets_preferences_proxy_mode_row_new ();
	g_object_ref_sink (_tmp260_);
	proxy_mode_row = _tmp260_;
	_tmp261_ = network_group;
	_tmp262_ = proxy_mode_row;
	adw_preferences_group_add (_tmp261_, (GtkWidget*) _tmp262_);
	_tmp263_ = g_strdup (_ ("Proxy URL"));
	_tmp264_ = (AdwEntryRow*) adw_entry_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp264_, _tmp263_);
	_g_free0 (_tmp263_);
	g_object_ref_sink (_tmp264_);
	_g_object_unref0 (self->priv->proxy_url_row);
	self->priv->proxy_url_row = _tmp264_;
	_tmp265_ = self->priv->proxy_url_row;
	proton_plus_utils_text_input_metadata_policy_apply ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (_tmp265_, adw_entry_row_get_type (), AdwEntryRow), PROTON_PLUS_UTILS_TEXT_INPUT_FIELD_KIND_URL);
	_tmp266_ = self->priv->proxy_url_row;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp266_, _ ("Example: http://127.0.0.1:7890 or socks5://127.0.0.1:1080"));
	_tmp267_ = self->priv->proxy_url_row;
	_tmp268_ = proton_plus_globals_SETTINGS;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp267_, g_settings_get_enum (_tmp268_, "proxy-mode") == 1);
	_tmp269_ = proton_plus_globals_SETTINGS;
	_tmp270_ = self->priv->proxy_url_row;
	g_settings_bind (_tmp269_, "proxy-url", (GObject*) _tmp270_, "text", G_SETTINGS_BIND_DEFAULT);
	_tmp271_ = proton_plus_globals_SETTINGS;
	_tmp272_ = g_signal_connect_object (_tmp271_, "changed::proxy-mode", (GCallback) _proton_plus_widgets_preferences_preferences_dialog_update_proxy_url_sensitivity_g_settings_changed, self, 0);
	self->priv->proxy_mode_changed_handler = _tmp272_;
	_tmp273_ = network_group;
	_tmp274_ = self->priv->proxy_url_row;
	adw_preferences_group_add (_tmp273_, (GtkWidget*) _tmp274_);
	_tmp275_ = g_strdup (_ ("Download speed limit"));
	_tmp276_ = g_strdup (_ ("Maximum total speed in KB/s for all downloads. Set to 0 for unlimited."));
	_tmp277_ = (AdwSpinRow*) adw_spin_row_new_with_range ((gdouble) 0, (gdouble) 10240, (gdouble) 1);
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp277_, _tmp275_);
	_g_free0 (_tmp275_);
	adw_action_row_set_subtitle ((AdwActionRow*) _tmp277_, _tmp276_);
	_g_free0 (_tmp276_);
	g_object_ref_sink (_tmp277_);
	_g_object_unref0 (self->priv->download_speed_limit_row);
	self->priv->download_speed_limit_row = _tmp277_;
	_tmp278_ = self->priv->download_speed_limit_row;
	adw_spin_row_set_digits (G_TYPE_CHECK_INSTANCE_CAST (_tmp278_, adw_spin_row_get_type (), AdwSpinRow), (guint) 0);
	_tmp279_ = self->priv->download_speed_limit_row;
	gtk_widget_set_tooltip_text ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (_tmp279_, adw_spin_row_get_type (), AdwSpinRow), _ ("This limit is shared across all active downloads."));
	proton_plus_widgets_preferences_preferences_dialog_update_download_speed_limit_row (self);
	_tmp280_ = self->priv->download_speed_limit_row;
	g_signal_connect_object ((GObject*) G_TYPE_CHECK_INSTANCE_CAST (_tmp280_, adw_spin_row_get_type (), AdwSpinRow), "notify::value", (GCallback) ___lambda353__g_object_notify, self, 0);
	_tmp281_ = proton_plus_globals_SETTINGS;
	_tmp282_ = g_strconcat ("changed::", PROTON_PLUS_WIDGETS_PREFERENCES_PREFERENCES_DIALOG_DOWNLOAD_SPEED_LIMIT_KEY, NULL);
	_tmp283_ = g_signal_connect_object (_tmp281_, _tmp282_, (GCallback) _proton_plus_widgets_preferences_preferences_dialog_update_download_speed_limit_row_g_settings_changed, self, 0);
	self->priv->download_speed_limit_changed_handler = _tmp283_;
	_g_free0 (_tmp282_);
	_tmp284_ = network_group;
	_tmp285_ = self->priv->download_speed_limit_row;
	adw_preferences_group_add (_tmp284_, (GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (_tmp285_, adw_spin_row_get_type (), AdwSpinRow));
	_tmp286_ = g_strdup (_ ("Experimental"));
	_tmp287_ = (AdwPreferencesGroup*) adw_preferences_group_new ();
	adw_preferences_group_set_title (_tmp287_, _tmp286_);
	_g_free0 (_tmp286_);
	g_object_ref_sink (_tmp287_);
	experimental_group = _tmp287_;
	_tmp288_ = advanced_page;
	_tmp289_ = experimental_group;
	adw_preferences_page_add (_tmp288_, _tmp289_);
	_tmp290_ = g_strdup (_ ("Preview features"));
	_tmp291_ = g_strdup (_ ("Enable experimental features for early testing"));
	_tmp292_ = (AdwSwitchRow*) adw_switch_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp292_, _tmp290_);
	_g_free0 (_tmp290_);
	adw_action_row_set_subtitle ((AdwActionRow*) _tmp292_, _tmp291_);
	_g_free0 (_tmp291_);
	g_object_ref_sink (_tmp292_);
	experimental_features_row = _tmp292_;
	_tmp293_ = experimental_features_row;
	_tmp294_ = (GtkImage*) gtk_image_new_from_icon_name ("flask-symbolic");
	g_object_ref_sink (_tmp294_);
	_tmp295_ = _tmp294_;
	adw_action_row_add_prefix ((AdwActionRow*) _tmp293_, (GtkWidget*) _tmp295_);
	_g_object_unref0 (_tmp295_);
	_tmp296_ = proton_plus_globals_SETTINGS;
	_tmp297_ = experimental_features_row;
	g_settings_bind (_tmp296_, "experimental-features", (GObject*) _tmp297_, "active", G_SETTINGS_BIND_DEFAULT);
	_tmp298_ = experimental_group;
	_tmp299_ = experimental_features_row;
	adw_preferences_group_add (_tmp298_, (GtkWidget*) _tmp299_);
	_tmp300_ = g_strdup (_ ("Maintenance"));
	_tmp301_ = (AdwPreferencesGroup*) adw_preferences_group_new ();
	adw_preferences_group_set_title (_tmp301_, _tmp300_);
	_g_free0 (_tmp300_);
	g_object_ref_sink (_tmp301_);
	maintenance_group = _tmp301_;
	_tmp302_ = advanced_page;
	_tmp303_ = maintenance_group;
	adw_preferences_page_add (_tmp302_, _tmp303_);
	_tmp304_ = maintenance_group;
	_tmp305_ = proton_plus_widgets_preferences_refresh_application_data_row_new ();
	g_object_ref_sink (_tmp305_);
	_tmp306_ = _tmp305_;
	adw_preferences_group_add (_tmp304_, (GtkWidget*) _tmp306_);
	_g_object_unref0 (_tmp306_);
	_tmp307_ = maintenance_group;
	_tmp308_ = proton_plus_widgets_preferences_delete_cache_row_new ();
	g_object_ref_sink (_tmp308_);
	_tmp309_ = _tmp308_;
	adw_preferences_group_add (_tmp307_, (GtkWidget*) _tmp309_);
	_g_object_unref0 (_tmp309_);
	_tmp310_ = g_strdup (_ ("System"));
	_tmp311_ = g_strdup ("dialog-information-symbolic");
	_tmp312_ = (AdwPreferencesPage*) adw_preferences_page_new ();
	adw_preferences_page_set_title (_tmp312_, _tmp310_);
	_g_free0 (_tmp310_);
	adw_preferences_page_set_icon_name (_tmp312_, _tmp311_);
	_g_free0 (_tmp311_);
	g_object_ref_sink (_tmp312_);
	system_page = _tmp312_;
	_tmp313_ = system_page;
	proton_plus_widgets_preferences_preferences_dialog_add_controller_page (self, _tmp313_);
	_tmp314_ = g_strdup (_ ("Software Environment"));
	_tmp315_ = (AdwPreferencesGroup*) adw_preferences_group_new ();
	adw_preferences_group_set_title (_tmp315_, _tmp314_);
	_g_free0 (_tmp314_);
	g_object_ref_sink (_tmp315_);
	environment_group = _tmp315_;
	_tmp316_ = system_page;
	_tmp317_ = environment_group;
	adw_preferences_page_add (_tmp316_, _tmp317_);
	if (proton_plus_globals_IS_STEAM_OS) {
		_tmp318_ = _ ("Yes");
	} else {
		_tmp318_ = _ ("No");
	}
	_tmp319_ = environment_group;
	_tmp320_ = g_strdup (_ ("SteamOS"));
	_tmp321_ = g_strdup (_tmp318_);
	_tmp322_ = (AdwActionRow*) adw_action_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp322_, _tmp320_);
	_g_free0 (_tmp320_);
	adw_action_row_set_subtitle (_tmp322_, _tmp321_);
	_g_free0 (_tmp321_);
	g_object_ref_sink (_tmp322_);
	_tmp323_ = _tmp322_;
	adw_preferences_group_add (_tmp319_, (GtkWidget*) _tmp323_);
	_g_object_unref0 (_tmp323_);
	if (proton_plus_globals_IS_FLATPAK) {
		_tmp324_ = _ ("Yes");
	} else {
		_tmp324_ = _ ("No");
	}
	_tmp325_ = environment_group;
	_tmp326_ = g_strdup (_ ("Flatpak"));
	_tmp327_ = g_strdup (_tmp324_);
	_tmp328_ = (AdwActionRow*) adw_action_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp328_, _tmp326_);
	_g_free0 (_tmp326_);
	adw_action_row_set_subtitle (_tmp328_, _tmp327_);
	_g_free0 (_tmp327_);
	g_object_ref_sink (_tmp328_);
	_tmp329_ = _tmp328_;
	adw_preferences_group_add (_tmp325_, (GtkWidget*) _tmp329_);
	_g_object_unref0 (_tmp329_);
	_tmp330_ = g_strdup (_ ("Hardware"));
	_tmp331_ = (AdwPreferencesGroup*) adw_preferences_group_new ();
	adw_preferences_group_set_title (_tmp331_, _tmp330_);
	_g_free0 (_tmp330_);
	g_object_ref_sink (_tmp331_);
	hardware_group = _tmp331_;
	_tmp332_ = system_page;
	_tmp333_ = hardware_group;
	adw_preferences_page_add (_tmp332_, _tmp333_);
	_tmp334_ = g_strdup ("");
	hwcaps_str = _tmp334_;
	_tmp335_ = proton_plus_globals_HWCAPS;
	{
		GList* hwcap_collection = NULL;
		GList* hwcap_it = NULL;
		hwcap_collection = _tmp335_;
		for (hwcap_it = hwcap_collection; hwcap_it != NULL; hwcap_it = hwcap_it->next) {
			gchar* _tmp336_;
			gchar* hwcap = NULL;
			_tmp336_ = g_strdup ((const gchar*) hwcap_it->data);
			hwcap = _tmp336_;
			{
				const gchar* _tmp337_;
				const gchar* _tmp340_;
				const gchar* _tmp341_;
				gchar* _tmp342_;
				_tmp337_ = hwcaps_str;
				if (g_strcmp0 (_tmp337_, "") != 0) {
					const gchar* _tmp338_;
					gchar* _tmp339_;
					_tmp338_ = hwcaps_str;
					_tmp339_ = g_strconcat (_tmp338_, ", ", NULL);
					_g_free0 (hwcaps_str);
					hwcaps_str = _tmp339_;
				}
				_tmp340_ = hwcaps_str;
				_tmp341_ = hwcap;
				_tmp342_ = g_strconcat (_tmp340_, _tmp341_, NULL);
				_g_free0 (hwcaps_str);
				hwcaps_str = _tmp342_;
				_g_free0 (hwcap);
			}
		}
	}
	_tmp343_ = hardware_group;
	_tmp344_ = g_strdup (_ ("HWCAPS"));
	_tmp345_ = hwcaps_str;
	_tmp346_ = g_strdup (_tmp345_);
	_tmp347_ = (AdwActionRow*) adw_action_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp347_, _tmp344_);
	_g_free0 (_tmp344_);
	adw_action_row_set_subtitle (_tmp347_, _tmp346_);
	_g_free0 (_tmp346_);
	g_object_ref_sink (_tmp347_);
	_tmp348_ = _tmp347_;
	adw_preferences_group_add (_tmp343_, (GtkWidget*) _tmp348_);
	_g_object_unref0 (_tmp348_);
	_tmp349_ = g_strdup (_ ("Dependencies"));
	_tmp350_ = (AdwPreferencesGroup*) adw_preferences_group_new ();
	adw_preferences_group_set_title (_tmp350_, _tmp349_);
	_g_free0 (_tmp349_);
	g_object_ref_sink (_tmp350_);
	dependencies_group = _tmp350_;
	_tmp351_ = system_page;
	_tmp352_ = dependencies_group;
	adw_preferences_page_add (_tmp351_, _tmp352_);
	if (proton_plus_globals_PROTONTRICKS_INSTALLED) {
		_tmp353_ = _ ("Yes");
	} else {
		_tmp353_ = _ ("No");
	}
	_tmp354_ = dependencies_group;
	_tmp355_ = g_strdup (_ ("Protontricks"));
	_tmp356_ = g_strdup (_tmp353_);
	_tmp357_ = (AdwActionRow*) adw_action_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp357_, _tmp355_);
	_g_free0 (_tmp355_);
	adw_action_row_set_subtitle (_tmp357_, _tmp356_);
	_g_free0 (_tmp356_);
	g_object_ref_sink (_tmp357_);
	_tmp358_ = _tmp357_;
	adw_preferences_group_add (_tmp354_, (GtkWidget*) _tmp358_);
	_g_object_unref0 (_tmp358_);
	if (proton_plus_globals_PROTONTRICKS_FLATPAK_INSTALLED) {
		_tmp359_ = _ ("Yes");
	} else {
		_tmp359_ = _ ("No");
	}
	_tmp360_ = dependencies_group;
	_tmp361_ = g_strdup (_ ("Protontricks (Flatpak)"));
	_tmp362_ = g_strdup (_tmp359_);
	_tmp363_ = (AdwActionRow*) adw_action_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp363_, _tmp361_);
	_g_free0 (_tmp361_);
	adw_action_row_set_subtitle (_tmp363_, _tmp362_);
	_g_free0 (_tmp362_);
	g_object_ref_sink (_tmp363_);
	_tmp364_ = _tmp363_;
	adw_preferences_group_add (_tmp360_, (GtkWidget*) _tmp364_);
	_g_object_unref0 (_tmp364_);
	if (proton_plus_globals_MANGOHUD_INSTALLED) {
		_tmp365_ = _ ("Yes");
	} else {
		_tmp365_ = _ ("No");
	}
	_tmp366_ = dependencies_group;
	_tmp367_ = g_strdup (_ ("MangoHud"));
	_tmp368_ = g_strdup (_tmp365_);
	_tmp369_ = (AdwActionRow*) adw_action_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp369_, _tmp367_);
	_g_free0 (_tmp367_);
	adw_action_row_set_subtitle (_tmp369_, _tmp368_);
	_g_free0 (_tmp368_);
	g_object_ref_sink (_tmp369_);
	_tmp370_ = _tmp369_;
	adw_preferences_group_add (_tmp366_, (GtkWidget*) _tmp370_);
	_g_object_unref0 (_tmp370_);
	if (proton_plus_globals_MANGOHUD_FLATPAK_INSTALLED) {
		_tmp371_ = _ ("Yes");
	} else {
		_tmp371_ = _ ("No");
	}
	_tmp372_ = dependencies_group;
	_tmp373_ = g_strdup (_ ("MangoHud (Flatpak)"));
	_tmp374_ = g_strdup (_tmp371_);
	_tmp375_ = (AdwActionRow*) adw_action_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp375_, _tmp373_);
	_g_free0 (_tmp373_);
	adw_action_row_set_subtitle (_tmp375_, _tmp374_);
	_g_free0 (_tmp374_);
	g_object_ref_sink (_tmp375_);
	_tmp376_ = _tmp375_;
	adw_preferences_group_add (_tmp372_, (GtkWidget*) _tmp376_);
	_g_object_unref0 (_tmp376_);
	if (proton_plus_globals_GAMESCOPE_INSTALLED) {
		_tmp377_ = _ ("Yes");
	} else {
		_tmp377_ = _ ("No");
	}
	_tmp378_ = dependencies_group;
	_tmp379_ = g_strdup (_ ("Gamescope"));
	_tmp380_ = g_strdup (_tmp377_);
	_tmp381_ = (AdwActionRow*) adw_action_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp381_, _tmp379_);
	_g_free0 (_tmp379_);
	adw_action_row_set_subtitle (_tmp381_, _tmp380_);
	_g_free0 (_tmp380_);
	g_object_ref_sink (_tmp381_);
	_tmp382_ = _tmp381_;
	adw_preferences_group_add (_tmp378_, (GtkWidget*) _tmp382_);
	_g_object_unref0 (_tmp382_);
	if (proton_plus_globals_SCOPEBUDDY_INSTALLED) {
		_tmp383_ = _ ("Yes");
	} else {
		_tmp383_ = _ ("No");
	}
	_tmp384_ = dependencies_group;
	_tmp385_ = g_strdup (_ ("ScopeBuddy"));
	_tmp386_ = g_strdup (_tmp383_);
	_tmp387_ = (AdwActionRow*) adw_action_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp387_, _tmp385_);
	_g_free0 (_tmp385_);
	adw_action_row_set_subtitle (_tmp387_, _tmp386_);
	_g_free0 (_tmp386_);
	g_object_ref_sink (_tmp387_);
	_tmp388_ = _tmp387_;
	adw_preferences_group_add (_tmp384_, (GtkWidget*) _tmp388_);
	_g_object_unref0 (_tmp388_);
	if (proton_plus_globals_GAMEMODE_INSTALLED) {
		_tmp389_ = _ ("Yes");
	} else {
		_tmp389_ = _ ("No");
	}
	_tmp390_ = dependencies_group;
	_tmp391_ = g_strdup (_ ("Feral Gamemode"));
	_tmp392_ = g_strdup (_tmp389_);
	_tmp393_ = (AdwActionRow*) adw_action_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp393_, _tmp391_);
	_g_free0 (_tmp391_);
	adw_action_row_set_subtitle (_tmp393_, _tmp392_);
	_g_free0 (_tmp392_);
	g_object_ref_sink (_tmp393_);
	_tmp394_ = _tmp393_;
	adw_preferences_group_add (_tmp390_, (GtkWidget*) _tmp394_);
	_g_object_unref0 (_tmp394_);
	_tmp395_ = g_strdup (_ ("Detected Launchers"));
	_tmp396_ = (AdwPreferencesGroup*) adw_preferences_group_new ();
	adw_preferences_group_set_title (_tmp396_, _tmp395_);
	_g_free0 (_tmp395_);
	g_object_ref_sink (_tmp396_);
	detected_launchers_group = _tmp396_;
	_tmp397_ = system_page;
	_tmp398_ = detected_launchers_group;
	adw_preferences_page_add (_tmp397_, _tmp398_);
	_tmp399_ = proton_plus_models_launchers_steam_new (PROTON_PLUS_MODELS_LAUNCHER_INSTALLATION_TYPES_SYSTEM, NULL, NULL);
	_tmp400_ = proton_plus_models_launchers_steam_new (PROTON_PLUS_MODELS_LAUNCHER_INSTALLATION_TYPES_FLATPAK, NULL, NULL);
	_tmp401_ = proton_plus_models_launchers_steam_new (PROTON_PLUS_MODELS_LAUNCHER_INSTALLATION_TYPES_SNAP, NULL, NULL);
	_tmp402_ = proton_plus_models_launchers_faugus_launcher_new (PROTON_PLUS_MODELS_LAUNCHER_INSTALLATION_TYPES_SYSTEM, NULL, NULL, NULL, NULL, NULL);
	_tmp403_ = proton_plus_models_launchers_faugus_launcher_new (PROTON_PLUS_MODELS_LAUNCHER_INSTALLATION_TYPES_FLATPAK, NULL, NULL, NULL, NULL, NULL);
	_tmp404_ = proton_plus_models_launchers_lutris_new (PROTON_PLUS_MODELS_LAUNCHER_INSTALLATION_TYPES_SYSTEM);
	_tmp405_ = proton_plus_models_launchers_lutris_new (PROTON_PLUS_MODELS_LAUNCHER_INSTALLATION_TYPES_FLATPAK);
	_tmp406_ = proton_plus_models_launchers_bottles_new (PROTON_PLUS_MODELS_LAUNCHER_INSTALLATION_TYPES_SYSTEM);
	_tmp407_ = proton_plus_models_launchers_bottles_new (PROTON_PLUS_MODELS_LAUNCHER_INSTALLATION_TYPES_FLATPAK);
	_tmp408_ = proton_plus_models_launchers_heroic_games_launcher_new (PROTON_PLUS_MODELS_LAUNCHER_INSTALLATION_TYPES_SYSTEM);
	_tmp409_ = proton_plus_models_launchers_heroic_games_launcher_new (PROTON_PLUS_MODELS_LAUNCHER_INSTALLATION_TYPES_FLATPAK);
	_tmp410_ = proton_plus_models_launchers_wine_zgui_new (PROTON_PLUS_MODELS_LAUNCHER_INSTALLATION_TYPES_SYSTEM);
	_tmp411_ = proton_plus_models_launchers_wine_zgui_new (PROTON_PLUS_MODELS_LAUNCHER_INSTALLATION_TYPES_FLATPAK);
	_tmp412_ = g_new0 (ProtonPlusModelsLauncher*, 13 + 1);
	_tmp412_[0] = (ProtonPlusModelsLauncher*) _tmp399_;
	_tmp412_[1] = (ProtonPlusModelsLauncher*) _tmp400_;
	_tmp412_[2] = (ProtonPlusModelsLauncher*) _tmp401_;
	_tmp412_[3] = (ProtonPlusModelsLauncher*) _tmp402_;
	_tmp412_[4] = (ProtonPlusModelsLauncher*) _tmp403_;
	_tmp412_[5] = (ProtonPlusModelsLauncher*) _tmp404_;
	_tmp412_[6] = (ProtonPlusModelsLauncher*) _tmp405_;
	_tmp412_[7] = (ProtonPlusModelsLauncher*) _tmp406_;
	_tmp412_[8] = (ProtonPlusModelsLauncher*) _tmp407_;
	_tmp412_[9] = (ProtonPlusModelsLauncher*) _tmp408_;
	_tmp412_[10] = (ProtonPlusModelsLauncher*) _tmp409_;
	_tmp412_[11] = (ProtonPlusModelsLauncher*) _tmp410_;
	_tmp412_[12] = (ProtonPlusModelsLauncher*) _tmp411_;
	all_launchers = _tmp412_;
	all_launchers_length1 = 13;
	_all_launchers_size_ = all_launchers_length1;
	_tmp413_ = all_launchers;
	_tmp413__length1 = all_launchers_length1;
	{
		ProtonPlusModelsLauncher** launcher_collection = NULL;
		gint launcher_collection_length1 = 0;
		gint _launcher_collection_size_ = 0;
		gint launcher_it = 0;
		launcher_collection = _tmp413_;
		launcher_collection_length1 = _tmp413__length1;
		for (launcher_it = 0; launcher_it < launcher_collection_length1; launcher_it = launcher_it + 1) {
			ProtonPlusModelsLauncher* _tmp414_;
			ProtonPlusModelsLauncher* launcher = NULL;
			_tmp414_ = _g_object_ref0 (launcher_collection[launcher_it]);
			launcher = _tmp414_;
			{
				const gchar* _tmp415_ = NULL;
				ProtonPlusModelsLauncher* _tmp416_;
				AdwPreferencesGroup* _tmp417_;
				ProtonPlusModelsLauncher* _tmp418_;
				const gchar* _tmp419_;
				ProtonPlusModelsLauncher* _tmp420_;
				gchar* _tmp421_;
				gchar* _tmp422_;
				gchar* _tmp423_;
				gchar* _tmp424_;
				AdwActionRow* _tmp425_ = NULL;
				AdwActionRow* _tmp426_;
				_tmp416_ = launcher;
				if (_tmp416_->installed) {
					_tmp415_ = _ ("Installed");
				} else {
					_tmp415_ = _ ("Not installed");
				}
				_tmp417_ = detected_launchers_group;
				_tmp418_ = launcher;
				_tmp419_ = _tmp418_->title;
				_tmp420_ = launcher;
				_tmp421_ = proton_plus_models_launcher_get_installation_type_title (_tmp420_);
				_tmp422_ = _tmp421_;
				_tmp423_ = g_strdup_printf ("%s (%s)", _tmp419_, _tmp422_);
				_tmp424_ = g_strdup (_tmp415_);
				_tmp425_ = (AdwActionRow*) adw_action_row_new ();
				adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp425_, _tmp423_);
				_g_free0 (_tmp423_);
				adw_action_row_set_subtitle (_tmp425_, _tmp424_);
				_g_free0 (_tmp424_);
				g_object_ref_sink (_tmp425_);
				_tmp426_ = _tmp425_;
				adw_preferences_group_add (_tmp417_, (GtkWidget*) _tmp426_);
				_g_object_unref0 (_tmp426_);
				_g_free0 (_tmp422_);
				_g_object_unref0 (launcher);
			}
		}
	}
	all_launchers = (_vala_array_free (all_launchers, all_launchers_length1, (GDestroyNotify) g_object_unref), NULL);
	_g_object_unref0 (detected_launchers_group);
	_g_object_unref0 (dependencies_group);
	_g_free0 (hwcaps_str);
	_g_object_unref0 (hardware_group);
	_g_object_unref0 (environment_group);
	_g_object_unref0 (system_page);
	_g_object_unref0 (maintenance_group);
	_g_object_unref0 (experimental_features_row);
	_g_object_unref0 (experimental_group);
	_g_object_unref0 (proxy_mode_row);
	_g_object_unref0 (network_group);
	_g_object_unref0 (gitlab_access_token_row);
	_g_object_unref0 (github_access_token_row);
	_g_object_unref0 (tokens_group);
	_g_object_unref0 (advanced_page);
	_g_object_unref0 (launchers_page);
	_g_object_unref0 (legacy_tools_row);
	_g_object_unref0 (tools_behavior_group);
	_g_object_unref0 (migrate_default_prefix_row);
	_g_object_unref0 (check_updates_on_launch_row);
	_g_object_unref0 (check_updates_on_boot_row);
	_g_object_unref0 (background_updates_frequency_row);
	_g_object_unref0 (background_updates_row);
	_g_object_unref0 (updates_group);
	_g_object_unref0 (tools_page);
	_g_object_unref0 (introduction_btn);
	_g_object_unref0 (help_page);
	_g_object_unref0 (controller_haptics_row);
	_g_object_unref0 (confirm_button_choices);
	_g_object_unref0 (controller_group);
	_g_object_unref0 (language_row);
	_g_object_unref0 (theme_row);
	_g_object_unref0 (appearance_group);
	_g_object_unref0 (general_page);
	block2_data_unref (_data2_);
	_data2_ = NULL;
	return self;
}

ProtonPlusWidgetsPreferencesPreferencesDialog*
proton_plus_widgets_preferences_preferences_dialog_new (GeeLinkedList* launchers)
{
	return proton_plus_widgets_preferences_preferences_dialog_construct (PROTON_PLUS_WIDGETS_PREFERENCES_TYPE_PREFERENCES_DIALOG, launchers);
}

static void
_vala_array_add1 (AdwPreferencesPage** * array,
                  gint* length,
                  gint* size,
                  AdwPreferencesPage* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (AdwPreferencesPage*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
proton_plus_widgets_preferences_preferences_dialog_add_controller_page (ProtonPlusWidgetsPreferencesPreferencesDialog* self,
                                                                        AdwPreferencesPage* page)
{
	AdwPreferencesPage* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (page != NULL);
	adw_preferences_dialog_add ((AdwPreferencesDialog*) self, page);
	_tmp0_ = _g_object_ref0 (page);
	_vala_array_add1 (&self->priv->controller_pages, &self->priv->controller_pages_length1, &self->priv->_controller_pages_size_, _tmp0_);
}

static void
proton_plus_widgets_preferences_preferences_dialog_update_proxy_url_sensitivity (ProtonPlusWidgetsPreferencesPreferencesDialog* self)
{
	AdwEntryRow* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->proxy_url_row;
	if (_tmp0_ != NULL) {
		AdwEntryRow* _tmp1_;
		GSettings* _tmp2_;
		_tmp1_ = self->priv->proxy_url_row;
		_tmp2_ = proton_plus_globals_SETTINGS;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp1_, g_settings_get_enum (_tmp2_, "proxy-mode") == 1);
	}
}

static void
proton_plus_widgets_preferences_preferences_dialog_update_download_speed_limit_row (ProtonPlusWidgetsPreferencesPreferencesDialog* self)
{
	gboolean _tmp0_ = FALSE;
	AdwSpinRow* _tmp1_;
	gint64 limit_bps = 0LL;
	GSettings* _tmp3_;
	gdouble limit_kib = 0.0;
	AdwSpinRow* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->download_speed_limit_row;
	if (_tmp1_ == NULL) {
		_tmp0_ = TRUE;
	} else {
		GSettings* _tmp2_;
		_tmp2_ = proton_plus_globals_SETTINGS;
		_tmp0_ = _tmp2_ == NULL;
	}
	if (_tmp0_) {
		return;
	}
	_tmp3_ = proton_plus_globals_SETTINGS;
	limit_bps = g_settings_get_int64 (_tmp3_, PROTON_PLUS_WIDGETS_PREFERENCES_PREFERENCES_DIALOG_DOWNLOAD_SPEED_LIMIT_KEY);
	if (limit_bps < ((gint64) 0)) {
		limit_bps = (gint64) 0;
	}
	limit_kib = ((gdouble) limit_bps) / ((gdouble) PROTON_PLUS_WIDGETS_PREFERENCES_PREFERENCES_DIALOG_KILOBYTE);
	_tmp4_ = self->priv->download_speed_limit_row;
	if (fabs (adw_spin_row_get_value (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, adw_spin_row_get_type (), AdwSpinRow)) - limit_kib) > 0.0001) {
		AdwSpinRow* _tmp5_;
		_tmp5_ = self->priv->download_speed_limit_row;
		adw_spin_row_set_value (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, adw_spin_row_get_type (), AdwSpinRow), limit_kib);
	}
}

static void
proton_plus_widgets_preferences_preferences_dialog_real_dispose (GObject* base)
{
	ProtonPlusWidgetsPreferencesPreferencesDialog * self;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp3_ = FALSE;
	self = (ProtonPlusWidgetsPreferencesPreferencesDialog*) base;
	if (self->priv->proxy_mode_changed_handler != ((gulong) 0)) {
		GSettings* _tmp1_;
		_tmp1_ = proton_plus_globals_SETTINGS;
		_tmp0_ = _tmp1_ != NULL;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GSettings* _tmp2_;
		_tmp2_ = proton_plus_globals_SETTINGS;
		g_signal_handler_disconnect ((GObject*) _tmp2_, self->priv->proxy_mode_changed_handler);
		self->priv->proxy_mode_changed_handler = (gulong) 0;
	}
	if (self->priv->download_speed_limit_changed_handler != ((gulong) 0)) {
		GSettings* _tmp4_;
		_tmp4_ = proton_plus_globals_SETTINGS;
		_tmp3_ = _tmp4_ != NULL;
	} else {
		_tmp3_ = FALSE;
	}
	if (_tmp3_) {
		GSettings* _tmp5_;
		_tmp5_ = proton_plus_globals_SETTINGS;
		g_signal_handler_disconnect ((GObject*) _tmp5_, self->priv->download_speed_limit_changed_handler);
		self->priv->download_speed_limit_changed_handler = (gulong) 0;
	}
	_g_object_unref0 (self->priv->proxy_url_row);
	self->priv->proxy_url_row = NULL;
	_g_object_unref0 (self->priv->download_speed_limit_row);
	self->priv->download_speed_limit_row = NULL;
	G_OBJECT_CLASS (proton_plus_widgets_preferences_preferences_dialog_parent_class)->dispose ((GObject*) G_TYPE_CHECK_INSTANCE_CAST (self, adw_preferences_dialog_get_type (), AdwPreferencesDialog));
}

static gboolean
proton_plus_widgets_preferences_preferences_dialog_real_controller_switch_page (ProtonPlusUtilsControllerNavigationHost* base,
                                                                                gint delta)
{
	ProtonPlusWidgetsPreferencesPreferencesDialog * self;
	gint count = 0;
	AdwPreferencesPage** _tmp0_;
	gint _tmp0__length1;
	GtkWidget* current = NULL;
	GtkWidget* _tmp1_;
	GtkWidget* _tmp2_;
	GtkWidget* _tmp3_;
	gint current_index = 0;
	gboolean result;
	self = (ProtonPlusWidgetsPreferencesPreferencesDialog*) base;
	_tmp0_ = self->priv->controller_pages;
	_tmp0__length1 = self->priv->controller_pages_length1;
	count = _tmp0__length1;
	if (count < 2) {
		result = FALSE;
		return result;
	}
	_tmp1_ = adw_preferences_dialog_get_visible_page ((AdwPreferencesDialog*) self);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	current = _tmp3_;
	current_index = 0;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp4_ = FALSE;
			_tmp4_ = TRUE;
			while (TRUE) {
				AdwPreferencesPage** _tmp6_;
				gint _tmp6__length1;
				AdwPreferencesPage* _tmp7_;
				GtkWidget* _tmp8_;
				if (!_tmp4_) {
					gint _tmp5_;
					_tmp5_ = i;
					i = _tmp5_ + 1;
				}
				_tmp4_ = FALSE;
				if (!(i < count)) {
					break;
				}
				_tmp6_ = self->priv->controller_pages;
				_tmp6__length1 = self->priv->controller_pages_length1;
				_tmp7_ = _tmp6_[i];
				_tmp8_ = current;
				if (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, gtk_widget_get_type (), GtkWidget) == _tmp8_) {
					current_index = i;
					break;
				}
			}
		}
	}
	{
		gint step = 0;
		step = 1;
		{
			gboolean _tmp9_ = FALSE;
			_tmp9_ = TRUE;
			while (TRUE) {
				gint index = 0;
				gboolean _tmp11_ = FALSE;
				AdwPreferencesPage** _tmp12_;
				gint _tmp12__length1;
				AdwPreferencesPage* _tmp13_;
				gboolean _tmp14_;
				gboolean _tmp15_;
				if (!_tmp9_) {
					gint _tmp10_;
					_tmp10_ = step;
					step = _tmp10_ + 1;
				}
				_tmp9_ = FALSE;
				if (!(step <= count)) {
					break;
				}
				index = (((current_index + (delta * step)) % count) + count) % count;
				_tmp12_ = self->priv->controller_pages;
				_tmp12__length1 = self->priv->controller_pages_length1;
				_tmp13_ = _tmp12_[index];
				_tmp14_ = gtk_widget_get_visible ((GtkWidget*) _tmp13_);
				_tmp15_ = _tmp14_;
				if (_tmp15_) {
					AdwPreferencesPage** _tmp16_;
					gint _tmp16__length1;
					AdwPreferencesPage* _tmp17_;
					GtkWidget* _tmp18_;
					_tmp16_ = self->priv->controller_pages;
					_tmp16__length1 = self->priv->controller_pages_length1;
					_tmp17_ = _tmp16_[index];
					_tmp18_ = current;
					_tmp11_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, gtk_widget_get_type (), GtkWidget) != _tmp18_;
				} else {
					_tmp11_ = FALSE;
				}
				if (_tmp11_) {
					AdwPreferencesPage** _tmp19_;
					gint _tmp19__length1;
					AdwPreferencesPage* _tmp20_;
					_tmp19_ = self->priv->controller_pages;
					_tmp19__length1 = self->priv->controller_pages_length1;
					_tmp20_ = _tmp19_[index];
					adw_preferences_dialog_set_visible_page ((AdwPreferencesDialog*) self, (GtkWidget*) _tmp20_);
					result = TRUE;
					_g_object_unref0 (current);
					return result;
				}
			}
		}
	}
	result = FALSE;
	_g_object_unref0 (current);
	return result;
}

static gboolean
proton_plus_widgets_preferences_preferences_dialog_real_controller_can_switch_page (ProtonPlusUtilsControllerNavigationHost* base)
{
	ProtonPlusWidgetsPreferencesPreferencesDialog * self;
	gint visible_count = 0;
	AdwPreferencesPage** _tmp0_;
	gint _tmp0__length1;
	gboolean result;
	self = (ProtonPlusWidgetsPreferencesPreferencesDialog*) base;
	visible_count = 0;
	_tmp0_ = self->priv->controller_pages;
	_tmp0__length1 = self->priv->controller_pages_length1;
	{
		AdwPreferencesPage** page_collection = NULL;
		gint page_collection_length1 = 0;
		gint _page_collection_size_ = 0;
		gint page_it = 0;
		page_collection = _tmp0_;
		page_collection_length1 = _tmp0__length1;
		for (page_it = 0; page_it < page_collection_length1; page_it = page_it + 1) {
			AdwPreferencesPage* _tmp1_;
			AdwPreferencesPage* page = NULL;
			_tmp1_ = _g_object_ref0 (page_collection[page_it]);
			page = _tmp1_;
			{
				AdwPreferencesPage* _tmp2_;
				gboolean _tmp3_;
				gboolean _tmp4_;
				_tmp2_ = page;
				_tmp3_ = gtk_widget_get_visible ((GtkWidget*) _tmp2_);
				_tmp4_ = _tmp3_;
				if (_tmp4_) {
					gint _tmp5_;
					_tmp5_ = visible_count;
					visible_count = _tmp5_ + 1;
				}
				_g_object_unref0 (page);
			}
		}
	}
	result = visible_count >= 2;
	return result;
}

static gboolean
proton_plus_widgets_preferences_preferences_dialog_real_controller_prefers_initial_focus_after_switch (ProtonPlusUtilsControllerNavigationHost* base)
{
	ProtonPlusWidgetsPreferencesPreferencesDialog * self;
	gboolean result;
	self = (ProtonPlusWidgetsPreferencesPreferencesDialog*) base;
	result = TRUE;
	return result;
}

static gchar*
proton_plus_widgets_preferences_preferences_dialog_real_get_controller_page_id (ProtonPlusUtilsControllerNavigationHost* base)
{
	ProtonPlusWidgetsPreferencesPreferencesDialog * self;
	gchar* _tmp8_;
	gchar* result;
	self = (ProtonPlusWidgetsPreferencesPreferencesDialog*) base;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				AdwPreferencesPage** _tmp2_;
				gint _tmp2__length1;
				AdwPreferencesPage** _tmp3_;
				gint _tmp3__length1;
				AdwPreferencesPage* _tmp4_;
				GtkWidget* _tmp5_;
				GtkWidget* _tmp6_;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				_tmp2_ = self->priv->controller_pages;
				_tmp2__length1 = self->priv->controller_pages_length1;
				if (!(i < _tmp2__length1)) {
					break;
				}
				_tmp3_ = self->priv->controller_pages;
				_tmp3__length1 = self->priv->controller_pages_length1;
				_tmp4_ = _tmp3_[i];
				_tmp5_ = adw_preferences_dialog_get_visible_page ((AdwPreferencesDialog*) self);
				_tmp6_ = _tmp5_;
				if (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_widget_get_type (), GtkWidget) == _tmp6_) {
					gchar* _tmp7_;
					_tmp7_ = g_strdup_printf ("preferences:%d", i);
					result = _tmp7_;
					return result;
				}
			}
		}
	}
	_tmp8_ = g_strdup ("preferences:unknown");
	result = _tmp8_;
	return result;
}

static GObject*
proton_plus_widgets_preferences_preferences_dialog_real_get_controller_page_root (ProtonPlusUtilsControllerNavigationHost* base)
{
	ProtonPlusWidgetsPreferencesPreferencesDialog * self;
	GtkWidget* _tmp0_;
	GtkWidget* _tmp1_;
	GObject* _tmp2_;
	GObject* result;
	self = (ProtonPlusWidgetsPreferencesPreferencesDialog*) base;
	_tmp0_ = adw_preferences_dialog_get_visible_page ((AdwPreferencesDialog*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 ((GObject*) _tmp1_);
	result = _tmp2_;
	return result;
}

static GObject*
proton_plus_widgets_preferences_preferences_dialog_real_get_controller_initial_focus (ProtonPlusUtilsControllerNavigationHost* base)
{
	ProtonPlusWidgetsPreferencesPreferencesDialog * self;
	GtkWidget* page = NULL;
	GtkWidget* _tmp0_;
	GtkWidget* _tmp1_;
	GtkWidget* _tmp2_;
	GtkWidget* _tmp3_ = NULL;
	GtkWidget* _tmp4_;
	GtkWidget* _tmp7_;
	GObject* result;
	self = (ProtonPlusWidgetsPreferencesPreferencesDialog*) base;
	_tmp0_ = adw_preferences_dialog_get_visible_page ((AdwPreferencesDialog*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	page = _tmp2_;
	_tmp4_ = page;
	if (_tmp4_ == NULL) {
		_g_object_unref0 (_tmp3_);
		_tmp3_ = NULL;
	} else {
		GtkWidget* _tmp5_;
		GtkWidget* _tmp6_;
		_tmp5_ = page;
		_tmp6_ = proton_plus_widgets_preferences_preferences_dialog_find_first_preferences_row (self, _tmp5_);
		_g_object_unref0 (_tmp3_);
		_tmp3_ = _tmp6_;
	}
	_tmp7_ = _tmp3_;
	_tmp3_ = NULL;
	result = (GObject*) _tmp7_;
	_g_object_unref0 (_tmp3_);
	_g_object_unref0 (page);
	return result;
}

static GtkWidget*
proton_plus_widgets_preferences_preferences_dialog_find_first_preferences_row (ProtonPlusWidgetsPreferencesPreferencesDialog* self,
                                                                               GtkWidget* root)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	GtkWidget* child = NULL;
	GtkWidget* _tmp4_;
	GtkWidget* _tmp5_;
	GtkWidget* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (root != NULL, NULL);
	if (!gtk_widget_get_mapped (root)) {
		_tmp1_ = TRUE;
	} else {
		_tmp1_ = !gtk_widget_is_visible (root);
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = !gtk_widget_is_sensitive (root);
	}
	if (_tmp0_) {
		result = NULL;
		return result;
	}
	if (G_TYPE_CHECK_INSTANCE_TYPE (root, adw_preferences_row_get_type ())) {
		_tmp2_ = gtk_widget_get_focusable (root);
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		GtkWidget* _tmp3_;
		_tmp3_ = _g_object_ref0 (root);
		result = _tmp3_;
		return result;
	}
	_tmp4_ = gtk_widget_get_first_child (root);
	_tmp5_ = _g_object_ref0 (_tmp4_);
	child = _tmp5_;
	while (TRUE) {
		GtkWidget* _tmp6_;
		GtkWidget* target = NULL;
		GtkWidget* _tmp7_;
		GtkWidget* _tmp8_;
		GtkWidget* _tmp9_;
		GtkWidget* _tmp10_;
		GtkWidget* _tmp11_;
		GtkWidget* _tmp12_;
		_tmp6_ = child;
		if (!(_tmp6_ != NULL)) {
			break;
		}
		_tmp7_ = child;
		_tmp8_ = proton_plus_widgets_preferences_preferences_dialog_find_first_preferences_row (self, _tmp7_);
		target = _tmp8_;
		_tmp9_ = target;
		if (_tmp9_ != NULL) {
			result = target;
			_g_object_unref0 (child);
			return result;
		}
		_tmp10_ = child;
		_tmp11_ = gtk_widget_get_next_sibling (_tmp10_);
		_tmp12_ = _g_object_ref0 (_tmp11_);
		_g_object_unref0 (child);
		child = _tmp12_;
		_g_object_unref0 (target);
	}
	result = NULL;
	_g_object_unref0 (child);
	return result;
}

static gboolean
proton_plus_widgets_preferences_preferences_dialog_real_controller_navigate_back (ProtonPlusUtilsControllerNavigationHost* base)
{
	ProtonPlusWidgetsPreferencesPreferencesDialog * self;
	gboolean result;
	self = (ProtonPlusWidgetsPreferencesPreferencesDialog*) base;
	result = FALSE;
	return result;
}

static gboolean
proton_plus_widgets_preferences_preferences_dialog_real_controller_can_navigate_back (ProtonPlusUtilsControllerNavigationHost* base)
{
	ProtonPlusWidgetsPreferencesPreferencesDialog * self;
	gboolean result;
	self = (ProtonPlusWidgetsPreferencesPreferencesDialog*) base;
	result = FALSE;
	return result;
}

static void
proton_plus_widgets_preferences_preferences_dialog_class_init (ProtonPlusWidgetsPreferencesPreferencesDialogClass * klass,
                                                               gpointer klass_data)
{
	proton_plus_widgets_preferences_preferences_dialog_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusWidgetsPreferencesPreferencesDialog_private_offset);
	((GObjectClass *) klass)->dispose = (void (*) (GObject*)) proton_plus_widgets_preferences_preferences_dialog_real_dispose;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_widgets_preferences_preferences_dialog_finalize;
}

static void
proton_plus_widgets_preferences_preferences_dialog_proton_plus_utils_controller_navigation_host_interface_init (ProtonPlusUtilsControllerNavigationHostIface * iface,
                                                                                                                gpointer iface_data)
{
	proton_plus_widgets_preferences_preferences_dialog_proton_plus_utils_controller_navigation_host_parent_iface = g_type_interface_peek_parent (iface);
	iface->controller_switch_page = (gboolean (*) (ProtonPlusUtilsControllerNavigationHost*, gint)) proton_plus_widgets_preferences_preferences_dialog_real_controller_switch_page;
	iface->controller_can_switch_page = (gboolean (*) (ProtonPlusUtilsControllerNavigationHost*)) proton_plus_widgets_preferences_preferences_dialog_real_controller_can_switch_page;
	iface->controller_prefers_initial_focus_after_switch = (gboolean (*) (ProtonPlusUtilsControllerNavigationHost*)) proton_plus_widgets_preferences_preferences_dialog_real_controller_prefers_initial_focus_after_switch;
	iface->get_controller_page_id = (gchar* (*) (ProtonPlusUtilsControllerNavigationHost*)) proton_plus_widgets_preferences_preferences_dialog_real_get_controller_page_id;
	iface->get_controller_page_root = (GObject* (*) (ProtonPlusUtilsControllerNavigationHost*)) proton_plus_widgets_preferences_preferences_dialog_real_get_controller_page_root;
	iface->get_controller_initial_focus = (GObject* (*) (ProtonPlusUtilsControllerNavigationHost*)) proton_plus_widgets_preferences_preferences_dialog_real_get_controller_initial_focus;
	iface->controller_navigate_back = (gboolean (*) (ProtonPlusUtilsControllerNavigationHost*)) proton_plus_widgets_preferences_preferences_dialog_real_controller_navigate_back;
	iface->controller_can_navigate_back = (gboolean (*) (ProtonPlusUtilsControllerNavigationHost*)) proton_plus_widgets_preferences_preferences_dialog_real_controller_can_navigate_back;
}

static void
proton_plus_widgets_preferences_preferences_dialog_instance_init (ProtonPlusWidgetsPreferencesPreferencesDialog * self,
                                                                  gpointer klass)
{
	AdwPreferencesPage** _tmp0_;
	self->priv = proton_plus_widgets_preferences_preferences_dialog_get_instance_private (self);
	_tmp0_ = g_new0 (AdwPreferencesPage*, 0 + 1);
	self->priv->controller_pages = _tmp0_;
	self->priv->controller_pages_length1 = 0;
	self->priv->_controller_pages_size_ = self->priv->controller_pages_length1;
	self->priv->proxy_mode_changed_handler = (gulong) 0;
	self->priv->download_speed_limit_changed_handler = (gulong) 0;
}

static void
proton_plus_widgets_preferences_preferences_dialog_finalize (GObject * obj)
{
	ProtonPlusWidgetsPreferencesPreferencesDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_PREFERENCES_TYPE_PREFERENCES_DIALOG, ProtonPlusWidgetsPreferencesPreferencesDialog);
	self->priv->controller_pages = (_vala_array_free (self->priv->controller_pages, self->priv->controller_pages_length1, (GDestroyNotify) g_object_unref), NULL);
	_g_object_unref0 (self->priv->proxy_url_row);
	_g_object_unref0 (self->priv->download_speed_limit_row);
	G_OBJECT_CLASS (proton_plus_widgets_preferences_preferences_dialog_parent_class)->finalize (obj);
}

static GType
proton_plus_widgets_preferences_preferences_dialog_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusWidgetsPreferencesPreferencesDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_widgets_preferences_preferences_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusWidgetsPreferencesPreferencesDialog), 0, (GInstanceInitFunc) proton_plus_widgets_preferences_preferences_dialog_instance_init, NULL };
	static const GInterfaceInfo proton_plus_utils_controller_navigation_host_info = { (GInterfaceInitFunc) proton_plus_widgets_preferences_preferences_dialog_proton_plus_utils_controller_navigation_host_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType proton_plus_widgets_preferences_preferences_dialog_type_id;
	proton_plus_widgets_preferences_preferences_dialog_type_id = g_type_register_static (adw_preferences_dialog_get_type (), "ProtonPlusWidgetsPreferencesPreferencesDialog", &g_define_type_info, 0);
	g_type_add_interface_static (proton_plus_widgets_preferences_preferences_dialog_type_id, PROTON_PLUS_UTILS_TYPE_CONTROLLER_NAVIGATION_HOST, &proton_plus_utils_controller_navigation_host_info);
	ProtonPlusWidgetsPreferencesPreferencesDialog_private_offset = g_type_add_instance_private (proton_plus_widgets_preferences_preferences_dialog_type_id, sizeof (ProtonPlusWidgetsPreferencesPreferencesDialogPrivate));
	return proton_plus_widgets_preferences_preferences_dialog_type_id;
}

GType
proton_plus_widgets_preferences_preferences_dialog_get_type (void)
{
	static volatile gsize proton_plus_widgets_preferences_preferences_dialog_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_widgets_preferences_preferences_dialog_type_id__once)) {
		GType proton_plus_widgets_preferences_preferences_dialog_type_id;
		proton_plus_widgets_preferences_preferences_dialog_type_id = proton_plus_widgets_preferences_preferences_dialog_get_type_once ();
		g_once_init_leave (&proton_plus_widgets_preferences_preferences_dialog_type_id__once, proton_plus_widgets_preferences_preferences_dialog_type_id);
	}
	return proton_plus_widgets_preferences_preferences_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);
}

