/* tools-releases-box.c generated by valac 0.56.19, the Vala compiler
 * generated from tools-releases-box.vala, do not modify */

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

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

enum  {
	PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_0_PROPERTY,
	PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_HEADER_TITLE_PROPERTY,
	PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_LAST_UPDATED_LABEL_PROPERTY,
	PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_REFRESH_BUTTON_PROPERTY,
	PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_REPOSITORY_BUTTON_PROPERTY,
	PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_VARIANT_BOX_PROPERTY,
	PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_FILTER_PROPERTY,
	PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_SEARCH_TEXT_PROPERTY,
	PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_NUM_PROPERTIES
};
static GParamSpec* proton_plus_widgets_tools_releases_box_properties[PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define __vala_JsonNode_free0(var) ((var == NULL) ? NULL : (var = (_vala_JsonNode_free (var), NULL)))
#define _json_object_unref0(var) ((var == NULL) ? NULL : (var = (json_object_unref (var), NULL)))
#define _gtk_expression_unref0(var) ((var == NULL) ? NULL : (var = (gtk_expression_unref (var), NULL)))
typedef struct _ProtonPlusWidgetsToolsReleasesBoxSetSelectedToolData ProtonPlusWidgetsToolsReleasesBoxSetSelectedToolData;
typedef struct _ProtonPlusWidgetsToolsReleasesBoxSetSelectedToolForcedData ProtonPlusWidgetsToolsReleasesBoxSetSelectedToolForcedData;
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
typedef struct _Block19Data Block19Data;
typedef struct _ProtonPlusWidgetsToolsReleasesBoxFocusJobData ProtonPlusWidgetsToolsReleasesBoxFocusJobData;
typedef struct _Block20Data Block20Data;
typedef struct _ProtonPlusWidgetsToolsReleasesBoxOnLoadMoreClickedData ProtonPlusWidgetsToolsReleasesBoxOnLoadMoreClickedData;
enum  {
	PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_JOB_SELECTED_SIGNAL,
	PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_NUM_SIGNALS
};
static guint proton_plus_widgets_tools_releases_box_signals[PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_NUM_SIGNALS] = {0};

struct _ProtonPlusWidgetsToolsReleasesBoxPrivate {
	GtkBox* _tool_box;
	GtkLabel* _title_label;
	GtkBox* _header_title;
	GtkLabel* _last_updated_label;
	GtkButton* _refresh_button;
	GtkButton* _repository_button;
	GtkListBox* _list_box;
	GtkScrolledWindow* _scrolled;
	GtkStack* _content_stack;
	AdwStatusPage* _status_page;
	ProtonPlusModelsTool* current_tool;
	GeeHashMap* job_state_handlers;
	guint tool_request_generation;
	ProtonPlusModelsVariant* selected_variant;
	GeeLinkedList* displayed_variants;
	GtkDropDown* _variant_dropdown;
	GHashTable* variant_list_items;
	GtkImage* selected_variant_checkmark;
	GtkBox* _variant_box;
	gboolean header_controls_visible;
	gboolean has_variants;
	gboolean provider_has_compatible_variants;
	gboolean updating_variant_dropdown;
	GtkListBoxRow* load_more_row;
	GtkButton* load_more_button;
	GtkWidget* controller_up_target;
	ProtonPlusWidgetsToolsFilter _filter;
	gchar* _search_text;
};

struct _ProtonPlusWidgetsToolsReleasesBoxSetSelectedToolData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ProtonPlusWidgetsToolsReleasesBox* self;
	ProtonPlusModelsTool* tool;
	gboolean result;
	guint request_generation;
	guint _tmp0_;
	ProtonPlusModelsTool* _tmp1_;
	GtkStack* _tmp2_;
	GtkButton* _tmp3_;
	GtkListBox* _tmp4_;
	GtkLabel* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	GtkLabel* _tmp8_;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	ProtonPlusModelsReleaseCatalog* catalog;
	ProtonPlusModelsReleaseCatalog* _tmp11_;
	ProtonPlusModelsReleaseCatalog* _tmp12_;
	ProtonPlusModelsReleaseCatalog* _tmp13_;
	ProtonPlusModelsReleaseCatalog* _tmp14_;
	GtkStack* _tmp15_;
	ProtonPlusModelsReleaseCatalogResult* _result_;
	ProtonPlusModelsReleaseCatalog* _tmp16_;
	ProtonPlusModelsReleaseCatalogResult* _tmp17_;
	ProtonPlusModelsReleaseCatalogResult* _tmp18_;
	gboolean _tmp19_;
	gboolean _tmp20_;
	AdwAlertDialog* dialog;
	ProtonPlusModelsReleaseCatalogResult* _tmp21_;
	ProtonPlusReturnCode _tmp22_;
	ProtonPlusReturnCode _tmp23_;
	gchar* _tmp24_;
	gchar* _tmp25_;
	ProtonPlusWidgetsMainErrorDialog* _tmp26_;
	AdwAlertDialog* _tmp27_;
	GtkStack* _tmp28_;
	AdwAlertDialog* _tmp29_;
	GtkRoot* _tmp30_;
	ProtonPlusModelsGroup* _tmp31_;
	ProtonPlusModelsGroup* _tmp32_;
	ProtonPlusModelsReleaseCatalogResult* _tmp33_;
	GeeLinkedList* _tmp34_;
	GeeLinkedList* _tmp35_;
	GtkListBox* _tmp36_;
	GtkListBoxRow* _tmp37_;
	gboolean _tmp38_;
	ProtonPlusModelsReleaseCatalog* _tmp39_;
	gboolean _tmp40_;
	gboolean _tmp41_;
	GtkListBoxRow* _tmp42_;
	GtkStack* _tmp43_;
};

struct _ProtonPlusWidgetsToolsReleasesBoxSetSelectedToolForcedData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ProtonPlusWidgetsToolsReleasesBox* self;
	ProtonPlusModelsTool* tool;
	guint request_generation;
	guint _tmp0_;
	ProtonPlusModelsTool* _tmp1_;
	GtkStack* _tmp2_;
	GtkButton* _tmp3_;
	GtkListBox* _tmp4_;
	GtkLabel* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	GtkLabel* _tmp8_;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	ProtonPlusModelsReleaseCatalog* catalog;
	ProtonPlusModelsReleaseCatalog* _tmp11_;
	ProtonPlusModelsReleaseCatalog* _tmp12_;
	ProtonPlusModelsReleaseCatalog* _tmp13_;
	ProtonPlusModelsReleaseCatalog* _tmp14_;
	GtkStack* _tmp15_;
	ProtonPlusModelsReleaseCatalogResult* _result_;
	ProtonPlusModelsReleaseCatalog* _tmp16_;
	ProtonPlusModelsReleaseCatalogResult* _tmp17_;
	ProtonPlusModelsReleaseCatalogResult* _tmp18_;
	gboolean _tmp19_;
	gboolean _tmp20_;
	AdwAlertDialog* dialog;
	ProtonPlusModelsReleaseCatalogResult* _tmp21_;
	ProtonPlusReturnCode _tmp22_;
	ProtonPlusReturnCode _tmp23_;
	gchar* _tmp24_;
	gchar* _tmp25_;
	ProtonPlusWidgetsMainErrorDialog* _tmp26_;
	AdwAlertDialog* _tmp27_;
	GtkStack* _tmp28_;
	AdwAlertDialog* _tmp29_;
	GtkRoot* _tmp30_;
	ProtonPlusModelsGroup* _tmp31_;
	ProtonPlusModelsGroup* _tmp32_;
	ProtonPlusModelsReleaseCatalogResult* _tmp33_;
	GeeLinkedList* _tmp34_;
	GeeLinkedList* _tmp35_;
	GtkListBox* _tmp36_;
	GtkListBoxRow* _tmp37_;
	gboolean _tmp38_;
	ProtonPlusModelsReleaseCatalog* _tmp39_;
	gboolean _tmp40_;
	gboolean _tmp41_;
	GtkListBoxRow* _tmp42_;
	GtkStack* _tmp43_;
};

struct _Block19Data {
	int _ref_count_;
	ProtonPlusWidgetsToolsReleasesBox* self;
	ProtonPlusWidgetsToolsReleaseRow* row;
	gpointer _async_data_;
};

struct _ProtonPlusWidgetsToolsReleasesBoxFocusJobData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ProtonPlusWidgetsToolsReleasesBox* self;
	ProtonPlusServicesInstallJob* target;
	Block19Data* _data19_;
	ProtonPlusModelsTool* _tmp0_;
	ProtonPlusModelsTool* _tmp1_;
	ProtonPlusWidgetsToolsReleaseRow* _tmp2_;
	ProtonPlusWidgetsToolsReleaseRow* _tmp3_;
	ProtonPlusWidgetsToolsReleaseRow* _tmp4_;
	ProtonPlusWidgetsToolsReleaseRow* _tmp5_;
};

struct _Block20Data {
	int _ref_count_;
	ProtonPlusWidgetsToolsReleasesBox* self;
	ProtonPlusServicesInstallJob* job;
};

struct _ProtonPlusWidgetsToolsReleasesBoxOnLoadMoreClickedData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ProtonPlusWidgetsToolsReleasesBox* self;
	ProtonPlusModelsTool* _tmp0_;
	ProtonPlusModelsTool* tool;
	ProtonPlusModelsTool* _tmp1_;
	ProtonPlusModelsTool* _tmp2_;
	guint request_generation;
	GtkButton* _tmp3_;
	ProtonPlusModelsReleaseCatalog* catalog;
	ProtonPlusModelsTool* _tmp4_;
	ProtonPlusModelsReleaseCatalog* _tmp5_;
	ProtonPlusModelsReleaseCatalog* _tmp6_;
	ProtonPlusModelsReleaseCatalog* _tmp7_;
	ProtonPlusModelsReleaseCatalog* _tmp8_;
	GtkButton* _tmp9_;
	ProtonPlusModelsReleaseCatalogResult* _result_;
	ProtonPlusModelsReleaseCatalog* _tmp10_;
	ProtonPlusModelsReleaseCatalogResult* _tmp11_;
	ProtonPlusModelsTool* _tmp12_;
	ProtonPlusModelsReleaseCatalogResult* _tmp13_;
	gboolean _tmp14_;
	gboolean _tmp15_;
	GeeLinkedList* _release_list;
	ProtonPlusModelsReleaseCatalogResult* _tmp16_;
	GeeLinkedList* _tmp17_;
	GeeLinkedList* _tmp18_;
	gint _release_size;
	GeeLinkedList* _tmp19_;
	gint _tmp20_;
	gint _tmp21_;
	gint _release_index;
	gint _tmp22_;
	gint _tmp23_;
	ProtonPlusModelsRelease* release;
	GeeLinkedList* _tmp24_;
	gpointer _tmp25_;
	ProtonPlusModelsRelease* _tmp26_;
	ProtonPlusModelsTool* _tmp27_;
	ProtonPlusModelsGroup* _tmp28_;
	ProtonPlusModelsGroup* _tmp29_;
	GtkListBox* _tmp30_;
	GtkListBoxRow* _tmp31_;
	GtkListBox* _tmp32_;
	GtkListBoxRow* _tmp33_;
	gboolean _tmp34_;
	ProtonPlusModelsReleaseCatalog* _tmp35_;
	gboolean _tmp36_;
	gboolean _tmp37_;
	GtkListBoxRow* _tmp38_;
	GtkButton* _tmp39_;
};

static gint ProtonPlusWidgetsToolsReleasesBox_private_offset;
static gpointer proton_plus_widgets_tools_releases_box_parent_class = NULL;
static ProtonPlusUtilsControllerDirectionalFocusIface * proton_plus_widgets_tools_releases_box_proton_plus_utils_controller_directional_focus_parent_iface = NULL;

static gchar* proton_plus_widgets_tools_releases_box_get_tool_variant_settings_key (ProtonPlusModelsTool* tool);
static gchar* proton_plus_widgets_tools_releases_box_get_legacy_tool_variant_settings_key (ProtonPlusModelsTool* tool);
static gchar* proton_plus_widgets_tools_releases_box_get_variant_tooltip (const gchar* variant_name);
static gchar* proton_plus_widgets_tools_releases_box_get_saved_variant_name (ProtonPlusWidgetsToolsReleasesBox* self,
                                                                      ProtonPlusModelsTool* tool);
static void _vala_JsonNode_free (JsonNode* self);
static void proton_plus_widgets_tools_releases_box_save_selected_variant_name (ProtonPlusWidgetsToolsReleasesBox* self,
                                                                        ProtonPlusModelsTool* tool,
                                                                        const gchar* variant_name);
static void _g_object_unref0_ (gpointer var);
static void proton_plus_widgets_tools_releases_box_set_title_label (ProtonPlusWidgetsToolsReleasesBox* self,
                                                             GtkLabel* value);
static GtkLabel* proton_plus_widgets_tools_releases_box_get_title_label (ProtonPlusWidgetsToolsReleasesBox* self);
static void proton_plus_widgets_tools_releases_box_set_header_title (ProtonPlusWidgetsToolsReleasesBox* self,
                                                              GtkBox* value);
static void proton_plus_widgets_tools_releases_box_set_last_updated_label (ProtonPlusWidgetsToolsReleasesBox* self,
                                                                    GtkLabel* value);
static void proton_plus_widgets_tools_releases_box_set_refresh_button (ProtonPlusWidgetsToolsReleasesBox* self,
                                                                GtkButton* value);
static void proton_plus_widgets_tools_releases_box_on_refresh_clicked (ProtonPlusWidgetsToolsReleasesBox* self);
static void _proton_plus_widgets_tools_releases_box_on_refresh_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                    gpointer self);
static void proton_plus_widgets_tools_releases_box_set_repository_button (ProtonPlusWidgetsToolsReleasesBox* self,
                                                                   GtkButton* value);
static void __lambda61_ (ProtonPlusWidgetsToolsReleasesBox* self);
static void ___lambda61__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);
static void proton_plus_widgets_tools_releases_box_set_variant_dropdown (ProtonPlusWidgetsToolsReleasesBox* self,
                                                                  GtkDropDown* value);
static GtkDropDown* proton_plus_widgets_tools_releases_box_get_variant_dropdown (ProtonPlusWidgetsToolsReleasesBox* self);
static void proton_plus_widgets_tools_releases_box_on_variant_selected (ProtonPlusWidgetsToolsReleasesBox* self);
static void _proton_plus_widgets_tools_releases_box_on_variant_selected_g_object_notify (GObject* _sender,
                                                                                  GParamSpec* pspec,
                                                                                  gpointer self);
static void proton_plus_widgets_tools_releases_box_on_variant_list_item_setup (ProtonPlusWidgetsToolsReleasesBox* self,
                                                                        GObject* object);
static void _proton_plus_widgets_tools_releases_box_on_variant_list_item_setup_gtk_signal_list_item_factory_setup (GtkSignalListItemFactory* _sender,
                                                                                                            GObject* object,
                                                                                                            gpointer self);
static void proton_plus_widgets_tools_releases_box_on_variant_list_item_bind (ProtonPlusWidgetsToolsReleasesBox* self,
                                                                       GObject* object);
static void _proton_plus_widgets_tools_releases_box_on_variant_list_item_bind_gtk_signal_list_item_factory_bind (GtkSignalListItemFactory* _sender,
                                                                                                          GObject* object,
                                                                                                          gpointer self);
static void proton_plus_widgets_tools_releases_box_on_variant_list_item_unbind (ProtonPlusWidgetsToolsReleasesBox* self,
                                                                         GObject* object);
static void _proton_plus_widgets_tools_releases_box_on_variant_list_item_unbind_gtk_signal_list_item_factory_unbind (GtkSignalListItemFactory* _sender,
                                                                                                              GObject* object,
                                                                                                              gpointer self);
static void proton_plus_widgets_tools_releases_box_set_variant_box (ProtonPlusWidgetsToolsReleasesBox* self,
                                                             GtkBox* value);
static void proton_plus_widgets_tools_releases_box_set_list_box (ProtonPlusWidgetsToolsReleasesBox* self,
                                                          GtkListBox* value);
static GtkListBox* proton_plus_widgets_tools_releases_box_get_list_box (ProtonPlusWidgetsToolsReleasesBox* self);
static gboolean proton_plus_widgets_tools_releases_box_filter_func (ProtonPlusWidgetsToolsReleasesBox* self,
                                                             GtkListBoxRow* row);
static gboolean _proton_plus_widgets_tools_releases_box_filter_func_gtk_list_box_filter_func (GtkListBoxRow* row,
                                                                                       gpointer self);
static void proton_plus_widgets_tools_releases_box_on_load_more_clicked (ProtonPlusWidgetsToolsReleasesBox* self,
                                                                  GAsyncReadyCallback _callback_,
                                                                  gpointer _user_data_);
static void proton_plus_widgets_tools_releases_box_on_load_more_clicked_finish (ProtonPlusWidgetsToolsReleasesBox* self,
                                                                         GAsyncResult* _res_);
static void _proton_plus_widgets_tools_releases_box_on_load_more_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                      gpointer self);
static void proton_plus_widgets_tools_releases_box_set_scrolled (ProtonPlusWidgetsToolsReleasesBox* self,
                                                          GtkScrolledWindow* value);
static void proton_plus_widgets_tools_releases_box_set_content_stack (ProtonPlusWidgetsToolsReleasesBox* self,
                                                               GtkStack* value);
static GtkStack* proton_plus_widgets_tools_releases_box_get_content_stack (ProtonPlusWidgetsToolsReleasesBox* self);
static void proton_plus_widgets_tools_releases_box_set_status_page (ProtonPlusWidgetsToolsReleasesBox* self,
                                                             AdwStatusPage* value);
static GtkScrolledWindow* proton_plus_widgets_tools_releases_box_get_scrolled (ProtonPlusWidgetsToolsReleasesBox* self);
static AdwStatusPage* proton_plus_widgets_tools_releases_box_get_status_page (ProtonPlusWidgetsToolsReleasesBox* self);
static void proton_plus_widgets_tools_releases_box_set_tool_box (ProtonPlusWidgetsToolsReleasesBox* self,
                                                          GtkBox* value);
static GtkBox* proton_plus_widgets_tools_releases_box_get_tool_box (ProtonPlusWidgetsToolsReleasesBox* self);
static void proton_plus_widgets_tools_releases_box_set_selected_tool_data_free (gpointer _data);
static gboolean proton_plus_widgets_tools_releases_box_set_selected_tool_co (ProtonPlusWidgetsToolsReleasesBoxSetSelectedToolData* _data_);
static void proton_plus_widgets_tools_releases_box_disconnect_job_state_handlers (ProtonPlusWidgetsToolsReleasesBox* self);
static void proton_plus_widgets_tools_releases_box_update_repository_button (ProtonPlusWidgetsToolsReleasesBox* self,
                                                                      ProtonPlusModelsTool* tool);
static void proton_plus_widgets_tools_releases_box_update_last_updated_label (ProtonPlusWidgetsToolsReleasesBox* self);
static void proton_plus_widgets_tools_releases_box_update_variant_row (ProtonPlusWidgetsToolsReleasesBox* self,
                                                                ProtonPlusModelsTool* tool);
static void proton_plus_widgets_tools_releases_box_set_selected_tool_ready (GObject* source_object,
                                                                     GAsyncResult* _res_,
                                                                     gpointer _user_data_);
static gboolean proton_plus_widgets_tools_releases_box_is_current_tool_request (ProtonPlusWidgetsToolsReleasesBox* self,
                                                                         ProtonPlusModelsTool* tool,
                                                                         guint request_generation);
static void proton_plus_widgets_tools_releases_box_add_release_rows (ProtonPlusWidgetsToolsReleasesBox* self,
                                                              ProtonPlusModelsTool* tool,
                                                              GeeLinkedList* releases);
static gboolean proton_plus_widgets_tools_releases_box_can_show_provider_release_rows (ProtonPlusWidgetsToolsReleasesBox* self);
static void proton_plus_widgets_tools_releases_box_apply_selected_variant_to_rows (ProtonPlusWidgetsToolsReleasesBox* self);
static void proton_plus_widgets_tools_releases_box_update_visibility (ProtonPlusWidgetsToolsReleasesBox* self);
static gboolean proton_plus_widgets_tools_releases_box_real_controller_focus_direction (ProtonPlusUtilsControllerDirectionalFocus* base,
                                                                                 GObject* focused_object,
                                                                                 ProtonPlusUtilsControllerNavigationDirection direction);
static void proton_plus_widgets_tools_releases_box_update_variant_list_item_checkmark (ProtonPlusWidgetsToolsReleasesBox* self);
static void proton_plus_widgets_tools_releases_box_set_selected_tool_forced (ProtonPlusWidgetsToolsReleasesBox* self,
                                                                      ProtonPlusModelsTool* tool,
                                                                      GAsyncReadyCallback _callback_,
                                                                      gpointer _user_data_);
static void proton_plus_widgets_tools_releases_box_set_selected_tool_forced_finish (ProtonPlusWidgetsToolsReleasesBox* self,
                                                                             GAsyncResult* _res_);
static void proton_plus_widgets_tools_releases_box_set_selected_tool_forced_data_free (gpointer _data);
static gboolean proton_plus_widgets_tools_releases_box_set_selected_tool_forced_co (ProtonPlusWidgetsToolsReleasesBoxSetSelectedToolForcedData* _data_);
static void proton_plus_widgets_tools_releases_box_set_selected_tool_forced_ready (GObject* source_object,
                                                                            GAsyncResult* _res_,
                                                                            gpointer _user_data_);
static ProtonPlusModelsVariant* proton_plus_widgets_tools_releases_box_resolve_release_variant (ProtonPlusWidgetsToolsReleasesBox* self,
                                                                                         ProtonPlusModelsRelease* release,
                                                                                         ProtonPlusServicesInstallJobMode mode);
static gboolean proton_plus_widgets_tools_releases_box_apply_selected_variant_to_job (ProtonPlusWidgetsToolsReleasesBox* self,
                                                                               ProtonPlusServicesInstallJob* job);
static void proton_plus_widgets_tools_releases_box_focus_job_data_free (gpointer _data);
static gboolean proton_plus_widgets_tools_releases_box_focus_job_co (ProtonPlusWidgetsToolsReleasesBoxFocusJobData* _data_);
static Block19Data* block19_data_ref (Block19Data* _data19_);
static void block19_data_unref (void * _userdata_);
static void proton_plus_widgets_tools_releases_box_focus_job_ready (GObject* source_object,
                                                             GAsyncResult* _res_,
                                                             gpointer _user_data_);
static ProtonPlusWidgetsToolsReleaseRow* proton_plus_widgets_tools_releases_box_find_job_row (ProtonPlusWidgetsToolsReleasesBox* self,
                                                                                       ProtonPlusServicesInstallJob* target);
static gboolean __lambda62_ (Block19Data* _data19_);
static gboolean ___lambda62__gsource_func (gpointer self);
static gboolean __lambda63_ (Block19Data* _data19_);
static gboolean ___lambda63__gsource_func (gpointer self);
static gboolean proton_plus_widgets_tools_releases_box_jobs_have_same_identity (ProtonPlusWidgetsToolsReleasesBox* self,
                                                                         ProtonPlusServicesInstallJob* left,
                                                                         ProtonPlusServicesInstallJob* right);
static void proton_plus_widgets_tools_releases_box_add_release_row (ProtonPlusWidgetsToolsReleasesBox* self,
                                                             ProtonPlusModelsRelease* release,
                                                             ProtonPlusServicesInstallJobMode mode);
static Block20Data* block20_data_ref (Block20Data* _data20_);
static void block20_data_unref (void * _userdata_);
static void __lambda41_ (Block20Data* _data20_);
static void ___lambda41__g_object_notify (GObject* _sender,
                                   GParamSpec* pspec,
                                   gpointer self);
static void __lambda60_ (ProtonPlusWidgetsToolsReleasesBox* self,
                  ProtonPlusServicesInstallJob* selected_job);
static void ___lambda60__proton_plus_widgets_tools_release_row_job_selected (ProtonPlusWidgetsToolsReleaseRow* _sender,
                                                                      ProtonPlusServicesInstallJob* job,
                                                                      gpointer self);
static void proton_plus_widgets_tools_releases_box_real_dispose (GObject* base);
static void proton_plus_widgets_tools_releases_box_on_load_more_clicked_data_free (gpointer _data);
static gboolean proton_plus_widgets_tools_releases_box_on_load_more_clicked_co (ProtonPlusWidgetsToolsReleasesBoxOnLoadMoreClickedData* _data_);
static void proton_plus_widgets_tools_releases_box_on_load_more_clicked_ready (GObject* source_object,
                                                                        GAsyncResult* _res_,
                                                                        gpointer _user_data_);
static void proton_plus_widgets_tools_releases_box_finalize (GObject * obj);
static GType proton_plus_widgets_tools_releases_box_get_type_once (void);
static void _vala_proton_plus_widgets_tools_releases_box_get_property (GObject * object,
                                                                guint property_id,
                                                                GValue * value,
                                                                GParamSpec * pspec);
