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

/*
 * SPDX-License-Identifier: GPL-3.0
 * SPDX-FileCopyrightText: 2020-2023 elementary, Inc. (https://elementary.io)
 */

#include <gtk/gtk.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "pantheon-files-core.h"
#include <gio/gio.h>
#include <glib/gi18n-lib.h>
#include <granite.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
#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 FILES_TYPE_APP_MENU (files_app_menu_get_type ())
#define FILES_APP_MENU(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FILES_TYPE_APP_MENU, FilesAppMenu))
#define FILES_APP_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FILES_TYPE_APP_MENU, FilesAppMenuClass))
#define FILES_IS_APP_MENU(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FILES_TYPE_APP_MENU))
#define FILES_IS_APP_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FILES_TYPE_APP_MENU))
#define FILES_APP_MENU_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FILES_TYPE_APP_MENU, FilesAppMenuClass))

typedef struct _FilesAppMenu FilesAppMenu;
typedef struct _FilesAppMenuClass FilesAppMenuClass;
typedef struct _FilesAppMenuPrivate FilesAppMenuPrivate;
enum  {
	FILES_APP_MENU_0_PROPERTY,
	FILES_APP_MENU_NUM_PROPERTIES
};
static GParamSpec* files_app_menu_properties[FILES_APP_MENU_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _Block52Data Block52Data;
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))

struct _FilesAppMenu {
	GtkPopover parent_instance;
	FilesAppMenuPrivate * priv;
};

struct _FilesAppMenuClass {
	GtkPopoverClass parent_class;
};

struct _FilesAppMenuPrivate {
	GtkButton* redo_button;
	GtkButton* undo_button;
	GtkButton* zoom_default_button;
	GtkButton* zoom_in_button;
	GtkButton* zoom_out_button;
	gchar** redo_accels;
	gint redo_accels_length1;
	gint _redo_accels_size_;
	gchar** undo_accels;
	gint undo_accels_length1;
	gint _undo_accels_size_;
	FilesUndoManager* undo_manager;
};

struct _Block52Data {
	int _ref_count_;
	FilesAppMenu* self;
	GtkRadioButton* iso_button;
	GtkRadioButton* locale_button;
	GtkRadioButton* informal_button;
	GtkRadioButton* compact_button;
	GSettings* app_settings;
};

static gint FilesAppMenu_private_offset;
static gpointer files_app_menu_parent_class = NULL;
static GSettings* files_app_menu_column_view_settings;
static GSettings* files_app_menu_column_view_settings = NULL;
static GSettings* files_app_menu_icon_view_settings;
static GSettings* files_app_menu_icon_view_settings = NULL;
static GSettings* files_app_menu_list_view_settings;
static GSettings* files_app_menu_list_view_settings = NULL;
VALA_EXTERN GSettings* files_app_settings;

VALA_EXTERN GType files_app_menu_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FilesAppMenu, g_object_unref)
static void files_app_menu_set_undo_redo_tooltips (FilesAppMenu* self);
static void files_app_menu_on_zoom_setting_changed (FilesAppMenu* self);
VALA_EXTERN FilesAppMenu* files_app_menu_new (void);
VALA_EXTERN FilesAppMenu* files_app_menu_construct (GType object_type);
static GObject * files_app_menu_constructor (GType type,
                                      guint n_construct_properties,
                                      GObjectConstructParam * construct_properties);
static Block52Data* block52_data_ref (Block52Data* _data52_);
static void block52_data_unref (void * _userdata_);
static GVariant* _variant_new9 (const gchar* value);
static GVariant* _variant_new10 (const gchar* value);
static GVariant* _variant_new11 (const gchar* value);
static void _files_app_menu_set_undo_redo_tooltips_files_undo_manager_request_menu_update (FilesUndoManager* _sender,
                                                                                    gpointer self);
static void _files_app_menu_on_zoom_setting_changed_g_settings_changed (GSettings* _sender,
                                                                 const gchar* key,
                                                                 gpointer self);
static void _files_app_menu___lambda150_ (Block52Data* _data52_);
static void __files_app_menu___lambda150__gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                              gpointer self);
static void _files_app_menu___lambda151_ (Block52Data* _data52_);
static void __files_app_menu___lambda151__gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                              gpointer self);
static void _files_app_menu___lambda152_ (Block52Data* _data52_);
static void __files_app_menu___lambda152__gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                              gpointer self);
static void _files_app_menu___lambda153_ (Block52Data* _data52_);
static void __files_app_menu___lambda153__gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                              gpointer self);
static void files_app_menu_finalize (GObject * obj);
static GType files_app_menu_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);

static inline gpointer
files_app_menu_get_instance_private (FilesAppMenu* self)
{
	return G_STRUCT_MEMBER_P (self, FilesAppMenu_private_offset);
}

static void
files_app_menu_set_undo_redo_tooltips (FilesAppMenu* self)
{
	const gchar* undo_action_s = NULL;
	FilesUndoManager* _tmp0_;
	const gchar* _tmp1_;
	const gchar* redo_action_s = NULL;
	FilesUndoManager* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_ = NULL;
	const gchar* _tmp5_;
	GtkButton* _tmp7_;
	gchar** _tmp8_;
	gint _tmp8__length1;
	gchar* _tmp9_;
	gchar* _tmp10_;
	const gchar* _tmp11_ = NULL;
	const gchar* _tmp12_;
	GtkButton* _tmp14_;
	gchar** _tmp15_;
	gint _tmp15__length1;
	gchar* _tmp16_;
	gchar* _tmp17_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->undo_manager;
	_tmp1_ = files_undo_manager_get_next_undo_description (_tmp0_);
	undo_action_s = _tmp1_;
	_tmp2_ = self->priv->undo_manager;
	_tmp3_ = files_undo_manager_get_next_redo_description (_tmp2_);
	redo_action_s = _tmp3_;
	_tmp5_ = undo_action_s;
	if (_tmp5_ != NULL) {
		const gchar* _tmp6_;
		_tmp6_ = undo_action_s;
		_tmp4_ = _tmp6_;
	} else {
		_tmp4_ = _ ("No operation to undo");
	}
	_tmp7_ = self->priv->undo_button;
	_tmp8_ = self->priv->undo_accels;
	_tmp8__length1 = self->priv->undo_accels_length1;
	_tmp9_ = granite_markup_accel_tooltip (_tmp8_, (gint) _tmp8__length1, _tmp4_);
	_tmp10_ = _tmp9_;
	gtk_widget_set_tooltip_markup ((GtkWidget*) _tmp7_, _tmp10_);
	_g_free0 (_tmp10_);
	_tmp12_ = redo_action_s;
	if (_tmp12_ != NULL) {
		const gchar* _tmp13_;
		_tmp13_ = redo_action_s;
		_tmp11_ = _tmp13_;
	} else {
		_tmp11_ = _ ("No operation to redo");
	}
	_tmp14_ = self->priv->redo_button;
	_tmp15_ = self->priv->redo_accels;
	_tmp15__length1 = self->priv->redo_accels_length1;
	_tmp16_ = granite_markup_accel_tooltip (_tmp15_, (gint) _tmp15__length1, _tmp11_);
	_tmp17_ = _tmp16_;
	gtk_widget_set_tooltip_markup ((GtkWidget*) _tmp14_, _tmp17_);
	_g_free0 (_tmp17_);
}

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

