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

#include <adwaita.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>
#include <gee.h>
#include <glib/gi18n-lib.h>
#include <float.h>
#include <math.h>
#include <gdk/gdk.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
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define PROTON_PLUS_WIDGETS_TYPE_DOWNLOAD_ROW (proton_plus_widgets_download_row_get_type ())
#define PROTON_PLUS_WIDGETS_DOWNLOAD_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_WIDGETS_TYPE_DOWNLOAD_ROW, ProtonPlusWidgetsDownloadRow))
#define PROTON_PLUS_WIDGETS_DOWNLOAD_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_WIDGETS_TYPE_DOWNLOAD_ROW, ProtonPlusWidgetsDownloadRowClass))
#define PROTON_PLUS_WIDGETS_IS_DOWNLOAD_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_WIDGETS_TYPE_DOWNLOAD_ROW))
#define PROTON_PLUS_WIDGETS_IS_DOWNLOAD_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_WIDGETS_TYPE_DOWNLOAD_ROW))
#define PROTON_PLUS_WIDGETS_DOWNLOAD_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_WIDGETS_TYPE_DOWNLOAD_ROW, ProtonPlusWidgetsDownloadRowClass))

typedef struct _ProtonPlusWidgetsDownloadRow ProtonPlusWidgetsDownloadRow;
typedef struct _ProtonPlusWidgetsDownloadRowClass ProtonPlusWidgetsDownloadRowClass;
typedef struct _ProtonPlusWidgetsDownloadRowPrivate ProtonPlusWidgetsDownloadRowPrivate;

#define PROTON_PLUS_MODELS_TYPE_BASE_RELEASE (proton_plus_models_base_release_get_type ())
#define PROTON_PLUS_MODELS_BASE_RELEASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_MODELS_TYPE_BASE_RELEASE, ProtonPlusModelsBaseRelease))
#define PROTON_PLUS_MODELS_BASE_RELEASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_MODELS_TYPE_BASE_RELEASE, ProtonPlusModelsBaseReleaseClass))
#define PROTON_PLUS_MODELS_IS_BASE_RELEASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_MODELS_TYPE_BASE_RELEASE))
#define PROTON_PLUS_MODELS_IS_BASE_RELEASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_MODELS_TYPE_BASE_RELEASE))
#define PROTON_PLUS_MODELS_BASE_RELEASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_MODELS_TYPE_BASE_RELEASE, ProtonPlusModelsBaseReleaseClass))