static void _vala_proton_plus_widgets_tools_releases_box_set_property (GObject * object,
                                                                guint property_id,
                                                                const GValue * value,
                                                                GParamSpec * pspec);
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_tools_releases_box_get_instance_private (ProtonPlusWidgetsToolsReleasesBox* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusWidgetsToolsReleasesBox_private_offset);
}

static gchar*
proton_plus_widgets_tools_releases_box_get_tool_variant_settings_key (ProtonPlusModelsTool* tool)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* result;
	g_return_val_if_fail (tool != NULL, NULL);
	_tmp0_ = proton_plus_models_tool_get_id (tool);
	_tmp1_ = _tmp0_;
	_tmp2_ = g_strdup (_tmp1_);
	result = _tmp2_;
	return result;
}

static gchar*
proton_plus_widgets_tools_releases_box_get_legacy_tool_variant_settings_key (ProtonPlusModelsTool* tool)
{
	ProtonPlusModelsGroup* _tmp0_;
	ProtonPlusModelsGroup* _tmp1_;
	ProtonPlusModelsLauncher* _tmp2_;
	ProtonPlusModelsLauncher* _tmp3_;
	const gchar* _tmp4_;
	ProtonPlusModelsGroup* _tmp5_;
	ProtonPlusModelsGroup* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* result;
	g_return_val_if_fail (tool != NULL, NULL);
	_tmp0_ = proton_plus_models_tool_get_group (tool);
	_tmp1_ = _tmp0_;
	_tmp2_ = proton_plus_models_group_get_launcher (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = _tmp3_->title;
	_tmp5_ = proton_plus_models_tool_get_group (tool);
	_tmp6_ = _tmp5_;
	_tmp7_ = proton_plus_models_group_get_title (_tmp6_);
	_tmp8_ = _tmp7_;
	_tmp9_ = proton_plus_models_tool_get_title (tool);
	_tmp10_ = _tmp9_;
	_tmp11_ = g_strdup_printf ("%s::%s::%s", _tmp4_, _tmp8_, _tmp10_);
	result = _tmp11_;
	return result;
}

static gchar*
proton_plus_widgets_tools_releases_box_get_variant_tooltip (const gchar* variant_name)
{
	const gchar* _tmp0_;
	GQuark _tmp2_ = 0U;
	static GQuark _tmp1_label0 = 0;
	static GQuark _tmp1_label1 = 0;
	static GQuark _tmp1_label2 = 0;
	static GQuark _tmp1_label3 = 0;
	static GQuark _tmp1_label4 = 0;
	static GQuark _tmp1_label5 = 0;
	static GQuark _tmp1_label6 = 0;
	static GQuark _tmp1_label7 = 0;
	gchar* result;
	g_return_val_if_fail (variant_name != NULL, NULL);
	_tmp0_ = variant_name;
	_tmp2_ = (NULL == _tmp0_) ? 0 : g_quark_from_string (_tmp0_);
	if (_tmp2_ == ((0 != _tmp1_label0) ? _tmp1_label0 : (_tmp1_label0 = g_quark_from_static_string ("x86_64")))) {
		switch (0) {
			default:
			{
				gchar* _tmp3_;
				_tmp3_ = g_strdup (_ ("Standard 64-bit build for most Intel and AMD PCs."));
				result = _tmp3_;
				return result;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label1) ? _tmp1_label1 : (_tmp1_label1 = g_quark_from_static_string ("x86_64_v3")))) {
		switch (0) {
			default:
			{
				gchar* _tmp4_;
				_tmp4_ = g_strdup (_ ("Optimized 64-bit build for Intel and AMD CPUs that support the x86-64-" \
"v3 instruction set."));
				result = _tmp4_;
				return result;
			}
		}
	} else if ((_tmp2_ == ((0 != _tmp1_label2) ? _tmp1_label2 : (_tmp1_label2 = g_quark_from_static_string ("arm64")))) || (_tmp2_ == ((0 != _tmp1_label3) ? _tmp1_label3 : (_tmp1_label3 = g_quark_from_static_string ("aarch64"))))) {
		switch (0) {
			default:
			{
				gchar* _tmp5_;
				_tmp5_ = g_strdup (_ ("64-bit ARM build. Choose this only on ARM64 hardware."));
				result = _tmp5_;
				return result;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label4) ? _tmp1_label4 : (_tmp1_label4 = g_quark_from_static_string ("x86")))) {
		switch (0) {
			default:
			{
				gchar* _tmp6_;
				_tmp6_ = g_strdup (_ ("32-bit x86 build. Choose this only when a 32-bit runner is required."));
				result = _tmp6_;
				return result;
			}
		}
	} else if ((_tmp2_ == ((0 != _tmp1_label5) ? _tmp1_label5 : (_tmp1_label5 = g_quark_from_static_string ("wow64")))) || (_tmp2_ == ((0 != _tmp1_label6) ? _tmp1_label6 : (_tmp1_label6 = g_quark_from_static_string ("x86_64_wow64"))))) {
		switch (0) {
			default:
			{
				gchar* _tmp7_;
				_tmp7_ = g_strdup (_ ("64-bit build with WoW64 support for running 32-bit Windows application" \
"s."));
				result = _tmp7_;
				return result;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label7) ? _tmp1_label7 : (_tmp1_label7 = g_quark_from_static_string ("default")))) {
		switch (0) {
			default:
			{
				gchar* _tmp8_;
				_tmp8_ = g_strdup (_ ("The provider's recommended build for most systems."));
				result = _tmp8_;
				return result;
			}
		}
	} else {
		switch (0) {
			default:
			{
				gchar* _tmp9_;
				_tmp9_ = g_strdup_printf (_ ("Select the %s build variant."), variant_name);
				result = _tmp9_;
				return result;
			}
		}
	}
}

static gchar*
proton_plus_widgets_tools_releases_box_get_saved_variant_name (ProtonPlusWidgetsToolsReleasesBox* self,
                                                               ProtonPlusModelsTool* tool)
{
	GSettings* _tmp0_;
	GSettings* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (tool != NULL, NULL);
	_tmp0_ = proton_plus_globals_SETTINGS;
	if (_tmp0_ == NULL) {
		gchar* _tmp1_;
		_tmp1_ = g_strdup ("");
		result = _tmp1_;
		return result;
	}
	_tmp2_ = proton_plus_globals_SETTINGS;
	_tmp3_ = g_settings_get_string (_tmp2_, "selected-tool-variants");
	_tmp4_ = _tmp3_;
	_tmp5_ = proton_plus_widgets_tools_releases_box_get_saved_variant_name_from_json (_tmp4_, tool);
	_tmp6_ = _tmp5_;
	_g_free0 (_tmp4_);
	result = _tmp6_;
	return result;
}

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

static gpointer
_json_object_ref0 (gpointer self)
{
	return self ? json_object_ref (self) : NULL;
}

gchar*
proton_plus_widgets_tools_releases_box_get_saved_variant_name_from_json (const gchar* raw,
                                                                         ProtonPlusModelsTool* tool)
{
	JsonNode* root_node = NULL;
	JsonNode* _tmp1_;
	gboolean _tmp2_ = FALSE;
	JsonNode* _tmp3_;
	JsonObject* root_obj = NULL;
	JsonNode* _tmp6_;
	JsonObject* _tmp7_;
	JsonObject* _tmp8_;
	gchar* saved_variant_name = NULL;
	JsonObject* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	const gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	const gchar* _tmp15_;
	JsonObject* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	const gchar* _tmp19_;
	gchar* _tmp20_;
	gchar* _tmp21_;
	gchar* result;
	g_return_val_if_fail (raw != NULL, NULL);
	g_return_val_if_fail (tool != NULL, NULL);
	if (g_strcmp0 (raw, "") == 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup ("");
		result = _tmp0_;
		return result;
	}
	_tmp1_ = proton_plus_utils_parser_get_node_from_json (raw);
	root_node = _tmp1_;
	_tmp3_ = root_node;
	if (_tmp3_ == NULL) {
		_tmp2_ = TRUE;
	} else {
		JsonNode* _tmp4_;
		_tmp4_ = root_node;
		_tmp2_ = json_node_get_node_type (_tmp4_) != JSON_NODE_OBJECT;
	}
	if (_tmp2_) {
		gchar* _tmp5_;
		_tmp5_ = g_strdup ("");
		result = _tmp5_;
		__vala_JsonNode_free0 (root_node);
		return result;
	}
	_tmp6_ = root_node;
	_tmp7_ = json_node_get_object (_tmp6_);
	_tmp8_ = _json_object_ref0 (_tmp7_);
	root_obj = _tmp8_;
	_tmp9_ = root_obj;
	_tmp10_ = proton_plus_widgets_tools_releases_box_get_tool_variant_settings_key (tool);
	_tmp11_ = _tmp10_;
	_tmp12_ = json_object_get_string_member_with_default (_tmp9_, _tmp11_, "");
	_tmp13_ = g_strdup (_tmp12_);
	_tmp14_ = _tmp13_;
	_g_free0 (_tmp11_);
	saved_variant_name = _tmp14_;
	_tmp15_ = saved_variant_name;
	if (g_strcmp0 (_tmp15_, "") != 0) {
		result = saved_variant_name;
		_json_object_unref0 (root_obj);
		__vala_JsonNode_free0 (root_node);
		return result;
	}
	_tmp16_ = root_obj;
	_tmp17_ = proton_plus_widgets_tools_releases_box_get_legacy_tool_variant_settings_key (tool);
	_tmp18_ = _tmp17_;
	_tmp19_ = json_object_get_string_member_with_default (_tmp16_, _tmp18_, "");
	_tmp20_ = g_strdup (_tmp19_);
	_tmp21_ = _tmp20_;
	_g_free0 (_tmp18_);
	result = _tmp21_;
	_g_free0 (saved_variant_name);
	_json_object_unref0 (root_obj);
	__vala_JsonNode_free0 (root_node);
	return result;
}

static void
proton_plus_widgets_tools_releases_box_save_selected_variant_name (ProtonPlusWidgetsToolsReleasesBox* self,
                                                                   ProtonPlusModelsTool* tool,
                                                                   const gchar* variant_name)
{
	GSettings* _tmp0_;
	GSettings* _tmp1_;
	GSettings* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (tool != NULL);
	g_return_if_fail (variant_name != NULL);
	_tmp0_ = proton_plus_globals_SETTINGS;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = proton_plus_globals_SETTINGS;
	_tmp2_ = proton_plus_globals_SETTINGS;
	_tmp3_ = g_settings_get_string (_tmp2_, "selected-tool-variants");
	_tmp4_ = _tmp3_;
	_tmp5_ = proton_plus_widgets_tools_releases_box_get_json_with_saved_variant_name (_tmp4_, tool, variant_name);
	_tmp6_ = _tmp5_;
	g_settings_set_string (_tmp1_, "selected-tool-variants", _tmp6_);
	_g_free0 (_tmp6_);
	_g_free0 (_tmp4_);
}

gchar*
proton_plus_widgets_tools_releases_box_get_json_with_saved_variant_name (const gchar* raw,
                                                                         ProtonPlusModelsTool* tool,
                                                                         const gchar* variant_name)
{
	JsonObject* root_obj = NULL;
	JsonNode* root_node = NULL;
	JsonNode* _tmp0_;
	gboolean _tmp1_ = FALSE;
	JsonNode* _tmp2_;
	JsonObject* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	JsonNode* node = NULL;
	JsonNode* _tmp11_;
	JsonObject* _tmp12_;
	JsonGenerator* generator = NULL;
	JsonGenerator* _tmp13_;
	gchar* _tmp14_;
	gchar* result;
	g_return_val_if_fail (raw != NULL, NULL);
	g_return_val_if_fail (tool != NULL, NULL);
	g_return_val_if_fail (variant_name != NULL, NULL);
	_tmp0_ = proton_plus_utils_parser_get_node_from_json (raw);
	root_node = _tmp0_;
	_tmp2_ = root_node;
	if (_tmp2_ != NULL) {
		JsonNode* _tmp3_;
		_tmp3_ = root_node;
		_tmp1_ = json_node_get_node_type (_tmp3_) == JSON_NODE_OBJECT;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		JsonNode* _tmp4_;
		JsonObject* _tmp5_;
		JsonObject* _tmp6_;
		_tmp4_ = root_node;
		_tmp5_ = json_node_get_object (_tmp4_);
		_tmp6_ = _json_object_ref0 (_tmp5_);
		_json_object_unref0 (root_obj);
		root_obj = _tmp6_;
	} else {
		JsonObject* _tmp7_;
		_tmp7_ = json_object_new ();
		_json_object_unref0 (root_obj);
		root_obj = _tmp7_;
	}
	_tmp8_ = root_obj;
	_tmp9_ = proton_plus_widgets_tools_releases_box_get_tool_variant_settings_key (tool);
	_tmp10_ = _tmp9_;
	json_object_set_string_member (_tmp8_, _tmp10_, variant_name);
	_g_free0 (_tmp10_);
	_tmp11_ = json_node_new (JSON_NODE_OBJECT);
	node = _tmp11_;
	_tmp12_ = root_obj;
	json_node_set_object (node, _tmp12_);
	_tmp13_ = json_generator_new ();
	generator = _tmp13_;
	json_generator_set_root (generator, node);
	_tmp14_ = json_generator_to_data (generator, NULL);
	result = _tmp14_;
	_g_object_unref0 (generator);
	__vala_JsonNode_free0 (node);
	__vala_JsonNode_free0 (root_node);
	_json_object_unref0 (root_obj);
	return result;
}

static void
_g_object_unref0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
}

static void
_proton_plus_widgets_tools_releases_box_on_refresh_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                               gpointer self)
{
	proton_plus_widgets_tools_releases_box_on_refresh_clicked ((ProtonPlusWidgetsToolsReleasesBox*) self);
}

static void
__lambda61_ (ProtonPlusWidgetsToolsReleasesBox* self)
{
	gboolean _tmp0_ = FALSE;
	ProtonPlusModelsTool* _tmp1_;
	_tmp1_ = self->priv->current_tool;
	if (_tmp1_ != NULL) {
		ProtonPlusModelsTool* _tmp2_;
		const gchar* _tmp3_;
		const gchar* _tmp4_;
		_tmp2_ = self->priv->current_tool;
		_tmp3_ = proton_plus_models_tool_get_repository_url (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp0_ = g_strcmp0 (_tmp4_, "") != 0;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		ProtonPlusModelsTool* _tmp5_;
		const gchar* _tmp6_;
		const gchar* _tmp7_;
		_tmp5_ = self->priv->current_tool;
		_tmp6_ = proton_plus_models_tool_get_repository_url (_tmp5_);
		_tmp7_ = _tmp6_;
		proton_plus_utils_system_open_uri (_tmp7_);
	}
}

static void
___lambda61__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
	__lambda61_ ((ProtonPlusWidgetsToolsReleasesBox*) self);
}

static gpointer
_gtk_expression_ref0 (gpointer self)
{
	return self ? gtk_expression_ref (self) : NULL;
}

static void
_proton_plus_widgets_tools_releases_box_on_variant_selected_g_object_notify (GObject* _sender,
                                                                             GParamSpec* pspec,
                                                                             gpointer self)
{
	proton_plus_widgets_tools_releases_box_on_variant_selected ((ProtonPlusWidgetsToolsReleasesBox*) self);
}

static void
_proton_plus_widgets_tools_releases_box_on_variant_list_item_setup_gtk_signal_list_item_factory_setup (GtkSignalListItemFactory* _sender,
                                                                                                       GObject* object,
                                                                                                       gpointer self)
{
	proton_plus_widgets_tools_releases_box_on_variant_list_item_setup ((ProtonPlusWidgetsToolsReleasesBox*) self, object);
}

static void
_proton_plus_widgets_tools_releases_box_on_variant_list_item_bind_gtk_signal_list_item_factory_bind (GtkSignalListItemFactory* _sender,
                                                                                                     GObject* object,
                                                                                                     gpointer self)
{
	proton_plus_widgets_tools_releases_box_on_variant_list_item_bind ((ProtonPlusWidgetsToolsReleasesBox*) self, object);
}

static void
_proton_plus_widgets_tools_releases_box_on_variant_list_item_unbind_gtk_signal_list_item_factory_unbind (GtkSignalListItemFactory* _sender,
                                                                                                         GObject* object,
                                                                                                         gpointer self)
{
	proton_plus_widgets_tools_releases_box_on_variant_list_item_unbind ((ProtonPlusWidgetsToolsReleasesBox*) self, object);
}

static gboolean
_proton_plus_widgets_tools_releases_box_filter_func_gtk_list_box_filter_func (GtkListBoxRow* row,
                                                                              gpointer self)
{
	gboolean result;
	result = proton_plus_widgets_tools_releases_box_filter_func ((ProtonPlusWidgetsToolsReleasesBox*) self, row);
	return result;
}

static void
_proton_plus_widgets_tools_releases_box_on_load_more_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                 gpointer self)
{
	proton_plus_widgets_tools_releases_box_on_load_more_clicked ((ProtonPlusWidgetsToolsReleasesBox*) self, NULL, NULL);
}

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