static void
files_app_menu_on_zoom_setting_changed (FilesAppMenu* self)
{
	GSettings* settings = NULL;
	GSettings* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	GQuark _tmp4_ = 0U;
	static GQuark _tmp3_label0 = 0;
	static GQuark _tmp3_label1 = 0;
	static GQuark _tmp3_label2 = 0;
	GSettings* _tmp11_;
	FilesZoomLevel default_zoom = 0;
	GSettings* _tmp13_;
	FilesZoomLevel zoom_level = 0;
	GSettings* _tmp14_;
	GtkButton* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	gint max_zoom = 0;
	GSettings* _tmp18_;
	gint min_zoom = 0;
	GSettings* _tmp19_;
	GtkButton* _tmp20_;
	GtkButton* _tmp21_;
	g_return_if_fail (self != NULL);
	settings = NULL;
	_tmp0_ = files_app_settings;
	_tmp1_ = g_settings_get_string (_tmp0_, "default-viewmode");
	_tmp2_ = _tmp1_;
	_tmp4_ = (NULL == _tmp2_) ? 0 : g_quark_from_string (_tmp2_);
	g_free (_tmp2_);
	if (_tmp4_ == ((0 != _tmp3_label0) ? _tmp3_label0 : (_tmp3_label0 = g_quark_from_static_string ("icon")))) {
		switch (0) {
			default:
			{
				GSettings* _tmp5_;
				GSettings* _tmp6_;
				_tmp5_ = files_app_menu_icon_view_settings;
				_tmp6_ = _g_object_ref0 (_tmp5_);
				_g_object_unref0 (settings);
				settings = _tmp6_;
				break;
			}
		}
	} else if (_tmp4_ == ((0 != _tmp3_label1) ? _tmp3_label1 : (_tmp3_label1 = g_quark_from_static_string ("list")))) {
		switch (0) {
			default:
			{
				GSettings* _tmp7_;
				GSettings* _tmp8_;
				_tmp7_ = files_app_menu_list_view_settings;
				_tmp8_ = _g_object_ref0 (_tmp7_);
				_g_object_unref0 (settings);
				settings = _tmp8_;
				break;
			}
		}
	} else if (_tmp4_ == ((0 != _tmp3_label2) ? _tmp3_label2 : (_tmp3_label2 = g_quark_from_static_string ("miller_columns")))) {
		switch (0) {
			default:
			{
				GSettings* _tmp9_;
				GSettings* _tmp10_;
				_tmp9_ = files_app_menu_column_view_settings;
				_tmp10_ = _g_object_ref0 (_tmp9_);
				_g_object_unref0 (settings);
				settings = _tmp10_;
				break;
			}
		}
	}
	_tmp11_ = settings;
	if (_tmp11_ == NULL) {
		GtkButton* _tmp12_;
		g_critical ("AppMenu.vala:255: Zoom string from settinggs: Null settings");
		_tmp12_ = self->priv->zoom_default_button;
		gtk_button_set_label (_tmp12_, "");
		_g_object_unref0 (settings);
		return;
	}
	_tmp13_ = settings;
	default_zoom = (FilesZoomLevel) g_settings_get_enum (_tmp13_, "default-zoom-level");
	_tmp14_ = settings;
	zoom_level = (FilesZoomLevel) g_settings_get_enum (_tmp14_, "zoom-level");
	_tmp15_ = self->priv->zoom_default_button;
	_tmp16_ = g_strdup_printf ("%.0f%%", (((gdouble) files_zoom_level_to_icon_size (zoom_level)) / ((gdouble) files_zoom_level_to_icon_size (default_zoom))) * 100);
	_tmp17_ = _tmp16_;
	gtk_button_set_label (_tmp15_, _tmp17_);
	_g_free0 (_tmp17_);
	_tmp18_ = settings;
	max_zoom = g_settings_get_enum (_tmp18_, "maximum-zoom-level");
	_tmp19_ = settings;
	min_zoom = g_settings_get_enum (_tmp19_, "minimum-zoom-level");
	_tmp20_ = self->priv->zoom_in_button;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp20_, zoom_level < max_zoom);
	_tmp21_ = self->priv->zoom_out_button;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp21_, zoom_level > min_zoom);
	_g_object_unref0 (settings);
}

FilesAppMenu*
files_app_menu_construct (GType object_type)
{
	FilesAppMenu * self = NULL;
	self = (FilesAppMenu*) g_object_new (object_type, NULL);
	return self;
}

FilesAppMenu*
files_app_menu_new (void)
{
	return files_app_menu_construct (FILES_TYPE_APP_MENU);
}

static Block52Data*
block52_data_ref (Block52Data* _data52_)
{
	g_atomic_int_inc (&_data52_->_ref_count_);
	return _data52_;
}

static void
block52_data_unref (void * _userdata_)
{
	Block52Data* _data52_;
	_data52_ = (Block52Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data52_->_ref_count_)) {
		FilesAppMenu* self;
		self = _data52_->self;
		_g_object_unref0 (_data52_->app_settings);
		_g_object_unref0 (_data52_->compact_button);
		_g_object_unref0 (_data52_->informal_button);
		_g_object_unref0 (_data52_->locale_button);
		_g_object_unref0 (_data52_->iso_button);
		_g_object_unref0 (self);
		g_slice_free (Block52Data, _data52_);
	}
}

static GVariant*
_variant_new9 (const gchar* value)
{
	return g_variant_ref_sink (g_variant_new_string (value));
}

static GVariant*
_variant_new10 (const gchar* value)
{
	return g_variant_ref_sink (g_variant_new_string (value));
}

static GVariant*
_variant_new11 (const gchar* value)
{
	return g_variant_ref_sink (g_variant_new_string (value));
}