typedef struct _ProtonPlusModelsBaseRelease ProtonPlusModelsBaseRelease;
typedef struct _ProtonPlusModelsBaseReleaseClass ProtonPlusModelsBaseReleaseClass;
enum  {
	PROTON_PLUS_WIDGETS_DOWNLOAD_ROW_0_PROPERTY,
	PROTON_PLUS_WIDGETS_DOWNLOAD_ROW_RELEASE_PROPERTY,
	PROTON_PLUS_WIDGETS_DOWNLOAD_ROW_NUM_PROPERTIES
};
static GParamSpec* proton_plus_widgets_download_row_properties[PROTON_PLUS_WIDGETS_DOWNLOAD_ROW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block7Data Block7Data;

#define PROTON_PLUS_MODELS_TYPE_RUNNER (proton_plus_models_runner_get_type ())
#define PROTON_PLUS_MODELS_RUNNER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_MODELS_TYPE_RUNNER, ProtonPlusModelsRunner))
#define PROTON_PLUS_MODELS_RUNNER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_MODELS_TYPE_RUNNER, ProtonPlusModelsRunnerClass))
#define PROTON_PLUS_MODELS_IS_RUNNER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_MODELS_TYPE_RUNNER))
#define PROTON_PLUS_MODELS_IS_RUNNER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_MODELS_TYPE_RUNNER))
#define PROTON_PLUS_MODELS_RUNNER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_MODELS_TYPE_RUNNER, ProtonPlusModelsRunnerClass))

typedef struct _ProtonPlusModelsRunner ProtonPlusModelsRunner;
typedef struct _ProtonPlusModelsRunnerClass ProtonPlusModelsRunnerClass;

#define PROTON_PLUS_MODELS_TYPE_GROUP (proton_plus_models_group_get_type ())
#define PROTON_PLUS_MODELS_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_MODELS_TYPE_GROUP, ProtonPlusModelsGroup))
#define PROTON_PLUS_MODELS_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_MODELS_TYPE_GROUP, ProtonPlusModelsGroupClass))
#define PROTON_PLUS_MODELS_IS_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_MODELS_TYPE_GROUP))
#define PROTON_PLUS_MODELS_IS_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_MODELS_TYPE_GROUP))
#define PROTON_PLUS_MODELS_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_MODELS_TYPE_GROUP, ProtonPlusModelsGroupClass))

typedef struct _ProtonPlusModelsGroup ProtonPlusModelsGroup;
typedef struct _ProtonPlusModelsGroupClass ProtonPlusModelsGroupClass;

#define PROTON_PLUS_MODELS_TYPE_LAUNCHER (proton_plus_models_launcher_get_type ())
#define PROTON_PLUS_MODELS_LAUNCHER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_MODELS_TYPE_LAUNCHER, ProtonPlusModelsLauncher))
#define PROTON_PLUS_MODELS_LAUNCHER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_MODELS_TYPE_LAUNCHER, ProtonPlusModelsLauncherClass))
#define PROTON_PLUS_MODELS_IS_LAUNCHER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_MODELS_TYPE_LAUNCHER))
#define PROTON_PLUS_MODELS_IS_LAUNCHER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_MODELS_TYPE_LAUNCHER))
#define PROTON_PLUS_MODELS_LAUNCHER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_MODELS_TYPE_LAUNCHER, ProtonPlusModelsLauncherClass))

typedef struct _ProtonPlusModelsLauncher ProtonPlusModelsLauncher;
typedef struct _ProtonPlusModelsLauncherClass ProtonPlusModelsLauncherClass;
typedef struct _ProtonPlusModelsLauncherPrivate ProtonPlusModelsLauncherPrivate;

#define PROTON_PLUS_MODELS_TYPE_GAME (proton_plus_models_game_get_type ())
#define PROTON_PLUS_MODELS_GAME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_MODELS_TYPE_GAME, ProtonPlusModelsGame))
#define PROTON_PLUS_MODELS_GAME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_MODELS_TYPE_GAME, ProtonPlusModelsGameClass))
#define PROTON_PLUS_MODELS_IS_GAME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_MODELS_TYPE_GAME))
#define PROTON_PLUS_MODELS_IS_GAME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_MODELS_TYPE_GAME))
#define PROTON_PLUS_MODELS_GAME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_MODELS_TYPE_GAME, ProtonPlusModelsGameClass))

typedef struct _ProtonPlusModelsGame ProtonPlusModelsGame;
typedef struct _ProtonPlusModelsGameClass ProtonPlusModelsGameClass;

#define PROTON_PLUS_MODELS_TYPE_SIMPLE_RUNNER (proton_plus_models_simple_runner_get_type ())
#define PROTON_PLUS_MODELS_SIMPLE_RUNNER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_MODELS_TYPE_SIMPLE_RUNNER, ProtonPlusModelsSimpleRunner))
#define PROTON_PLUS_MODELS_SIMPLE_RUNNER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_MODELS_TYPE_SIMPLE_RUNNER, ProtonPlusModelsSimpleRunnerClass))
#define PROTON_PLUS_MODELS_IS_SIMPLE_RUNNER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_MODELS_TYPE_SIMPLE_RUNNER))
#define PROTON_PLUS_MODELS_IS_SIMPLE_RUNNER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_MODELS_TYPE_SIMPLE_RUNNER))
#define PROTON_PLUS_MODELS_SIMPLE_RUNNER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_MODELS_TYPE_SIMPLE_RUNNER, ProtonPlusModelsSimpleRunnerClass))

typedef struct _ProtonPlusModelsSimpleRunner ProtonPlusModelsSimpleRunner;
typedef struct _ProtonPlusModelsSimpleRunnerClass ProtonPlusModelsSimpleRunnerClass;
typedef enum  {
	PROTON_PLUS_MODELS_LAUNCHER_INSTALLATION_TYPES_SYSTEM,
	PROTON_PLUS_MODELS_LAUNCHER_INSTALLATION_TYPES_FLATPAK,
	PROTON_PLUS_MODELS_LAUNCHER_INSTALLATION_TYPES_SNAP
} ProtonPlusModelsLauncherInstallationTypes;

#define PROTON_PLUS_MODELS_LAUNCHER_TYPE_INSTALLATION_TYPES (proton_plus_models_launcher_installation_types_get_type ())
typedef enum  {
	PROTON_PLUS_MODELS_BASE_RELEASE_STATE_NOT_INSTALLED,
	PROTON_PLUS_MODELS_BASE_RELEASE_STATE_UPDATE_AVAILABLE,
	PROTON_PLUS_MODELS_BASE_RELEASE_STATE_UP_TO_DATE,
	PROTON_PLUS_MODELS_BASE_RELEASE_STATE_BUSY_INSTALLING,
	PROTON_PLUS_MODELS_BASE_RELEASE_STATE_BUSY_REMOVING,
	PROTON_PLUS_MODELS_BASE_RELEASE_STATE_BUSY_UPDATING
} ProtonPlusModelsBaseReleaseState;

#define PROTON_PLUS_MODELS_BASE_RELEASE_TYPE_STATE (proton_plus_models_base_release_state_get_type ())
typedef enum  {
	PROTON_PLUS_MODELS_BASE_RELEASE_STEP_NOTHING,
	PROTON_PLUS_MODELS_BASE_RELEASE_STEP_DOWNLOADING,
	PROTON_PLUS_MODELS_BASE_RELEASE_STEP_EXTRACTING,
	PROTON_PLUS_MODELS_BASE_RELEASE_STEP_MOVING,
	PROTON_PLUS_MODELS_BASE_RELEASE_STEP_REMOVING
} ProtonPlusModelsBaseReleaseStep;

#define PROTON_PLUS_MODELS_BASE_RELEASE_TYPE_STEP (proton_plus_models_base_release_step_get_type ())
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _Block8Data Block8Data;

struct _ProtonPlusWidgetsDownloadRow {
	AdwActionRow parent_instance;
	ProtonPlusWidgetsDownloadRowPrivate * priv;
};

struct _ProtonPlusWidgetsDownloadRowClass {
	AdwActionRowClass parent_class;
};

struct _ProtonPlusWidgetsDownloadRowPrivate {
	ProtonPlusModelsBaseRelease* _release;
	GtkProgressBar* progress_bar;
	GtkButton* cancel_button;
	GtkBox* box;
	guint pulse_id;
};

struct _Block7Data {
	int _ref_count_;
	ProtonPlusWidgetsDownloadRow* self;
	ProtonPlusModelsBaseRelease* release;
};

struct _ProtonPlusModelsLauncher {
	GObject parent_instance;
	ProtonPlusModelsLauncherPrivate * priv;
	gchar* title;
	gchar* icon_path;
	gchar* directory;
	gboolean installed;
	gboolean has_library_support;
	GList* games;
	GeeArrayList* compatibility_tools;
	ProtonPlusModelsGroup** groups;
	gint groups_length1;
	ProtonPlusModelsLauncherInstallationTypes installation_type;
};

struct _ProtonPlusModelsLauncherClass {
	GObjectClass parent_class;
	void (*load_game_library) (ProtonPlusModelsLauncher* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	gboolean (*load_game_library_finish) (ProtonPlusModelsLauncher* self, GAsyncResult* _res_);
	gint (*get_compatibility_tool_usage_count) (ProtonPlusModelsLauncher* self, const gchar* compatibility_tool_name);
};

struct _Block8Data {
	int _ref_count_;
	ProtonPlusWidgetsDownloadRow* self;
	GtkButton* copy_button;
};

static gint ProtonPlusWidgetsDownloadRow_private_offset;
static gpointer proton_plus_widgets_download_row_parent_class = NULL;

VALA_EXTERN GType proton_plus_widgets_download_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusWidgetsDownloadRow, g_object_unref)
VALA_EXTERN GType proton_plus_models_base_release_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusModelsBaseRelease, g_object_unref)
VALA_EXTERN ProtonPlusWidgetsDownloadRow* proton_plus_widgets_download_row_new (ProtonPlusModelsBaseRelease* release);
VALA_EXTERN ProtonPlusWidgetsDownloadRow* proton_plus_widgets_download_row_construct (GType object_type,
                                                                          ProtonPlusModelsBaseRelease* release);
static Block7Data* block7_data_ref (Block7Data* _data7_);
static void block7_data_unref (void * _userdata_);
static void proton_plus_widgets_download_row_set_release (ProtonPlusWidgetsDownloadRow* self,
                                                   ProtonPlusModelsBaseRelease* value);
VALA_EXTERN const gchar* proton_plus_models_base_release_get_displayed_title (ProtonPlusModelsBaseRelease* self);
VALA_EXTERN const gchar* proton_plus_models_base_release_get_title (ProtonPlusModelsBaseRelease* self);
VALA_EXTERN GType proton_plus_models_runner_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusModelsRunner, g_object_unref)
VALA_EXTERN ProtonPlusModelsRunner* proton_plus_models_base_release_get_runner (ProtonPlusModelsBaseRelease* self);
VALA_EXTERN GType proton_plus_models_group_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusModelsGroup, g_object_unref)
VALA_EXTERN ProtonPlusModelsGroup* proton_plus_models_runner_get_group (ProtonPlusModelsRunner* self);
VALA_EXTERN GType proton_plus_models_launcher_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusModelsLauncher, g_object_unref)
VALA_EXTERN ProtonPlusModelsLauncher* proton_plus_models_group_get_launcher (ProtonPlusModelsGroup* self);
VALA_EXTERN GType proton_plus_models_game_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusModelsGame, g_object_unref)
VALA_EXTERN GType proton_plus_models_simple_runner_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusModelsSimpleRunner, g_object_unref)
VALA_EXTERN GType proton_plus_models_launcher_installation_types_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType proton_plus_models_base_release_state_get_type (void) G_GNUC_CONST ;
VALA_EXTERN ProtonPlusModelsBaseReleaseState proton_plus_models_base_release_get_state (ProtonPlusModelsBaseRelease* self);
static void __lambda50_ (Block7Data* _data7_);
VALA_EXTERN void proton_plus_models_base_release_set_canceled (ProtonPlusModelsBaseRelease* self,
                                                   gboolean value);