ProtonPlusWidgetsToolsReleasesBox*
proton_plus_widgets_tools_releases_box_construct (GType object_type)
{
	ProtonPlusWidgetsToolsReleasesBox * self = NULL;
	GHashTable* _tmp0_;
	gchar* _tmp1_;
	gchar** _tmp2_;
	GtkLabel* _tmp3_ = NULL;
	GtkLabel* _tmp4_;
	GtkBox* title_box = NULL;
	GtkBox* _tmp5_ = NULL;
	GtkLabel* _tmp6_;
	GtkImage* icon = NULL;
	GtkImage* _tmp7_ = NULL;
	GtkBox* _tmp8_ = NULL;
	GtkBox* _tmp9_;
	GtkBox* _tmp10_;
	GtkBox* _tmp11_;
	gchar* _tmp12_;
	gchar** _tmp13_;
	GtkLabel* _tmp14_ = NULL;
	GtkLabel* _tmp15_;
	GtkLabel* _tmp16_;
	gchar* _tmp17_;
	GtkButton* _tmp18_ = NULL;
	GtkButton* _tmp19_;
	GtkButton* _tmp20_;
	GtkButton* _tmp21_;
	GtkButton* _tmp22_ = NULL;
	GtkButton* _tmp23_;
	GtkButton* _tmp24_;
	GtkExpression* expression = NULL;
	GtkPropertyExpression* _tmp25_;
	GtkExpression* _tmp26_;
	gchar* _tmp27_;
	GtkDropDown* _tmp28_ = NULL;
	GtkDropDown* _tmp29_;
	GtkDropDown* _tmp30_;
	GtkDropDown* _tmp31_;
	GtkDropDown* _tmp32_;
	GtkSignalListItemFactory* variant_list_factory = NULL;
	GtkSignalListItemFactory* _tmp33_;
	GtkDropDown* _tmp34_;
	GtkBox* _tmp35_ = NULL;
	GtkBox* _tmp36_;
	GtkBox* _tmp37_;
	GtkDropDown* _tmp38_;
	GtkListBox* _tmp39_ = NULL;
	GtkListBox* _tmp40_;
	GtkListBox* _tmp41_;
	GtkListBox* _tmp42_;
	GtkListBox* _tmp43_;
	GtkButton* _tmp44_ = NULL;
	GtkButton* _tmp45_;
	GtkButton* _tmp46_;
	GtkButton* _tmp47_;
	GtkButton* _tmp48_;
	GtkWidget* _tmp49_;
	GtkListBoxRow* _tmp50_ = NULL;
	GtkListBox* _tmp51_;
	GtkListBoxRow* _tmp52_;
	GtkListBox* _tmp53_;
	GtkWidget* _tmp54_;
	GtkScrolledWindow* _tmp55_ = NULL;
	GtkScrolledWindow* _tmp56_;
	AdwSpinner* spinner = NULL;
	AdwSpinner* _tmp57_ = NULL;
	GtkBox* spinner_box = NULL;
	GtkBox* _tmp58_ = NULL;
	GtkStack* _tmp59_ = NULL;
	GtkStack* _tmp60_;
	GtkStack* _tmp61_;
	gchar* _tmp62_;
	gchar* _tmp63_;
	gchar* _tmp64_;
	AdwStatusPage* _tmp65_ = NULL;
	AdwStatusPage* _tmp66_;
	GtkStack* _tmp67_;
	GtkScrolledWindow* _tmp68_;
	GtkStack* _tmp69_;
	GtkStack* _tmp70_;
	AdwStatusPage* _tmp71_;
	GtkBox* _tmp72_;
	GtkBox* _tmp73_;
	GtkBox* _tmp74_;
	GtkStack* _tmp75_;
	AdwClamp* clamp = NULL;
	GtkBox* _tmp76_;
	GtkWidget* _tmp77_;
	AdwClamp* _tmp78_ = NULL;
	self = (ProtonPlusWidgetsToolsReleasesBox*) g_object_new (object_type, "orientation", GTK_ORIENTATION_VERTICAL, "spacing", 0, NULL);
	_tmp0_ = g_hash_table_new_full (NULL, NULL, _g_object_unref0_, _g_object_unref0_);
	_g_hash_table_unref0 (self->priv->variant_list_items);
	self->priv->variant_list_items = _tmp0_;
	_tmp1_ = g_strdup ("title-4");
	_tmp2_ = g_new0 (gchar*, 1 + 1);
	_tmp2_[0] = _tmp1_;
	_tmp3_ = (GtkLabel*) gtk_label_new (NULL);
	gtk_widget_set_halign ((GtkWidget*) _tmp3_, GTK_ALIGN_CENTER);
	gtk_label_set_xalign (_tmp3_, 0.5f);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp3_, _tmp2_);
	_tmp2_ = (_vala_array_free (_tmp2_, 1, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp3_);
	_tmp4_ = _tmp3_;
	proton_plus_widgets_tools_releases_box_set_title_label (self, _tmp4_);
	_g_object_unref0 (_tmp4_);
	_tmp5_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	gtk_widget_set_valign ((GtkWidget*) _tmp5_, GTK_ALIGN_CENTER);
	g_object_ref_sink (_tmp5_);
	title_box = _tmp5_;
	_tmp6_ = self->priv->_title_label;
	gtk_box_append (title_box, (GtkWidget*) _tmp6_);
	_tmp7_ = (GtkImage*) gtk_image_new_from_icon_name ("screwdriver-wrench-symbolic");
	gtk_widget_set_valign ((GtkWidget*) _tmp7_, GTK_ALIGN_CENTER);
	g_object_ref_sink (_tmp7_);
	icon = _tmp7_;
	_tmp8_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
	gtk_widget_set_halign ((GtkWidget*) _tmp8_, GTK_ALIGN_CENTER);
	gtk_widget_set_valign ((GtkWidget*) _tmp8_, GTK_ALIGN_CENTER);
	g_object_ref_sink (_tmp8_);
	_tmp9_ = _tmp8_;
	proton_plus_widgets_tools_releases_box_set_header_title (self, _tmp9_);
	_g_object_unref0 (_tmp9_);
	_tmp10_ = self->priv->_header_title;
	gtk_box_append (_tmp10_, (GtkWidget*) icon);
	_tmp11_ = self->priv->_header_title;
	gtk_box_append (_tmp11_, (GtkWidget*) title_box);
	_tmp12_ = g_strdup ("caption");
	_tmp13_ = g_new0 (gchar*, 1 + 1);
	_tmp13_[0] = _tmp12_;
	_tmp14_ = (GtkLabel*) gtk_label_new (NULL);
	gtk_widget_set_halign ((GtkWidget*) _tmp14_, GTK_ALIGN_CENTER);
	gtk_widget_set_valign ((GtkWidget*) _tmp14_, GTK_ALIGN_CENTER);
	gtk_label_set_xalign (_tmp14_, 0.5f);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp14_, _tmp13_);
	_tmp13_ = (_vala_array_free (_tmp13_, 1, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp14_);
	_tmp15_ = _tmp14_;
	proton_plus_widgets_tools_releases_box_set_last_updated_label (self, _tmp15_);
	_g_object_unref0 (_tmp15_);
	_tmp16_ = self->priv->_last_updated_label;
	gtk_box_append (title_box, (GtkWidget*) _tmp16_);
	_tmp17_ = g_strdup (_ ("Check for new releases"));
	_tmp18_ = (GtkButton*) gtk_button_new_from_icon_name ("arrows-rotate-symbolic");
	gtk_widget_set_valign ((GtkWidget*) _tmp18_, GTK_ALIGN_CENTER);
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp18_, _tmp17_);
	_g_free0 (_tmp17_);
	g_object_ref_sink (_tmp18_);
	_tmp19_ = _tmp18_;
	proton_plus_widgets_tools_releases_box_set_refresh_button (self, _tmp19_);
	_g_object_unref0 (_tmp19_);
	_tmp20_ = self->priv->_refresh_button;
	gtk_widget_add_css_class ((GtkWidget*) _tmp20_, "flat");
	_tmp21_ = self->priv->_refresh_button;
	g_signal_connect_object (_tmp21_, "clicked", (GCallback) _proton_plus_widgets_tools_releases_box_on_refresh_clicked_gtk_button_clicked, self, 0);
	_tmp22_ = (GtkButton*) gtk_button_new_from_icon_name ("globe-symbolic");
	gtk_widget_set_valign ((GtkWidget*) _tmp22_, GTK_ALIGN_CENTER);
	gtk_widget_set_visible ((GtkWidget*) _tmp22_, FALSE);
	g_object_ref_sink (_tmp22_);
	_tmp23_ = _tmp22_;
	proton_plus_widgets_tools_releases_box_set_repository_button (self, _tmp23_);
	_g_object_unref0 (_tmp23_);
	_tmp24_ = self->priv->_repository_button;
	g_signal_connect_object (_tmp24_, "clicked", (GCallback) ___lambda61__gtk_button_clicked, self, 0);
	_tmp25_ = (GtkPropertyExpression*) gtk_property_expression_new (gtk_string_object_get_type (), NULL, "string");
	expression = (GtkExpression*) _tmp25_;
	_tmp26_ = _gtk_expression_ref0 (expression);
	_tmp27_ = g_strdup (_ ("Choose which architecture or build variant to show."));
	_tmp28_ = (GtkDropDown*) gtk_drop_down_new (NULL, _tmp26_);
	gtk_widget_set_visible ((GtkWidget*) _tmp28_, FALSE);
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp28_, _tmp27_);
	_g_free0 (_tmp27_);
	g_object_ref_sink (_tmp28_);
	_tmp29_ = _tmp28_;
	proton_plus_widgets_tools_releases_box_set_variant_dropdown (self, _tmp29_);
	_g_object_unref0 (_tmp29_);
	_tmp30_ = self->priv->_variant_dropdown;
	gtk_widget_set_valign ((GtkWidget*) _tmp30_, GTK_ALIGN_CENTER);
	_tmp31_ = self->priv->_variant_dropdown;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp31_, FALSE);
	_tmp32_ = self->priv->_variant_dropdown;
	g_signal_connect_object ((GObject*) _tmp32_, "notify::selected", (GCallback) _proton_plus_widgets_tools_releases_box_on_variant_selected_g_object_notify, self, 0);
	_tmp33_ = (GtkSignalListItemFactory*) gtk_signal_list_item_factory_new ();
	variant_list_factory = _tmp33_;
	g_signal_connect_object (variant_list_factory, "setup", (GCallback) _proton_plus_widgets_tools_releases_box_on_variant_list_item_setup_gtk_signal_list_item_factory_setup, self, 0);
	g_signal_connect_object (variant_list_factory, "bind", (GCallback) _proton_plus_widgets_tools_releases_box_on_variant_list_item_bind_gtk_signal_list_item_factory_bind, self, 0);
	g_signal_connect_object (variant_list_factory, "unbind", (GCallback) _proton_plus_widgets_tools_releases_box_on_variant_list_item_unbind_gtk_signal_list_item_factory_unbind, self, 0);
	_tmp34_ = self->priv->_variant_dropdown;
	gtk_drop_down_set_list_factory (_tmp34_, (GtkListItemFactory*) variant_list_factory);
	_tmp35_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	gtk_widget_set_visible ((GtkWidget*) _tmp35_, FALSE);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp35_, FALSE);
	gtk_widget_set_valign ((GtkWidget*) _tmp35_, GTK_ALIGN_CENTER);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp35_, 0);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp35_, 0);
	g_object_ref_sink (_tmp35_);
	_tmp36_ = _tmp35_;
	proton_plus_widgets_tools_releases_box_set_variant_box (self, _tmp36_);
	_g_object_unref0 (_tmp36_);
	_tmp37_ = self->priv->_variant_box;
	_tmp38_ = self->priv->_variant_dropdown;
	gtk_box_append (_tmp37_, (GtkWidget*) _tmp38_);
	_tmp39_ = (GtkListBox*) gtk_list_box_new ();
	gtk_list_box_set_selection_mode (_tmp39_, GTK_SELECTION_NONE);
	g_object_ref_sink (_tmp39_);
	_tmp40_ = _tmp39_;
	proton_plus_widgets_tools_releases_box_set_list_box (self, _tmp40_);
	_g_object_unref0 (_tmp40_);
	_tmp41_ = self->priv->_list_box;
	gtk_widget_add_css_class ((GtkWidget*) _tmp41_, "boxed-list");
	_tmp42_ = self->priv->_list_box;
	gtk_widget_add_css_class ((GtkWidget*) _tmp42_, "tools-releases-card");
	_tmp43_ = self->priv->_list_box;
	gtk_list_box_set_filter_func (_tmp43_, _proton_plus_widgets_tools_releases_box_filter_func_gtk_list_box_filter_func, g_object_ref (self), g_object_unref);
	_tmp44_ = (GtkButton*) gtk_button_new_with_label (_ ("Load More"));
	gtk_widget_set_margin_top ((GtkWidget*) _tmp44_, 12);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp44_, 12);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp44_, 12);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp44_, 12);
	gtk_widget_set_halign ((GtkWidget*) _tmp44_, GTK_ALIGN_CENTER);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp44_, TRUE);
	g_object_ref_sink (_tmp44_);
	_g_object_unref0 (self->priv->load_more_button);
	self->priv->load_more_button = _tmp44_;
	_tmp45_ = self->priv->load_more_button;
	gtk_widget_add_css_class ((GtkWidget*) _tmp45_, "pill");
	_tmp46_ = self->priv->load_more_button;
	gtk_widget_add_css_class ((GtkWidget*) _tmp46_, "suggested-action");
	_tmp47_ = self->priv->load_more_button;
	g_signal_connect_object (_tmp47_, "clicked", (GCallback) _proton_plus_widgets_tools_releases_box_on_load_more_clicked_gtk_button_clicked, self, 0);
	_tmp48_ = self->priv->load_more_button;
	_tmp49_ = _g_object_ref0 ((GtkWidget*) _tmp48_);
	_tmp50_ = (GtkListBoxRow*) gtk_list_box_row_new ();
	gtk_list_box_row_set_child (_tmp50_, _tmp49_);
	_g_object_unref0 (_tmp49_);
	gtk_list_box_row_set_activatable (_tmp50_, FALSE);
	gtk_list_box_row_set_selectable (_tmp50_, FALSE);
	gtk_widget_set_focusable ((GtkWidget*) _tmp50_, FALSE);
	gtk_widget_set_visible ((GtkWidget*) _tmp50_, FALSE);
	g_object_ref_sink (_tmp50_);
	_g_object_unref0 (self->priv->load_more_row);
	self->priv->load_more_row = _tmp50_;
	_tmp51_ = self->priv->_list_box;
	_tmp52_ = self->priv->load_more_row;
	gtk_list_box_append (_tmp51_, (GtkWidget*) _tmp52_);
	_tmp53_ = self->priv->_list_box;
	_tmp54_ = _g_object_ref0 ((GtkWidget*) _tmp53_);
	_tmp55_ = (GtkScrolledWindow*) gtk_scrolled_window_new ();
	gtk_scrolled_window_set_child (_tmp55_, _tmp54_);
	_g_object_unref0 (_tmp54_);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp55_, TRUE);
	g_object_set (_tmp55_, "hscrollbar-policy", GTK_POLICY_NEVER, NULL);
	g_object_set (_tmp55_, "vscrollbar-policy", GTK_POLICY_AUTOMATIC, NULL);
	g_object_ref_sink (_tmp55_);
	_tmp56_ = _tmp55_;
	proton_plus_widgets_tools_releases_box_set_scrolled (self, _tmp56_);
	_g_object_unref0 (_tmp56_);
	_tmp57_ = (AdwSpinner*) adw_spinner_new ();
	gtk_widget_set_halign ((GtkWidget*) _tmp57_, GTK_ALIGN_CENTER);
	gtk_widget_set_valign ((GtkWidget*) _tmp57_, GTK_ALIGN_CENTER);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp57_, TRUE);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp57_, TRUE);
	g_object_ref_sink (_tmp57_);
	spinner = _tmp57_;
	gtk_widget_set_size_request ((GtkWidget*) spinner, 32, 32);
	_tmp58_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp58_, TRUE);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp58_, TRUE);
	g_object_ref_sink (_tmp58_);
	spinner_box = _tmp58_;
	gtk_box_append (spinner_box, (GtkWidget*) spinner);
	_tmp59_ = (GtkStack*) gtk_stack_new ();
	gtk_widget_set_vexpand ((GtkWidget*) _tmp59_, TRUE);
	gtk_widget_set_overflow ((GtkWidget*) _tmp59_, GTK_OVERFLOW_HIDDEN);
	g_object_ref_sink (_tmp59_);
	_tmp60_ = _tmp59_;
	proton_plus_widgets_tools_releases_box_set_content_stack (self, _tmp60_);
	_g_object_unref0 (_tmp60_);
	_tmp61_ = self->priv->_content_stack;
	gtk_widget_add_css_class ((GtkWidget*) _tmp61_, "card");
	_tmp62_ = g_strdup (_ ("No releases found"));
	_tmp63_ = g_strdup (_ ("No releases match the current filter."));
	_tmp64_ = g_strdup ("magnifying-glass-symbolic");
	_tmp65_ = (AdwStatusPage*) adw_status_page_new ();
	adw_status_page_set_title (_tmp65_, _tmp62_);
	_g_free0 (_tmp62_);
	adw_status_page_set_description (_tmp65_, _tmp63_);
	_g_free0 (_tmp63_);
	adw_status_page_set_icon_name (_tmp65_, _tmp64_);
	_g_free0 (_tmp64_);
	g_object_ref_sink (_tmp65_);
	_tmp66_ = _tmp65_;
	proton_plus_widgets_tools_releases_box_set_status_page (self, _tmp66_);
	_g_object_unref0 (_tmp66_);
	_tmp67_ = self->priv->_content_stack;
	_tmp68_ = self->priv->_scrolled;
	gtk_stack_add_named (_tmp67_, (GtkWidget*) _tmp68_, "list");
	_tmp69_ = self->priv->_content_stack;
	gtk_stack_add_named (_tmp69_, (GtkWidget*) spinner_box, "spinner");
	_tmp70_ = self->priv->_content_stack;
	_tmp71_ = self->priv->_status_page;
	gtk_stack_add_named (_tmp70_, (GtkWidget*) _tmp71_, "empty");
	_tmp72_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
	g_object_ref_sink (_tmp72_);
	_tmp73_ = _tmp72_;
	proton_plus_widgets_tools_releases_box_set_tool_box (self, _tmp73_);
	_g_object_unref0 (_tmp73_);
	_tmp74_ = self->priv->_tool_box;
	_tmp75_ = self->priv->_content_stack;
	gtk_box_append (_tmp74_, (GtkWidget*) _tmp75_);
	_tmp76_ = self->priv->_tool_box;
	_tmp77_ = _g_object_ref0 ((GtkWidget*) _tmp76_);
	_tmp78_ = (AdwClamp*) adw_clamp_new ();
	adw_clamp_set_maximum_size (_tmp78_, 975);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp78_, 12);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp78_, 12);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp78_, 12);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp78_, 12);
	adw_clamp_set_child (_tmp78_, _tmp77_);
	_g_object_unref0 (_tmp77_);
	g_object_ref_sink (_tmp78_);
	clamp = _tmp78_;
	gtk_box_append ((GtkBox*) self, (GtkWidget*) clamp);
	_g_object_unref0 (clamp);
	_g_object_unref0 (spinner_box);
	_g_object_unref0 (spinner);
	_g_object_unref0 (variant_list_factory);
	_gtk_expression_unref0 (expression);
	_g_object_unref0 (icon);
	_g_object_unref0 (title_box);
	return self;
}

ProtonPlusWidgetsToolsReleasesBox*
proton_plus_widgets_tools_releases_box_new (void)
{
	return proton_plus_widgets_tools_releases_box_construct (PROTON_PLUS_WIDGETS_TOOLS_TYPE_RELEASES_BOX);
}

void
proton_plus_widgets_tools_releases_box_set_controller_up_target (ProtonPlusWidgetsToolsReleasesBox* self,
                                                                 GtkWidget* target)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (target != NULL);
	self->priv->controller_up_target = target;
}

static void
proton_plus_widgets_tools_releases_box_set_selected_tool_data_free (gpointer _data)
{
	ProtonPlusWidgetsToolsReleasesBoxSetSelectedToolData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->tool);
	_g_object_unref0 (_data_->self);
	g_slice_free (ProtonPlusWidgetsToolsReleasesBoxSetSelectedToolData, _data_);
}

void
proton_plus_widgets_tools_releases_box_set_selected_tool (ProtonPlusWidgetsToolsReleasesBox* self,
                                                          ProtonPlusModelsTool* tool,
                                                          GAsyncReadyCallback _callback_,
                                                          gpointer _user_data_)
{
	ProtonPlusWidgetsToolsReleasesBoxSetSelectedToolData* _data_;
	ProtonPlusWidgetsToolsReleasesBox* _tmp0_;
	ProtonPlusModelsTool* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (tool != NULL);
	_data_ = g_slice_new0 (ProtonPlusWidgetsToolsReleasesBoxSetSelectedToolData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_widgets_tools_releases_box_set_selected_tool_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (tool);
	_g_object_unref0 (_data_->tool);
	_data_->tool = _tmp1_;
	proton_plus_widgets_tools_releases_box_set_selected_tool_co (_data_);
}

gboolean
proton_plus_widgets_tools_releases_box_set_selected_tool_finish (ProtonPlusWidgetsToolsReleasesBox* self,
                                                                 GAsyncResult* _res_)
{
	gboolean result;
	ProtonPlusWidgetsToolsReleasesBoxSetSelectedToolData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
proton_plus_widgets_tools_releases_box_set_selected_tool_ready (GObject* source_object,
                                                                GAsyncResult* _res_,
                                                                gpointer _user_data_)
{
	ProtonPlusWidgetsToolsReleasesBoxSetSelectedToolData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_widgets_tools_releases_box_set_selected_tool_co (_data_);
}

static gboolean
proton_plus_widgets_tools_releases_box_set_selected_tool_co (ProtonPlusWidgetsToolsReleasesBoxSetSelectedToolData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->self->priv->tool_request_generation = _data_->self->priv->tool_request_generation + 1;
	_data_->_tmp0_ = _data_->self->priv->tool_request_generation;
	_data_->request_generation = _data_->_tmp0_;
	_data_->_tmp1_ = _g_object_ref0 (_data_->tool);
	_g_object_unref0 (_data_->self->priv->current_tool);
	_data_->self->priv->current_tool = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->self->priv->_content_stack;
	gtk_stack_set_visible_child_name (_data_->_tmp2_, "spinner");
	_data_->_tmp3_ = _data_->self->priv->load_more_button;
	gtk_widget_set_sensitive ((GtkWidget*) _data_->_tmp3_, TRUE);
	proton_plus_widgets_tools_releases_box_disconnect_job_state_handlers (_data_->self);
	_data_->_tmp4_ = _data_->self->priv->_list_box;
	gtk_list_box_remove_all (_data_->_tmp4_);
	_data_->_tmp5_ = _data_->self->priv->_title_label;
	_data_->_tmp6_ = proton_plus_models_tool_get_title (_data_->tool);
	_data_->_tmp7_ = _data_->_tmp6_;
	gtk_label_set_label (_data_->_tmp5_, _data_->_tmp7_);
	_data_->_tmp8_ = _data_->self->priv->_title_label;
	_data_->_tmp9_ = proton_plus_models_tool_get_description (_data_->tool);
	_data_->_tmp10_ = _data_->_tmp9_;
	gtk_widget_set_tooltip_text ((GtkWidget*) _data_->_tmp8_, _data_->_tmp10_);
	proton_plus_widgets_tools_releases_box_update_repository_button (_data_->self, _data_->tool);
	proton_plus_widgets_tools_releases_box_update_last_updated_label (_data_->self);
	proton_plus_widgets_tools_releases_box_update_variant_row (_data_->self, _data_->tool);
	_data_->_tmp11_ = proton_plus_models_tool_get_release_catalog (_data_->tool);
	_data_->_tmp12_ = _data_->_tmp11_;
	_data_->_tmp13_ = _g_object_ref0 (_data_->_tmp12_);
	_data_->catalog = _data_->_tmp13_;
	_data_->_tmp14_ = _data_->catalog;
	if (_data_->_tmp14_ == NULL) {
		_data_->_tmp15_ = _data_->self->priv->_content_stack;
		gtk_stack_set_visible_child_name (_data_->_tmp15_, "empty");
		_data_->result = TRUE;
		_g_object_unref0 (_data_->catalog);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp16_ = _data_->catalog;
	_data_->_state_ = 1;
	proton_plus_models_release_catalog_load (_data_->_tmp16_, FALSE, proton_plus_widgets_tools_releases_box_set_selected_tool_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp17_ = proton_plus_models_release_catalog_load_finish (_data_->_tmp16_, _data_->_res_);
	_data_->_result_ = _data_->_tmp17_;
	if (!proton_plus_widgets_tools_releases_box_is_current_tool_request (_data_->self, _data_->tool, _data_->request_generation)) {
		_data_->result = FALSE;
		_g_object_unref0 (_data_->_result_);
		_g_object_unref0 (_data_->catalog);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp18_ = _data_->_result_;
	_data_->_tmp19_ = proton_plus_models_release_catalog_result_get_succeeded (_data_->_tmp18_);
	_data_->_tmp20_ = _data_->_tmp19_;
	if (!_data_->_tmp20_) {
		_data_->_tmp21_ = _data_->_result_;
		_data_->_tmp22_ = proton_plus_models_release_catalog_result_get_code (_data_->_tmp21_);
		_data_->_tmp23_ = _data_->_tmp22_;
		_data_->_tmp24_ = proton_plus_get_return_code_message (_data_->_tmp23_);
		_data_->_tmp25_ = _data_->_tmp24_;
		_data_->_tmp26_ = proton_plus_widgets_main_error_dialog_new (_ ("Failed to Fetch Releases"), _data_->_tmp25_, "");
		g_object_ref_sink (_data_->_tmp26_);
		_data_->_tmp27_ = (AdwAlertDialog*) _data_->_tmp26_;
		_g_free0 (_data_->_tmp25_);
		_data_->dialog = _data_->_tmp27_;
		_data_->_tmp28_ = _data_->self->priv->_content_stack;
		gtk_stack_set_visible_child_name (_data_->_tmp28_, "list");
		_data_->_tmp29_ = _data_->dialog;
		_data_->_tmp30_ = gtk_widget_get_root ((GtkWidget*) _data_->self);
		proton_plus_widgets_window_present_dialog_for_controller ((AdwDialog*) _data_->_tmp29_, (GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp30_, gtk_window_get_type (), GtkWindow));
		_data_->result = FALSE;
		_g_object_unref0 (_data_->dialog);
		_g_object_unref0 (_data_->_result_);
		_g_object_unref0 (_data_->catalog);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp31_ = proton_plus_models_tool_get_group (_data_->tool);
	_data_->_tmp32_ = _data_->_tmp31_;
	proton_plus_models_group_refresh_installed_state (_data_->_tmp32_);
	_data_->_tmp33_ = _data_->_result_;
	_data_->_tmp34_ = proton_plus_models_release_catalog_result_get_releases (_data_->_tmp33_);
	_data_->_tmp35_ = _data_->_tmp34_;
	proton_plus_widgets_tools_releases_box_add_release_rows (_data_->self, _data_->tool, _data_->_tmp35_);
	_data_->_tmp36_ = _data_->self->priv->_list_box;
	_data_->_tmp37_ = _data_->self->priv->load_more_row;
	gtk_list_box_append (_data_->_tmp36_, (GtkWidget*) _data_->_tmp37_);
	_data_->_tmp39_ = _data_->catalog;
	_data_->_tmp40_ = proton_plus_models_release_catalog_get_has_more (_data_->_tmp39_);
	_data_->_tmp41_ = _data_->_tmp40_;
	if (_data_->_tmp41_) {
		_data_->_tmp38_ = proton_plus_widgets_tools_releases_box_can_show_provider_release_rows (_data_->self);
	} else {
		_data_->_tmp38_ = FALSE;
	}
	_data_->_tmp42_ = _data_->self->priv->load_more_row;
	gtk_widget_set_visible ((GtkWidget*) _data_->_tmp42_, _data_->_tmp38_);
	_data_->_tmp43_ = _data_->self->priv->_content_stack;
	gtk_stack_set_visible_child_name (_data_->_tmp43_, "list");
	proton_plus_widgets_tools_releases_box_apply_selected_variant_to_rows (_data_->self);
	proton_plus_widgets_tools_releases_box_update_last_updated_label (_data_->self);
	proton_plus_widgets_tools_releases_box_update_visibility (_data_->self);
	_data_->result = TRUE;
	_g_object_unref0 (_data_->_result_);
	_g_object_unref0 (_data_->catalog);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

gboolean
proton_plus_widgets_tools_releases_box_focus_first_controller_target (ProtonPlusWidgetsToolsReleasesBox* self)
{
	GtkWidget* child = NULL;
	GtkListBox* _tmp0_;
	GtkWidget* _tmp1_;
	GtkWidget* _tmp2_;
	gboolean _tmp19_ = FALSE;
	gboolean _tmp20_ = FALSE;
	gboolean _tmp21_ = FALSE;
	GtkListBoxRow* _tmp22_;
	gboolean _tmp27_ = FALSE;
	gboolean _tmp28_ = FALSE;
	gboolean _tmp29_ = FALSE;
	gboolean _tmp30_ = FALSE;
	GtkWidget* _tmp31_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_list_box;
	_tmp1_ = gtk_widget_get_first_child ((GtkWidget*) _tmp0_);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	child = _tmp2_;
	while (TRUE) {
		GtkWidget* _tmp3_;
		gboolean _tmp4_ = FALSE;
		gboolean _tmp5_ = FALSE;
		gboolean _tmp6_ = FALSE;
		gboolean _tmp7_ = FALSE;
		gboolean _tmp8_ = FALSE;
		GtkWidget* _tmp9_;
		GtkWidget* _tmp16_;
		GtkWidget* _tmp17_;
		GtkWidget* _tmp18_;
		_tmp3_ = child;
		if (!(_tmp3_ != NULL)) {
			break;
		}
		_tmp9_ = child;
		if (PROTON_PLUS_WIDGETS_TOOLS_IS_RELEASE_ROW (_tmp9_)) {
			GtkWidget* _tmp10_;
			_tmp10_ = child;
			_tmp8_ = gtk_widget_get_mapped (_tmp10_);
		} else {
			_tmp8_ = FALSE;
		}
		if (_tmp8_) {
			GtkWidget* _tmp11_;
			_tmp11_ = child;
			_tmp7_ = gtk_widget_is_visible (_tmp11_);
		} else {
			_tmp7_ = FALSE;
		}
		if (_tmp7_) {
			GtkWidget* _tmp12_;
			_tmp12_ = child;
			_tmp6_ = gtk_widget_get_child_visible (_tmp12_);
		} else {
			_tmp6_ = FALSE;
		}
		if (_tmp6_) {
			GtkWidget* _tmp13_;
			_tmp13_ = child;
			_tmp5_ = gtk_widget_is_sensitive (_tmp13_);
		} else {
			_tmp5_ = FALSE;
		}
		if (_tmp5_) {
			GtkWidget* _tmp14_;
			_tmp14_ = child;
			_tmp4_ = gtk_widget_get_focusable (_tmp14_);
		} else {
			_tmp4_ = FALSE;
		}
		if (_tmp4_) {
			GtkWidget* _tmp15_;
			_tmp15_ = child;
			result = gtk_widget_grab_focus (_tmp15_);
			_g_object_unref0 (child);
			return result;
		}
		_tmp16_ = child;
		_tmp17_ = gtk_widget_get_next_sibling (_tmp16_);
		_tmp18_ = _g_object_ref0 (_tmp17_);
		_g_object_unref0 (child);
		child = _tmp18_;
	}
	_tmp22_ = self->priv->load_more_row;
	if (gtk_widget_get_mapped ((GtkWidget*) _tmp22_)) {
		GtkListBoxRow* _tmp23_;
		_tmp23_ = self->priv->load_more_row;
		_tmp21_ = gtk_widget_is_visible ((GtkWidget*) _tmp23_);
	} else {
		_tmp21_ = FALSE;
	}
	if (_tmp21_) {
		GtkListBoxRow* _tmp24_;
		_tmp24_ = self->priv->load_more_row;
		_tmp20_ = gtk_widget_get_child_visible ((GtkWidget*) _tmp24_);
	} else {
		_tmp20_ = FALSE;
	}
	if (_tmp20_) {
		GtkButton* _tmp25_;
		_tmp25_ = self->priv->load_more_button;
		_tmp19_ = gtk_widget_is_sensitive ((GtkWidget*) _tmp25_);
	} else {
		_tmp19_ = FALSE;
	}
	if (_tmp19_) {
		GtkButton* _tmp26_;
		_tmp26_ = self->priv->load_more_button;
		result = gtk_widget_grab_focus ((GtkWidget*) _tmp26_);
		_g_object_unref0 (child);
		return result;
	}
	_tmp31_ = self->priv->controller_up_target;
	if (_tmp31_ != NULL) {
		GtkWidget* _tmp32_;
		_tmp32_ = self->priv->controller_up_target;
		_tmp30_ = gtk_widget_get_mapped (G_TYPE_CHECK_INSTANCE_CAST (_tmp32_, gtk_widget_get_type (), GtkWidget));
	} else {
		_tmp30_ = FALSE;
	}
	if (_tmp30_) {
		GtkWidget* _tmp33_;
		_tmp33_ = self->priv->controller_up_target;
		_tmp29_ = gtk_widget_is_visible (G_TYPE_CHECK_INSTANCE_CAST (_tmp33_, gtk_widget_get_type (), GtkWidget));
	} else {
		_tmp29_ = FALSE;
	}
	if (_tmp29_) {
		GtkWidget* _tmp34_;
		_tmp34_ = self->priv->controller_up_target;
		_tmp28_ = gtk_widget_is_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp34_, gtk_widget_get_type (), GtkWidget));
	} else {
		_tmp28_ = FALSE;
	}
	if (_tmp28_) {
		GtkWidget* _tmp35_;
		_tmp35_ = self->priv->controller_up_target;
		_tmp27_ = gtk_widget_grab_focus (G_TYPE_CHECK_INSTANCE_CAST (_tmp35_, gtk_widget_get_type (), GtkWidget));
	} else {
		_tmp27_ = FALSE;
	}
	result = _tmp27_;
	_g_object_unref0 (child);
	return result;
}

static gboolean
proton_plus_widgets_tools_releases_box_real_controller_focus_direction (ProtonPlusUtilsControllerDirectionalFocus* base,
                                                                        GObject* focused_object,
                                                                        ProtonPlusUtilsControllerNavigationDirection direction)
{
	ProtonPlusWidgetsToolsReleasesBox * self;
	GtkWidget* focused = NULL;
	GtkWidget* _tmp0_;
	gboolean _tmp1_ = FALSE;
	GtkWidget* _tmp2_;
	GtkButton* _tmp27_;
	gboolean result;
	self = (ProtonPlusWidgetsToolsReleasesBox*) base;
	g_return_val_if_fail (focused_object != NULL, FALSE);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (focused_object, gtk_widget_get_type ()) ? ((GtkWidget*) focused_object) : NULL);
	focused = _tmp0_;
	_tmp2_ = focused;
	if (_tmp2_ == NULL) {
		_tmp1_ = TRUE;
	} else {
		gboolean _tmp3_ = FALSE;
		GtkWidget* _tmp4_;
		GtkListBoxRow* _tmp5_;
		_tmp4_ = focused;
		_tmp5_ = self->priv->load_more_row;
		if (_tmp4_ != G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, gtk_widget_get_type (), GtkWidget)) {
			GtkWidget* _tmp6_;
			GtkListBoxRow* _tmp7_;
			_tmp6_ = focused;
			_tmp7_ = self->priv->load_more_row;
			_tmp3_ = !gtk_widget_is_ancestor (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, gtk_widget_get_type (), GtkWidget), (GtkWidget*) _tmp7_);
		} else {
			_tmp3_ = FALSE;
		}
		_tmp1_ = _tmp3_;
	}
	if (_tmp1_) {
		result = FALSE;
		_g_object_unref0 (focused);
		return result;
	}
	if (direction == PROTON_PLUS_UTILS_CONTROLLER_NAVIGATION_DIRECTION_UP) {
		GtkWidget* child = NULL;
		GtkListBox* _tmp8_;
		GtkWidget* _tmp9_;
		GtkWidget* _tmp10_;
		_tmp8_ = self->priv->_list_box;
		_tmp9_ = gtk_widget_get_last_child ((GtkWidget*) _tmp8_);
		_tmp10_ = _g_object_ref0 (_tmp9_);
		child = _tmp10_;
		while (TRUE) {
			GtkWidget* _tmp11_;
			gboolean _tmp12_ = FALSE;
			gboolean _tmp13_ = FALSE;
			gboolean _tmp14_ = FALSE;
			gboolean _tmp15_ = FALSE;
			gboolean _tmp16_ = FALSE;
			GtkWidget* _tmp17_;
			GtkWidget* _tmp24_;
			GtkWidget* _tmp25_;
			GtkWidget* _tmp26_;
			_tmp11_ = child;
			if (!(_tmp11_ != NULL)) {
				break;
			}
			_tmp17_ = child;
			if (PROTON_PLUS_WIDGETS_TOOLS_IS_RELEASE_ROW (_tmp17_)) {
				GtkWidget* _tmp18_;
				_tmp18_ = child;
				_tmp16_ = gtk_widget_get_mapped (_tmp18_);
			} else {
				_tmp16_ = FALSE;
			}
			if (_tmp16_) {
				GtkWidget* _tmp19_;
				_tmp19_ = child;
				_tmp15_ = gtk_widget_is_visible (_tmp19_);
			} else {
				_tmp15_ = FALSE;
			}
			if (_tmp15_) {
				GtkWidget* _tmp20_;
				_tmp20_ = child;
				_tmp14_ = gtk_widget_get_child_visible (_tmp20_);
			} else {
				_tmp14_ = FALSE;
			}
			if (_tmp14_) {
				GtkWidget* _tmp21_;
				_tmp21_ = child;
				_tmp13_ = gtk_widget_is_sensitive (_tmp21_);
			} else {
				_tmp13_ = FALSE;
			}
			if (_tmp13_) {
				GtkWidget* _tmp22_;
				_tmp22_ = child;
				_tmp12_ = gtk_widget_get_focusable (_tmp22_);
			} else {
				_tmp12_ = FALSE;
			}
			if (_tmp12_) {
				GtkWidget* _tmp23_;
				_tmp23_ = child;
				result = gtk_widget_grab_focus (_tmp23_);
				_g_object_unref0 (child);
				_g_object_unref0 (focused);
				return result;
			}
			_tmp24_ = child;
			_tmp25_ = gtk_widget_get_prev_sibling (_tmp24_);
			_tmp26_ = _g_object_ref0 (_tmp25_);
			_g_object_unref0 (child);
			child = _tmp26_;
		}
		_g_object_unref0 (child);
	}
	_tmp27_ = self->priv->load_more_button;
	result = gtk_widget_grab_focus ((GtkWidget*) _tmp27_);
	_g_object_unref0 (focused);
	return result;
}

static void
proton_plus_widgets_tools_releases_box_on_variant_list_item_setup (ProtonPlusWidgetsToolsReleasesBox* self,
                                                                   GObject* object)
{
	GtkListItem* list_item = NULL;
	GtkListItem* _tmp0_;
	GtkLabel* label = NULL;
	GtkLabel* _tmp1_ = NULL;
	GtkImage* checkmark = NULL;
	GtkImage* _tmp2_ = NULL;
	GtkBox* row = NULL;
	GtkBox* _tmp3_ = NULL;
	GtkBox* content = NULL;
	GtkBox* _tmp4_ = NULL;
	GtkLabel* _tmp5_;
	GtkImage* _tmp6_;
	GtkBox* _tmp7_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (object != NULL);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (object, gtk_list_item_get_type ()) ? ((GtkListItem*) object) : NULL);
	list_item = _tmp0_;
	_tmp1_ = (GtkLabel*) gtk_label_new (NULL);
	gtk_label_set_xalign (_tmp1_, 0.0f);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp1_, TRUE);
	g_object_ref_sink (_tmp1_);
	label = _tmp1_;
	_tmp2_ = (GtkImage*) gtk_image_new_from_icon_name ("object-select-symbolic");
	gtk_widget_set_visible ((GtkWidget*) _tmp2_, FALSE);
	g_object_ref_sink (_tmp2_);
	checkmark = _tmp2_;
	_tmp3_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp3_, TRUE);
	g_object_ref_sink (_tmp3_);
	row = _tmp3_;
	_tmp4_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp4_, TRUE);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp4_, 6);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp4_, 6);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp4_, 12);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp4_, 12);
	g_object_ref_sink (_tmp4_);
	content = _tmp4_;
	gtk_box_append (content, (GtkWidget*) label);
	gtk_box_append (content, (GtkWidget*) checkmark);
	gtk_box_append (row, (GtkWidget*) content);
	_tmp5_ = _g_object_ref0 (label);
	g_object_set_data_full (object, "variant-label", _tmp5_, g_object_unref);
	_tmp6_ = _g_object_ref0 (checkmark);
	g_object_set_data_full (object, "variant-checkmark", _tmp6_, g_object_unref);
	_tmp7_ = _g_object_ref0 (row);
	g_object_set_data_full (object, "variant-row", _tmp7_, g_object_unref);
	gtk_list_item_set_child (list_item, (GtkWidget*) row);
	_g_object_unref0 (content);
	_g_object_unref0 (row);
	_g_object_unref0 (checkmark);
	_g_object_unref0 (label);
	_g_object_unref0 (list_item);
}