static void
_files_app_menu_set_undo_redo_tooltips_files_undo_manager_request_menu_update (FilesUndoManager* _sender,
                                                                               gpointer self)
{
	files_app_menu_set_undo_redo_tooltips ((FilesAppMenu*) self);
}

static void
_files_app_menu_on_zoom_setting_changed_g_settings_changed (GSettings* _sender,
                                                            const gchar* key,
                                                            gpointer self)
{
	files_app_menu_on_zoom_setting_changed ((FilesAppMenu*) self);
}

static void
_files_app_menu___lambda150_ (Block52Data* _data52_)
{
	FilesAppMenu* self;
	GtkRadioButton* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	self = _data52_->self;
	_tmp0_ = _data52_->iso_button;
	_tmp1_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		GSettings* _tmp3_;
		_tmp3_ = _data52_->app_settings;
		g_settings_set_enum (_tmp3_, "date-format", (gint) FILES_DATE_FORMAT_MODE_ISO);
	}
}

static void
__files_app_menu___lambda150__gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                         gpointer self)
{
	_files_app_menu___lambda150_ (self);
}

static void
_files_app_menu___lambda151_ (Block52Data* _data52_)
{
	FilesAppMenu* self;
	GtkRadioButton* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	self = _data52_->self;
	_tmp0_ = _data52_->locale_button;
	_tmp1_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		GSettings* _tmp3_;
		_tmp3_ = _data52_->app_settings;
		g_settings_set_enum (_tmp3_, "date-format", (gint) FILES_DATE_FORMAT_MODE_LOCALE);
	}
}

static void
__files_app_menu___lambda151__gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                         gpointer self)
{
	_files_app_menu___lambda151_ (self);
}

static void
_files_app_menu___lambda152_ (Block52Data* _data52_)
{
	FilesAppMenu* self;
	GtkRadioButton* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	self = _data52_->self;
	_tmp0_ = _data52_->informal_button;
	_tmp1_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		GSettings* _tmp3_;
		_tmp3_ = _data52_->app_settings;
		g_settings_set_enum (_tmp3_, "date-format", (gint) FILES_DATE_FORMAT_MODE_INFORMAL);
	}
}

static void
__files_app_menu___lambda152__gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                         gpointer self)
{
	_files_app_menu___lambda152_ (self);
}

static void
_files_app_menu___lambda153_ (Block52Data* _data52_)
{
	FilesAppMenu* self;
	GtkRadioButton* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	self = _data52_->self;
	_tmp0_ = _data52_->compact_button;
	_tmp1_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		GSettings* _tmp3_;
		_tmp3_ = _data52_->app_settings;
		g_settings_set_enum (_tmp3_, "date-format", (gint) FILES_DATE_FORMAT_MODE_COMPACT);
	}
}

static void
__files_app_menu___lambda153__gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                         gpointer self)
{
	_files_app_menu___lambda153_ (self);
}