static void ___lambda50__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);
VALA_EXTERN gboolean proton_plus_models_base_release_get_is_finished (ProtonPlusModelsBaseRelease* self);
VALA_EXTERN void proton_plus_widgets_download_row_set_finished (ProtonPlusWidgetsDownloadRow* self,
                                                    gboolean success);
VALA_EXTERN gboolean proton_plus_models_base_release_get_install_success (ProtonPlusModelsBaseRelease* self);
static void proton_plus_widgets_download_row_update_progress (ProtonPlusWidgetsDownloadRow* self);
static void _proton_plus_widgets_download_row_update_progress_g_object_notify (GObject* _sender,
                                                                        GParamSpec* pspec,
                                                                        gpointer self);
static void proton_plus_widgets_download_row_update_stats (ProtonPlusWidgetsDownloadRow* self);
static void _proton_plus_widgets_download_row_update_stats_g_object_notify (GObject* _sender,
                                                                     GParamSpec* pspec,
                                                                     gpointer self);
static void proton_plus_widgets_download_row_update_step (ProtonPlusWidgetsDownloadRow* self);
static void _proton_plus_widgets_download_row_update_step_g_object_notify (GObject* _sender,
                                                                    GParamSpec* pspec,
                                                                    gpointer self);
static gboolean ___lambda53_ (Block7Data* _data7_);
VALA_EXTERN GType proton_plus_models_base_release_step_get_type (void) G_GNUC_CONST ;
VALA_EXTERN ProtonPlusModelsBaseReleaseStep proton_plus_models_base_release_get_step (ProtonPlusModelsBaseRelease* self);
VALA_EXTERN gboolean proton_plus_models_base_release_get_is_percent (ProtonPlusModelsBaseRelease* self);
static gboolean ____lambda53__gsource_func (gpointer self);
static void __lambda54_ (Block7Data* _data7_);
static void ___lambda54__gtk_widget_destroy (GtkWidget* _sender,
                                      gpointer self);
VALA_EXTERN ProtonPlusModelsBaseRelease* proton_plus_widgets_download_row_get_release (ProtonPlusWidgetsDownloadRow* self);
VALA_EXTERN const gchar* proton_plus_models_base_release_get_progress (ProtonPlusModelsBaseRelease* self);
VALA_EXTERN gdouble proton_plus_models_base_release_get_speed_kbps (ProtonPlusModelsBaseRelease* self);
VALA_EXTERN gdouble* proton_plus_models_base_release_get_seconds_remaining (ProtonPlusModelsBaseRelease* self);
VALA_EXTERN gboolean proton_plus_models_base_release_get_canceled (ProtonPlusModelsBaseRelease* self);
static Block8Data* block8_data_ref (Block8Data* _data8_);
static void block8_data_unref (void * _userdata_);
static void ____lambda51_ (Block8Data* _data8_);
VALA_EXTERN const gchar* proton_plus_models_base_release_get_error_message (ProtonPlusModelsBaseRelease* self);
static void _____lambda51__gtk_button_clicked (GtkButton* _sender,
                                        gpointer self);
static void ____lambda52_ (ProtonPlusWidgetsDownloadRow* self);
VALA_EXTERN void proton_plus_utils_system_open_uri (const gchar* uri);
static void _____lambda52__gtk_button_clicked (GtkButton* _sender,
                                        gpointer self);
static void proton_plus_widgets_download_row_finalize (GObject * obj);
static GType proton_plus_widgets_download_row_get_type_once (void);
static void _vala_proton_plus_widgets_download_row_get_property (GObject * object,
                                                          guint property_id,
                                                          GValue * value,
                                                          GParamSpec * pspec);
static void _vala_proton_plus_widgets_download_row_set_property (GObject * object,
                                                          guint property_id,
                                                          const GValue * value,
                                                          GParamSpec * pspec);

static inline gpointer
proton_plus_widgets_download_row_get_instance_private (ProtonPlusWidgetsDownloadRow* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusWidgetsDownloadRow_private_offset);
}

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

static Block7Data*
block7_data_ref (Block7Data* _data7_)
{
	g_atomic_int_inc (&_data7_->_ref_count_);
	return _data7_;
}

static void
block7_data_unref (void * _userdata_)
{
	Block7Data* _data7_;
	_data7_ = (Block7Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data7_->_ref_count_)) {
		ProtonPlusWidgetsDownloadRow* self;
		self = _data7_->self;
		_g_object_unref0 (_data7_->release);
		_g_object_unref0 (self);
		g_slice_free (Block7Data, _data7_);
	}
}

static void
__lambda50_ (Block7Data* _data7_)
{
	ProtonPlusWidgetsDownloadRow* self;
	self = _data7_->self;
	proton_plus_models_base_release_set_canceled (_data7_->release, TRUE);
}

static void
___lambda50__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
	__lambda50_ (self);
}

static void
_proton_plus_widgets_download_row_update_progress_g_object_notify (GObject* _sender,
                                                                   GParamSpec* pspec,
                                                                   gpointer self)
{
	proton_plus_widgets_download_row_update_progress ((ProtonPlusWidgetsDownloadRow*) self);
}

static void
_proton_plus_widgets_download_row_update_stats_g_object_notify (GObject* _sender,
                                                                GParamSpec* pspec,
                                                                gpointer self)
{
	proton_plus_widgets_download_row_update_stats ((ProtonPlusWidgetsDownloadRow*) self);
}

static void
_proton_plus_widgets_download_row_update_step_g_object_notify (GObject* _sender,
                                                               GParamSpec* pspec,
                                                               gpointer self)
{
	proton_plus_widgets_download_row_update_step ((ProtonPlusWidgetsDownloadRow*) self);
}

static gboolean
___lambda53_ (Block7Data* _data7_)
{
	ProtonPlusWidgetsDownloadRow* self;
	gboolean _tmp0_ = FALSE;
	ProtonPlusModelsBaseReleaseStep _tmp1_;
	ProtonPlusModelsBaseReleaseStep _tmp2_;
	gboolean result;
	self = _data7_->self;
	_tmp1_ = proton_plus_models_base_release_get_step (_data7_->release);
	_tmp2_ = _tmp1_;
	if (_tmp2_ != PROTON_PLUS_MODELS_BASE_RELEASE_STEP_DOWNLOADING) {
		_tmp0_ = TRUE;
	} else {
		gboolean _tmp3_;
		gboolean _tmp4_;
		_tmp3_ = proton_plus_models_base_release_get_is_percent (_data7_->release);
		_tmp4_ = _tmp3_;
		_tmp0_ = !_tmp4_;
	}
	if (_tmp0_) {
		GtkProgressBar* _tmp5_;
		_tmp5_ = self->priv->progress_bar;
		gtk_progress_bar_pulse (_tmp5_);
	}
	result = TRUE;
	return result;
}