static void
proton_plus_widgets_tools_releases_box_on_variant_list_item_bind (ProtonPlusWidgetsToolsReleasesBox* self,
                                                                  GObject* object)
{
	GtkListItem* list_item = NULL;
	GtkListItem* _tmp0_;
	GtkStringObject* variant = NULL;
	GtkListItem* _tmp1_;
	GObject* _tmp2_;
	GObject* _tmp3_;
	GtkStringObject* _tmp4_;
	GtkStringObject* _tmp5_;
	GHashTable* _tmp6_;
	GtkStringObject* _tmp7_;
	GtkStringObject* _tmp8_;
	GtkListItem* _tmp9_;
	GtkListItem* _tmp10_;
	gchar* variant_name = NULL;
	GtkStringObject* _tmp11_;
	const gchar* _tmp12_;
	const gchar* _tmp13_;
	gchar* _tmp14_;
	gchar* tooltip = NULL;
	const gchar* _tmp15_;
	gchar* _tmp16_;
	GtkLabel* label = NULL;
	gconstpointer _tmp17_;
	GtkLabel* _tmp18_;
	GtkImage* checkmark = NULL;
	gconstpointer _tmp19_;
	GtkImage* _tmp20_;
	GtkBox* row = NULL;
	gconstpointer _tmp21_;
	GtkBox* _tmp22_;
	GtkWidget* list_row = NULL;
	GtkBox* _tmp23_;
	GtkWidget* _tmp24_;
	GtkWidget* _tmp25_;
	GtkLabel* _tmp26_;
	const gchar* _tmp27_;
	GtkWidget* _tmp28_;
	GtkImage* _tmp31_;
	GtkStringObject* _tmp32_;
	GtkDropDown* _tmp33_;
	GObject* _tmp34_;
	GObject* _tmp35_;
	GtkImage* _tmp36_;
	gboolean _tmp37_;
	gboolean _tmp38_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (object != NULL);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (object, gtk_list_item_get_type ()) ? ((GtkListItem*) object) : NULL);
	list_item = _tmp0_;
	_tmp1_ = list_item;
	_tmp2_ = gtk_list_item_get_item (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, gtk_string_object_get_type ()) ? ((GtkStringObject*) _tmp3_) : NULL);
	variant = _tmp4_;
	_tmp5_ = variant;
	if (_tmp5_ == NULL) {
		_g_object_unref0 (variant);
		_g_object_unref0 (list_item);
		return;
	}
	_tmp6_ = self->priv->variant_list_items;
	_tmp7_ = variant;
	_tmp8_ = _g_object_ref0 (_tmp7_);
	_tmp9_ = list_item;
	_tmp10_ = _g_object_ref0 (_tmp9_);
	g_hash_table_insert (_tmp6_, _tmp8_, _tmp10_);
	_tmp11_ = variant;
	_tmp12_ = gtk_string_object_get_string (_tmp11_);
	_tmp13_ = _tmp12_;
	_tmp14_ = g_strdup (_tmp13_);
	variant_name = _tmp14_;
	_tmp15_ = variant_name;
	_tmp16_ = proton_plus_widgets_tools_releases_box_get_variant_tooltip (_tmp15_);
	tooltip = _tmp16_;
	_tmp17_ = g_object_get_data (object, "variant-label");
	_tmp18_ = _g_object_ref0 ((GtkLabel*) _tmp17_);
	label = _tmp18_;
	_tmp19_ = g_object_get_data (object, "variant-checkmark");
	_tmp20_ = _g_object_ref0 ((GtkImage*) _tmp19_);
	checkmark = _tmp20_;
	_tmp21_ = g_object_get_data (object, "variant-row");
	_tmp22_ = _g_object_ref0 ((GtkBox*) _tmp21_);
	row = _tmp22_;
	_tmp23_ = row;
	_tmp24_ = gtk_widget_get_parent ((GtkWidget*) _tmp23_);
	_tmp25_ = _g_object_ref0 (_tmp24_);
	list_row = _tmp25_;
	_tmp26_ = label;
	_tmp27_ = variant_name;
	gtk_label_set_label (_tmp26_, _tmp27_);
	_tmp28_ = list_row;
	if (_tmp28_ != NULL) {
		GtkWidget* _tmp29_;
		const gchar* _tmp30_;
		_tmp29_ = list_row;
		_tmp30_ = tooltip;
		gtk_widget_set_tooltip_text (_tmp29_, _tmp30_);
	}
	_tmp31_ = checkmark;
	_tmp32_ = variant;
	_tmp33_ = self->priv->_variant_dropdown;
	_tmp34_ = gtk_drop_down_get_selected_item (_tmp33_);
	_tmp35_ = _tmp34_;
	gtk_widget_set_visible ((GtkWidget*) _tmp31_, G_TYPE_CHECK_INSTANCE_CAST (_tmp32_, G_TYPE_OBJECT, GObject) == _tmp35_);
	_tmp36_ = checkmark;
	_tmp37_ = gtk_widget_get_visible ((GtkWidget*) _tmp36_);
	_tmp38_ = _tmp37_;
	if (_tmp38_) {
		GtkImage* _tmp39_;
		GtkImage* _tmp40_;
		_tmp39_ = checkmark;
		_tmp40_ = _g_object_ref0 (_tmp39_);
		_g_object_unref0 (self->priv->selected_variant_checkmark);
		self->priv->selected_variant_checkmark = _tmp40_;
	}
	_g_object_unref0 (list_row);
	_g_object_unref0 (row);
	_g_object_unref0 (checkmark);
	_g_object_unref0 (label);
	_g_free0 (tooltip);
	_g_free0 (variant_name);
	_g_object_unref0 (variant);
	_g_object_unref0 (list_item);
}

static void
proton_plus_widgets_tools_releases_box_on_variant_list_item_unbind (ProtonPlusWidgetsToolsReleasesBox* self,
                                                                    GObject* object)
{
	GtkListItem* list_item = NULL;
	GtkListItem* _tmp0_;
	GtkStringObject* variant = NULL;
	GtkListItem* _tmp1_;
	GObject* _tmp2_;
	GObject* _tmp3_;
	GtkStringObject* _tmp4_;
	gboolean _tmp5_ = FALSE;
	GtkStringObject* _tmp6_;
	GtkImage* checkmark = NULL;
	gconstpointer _tmp13_;
	GtkImage* _tmp14_;
	GtkImage* _tmp15_;
	GtkImage* _tmp16_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (object != NULL);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (object, gtk_list_item_get_type ()) ? ((GtkListItem*) object) : NULL);
	list_item = _tmp0_;
	_tmp1_ = list_item;
	_tmp2_ = gtk_list_item_get_item (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, gtk_string_object_get_type ()) ? ((GtkStringObject*) _tmp3_) : NULL);
	variant = _tmp4_;
	_tmp6_ = variant;
	if (_tmp6_ != NULL) {
		GHashTable* _tmp7_;
		GtkStringObject* _tmp8_;
		gconstpointer _tmp9_;
		GtkListItem* _tmp10_;
		_tmp7_ = self->priv->variant_list_items;
		_tmp8_ = variant;
		_tmp9_ = g_hash_table_lookup (_tmp7_, _tmp8_);
		_tmp10_ = list_item;
		_tmp5_ = ((GtkListItem*) _tmp9_) == _tmp10_;
	} else {
		_tmp5_ = FALSE;
	}
	if (_tmp5_) {
		GHashTable* _tmp11_;
		GtkStringObject* _tmp12_;
		_tmp11_ = self->priv->variant_list_items;
		_tmp12_ = variant;
		g_hash_table_remove (_tmp11_, _tmp12_);
	}
	_tmp13_ = g_object_get_data (object, "variant-checkmark");
	_tmp14_ = _g_object_ref0 ((GtkImage*) _tmp13_);
	checkmark = _tmp14_;
	_tmp15_ = checkmark;
	_tmp16_ = self->priv->selected_variant_checkmark;
	if (_tmp15_ == _tmp16_) {
		_g_object_unref0 (self->priv->selected_variant_checkmark);
		self->priv->selected_variant_checkmark = NULL;
	}
	_g_object_unref0 (checkmark);
	_g_object_unref0 (variant);
	_g_object_unref0 (list_item);
}

static void
proton_plus_widgets_tools_releases_box_update_variant_list_item_checkmark (ProtonPlusWidgetsToolsReleasesBox* self)
{
	GtkImage* _tmp0_;
	GtkStringObject* selected_item = NULL;
	GtkDropDown* _tmp2_;
	GObject* _tmp3_;
	GObject* _tmp4_;
	GtkStringObject* _tmp5_;
	GtkListItem* _tmp6_ = NULL;
	GtkStringObject* _tmp7_;
	GtkListItem* list_item = NULL;
	GtkListItem* _tmp11_;
	GtkListItem* _tmp12_;
	GtkListItem* _tmp13_;
	gconstpointer _tmp14_;
	GtkImage* _tmp15_;
	GtkImage* _tmp16_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->selected_variant_checkmark;
	if (_tmp0_ != NULL) {
		GtkImage* _tmp1_;
		_tmp1_ = self->priv->selected_variant_checkmark;
		gtk_widget_set_visible ((GtkWidget*) _tmp1_, FALSE);
	}
	_tmp2_ = self->priv->_variant_dropdown;
	_tmp3_ = gtk_drop_down_get_selected_item (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp4_, gtk_string_object_get_type ()) ? ((GtkStringObject*) _tmp4_) : NULL);
	selected_item = _tmp5_;
	_tmp7_ = selected_item;
	if (_tmp7_ != NULL) {
		GHashTable* _tmp8_;
		GtkStringObject* _tmp9_;
		gconstpointer _tmp10_;
		_tmp8_ = self->priv->variant_list_items;
		_tmp9_ = selected_item;
		_tmp10_ = g_hash_table_lookup (_tmp8_, _tmp9_);
		_tmp6_ = (GtkListItem*) _tmp10_;
	} else {
		_tmp6_ = NULL;
	}
	_tmp11_ = _g_object_ref0 (_tmp6_);
	list_item = _tmp11_;
	_tmp12_ = list_item;
	if (_tmp12_ == NULL) {
		_g_object_unref0 (self->priv->selected_variant_checkmark);
		self->priv->selected_variant_checkmark = NULL;
		_g_object_unref0 (list_item);
		_g_object_unref0 (selected_item);
		return;
	}
	_tmp13_ = list_item;
	_tmp14_ = g_object_get_data ((GObject*) _tmp13_, "variant-checkmark");
	_tmp15_ = _g_object_ref0 ((GtkImage*) _tmp14_);
	_g_object_unref0 (self->priv->selected_variant_checkmark);
	self->priv->selected_variant_checkmark = _tmp15_;
	_tmp16_ = self->priv->selected_variant_checkmark;
	gtk_widget_set_visible ((GtkWidget*) _tmp16_, TRUE);
	_g_object_unref0 (list_item);
	_g_object_unref0 (selected_item);
}

static void
proton_plus_widgets_tools_releases_box_on_refresh_clicked (ProtonPlusWidgetsToolsReleasesBox* self)
{
	ProtonPlusModelsTool* _tmp0_;
	ProtonPlusModelsTool* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->current_tool;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = self->priv->current_tool;
	proton_plus_widgets_tools_releases_box_set_selected_tool_forced (self, _tmp1_, NULL, NULL);
}

static void
proton_plus_widgets_tools_releases_box_set_selected_tool_forced_data_free (gpointer _data)
{
	ProtonPlusWidgetsToolsReleasesBoxSetSelectedToolForcedData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->tool);
	_g_object_unref0 (_data_->self);
	g_slice_free (ProtonPlusWidgetsToolsReleasesBoxSetSelectedToolForcedData, _data_);
}