static GObject *
files_app_menu_constructor (GType type,
                            guint n_construct_properties,
                            GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	FilesAppMenu * self;
	Block52Data* _data52_;
	GtkApplication* app_instance = NULL;
	GApplication* _tmp0_;
	GtkApplication* _tmp1_;
	gchar* _tmp2_;
	GVariant* _tmp3_;
	GtkButton* _tmp4_ = NULL;
	GtkButton* _tmp5_;
	GtkApplication* _tmp6_;
	gchar** _tmp7_;
	gchar** _tmp8_;
	gchar** _tmp9_;
	gint _tmp9__length1;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	GVariant* _tmp13_;
	GtkButton* _tmp14_ = NULL;
	GtkButton* _tmp15_;
	GtkApplication* _tmp16_;
	gchar** _tmp17_;
	gchar** _tmp18_;
	gchar** _tmp19_;
	gint _tmp19__length1;
	gchar* _tmp20_;
	gchar* _tmp21_;
	gchar* _tmp22_;
	GVariant* _tmp23_;
	GtkButton* _tmp24_ = NULL;
	GtkButton* _tmp25_;
	GtkApplication* _tmp26_;
	gchar** _tmp27_;
	gchar** _tmp28_;
	gchar** _tmp29_;
	gint _tmp29__length1;
	gchar* _tmp30_;
	gchar* _tmp31_;
	GtkBox* icon_size_box = NULL;
	GtkBox* _tmp32_ = NULL;
	GtkBox* _tmp33_;
	GtkStyleContext* _tmp34_;
	GtkBox* _tmp35_;
	GtkButton* _tmp36_;
	GtkBox* _tmp37_;
	GtkButton* _tmp38_;
	GtkBox* _tmp39_;
	GtkButton* _tmp40_;
	GtkBox* undo_redo_box = NULL;
	GtkBox* _tmp41_ = NULL;
	GtkBox* _tmp42_;
	GtkStyleContext* _tmp43_;
	gchar* _tmp44_;
	GtkButton* _tmp45_ = NULL;
	gchar* _tmp46_;
	GtkButton* _tmp47_ = NULL;
	GtkBox* _tmp48_;
	GtkButton* _tmp49_;
	GtkBox* _tmp50_;
	GtkButton* _tmp51_;
	GtkApplication* _tmp52_;
	gchar** _tmp53_;
	gchar** _tmp54_;
	GtkApplication* _tmp55_;
	gchar** _tmp56_;
	gchar** _tmp57_;
	GraniteSwitchModelButton* double_click_button = NULL;
	gchar* _tmp58_;
	gchar* _tmp59_;
	GraniteSwitchModelButton* _tmp60_ = NULL;
	GraniteSwitchModelButton* folders_before_files = NULL;
	gchar* _tmp61_;
	GraniteSwitchModelButton* _tmp62_ = NULL;
	GraniteSwitchModelButton* restore_tabs = NULL;
	gchar* _tmp63_;
	GraniteSwitchModelButton* _tmp64_ = NULL;
	GraniteHeaderLabel* show_header = NULL;
	GraniteHeaderLabel* _tmp65_;
	GtkCheckButton* show_hidden_button = NULL;
	gchar* _tmp66_;
	GtkCheckButton* _tmp67_ = NULL;
	GtkCheckButton* _tmp68_;
	GtkStyleContext* _tmp69_;
	GtkCheckButton* _tmp70_;
	GraniteAccelLabel* _tmp71_;
	GraniteAccelLabel* _tmp72_;
	GtkCheckButton* show_local_thumbnails = NULL;
	gchar* _tmp73_;
	GtkCheckButton* _tmp74_ = NULL;
	GtkCheckButton* _tmp75_;
	GtkStyleContext* _tmp76_;
	GtkCheckButton* show_remote_thumbnails = NULL;
	gchar* _tmp77_;
	GtkCheckButton* _tmp78_ = NULL;
	GtkCheckButton* _tmp79_;
	GtkStyleContext* _tmp80_;
	GtkCheckButton* show_file_preview = NULL;
	gchar* _tmp81_;
	GtkCheckButton* _tmp82_ = NULL;
	GtkCheckButton* _tmp83_;
	GtkStyleContext* _tmp84_;
	GraniteHeaderLabel* datetimeformat_header = NULL;
	GraniteHeaderLabel* _tmp85_;
	gchar* _tmp86_;
	gchar* _tmp87_;
	GtkRadioButton* _tmp88_;
	GtkRadioButton* _tmp89_;
	GtkRadioButton* _tmp90_;
	GtkStyleContext* _tmp91_;
	GtkRadioButton* _tmp92_;
	gchar* _tmp93_;
	gchar* _tmp94_;
	GtkRadioButton* _tmp95_;
	GtkRadioButton* _tmp96_;
	GtkRadioButton* _tmp97_;
	GtkStyleContext* _tmp98_;
	GtkRadioButton* _tmp99_;
	gchar* _tmp100_;
	gchar* _tmp101_;
	GtkRadioButton* _tmp102_;
	GtkRadioButton* _tmp103_;
	GtkRadioButton* _tmp104_;
	GtkStyleContext* _tmp105_;
	GtkRadioButton* _tmp106_;
	gchar* _tmp107_;
	gchar* _tmp108_;
	GtkRadioButton* _tmp109_;
	GtkRadioButton* _tmp110_;
	GtkRadioButton* _tmp111_;
	GtkStyleContext* _tmp112_;
	GtkBox* menu_box = NULL;
	GtkBox* _tmp113_ = NULL;
	GtkBox* _tmp114_;
	GtkBox* _tmp115_;
	GtkBox* _tmp116_;
	GtkBox* _tmp117_;
	GtkBox* _tmp118_;
	GtkSeparator* _tmp119_ = NULL;
	GtkSeparator* _tmp120_;
	GtkBox* _tmp121_;
	GraniteSwitchModelButton* _tmp122_;
	GtkBox* _tmp123_;
	GraniteSwitchModelButton* _tmp124_;
	GtkBox* _tmp125_;
	GraniteSwitchModelButton* _tmp126_;
	GtkBox* _tmp127_;
	GtkSeparator* _tmp128_ = NULL;
	GtkSeparator* _tmp129_;
	GtkBox* _tmp130_;
	GraniteHeaderLabel* _tmp131_;
	GtkBox* _tmp132_;
	GtkCheckButton* _tmp133_;
	GtkBox* _tmp134_;
	GtkCheckButton* _tmp135_;
	GtkBox* _tmp136_;
	GtkCheckButton* _tmp137_;
	GtkBox* _tmp138_;
	GtkCheckButton* _tmp139_;
	GtkBox* _tmp140_;
	GtkSeparator* _tmp141_ = NULL;
	GtkSeparator* _tmp142_;
	GtkBox* _tmp143_;
	GraniteHeaderLabel* _tmp144_;
	GtkBox* _tmp145_;
	GtkRadioButton* _tmp146_;
	GtkBox* _tmp147_;
	GtkRadioButton* _tmp148_;
	GtkBox* _tmp149_;
	GtkRadioButton* _tmp150_;
	GtkBox* _tmp151_;
	GtkRadioButton* _tmp152_;
	GtkBox* _tmp153_;
	GtkBox* _tmp154_;
	FilesUndoManager* _tmp155_;
	FilesUndoManager* _tmp156_;
	GSettings* _tmp157_;
	GSettings* _tmp158_;
	GSettings* _tmp159_;
	GSettings* _tmp160_;
	GSettings* _tmp161_;
	GSettings* _tmp162_;
	GtkRadioButton* _tmp167_;
	GtkRadioButton* _tmp168_;
	GtkRadioButton* _tmp169_;
	GtkRadioButton* _tmp170_;
	parent_class = G_OBJECT_CLASS (files_app_menu_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FILES_TYPE_APP_MENU, FilesAppMenu);
	_data52_ = g_slice_new0 (Block52Data);
	_data52_->_ref_count_ = 1;
	_data52_->self = g_object_ref (self);
	_tmp0_ = g_application_get_default ();
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_application_get_type (), GtkApplication));
	app_instance = _tmp1_;
	_tmp2_ = g_strdup ("win.zoom");
	_tmp3_ = _variant_new9 ("ZOOM_OUT");
	_tmp4_ = (GtkButton*) gtk_button_new_from_icon_name ("zoom-out-symbolic", (GtkIconSize) GTK_ICON_SIZE_MENU);
	gtk_actionable_set_action_name ((GtkActionable*) _tmp4_, _tmp2_);
	_g_free0 (_tmp2_);
	g_object_set ((GtkActionable*) _tmp4_, "action-target", _tmp3_, NULL);
	_g_variant_unref0 (_tmp3_);
	g_object_ref_sink (_tmp4_);
	_g_object_unref0 (self->priv->zoom_out_button);
	self->priv->zoom_out_button = _tmp4_;
	_tmp5_ = self->priv->zoom_out_button;
	_tmp6_ = app_instance;
	_tmp8_ = _tmp7_ = gtk_application_get_accels_for_action (_tmp6_, "win.zoom::ZOOM_OUT");
	_tmp9_ = _tmp8_;
	_tmp9__length1 = _vala_array_length (_tmp7_);
	_tmp10_ = granite_markup_accel_tooltip (_tmp9_, (gint) _vala_array_length (_tmp7_), _ ("Zoom Out"));
	_tmp11_ = _tmp10_;
	gtk_widget_set_tooltip_markup ((GtkWidget*) _tmp5_, _tmp11_);
	_g_free0 (_tmp11_);
	_tmp9_ = (_vala_array_free (_tmp9_, _tmp9__length1, (GDestroyNotify) g_free), NULL);
	_tmp12_ = g_strdup ("win.zoom");
	_tmp13_ = _variant_new10 ("ZOOM_NORMAL");
	_tmp14_ = (GtkButton*) gtk_button_new_with_label ("100%");
	gtk_actionable_set_action_name ((GtkActionable*) _tmp14_, _tmp12_);
	_g_free0 (_tmp12_);
	g_object_set ((GtkActionable*) _tmp14_, "action-target", _tmp13_, NULL);
	_g_variant_unref0 (_tmp13_);
	g_object_ref_sink (_tmp14_);
	_g_object_unref0 (self->priv->zoom_default_button);
	self->priv->zoom_default_button = _tmp14_;
	_tmp15_ = self->priv->zoom_default_button;
	_tmp16_ = app_instance;
	_tmp18_ = _tmp17_ = gtk_application_get_accels_for_action (_tmp16_, "win.zoom::ZOOM_NORMAL");
	_tmp19_ = _tmp18_;
	_tmp19__length1 = _vala_array_length (_tmp17_);
	_tmp20_ = granite_markup_accel_tooltip (_tmp19_, (gint) _vala_array_length (_tmp17_), _ ("Zoom 1:1"));
	_tmp21_ = _tmp20_;
	gtk_widget_set_tooltip_markup ((GtkWidget*) _tmp15_, _tmp21_);
	_g_free0 (_tmp21_);
	_tmp19_ = (_vala_array_free (_tmp19_, _tmp19__length1, (GDestroyNotify) g_free), NULL);
	_tmp22_ = g_strdup ("win.zoom");
	_tmp23_ = _variant_new11 ("ZOOM_IN");
	_tmp24_ = (GtkButton*) gtk_button_new_from_icon_name ("zoom-in-symbolic", (GtkIconSize) GTK_ICON_SIZE_MENU);
	gtk_actionable_set_action_name ((GtkActionable*) _tmp24_, _tmp22_);
	_g_free0 (_tmp22_);
	g_object_set ((GtkActionable*) _tmp24_, "action-target", _tmp23_, NULL);
	_g_variant_unref0 (_tmp23_);
	g_object_ref_sink (_tmp24_);
	_g_object_unref0 (self->priv->zoom_in_button);
	self->priv->zoom_in_button = _tmp24_;
	_tmp25_ = self->priv->zoom_in_button;
	_tmp26_ = app_instance;
	_tmp28_ = _tmp27_ = gtk_application_get_accels_for_action (_tmp26_, "win.zoom::ZOOM_IN");
	_tmp29_ = _tmp28_;
	_tmp29__length1 = _vala_array_length (_tmp27_);
	_tmp30_ = granite_markup_accel_tooltip (_tmp29_, (gint) _vala_array_length (_tmp27_), _ ("Zoom In"));
	_tmp31_ = _tmp30_;
	gtk_widget_set_tooltip_markup ((GtkWidget*) _tmp25_, _tmp31_);
	_g_free0 (_tmp31_);
	_tmp29_ = (_vala_array_free (_tmp29_, _tmp29__length1, (GDestroyNotify) g_free), NULL);
	_tmp32_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	gtk_box_set_homogeneous (_tmp32_, TRUE);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp32_, TRUE);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp32_, 12);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp32_, 12);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp32_, 6);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp32_, 12);
	g_object_ref_sink (_tmp32_);
	icon_size_box = _tmp32_;
	_tmp33_ = icon_size_box;
	_tmp34_ = gtk_widget_get_style_context ((GtkWidget*) _tmp33_);
	gtk_style_context_add_class (_tmp34_, GTK_STYLE_CLASS_LINKED);
	_tmp35_ = icon_size_box;
	_tmp36_ = self->priv->zoom_out_button;
	gtk_container_add ((GtkContainer*) _tmp35_, (GtkWidget*) _tmp36_);
	_tmp37_ = icon_size_box;
	_tmp38_ = self->priv->zoom_default_button;
	gtk_container_add ((GtkContainer*) _tmp37_, (GtkWidget*) _tmp38_);
	_tmp39_ = icon_size_box;
	_tmp40_ = self->priv->zoom_in_button;
	gtk_container_add ((GtkContainer*) _tmp39_, (GtkWidget*) _tmp40_);
	_tmp41_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	gtk_box_set_homogeneous (_tmp41_, TRUE);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp41_, 12);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp41_, 12);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp41_, 12);
	g_object_ref_sink (_tmp41_);
	undo_redo_box = _tmp41_;
	_tmp42_ = undo_redo_box;
	_tmp43_ = gtk_widget_get_style_context ((GtkWidget*) _tmp42_);
	gtk_style_context_add_class (_tmp43_, GTK_STYLE_CLASS_LINKED);
	_tmp44_ = g_strdup ("win.undo");
	_tmp45_ = (GtkButton*) gtk_button_new_from_icon_name ("edit-undo-symbolic", (GtkIconSize) GTK_ICON_SIZE_MENU);
	gtk_actionable_set_action_name ((GtkActionable*) _tmp45_, _tmp44_);
	_g_free0 (_tmp44_);
	g_object_ref_sink (_tmp45_);
	_g_object_unref0 (self->priv->undo_button);
	self->priv->undo_button = _tmp45_;
	_tmp46_ = g_strdup ("win.redo");
	_tmp47_ = (GtkButton*) gtk_button_new_from_icon_name ("edit-redo-symbolic", (GtkIconSize) GTK_ICON_SIZE_MENU);
	gtk_actionable_set_action_name ((GtkActionable*) _tmp47_, _tmp46_);
	_g_free0 (_tmp46_);
	g_object_ref_sink (_tmp47_);
	_g_object_unref0 (self->priv->redo_button);
	self->priv->redo_button = _tmp47_;
	_tmp48_ = undo_redo_box;
	_tmp49_ = self->priv->undo_button;
	gtk_container_add ((GtkContainer*) _tmp48_, (GtkWidget*) _tmp49_);
	_tmp50_ = undo_redo_box;
	_tmp51_ = self->priv->redo_button;
	gtk_container_add ((GtkContainer*) _tmp50_, (GtkWidget*) _tmp51_);
	_tmp52_ = app_instance;
	_tmp54_ = _tmp53_ = gtk_application_get_accels_for_action (_tmp52_, "win.undo");
	self->priv->undo_accels = (_vala_array_free (self->priv->undo_accels, self->priv->undo_accels_length1, (GDestroyNotify) g_free), NULL);
	self->priv->undo_accels = _tmp54_;
	self->priv->undo_accels_length1 = _vala_array_length (_tmp53_);
	self->priv->_undo_accels_size_ = self->priv->undo_accels_length1;
	_tmp55_ = app_instance;
	_tmp57_ = _tmp56_ = gtk_application_get_accels_for_action (_tmp55_, "win.redo");
	self->priv->redo_accels = (_vala_array_free (self->priv->redo_accels, self->priv->redo_accels_length1, (GDestroyNotify) g_free), NULL);
	self->priv->redo_accels = _tmp57_;
	self->priv->redo_accels_length1 = _vala_array_length (_tmp56_);
	self->priv->_redo_accels_size_ = self->priv->redo_accels_length1;
	_tmp58_ = g_strdup (_ ("Double-click on a folder opens it, single-click selects it"));
	_tmp59_ = g_strdup ("win.singleclick-select");
	_tmp60_ = granite_switch_model_button_new (_ ("Double-click to Navigate"));
	granite_switch_model_button_set_description (_tmp60_, _tmp58_);
	_g_free0 (_tmp58_);
	gtk_actionable_set_action_name ((GtkActionable*) _tmp60_, _tmp59_);
	_g_free0 (_tmp59_);
	g_object_ref_sink (_tmp60_);
	double_click_button = _tmp60_;
	_tmp61_ = g_strdup ("win.sort-directories-first");
	_tmp62_ = granite_switch_model_button_new (_ ("Sort Folders before Files"));
	gtk_actionable_set_action_name ((GtkActionable*) _tmp62_, _tmp61_);
	_g_free0 (_tmp61_);
	g_object_ref_sink (_tmp62_);
	folders_before_files = _tmp62_;
	_tmp63_ = g_strdup ("win.restore-tabs");
	_tmp64_ = granite_switch_model_button_new (_ ("Restore Tabs from Last Time"));
	gtk_actionable_set_action_name ((GtkActionable*) _tmp64_, _tmp63_);
	_g_free0 (_tmp63_);
	g_object_ref_sink (_tmp64_);
	restore_tabs = _tmp64_;
	_tmp65_ = granite_header_label_new (_ ("Show in View"));
	g_object_ref_sink (_tmp65_);
	show_header = _tmp65_;
	_tmp66_ = g_strdup ("win.show-hiddenfiles");
	_tmp67_ = (GtkCheckButton*) gtk_check_button_new ();
	gtk_actionable_set_action_name ((GtkActionable*) _tmp67_, _tmp66_);
	_g_free0 (_tmp66_);
	g_object_ref_sink (_tmp67_);
	show_hidden_button = _tmp67_;
	_tmp68_ = show_hidden_button;
	_tmp69_ = gtk_widget_get_style_context ((GtkWidget*) _tmp68_);
	gtk_style_context_add_class (_tmp69_, GTK_STYLE_CLASS_MENUITEM);
	_tmp70_ = show_hidden_button;
	_tmp71_ = granite_accel_label_new (_ ("Hidden Files"), "<Ctrl>h");
	g_object_ref_sink (_tmp71_);
	_tmp72_ = _tmp71_;
	gtk_container_add ((GtkContainer*) _tmp70_, (GtkWidget*) _tmp72_);
	_g_object_unref0 (_tmp72_);
	_tmp73_ = g_strdup ("win.show-local-thumbnails");
	_tmp74_ = (GtkCheckButton*) gtk_check_button_new_with_label (_ ("Local Thumbnails"));
	gtk_actionable_set_action_name ((GtkActionable*) _tmp74_, _tmp73_);
	_g_free0 (_tmp73_);
	g_object_ref_sink (_tmp74_);
	show_local_thumbnails = _tmp74_;
	_tmp75_ = show_local_thumbnails;
	_tmp76_ = gtk_widget_get_style_context ((GtkWidget*) _tmp75_);
	gtk_style_context_add_class (_tmp76_, GTK_STYLE_CLASS_MENUITEM);
	_tmp77_ = g_strdup ("win.show-remote-thumbnails");
	_tmp78_ = (GtkCheckButton*) gtk_check_button_new_with_label (_ ("Remote Thumbnails"));
	gtk_actionable_set_action_name ((GtkActionable*) _tmp78_, _tmp77_);
	_g_free0 (_tmp77_);
	g_object_ref_sink (_tmp78_);
	show_remote_thumbnails = _tmp78_;
	_tmp79_ = show_remote_thumbnails;
	_tmp80_ = gtk_widget_get_style_context ((GtkWidget*) _tmp79_);
	gtk_style_context_add_class (_tmp80_, GTK_STYLE_CLASS_MENUITEM);
	_tmp81_ = g_strdup ("win.show-file-preview");
	_tmp82_ = (GtkCheckButton*) gtk_check_button_new_with_label (_ ("File Preview (Column View)"));
	gtk_actionable_set_action_name ((GtkActionable*) _tmp82_, _tmp81_);
	_g_free0 (_tmp81_);
	g_object_ref_sink (_tmp82_);
	show_file_preview = _tmp82_;
	_tmp83_ = show_file_preview;
	_tmp84_ = gtk_widget_get_style_context ((GtkWidget*) _tmp83_);
	gtk_style_context_add_class (_tmp84_, GTK_STYLE_CLASS_MENUITEM);
	_tmp85_ = granite_header_label_new (_ ("Date & Time Format"));
	g_object_ref_sink (_tmp85_);
	datetimeformat_header = _tmp85_;
	_tmp86_ = files_date_format_mode_to_string (FILES_DATE_FORMAT_MODE_ISO);
	_tmp87_ = _tmp86_;
	_tmp88_ = (GtkRadioButton*) gtk_radio_button_new_with_label (NULL, _tmp87_);
	g_object_ref_sink (_tmp88_);
	_tmp89_ = _tmp88_;
	_g_free0 (_tmp87_);
	_data52_->iso_button = _tmp89_;
	_tmp90_ = _data52_->iso_button;
	_tmp91_ = gtk_widget_get_style_context ((GtkWidget*) _tmp90_);
	gtk_style_context_add_class (_tmp91_, GTK_STYLE_CLASS_MENUITEM);
	_tmp92_ = _data52_->iso_button;
	_tmp93_ = files_date_format_mode_to_string (FILES_DATE_FORMAT_MODE_LOCALE);
	_tmp94_ = _tmp93_;
	_tmp95_ = (GtkRadioButton*) gtk_radio_button_new_with_label_from_widget (_tmp92_, _tmp94_);
	g_object_ref_sink (_tmp95_);
	_tmp96_ = _tmp95_;
	_g_free0 (_tmp94_);
	_data52_->locale_button = _tmp96_;
	_tmp97_ = _data52_->locale_button;
	_tmp98_ = gtk_widget_get_style_context ((GtkWidget*) _tmp97_);
	gtk_style_context_add_class (_tmp98_, GTK_STYLE_CLASS_MENUITEM);
	_tmp99_ = _data52_->iso_button;
	_tmp100_ = files_date_format_mode_to_string (FILES_DATE_FORMAT_MODE_INFORMAL);
	_tmp101_ = _tmp100_;
	_tmp102_ = (GtkRadioButton*) gtk_radio_button_new_with_label_from_widget (_tmp99_, _tmp101_);
	g_object_ref_sink (_tmp102_);
	_tmp103_ = _tmp102_;
	_g_free0 (_tmp101_);
	_data52_->informal_button = _tmp103_;
	_tmp104_ = _data52_->informal_button;
	_tmp105_ = gtk_widget_get_style_context ((GtkWidget*) _tmp104_);
	gtk_style_context_add_class (_tmp105_, GTK_STYLE_CLASS_MENUITEM);
	_tmp106_ = _data52_->iso_button;
	_tmp107_ = files_date_format_mode_to_string (FILES_DATE_FORMAT_MODE_COMPACT);
	_tmp108_ = _tmp107_;
	_tmp109_ = (GtkRadioButton*) gtk_radio_button_new_with_label_from_widget (_tmp106_, _tmp108_);
	g_object_ref_sink (_tmp109_);
	_tmp110_ = _tmp109_;
	_g_free0 (_tmp108_);
	_data52_->compact_button = _tmp110_;
	_tmp111_ = _data52_->compact_button;
	_tmp112_ = gtk_widget_get_style_context ((GtkWidget*) _tmp111_);
	gtk_style_context_add_class (_tmp112_, GTK_STYLE_CLASS_MENUITEM);
	_tmp113_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp113_, 6);
	g_object_ref_sink (_tmp113_);
	menu_box = _tmp113_;
	_tmp114_ = menu_box;
	_tmp115_ = icon_size_box;
	gtk_container_add ((GtkContainer*) _tmp114_, (GtkWidget*) _tmp115_);
	_tmp116_ = menu_box;
	_tmp117_ = undo_redo_box;
	gtk_container_add ((GtkContainer*) _tmp116_, (GtkWidget*) _tmp117_);
	_tmp118_ = menu_box;
	_tmp119_ = (GtkSeparator*) gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp119_, 3);
	g_object_ref_sink (_tmp119_);
	_tmp120_ = _tmp119_;
	gtk_container_add ((GtkContainer*) _tmp118_, (GtkWidget*) _tmp120_);
	_g_object_unref0 (_tmp120_);
	_tmp121_ = menu_box;
	_tmp122_ = double_click_button;
	gtk_container_add ((GtkContainer*) _tmp121_, (GtkWidget*) _tmp122_);
	_tmp123_ = menu_box;
	_tmp124_ = folders_before_files;
	gtk_container_add ((GtkContainer*) _tmp123_, (GtkWidget*) _tmp124_);
	_tmp125_ = menu_box;
	_tmp126_ = restore_tabs;
	gtk_container_add ((GtkContainer*) _tmp125_, (GtkWidget*) _tmp126_);
	_tmp127_ = menu_box;
	_tmp128_ = (GtkSeparator*) gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp128_, 3);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp128_, 3);
	g_object_ref_sink (_tmp128_);
	_tmp129_ = _tmp128_;
	gtk_container_add ((GtkContainer*) _tmp127_, (GtkWidget*) _tmp129_);
	_g_object_unref0 (_tmp129_);
	_tmp130_ = menu_box;
	_tmp131_ = show_header;
	gtk_container_add ((GtkContainer*) _tmp130_, (GtkWidget*) _tmp131_);
	_tmp132_ = menu_box;
	_tmp133_ = show_hidden_button;
	gtk_container_add ((GtkContainer*) _tmp132_, (GtkWidget*) _tmp133_);
	_tmp134_ = menu_box;
	_tmp135_ = show_local_thumbnails;
	gtk_container_add ((GtkContainer*) _tmp134_, (GtkWidget*) _tmp135_);
	_tmp136_ = menu_box;
	_tmp137_ = show_remote_thumbnails;
	gtk_container_add ((GtkContainer*) _tmp136_, (GtkWidget*) _tmp137_);
	_tmp138_ = menu_box;
	_tmp139_ = show_file_preview;
	gtk_container_add ((GtkContainer*) _tmp138_, (GtkWidget*) _tmp139_);
	_tmp140_ = menu_box;
	_tmp141_ = (GtkSeparator*) gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp141_, 3);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp141_, 3);
	g_object_ref_sink (_tmp141_);
	_tmp142_ = _tmp141_;
	gtk_container_add ((GtkContainer*) _tmp140_, (GtkWidget*) _tmp142_);
	_g_object_unref0 (_tmp142_);
	_tmp143_ = menu_box;
	_tmp144_ = datetimeformat_header;
	gtk_container_add ((GtkContainer*) _tmp143_, (GtkWidget*) _tmp144_);
	_tmp145_ = menu_box;
	_tmp146_ = _data52_->iso_button;
	gtk_container_add ((GtkContainer*) _tmp145_, (GtkWidget*) _tmp146_);
	_tmp147_ = menu_box;
	_tmp148_ = _data52_->locale_button;
	gtk_container_add ((GtkContainer*) _tmp147_, (GtkWidget*) _tmp148_);
	_tmp149_ = menu_box;
	_tmp150_ = _data52_->informal_button;
	gtk_container_add ((GtkContainer*) _tmp149_, (GtkWidget*) _tmp150_);
	_tmp151_ = menu_box;
	_tmp152_ = _data52_->compact_button;
	gtk_container_add ((GtkContainer*) _tmp151_, (GtkWidget*) _tmp152_);
	_tmp153_ = menu_box;
	gtk_widget_show_all ((GtkWidget*) _tmp153_);
	_tmp154_ = menu_box;
	g_object_set ((GtkContainer*) self, "child", (GtkWidget*) _tmp154_, NULL);
	_tmp155_ = files_undo_manager_instance ();
	self->priv->undo_manager = _tmp155_;
	_tmp156_ = self->priv->undo_manager;
	g_signal_connect_object (_tmp156_, "request-menu-update", (GCallback) _files_app_menu_set_undo_redo_tooltips_files_undo_manager_request_menu_update, self, 0);
	files_app_menu_set_undo_redo_tooltips (self);
	_tmp157_ = files_app_menu_icon_view_settings;
	g_signal_connect_object (_tmp157_, "changed::zoom-level", (GCallback) _files_app_menu_on_zoom_setting_changed_g_settings_changed, self, 0);
	_tmp158_ = files_app_menu_list_view_settings;
	g_signal_connect_object (_tmp158_, "changed::zoom-level", (GCallback) _files_app_menu_on_zoom_setting_changed_g_settings_changed, self, 0);
	_tmp159_ = files_app_menu_column_view_settings;
	g_signal_connect_object (_tmp159_, "changed::zoom-level", (GCallback) _files_app_menu_on_zoom_setting_changed_g_settings_changed, self, 0);
	_tmp160_ = g_settings_new ("io.elementary.files.preferences");
	_data52_->app_settings = _tmp160_;
	_tmp161_ = _data52_->app_settings;
	g_signal_connect_object (_tmp161_, "changed::default-viewmode", (GCallback) _files_app_menu_on_zoom_setting_changed_g_settings_changed, self, 0);
	_tmp162_ = _data52_->app_settings;
	switch (g_settings_get_enum (_tmp162_, "date-format")) {
		case FILES_DATE_FORMAT_MODE_ISO:
		{
			GtkRadioButton* _tmp163_;
			_tmp163_ = _data52_->iso_button;
			gtk_toggle_button_set_active ((GtkToggleButton*) _tmp163_, TRUE);
			break;
		}
		case FILES_DATE_FORMAT_MODE_LOCALE:
		{
			GtkRadioButton* _tmp164_;
			_tmp164_ = _data52_->locale_button;
			gtk_toggle_button_set_active ((GtkToggleButton*) _tmp164_, TRUE);
			break;
		}
		case FILES_DATE_FORMAT_MODE_INFORMAL:
		{
			GtkRadioButton* _tmp165_;
			_tmp165_ = _data52_->informal_button;
			gtk_toggle_button_set_active ((GtkToggleButton*) _tmp165_, TRUE);
			break;
		}
		case FILES_DATE_FORMAT_MODE_COMPACT:
		{
			GtkRadioButton* _tmp166_;
			_tmp166_ = _data52_->compact_button;
			gtk_toggle_button_set_active ((GtkToggleButton*) _tmp166_, TRUE);
			break;
		}
		default:
		{
			g_assert_not_reached ();
		}
	}
	_tmp167_ = _data52_->iso_button;
	g_signal_connect_data ((GtkToggleButton*) _tmp167_, "toggled", (GCallback) __files_app_menu___lambda150__gtk_toggle_button_toggled, block52_data_ref (_data52_), (GClosureNotify) block52_data_unref, 0);
	_tmp168_ = _data52_->locale_button;
	g_signal_connect_data ((GtkToggleButton*) _tmp168_, "toggled", (GCallback) __files_app_menu___lambda151__gtk_toggle_button_toggled, block52_data_ref (_data52_), (GClosureNotify) block52_data_unref, 0);
	_tmp169_ = _data52_->informal_button;
	g_signal_connect_data ((GtkToggleButton*) _tmp169_, "toggled", (GCallback) __files_app_menu___lambda152__gtk_toggle_button_toggled, block52_data_ref (_data52_), (GClosureNotify) block52_data_unref, 0);
	_tmp170_ = _data52_->compact_button;
	g_signal_connect_data ((GtkToggleButton*) _tmp170_, "toggled", (GCallback) __files_app_menu___lambda153__gtk_toggle_button_toggled, block52_data_ref (_data52_), (GClosureNotify) block52_data_unref, 0);
	_g_object_unref0 (menu_box);
	_g_object_unref0 (datetimeformat_header);
	_g_object_unref0 (show_file_preview);
	_g_object_unref0 (show_remote_thumbnails);
	_g_object_unref0 (show_local_thumbnails);
	_g_object_unref0 (show_hidden_button);
	_g_object_unref0 (show_header);
	_g_object_unref0 (restore_tabs);
	_g_object_unref0 (folders_before_files);
	_g_object_unref0 (double_click_button);
	_g_object_unref0 (undo_redo_box);
	_g_object_unref0 (icon_size_box);
	_g_object_unref0 (app_instance);
	block52_data_unref (_data52_);
	_data52_ = NULL;
	return obj;
}