static gboolean
____lambda53__gsource_func (gpointer self)
{
	gboolean result;
	result = ___lambda53_ (self);
	return result;
}

static void
__lambda54_ (Block7Data* _data7_)
{
	ProtonPlusWidgetsDownloadRow* self;
	GError* _inner_error0_ = NULL;
	self = _data7_->self;
	if (self->priv->pulse_id > ((guint) 0)) {
		g_source_remove (self->priv->pulse_id);
		self->priv->pulse_id = (guint) 0;
	}
	{
		guint _tmp0_;
		GQuark _tmp1_;
		guint _tmp2_;
		GQuark _tmp3_;
		guint _tmp4_;
		GQuark _tmp5_;
		guint _tmp6_;
		GQuark _tmp7_;
		g_signal_parse_name ("notify::progress", G_TYPE_OBJECT, &_tmp0_, &_tmp1_, TRUE);
		g_signal_handlers_disconnect_matched ((GObject*) _data7_->release, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DETAIL | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp0_, _tmp1_, NULL, (GCallback) _proton_plus_widgets_download_row_update_progress_g_object_notify, self);
		g_signal_parse_name ("notify::speed-kbps", G_TYPE_OBJECT, &_tmp2_, &_tmp3_, TRUE);
		g_signal_handlers_disconnect_matched ((GObject*) _data7_->release, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DETAIL | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp2_, _tmp3_, NULL, (GCallback) _proton_plus_widgets_download_row_update_stats_g_object_notify, self);
		g_signal_parse_name ("notify::seconds-remaining", G_TYPE_OBJECT, &_tmp4_, &_tmp5_, TRUE);
		g_signal_handlers_disconnect_matched ((GObject*) _data7_->release, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DETAIL | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp4_, _tmp5_, NULL, (GCallback) _proton_plus_widgets_download_row_update_stats_g_object_notify, self);
		g_signal_parse_name ("notify::step", G_TYPE_OBJECT, &_tmp6_, &_tmp7_, TRUE);
		g_signal_handlers_disconnect_matched ((GObject*) _data7_->release, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DETAIL | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp6_, _tmp7_, NULL, (GCallback) _proton_plus_widgets_download_row_update_step_g_object_notify, self);
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
___lambda54__gtk_widget_destroy (GtkWidget* _sender,
                                 gpointer self)
{
	__lambda54_ (self);
}

ProtonPlusWidgetsDownloadRow*
proton_plus_widgets_download_row_construct (GType object_type,
                                            ProtonPlusModelsBaseRelease* release)
{
	ProtonPlusWidgetsDownloadRow * self = NULL;
	Block7Data* _data7_;
	ProtonPlusModelsBaseRelease* _tmp0_;
	const gchar* _tmp1_ = NULL;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	ProtonPlusModelsRunner* _tmp8_;
	ProtonPlusModelsRunner* _tmp9_;
	ProtonPlusModelsGroup* _tmp10_;
	ProtonPlusModelsGroup* _tmp11_;
	ProtonPlusModelsLauncher* _tmp12_;
	ProtonPlusModelsLauncher* _tmp13_;
	const gchar* _tmp14_;
	GtkImage* _tmp15_;
	GtkImage* _tmp16_;
	GtkProgressBar* _tmp17_;
	GtkProgressBar* _tmp18_;
	GtkProgressBar* _tmp19_;
	GtkProgressBar* _tmp20_;
	GtkButton* _tmp21_;
	GtkButton* _tmp22_;
	GtkButton* _tmp23_;
	GtkButton* _tmp24_;
	GtkButton* _tmp25_;
	GtkButton* _tmp26_;
	ProtonPlusModelsBaseReleaseState _tmp27_;
	ProtonPlusModelsBaseReleaseState _tmp28_;
	GtkButton* _tmp29_;
	GtkBox* _tmp30_;
	GtkBox* _tmp31_;
	GtkProgressBar* _tmp32_;
	GtkBox* _tmp33_;
	GtkButton* _tmp34_;
	GtkBox* _tmp35_;
	gboolean _tmp36_;
	gboolean _tmp37_;
	g_return_val_if_fail (release != NULL, NULL);
	_data7_ = g_slice_new0 (Block7Data);
	_data7_->_ref_count_ = 1;
	_tmp0_ = _g_object_ref0 (release);
	_g_object_unref0 (_data7_->release);
	_data7_->release = _tmp0_;
	self = (ProtonPlusWidgetsDownloadRow*) g_object_new (object_type, NULL);
	_data7_->self = g_object_ref (self);
	proton_plus_widgets_download_row_set_release (self, _data7_->release);
	_tmp2_ = proton_plus_models_base_release_get_displayed_title (_data7_->release);
	_tmp3_ = _tmp2_;
	if (_tmp3_ != NULL) {
		const gchar* _tmp4_;
		const gchar* _tmp5_;
		_tmp4_ = proton_plus_models_base_release_get_displayed_title (_data7_->release);
		_tmp5_ = _tmp4_;
		_tmp1_ = _tmp5_;
	} else {
		const gchar* _tmp6_;
		const gchar* _tmp7_;
		_tmp6_ = proton_plus_models_base_release_get_title (_data7_->release);
		_tmp7_ = _tmp6_;
		_tmp1_ = _tmp7_;
	}
	adw_preferences_row_set_title ((AdwPreferencesRow*) self, _tmp1_);
	_tmp8_ = proton_plus_models_base_release_get_runner (_data7_->release);
	_tmp9_ = _tmp8_;
	_tmp10_ = proton_plus_models_runner_get_group (_tmp9_);
	_tmp11_ = _tmp10_;
	_tmp12_ = proton_plus_models_group_get_launcher (_tmp11_);
	_tmp13_ = _tmp12_;
	_tmp14_ = _tmp13_->icon_path;
	_tmp15_ = (GtkImage*) gtk_image_new_from_resource (_tmp14_);
	g_object_ref_sink (_tmp15_);
	_tmp16_ = _tmp15_;
	adw_action_row_add_prefix ((AdwActionRow*) self, (GtkWidget*) _tmp16_);
	_g_object_unref0 (_tmp16_);
	_tmp17_ = (GtkProgressBar*) gtk_progress_bar_new ();
	g_object_ref_sink (_tmp17_);
	_g_object_unref0 (self->priv->progress_bar);
	self->priv->progress_bar = _tmp17_;
	_tmp18_ = self->priv->progress_bar;
	gtk_progress_bar_set_show_text (_tmp18_, FALSE);
	_tmp19_ = self->priv->progress_bar;
	gtk_widget_set_valign ((GtkWidget*) _tmp19_, GTK_ALIGN_CENTER);
	_tmp20_ = self->priv->progress_bar;
	gtk_widget_set_size_request ((GtkWidget*) _tmp20_, 180, -1);
	_tmp21_ = (GtkButton*) gtk_button_new_from_icon_name ("circle-xmark-symbolic");
	g_object_ref_sink (_tmp21_);
	_g_object_unref0 (self->priv->cancel_button);
	self->priv->cancel_button = _tmp21_;
	_tmp22_ = self->priv->cancel_button;
	gtk_widget_add_css_class ((GtkWidget*) _tmp22_, "flat");
	_tmp23_ = self->priv->cancel_button;
	gtk_widget_add_css_class ((GtkWidget*) _tmp23_, "circular");
	_tmp24_ = self->priv->cancel_button;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp24_, _ ("Cancel"));
	_tmp25_ = self->priv->cancel_button;
	gtk_widget_set_valign ((GtkWidget*) _tmp25_, GTK_ALIGN_CENTER);
	_tmp26_ = self->priv->cancel_button;
	_tmp27_ = proton_plus_models_base_release_get_state (_data7_->release);
	_tmp28_ = _tmp27_;
	gtk_widget_set_visible ((GtkWidget*) _tmp26_, _tmp28_ != PROTON_PLUS_MODELS_BASE_RELEASE_STATE_BUSY_UPDATING);
	_tmp29_ = self->priv->cancel_button;
	g_signal_connect_data (_tmp29_, "clicked", (GCallback) ___lambda50__gtk_button_clicked, block7_data_ref (_data7_), (GClosureNotify) block7_data_unref, 0);
	_tmp30_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
	g_object_ref_sink (_tmp30_);
	_g_object_unref0 (self->priv->box);
	self->priv->box = _tmp30_;
	_tmp31_ = self->priv->box;
	_tmp32_ = self->priv->progress_bar;
	gtk_box_append (_tmp31_, (GtkWidget*) _tmp32_);
	_tmp33_ = self->priv->box;
	_tmp34_ = self->priv->cancel_button;
	gtk_box_append (_tmp33_, (GtkWidget*) _tmp34_);
	_tmp35_ = self->priv->box;
	adw_action_row_add_suffix ((AdwActionRow*) self, (GtkWidget*) _tmp35_);
	_tmp36_ = proton_plus_models_base_release_get_is_finished (_data7_->release);
	_tmp37_ = _tmp36_;
	if (_tmp37_) {
		gboolean _tmp38_;
		gboolean _tmp39_;
		_tmp38_ = proton_plus_models_base_release_get_install_success (_data7_->release);
		_tmp39_ = _tmp38_;
		proton_plus_widgets_download_row_set_finished (self, _tmp39_);
	} else {
		g_signal_connect_object ((GObject*) _data7_->release, "notify::progress", (GCallback) _proton_plus_widgets_download_row_update_progress_g_object_notify, self, 0);
		g_signal_connect_object ((GObject*) _data7_->release, "notify::speed-kbps", (GCallback) _proton_plus_widgets_download_row_update_stats_g_object_notify, self, 0);
		g_signal_connect_object ((GObject*) _data7_->release, "notify::seconds-remaining", (GCallback) _proton_plus_widgets_download_row_update_stats_g_object_notify, self, 0);
		g_signal_connect_object ((GObject*) _data7_->release, "notify::step", (GCallback) _proton_plus_widgets_download_row_update_step_g_object_notify, self, 0);
		proton_plus_widgets_download_row_update_progress (self);
		proton_plus_widgets_download_row_update_step (self);
		self->priv->pulse_id = g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 25, ____lambda53__gsource_func, block7_data_ref (_data7_), block7_data_unref);
	}
	g_signal_connect_data ((GtkWidget*) self, "destroy", (GCallback) ___lambda54__gtk_widget_destroy, block7_data_ref (_data7_), (GClosureNotify) block7_data_unref, 0);
	block7_data_unref (_data7_);
	_data7_ = NULL;
	return self;
}