static void
proton_plus_widgets_tools_releases_box_set_selected_tool_forced (ProtonPlusWidgetsToolsReleasesBox* self,
                                                                 ProtonPlusModelsTool* tool,
                                                                 GAsyncReadyCallback _callback_,
                                                                 gpointer _user_data_)
{
	ProtonPlusWidgetsToolsReleasesBoxSetSelectedToolForcedData* _data_;
	ProtonPlusWidgetsToolsReleasesBox* _tmp0_;
	ProtonPlusModelsTool* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (tool != NULL);
	_data_ = g_slice_new0 (ProtonPlusWidgetsToolsReleasesBoxSetSelectedToolForcedData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_widgets_tools_releases_box_set_selected_tool_forced_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (tool);
	_g_object_unref0 (_data_->tool);
	_data_->tool = _tmp1_;
	proton_plus_widgets_tools_releases_box_set_selected_tool_forced_co (_data_);
}

static void
proton_plus_widgets_tools_releases_box_set_selected_tool_forced_finish (ProtonPlusWidgetsToolsReleasesBox* self,
                                                                        GAsyncResult* _res_)
{
	ProtonPlusWidgetsToolsReleasesBoxSetSelectedToolForcedData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
proton_plus_widgets_tools_releases_box_set_selected_tool_forced_ready (GObject* source_object,
                                                                       GAsyncResult* _res_,
                                                                       gpointer _user_data_)
{
	ProtonPlusWidgetsToolsReleasesBoxSetSelectedToolForcedData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_widgets_tools_releases_box_set_selected_tool_forced_co (_data_);
}

static gboolean
proton_plus_widgets_tools_releases_box_set_selected_tool_forced_co (ProtonPlusWidgetsToolsReleasesBoxSetSelectedToolForcedData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->self->priv->tool_request_generation = _data_->self->priv->tool_request_generation + 1;
	_data_->_tmp0_ = _data_->self->priv->tool_request_generation;
	_data_->request_generation = _data_->_tmp0_;
	_data_->_tmp1_ = _g_object_ref0 (_data_->tool);
	_g_object_unref0 (_data_->self->priv->current_tool);
	_data_->self->priv->current_tool = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->self->priv->_content_stack;
	gtk_stack_set_visible_child_name (_data_->_tmp2_, "spinner");
	_data_->_tmp3_ = _data_->self->priv->load_more_button;
	gtk_widget_set_sensitive ((GtkWidget*) _data_->_tmp3_, TRUE);
	proton_plus_widgets_tools_releases_box_disconnect_job_state_handlers (_data_->self);
	_data_->_tmp4_ = _data_->self->priv->_list_box;
	gtk_list_box_remove_all (_data_->_tmp4_);
	_data_->_tmp5_ = _data_->self->priv->_title_label;
	_data_->_tmp6_ = proton_plus_models_tool_get_title (_data_->tool);
	_data_->_tmp7_ = _data_->_tmp6_;
	gtk_label_set_label (_data_->_tmp5_, _data_->_tmp7_);
	_data_->_tmp8_ = _data_->self->priv->_title_label;
	_data_->_tmp9_ = proton_plus_models_tool_get_description (_data_->tool);
	_data_->_tmp10_ = _data_->_tmp9_;
	gtk_widget_set_tooltip_text ((GtkWidget*) _data_->_tmp8_, _data_->_tmp10_);
	proton_plus_widgets_tools_releases_box_update_repository_button (_data_->self, _data_->tool);
	_data_->_tmp11_ = proton_plus_models_tool_get_release_catalog (_data_->tool);
	_data_->_tmp12_ = _data_->_tmp11_;
	_data_->_tmp13_ = _g_object_ref0 (_data_->_tmp12_);
	_data_->catalog = _data_->_tmp13_;
	_data_->_tmp14_ = _data_->catalog;
	if (_data_->_tmp14_ == NULL) {
		_data_->_tmp15_ = _data_->self->priv->_content_stack;
		gtk_stack_set_visible_child_name (_data_->_tmp15_, "empty");
		_g_object_unref0 (_data_->catalog);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp16_ = _data_->catalog;
	_data_->_state_ = 1;
	proton_plus_models_release_catalog_refresh (_data_->_tmp16_, proton_plus_widgets_tools_releases_box_set_selected_tool_forced_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp17_ = proton_plus_models_release_catalog_refresh_finish (_data_->_tmp16_, _data_->_res_);
	_data_->_result_ = _data_->_tmp17_;
	if (!proton_plus_widgets_tools_releases_box_is_current_tool_request (_data_->self, _data_->tool, _data_->request_generation)) {
		_g_object_unref0 (_data_->_result_);
		_g_object_unref0 (_data_->catalog);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp18_ = _data_->_result_;
	_data_->_tmp19_ = proton_plus_models_release_catalog_result_get_succeeded (_data_->_tmp18_);
	_data_->_tmp20_ = _data_->_tmp19_;
	if (!_data_->_tmp20_) {
		_data_->_tmp21_ = _data_->_result_;
		_data_->_tmp22_ = proton_plus_models_release_catalog_result_get_code (_data_->_tmp21_);
		_data_->_tmp23_ = _data_->_tmp22_;
		_data_->_tmp24_ = proton_plus_get_return_code_message (_data_->_tmp23_);
		_data_->_tmp25_ = _data_->_tmp24_;
		_data_->_tmp26_ = proton_plus_widgets_main_error_dialog_new (_ ("Failed to Fetch Releases"), _data_->_tmp25_, "");
		g_object_ref_sink (_data_->_tmp26_);
		_data_->_tmp27_ = (AdwAlertDialog*) _data_->_tmp26_;
		_g_free0 (_data_->_tmp25_);
		_data_->dialog = _data_->_tmp27_;
		_data_->_tmp28_ = _data_->self->priv->_content_stack;
		gtk_stack_set_visible_child_name (_data_->_tmp28_, "list");
		_data_->_tmp29_ = _data_->dialog;
		_data_->_tmp30_ = gtk_widget_get_root ((GtkWidget*) _data_->self);
		proton_plus_widgets_window_present_dialog_for_controller ((AdwDialog*) _data_->_tmp29_, (GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp30_, gtk_window_get_type (), GtkWindow));
		_g_object_unref0 (_data_->dialog);
		_g_object_unref0 (_data_->_result_);
		_g_object_unref0 (_data_->catalog);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp31_ = proton_plus_models_tool_get_group (_data_->tool);
	_data_->_tmp32_ = _data_->_tmp31_;
	proton_plus_models_group_refresh_installed_state (_data_->_tmp32_);
	_data_->_tmp33_ = _data_->_result_;
	_data_->_tmp34_ = proton_plus_models_release_catalog_result_get_releases (_data_->_tmp33_);
	_data_->_tmp35_ = _data_->_tmp34_;
	proton_plus_widgets_tools_releases_box_add_release_rows (_data_->self, _data_->tool, _data_->_tmp35_);
	_data_->_tmp36_ = _data_->self->priv->_list_box;
	_data_->_tmp37_ = _data_->self->priv->load_more_row;
	gtk_list_box_append (_data_->_tmp36_, (GtkWidget*) _data_->_tmp37_);
	_data_->_tmp39_ = _data_->catalog;
	_data_->_tmp40_ = proton_plus_models_release_catalog_get_has_more (_data_->_tmp39_);
	_data_->_tmp41_ = _data_->_tmp40_;
	if (_data_->_tmp41_) {
		_data_->_tmp38_ = proton_plus_widgets_tools_releases_box_can_show_provider_release_rows (_data_->self);
	} else {
		_data_->_tmp38_ = FALSE;
	}
	_data_->_tmp42_ = _data_->self->priv->load_more_row;
	gtk_widget_set_visible ((GtkWidget*) _data_->_tmp42_, _data_->_tmp38_);
	_data_->_tmp43_ = _data_->self->priv->_content_stack;
	gtk_stack_set_visible_child_name (_data_->_tmp43_, "list");
	proton_plus_widgets_tools_releases_box_apply_selected_variant_to_rows (_data_->self);
	proton_plus_widgets_tools_releases_box_update_last_updated_label (_data_->self);
	proton_plus_widgets_tools_releases_box_update_visibility (_data_->self);
	_g_object_unref0 (_data_->_result_);
	_g_object_unref0 (_data_->catalog);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
proton_plus_widgets_tools_releases_box_update_variant_row (ProtonPlusWidgetsToolsReleasesBox* self,
                                                           ProtonPlusModelsTool* tool)
{
	GeeLinkedList* _tmp0_;
	GtkDropDown* _tmp1_;
	GtkBox* _tmp2_;
	ProtonPlusModelsToolsProviderTool* provider_tool = NULL;
	ProtonPlusModelsToolsProviderTool* _tmp3_;
	ProtonPlusModelsToolsProviderTool* _tmp4_;
	ProtonPlusModelsToolsProviderTool* _tmp6_;
	GeeLinkedList* _tmp7_;
	GeeLinkedList* _tmp8_;
	ProtonPlusModelsCpuCapabilities* _tmp9_;
	GeeLinkedList* _tmp10_;
	GeeLinkedList* _tmp11_;
	gint _tmp12_;
	gint _tmp13_;
	AdwStatusPage* _tmp15_;
	GeeLinkedList* _tmp16_;
	ProtonPlusModelsCpuCapabilities* _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	ProtonPlusModelsVariant* _tmp20_;
	GeeLinkedList* _tmp21_;
	GtkStringList* model = NULL;
	GtkStringList* _tmp22_;
	gint selected_index = 0;
	gint index = 0;
	GtkDropDown* _tmp38_;
	GtkStringList* _tmp39_;
	GtkDropDown* _tmp40_;
	GtkDropDown* _tmp41_;
	GtkBox* _tmp42_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (tool != NULL);
	_g_object_unref0 (self->priv->selected_variant);
	self->priv->selected_variant = NULL;
	_tmp0_ = self->priv->displayed_variants;
	gee_abstract_collection_clear ((GeeAbstractCollection*) _tmp0_);
	self->priv->has_variants = FALSE;
	self->priv->provider_has_compatible_variants = TRUE;
	_tmp1_ = self->priv->_variant_dropdown;
	gtk_widget_set_visible ((GtkWidget*) _tmp1_, FALSE);
	_tmp2_ = self->priv->_variant_box;
	gtk_widget_set_visible ((GtkWidget*) _tmp2_, FALSE);
	_tmp3_ = _g_object_ref0 (PROTON_PLUS_MODELS_TOOLS_IS_PROVIDER_TOOL (tool) ? ((ProtonPlusModelsToolsProviderTool*) tool) : NULL);
	provider_tool = _tmp3_;
	_tmp4_ = provider_tool;
	if (_tmp4_ == NULL) {
		AdwStatusPage* _tmp5_;
		_tmp5_ = self->priv->_status_page;
		adw_status_page_set_description (_tmp5_, _ ("No releases match the current filter."));
		_g_object_unref0 (provider_tool);
		return;
	}
	_tmp6_ = provider_tool;
	_tmp7_ = proton_plus_models_tools_provider_tool_get_variants (_tmp6_);
	_tmp8_ = _tmp7_;
	_tmp9_ = proton_plus_globals_CPU_CAPABILITIES;
	_tmp10_ = proton_plus_models_variant_selector_compatible_variants ((GeeIterable*) _tmp8_, _tmp9_);
	_g_object_unref0 (self->priv->displayed_variants);
	self->priv->displayed_variants = _tmp10_;
	_tmp11_ = self->priv->displayed_variants;
	_tmp12_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp11_);
	_tmp13_ = _tmp12_;
	self->priv->provider_has_compatible_variants = _tmp13_ > 0;
	if (!self->priv->provider_has_compatible_variants) {
		AdwStatusPage* _tmp14_;
		_tmp14_ = self->priv->_status_page;
		adw_status_page_set_description (_tmp14_, _ ("No compatible variants are available for this system."));
		_g_object_unref0 (provider_tool);
		return;
	}
	_tmp15_ = self->priv->_status_page;
	adw_status_page_set_description (_tmp15_, _ ("No releases match the current filter."));
	_tmp16_ = self->priv->displayed_variants;
	_tmp17_ = proton_plus_globals_CPU_CAPABILITIES;
	_tmp18_ = proton_plus_widgets_tools_releases_box_get_saved_variant_name (self, tool);
	_tmp19_ = _tmp18_;
	_tmp20_ = proton_plus_models_variant_selector_select_variant ((GeeIterable*) _tmp16_, _tmp17_, _tmp19_);
	_g_object_unref0 (self->priv->selected_variant);
	self->priv->selected_variant = _tmp20_;
	_g_free0 (_tmp19_);
	_tmp21_ = self->priv->displayed_variants;
	if (!proton_plus_models_variant_selector_should_show_dropdown ((GeeCollection*) _tmp21_)) {
		_g_object_unref0 (provider_tool);
		return;
	}
	_tmp22_ = gtk_string_list_new (NULL);
	model = _tmp22_;
	selected_index = 0;
	index = 0;
	{
		GeeLinkedList* _variant_list = NULL;
		GeeLinkedList* _tmp23_;
		gint _variant_size = 0;
		GeeLinkedList* _tmp24_;
		gint _tmp25_;
		gint _tmp26_;
		gint _variant_index = 0;
		_tmp23_ = self->priv->displayed_variants;
		_variant_list = _tmp23_;
		_tmp24_ = _variant_list;
		_tmp25_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp24_);
		_tmp26_ = _tmp25_;
		_variant_size = _tmp26_;
		_variant_index = -1;
		while (TRUE) {
			gint _tmp27_;
			gint _tmp28_;
			ProtonPlusModelsVariant* variant = NULL;
			GeeLinkedList* _tmp29_;
			gpointer _tmp30_;
			GtkStringList* _tmp31_;
			ProtonPlusModelsVariant* _tmp32_;
			const gchar* _tmp33_;
			const gchar* _tmp34_;
			ProtonPlusModelsVariant* _tmp35_;
			ProtonPlusModelsVariant* _tmp36_;
			gint _tmp37_;
			_variant_index = _variant_index + 1;
			_tmp27_ = _variant_index;
			_tmp28_ = _variant_size;
			if (!(_tmp27_ < _tmp28_)) {
				break;
			}
			_tmp29_ = _variant_list;
			_tmp30_ = gee_abstract_list_get ((GeeAbstractList*) _tmp29_, _variant_index);
			variant = (ProtonPlusModelsVariant*) _tmp30_;
			_tmp31_ = model;
			_tmp32_ = variant;
			_tmp33_ = proton_plus_models_variant_get_name (_tmp32_);
			_tmp34_ = _tmp33_;
			gtk_string_list_append (_tmp31_, _tmp34_);
			_tmp35_ = variant;
			_tmp36_ = self->priv->selected_variant;
			if (_tmp35_ == _tmp36_) {
				selected_index = index;
			}
			_tmp37_ = index;
			index = _tmp37_ + 1;
			_g_object_unref0 (variant);
		}
	}
	self->priv->updating_variant_dropdown = TRUE;
	_tmp38_ = self->priv->_variant_dropdown;
	_tmp39_ = model;
	gtk_drop_down_set_model (_tmp38_, (GListModel*) _tmp39_);
	_tmp40_ = self->priv->_variant_dropdown;
	gtk_drop_down_set_selected (_tmp40_, (guint) selected_index);
	self->priv->updating_variant_dropdown = FALSE;
	proton_plus_widgets_tools_releases_box_update_variant_list_item_checkmark (self);
	_tmp41_ = self->priv->_variant_dropdown;
	gtk_widget_set_visible ((GtkWidget*) _tmp41_, TRUE);
	self->priv->has_variants = TRUE;
	_tmp42_ = self->priv->_variant_box;
	gtk_widget_set_visible ((GtkWidget*) _tmp42_, self->priv->header_controls_visible);
	_g_object_unref0 (model);
	_g_object_unref0 (provider_tool);
}

void
proton_plus_widgets_tools_releases_box_set_header_controls_visible (ProtonPlusWidgetsToolsReleasesBox* self,
                                                                    gboolean visible)
{
	gboolean _tmp0_ = FALSE;
	GtkBox* _tmp1_;
	gboolean _tmp2_ = FALSE;
	GtkLabel* _tmp5_;
	GtkButton* _tmp6_;
	gboolean _tmp7_ = FALSE;
	gboolean _tmp8_ = FALSE;
	GtkButton* _tmp13_;
	g_return_if_fail (self != NULL);
	self->priv->header_controls_visible = visible;
	if (visible) {
		_tmp0_ = self->priv->has_variants;
	} else {
		_tmp0_ = FALSE;
	}
	_tmp1_ = self->priv->_variant_box;
	gtk_widget_set_visible ((GtkWidget*) _tmp1_, _tmp0_);
	if (visible) {
		GtkLabel* _tmp3_;
		const gchar* _tmp4_;
		_tmp3_ = self->priv->_last_updated_label;
		_tmp4_ = gtk_label_get_label (_tmp3_);
		_tmp2_ = g_strcmp0 (_tmp4_, "") != 0;
	} else {
		_tmp2_ = FALSE;
	}
	_tmp5_ = self->priv->_last_updated_label;
	gtk_widget_set_visible ((GtkWidget*) _tmp5_, _tmp2_);
	_tmp6_ = self->priv->_refresh_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp6_, visible);
	if (visible) {
		ProtonPlusModelsTool* _tmp9_;
		_tmp9_ = self->priv->current_tool;
		_tmp8_ = _tmp9_ != NULL;
	} else {
		_tmp8_ = FALSE;
	}
	if (_tmp8_) {
		ProtonPlusModelsTool* _tmp10_;
		const gchar* _tmp11_;
		const gchar* _tmp12_;
		_tmp10_ = self->priv->current_tool;
		_tmp11_ = proton_plus_models_tool_get_repository_url (_tmp10_);
		_tmp12_ = _tmp11_;
		_tmp7_ = g_strcmp0 (_tmp12_, "") != 0;
	} else {
		_tmp7_ = FALSE;
	}
	_tmp13_ = self->priv->_repository_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp13_, _tmp7_);
}

static void
proton_plus_widgets_tools_releases_box_update_repository_button (ProtonPlusWidgetsToolsReleasesBox* self,
                                                                 ProtonPlusModelsTool* tool)
{
	GtkButton* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gboolean _tmp3_ = FALSE;
	GtkButton* _tmp6_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (tool != NULL);
	_tmp0_ = self->priv->_repository_button;
	_tmp1_ = proton_plus_models_tool_get_repository_url (tool);
	_tmp2_ = _tmp1_;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp0_, _tmp2_);
	if (self->priv->header_controls_visible) {
		const gchar* _tmp4_;
		const gchar* _tmp5_;
		_tmp4_ = proton_plus_models_tool_get_repository_url (tool);
		_tmp5_ = _tmp4_;
		_tmp3_ = g_strcmp0 (_tmp5_, "") != 0;
	} else {
		_tmp3_ = FALSE;
	}
	_tmp6_ = self->priv->_repository_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp6_, _tmp3_);
}

static void
proton_plus_widgets_tools_releases_box_on_variant_selected (ProtonPlusWidgetsToolsReleasesBox* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gint selected_index = 0;
	GtkDropDown* _tmp6_;
	guint _tmp7_;
	guint _tmp8_;
	ProtonPlusModelsVariant* variant = NULL;
	GeeLinkedList* _tmp9_;
	ProtonPlusModelsVariant* _tmp10_;
	ProtonPlusModelsVariant* _tmp11_;
	ProtonPlusModelsVariant* _tmp12_;
	ProtonPlusModelsVariant* _tmp13_;
	ProtonPlusModelsVariant* _tmp14_;
	ProtonPlusModelsVariant* _tmp15_;
	ProtonPlusModelsTool* _tmp16_;
	ProtonPlusModelsVariant* _tmp17_;
	const gchar* _tmp18_;
	const gchar* _tmp19_;
	g_return_if_fail (self != NULL);
	if (self->priv->updating_variant_dropdown) {
		_tmp1_ = TRUE;
	} else {
		ProtonPlusModelsTool* _tmp2_;
		_tmp2_ = self->priv->current_tool;
		_tmp1_ = _tmp2_ == NULL;
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		GeeLinkedList* _tmp3_;
		gint _tmp4_;
		gint _tmp5_;
		_tmp3_ = self->priv->displayed_variants;
		_tmp4_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp3_);
		_tmp5_ = _tmp4_;
		_tmp0_ = _tmp5_ <= 1;
	}
	if (_tmp0_) {
		return;
	}
	_tmp6_ = self->priv->_variant_dropdown;
	_tmp7_ = gtk_drop_down_get_selected (_tmp6_);
	_tmp8_ = _tmp7_;
	selected_index = (gint) _tmp8_;
	_tmp9_ = self->priv->displayed_variants;
	_tmp10_ = proton_plus_models_variant_selector_variant_at_display_index ((GeeList*) _tmp9_, selected_index);
	variant = _tmp10_;
	_tmp11_ = variant;
	if (_tmp11_ == NULL) {
		_g_object_unref0 (variant);
		return;
	}
	proton_plus_widgets_tools_releases_box_update_variant_list_item_checkmark (self);
	_tmp12_ = self->priv->selected_variant;
	_tmp13_ = variant;
	if (_tmp12_ == _tmp13_) {
		_g_object_unref0 (variant);
		return;
	}
	_tmp14_ = variant;
	_tmp15_ = _g_object_ref0 (_tmp14_);
	_g_object_unref0 (self->priv->selected_variant);
	self->priv->selected_variant = _tmp15_;
	_tmp16_ = self->priv->current_tool;
	_tmp17_ = variant;
	_tmp18_ = proton_plus_models_variant_get_name (_tmp17_);
	_tmp19_ = _tmp18_;
	proton_plus_widgets_tools_releases_box_save_selected_variant_name (self, _tmp16_, _tmp19_);
	proton_plus_widgets_tools_releases_box_apply_selected_variant_to_rows (self);
	_g_object_unref0 (variant);
}

static ProtonPlusModelsVariant*
proton_plus_widgets_tools_releases_box_resolve_release_variant (ProtonPlusWidgetsToolsReleasesBox* self,
                                                                ProtonPlusModelsRelease* release,
                                                                ProtonPlusServicesInstallJobMode mode)
{
	ProtonPlusModelsVariant* _tmp0_;
	ProtonPlusModelsCpuCapabilities* _tmp1_;
	ProtonPlusModelsVariant* _tmp2_;
	ProtonPlusModelsVariant* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (release != NULL, NULL);
	_tmp0_ = self->priv->selected_variant;
	_tmp1_ = proton_plus_globals_CPU_CAPABILITIES;
	_tmp2_ = proton_plus_models_variant_selector_resolve_release_variant (release, _tmp0_, _tmp1_, mode == PROTON_PLUS_SERVICES_INSTALL_JOB_MODE_LATEST);
	result = _tmp2_;
	return result;
}

static gboolean
proton_plus_widgets_tools_releases_box_apply_selected_variant_to_job (ProtonPlusWidgetsToolsReleasesBox* self,
                                                                      ProtonPlusServicesInstallJob* job)
{
	ProtonPlusModelsTool* _tmp0_;
	ProtonPlusModelsTool* _tmp1_;
	ProtonPlusModelsVariant* variant = NULL;
	ProtonPlusModelsRelease* _tmp2_;
	ProtonPlusModelsRelease* _tmp3_;
	ProtonPlusServicesInstallJobMode _tmp4_;
	ProtonPlusServicesInstallJobMode _tmp5_;
	ProtonPlusModelsVariant* _tmp6_;
	gboolean _tmp7_ = FALSE;
	gboolean _tmp8_ = FALSE;
	ProtonPlusModelsVariant* _tmp9_;
	ProtonPlusModelsVariant* _tmp16_;
	const gchar* _tmp17_;
	const gchar* _tmp18_;
	ProtonPlusModelsVariant* _tmp19_;
	ProtonPlusModelsAssetsAsset* _tmp20_;
	ProtonPlusModelsAssetsAsset* _tmp21_;
	ProtonPlusModelsVariant* _tmp22_;
	const gchar* _tmp23_;
	const gchar* _tmp24_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (job != NULL, FALSE);
	_tmp0_ = proton_plus_services_install_job_get_tool (job);
	_tmp1_ = _tmp0_;
	if (!PROTON_PLUS_MODELS_TOOLS_IS_PROVIDER_TOOL (_tmp1_)) {
		result = TRUE;
		return result;
	}
	_tmp2_ = proton_plus_services_install_job_get_release (job);
	_tmp3_ = _tmp2_;
	_tmp4_ = proton_plus_services_install_job_get_mode (job);
	_tmp5_ = _tmp4_;
	_tmp6_ = proton_plus_widgets_tools_releases_box_resolve_release_variant (self, _tmp3_, _tmp5_);
	variant = _tmp6_;
	_tmp9_ = variant;
	if (_tmp9_ == NULL) {
		_tmp8_ = TRUE;
	} else {
		ProtonPlusModelsVariant* _tmp10_;
		const gchar* _tmp11_;
		const gchar* _tmp12_;
		_tmp10_ = variant;
		_tmp11_ = proton_plus_models_variant_get_download_url (_tmp10_);
		_tmp12_ = _tmp11_;
		_tmp8_ = _tmp12_ == NULL;
	}
	if (_tmp8_) {
		_tmp7_ = TRUE;
	} else {
		ProtonPlusModelsVariant* _tmp13_;
		const gchar* _tmp14_;
		const gchar* _tmp15_;
		_tmp13_ = variant;
		_tmp14_ = proton_plus_models_variant_get_download_url (_tmp13_);
		_tmp15_ = _tmp14_;
		_tmp7_ = g_strcmp0 (_tmp15_, "") == 0;
	}
	if (_tmp7_) {
		result = FALSE;
		_g_object_unref0 (variant);
		return result;
	}
	_tmp16_ = variant;
	_tmp17_ = proton_plus_models_variant_get_name (_tmp16_);
	_tmp18_ = _tmp17_;
	_tmp19_ = variant;
	_tmp20_ = proton_plus_models_variant_resolved_asset (_tmp19_);
	_tmp21_ = _tmp20_;
	_tmp22_ = variant;
	_tmp23_ = proton_plus_models_variant_get_id (_tmp22_);
	_tmp24_ = _tmp23_;
	proton_plus_services_install_job_set_selected_variant (job, _tmp18_, _tmp21_, _tmp24_);
	_g_object_unref0 (_tmp21_);
	result = TRUE;
	_g_object_unref0 (variant);
	return result;
}

static void
proton_plus_widgets_tools_releases_box_apply_selected_variant_to_rows (ProtonPlusWidgetsToolsReleasesBox* self)
{
	GtkWidget* child = NULL;
	GtkListBox* _tmp0_;
	GtkWidget* _tmp1_;
	GtkWidget* _tmp2_;
	GtkListBox* _tmp12_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_list_box;
	_tmp1_ = gtk_widget_get_first_child ((GtkWidget*) _tmp0_);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	child = _tmp2_;
	while (TRUE) {
		GtkWidget* _tmp3_;
		ProtonPlusServicesInstallJob* job = NULL;
		GtkWidget* _tmp4_;
		gconstpointer _tmp5_;
		ProtonPlusServicesInstallJob* _tmp6_;
		ProtonPlusServicesInstallJob* _tmp7_;
		GtkWidget* _tmp9_;
		GtkWidget* _tmp10_;
		GtkWidget* _tmp11_;
		_tmp3_ = child;
		if (!(_tmp3_ != NULL)) {
			break;
		}
		_tmp4_ = child;
		_tmp5_ = g_object_get_data ((GObject*) _tmp4_, "job");
		_tmp6_ = _g_object_ref0 ((ProtonPlusServicesInstallJob*) _tmp5_);
		job = _tmp6_;
		_tmp7_ = job;
		if (_tmp7_ != NULL) {
			ProtonPlusServicesInstallJob* _tmp8_;
			_tmp8_ = job;
			proton_plus_widgets_tools_releases_box_apply_selected_variant_to_job (self, _tmp8_);
		}
		_tmp9_ = child;
		_tmp10_ = gtk_widget_get_next_sibling (_tmp9_);
		_tmp11_ = _g_object_ref0 (_tmp10_);
		_g_object_unref0 (child);
		child = _tmp11_;
		_g_object_unref0 (job);
	}
	_tmp12_ = self->priv->_list_box;
	gtk_list_box_invalidate_filter (_tmp12_);
	proton_plus_widgets_tools_releases_box_update_visibility (self);
	_g_object_unref0 (child);
}