static void
files_app_menu_class_init (FilesAppMenuClass * klass,
                           gpointer klass_data)
{
	GSettings* _tmp0_;
	GSettings* _tmp1_;
	GSettings* _tmp2_;
	files_app_menu_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &FilesAppMenu_private_offset);
	G_OBJECT_CLASS (klass)->constructor = files_app_menu_constructor;
	G_OBJECT_CLASS (klass)->finalize = files_app_menu_finalize;
	_tmp0_ = g_settings_new ("io.elementary.files.column-view");
	_g_object_unref0 (files_app_menu_column_view_settings);
	files_app_menu_column_view_settings = _tmp0_;
	_tmp1_ = g_settings_new ("io.elementary.files.icon-view");
	_g_object_unref0 (files_app_menu_icon_view_settings);
	files_app_menu_icon_view_settings = _tmp1_;
	_tmp2_ = g_settings_new ("io.elementary.files.list-view");
	_g_object_unref0 (files_app_menu_list_view_settings);
	files_app_menu_list_view_settings = _tmp2_;
}

static void
files_app_menu_instance_init (FilesAppMenu * self,
                              gpointer klass)
{
	self->priv = files_app_menu_get_instance_private (self);
}

static void
files_app_menu_finalize (GObject * obj)
{
	FilesAppMenu * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FILES_TYPE_APP_MENU, FilesAppMenu);
	_g_object_unref0 (self->priv->redo_button);
	_g_object_unref0 (self->priv->undo_button);
	_g_object_unref0 (self->priv->zoom_default_button);
	_g_object_unref0 (self->priv->zoom_in_button);
	_g_object_unref0 (self->priv->zoom_out_button);
	self->priv->redo_accels = (_vala_array_free (self->priv->redo_accels, self->priv->redo_accels_length1, (GDestroyNotify) g_free), NULL);
	self->priv->undo_accels = (_vala_array_free (self->priv->undo_accels, self->priv->undo_accels_length1, (GDestroyNotify) g_free), NULL);
	G_OBJECT_CLASS (files_app_menu_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
files_app_menu_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FilesAppMenuClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) files_app_menu_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FilesAppMenu), 0, (GInstanceInitFunc) files_app_menu_instance_init, NULL };
	GType files_app_menu_type_id;
	files_app_menu_type_id = g_type_register_static (gtk_popover_get_type (), "FilesAppMenu", &g_define_type_info, 0);
	FilesAppMenu_private_offset = g_type_add_instance_private (files_app_menu_type_id, sizeof (FilesAppMenuPrivate));
	return files_app_menu_type_id;
}

GType
files_app_menu_get_type (void)
{
	static volatile gsize files_app_menu_type_id__once = 0;
	if (g_once_init_enter (&files_app_menu_type_id__once)) {
		GType files_app_menu_type_id;
		files_app_menu_type_id = files_app_menu_get_type_once ();
		g_once_init_leave (&files_app_menu_type_id__once, files_app_menu_type_id);
	}
	return files_app_menu_type_id__once;
}

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

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

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