ProtonPlusWidgetsDownloadRow*
proton_plus_widgets_download_row_new (ProtonPlusModelsBaseRelease* release)
{
	return proton_plus_widgets_download_row_construct (PROTON_PLUS_WIDGETS_TYPE_DOWNLOAD_ROW, release);
}

static glong
string_strnlen (gchar* str,
                glong maxlen)
{
	gchar* end = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	glong result;
	_tmp0_ = memchr (str, 0, (gsize) maxlen);
	end = _tmp0_;
	_tmp1_ = end;
	if (_tmp1_ == NULL) {
		result = maxlen;
		return result;
	} else {
		gchar* _tmp2_;
		_tmp2_ = end;
		result = (glong) (_tmp2_ - str);
		return result;
	}
}

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

static gdouble
double_parse (const gchar* str)
{
	gdouble result;
	g_return_val_if_fail (str != NULL, -1.0);
	result = g_ascii_strtod (str, NULL);
	return result;
}

static void
proton_plus_widgets_download_row_update_progress (ProtonPlusWidgetsDownloadRow* self)
{
	gboolean _tmp0_ = FALSE;
	ProtonPlusModelsBaseRelease* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	g_return_if_fail (self != NULL);
	proton_plus_widgets_download_row_update_stats (self);
	_tmp1_ = self->priv->_release;
	_tmp2_ = proton_plus_models_base_release_get_progress (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_ != NULL) {
		ProtonPlusModelsBaseRelease* _tmp4_;
		gboolean _tmp5_;
		gboolean _tmp6_;
		_tmp4_ = self->priv->_release;
		_tmp5_ = proton_plus_models_base_release_get_is_percent (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp0_ = _tmp6_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		gchar* progress = NULL;
		ProtonPlusModelsBaseRelease* _tmp7_;
		const gchar* _tmp8_;
		const gchar* _tmp9_;
		gchar* _tmp10_;
		const gchar* _tmp11_;
		GtkProgressBar* _tmp17_;
		const gchar* _tmp18_;
		_tmp7_ = self->priv->_release;
		_tmp8_ = proton_plus_models_base_release_get_progress (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp10_ = g_strdup (_tmp9_);
		progress = _tmp10_;
		_tmp11_ = progress;
		if (g_str_has_suffix (_tmp11_, "%")) {
			const gchar* _tmp12_;
			const gchar* _tmp13_;
			gint _tmp14_;
			gint _tmp15_;
			gchar* _tmp16_;
			_tmp12_ = progress;
			_tmp13_ = progress;
			_tmp14_ = strlen (_tmp13_);
			_tmp15_ = _tmp14_;
			_tmp16_ = string_substring (_tmp12_, (glong) 0, (glong) (_tmp15_ - 1));
			_g_free0 (progress);
			progress = _tmp16_;
		}
		_tmp17_ = self->priv->progress_bar;
		_tmp18_ = progress;
		gtk_progress_bar_set_fraction (_tmp17_, double_parse (_tmp18_) / 100.0);
		_g_free0 (progress);
	} else {
		GtkProgressBar* _tmp19_;
		_tmp19_ = self->priv->progress_bar;
		gtk_progress_bar_set_fraction (_tmp19_, (gdouble) 0);
	}
}

static void
proton_plus_widgets_download_row_update_stats (ProtonPlusWidgetsDownloadRow* self)
{
	GtkButton* _tmp0_;
	ProtonPlusModelsBaseRelease* _tmp1_;
	ProtonPlusModelsBaseReleaseState _tmp2_;
	ProtonPlusModelsBaseReleaseState _tmp3_;
	gchar* _tmp4_ = NULL;
	ProtonPlusModelsBaseRelease* _tmp5_;
	gdouble _tmp6_;
	gdouble _tmp7_;
	gchar* download_speed = NULL;
	gchar* _tmp16_;
	const gchar* _tmp17_ = NULL;
	ProtonPlusModelsBaseRelease* _tmp18_;
	ProtonPlusModelsBaseReleaseState _tmp19_;
	ProtonPlusModelsBaseReleaseState _tmp20_;
	gchar* state_text = NULL;
	gchar* _tmp21_;
	gchar* progress_text = NULL;
	const gchar* _tmp22_;
	const gchar* _tmp23_;
	gchar* _tmp24_;
	ProtonPlusModelsBaseRelease* _tmp25_;
	gdouble* _tmp26_;
	gdouble* _tmp27_;
	const gchar* _tmp49_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->cancel_button;
	_tmp1_ = self->priv->_release;
	_tmp2_ = proton_plus_models_base_release_get_state (_tmp1_);
	_tmp3_ = _tmp2_;
	gtk_widget_set_visible ((GtkWidget*) _tmp0_, _tmp3_ != PROTON_PLUS_MODELS_BASE_RELEASE_STATE_BUSY_UPDATING);
	_tmp5_ = self->priv->_release;
	_tmp6_ = proton_plus_models_base_release_get_speed_kbps (_tmp5_);
	_tmp7_ = _tmp6_;
	if (_tmp7_ >= ((gdouble) 1000)) {
		ProtonPlusModelsBaseRelease* _tmp8_;
		gdouble _tmp9_;
		gdouble _tmp10_;
		gchar* _tmp11_;
		_tmp8_ = self->priv->_release;
		_tmp9_ = proton_plus_models_base_release_get_speed_kbps (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp11_ = g_strdup_printf ("%.2f MB/s", _tmp10_ / 1024.0);
		_g_free0 (_tmp4_);
		_tmp4_ = _tmp11_;
	} else {
		ProtonPlusModelsBaseRelease* _tmp12_;
		gdouble _tmp13_;
		gdouble _tmp14_;
		gchar* _tmp15_;
		_tmp12_ = self->priv->_release;
		_tmp13_ = proton_plus_models_base_release_get_speed_kbps (_tmp12_);
		_tmp14_ = _tmp13_;
		_tmp15_ = g_strdup_printf ("%.2f KB/s", _tmp14_);
		_g_free0 (_tmp4_);
		_tmp4_ = _tmp15_;
	}
	_tmp16_ = _tmp4_;
	_tmp4_ = NULL;
	download_speed = _tmp16_;
	_tmp18_ = self->priv->_release;
	_tmp19_ = proton_plus_models_base_release_get_state (_tmp18_);
	_tmp20_ = _tmp19_;
	if (_tmp20_ == PROTON_PLUS_MODELS_BASE_RELEASE_STATE_BUSY_UPDATING) {
		_tmp17_ = _ ("Updating");
	} else {
		_tmp17_ = _ ("Downloading");
	}
	_tmp21_ = g_strdup (_tmp17_);
	state_text = _tmp21_;
	_tmp22_ = state_text;
	_tmp23_ = download_speed;
	_tmp24_ = g_strdup_printf ("%s - %s", _tmp22_, _tmp23_);
	progress_text = _tmp24_;
	_tmp25_ = self->priv->_release;
	_tmp26_ = proton_plus_models_base_release_get_seconds_remaining (_tmp25_);
	_tmp27_ = _tmp26_;
	if (_tmp27_ != NULL) {
		gint s = 0;
		ProtonPlusModelsBaseRelease* _tmp28_;
		gdouble* _tmp29_;
		gdouble* _tmp30_;
		gint m = 0;
		ProtonPlusModelsBaseRelease* _tmp31_;
		gdouble* _tmp32_;
		gdouble* _tmp33_;
		gint h = 0;
		ProtonPlusModelsBaseRelease* _tmp34_;
		gdouble* _tmp35_;
		gdouble* _tmp36_;
		_tmp28_ = self->priv->_release;
		_tmp29_ = proton_plus_models_base_release_get_seconds_remaining (_tmp28_);
		_tmp30_ = _tmp29_;
		s = ((gint) (*_tmp30_)) % 60;
		_tmp31_ = self->priv->_release;
		_tmp32_ = proton_plus_models_base_release_get_seconds_remaining (_tmp31_);
		_tmp33_ = _tmp32_;
		m = (((gint) (*_tmp33_)) / 60) % 60;
		_tmp34_ = self->priv->_release;
		_tmp35_ = proton_plus_models_base_release_get_seconds_remaining (_tmp34_);
		_tmp36_ = _tmp35_;
		h = ((gint) (*_tmp36_)) / 3600;
		if (h > 0) {
			const gchar* _tmp37_;
			gchar* _tmp38_;
			gchar* _tmp39_;
			gchar* _tmp40_;
			_tmp37_ = progress_text;
			_tmp38_ = g_strdup_printf (" (%02d:%02d:%02d)", h, m, s);
			_tmp39_ = _tmp38_;
			_tmp40_ = g_strconcat (_tmp37_, _tmp39_, NULL);
			_g_free0 (progress_text);
			progress_text = _tmp40_;
			_g_free0 (_tmp39_);
		} else {
			if (m > 0) {
				const gchar* _tmp41_;
				gchar* _tmp42_;
				gchar* _tmp43_;
				gchar* _tmp44_;
				_tmp41_ = progress_text;
				_tmp42_ = g_strdup_printf (" (%02d:%02d)", m, s);
				_tmp43_ = _tmp42_;
				_tmp44_ = g_strconcat (_tmp41_, _tmp43_, NULL);
				_g_free0 (progress_text);
				progress_text = _tmp44_;
				_g_free0 (_tmp43_);
			} else {
				const gchar* _tmp45_;
				gchar* _tmp46_;
				gchar* _tmp47_;
				gchar* _tmp48_;
				_tmp45_ = progress_text;
				_tmp46_ = g_strdup_printf (" (%ds)", s);
				_tmp47_ = _tmp46_;
				_tmp48_ = g_strconcat (_tmp45_, _tmp47_, NULL);
				_g_free0 (progress_text);
				progress_text = _tmp48_;
				_g_free0 (_tmp47_);
			}
		}
	}
	_tmp49_ = progress_text;
	adw_action_row_set_subtitle ((AdwActionRow*) self, _tmp49_);
	_g_free0 (progress_text);
	_g_free0 (state_text);
	_g_free0 (download_speed);
	_g_free0 (_tmp4_);
}

static void
proton_plus_widgets_download_row_update_step (ProtonPlusWidgetsDownloadRow* self)
{
	ProtonPlusModelsBaseRelease* _tmp0_;
	ProtonPlusModelsBaseReleaseStep _tmp1_;
	ProtonPlusModelsBaseReleaseStep _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_release;
	_tmp1_ = proton_plus_models_base_release_get_step (_tmp0_);
	_tmp2_ = _tmp1_;
	switch (_tmp2_) {
		case PROTON_PLUS_MODELS_BASE_RELEASE_STEP_DOWNLOADING:
		{
			proton_plus_widgets_download_row_update_progress (self);
			break;
		}
		case PROTON_PLUS_MODELS_BASE_RELEASE_STEP_EXTRACTING:
		{
			adw_action_row_set_subtitle ((AdwActionRow*) self, _ ("Extracting"));
			break;
		}
		case PROTON_PLUS_MODELS_BASE_RELEASE_STEP_MOVING:
		{
			adw_action_row_set_subtitle ((AdwActionRow*) self, _ ("Moving"));
			break;
		}
		default:
		{
			adw_action_row_set_subtitle ((AdwActionRow*) self, "");
			break;
		}
	}
}

static Block8Data*
block8_data_ref (Block8Data* _data8_)
{
	g_atomic_int_inc (&_data8_->_ref_count_);
	return _data8_;
}

static void
block8_data_unref (void * _userdata_)
{
	Block8Data* _data8_;
	_data8_ = (Block8Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data8_->_ref_count_)) {
		ProtonPlusWidgetsDownloadRow* self;
		self = _data8_->self;
		_g_object_unref0 (_data8_->copy_button);
		_g_object_unref0 (self);
		g_slice_free (Block8Data, _data8_);
	}
}

static void
____lambda51_ (Block8Data* _data8_)
{
	ProtonPlusWidgetsDownloadRow* self;
	GdkClipboard* clipboard = NULL;
	GtkButton* _tmp0_;
	GdkClipboard* _tmp1_;
	GdkClipboard* _tmp2_;
	const gchar* _tmp3_ = NULL;
	ProtonPlusModelsBaseRelease* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	GdkClipboard* _tmp7_;
	self = _data8_->self;
	_tmp0_ = _data8_->copy_button;
	_tmp1_ = gtk_widget_get_clipboard ((GtkWidget*) _tmp0_);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	clipboard = _tmp2_;
	_tmp4_ = self->priv->_release;
	_tmp5_ = proton_plus_models_base_release_get_error_message (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp3_ = _tmp6_;
	if (_tmp3_ == NULL) {
		_tmp3_ = _ ("Unknown error");
	}
	_tmp7_ = clipboard;
	gdk_clipboard_set_text (_tmp7_, _tmp3_);
	_g_object_unref0 (clipboard);
}

static void
_____lambda51__gtk_button_clicked (GtkButton* _sender,
                                   gpointer self)
{
	____lambda51_ (self);
}

static void
____lambda52_ (ProtonPlusWidgetsDownloadRow* self)
{
	proton_plus_utils_system_open_uri ("https://github.com/Vysp3r/ProtonPlus/issues/new?template=bug_report.md");
}

static void
_____lambda52__gtk_button_clicked (GtkButton* _sender,
                                   gpointer self)
{
	____lambda52_ ((ProtonPlusWidgetsDownloadRow*) self);
}

void
proton_plus_widgets_download_row_set_finished (ProtonPlusWidgetsDownloadRow* self,
                                               gboolean success)
{
	GtkProgressBar* _tmp0_;
	GtkButton* _tmp1_;
	GtkWidget* child = NULL;
	GtkBox* _tmp2_;
	GtkWidget* _tmp3_;
	GtkWidget* _tmp4_;
	ProtonPlusModelsBaseRelease* _tmp18_;
	gboolean _tmp19_;
	gboolean _tmp20_;
	g_return_if_fail (self != NULL);
	if (self->priv->pulse_id > ((guint) 0)) {
		g_source_remove (self->priv->pulse_id);
		self->priv->pulse_id = (guint) 0;
	}
	_tmp0_ = self->priv->progress_bar;
	gtk_widget_set_visible ((GtkWidget*) _tmp0_, FALSE);
	_tmp1_ = self->priv->cancel_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp1_, FALSE);
	_tmp2_ = self->priv->box;
	_tmp3_ = gtk_widget_get_first_child ((GtkWidget*) _tmp2_);
	_tmp4_ = _g_object_ref0 (_tmp3_);
	child = _tmp4_;
	while (TRUE) {
		GtkWidget* _tmp5_;
		GtkWidget* next = NULL;
		GtkWidget* _tmp6_;
		GtkWidget* _tmp7_;
		GtkWidget* _tmp8_;
		gboolean _tmp9_ = FALSE;
		GtkWidget* _tmp10_;
		GtkProgressBar* _tmp11_;
		GtkWidget* _tmp16_;
		GtkWidget* _tmp17_;
		_tmp5_ = child;
		if (!(_tmp5_ != NULL)) {
			break;
		}
		_tmp6_ = child;
		_tmp7_ = gtk_widget_get_next_sibling (_tmp6_);
		_tmp8_ = _g_object_ref0 (_tmp7_);
		next = _tmp8_;
		_tmp10_ = child;
		_tmp11_ = self->priv->progress_bar;
		if (_tmp10_ != G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, gtk_widget_get_type (), GtkWidget)) {
			GtkWidget* _tmp12_;
			GtkButton* _tmp13_;
			_tmp12_ = child;
			_tmp13_ = self->priv->cancel_button;
			_tmp9_ = _tmp12_ != G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, gtk_widget_get_type (), GtkWidget);
		} else {
			_tmp9_ = FALSE;
		}
		if (_tmp9_) {
			GtkBox* _tmp14_;
			GtkWidget* _tmp15_;
			_tmp14_ = self->priv->box;
			_tmp15_ = child;
			gtk_box_remove (_tmp14_, _tmp15_);
		}
		_tmp16_ = next;
		_tmp17_ = _g_object_ref0 (_tmp16_);
		_g_object_unref0 (child);
		child = _tmp17_;
		_g_object_unref0 (next);
	}
	_tmp18_ = self->priv->_release;
	_tmp19_ = proton_plus_models_base_release_get_canceled (_tmp18_);
	_tmp20_ = _tmp19_;
	if (_tmp20_) {
		adw_action_row_set_subtitle ((AdwActionRow*) self, _ ("Canceled"));
	} else {
		if (success) {
			adw_action_row_set_subtitle ((AdwActionRow*) self, _ ("Success"));
		} else {
			Block8Data* _data8_;
			GtkButton* _tmp21_;
			GtkButton* _tmp22_;
			GtkButton* _tmp23_;
			GtkButton* _tmp24_;
			GtkButton* _tmp25_;
			GtkButton* _tmp26_;
			GtkBox* _tmp27_;
			GtkButton* _tmp28_;
			GtkButton* report_button = NULL;
			GtkButton* _tmp29_;
			GtkButton* _tmp30_;
			GtkButton* _tmp31_;
			GtkButton* _tmp32_;
			GtkButton* _tmp33_;
			GtkButton* _tmp34_;
			GtkBox* _tmp35_;
			GtkButton* _tmp36_;
			_data8_ = g_slice_new0 (Block8Data);
			_data8_->_ref_count_ = 1;
			_data8_->self = g_object_ref (self);
			adw_action_row_set_subtitle ((AdwActionRow*) self, _ ("Error"));
			_tmp21_ = (GtkButton*) gtk_button_new_from_icon_name ("copy-symbolic");
			g_object_ref_sink (_tmp21_);
			_data8_->copy_button = _tmp21_;
			_tmp22_ = _data8_->copy_button;
			gtk_widget_set_valign ((GtkWidget*) _tmp22_, GTK_ALIGN_CENTER);
			_tmp23_ = _data8_->copy_button;
			gtk_widget_add_css_class ((GtkWidget*) _tmp23_, "flat");
			_tmp24_ = _data8_->copy_button;
			gtk_widget_add_css_class ((GtkWidget*) _tmp24_, "circular");
			_tmp25_ = _data8_->copy_button;
			gtk_widget_set_tooltip_text ((GtkWidget*) _tmp25_, _ ("Copy Error Message"));
			_tmp26_ = _data8_->copy_button;
			g_signal_connect_data (_tmp26_, "clicked", (GCallback) _____lambda51__gtk_button_clicked, block8_data_ref (_data8_), (GClosureNotify) block8_data_unref, 0);
			_tmp27_ = self->priv->box;
			_tmp28_ = _data8_->copy_button;
			gtk_box_append (_tmp27_, (GtkWidget*) _tmp28_);
			_tmp29_ = (GtkButton*) gtk_button_new_from_icon_name ("github-symbolic");
			g_object_ref_sink (_tmp29_);
			report_button = _tmp29_;
			_tmp30_ = report_button;
			gtk_widget_set_valign ((GtkWidget*) _tmp30_, GTK_ALIGN_CENTER);
			_tmp31_ = report_button;
			gtk_widget_add_css_class ((GtkWidget*) _tmp31_, "flat");
			_tmp32_ = report_button;
			gtk_widget_add_css_class ((GtkWidget*) _tmp32_, "circular");
			_tmp33_ = report_button;
			gtk_widget_set_tooltip_text ((GtkWidget*) _tmp33_, _ ("Report Issue"));
			_tmp34_ = report_button;
			g_signal_connect_object (_tmp34_, "clicked", (GCallback) _____lambda52__gtk_button_clicked, self, 0);
			_tmp35_ = self->priv->box;
			_tmp36_ = report_button;
			gtk_box_append (_tmp35_, (GtkWidget*) _tmp36_);
			_g_object_unref0 (report_button);
			block8_data_unref (_data8_);
			_data8_ = NULL;
		}
	}
	_g_object_unref0 (child);
}