static void
proton_plus_widgets_tools_releases_box_update_last_updated_label (ProtonPlusWidgetsToolsReleasesBox* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	ProtonPlusModelsTool* _tmp2_;
	GDateTime* date = NULL;
	ProtonPlusModelsTool* _tmp13_;
	ProtonPlusModelsReleaseCatalog* _tmp14_;
	ProtonPlusModelsReleaseCatalog* _tmp15_;
	const gchar* _tmp16_;
	const gchar* _tmp17_;
	GDateTime* _tmp18_;
	GDateTime* _tmp19_;
	gboolean _tmp27_ = FALSE;
	GtkLabel* _tmp30_;
	g_return_if_fail (self != NULL);
	_tmp2_ = self->priv->current_tool;
	if (_tmp2_ == NULL) {
		_tmp1_ = TRUE;
	} else {
		ProtonPlusModelsTool* _tmp3_;
		ProtonPlusModelsReleaseCatalog* _tmp4_;
		ProtonPlusModelsReleaseCatalog* _tmp5_;
		_tmp3_ = self->priv->current_tool;
		_tmp4_ = proton_plus_models_tool_get_release_catalog (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp1_ = _tmp5_ == NULL;
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		ProtonPlusModelsTool* _tmp6_;
		ProtonPlusModelsReleaseCatalog* _tmp7_;
		ProtonPlusModelsReleaseCatalog* _tmp8_;
		const gchar* _tmp9_;
		const gchar* _tmp10_;
		_tmp6_ = self->priv->current_tool;
		_tmp7_ = proton_plus_models_tool_get_release_catalog (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = proton_plus_models_release_catalog_get_last_updated (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp0_ = g_strcmp0 (_tmp10_, "") == 0;
	}
	if (_tmp0_) {
		GtkLabel* _tmp11_;
		GtkLabel* _tmp12_;
		_tmp11_ = self->priv->_last_updated_label;
		gtk_label_set_label (_tmp11_, "");
		_tmp12_ = self->priv->_last_updated_label;
		gtk_widget_set_visible ((GtkWidget*) _tmp12_, FALSE);
		return;
	}
	_tmp13_ = self->priv->current_tool;
	_tmp14_ = proton_plus_models_tool_get_release_catalog (_tmp13_);
	_tmp15_ = _tmp14_;
	_tmp16_ = proton_plus_models_release_catalog_get_last_updated (_tmp15_);
	_tmp17_ = _tmp16_;
	_tmp18_ = g_date_time_new_from_iso8601 (_tmp17_, NULL);
	date = _tmp18_;
	_tmp19_ = date;
	if (_tmp19_ != NULL) {
		GtkLabel* _tmp20_;
		GDateTime* _tmp21_;
		gchar* _tmp22_;
		gchar* _tmp23_;
		gchar* _tmp24_;
		gchar* _tmp25_;
		_tmp20_ = self->priv->_last_updated_label;
		_tmp21_ = date;
		_tmp22_ = g_date_time_format (_tmp21_, "%Y-%m-%d %H:%M");
		_tmp23_ = _tmp22_;
		_tmp24_ = g_strdup_printf (_ ("Last updated: %s"), _tmp23_);
		_tmp25_ = _tmp24_;
		gtk_label_set_label (_tmp20_, _tmp25_);
		_g_free0 (_tmp25_);
		_g_free0 (_tmp23_);
	} else {
		GtkLabel* _tmp26_;
		_tmp26_ = self->priv->_last_updated_label;
		gtk_label_set_label (_tmp26_, "");
	}
	if (self->priv->header_controls_visible) {
		GtkLabel* _tmp28_;
		const gchar* _tmp29_;
		_tmp28_ = self->priv->_last_updated_label;
		_tmp29_ = gtk_label_get_label (_tmp28_);
		_tmp27_ = g_strcmp0 (_tmp29_, "") != 0;
	} else {
		_tmp27_ = FALSE;
	}
	_tmp30_ = self->priv->_last_updated_label;
	gtk_widget_set_visible ((GtkWidget*) _tmp30_, _tmp27_);
	_g_date_time_unref0 (date);
}

void
proton_plus_widgets_tools_releases_box_refresh_usage_pills (ProtonPlusWidgetsToolsReleasesBox* self)
{
	GtkWidget* child = NULL;
	GtkListBox* _tmp0_;
	GtkWidget* _tmp1_;
	GtkWidget* _tmp2_;
	GtkListBox* _tmp9_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_list_box;
	_tmp1_ = gtk_widget_get_first_child ((GtkWidget*) _tmp0_);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	child = _tmp2_;
	while (TRUE) {
		GtkWidget* _tmp3_;
		GtkWidget* _tmp4_;
		GtkWidget* _tmp6_;
		GtkWidget* _tmp7_;
		GtkWidget* _tmp8_;
		_tmp3_ = child;
		if (!(_tmp3_ != NULL)) {
			break;
		}
		_tmp4_ = child;
		if (PROTON_PLUS_WIDGETS_TOOLS_IS_RELEASE_ROW (_tmp4_)) {
			GtkWidget* _tmp5_;
			_tmp5_ = child;
			proton_plus_widgets_tools_release_row_refresh_usage_pill (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, PROTON_PLUS_WIDGETS_TOOLS_TYPE_RELEASE_ROW, ProtonPlusWidgetsToolsReleaseRow));
		}
		_tmp6_ = child;
		_tmp7_ = gtk_widget_get_next_sibling (_tmp6_);
		_tmp8_ = _g_object_ref0 (_tmp7_);
		_g_object_unref0 (child);
		child = _tmp8_;
	}
	_tmp9_ = self->priv->_list_box;
	gtk_list_box_invalidate_filter (_tmp9_);
	proton_plus_widgets_tools_releases_box_update_visibility (self);
	_g_object_unref0 (child);
}

static void
proton_plus_widgets_tools_releases_box_focus_job_data_free (gpointer _data)
{
	ProtonPlusWidgetsToolsReleasesBoxFocusJobData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->target);
	_g_object_unref0 (_data_->self);
	g_slice_free (ProtonPlusWidgetsToolsReleasesBoxFocusJobData, _data_);
}

void
proton_plus_widgets_tools_releases_box_focus_job (ProtonPlusWidgetsToolsReleasesBox* self,
                                                  ProtonPlusServicesInstallJob* target,
                                                  GAsyncReadyCallback _callback_,
                                                  gpointer _user_data_)
{
	ProtonPlusWidgetsToolsReleasesBoxFocusJobData* _data_;
	ProtonPlusWidgetsToolsReleasesBox* _tmp0_;
	ProtonPlusServicesInstallJob* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (target != NULL);
	_data_ = g_slice_new0 (ProtonPlusWidgetsToolsReleasesBoxFocusJobData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_widgets_tools_releases_box_focus_job_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (target);
	_g_object_unref0 (_data_->target);
	_data_->target = _tmp1_;
	proton_plus_widgets_tools_releases_box_focus_job_co (_data_);
}

void
proton_plus_widgets_tools_releases_box_focus_job_finish (ProtonPlusWidgetsToolsReleasesBox* self,
                                                         GAsyncResult* _res_)
{
	ProtonPlusWidgetsToolsReleasesBoxFocusJobData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static Block19Data*
block19_data_ref (Block19Data* _data19_)
{
	g_atomic_int_inc (&_data19_->_ref_count_);
	return _data19_;
}

static void
block19_data_unref (void * _userdata_)
{
	Block19Data* _data19_;
	_data19_ = (Block19Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data19_->_ref_count_)) {
		ProtonPlusWidgetsToolsReleasesBox* self;
		self = _data19_->self;
		_g_object_unref0 (_data19_->row);
		_g_object_unref0 (self);
		g_slice_free (Block19Data, _data19_);
	}
}

static void
proton_plus_widgets_tools_releases_box_focus_job_ready (GObject* source_object,
                                                        GAsyncResult* _res_,
                                                        gpointer _user_data_)
{
	ProtonPlusWidgetsToolsReleasesBoxFocusJobData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_widgets_tools_releases_box_focus_job_co (_data_);
}

static gboolean
__lambda62_ (Block19Data* _data19_)
{
	ProtonPlusWidgetsToolsReleasesBox* self;
	graphene_rect_t bounds = {0};
	ProtonPlusWidgetsToolsReleaseRow* _tmp0_;
	GtkListBox* _tmp1_;
	graphene_rect_t _tmp2_ = {0};
	gboolean _tmp3_;
	gboolean result;
	self = _data19_->self;
	_tmp0_ = _data19_->row;
	_tmp1_ = self->priv->_list_box;
	_tmp3_ = gtk_widget_compute_bounds ((GtkWidget*) _tmp0_, (GtkWidget*) _tmp1_, &_tmp2_);
	bounds = _tmp2_;
	if (_tmp3_) {
		GtkAdjustment* adjustment = NULL;
		GtkScrolledWindow* _tmp4_;
		GtkAdjustment* _tmp5_;
		GtkAdjustment* _tmp6_;
		gdouble maximum = 0.0;
		GtkAdjustment* _tmp7_;
		gdouble _tmp8_;
		gdouble _tmp9_;
		GtkAdjustment* _tmp10_;
		gdouble _tmp11_;
		gdouble _tmp12_;
		GtkAdjustment* _tmp13_;
		gdouble _tmp14_;
		gdouble _tmp15_;
		gdouble target_value = 0.0;
		graphene_rect_t _tmp19_;
		graphene_point_t _tmp20_;
		GtkAdjustment* _tmp21_;
		gdouble _tmp22_;
		gdouble _tmp23_;
		graphene_rect_t _tmp24_;
		graphene_size_t _tmp25_;
		GtkAdjustment* _tmp26_;
		gdouble _tmp27_;
		gdouble _tmp28_;
		GtkAdjustment* _tmp32_;
		_tmp4_ = self->priv->_scrolled;
		_tmp5_ = gtk_scrolled_window_get_vadjustment (_tmp4_);
		_tmp6_ = _g_object_ref0 (_tmp5_);
		adjustment = _tmp6_;
		_tmp7_ = adjustment;
		_tmp8_ = gtk_adjustment_get_upper (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp10_ = adjustment;
		_tmp11_ = gtk_adjustment_get_page_size (_tmp10_);
		_tmp12_ = _tmp11_;
		maximum = _tmp9_ - _tmp12_;
		_tmp13_ = adjustment;
		_tmp14_ = gtk_adjustment_get_lower (_tmp13_);
		_tmp15_ = _tmp14_;
		if (maximum < _tmp15_) {
			GtkAdjustment* _tmp16_;
			gdouble _tmp17_;
			gdouble _tmp18_;
			_tmp16_ = adjustment;
			_tmp17_ = gtk_adjustment_get_lower (_tmp16_);
			_tmp18_ = _tmp17_;
			maximum = _tmp18_;
		}
		_tmp19_ = bounds;
		_tmp20_ = _tmp19_.origin;
		_tmp21_ = adjustment;
		_tmp22_ = gtk_adjustment_get_page_size (_tmp21_);
		_tmp23_ = _tmp22_;
		_tmp24_ = bounds;
		_tmp25_ = _tmp24_.size;
		target_value = _tmp20_.y - ((_tmp23_ - _tmp25_.height) / 2.0);
		_tmp26_ = adjustment;
		_tmp27_ = gtk_adjustment_get_lower (_tmp26_);
		_tmp28_ = _tmp27_;
		if (target_value < _tmp28_) {
			GtkAdjustment* _tmp29_;
			gdouble _tmp30_;
			gdouble _tmp31_;
			_tmp29_ = adjustment;
			_tmp30_ = gtk_adjustment_get_lower (_tmp29_);
			_tmp31_ = _tmp30_;
			target_value = _tmp31_;
		}
		if (target_value > maximum) {
			target_value = maximum;
		}
		_tmp32_ = adjustment;
		gtk_adjustment_set_value (_tmp32_, target_value);
		_g_object_unref0 (adjustment);
	}
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda62__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda62_ (self);
	return result;
}

static gboolean
__lambda63_ (Block19Data* _data19_)
{
	ProtonPlusWidgetsToolsReleasesBox* self;
	ProtonPlusWidgetsToolsReleaseRow* _tmp0_;
	gboolean result;
	self = _data19_->self;
	_tmp0_ = _data19_->row;
	gtk_widget_remove_css_class ((GtkWidget*) _tmp0_, "download-highlight");
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda63__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda63_ (self);
	return result;
}

static gboolean
proton_plus_widgets_tools_releases_box_focus_job_co (ProtonPlusWidgetsToolsReleasesBoxFocusJobData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data19_ = g_slice_new0 (Block19Data);
	_data_->_data19_->_ref_count_ = 1;
	_data_->_data19_->self = g_object_ref (_data_->self);
	_data_->_data19_->_async_data_ = _data_;
	_data_->_tmp0_ = proton_plus_services_install_job_get_tool (_data_->target);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_state_ = 1;
	proton_plus_widgets_tools_releases_box_set_selected_tool (_data_->self, _data_->_tmp1_, proton_plus_widgets_tools_releases_box_focus_job_ready, _data_);
	return FALSE;
	_state_1:
	if (!proton_plus_widgets_tools_releases_box_set_selected_tool_finish (_data_->self, _data_->_res_)) {
		block19_data_unref (_data_->_data19_);
		_data_->_data19_ = NULL;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp2_ = proton_plus_widgets_tools_releases_box_find_job_row (_data_->self, _data_->target);
	_data_->_data19_->row = _data_->_tmp2_;
	_data_->_tmp3_ = _data_->_data19_->row;
	if (_data_->_tmp3_ == NULL) {
		block19_data_unref (_data_->_data19_);
		_data_->_data19_ = NULL;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp4_ = _data_->_data19_->row;
	gtk_widget_grab_focus ((GtkWidget*) _data_->_tmp4_);
	_data_->_tmp5_ = _data_->_data19_->row;
	gtk_widget_add_css_class ((GtkWidget*) _data_->_tmp5_, "download-highlight");
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda62__gsource_func, block19_data_ref (_data_->_data19_), block19_data_unref);
	g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 1200, ___lambda63__gsource_func, block19_data_ref (_data_->_data19_), block19_data_unref);
	block19_data_unref (_data_->_data19_);
	_data_->_data19_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static ProtonPlusWidgetsToolsReleaseRow*
proton_plus_widgets_tools_releases_box_find_job_row (ProtonPlusWidgetsToolsReleasesBox* self,
                                                     ProtonPlusServicesInstallJob* target)
{
	GtkWidget* child = NULL;
	GtkListBox* _tmp0_;
	GtkWidget* _tmp1_;
	GtkWidget* _tmp2_;
	ProtonPlusWidgetsToolsReleaseRow* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (target != NULL, NULL);
	_tmp0_ = self->priv->_list_box;
	_tmp1_ = gtk_widget_get_first_child ((GtkWidget*) _tmp0_);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	child = _tmp2_;
	while (TRUE) {
		GtkWidget* _tmp3_;
		ProtonPlusServicesInstallJob* job = NULL;
		GtkWidget* _tmp4_;
		gconstpointer _tmp5_;
		ProtonPlusServicesInstallJob* _tmp6_;
		gboolean _tmp7_ = FALSE;
		ProtonPlusServicesInstallJob* _tmp8_;
		GtkWidget* _tmp14_;
		GtkWidget* _tmp15_;
		GtkWidget* _tmp16_;
		_tmp3_ = child;
		if (!(_tmp3_ != NULL)) {
			break;
		}
		_tmp4_ = child;
		_tmp5_ = g_object_get_data ((GObject*) _tmp4_, "job");
		_tmp6_ = _g_object_ref0 ((ProtonPlusServicesInstallJob*) _tmp5_);
		job = _tmp6_;
		_tmp8_ = job;
		if (_tmp8_ != NULL) {
			gboolean _tmp9_ = FALSE;
			ProtonPlusServicesInstallJob* _tmp10_;
			_tmp10_ = job;
			if (_tmp10_ == target) {
				_tmp9_ = TRUE;
			} else {
				ProtonPlusServicesInstallJob* _tmp11_;
				_tmp11_ = job;
				_tmp9_ = proton_plus_widgets_tools_releases_box_jobs_have_same_identity (self, _tmp11_, target);
			}
			_tmp7_ = _tmp9_;
		} else {
			_tmp7_ = FALSE;
		}
		if (_tmp7_) {
			GtkWidget* _tmp12_;
			ProtonPlusWidgetsToolsReleaseRow* _tmp13_;
			_tmp12_ = child;
			_tmp13_ = _g_object_ref0 (PROTON_PLUS_WIDGETS_TOOLS_IS_RELEASE_ROW (_tmp12_) ? ((ProtonPlusWidgetsToolsReleaseRow*) _tmp12_) : NULL);
			result = _tmp13_;
			_g_object_unref0 (job);
			_g_object_unref0 (child);
			return result;
		}
		_tmp14_ = child;
		_tmp15_ = gtk_widget_get_next_sibling (_tmp14_);
		_tmp16_ = _g_object_ref0 (_tmp15_);
		_g_object_unref0 (child);
		child = _tmp16_;
		_g_object_unref0 (job);
	}
	result = NULL;
	_g_object_unref0 (child);
	return result;
}

static gboolean
proton_plus_widgets_tools_releases_box_jobs_have_same_identity (ProtonPlusWidgetsToolsReleasesBox* self,
                                                                ProtonPlusServicesInstallJob* left,
                                                                ProtonPlusServicesInstallJob* right)
{
	gboolean _tmp0_ = FALSE;
	ProtonPlusModelsTool* _tmp1_;
	ProtonPlusModelsTool* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	ProtonPlusModelsTool* _tmp5_;
	ProtonPlusModelsTool* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	gboolean _tmp13_ = FALSE;
	ProtonPlusModelsRelease* _tmp14_;
	ProtonPlusModelsRelease* _tmp15_;
	const gchar* _tmp16_;
	const gchar* _tmp17_;
	gboolean _tmp30_ = FALSE;
	gboolean _tmp31_ = FALSE;
	ProtonPlusModelsRelease* _tmp32_;
	ProtonPlusModelsRelease* _tmp33_;
	const gchar* _tmp34_;
	const gchar* _tmp35_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (left != NULL, FALSE);
	g_return_val_if_fail (right != NULL, FALSE);
	_tmp1_ = proton_plus_services_install_job_get_tool (left);
	_tmp2_ = _tmp1_;
	_tmp3_ = proton_plus_models_tool_get_id (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = proton_plus_services_install_job_get_tool (right);
	_tmp6_ = _tmp5_;
	_tmp7_ = proton_plus_models_tool_get_id (_tmp6_);
	_tmp8_ = _tmp7_;
	if (g_strcmp0 (_tmp4_, _tmp8_) != 0) {
		_tmp0_ = TRUE;
	} else {
		ProtonPlusServicesInstallJobMode _tmp9_;
		ProtonPlusServicesInstallJobMode _tmp10_;
		ProtonPlusServicesInstallJobMode _tmp11_;
		ProtonPlusServicesInstallJobMode _tmp12_;
		_tmp9_ = proton_plus_services_install_job_get_mode (left);
		_tmp10_ = _tmp9_;
		_tmp11_ = proton_plus_services_install_job_get_mode (right);
		_tmp12_ = _tmp11_;
		_tmp0_ = _tmp10_ != _tmp12_;
	}
	if (_tmp0_) {
		result = FALSE;
		return result;
	}
	_tmp14_ = proton_plus_services_install_job_get_release (left);
	_tmp15_ = _tmp14_;
	_tmp16_ = proton_plus_models_release_get_upstream_release_id (_tmp15_);
	_tmp17_ = _tmp16_;
	if (g_strcmp0 (_tmp17_, "") != 0) {
		ProtonPlusModelsRelease* _tmp18_;
		ProtonPlusModelsRelease* _tmp19_;
		const gchar* _tmp20_;
		const gchar* _tmp21_;
		_tmp18_ = proton_plus_services_install_job_get_release (right);
		_tmp19_ = _tmp18_;
		_tmp20_ = proton_plus_models_release_get_upstream_release_id (_tmp19_);
		_tmp21_ = _tmp20_;
		_tmp13_ = g_strcmp0 (_tmp21_, "") != 0;
	} else {
		_tmp13_ = FALSE;
	}
	if (_tmp13_) {
		ProtonPlusModelsRelease* _tmp22_;
		ProtonPlusModelsRelease* _tmp23_;
		const gchar* _tmp24_;
		const gchar* _tmp25_;
		ProtonPlusModelsRelease* _tmp26_;
		ProtonPlusModelsRelease* _tmp27_;
		const gchar* _tmp28_;
		const gchar* _tmp29_;
		_tmp22_ = proton_plus_services_install_job_get_release (left);
		_tmp23_ = _tmp22_;
		_tmp24_ = proton_plus_models_release_get_upstream_release_id (_tmp23_);
		_tmp25_ = _tmp24_;
		_tmp26_ = proton_plus_services_install_job_get_release (right);
		_tmp27_ = _tmp26_;
		_tmp28_ = proton_plus_models_release_get_upstream_release_id (_tmp27_);
		_tmp29_ = _tmp28_;
		result = g_strcmp0 (_tmp25_, _tmp29_) == 0;
		return result;
	}
	_tmp32_ = proton_plus_services_install_job_get_release (left);
	_tmp33_ = _tmp32_;
	_tmp34_ = proton_plus_models_release_get_source_tag (_tmp33_);
	_tmp35_ = _tmp34_;
	if (g_strcmp0 (_tmp35_, "") != 0) {
		ProtonPlusModelsRelease* _tmp36_;
		ProtonPlusModelsRelease* _tmp37_;
		const gchar* _tmp38_;
		const gchar* _tmp39_;
		_tmp36_ = proton_plus_services_install_job_get_release (right);
		_tmp37_ = _tmp36_;
		_tmp38_ = proton_plus_models_release_get_source_tag (_tmp37_);
		_tmp39_ = _tmp38_;
		_tmp31_ = g_strcmp0 (_tmp39_, "") != 0;
	} else {
		_tmp31_ = FALSE;
	}
	if (_tmp31_) {
		ProtonPlusModelsRelease* _tmp40_;
		ProtonPlusModelsRelease* _tmp41_;
		const gchar* _tmp42_;
		const gchar* _tmp43_;
		ProtonPlusModelsRelease* _tmp44_;
		ProtonPlusModelsRelease* _tmp45_;
		const gchar* _tmp46_;
		const gchar* _tmp47_;
		_tmp40_ = proton_plus_services_install_job_get_release (left);
		_tmp41_ = _tmp40_;
		_tmp42_ = proton_plus_models_release_get_source_tag (_tmp41_);
		_tmp43_ = _tmp42_;
		_tmp44_ = proton_plus_services_install_job_get_release (right);
		_tmp45_ = _tmp44_;
		_tmp46_ = proton_plus_models_release_get_source_tag (_tmp45_);
		_tmp47_ = _tmp46_;
		_tmp30_ = g_strcmp0 (_tmp43_, _tmp47_) == 0;
	} else {
		_tmp30_ = FALSE;
	}
	result = _tmp30_;
	return result;
}

static void
proton_plus_widgets_tools_releases_box_add_release_rows (ProtonPlusWidgetsToolsReleasesBox* self,
                                                         ProtonPlusModelsTool* tool,
                                                         GeeLinkedList* releases)
{
	gboolean _tmp0_ = FALSE;
	g_return_if_fail (self != NULL);
	g_return_if_fail (tool != NULL);
	g_return_if_fail (releases != NULL);
	if (PROTON_PLUS_MODELS_TOOLS_IS_PROVIDER_TOOL (tool)) {
		gint _tmp1_;
		gint _tmp2_;
		_tmp1_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) releases);
		_tmp2_ = _tmp1_;
		_tmp0_ = _tmp2_ > 0;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		gpointer _tmp3_;
		ProtonPlusModelsRelease* _tmp4_;
		_tmp3_ = gee_abstract_list_get ((GeeAbstractList*) releases, 0);
		_tmp4_ = (ProtonPlusModelsRelease*) _tmp3_;
		proton_plus_widgets_tools_releases_box_add_release_row (self, _tmp4_, PROTON_PLUS_SERVICES_INSTALL_JOB_MODE_LATEST);
		_g_object_unref0 (_tmp4_);
	}
	{
		GeeLinkedList* _release_list = NULL;
		gint _release_size = 0;
		GeeLinkedList* _tmp5_;
		gint _tmp6_;
		gint _tmp7_;
		gint _release_index = 0;
		_release_list = releases;
		_tmp5_ = _release_list;
		_tmp6_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp5_);
		_tmp7_ = _tmp6_;
		_release_size = _tmp7_;
		_release_index = -1;
		while (TRUE) {
			gint _tmp8_;
			gint _tmp9_;
			ProtonPlusModelsRelease* release = NULL;
			GeeLinkedList* _tmp10_;
			gpointer _tmp11_;
			ProtonPlusModelsRelease* _tmp12_;
			_release_index = _release_index + 1;
			_tmp8_ = _release_index;
			_tmp9_ = _release_size;
			if (!(_tmp8_ < _tmp9_)) {
				break;
			}
			_tmp10_ = _release_list;
			_tmp11_ = gee_abstract_list_get ((GeeAbstractList*) _tmp10_, _release_index);
			release = (ProtonPlusModelsRelease*) _tmp11_;
			_tmp12_ = release;
			proton_plus_widgets_tools_releases_box_add_release_row (self, _tmp12_, PROTON_PLUS_SERVICES_INSTALL_JOB_MODE_VERSIONED);
			_g_object_unref0 (release);
		}
	}
}

static Block20Data*
block20_data_ref (Block20Data* _data20_)
{
	g_atomic_int_inc (&_data20_->_ref_count_);
	return _data20_;
}

static void
block20_data_unref (void * _userdata_)
{
	Block20Data* _data20_;
	_data20_ = (Block20Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data20_->_ref_count_)) {
		ProtonPlusWidgetsToolsReleasesBox* self;
		self = _data20_->self;
		_g_object_unref0 (_data20_->job);
		_g_object_unref0 (self);
		g_slice_free (Block20Data, _data20_);
	}
}

static void
__lambda41_ (Block20Data* _data20_)
{
	ProtonPlusWidgetsToolsReleasesBox* self;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	ProtonPlusServicesInstallJob* _tmp2_;
	ProtonPlusServicesInstallJobState _tmp3_;
	ProtonPlusServicesInstallJobState _tmp4_;
	self = _data20_->self;
	_tmp2_ = _data20_->job;
	_tmp3_ = proton_plus_services_install_job_get_state (_tmp2_);
	_tmp4_ = _tmp3_;
	if (_tmp4_ != PROTON_PLUS_SERVICES_INSTALL_JOB_STATE_BUSY_INSTALLING) {
		ProtonPlusServicesInstallJob* _tmp5_;
		ProtonPlusServicesInstallJobState _tmp6_;
		ProtonPlusServicesInstallJobState _tmp7_;
		_tmp5_ = _data20_->job;
		_tmp6_ = proton_plus_services_install_job_get_state (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp1_ = _tmp7_ != PROTON_PLUS_SERVICES_INSTALL_JOB_STATE_BUSY_REMOVING;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		ProtonPlusServicesInstallJob* _tmp8_;
		ProtonPlusServicesInstallJobState _tmp9_;
		ProtonPlusServicesInstallJobState _tmp10_;
		_tmp8_ = _data20_->job;
		_tmp9_ = proton_plus_services_install_job_get_state (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp0_ = _tmp10_ != PROTON_PLUS_SERVICES_INSTALL_JOB_STATE_BUSY_UPDATING;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GtkListBox* _tmp11_;
		_tmp11_ = self->priv->_list_box;
		gtk_list_box_invalidate_filter (_tmp11_);
		proton_plus_widgets_tools_releases_box_update_visibility (self);
	}
}

static void
___lambda41__g_object_notify (GObject* _sender,
                              GParamSpec* pspec,
                              gpointer self)
{
	__lambda41_ (self);
}

static void
__lambda60_ (ProtonPlusWidgetsToolsReleasesBox* self,
             ProtonPlusServicesInstallJob* selected_job)
{
	g_return_if_fail (selected_job != NULL);
	g_signal_emit (self, proton_plus_widgets_tools_releases_box_signals[PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_JOB_SELECTED_SIGNAL], 0, selected_job);
}

static void
___lambda60__proton_plus_widgets_tools_release_row_job_selected (ProtonPlusWidgetsToolsReleaseRow* _sender,
                                                                 ProtonPlusServicesInstallJob* job,
                                                                 gpointer self)
{
	__lambda60_ ((ProtonPlusWidgetsToolsReleasesBox*) self, job);
}

static void
proton_plus_widgets_tools_releases_box_add_release_row (ProtonPlusWidgetsToolsReleasesBox* self,
                                                        ProtonPlusModelsRelease* release,
                                                        ProtonPlusServicesInstallJobMode mode)
{
	Block20Data* _data20_;
	ProtonPlusModelsTool* _tmp0_;
	ProtonPlusModelsTool* _tmp1_;
	ProtonPlusServicesInstallJob* _tmp2_;
	ProtonPlusServicesInstallJob* _tmp3_;
	ProtonPlusServicesInstallJob* active_job = NULL;
	ProtonPlusUtilsDownloadManager* _tmp4_;
	ProtonPlusUtilsDownloadManager* _tmp5_;
	ProtonPlusServicesInstallJob* _tmp6_;
	ProtonPlusServicesInstallJob* _tmp7_;
	ProtonPlusServicesInstallJob* _tmp8_;
	GeeHashMap* _tmp11_;
	ProtonPlusServicesInstallJob* _tmp12_;
	GeeHashMap* _tmp17_;
	ProtonPlusServicesInstallJob* _tmp18_;
	ProtonPlusServicesInstallJob* _tmp19_;
	gulong _tmp20_;
	ProtonPlusWidgetsToolsReleaseRow* row = NULL;
	ProtonPlusServicesInstallJob* _tmp21_;
	ProtonPlusServicesSteamTinkerLaunchContext* _tmp22_;
	ProtonPlusServicesSteamTinkerLaunchContext* _tmp23_;
	ProtonPlusWidgetsToolsReleaseRow* _tmp32_;
	GtkWidget* _tmp33_;
	ProtonPlusWidgetsToolsReleaseRow* _tmp34_;
	ProtonPlusServicesInstallJob* _tmp35_;
	ProtonPlusServicesInstallJob* _tmp36_;
	ProtonPlusWidgetsToolsReleaseRow* _tmp37_;
	GtkListBox* _tmp38_;
	ProtonPlusWidgetsToolsReleaseRow* _tmp39_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (release != NULL);
	_data20_ = g_slice_new0 (Block20Data);
	_data20_->_ref_count_ = 1;
	_data20_->self = g_object_ref (self);
	_tmp0_ = self->priv->current_tool;
	if (_tmp0_ == NULL) {
		block20_data_unref (_data20_);
		_data20_ = NULL;
		return;
	}
	_tmp1_ = self->priv->current_tool;
	_tmp2_ = proton_plus_services_install_job_new (release, _tmp1_, mode, NULL, NULL);
	_data20_->job = _tmp2_;
	_tmp3_ = _data20_->job;
	if (!proton_plus_widgets_tools_releases_box_apply_selected_variant_to_job (self, _tmp3_)) {
		block20_data_unref (_data20_);
		_data20_ = NULL;
		return;
	}
	_tmp4_ = proton_plus_utils_download_manager_get_instance ();
	_tmp5_ = _tmp4_;
	_tmp6_ = _data20_->job;
	_tmp7_ = proton_plus_utils_download_manager_get_active_download (_tmp5_, _tmp6_);
	active_job = _tmp7_;
	_tmp8_ = active_job;
	if (_tmp8_ != NULL) {
		ProtonPlusServicesInstallJob* _tmp9_;
		ProtonPlusServicesInstallJob* _tmp10_;
		_tmp9_ = active_job;
		_tmp10_ = _g_object_ref0 (_tmp9_);
		_g_object_unref0 (_data20_->job);
		_data20_->job = _tmp10_;
	}
	_tmp11_ = self->priv->job_state_handlers;
	_tmp12_ = _data20_->job;
	if (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp11_, _tmp12_)) {
		ProtonPlusServicesInstallJob* _tmp13_;
		GeeHashMap* _tmp14_;
		ProtonPlusServicesInstallJob* _tmp15_;
		gpointer _tmp16_;
		_tmp13_ = _data20_->job;
		_tmp14_ = self->priv->job_state_handlers;
		_tmp15_ = _data20_->job;
		_tmp16_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp14_, _tmp15_);
		g_signal_handler_disconnect ((GObject*) _tmp13_, (gulong) ((guintptr) _tmp16_));
	}
	_tmp17_ = self->priv->job_state_handlers;
	_tmp18_ = _data20_->job;
	_tmp19_ = _data20_->job;
	_tmp20_ = g_signal_connect_data ((GObject*) _tmp19_, "notify::state", (GCallback) ___lambda41__g_object_notify, block20_data_ref (_data20_), (GClosureNotify) block20_data_unref, 0);
	gee_abstract_map_set ((GeeAbstractMap*) _tmp17_, _tmp18_, (gpointer) ((guintptr) _tmp20_));
	_tmp21_ = _data20_->job;
	_tmp22_ = proton_plus_services_install_job_get_steam_tinker_launch_context (_tmp21_);
	_tmp23_ = _tmp22_;
	if (_tmp23_ != NULL) {
		ProtonPlusServicesInstallJob* _tmp24_;
		ProtonPlusWidgetsToolsSTLReleaseRow* _tmp25_;
		ProtonPlusServicesInstallJob* _tmp26_;
		_tmp24_ = _data20_->job;
		_tmp25_ = proton_plus_widgets_tools_stl_release_row_new (_tmp24_);
		g_object_ref_sink (_tmp25_);
		_g_object_unref0 (row);
		row = (ProtonPlusWidgetsToolsReleaseRow*) _tmp25_;
		_tmp26_ = active_job;
		if (_tmp26_ == NULL) {
			ProtonPlusServicesInstallationService* _tmp27_;
			ProtonPlusServicesInstallationService* _tmp28_;
			ProtonPlusServicesInstallJob* _tmp29_;
			_tmp27_ = proton_plus_services_installation_service_get_instance ();
			_tmp28_ = _tmp27_;
			_tmp29_ = _data20_->job;
			proton_plus_services_installation_service_refresh_steam_tinker_launch_release (_tmp28_, _tmp29_, NULL, NULL);
		}
	} else {
		ProtonPlusServicesInstallJob* _tmp30_;
		ProtonPlusWidgetsToolsReleaseRow* _tmp31_;
		_tmp30_ = _data20_->job;
		_tmp31_ = proton_plus_widgets_tools_release_row_new (_tmp30_);
		g_object_ref_sink (_tmp31_);
		_g_object_unref0 (row);
		row = _tmp31_;
	}
	_tmp32_ = row;
	_tmp33_ = self->priv->controller_up_target;
	proton_plus_widgets_tools_release_row_set_controller_up_target (_tmp32_, _tmp33_);
	_tmp34_ = row;
	_tmp35_ = _data20_->job;
	_tmp36_ = _g_object_ref0 (_tmp35_);
	g_object_set_data_full ((GObject*) _tmp34_, "job", _tmp36_, g_object_unref);
	_tmp37_ = row;
	g_signal_connect_object (_tmp37_, "job-selected", (GCallback) ___lambda60__proton_plus_widgets_tools_release_row_job_selected, self, 0);
	_tmp38_ = self->priv->_list_box;
	_tmp39_ = row;
	gtk_list_box_append (_tmp38_, (GtkWidget*) _tmp39_);
	_g_object_unref0 (row);
	_g_object_unref0 (active_job);
	block20_data_unref (_data20_);
	_data20_ = NULL;
}

static void
proton_plus_widgets_tools_releases_box_disconnect_job_state_handlers (ProtonPlusWidgetsToolsReleasesBox* self)
{
	GeeHashMap* _tmp15_;
	g_return_if_fail (self != NULL);
	{
		GeeIterator* _entry_it = NULL;
		GeeHashMap* _tmp0_;
		GeeSet* _tmp1_;
		GeeSet* _tmp2_;
		GeeSet* _tmp3_;
		GeeIterator* _tmp4_;
		GeeIterator* _tmp5_;
		_tmp0_ = self->priv->job_state_handlers;
		_tmp1_ = gee_abstract_map_get_entries ((GeeAbstractMap*) _tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = _tmp2_;
		_tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_);
		_tmp5_ = _tmp4_;
		_g_object_unref0 (_tmp3_);
		_entry_it = _tmp5_;
		while (TRUE) {
			GeeIterator* _tmp6_;
			GeeMapEntry* entry = NULL;
			GeeIterator* _tmp7_;
			gpointer _tmp8_;
			GeeMapEntry* _tmp9_;
			gconstpointer _tmp10_;
			gconstpointer _tmp11_;
			GeeMapEntry* _tmp12_;
			gconstpointer _tmp13_;
			gconstpointer _tmp14_;
			_tmp6_ = _entry_it;
			if (!gee_iterator_next (_tmp6_)) {
				break;
			}
			_tmp7_ = _entry_it;
			_tmp8_ = gee_iterator_get (_tmp7_);
			entry = (GeeMapEntry*) _tmp8_;
			_tmp9_ = entry;
			_tmp10_ = gee_map_entry_get_key (_tmp9_);
			_tmp11_ = _tmp10_;
			_tmp12_ = entry;
			_tmp13_ = gee_map_entry_get_value (_tmp12_);
			_tmp14_ = _tmp13_;
			g_signal_handler_disconnect ((GObject*) ((ProtonPlusServicesInstallJob*) _tmp11_), (gulong) ((guintptr) _tmp14_));
			_g_object_unref0 (entry);
		}
		_g_object_unref0 (_entry_it);
	}
	_tmp15_ = self->priv->job_state_handlers;
	gee_abstract_map_clear ((GeeAbstractMap*) _tmp15_);
}

static void
proton_plus_widgets_tools_releases_box_real_dispose (GObject* base)
{
	ProtonPlusWidgetsToolsReleasesBox * self;
	self = (ProtonPlusWidgetsToolsReleasesBox*) base;
	proton_plus_widgets_tools_releases_box_disconnect_job_state_handlers (self);
	G_OBJECT_CLASS (proton_plus_widgets_tools_releases_box_parent_class)->dispose ((GObject*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_box_get_type (), GtkBox));
}

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

static void
proton_plus_widgets_tools_releases_box_on_load_more_clicked (ProtonPlusWidgetsToolsReleasesBox* self,
                                                             GAsyncReadyCallback _callback_,
                                                             gpointer _user_data_)
{
	ProtonPlusWidgetsToolsReleasesBoxOnLoadMoreClickedData* _data_;
	ProtonPlusWidgetsToolsReleasesBox* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (ProtonPlusWidgetsToolsReleasesBoxOnLoadMoreClickedData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_widgets_tools_releases_box_on_load_more_clicked_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	proton_plus_widgets_tools_releases_box_on_load_more_clicked_co (_data_);
}

static void
proton_plus_widgets_tools_releases_box_on_load_more_clicked_finish (ProtonPlusWidgetsToolsReleasesBox* self,
                                                                    GAsyncResult* _res_)
{
	ProtonPlusWidgetsToolsReleasesBoxOnLoadMoreClickedData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
proton_plus_widgets_tools_releases_box_on_load_more_clicked_ready (GObject* source_object,
                                                                   GAsyncResult* _res_,
                                                                   gpointer _user_data_)
{
	ProtonPlusWidgetsToolsReleasesBoxOnLoadMoreClickedData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_widgets_tools_releases_box_on_load_more_clicked_co (_data_);
}

static gboolean
proton_plus_widgets_tools_releases_box_on_load_more_clicked_co (ProtonPlusWidgetsToolsReleasesBoxOnLoadMoreClickedData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->current_tool;
	if (_data_->_tmp0_ == NULL) {
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp1_ = _data_->self->priv->current_tool;
	_data_->_tmp2_ = _g_object_ref0 (_data_->_tmp1_);
	_data_->tool = _data_->_tmp2_;
	_data_->request_generation = _data_->self->priv->tool_request_generation;
	_data_->_tmp3_ = _data_->self->priv->load_more_button;
	gtk_widget_set_sensitive ((GtkWidget*) _data_->_tmp3_, FALSE);
	_data_->_tmp4_ = _data_->tool;
	_data_->_tmp5_ = proton_plus_models_tool_get_release_catalog (_data_->_tmp4_);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = _g_object_ref0 (_data_->_tmp6_);
	_data_->catalog = _data_->_tmp7_;
	_data_->_tmp8_ = _data_->catalog;
	if (_data_->_tmp8_ == NULL) {
		_data_->_tmp9_ = _data_->self->priv->load_more_button;
		gtk_widget_set_sensitive ((GtkWidget*) _data_->_tmp9_, TRUE);
		_g_object_unref0 (_data_->catalog);
		_g_object_unref0 (_data_->tool);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp10_ = _data_->catalog;
	_data_->_state_ = 1;
	proton_plus_models_release_catalog_load_more (_data_->_tmp10_, proton_plus_widgets_tools_releases_box_on_load_more_clicked_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp11_ = proton_plus_models_release_catalog_load_more_finish (_data_->_tmp10_, _data_->_res_);
	_data_->_result_ = _data_->_tmp11_;
	_data_->_tmp12_ = _data_->tool;
	if (!proton_plus_widgets_tools_releases_box_is_current_tool_request (_data_->self, _data_->_tmp12_, _data_->request_generation)) {
		_g_object_unref0 (_data_->_result_);
		_g_object_unref0 (_data_->catalog);
		_g_object_unref0 (_data_->tool);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp13_ = _data_->_result_;
	_data_->_tmp14_ = proton_plus_models_release_catalog_result_get_succeeded (_data_->_tmp13_);
	_data_->_tmp15_ = _data_->_tmp14_;
	if (_data_->_tmp15_) {
		{
			_data_->_tmp16_ = _data_->_result_;
			_data_->_tmp17_ = proton_plus_models_release_catalog_result_get_releases (_data_->_tmp16_);
			_data_->_tmp18_ = _data_->_tmp17_;
			_data_->_release_list = _data_->_tmp18_;
			_data_->_tmp19_ = _data_->_release_list;
			_data_->_tmp20_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _data_->_tmp19_);
			_data_->_tmp21_ = _data_->_tmp20_;
			_data_->_release_size = _data_->_tmp21_;
			_data_->_release_index = -1;
			while (TRUE) {
				_data_->_release_index = _data_->_release_index + 1;
				_data_->_tmp22_ = _data_->_release_index;
				_data_->_tmp23_ = _data_->_release_size;
				if (!(_data_->_tmp22_ < _data_->_tmp23_)) {
					break;
				}
				_data_->_tmp24_ = _data_->_release_list;
				_data_->_tmp25_ = gee_abstract_list_get ((GeeAbstractList*) _data_->_tmp24_, _data_->_release_index);
				_data_->release = (ProtonPlusModelsRelease*) _data_->_tmp25_;
				_data_->_tmp26_ = _data_->release;
				proton_plus_widgets_tools_releases_box_add_release_row (_data_->self, _data_->_tmp26_, PROTON_PLUS_SERVICES_INSTALL_JOB_MODE_VERSIONED);
				_g_object_unref0 (_data_->release);
			}
		}
		_data_->_tmp27_ = _data_->tool;
		_data_->_tmp28_ = proton_plus_models_tool_get_group (_data_->_tmp27_);
		_data_->_tmp29_ = _data_->_tmp28_;
		proton_plus_models_group_refresh_installed_state (_data_->_tmp29_);
		_data_->_tmp30_ = _data_->self->priv->_list_box;
		_data_->_tmp31_ = _data_->self->priv->load_more_row;
		gtk_list_box_remove (_data_->_tmp30_, (GtkWidget*) _data_->_tmp31_);
		_data_->_tmp32_ = _data_->self->priv->_list_box;
		_data_->_tmp33_ = _data_->self->priv->load_more_row;
		gtk_list_box_append (_data_->_tmp32_, (GtkWidget*) _data_->_tmp33_);
	}
	_data_->_tmp35_ = _data_->catalog;
	_data_->_tmp36_ = proton_plus_models_release_catalog_get_has_more (_data_->_tmp35_);
	_data_->_tmp37_ = _data_->_tmp36_;
	if (_data_->_tmp37_) {
		_data_->_tmp34_ = proton_plus_widgets_tools_releases_box_can_show_provider_release_rows (_data_->self);
	} else {
		_data_->_tmp34_ = FALSE;
	}
	_data_->_tmp38_ = _data_->self->priv->load_more_row;
	gtk_widget_set_visible ((GtkWidget*) _data_->_tmp38_, _data_->_tmp34_);
	_data_->_tmp39_ = _data_->self->priv->load_more_button;
	gtk_widget_set_sensitive ((GtkWidget*) _data_->_tmp39_, TRUE);
	proton_plus_widgets_tools_releases_box_update_visibility (_data_->self);
	_g_object_unref0 (_data_->_result_);
	_g_object_unref0 (_data_->catalog);
	_g_object_unref0 (_data_->tool);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static gboolean
proton_plus_widgets_tools_releases_box_is_current_tool_request (ProtonPlusWidgetsToolsReleasesBox* self,
                                                                ProtonPlusModelsTool* tool,
                                                                guint request_generation)
{
	gboolean _tmp0_ = FALSE;
	ProtonPlusModelsTool* _tmp1_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (tool != NULL, FALSE);
	_tmp1_ = self->priv->current_tool;
	if (_tmp1_ == tool) {
		_tmp0_ = self->priv->tool_request_generation == request_generation;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

static gboolean
proton_plus_widgets_tools_releases_box_can_show_provider_release_rows (ProtonPlusWidgetsToolsReleasesBox* self)
{
	gboolean _tmp0_ = FALSE;
	ProtonPlusModelsTool* _tmp1_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp1_ = self->priv->current_tool;
	if (!PROTON_PLUS_MODELS_TOOLS_IS_PROVIDER_TOOL (_tmp1_)) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = self->priv->provider_has_compatible_variants;
	}
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_tools_releases_box_update_visibility (ProtonPlusWidgetsToolsReleasesBox* self)
{
	gboolean has_visible = FALSE;
	GtkWidget* child = NULL;
	GtkListBox* _tmp0_;
	GtkWidget* _tmp1_;
	GtkWidget* _tmp2_;
	gboolean _tmp12_ = FALSE;
	g_return_if_fail (self != NULL);
	has_visible = FALSE;
	_tmp0_ = self->priv->_list_box;
	_tmp1_ = gtk_widget_get_first_child ((GtkWidget*) _tmp0_);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	child = _tmp2_;
	while (TRUE) {
		GtkWidget* _tmp3_;
		gboolean _tmp4_ = FALSE;
		GtkWidget* _tmp5_;
		GtkWidget* _tmp9_;
		GtkWidget* _tmp10_;
		GtkWidget* _tmp11_;
		_tmp3_ = child;
		if (!(_tmp3_ != NULL)) {
			break;
		}
		_tmp5_ = child;
		if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, gtk_list_box_row_get_type ())) {
			GtkWidget* _tmp6_;
			GtkListBoxRow* _tmp7_;
			_tmp6_ = child;
			_tmp7_ = self->priv->load_more_row;
			_tmp4_ = _tmp6_ != G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, gtk_widget_get_type (), GtkWidget);
		} else {
			_tmp4_ = FALSE;
		}
		if (_tmp4_) {
			GtkWidget* _tmp8_;
			_tmp8_ = child;
			if (proton_plus_widgets_tools_releases_box_filter_func (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, gtk_list_box_row_get_type (), GtkListBoxRow))) {
				has_visible = TRUE;
				break;
			}
		}
		_tmp9_ = child;
		_tmp10_ = gtk_widget_get_next_sibling (_tmp9_);
		_tmp11_ = _g_object_ref0 (_tmp10_);
		_g_object_unref0 (child);
		child = _tmp11_;
	}
	if (has_visible) {
		_tmp12_ = TRUE;
	} else {
		gboolean _tmp13_ = FALSE;
		GtkListBoxRow* _tmp14_;
		_tmp14_ = self->priv->load_more_row;
		if (_tmp14_ != NULL) {
			GtkListBoxRow* _tmp15_;
			gboolean _tmp16_;
			gboolean _tmp17_;
			_tmp15_ = self->priv->load_more_row;
			_tmp16_ = gtk_widget_get_visible ((GtkWidget*) _tmp15_);
			_tmp17_ = _tmp16_;
			_tmp13_ = _tmp17_;
		} else {
			_tmp13_ = FALSE;
		}
		_tmp12_ = _tmp13_;
	}
	if (_tmp12_) {
		GtkStack* _tmp18_;
		_tmp18_ = self->priv->_content_stack;
		gtk_stack_set_visible_child_name (_tmp18_, "list");
	} else {
		GtkStack* _tmp19_;
		_tmp19_ = self->priv->_content_stack;
		gtk_stack_set_visible_child_name (_tmp19_, "empty");
	}
	_g_object_unref0 (child);
}

static gboolean
string_contains (const gchar* self,
                 const gchar* needle)
{
	gchar* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (needle != NULL, FALSE);
	_tmp0_ = strstr ((gchar*) self, (gchar*) needle);
	result = _tmp0_ != NULL;
	return result;
}

static gboolean
proton_plus_widgets_tools_releases_box_filter_func (ProtonPlusWidgetsToolsReleasesBox* self,
                                                    GtkListBoxRow* row)
{
	ProtonPlusServicesInstallJob* job = NULL;
	gconstpointer _tmp0_;
	ProtonPlusServicesInstallJob* _tmp1_;
	ProtonPlusServicesInstallJob* _tmp2_;
	gboolean _tmp3_ = FALSE;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	ProtonPlusModelsToolsProviderTool* provider_tool = NULL;
	ProtonPlusModelsTool* _tmp16_;
	ProtonPlusModelsToolsProviderTool* _tmp17_;
	gboolean _tmp18_ = FALSE;
	ProtonPlusModelsToolsProviderTool* _tmp19_;
	ProtonPlusWidgetsToolsFilter _tmp29_;
	ProtonPlusWidgetsToolsFilter _tmp30_;
	ProtonPlusWidgetsToolsFilter _tmp31_;
	ProtonPlusWidgetsToolsFilter _tmp32_;
	gint usage_count = 0;
	ProtonPlusServicesInstallJob* _tmp40_;
	ProtonPlusModelsTool* _tmp41_;
	ProtonPlusModelsTool* _tmp42_;
	ProtonPlusModelsGroup* _tmp43_;
	ProtonPlusModelsGroup* _tmp44_;
	ProtonPlusModelsLauncher* _tmp45_;
	ProtonPlusModelsLauncher* _tmp46_;
	ProtonPlusServicesInstallJob* _tmp47_;
	gchar* _tmp48_;
	gchar* _tmp49_;
	gint _tmp50_;
	ProtonPlusWidgetsToolsFilter _tmp51_;
	ProtonPlusWidgetsToolsFilter _tmp52_;
	ProtonPlusWidgetsToolsFilter _tmp53_;
	ProtonPlusWidgetsToolsFilter _tmp54_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (row != NULL, FALSE);
	_tmp0_ = g_object_get_data ((GObject*) row, "job");
	_tmp1_ = _g_object_ref0 ((ProtonPlusServicesInstallJob*) _tmp0_);
	job = _tmp1_;
	_tmp2_ = job;
	if (_tmp2_ == NULL) {
		result = TRUE;
		_g_object_unref0 (job);
		return result;
	}
	_tmp4_ = proton_plus_widgets_tools_releases_box_get_search_text (self);
	_tmp5_ = _tmp4_;
	if (g_strcmp0 (_tmp5_, "") != 0) {
		ProtonPlusServicesInstallJob* _tmp6_;
		gchar* _tmp7_;
		gchar* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		gchar* _tmp11_;
		const gchar* _tmp12_;
		const gchar* _tmp13_;
		gchar* _tmp14_;
		gchar* _tmp15_;
		_tmp6_ = job;
		_tmp7_ = proton_plus_services_install_job_get_title (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = _tmp8_;
		_tmp10_ = g_utf8_strdown (_tmp9_, (gssize) -1);
		_tmp11_ = _tmp10_;
		_tmp12_ = proton_plus_widgets_tools_releases_box_get_search_text (self);
		_tmp13_ = _tmp12_;
		_tmp14_ = g_utf8_strdown (_tmp13_, (gssize) -1);
		_tmp15_ = _tmp14_;
		_tmp3_ = !string_contains (_tmp11_, _tmp15_);
		_g_free0 (_tmp15_);
		_g_free0 (_tmp11_);
		_g_free0 (_tmp9_);
	} else {
		_tmp3_ = FALSE;
	}
	if (_tmp3_) {
		result = FALSE;
		_g_object_unref0 (job);
		return result;
	}
	_tmp16_ = self->priv->current_tool;
	_tmp17_ = _g_object_ref0 (PROTON_PLUS_MODELS_TOOLS_IS_PROVIDER_TOOL (_tmp16_) ? ((ProtonPlusModelsToolsProviderTool*) _tmp16_) : NULL);
	provider_tool = _tmp17_;
	_tmp19_ = provider_tool;
	if (_tmp19_ != NULL) {
		gboolean _tmp20_ = FALSE;
		if (!self->priv->provider_has_compatible_variants) {
			_tmp20_ = TRUE;
		} else {
			ProtonPlusServicesInstallJob* _tmp21_;
			ProtonPlusModelsRelease* _tmp22_;
			ProtonPlusModelsRelease* _tmp23_;
			ProtonPlusServicesInstallJob* _tmp24_;
			ProtonPlusServicesInstallJobMode _tmp25_;
			ProtonPlusServicesInstallJobMode _tmp26_;
			ProtonPlusModelsVariant* _tmp27_;
			ProtonPlusModelsVariant* _tmp28_;
			_tmp21_ = job;
			_tmp22_ = proton_plus_services_install_job_get_release (_tmp21_);
			_tmp23_ = _tmp22_;
			_tmp24_ = job;
			_tmp25_ = proton_plus_services_install_job_get_mode (_tmp24_);
			_tmp26_ = _tmp25_;
			_tmp27_ = proton_plus_widgets_tools_releases_box_resolve_release_variant (self, _tmp23_, _tmp26_);
			_tmp28_ = _tmp27_;
			_tmp20_ = _tmp28_ == NULL;
			_g_object_unref0 (_tmp28_);
		}
		_tmp18_ = _tmp20_;
	} else {
		_tmp18_ = FALSE;
	}
	if (_tmp18_) {
		result = FALSE;
		_g_object_unref0 (provider_tool);
		_g_object_unref0 (job);
		return result;
	}
	_tmp29_ = proton_plus_widgets_tools_releases_box_get_filter (self);
	_tmp30_ = _tmp29_;
	if (_tmp30_ == PROTON_PLUS_WIDGETS_TOOLS_FILTER_ALL) {
		result = TRUE;
		_g_object_unref0 (provider_tool);
		_g_object_unref0 (job);
		return result;
	}
	_tmp31_ = proton_plus_widgets_tools_releases_box_get_filter (self);
	_tmp32_ = _tmp31_;
	if (_tmp32_ == PROTON_PLUS_WIDGETS_TOOLS_FILTER_INSTALLED) {
		gboolean _tmp33_ = FALSE;
		ProtonPlusServicesInstallJob* _tmp34_;
		ProtonPlusServicesInstallJobState _tmp35_;
		ProtonPlusServicesInstallJobState _tmp36_;
		_tmp34_ = job;
		_tmp35_ = proton_plus_services_install_job_get_state (_tmp34_);
		_tmp36_ = _tmp35_;
		if (_tmp36_ == PROTON_PLUS_SERVICES_INSTALL_JOB_STATE_UP_TO_DATE) {
			_tmp33_ = TRUE;
		} else {
			ProtonPlusServicesInstallJob* _tmp37_;
			ProtonPlusServicesInstallJobState _tmp38_;
			ProtonPlusServicesInstallJobState _tmp39_;
			_tmp37_ = job;
			_tmp38_ = proton_plus_services_install_job_get_state (_tmp37_);
			_tmp39_ = _tmp38_;
			_tmp33_ = _tmp39_ == PROTON_PLUS_SERVICES_INSTALL_JOB_STATE_UPDATE_AVAILABLE;
		}
		result = _tmp33_;
		_g_object_unref0 (provider_tool);
		_g_object_unref0 (job);
		return result;
	}
	_tmp40_ = job;
	_tmp41_ = proton_plus_services_install_job_get_tool (_tmp40_);
	_tmp42_ = _tmp41_;
	_tmp43_ = proton_plus_models_tool_get_group (_tmp42_);
	_tmp44_ = _tmp43_;
	_tmp45_ = proton_plus_models_group_get_launcher (_tmp44_);
	_tmp46_ = _tmp45_;
	_tmp47_ = job;
	_tmp48_ = proton_plus_services_install_job_get_usage_identifier (_tmp47_);
	_tmp49_ = _tmp48_;
	_tmp50_ = proton_plus_models_launcher_get_compatibility_tool_usage_count (_tmp46_, _tmp49_);
	_g_free0 (_tmp49_);
	usage_count = _tmp50_;
	_tmp51_ = proton_plus_widgets_tools_releases_box_get_filter (self);
	_tmp52_ = _tmp51_;
	if (_tmp52_ == PROTON_PLUS_WIDGETS_TOOLS_FILTER_USED) {
		result = usage_count > 0;
		_g_object_unref0 (provider_tool);
		_g_object_unref0 (job);
		return result;
	}
	_tmp53_ = proton_plus_widgets_tools_releases_box_get_filter (self);
	_tmp54_ = _tmp53_;
	if (_tmp54_ == PROTON_PLUS_WIDGETS_TOOLS_FILTER_UNUSED) {
		result = usage_count == 0;
		_g_object_unref0 (provider_tool);
		_g_object_unref0 (job);
		return result;
	}
	result = TRUE;
	_g_object_unref0 (provider_tool);
	_g_object_unref0 (job);
	return result;
}

static GtkBox*
proton_plus_widgets_tools_releases_box_get_tool_box (ProtonPlusWidgetsToolsReleasesBox* self)
{
	GtkBox* result;
	GtkBox* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_tool_box;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_tools_releases_box_set_tool_box (ProtonPlusWidgetsToolsReleasesBox* self,
                                                     GtkBox* value)
{
	GtkBox* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_tool_box);
	self->priv->_tool_box = _tmp0_;
}

static GtkLabel*
proton_plus_widgets_tools_releases_box_get_title_label (ProtonPlusWidgetsToolsReleasesBox* self)
{
	GtkLabel* result;
	GtkLabel* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_title_label;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_tools_releases_box_set_title_label (ProtonPlusWidgetsToolsReleasesBox* self,
                                                        GtkLabel* value)
{
	GtkLabel* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_title_label);
	self->priv->_title_label = _tmp0_;
}

GtkBox*
proton_plus_widgets_tools_releases_box_get_header_title (ProtonPlusWidgetsToolsReleasesBox* self)
{
	GtkBox* result;
	GtkBox* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_header_title;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_tools_releases_box_set_header_title (ProtonPlusWidgetsToolsReleasesBox* self,
                                                         GtkBox* value)
{
	GtkBox* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_widgets_tools_releases_box_get_header_title (self);
	if (old_value != value) {
		GtkBox* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_header_title);
		self->priv->_header_title = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_widgets_tools_releases_box_properties[PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_HEADER_TITLE_PROPERTY]);
	}
}

GtkLabel*
proton_plus_widgets_tools_releases_box_get_last_updated_label (ProtonPlusWidgetsToolsReleasesBox* self)
{
	GtkLabel* result;
	GtkLabel* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_last_updated_label;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_tools_releases_box_set_last_updated_label (ProtonPlusWidgetsToolsReleasesBox* self,
                                                               GtkLabel* value)
{
	GtkLabel* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_widgets_tools_releases_box_get_last_updated_label (self);
	if (old_value != value) {
		GtkLabel* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_last_updated_label);
		self->priv->_last_updated_label = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_widgets_tools_releases_box_properties[PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_LAST_UPDATED_LABEL_PROPERTY]);
	}
}

GtkButton*
proton_plus_widgets_tools_releases_box_get_refresh_button (ProtonPlusWidgetsToolsReleasesBox* self)
{
	GtkButton* result;
	GtkButton* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_refresh_button;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_tools_releases_box_set_refresh_button (ProtonPlusWidgetsToolsReleasesBox* self,
                                                           GtkButton* value)
{
	GtkButton* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_widgets_tools_releases_box_get_refresh_button (self);
	if (old_value != value) {
		GtkButton* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_refresh_button);
		self->priv->_refresh_button = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_widgets_tools_releases_box_properties[PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_REFRESH_BUTTON_PROPERTY]);
	}
}

GtkButton*
proton_plus_widgets_tools_releases_box_get_repository_button (ProtonPlusWidgetsToolsReleasesBox* self)
{
	GtkButton* result;
	GtkButton* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_repository_button;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_tools_releases_box_set_repository_button (ProtonPlusWidgetsToolsReleasesBox* self,
                                                              GtkButton* value)
{
	GtkButton* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_widgets_tools_releases_box_get_repository_button (self);
	if (old_value != value) {
		GtkButton* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_repository_button);
		self->priv->_repository_button = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_widgets_tools_releases_box_properties[PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_REPOSITORY_BUTTON_PROPERTY]);
	}
}

static GtkListBox*
proton_plus_widgets_tools_releases_box_get_list_box (ProtonPlusWidgetsToolsReleasesBox* self)
{
	GtkListBox* result;
	GtkListBox* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_list_box;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_tools_releases_box_set_list_box (ProtonPlusWidgetsToolsReleasesBox* self,
                                                     GtkListBox* value)
{
	GtkListBox* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_list_box);
	self->priv->_list_box = _tmp0_;
}

static GtkScrolledWindow*
proton_plus_widgets_tools_releases_box_get_scrolled (ProtonPlusWidgetsToolsReleasesBox* self)
{
	GtkScrolledWindow* result;
	GtkScrolledWindow* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_scrolled;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_tools_releases_box_set_scrolled (ProtonPlusWidgetsToolsReleasesBox* self,
                                                     GtkScrolledWindow* value)
{
	GtkScrolledWindow* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_scrolled);
	self->priv->_scrolled = _tmp0_;
}

static GtkStack*
proton_plus_widgets_tools_releases_box_get_content_stack (ProtonPlusWidgetsToolsReleasesBox* self)
{
	GtkStack* result;
	GtkStack* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_content_stack;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_tools_releases_box_set_content_stack (ProtonPlusWidgetsToolsReleasesBox* self,
                                                          GtkStack* value)
{
	GtkStack* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_content_stack);
	self->priv->_content_stack = _tmp0_;
}

static AdwStatusPage*
proton_plus_widgets_tools_releases_box_get_status_page (ProtonPlusWidgetsToolsReleasesBox* self)
{
	AdwStatusPage* result;
	AdwStatusPage* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_status_page;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_tools_releases_box_set_status_page (ProtonPlusWidgetsToolsReleasesBox* self,
                                                        AdwStatusPage* value)
{
	AdwStatusPage* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_status_page);
	self->priv->_status_page = _tmp0_;
}

static GtkDropDown*
proton_plus_widgets_tools_releases_box_get_variant_dropdown (ProtonPlusWidgetsToolsReleasesBox* self)
{
	GtkDropDown* result;
	GtkDropDown* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_variant_dropdown;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_tools_releases_box_set_variant_dropdown (ProtonPlusWidgetsToolsReleasesBox* self,
                                                             GtkDropDown* value)
{
	GtkDropDown* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_variant_dropdown);
	self->priv->_variant_dropdown = _tmp0_;
}

GtkBox*
proton_plus_widgets_tools_releases_box_get_variant_box (ProtonPlusWidgetsToolsReleasesBox* self)
{
	GtkBox* result;
	GtkBox* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_variant_box;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_tools_releases_box_set_variant_box (ProtonPlusWidgetsToolsReleasesBox* self,
                                                        GtkBox* value)
{
	GtkBox* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_widgets_tools_releases_box_get_variant_box (self);
	if (old_value != value) {
		GtkBox* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_variant_box);
		self->priv->_variant_box = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_widgets_tools_releases_box_properties[PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_VARIANT_BOX_PROPERTY]);
	}
}

ProtonPlusWidgetsToolsFilter
proton_plus_widgets_tools_releases_box_get_filter (ProtonPlusWidgetsToolsReleasesBox* self)
{
	ProtonPlusWidgetsToolsFilter result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_filter;
	return result;
}

void
proton_plus_widgets_tools_releases_box_set_filter (ProtonPlusWidgetsToolsReleasesBox* self,
                                                   ProtonPlusWidgetsToolsFilter value)
{
	GtkListBox* _tmp0_;
	g_return_if_fail (self != NULL);
	self->priv->_filter = value;
	_tmp0_ = self->priv->_list_box;
	gtk_list_box_invalidate_filter (_tmp0_);
	proton_plus_widgets_tools_releases_box_update_visibility (self);
	g_object_notify_by_pspec ((GObject *) self, proton_plus_widgets_tools_releases_box_properties[PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_FILTER_PROPERTY]);
}

const gchar*
proton_plus_widgets_tools_releases_box_get_search_text (ProtonPlusWidgetsToolsReleasesBox* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_search_text;
	result = _tmp0_;
	return result;
}

void
proton_plus_widgets_tools_releases_box_set_search_text (ProtonPlusWidgetsToolsReleasesBox* self,
                                                        const gchar* value)
{
	gchar* _tmp0_;
	GtkListBox* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_search_text);
	self->priv->_search_text = _tmp0_;
	_tmp1_ = self->priv->_list_box;
	gtk_list_box_invalidate_filter (_tmp1_);
	proton_plus_widgets_tools_releases_box_update_visibility (self);
	g_object_notify_by_pspec ((GObject *) self, proton_plus_widgets_tools_releases_box_properties[PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_SEARCH_TEXT_PROPERTY]);
}