ProtonPlusModelsBaseRelease*
proton_plus_widgets_download_row_get_release (ProtonPlusWidgetsDownloadRow* self)
{
	ProtonPlusModelsBaseRelease* result;
	ProtonPlusModelsBaseRelease* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_release;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_download_row_set_release (ProtonPlusWidgetsDownloadRow* self,
                                              ProtonPlusModelsBaseRelease* value)
{
	ProtonPlusModelsBaseRelease* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_widgets_download_row_get_release (self);
	if (old_value != value) {
		ProtonPlusModelsBaseRelease* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_release);
		self->priv->_release = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_widgets_download_row_properties[PROTON_PLUS_WIDGETS_DOWNLOAD_ROW_RELEASE_PROPERTY]);
	}
}

static void
proton_plus_widgets_download_row_class_init (ProtonPlusWidgetsDownloadRowClass * klass,
                                             gpointer klass_data)
{
	proton_plus_widgets_download_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusWidgetsDownloadRow_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_widgets_download_row_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_widgets_download_row_set_property;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_widgets_download_row_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_DOWNLOAD_ROW_RELEASE_PROPERTY, proton_plus_widgets_download_row_properties[PROTON_PLUS_WIDGETS_DOWNLOAD_ROW_RELEASE_PROPERTY] = g_param_spec_object ("release", "release", "release", PROTON_PLUS_MODELS_TYPE_BASE_RELEASE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
proton_plus_widgets_download_row_instance_init (ProtonPlusWidgetsDownloadRow * self,
                                                gpointer klass)
{
	self->priv = proton_plus_widgets_download_row_get_instance_private (self);
}

static void
proton_plus_widgets_download_row_finalize (GObject * obj)
{
	ProtonPlusWidgetsDownloadRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_TYPE_DOWNLOAD_ROW, ProtonPlusWidgetsDownloadRow);
	_g_object_unref0 (self->priv->_release);
	_g_object_unref0 (self->priv->progress_bar);
	_g_object_unref0 (self->priv->cancel_button);
	_g_object_unref0 (self->priv->box);
	G_OBJECT_CLASS (proton_plus_widgets_download_row_parent_class)->finalize (obj);
}

static GType
proton_plus_widgets_download_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusWidgetsDownloadRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_widgets_download_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusWidgetsDownloadRow), 0, (GInstanceInitFunc) proton_plus_widgets_download_row_instance_init, NULL };
	GType proton_plus_widgets_download_row_type_id;
	proton_plus_widgets_download_row_type_id = g_type_register_static (adw_action_row_get_type (), "ProtonPlusWidgetsDownloadRow", &g_define_type_info, 0);
	ProtonPlusWidgetsDownloadRow_private_offset = g_type_add_instance_private (proton_plus_widgets_download_row_type_id, sizeof (ProtonPlusWidgetsDownloadRowPrivate));
	return proton_plus_widgets_download_row_type_id;
}