static void
proton_plus_widgets_tools_releases_box_class_init (ProtonPlusWidgetsToolsReleasesBoxClass * klass,
                                                   gpointer klass_data)
{
	proton_plus_widgets_tools_releases_box_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusWidgetsToolsReleasesBox_private_offset);
	((GObjectClass *) klass)->dispose = (void (*) (GObject*)) proton_plus_widgets_tools_releases_box_real_dispose;
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_widgets_tools_releases_box_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_widgets_tools_releases_box_set_property;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_widgets_tools_releases_box_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_HEADER_TITLE_PROPERTY, proton_plus_widgets_tools_releases_box_properties[PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_HEADER_TITLE_PROPERTY] = g_param_spec_object ("header-title", "header-title", "header-title", gtk_box_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_LAST_UPDATED_LABEL_PROPERTY, proton_plus_widgets_tools_releases_box_properties[PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_LAST_UPDATED_LABEL_PROPERTY] = g_param_spec_object ("last-updated-label", "last-updated-label", "last-updated-label", gtk_label_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_REFRESH_BUTTON_PROPERTY, proton_plus_widgets_tools_releases_box_properties[PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_REFRESH_BUTTON_PROPERTY] = g_param_spec_object ("refresh-button", "refresh-button", "refresh-button", gtk_button_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_REPOSITORY_BUTTON_PROPERTY, proton_plus_widgets_tools_releases_box_properties[PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_REPOSITORY_BUTTON_PROPERTY] = g_param_spec_object ("repository-button", "repository-button", "repository-button", gtk_button_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_VARIANT_BOX_PROPERTY, proton_plus_widgets_tools_releases_box_properties[PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_VARIANT_BOX_PROPERTY] = g_param_spec_object ("variant-box", "variant-box", "variant-box", gtk_box_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_FILTER_PROPERTY, proton_plus_widgets_tools_releases_box_properties[PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_FILTER_PROPERTY] = g_param_spec_enum ("filter", "filter", "filter", PROTON_PLUS_WIDGETS_TOOLS_TYPE_FILTER, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_SEARCH_TEXT_PROPERTY, proton_plus_widgets_tools_releases_box_properties[PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_SEARCH_TEXT_PROPERTY] = g_param_spec_string ("search-text", "search-text", "search-text", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	proton_plus_widgets_tools_releases_box_signals[PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_JOB_SELECTED_SIGNAL] = g_signal_new ("job-selected", PROTON_PLUS_WIDGETS_TOOLS_TYPE_RELEASES_BOX, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, PROTON_PLUS_SERVICES_TYPE_INSTALL_JOB);
}

static void
proton_plus_widgets_tools_releases_box_proton_plus_utils_controller_directional_focus_interface_init (ProtonPlusUtilsControllerDirectionalFocusIface * iface,
                                                                                                      gpointer iface_data)
{
	proton_plus_widgets_tools_releases_box_proton_plus_utils_controller_directional_focus_parent_iface = g_type_interface_peek_parent (iface);
	iface->controller_focus_direction = (gboolean (*) (ProtonPlusUtilsControllerDirectionalFocus*, GObject*, ProtonPlusUtilsControllerNavigationDirection)) proton_plus_widgets_tools_releases_box_real_controller_focus_direction;
}

static void
proton_plus_widgets_tools_releases_box_instance_init (ProtonPlusWidgetsToolsReleasesBox * self,
                                                      gpointer klass)
{
	GeeHashMap* _tmp0_;
	GeeLinkedList* _tmp1_;
	gchar* _tmp2_;
	self->priv = proton_plus_widgets_tools_releases_box_get_instance_private (self);
	_tmp0_ = gee_hash_map_new (PROTON_PLUS_SERVICES_TYPE_INSTALL_JOB, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, G_TYPE_ULONG, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->job_state_handlers = _tmp0_;
	self->priv->tool_request_generation = (guint) 0;
	self->priv->selected_variant = NULL;
	_tmp1_ = gee_linked_list_new (PROTON_PLUS_MODELS_TYPE_VARIANT, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	self->priv->displayed_variants = _tmp1_;
	self->priv->selected_variant_checkmark = NULL;
	self->priv->header_controls_visible = FALSE;
	self->priv->has_variants = FALSE;
	self->priv->provider_has_compatible_variants = TRUE;
	self->priv->updating_variant_dropdown = FALSE;
	self->priv->_filter = PROTON_PLUS_WIDGETS_TOOLS_FILTER_ALL;
	_tmp2_ = g_strdup ("");
	self->priv->_search_text = _tmp2_;
}

static void
proton_plus_widgets_tools_releases_box_finalize (GObject * obj)
{
	ProtonPlusWidgetsToolsReleasesBox * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_TOOLS_TYPE_RELEASES_BOX, ProtonPlusWidgetsToolsReleasesBox);
	_g_object_unref0 (self->priv->_tool_box);
	_g_object_unref0 (self->priv->_title_label);
	_g_object_unref0 (self->priv->_header_title);
	_g_object_unref0 (self->priv->_last_updated_label);
	_g_object_unref0 (self->priv->_refresh_button);
	_g_object_unref0 (self->priv->_repository_button);
	_g_object_unref0 (self->priv->_list_box);
	_g_object_unref0 (self->priv->_scrolled);
	_g_object_unref0 (self->priv->_content_stack);
	_g_object_unref0 (self->priv->_status_page);
	_g_object_unref0 (self->priv->current_tool);
	_g_object_unref0 (self->priv->job_state_handlers);
	_g_object_unref0 (self->priv->selected_variant);
	_g_object_unref0 (self->priv->displayed_variants);
	_g_object_unref0 (self->priv->_variant_dropdown);
	_g_hash_table_unref0 (self->priv->variant_list_items);
	_g_object_unref0 (self->priv->selected_variant_checkmark);
	_g_object_unref0 (self->priv->_variant_box);
	_g_object_unref0 (self->priv->load_more_row);
	_g_object_unref0 (self->priv->load_more_button);
	_g_free0 (self->priv->_search_text);
	G_OBJECT_CLASS (proton_plus_widgets_tools_releases_box_parent_class)->finalize (obj);
}

static GType
proton_plus_widgets_tools_releases_box_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusWidgetsToolsReleasesBoxClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_widgets_tools_releases_box_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusWidgetsToolsReleasesBox), 0, (GInstanceInitFunc) proton_plus_widgets_tools_releases_box_instance_init, NULL };
	static const GInterfaceInfo proton_plus_utils_controller_directional_focus_info = { (GInterfaceInitFunc) proton_plus_widgets_tools_releases_box_proton_plus_utils_controller_directional_focus_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType proton_plus_widgets_tools_releases_box_type_id;
	proton_plus_widgets_tools_releases_box_type_id = g_type_register_static (gtk_box_get_type (), "ProtonPlusWidgetsToolsReleasesBox", &g_define_type_info, 0);
	g_type_add_interface_static (proton_plus_widgets_tools_releases_box_type_id, PROTON_PLUS_UTILS_TYPE_CONTROLLER_DIRECTIONAL_FOCUS, &proton_plus_utils_controller_directional_focus_info);
	ProtonPlusWidgetsToolsReleasesBox_private_offset = g_type_add_instance_private (proton_plus_widgets_tools_releases_box_type_id, sizeof (ProtonPlusWidgetsToolsReleasesBoxPrivate));
	return proton_plus_widgets_tools_releases_box_type_id;
}

GType
proton_plus_widgets_tools_releases_box_get_type (void)
{
	static volatile gsize proton_plus_widgets_tools_releases_box_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_widgets_tools_releases_box_type_id__once)) {
		GType proton_plus_widgets_tools_releases_box_type_id;
		proton_plus_widgets_tools_releases_box_type_id = proton_plus_widgets_tools_releases_box_get_type_once ();
		g_once_init_leave (&proton_plus_widgets_tools_releases_box_type_id__once, proton_plus_widgets_tools_releases_box_type_id);
	}
	return proton_plus_widgets_tools_releases_box_type_id__once;
}

static void
_vala_proton_plus_widgets_tools_releases_box_get_property (GObject * object,
                                                           guint property_id,
                                                           GValue * value,
                                                           GParamSpec * pspec)
{
	ProtonPlusWidgetsToolsReleasesBox * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_TOOLS_TYPE_RELEASES_BOX, ProtonPlusWidgetsToolsReleasesBox);
	switch (property_id) {
		case PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_HEADER_TITLE_PROPERTY:
		g_value_set_object (value, proton_plus_widgets_tools_releases_box_get_header_title (self));
		break;
		case PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_LAST_UPDATED_LABEL_PROPERTY:
		g_value_set_object (value, proton_plus_widgets_tools_releases_box_get_last_updated_label (self));
		break;
		case PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_REFRESH_BUTTON_PROPERTY:
		g_value_set_object (value, proton_plus_widgets_tools_releases_box_get_refresh_button (self));
		break;
		case PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_REPOSITORY_BUTTON_PROPERTY:
		g_value_set_object (value, proton_plus_widgets_tools_releases_box_get_repository_button (self));
		break;
		case PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_VARIANT_BOX_PROPERTY:
		g_value_set_object (value, proton_plus_widgets_tools_releases_box_get_variant_box (self));
		break;
		case PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_FILTER_PROPERTY:
		g_value_set_enum (value, proton_plus_widgets_tools_releases_box_get_filter (self));
		break;
		case PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_SEARCH_TEXT_PROPERTY:
		g_value_set_string (value, proton_plus_widgets_tools_releases_box_get_search_text (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_proton_plus_widgets_tools_releases_box_set_property (GObject * object,
                                                           guint property_id,
                                                           const GValue * value,
                                                           GParamSpec * pspec)
{
	ProtonPlusWidgetsToolsReleasesBox * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_TOOLS_TYPE_RELEASES_BOX, ProtonPlusWidgetsToolsReleasesBox);
	switch (property_id) {
		case PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_HEADER_TITLE_PROPERTY:
		proton_plus_widgets_tools_releases_box_set_header_title (self, g_value_get_object (value));
		break;
		case PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_LAST_UPDATED_LABEL_PROPERTY:
		proton_plus_widgets_tools_releases_box_set_last_updated_label (self, g_value_get_object (value));
		break;
		case PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_REFRESH_BUTTON_PROPERTY:
		proton_plus_widgets_tools_releases_box_set_refresh_button (self, g_value_get_object (value));
		break;
		case PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_REPOSITORY_BUTTON_PROPERTY:
		proton_plus_widgets_tools_releases_box_set_repository_button (self, g_value_get_object (value));
		break;
		case PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_VARIANT_BOX_PROPERTY:
		proton_plus_widgets_tools_releases_box_set_variant_box (self, g_value_get_object (value));
		break;
		case PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_FILTER_PROPERTY:
		proton_plus_widgets_tools_releases_box_set_filter (self, g_value_get_enum (value));
		break;
		case PROTON_PLUS_WIDGETS_TOOLS_RELEASES_BOX_SEARCH_TEXT_PROPERTY:
		proton_plus_widgets_tools_releases_box_set_search_text (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