GType
proton_plus_widgets_download_row_get_type (void)
{
	static volatile gsize proton_plus_widgets_download_row_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_widgets_download_row_type_id__once)) {
		GType proton_plus_widgets_download_row_type_id;
		proton_plus_widgets_download_row_type_id = proton_plus_widgets_download_row_get_type_once ();
		g_once_init_leave (&proton_plus_widgets_download_row_type_id__once, proton_plus_widgets_download_row_type_id);
	}
	return proton_plus_widgets_download_row_type_id__once;
}

static void
_vala_proton_plus_widgets_download_row_get_property (GObject * object,
                                                     guint property_id,
                                                     GValue * value,
                                                     GParamSpec * pspec)
{
	ProtonPlusWidgetsDownloadRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_TYPE_DOWNLOAD_ROW, ProtonPlusWidgetsDownloadRow);
	switch (property_id) {
		case PROTON_PLUS_WIDGETS_DOWNLOAD_ROW_RELEASE_PROPERTY:
		g_value_set_object (value, proton_plus_widgets_download_row_get_release (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_proton_plus_widgets_download_row_set_property (GObject * object,
                                                     guint property_id,
                                                     const GValue * value,
                                                     GParamSpec * pspec)
{
	ProtonPlusWidgetsDownloadRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_TYPE_DOWNLOAD_ROW, ProtonPlusWidgetsDownloadRow);
	switch (property_id) {
		case PROTON_PLUS_WIDGETS_DOWNLOAD_ROW_RELEASE_PROPERTY:
		proton_plus_widgets_download_row_set_release (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

