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

/*
* Copyright (c) 2018-2026 (https://github.com/phase1geo/Minder)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*
* Authored by: Trevor Williams <phase1geo@gmail.com>
*/

#include <granite-7.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gio/gio.h>
#include <glib/gi18n-lib.h>
#include <pango/pango.h>
#include <gdk/gdk.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 TYPE_PREFERENCES (preferences_get_type ())
#define PREFERENCES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PREFERENCES, Preferences))
#define PREFERENCES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PREFERENCES, PreferencesClass))
#define IS_PREFERENCES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PREFERENCES))
#define IS_PREFERENCES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PREFERENCES))
#define PREFERENCES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PREFERENCES, PreferencesClass))

typedef struct _Preferences Preferences;
typedef struct _PreferencesClass PreferencesClass;
typedef struct _PreferencesPrivate PreferencesPrivate;

#define TYPE_MAIN_WINDOW (main_window_get_type ())
#define MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MAIN_WINDOW, MainWindow))
#define MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MAIN_WINDOW, MainWindowClass))
#define IS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MAIN_WINDOW))
#define IS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MAIN_WINDOW))
#define MAIN_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MAIN_WINDOW, MainWindowClass))

typedef struct _MainWindow MainWindow;
typedef struct _MainWindowClass MainWindowClass;

#define TYPE_TAGS (tags_get_type ())
#define TAGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TAGS, Tags))
#define TAGS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TAGS, TagsClass))
#define IS_TAGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TAGS))
#define IS_TAGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TAGS))
#define TAGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TAGS, TagsClass))

typedef struct _Tags Tags;
typedef struct _TagsClass TagsClass;
enum  {
	PREFERENCES_0_PROPERTY,
	PREFERENCES_NUM_PROPERTIES
};
static GParamSpec* preferences_properties[PREFERENCES_NUM_PROPERTIES];
typedef void (*GSimpleActionActivateCallback) (GSimpleAction* action, GVariant* parameter, gpointer user_data);
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _tags_unref0(var) ((var == NULL) ? NULL : (var = (tags_unref (var), NULL)))
typedef struct _Block52Data Block52Data;
typedef struct _Block53Data Block53Data;
typedef struct _Block54Data Block54Data;

#define TYPE_TEMPLATES (templates_get_type ())
#define TEMPLATES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TEMPLATES, Templates))
#define TEMPLATES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TEMPLATES, TemplatesClass))
#define IS_TEMPLATES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TEMPLATES))
#define IS_TEMPLATES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TEMPLATES))
#define TEMPLATES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TEMPLATES, TemplatesClass))

typedef struct _Templates Templates;
typedef struct _TemplatesClass TemplatesClass;

#define TYPE_TAG_EDITOR (tag_editor_get_type ())
#define TAG_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TAG_EDITOR, TagEditor))
#define TAG_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TAG_EDITOR, TagEditorClass))
#define IS_TAG_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TAG_EDITOR))
#define IS_TAG_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TAG_EDITOR))
#define TAG_EDITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TAG_EDITOR, TagEditorClass))

typedef struct _TagEditor TagEditor;
typedef struct _TagEditorClass TagEditorClass;
typedef struct _Block55Data Block55Data;
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))

#define TYPE_TAG (tag_get_type ())
#define TAG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TAG, Tag))
#define TAG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TAG, TagClass))
#define IS_TAG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TAG))
#define IS_TAG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TAG))
#define TAG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TAG, TagClass))

typedef struct _Tag Tag;
typedef struct _TagClass TagClass;
typedef struct _Block56Data Block56Data;
typedef enum  {
	KEY_COMMAND_DO_NOTHING,
	KEY_COMMAND_GENERAL_START,
	KEY_COMMAND_FILE_START,
	KEY_COMMAND_FILE_NEW,
	KEY_COMMAND_FILE_OPEN,
	KEY_COMMAND_FILE_OPEN_DIR,
	KEY_COMMAND_FILE_SAVE,
	KEY_COMMAND_FILE_SAVE_AS,
	KEY_COMMAND_FILE_PRINT,
	KEY_COMMAND_FILE_END,
	KEY_COMMAND_TAB_START,
	KEY_COMMAND_TAB_GOTO_NEXT,
	KEY_COMMAND_TAB_GOTO_PREV,
	KEY_COMMAND_TAB_CLOSE_CURRENT,
	KEY_COMMAND_TAB_END,
	KEY_COMMAND_UNDO_START,
	KEY_COMMAND_UNDO_ACTION,
	KEY_COMMAND_REDO_ACTION,
	KEY_COMMAND_UNDO_END,
	KEY_COMMAND_ZOOM_START,
	KEY_COMMAND_ZOOM_IN,
	KEY_COMMAND_ZOOM_OUT,
	KEY_COMMAND_ZOOM_FIT,
	KEY_COMMAND_ZOOM_SELECTED,
	KEY_COMMAND_ZOOM_ACTUAL,
	KEY_COMMAND_ZOOM_END,
	KEY_COMMAND_SIDEBAR_START,
	KEY_COMMAND_SHOW_CURRENT_SIDEBAR,
	KEY_COMMAND_SHOW_STYLE_SIDEBAR,
	KEY_COMMAND_SHOW_TAG_SIDEBAR,
	KEY_COMMAND_SHOW_STICKER_SIDEBAR,
	KEY_COMMAND_SHOW_MAP_SIDEBAR,
	KEY_COMMAND_SHOW_CURRENT_INFO,
	KEY_COMMAND_SIDEBAR_END,
	KEY_COMMAND_MAP_START,
	KEY_COMMAND_TOGGLE_CONNECTIONS,
	KEY_COMMAND_TOGGLE_CALLOUTS,
	KEY_COMMAND_BALANCE_NODES,
	KEY_COMMAND_FOLD_COMPLETED_TASKS,
	KEY_COMMAND_UNFOLD_ALL_NODES,
	KEY_COMMAND_MAP_END,
	KEY_COMMAND_MISCELLANEOUS_START,
	KEY_COMMAND_SHOW_PREFERENCES,
	KEY_COMMAND_SHOW_SHORTCUTS,
	KEY_COMMAND_SHOW_CONTEXTUAL_MENU,
	KEY_COMMAND_SHOW_FIND,
	KEY_COMMAND_SHOW_ABOUT,
	KEY_COMMAND_TOGGLE_BRAINDUMP,
	KEY_COMMAND_TOGGLE_FOCUS_MODE,
	KEY_COMMAND_EDIT_NOTE,
	KEY_COMMAND_EDIT_SELECTED,
	KEY_COMMAND_SHOW_SELECTED,
	KEY_COMMAND_REMOVE_STICKER_SELECTED,
	KEY_COMMAND_QUIT,
	KEY_COMMAND_MISCELLANEOUS_END,
	KEY_COMMAND_CONTROL_PRESSED,
	KEY_COMMAND_ESCAPE,
	KEY_COMMAND_GENERAL_END,
	KEY_COMMAND_NODE_START,
	KEY_COMMAND_NODE_EXIST_START,
	KEY_COMMAND_NODE_ADD_ROOT,
	KEY_COMMAND_NODE_ADD_SIBLING_AFTER,
	KEY_COMMAND_NODE_ADD_SIBLING_BEFORE,
	KEY_COMMAND_NODE_ADD_CHILD,
	KEY_COMMAND_NODE_ADD_PARENT,
	KEY_COMMAND_NODE_QUICK_ENTRY_INSERT,
	KEY_COMMAND_NODE_QUICK_ENTRY_REPLACE,
	KEY_COMMAND_NODE_REMOVE,
	KEY_COMMAND_NODE_REMOVE_ONLY,
	KEY_COMMAND_NODE_EXIST_END,
	KEY_COMMAND_NODE_CLIPBOARD_START,
	KEY_COMMAND_NODE_PASTE_NODE_LINK,
	KEY_COMMAND_NODE_PASTE_REPLACE,
	KEY_COMMAND_NODE_CLIPBOARD_END,
	KEY_COMMAND_NODE_VIEW_START,
	KEY_COMMAND_NODE_CENTER,
	KEY_COMMAND_NODE_VIEW_END,
	KEY_COMMAND_NODE_CHANGE_START,
	KEY_COMMAND_NODE_CHANGE_TASK,
	KEY_COMMAND_NODE_CHANGE_IMAGE,
	KEY_COMMAND_NODE_REMOVE_IMAGE,
	KEY_COMMAND_NODE_CHANGE_LINK_COLOR,
	KEY_COMMAND_NODE_RANDOMIZE_LINK_COLOR,
	KEY_COMMAND_NODE_REPARENT_LINK_COLOR,
	KEY_COMMAND_NODE_TOGGLE_FOLDS_SHALLOW,
	KEY_COMMAND_NODE_TOGGLE_FOLDS_DEEP,
	KEY_COMMAND_NODE_TOGGLE_LINKS,
	KEY_COMMAND_NODE_ADD_GROUP,
	KEY_COMMAND_NODE_ADD_CONNECTION,
	KEY_COMMAND_NODE_TOGGLE_CALLOUT,
	KEY_COMMAND_NODE_TOGGLE_SEQUENCE,
	KEY_COMMAND_NODE_CHANGE_END,
	KEY_COMMAND_NODE_SELECT_START,
	KEY_COMMAND_NODE_SELECT_ROOT,
	KEY_COMMAND_NODE_SELECT_PARENT,
	KEY_COMMAND_NODE_SELECT_SIBLING_NEXT,
	KEY_COMMAND_NODE_SELECT_SIBLING_PREV,
	KEY_COMMAND_NODE_SELECT_CHILD,
	KEY_COMMAND_NODE_SELECT_CHILDREN,
	KEY_COMMAND_NODE_SELECT_TREE,
	KEY_COMMAND_NODE_SELECT_DOWN,
	KEY_COMMAND_NODE_SELECT_UP,
	KEY_COMMAND_NODE_SELECT_RIGHT,
	KEY_COMMAND_NODE_SELECT_LEFT,
	KEY_COMMAND_NODE_SELECT_LINKED,
	KEY_COMMAND_NODE_SELECT_CALLOUT,
	KEY_COMMAND_NODE_SELECT_CONNECTION,
	KEY_COMMAND_NODE_SELECT_END,
	KEY_COMMAND_NODE_MOVE_START,
	KEY_COMMAND_NODE_SWAP_RIGHT,
	KEY_COMMAND_NODE_SWAP_LEFT,
	KEY_COMMAND_NODE_SWAP_UP,
	KEY_COMMAND_NODE_SWAP_DOWN,
	KEY_COMMAND_NODE_SORT_ALPHABETICALLY,
	KEY_COMMAND_NODE_SORT_RANDOMLY,
	KEY_COMMAND_NODE_DETACH,
	KEY_COMMAND_NODE_MOVE_END,
	KEY_COMMAND_NODE_ALIGN_START,
	KEY_COMMAND_NODE_ALIGN_TOP,
	KEY_COMMAND_NODE_ALIGN_VCENTER,
	KEY_COMMAND_NODE_ALIGN_BOTTOM,
	KEY_COMMAND_NODE_ALIGN_LEFT,
	KEY_COMMAND_NODE_ALIGN_HCENTER,
	KEY_COMMAND_NODE_ALIGN_RIGHT,
	KEY_COMMAND_NODE_ALIGN_END,
	KEY_COMMAND_NODE_END,
	KEY_COMMAND_CALLOUT_START,
	KEY_COMMAND_CALLOUT_SELECT_START,
	KEY_COMMAND_CALLOUT_SELECT_NODE,
	KEY_COMMAND_CALLOUT_SELECT_END,
	KEY_COMMAND_CALLOUT_REMOVE,
	KEY_COMMAND_CALLOUT_END,
	KEY_COMMAND_CONNECTION_START,
	KEY_COMMAND_CONNECTION_EXIST_START,
	KEY_COMMAND_CONNECTION_REMOVE,
	KEY_COMMAND_CONNECTION_EXIST_END,
	KEY_COMMAND_CONNECTION_SELECT_START,
	KEY_COMMAND_CONNECTION_SELECT_FROM,
	KEY_COMMAND_CONNECTION_SELECT_TO,
	KEY_COMMAND_CONNECTION_SELECT_NEXT,
	KEY_COMMAND_CONNECTION_SELECT_PREV,
	KEY_COMMAND_CONNECTION_SELECT_END,
	KEY_COMMAND_CONNECTION_END,
	KEY_COMMAND_STICKER_START,
	KEY_COMMAND_STICKER_REMOVE,
	KEY_COMMAND_STICKER_END,
	KEY_COMMAND_GROUP_START,
	KEY_COMMAND_GROUP_CHANGE_START,
	KEY_COMMAND_GROUP_CHANGE_COLOR,
	KEY_COMMAND_GROUP_MERGE,
	KEY_COMMAND_GROUP_REMOVE,
	KEY_COMMAND_GROUP_CHANGE_END,
	KEY_COMMAND_GROUP_SELECT_START,
	KEY_COMMAND_GROUP_SELECT_MAIN,
	KEY_COMMAND_GROUP_SELECT_ALL,
	KEY_COMMAND_GROUP_SELECT_END,
	KEY_COMMAND_GROUP_END,
	KEY_COMMAND_EDIT_START,
	KEY_COMMAND_EDIT_TEXT_START,
	KEY_COMMAND_EDIT_INSERT_NEWLINE,
	KEY_COMMAND_EDIT_INSERT_TAB,
	KEY_COMMAND_EDIT_INSERT_EMOJI,
	KEY_COMMAND_EDIT_ESCAPE,
	KEY_COMMAND_EDIT_BACKSPACE,
	KEY_COMMAND_EDIT_DELETE,
	KEY_COMMAND_EDIT_REMOVE_WORD_NEXT,
	KEY_COMMAND_EDIT_REMOVE_WORD_PREV,
	KEY_COMMAND_EDIT_TEXT_END,
	KEY_COMMAND_EDIT_MARKDOWN_START,
	KEY_COMMAND_EDIT_HEADER1,
	KEY_COMMAND_EDIT_HEADER2,
	KEY_COMMAND_EDIT_HEADER3,
	KEY_COMMAND_EDIT_HEADER4,
	KEY_COMMAND_EDIT_HEADER5,
	KEY_COMMAND_EDIT_HEADER6,
	KEY_COMMAND_EDIT_BOLD,
	KEY_COMMAND_EDIT_ITALICS,
	KEY_COMMAND_EDIT_STRIKE,
	KEY_COMMAND_EDIT_CODE,
	KEY_COMMAND_EDIT_HIGHLIGHT,
	KEY_COMMAND_EDIT_SUPERSCRIPT,
	KEY_COMMAND_EDIT_SUBSCRIPT,
	KEY_COMMAND_EDIT_LINK,
	KEY_COMMAND_EDIT_MARKDOWN_END,
	KEY_COMMAND_EDIT_CLIPBOARD_START,
	KEY_COMMAND_EDIT_COPY,
	KEY_COMMAND_EDIT_CUT,
	KEY_COMMAND_EDIT_PASTE,
	KEY_COMMAND_EDIT_CLIPBOARD_END,
	KEY_COMMAND_EDIT_URL_START,
	KEY_COMMAND_EDIT_OPEN_URL,
	KEY_COMMAND_EDIT_ADD_URL,
	KEY_COMMAND_EDIT_EDIT_URL,
	KEY_COMMAND_EDIT_REMOVE_URL,
	KEY_COMMAND_EDIT_URL_END,
	KEY_COMMAND_EDIT_CURSOR_START,
	KEY_COMMAND_EDIT_CURSOR_CHAR_NEXT,
	KEY_COMMAND_EDIT_CURSOR_CHAR_PREV,
	KEY_COMMAND_EDIT_CURSOR_UP,
	KEY_COMMAND_EDIT_CURSOR_DOWN,
	KEY_COMMAND_EDIT_CURSOR_WORD_NEXT,
	KEY_COMMAND_EDIT_CURSOR_WORD_PREV,
	KEY_COMMAND_EDIT_CURSOR_FIRST,
	KEY_COMMAND_EDIT_CURSOR_LAST,
	KEY_COMMAND_EDIT_CURSOR_LINESTART,
	KEY_COMMAND_EDIT_CURSOR_LINEEND,
	KEY_COMMAND_EDIT_CURSOR_END,
	KEY_COMMAND_EDIT_SELECT_START,
	KEY_COMMAND_EDIT_SELECT_CHAR_NEXT,
	KEY_COMMAND_EDIT_SELECT_CHAR_PREV,
	KEY_COMMAND_EDIT_SELECT_UP,
	KEY_COMMAND_EDIT_SELECT_DOWN,
	KEY_COMMAND_EDIT_SELECT_WORD_NEXT,
	KEY_COMMAND_EDIT_SELECT_WORD_PREV,
	KEY_COMMAND_EDIT_SELECT_START_UP,
	KEY_COMMAND_EDIT_SELECT_START_HOME,
	KEY_COMMAND_EDIT_SELECT_END_DOWN,
	KEY_COMMAND_EDIT_SELECT_END_END,
	KEY_COMMAND_EDIT_SELECT_LINESTART,
	KEY_COMMAND_EDIT_SELECT_LINEEND,
	KEY_COMMAND_EDIT_SELECT_ALL,
	KEY_COMMAND_EDIT_SELECT_NONE,
	KEY_COMMAND_EDIT_SELECT_END,
	KEY_COMMAND_EDIT_MISC_START,
	KEY_COMMAND_EDIT_RETURN,
	KEY_COMMAND_EDIT_SHIFT_RETURN,
	KEY_COMMAND_EDIT_TAB,
	KEY_COMMAND_EDIT_SHIFT_TAB,
	KEY_COMMAND_EDIT_MISC_END,
	KEY_COMMAND_EDIT_END,
	KEY_COMMAND_NUM
} KeyCommand;

#define TYPE_KEY_COMMAND (key_command_get_type ())
typedef struct _Block57Data Block57Data;

#define TYPE_SHORTCUT (shortcut_get_type ())
#define SHORTCUT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SHORTCUT, Shortcut))
#define SHORTCUT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SHORTCUT, ShortcutClass))
#define IS_SHORTCUT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SHORTCUT))
#define IS_SHORTCUT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SHORTCUT))
#define SHORTCUT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SHORTCUT, ShortcutClass))

typedef struct _Shortcut Shortcut;
typedef struct _ShortcutClass ShortcutClass;
typedef struct _Block58Data Block58Data;
#define _shortcut_unref0(var) ((var == NULL) ? NULL : (var = (shortcut_unref (var), NULL)))

#define TYPE_SHORTCUTS (shortcuts_get_type ())
#define SHORTCUTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SHORTCUTS, Shortcuts))
#define SHORTCUTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SHORTCUTS, ShortcutsClass))
#define IS_SHORTCUTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SHORTCUTS))
#define IS_SHORTCUTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SHORTCUTS))
#define SHORTCUTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SHORTCUTS, ShortcutsClass))

typedef struct _Shortcuts Shortcuts;
typedef struct _ShortcutsClass ShortcutsClass;
typedef struct _Block59Data Block59Data;

#define TYPE_THEMES (themes_get_type ())
#define THEMES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_THEMES, Themes))
#define THEMES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_THEMES, ThemesClass))
#define IS_THEMES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_THEMES))
#define IS_THEMES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_THEMES))
#define THEMES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_THEMES, ThemesClass))

typedef struct _Themes Themes;
typedef struct _ThemesClass ThemesClass;

#define TYPE_THEME (theme_get_type ())
#define THEME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_THEME, Theme))
#define THEME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_THEME, ThemeClass))
#define IS_THEME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_THEME))
#define IS_THEME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_THEME))
#define THEME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_THEME, ThemeClass))

typedef struct _Theme Theme;
typedef struct _ThemeClass ThemeClass;
#define _g_array_unref0(var) ((var == NULL) ? NULL : (var = (g_array_unref (var), NULL)))
typedef void (*ConfirmationDialogFunc) (gpointer user_data);

#define TYPE_TEMPLATE_GROUP (template_group_get_type ())
#define TEMPLATE_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TEMPLATE_GROUP, TemplateGroup))
#define TEMPLATE_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TEMPLATE_GROUP, TemplateGroupClass))
#define IS_TEMPLATE_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TEMPLATE_GROUP))
#define IS_TEMPLATE_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TEMPLATE_GROUP))
#define TEMPLATE_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TEMPLATE_GROUP, TemplateGroupClass))

typedef struct _TemplateGroup TemplateGroup;
typedef struct _TemplateGroupClass TemplateGroupClass;
typedef enum  {
	TEMPLATE_TYPE_STYLE_GENERAL,
	TEMPLATE_TYPE_STYLE_NODE,
	TEMPLATE_TYPE_STYLE_CONNECTION,
	TEMPLATE_TYPE_STYLE_CALLOUT,
	TEMPLATE_TYPE_STYLE_OPTION_BRANCH,
	TEMPLATE_TYPE_STYLE_OPTION_LINK,
	TEMPLATE_TYPE_STYLE_OPTION_NODE,
	TEMPLATE_TYPE_STYLE_OPTION_CONNECTION,
	TEMPLATE_TYPE_STYLE_OPTION_CALLOUT,
	TEMPLATE_TYPE_NUM
} TemplateType;

#define TYPE_TEMPLATE_TYPE (template_type_get_type ())
#define _template_group_unref0(var) ((var == NULL) ? NULL : (var = (template_group_unref (var), NULL)))
enum  {
	PREFERENCES_TAB_SWITCHED_SIGNAL,
	PREFERENCES_NUM_SIGNALS
};
static guint preferences_signals[PREFERENCES_NUM_SIGNALS] = {0};
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _Preferences {
	GraniteDialog parent_instance;
	PreferencesPrivate * priv;
};

struct _PreferencesClass {
	GraniteDialogClass parent_class;
};

struct _PreferencesPrivate {
	MainWindow* _win;
	GtkMenuButton* _theme_mb;
	gchar* _shortcut_inst_start_str;
	gchar* _shortcut_inst_edit_str;
	GtkLabel* _shortcut_instructions;
	Tags* _tags;
	GtkMenuButton* _style_menu;
};

struct _Block52Data {
	int _ref_count_;
	Preferences* self;
	GtkStack* stack;
};

struct _Block53Data {
	int _ref_count_;
	Preferences* self;
	GtkGrid* grid;
};

struct _Block54Data {
	int _ref_count_;
	Preferences* self;
	GtkGrid* grid;
};

struct _Block55Data {
	int _ref_count_;
	Preferences* self;
	TagEditor* editor;
};

struct _Block56Data {
	int _ref_count_;
	Preferences* self;
	GtkGrid* grid;
	GtkButton* search_btn;
	GtkSearchEntry* search;
};

struct _Block57Data {
	int _ref_count_;
	Preferences* self;
	GtkGrid* grid;
};

struct _Block58Data {
	int _ref_count_;
	Preferences* self;
	gchar* disabled;
	gchar* enter;
	Shortcut* shortcut;
	GtkShortcutLabel* sl;
	GtkEditableLabel* nl;
	GtkStack* stack;
	KeyCommand command;
};

struct _Block59Data {
	int _ref_count_;
	Preferences* self;
	GraniteMessageDialog* dialog;
};

static gint Preferences_private_offset;
static gpointer preferences_parent_class = NULL;
VALA_EXTERN GSettings* minder_settings;

VALA_EXTERN GType preferences_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Preferences, g_object_unref)
VALA_EXTERN GType main_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MainWindow, g_object_unref)
VALA_EXTERN gpointer tags_ref (gpointer instance);
VALA_EXTERN void tags_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_tags (const gchar* name,
                             const gchar* nick,
                             const gchar* blurb,
                             GType object_type,
                             GParamFlags flags);
VALA_EXTERN void value_set_tags (GValue* value,
                     gpointer v_object);
VALA_EXTERN void value_take_tags (GValue* value,
                      gpointer v_object);
VALA_EXTERN gpointer value_get_tags (const GValue* value);
VALA_EXTERN GType tags_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Tags, tags_unref)
static void preferences_action_set_default_theme (Preferences* self,
                                           GSimpleAction* action,
                                           GVariant* variant);
static void _preferences_action_set_default_theme_gsimple_action_activate_callback (GSimpleAction* action,
                                                                             GVariant* parameter,
                                                                             gpointer self);
static void preferences_action_clear_all_shortcuts (Preferences* self);
static void _preferences_action_clear_all_shortcuts_gsimple_action_activate_callback (GSimpleAction* action,
                                                                               GVariant* parameter,
                                                                               gpointer self);
static void preferences_action_set_minder_shortcuts (Preferences* self);
static void _preferences_action_set_minder_shortcuts_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                GVariant* parameter,
                                                                                gpointer self);
static void preferences_action_set_style_builtin (Preferences* self,
                                           GSimpleAction* action,
                                           GVariant* variant);
static void _preferences_action_set_style_builtin_gsimple_action_activate_callback (GSimpleAction* action,
                                                                             GVariant* parameter,
                                                                             gpointer self);
static void preferences_action_set_style_named (Preferences* self,
                                         GSimpleAction* action,
                                         GVariant* variant);
static void _preferences_action_set_style_named_gsimple_action_activate_callback (GSimpleAction* action,
                                                                           GVariant* parameter,
                                                                           gpointer self);
VALA_EXTERN Preferences* preferences_new (MainWindow* win);
VALA_EXTERN Preferences* preferences_construct (GType object_type,
                                    MainWindow* win);
static Block52Data* block52_data_ref (Block52Data* _data52_);
static void block52_data_unref (void * _userdata_);
static GtkGrid* preferences_create_behavior (Preferences* self);
static GtkGrid* preferences_create_appearance (Preferences* self);
static GtkBox* preferences_create_tags (Preferences* self);
static GtkBox* preferences_create_shortcuts (Preferences* self);
static GtkGrid* preferences_create_advanced (Preferences* self);
static void __lambda84_ (Block52Data* _data52_,
                  GParamSpec* ps);
static void ___lambda84__g_object_notify (GObject* _sender,
                                   GParamSpec* pspec,
                                   gpointer self);
VALA_EXTERN void utils_set_switcher_tab_widths (GtkWidget* switcher);
static void __lambda85_ (Preferences* self);
static void ___lambda85__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);
static Block53Data* block53_data_ref (Block53Data* _data53_);
static void block53_data_unref (void * _userdata_);
static GtkLabel* preferences_make_label (Preferences* self,
                                  const gchar* label,
                                  GtkAlign align);
static GtkSwitch* preferences_make_switch (Preferences* self,
                                    const gchar* setting);
static GtkImage* preferences_make_info (Preferences* self,
                                 const gchar* detail);
static void __lambda48_ (Block53Data* _data53_,
                  const gchar* tab_name);
static void ___lambda48__preferences_tab_switched (Preferences* _sender,
                                            const gchar* tab_name,
                                            gpointer self);
static Block54Data* block54_data_ref (Block54Data* _data54_);
static void block54_data_unref (void * _userdata_);
static GtkMenuButton* preferences_make_themes (Preferences* self);
static GtkSpinButton* preferences_make_spinner (Preferences* self,
                                         const gchar* setting,
                                         gint min_value,
                                         gint max_value,
                                         gint step);
VALA_EXTERN gpointer templates_ref (gpointer instance);
VALA_EXTERN void templates_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_templates (const gchar* name,
                                  const gchar* nick,
                                  const gchar* blurb,
                                  GType object_type,
                                  GParamFlags flags);
VALA_EXTERN void value_set_templates (GValue* value,
                          gpointer v_object);
VALA_EXTERN void value_take_templates (GValue* value,
                           gpointer v_object);
VALA_EXTERN gpointer value_get_templates (const GValue* value);
VALA_EXTERN GType templates_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Templates, templates_unref)
static GtkMenuButton* preferences_make_global_style (Preferences* self,
                                              Templates* templates);
VALA_EXTERN Templates* main_window_get_templates (MainWindow* self);
static void __lambda49_ (Block54Data* _data54_,
                  const gchar* tab_name);
static void ___lambda49__preferences_tab_switched (Preferences* _sender,
                                            const gchar* tab_name,
                                            gpointer self);
VALA_EXTERN GType tag_editor_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TagEditor, g_object_unref)
static Block55Data* block55_data_ref (Block55Data* _data55_);
static void block55_data_unref (void * _userdata_);
VALA_EXTERN Tags* tags_new (void);
VALA_EXTERN Tags* tags_construct (GType object_type);
VALA_EXTERN void tags_load_variant (Tags* self,
                        GVariant* variant);
VALA_EXTERN TagEditor* tag_editor_new (MainWindow* win,
                           gboolean draggable);
VALA_EXTERN TagEditor* tag_editor_construct (GType object_type,
                                 MainWindow* win,
                                 gboolean draggable);
VALA_EXTERN void tag_editor_set_tags (TagEditor* self,
                          Tags* tags);
static void __lambda66_ (Preferences* self);
static void preferences_save_tags (Preferences* self);
VALA_EXTERN GType tag_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Tag, g_object_unref)
static void ___lambda66__tag_editor_tag_changed (TagEditor* _sender,
                                          Tag* tag,
                                          Tag* orig_tag,
                                          gpointer self);
static void __lambda67_ (Preferences* self);
static void ___lambda67__tag_editor_tag_added (TagEditor* _sender,
                                        Tag* tag,
                                        gpointer self);
static void __lambda68_ (Preferences* self);
static void ___lambda68__tag_editor_tag_removed (TagEditor* _sender,
                                          Tag* tag,
                                          gint index,
                                          gpointer self);
static void __lambda69_ (Block55Data* _data55_,
                  const gchar* tab_name);
static void ___lambda69__preferences_tab_switched (Preferences* _sender,
                                            const gchar* tab_name,
                                            gpointer self);
VALA_EXTERN GVariant* tags_save_variant (Tags* self);
static Block56Data* block56_data_ref (Block56Data* _data56_);
static void block56_data_unref (void * _userdata_);
VALA_EXTERN GType key_command_get_type (void) G_GNUC_CONST ;
VALA_EXTERN gboolean key_command_viewable (KeyCommand self);
VALA_EXTERN gboolean key_command_is_section_start (KeyCommand self);
static GtkSeparator* preferences_make_separator (Preferences* self);
VALA_EXTERN gchar* key_command_shortcut_label (KeyCommand self);
VALA_EXTERN gboolean key_command_is_section_end (KeyCommand self);
VALA_EXTERN gboolean key_command_is_group_start (KeyCommand self);
VALA_EXTERN gboolean key_command_is_group_end (KeyCommand self);
static GtkStack* preferences_make_shortcut (Preferences* self,
                                     KeyCommand command);
static void __lambda79_ (Block56Data* _data56_);
static void preferences_update_search_results (Preferences* self,
                                        GtkGrid* grid,
                                        const gchar* text);
static void ___lambda79__gtk_search_entry_search_changed (GtkSearchEntry* _sender,
                                                   gpointer self);
static void __lambda80_ (Block56Data* _data56_);
static void ___lambda80__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);
static gboolean __lambda81_ (Block56Data* _data56_,
                      guint keyval,
                      guint keycode,
                      GdkModifierType state);
static gboolean ___lambda81__gtk_event_controller_key_key_pressed (GtkEventControllerKey* _sender,
                                                            guint keyval,
                                                            guint keycode,
                                                            GdkModifierType state,
                                                            gpointer self);
static void __lambda82_ (Block56Data* _data56_,
                  const gchar* tab_name);
static void ___lambda82__preferences_tab_switched (Preferences* _sender,
                                            const gchar* tab_name,
                                            gpointer self);
static Block57Data* block57_data_ref (Block57Data* _data57_);
static void block57_data_unref (void * _userdata_);
static GtkDropDown* preferences_make_enum (Preferences* self,
                                    const gchar* setting,
                                    gchar** labels,
                                    gint labels_length1);
VALA_EXTERN gchar** upgrade_action_labels (gint* result_length1);
static void __lambda83_ (Block57Data* _data57_,
                  const gchar* tab_name);
static void ___lambda83__preferences_tab_switched (Preferences* _sender,
                                            const gchar* tab_name,
                                            gpointer self);
VALA_EXTERN gpointer shortcut_ref (gpointer instance);
VALA_EXTERN void shortcut_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_shortcut (const gchar* name,
                                 const gchar* nick,
                                 const gchar* blurb,
                                 GType object_type,
                                 GParamFlags flags);
VALA_EXTERN void value_set_shortcut (GValue* value,
                         gpointer v_object);
VALA_EXTERN void value_take_shortcut (GValue* value,
                          gpointer v_object);
VALA_EXTERN gpointer value_get_shortcut (const GValue* value);
VALA_EXTERN GType shortcut_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Shortcut, shortcut_unref)
static Block58Data* block58_data_ref (Block58Data* _data58_);
static void block58_data_unref (void * _userdata_);
VALA_EXTERN gpointer shortcuts_ref (gpointer instance);
VALA_EXTERN void shortcuts_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_shortcuts (const gchar* name,
                                  const gchar* nick,
                                  const gchar* blurb,
                                  GType object_type,
                                  GParamFlags flags);
VALA_EXTERN void value_set_shortcuts (GValue* value,
                          gpointer v_object);
VALA_EXTERN void value_take_shortcuts (GValue* value,
                           gpointer v_object);
VALA_EXTERN gpointer value_get_shortcuts (const GValue* value);
VALA_EXTERN GType shortcuts_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Shortcuts, shortcuts_unref)
VALA_EXTERN Shortcuts* main_window_get_shortcuts (MainWindow* self);
VALA_EXTERN Shortcut* shortcuts_get_shortcut (Shortcuts* self,
                                  KeyCommand command);
VALA_EXTERN gchar* shortcut_get_accelerator (Shortcut* self);
VALA_EXTERN gboolean key_command_editable (KeyCommand self);
static void __lambda70_ (Block58Data* _data58_);
static void ___lambda70__gtk_event_controller_focus_enter (GtkEventControllerFocus* _sender,
                                                    gpointer self);
static void __lambda71_ (Block58Data* _data58_);
static void ___lambda71__gtk_event_controller_focus_leave (GtkEventControllerFocus* _sender,
                                                    gpointer self);
static void __lambda72_ (Block58Data* _data58_,
                  gint n_press,
                  gdouble x,
                  gdouble y);
static void ___lambda72__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                             gint n_press,
                                             gdouble x,
                                             gdouble y,
                                             gpointer self);
static gboolean __lambda73_ (Block58Data* _data58_,
                      guint keyval,
                      guint keycode,
                      GdkModifierType state);
VALA_EXTERN void shortcuts_clear_shortcut (Shortcuts* self,
                               KeyCommand command);
static gboolean ___lambda73__gtk_event_controller_key_key_pressed (GtkEventControllerKey* _sender,
                                                            guint keyval,
                                                            guint keycode,
                                                            GdkModifierType state,
                                                            gpointer self);
static void __lambda74_ (Block58Data* _data58_);
static void ___lambda74__gtk_event_controller_focus_enter (GtkEventControllerFocus* _sender,
                                                    gpointer self);
static void __lambda75_ (Block58Data* _data58_);
static void ___lambda75__gtk_event_controller_focus_leave (GtkEventControllerFocus* _sender,
                                                    gpointer self);
static void __lambda76_ (Block58Data* _data58_,
                  gint n_press,
                  gdouble x,
                  gdouble y);
static void ___lambda76__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                             gint n_press,
                                             gdouble x,
                                             gdouble y,
                                             gpointer self);
static gboolean __lambda77_ (Block58Data* _data58_,
                      guint keyval,
                      guint keycode,
                      GdkModifierType state);
VALA_EXTERN Shortcut* shortcuts_shortcut_conflicts_with (Shortcuts* self,
                                             guint keycode,
                                             gboolean control,
                                             gboolean shift,
                                             gboolean alt,
                                             KeyCommand command);
VALA_EXTERN Shortcut* shortcut_new (guint keycode,
                        gboolean control,
                        gboolean shift,
                        gboolean alt,
                        KeyCommand command);
VALA_EXTERN Shortcut* shortcut_construct (GType object_type,
                              guint keycode,
                              gboolean control,
                              gboolean shift,
                              gboolean alt,
                              KeyCommand command);
VALA_EXTERN void shortcuts_set_shortcut (Shortcuts* self,
                             Shortcut* shortcut);
static void preferences_show_conflict_dialog (Preferences* self,
                                       Shortcut* attempt,
                                       Shortcut* conflict);
static gboolean ___lambda77__gtk_event_controller_key_key_pressed (GtkEventControllerKey* _sender,
                                                            guint keyval,
                                                            guint keycode,
                                                            GdkModifierType state,
                                                            gpointer self);
static Block59Data* block59_data_ref (Block59Data* _data59_);
static void block59_data_unref (void * _userdata_);
VALA_EXTERN KeyCommand shortcut_get_command (Shortcut* self);
static void __lambda78_ (Block59Data* _data59_,
                  gint id);
static void ___lambda78__gtk_dialog_response (GtkDialog* _sender,
                                       gint response_id,
                                       gpointer self);
static void _g_free0_ (gpointer var);
static void _vala_gchar_free_function_content_of (gpointer data);
VALA_EXTERN GType themes_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Themes, g_object_unref)
VALA_EXTERN Themes* main_window_get_themes (MainWindow* self);
VALA_EXTERN void themes_names (Themes* self,
                   GArray** names);
VALA_EXTERN GType theme_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Theme, g_object_unref)
VALA_EXTERN Theme* themes_get_theme (Themes* self,
                         const gchar* name);
VALA_EXTERN const gchar* theme_get_label (Theme* self);
VALA_EXTERN void utils_create_confirmation_dialog (GtkWindow* win,
                                       const gchar* message,
                                       const gchar* detail,
                                       ConfirmationDialogFunc confirm_func,
                                       gpointer confirm_func_target);
static void __lambda46_ (Preferences* self);
VALA_EXTERN void shortcuts_clear_all_shortcuts (Shortcuts* self);
static void ___lambda46__confirmation_dialog_func (gpointer self);
static void __lambda47_ (Preferences* self);
VALA_EXTERN void shortcuts_restore_default_shortcuts (Shortcuts* self);
VALA_EXTERN void shortcuts_save (Shortcuts* self);
static void ___lambda47__confirmation_dialog_func (gpointer self);
static void preferences_set_global_style_label (Preferences* self);
VALA_EXTERN gpointer template_group_ref (gpointer instance);
VALA_EXTERN void template_group_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_template_group (const gchar* name,
                                       const gchar* nick,
                                       const gchar* blurb,
                                       GType object_type,
                                       GParamFlags flags);
VALA_EXTERN void value_set_template_group (GValue* value,
                               gpointer v_object);
VALA_EXTERN void value_take_template_group (GValue* value,
                                gpointer v_object);
VALA_EXTERN gpointer value_get_template_group (const GValue* value);
VALA_EXTERN GType template_group_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TemplateGroup, template_group_unref)
VALA_EXTERN GType template_type_get_type (void) G_GNUC_CONST ;
VALA_EXTERN TemplateGroup* templates_get_template_group (Templates* self,
                                             TemplateType ttype);
VALA_EXTERN GArray* template_group_get_names (TemplateGroup* self);
static void preferences_finalize (GObject * obj);
static GType preferences_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static const GActionEntry PREFERENCES_action_entries[5] = {{"action_set_default_theme", _preferences_action_set_default_theme_gsimple_action_activate_callback, "s"}, {"action_clear_all_shortcuts", _preferences_action_clear_all_shortcuts_gsimple_action_activate_callback}, {"action_set_minder_shortcuts", _preferences_action_set_minder_shortcuts_gsimple_action_activate_callback}, {"action_set_style_builtin", _preferences_action_set_style_builtin_gsimple_action_activate_callback, "i"}, {"action_set_style_named", _preferences_action_set_style_named_gsimple_action_activate_callback, "s"}};

static inline gpointer
preferences_get_instance_private (Preferences* self)
{
	return G_STRUCT_MEMBER_P (self, Preferences_private_offset);
}

static void
_preferences_action_set_default_theme_gsimple_action_activate_callback (GSimpleAction* action,
                                                                        GVariant* parameter,
                                                                        gpointer self)
{
	preferences_action_set_default_theme ((Preferences*) self, action, parameter);
}

static void
_preferences_action_clear_all_shortcuts_gsimple_action_activate_callback (GSimpleAction* action,
                                                                          GVariant* parameter,
                                                                          gpointer self)
{
	preferences_action_clear_all_shortcuts ((Preferences*) self);
}

static void
_preferences_action_set_minder_shortcuts_gsimple_action_activate_callback (GSimpleAction* action,
                                                                           GVariant* parameter,
                                                                           gpointer self)
{
	preferences_action_set_minder_shortcuts ((Preferences*) self);
}

static void
_preferences_action_set_style_builtin_gsimple_action_activate_callback (GSimpleAction* action,
                                                                        GVariant* parameter,
                                                                        gpointer self)
{
	preferences_action_set_style_builtin ((Preferences*) self, action, parameter);
}

static void
_preferences_action_set_style_named_gsimple_action_activate_callback (GSimpleAction* action,
                                                                      GVariant* parameter,
                                                                      gpointer self)
{
	preferences_action_set_style_named ((Preferences*) self, action, parameter);
}

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_)) {
		Preferences* self;
		self = _data52_->self;
		_g_object_unref0 (_data52_->stack);
		_g_object_unref0 (self);
		g_slice_free (Block52Data, _data52_);
	}
}

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

static void
__lambda84_ (Block52Data* _data52_,
             GParamSpec* ps)
{
	Preferences* self;
	const gchar* _tmp0_;
	self = _data52_->self;
	g_return_if_fail (ps != NULL);
	_tmp0_ = ps->name;
	if (g_strcmp0 (_tmp0_, "visible-child") == 0) {
		const gchar* _tmp1_;
		const gchar* _tmp2_;
		_tmp1_ = gtk_stack_get_visible_child_name (_data52_->stack);
		_tmp2_ = _tmp1_;
		g_signal_emit (self, preferences_signals[PREFERENCES_TAB_SWITCHED_SIGNAL], 0, _tmp2_);
	}
}

static void
___lambda84__g_object_notify (GObject* _sender,
                              GParamSpec* pspec,
                              gpointer self)
{
	__lambda84_ (self, pspec);
}

static void
__lambda85_ (Preferences* self)
{
	gtk_window_destroy ((GtkWindow*) self);
}

static void
___lambda85__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
	__lambda85_ ((Preferences*) self);
}

Preferences*
preferences_construct (GType object_type,
                       MainWindow* win)
{
	Preferences * self = NULL;
	Block52Data* _data52_;
	MainWindow* _tmp0_;
	GtkStack* _tmp1_ = NULL;
	GtkGrid* _tmp2_;
	GtkGrid* _tmp3_;
	GtkGrid* _tmp4_;
	GtkGrid* _tmp5_;
	GtkBox* _tmp6_;
	GtkBox* _tmp7_;
	GtkBox* _tmp8_;
	GtkBox* _tmp9_;
	GtkGrid* _tmp10_;
	GtkGrid* _tmp11_;
	GtkStackSwitcher* switcher = NULL;
	GtkStack* _tmp12_;
	GtkStackSwitcher* _tmp13_ = NULL;
	GtkBox* box = NULL;
	GtkBox* _tmp14_;
	GtkBox* _tmp15_;
	GtkButton* close_button = NULL;
	GtkWidget* _tmp16_;
	GtkButton* _tmp17_;
	GSimpleActionGroup* actions = NULL;
	GSimpleActionGroup* _tmp18_;
	g_return_val_if_fail (win != NULL, NULL);
	_data52_ = g_slice_new0 (Block52Data);
	_data52_->_ref_count_ = 1;
	self = (Preferences*) g_object_new (object_type, "title", _ ("Preferences"), "transient-for", win, "modal", TRUE, NULL);
	_data52_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (win);
	_g_object_unref0 (self->priv->_win);
	self->priv->_win = _tmp0_;
	_tmp1_ = (GtkStack*) gtk_stack_new ();
	gtk_widget_set_halign ((GtkWidget*) _tmp1_, GTK_ALIGN_FILL);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp1_, TRUE);
	gtk_widget_set_valign ((GtkWidget*) _tmp1_, GTK_ALIGN_FILL);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp1_, 10);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp1_, 10);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp1_, 18);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp1_, 24);
	g_object_ref_sink (_tmp1_);
	_data52_->stack = _tmp1_;
	_tmp2_ = preferences_create_behavior (self);
	_tmp3_ = _tmp2_;
	gtk_stack_add_titled (_data52_->stack, (GtkWidget*) _tmp3_, "behavior", _ ("Behavior"));
	_g_object_unref0 (_tmp3_);
	_tmp4_ = preferences_create_appearance (self);
	_tmp5_ = _tmp4_;
	gtk_stack_add_titled (_data52_->stack, (GtkWidget*) _tmp5_, "appearance", _ ("Appearance"));
	_g_object_unref0 (_tmp5_);
	_tmp6_ = preferences_create_tags (self);
	_tmp7_ = _tmp6_;
	gtk_stack_add_titled (_data52_->stack, (GtkWidget*) _tmp7_, "tags", _ ("Tags"));
	_g_object_unref0 (_tmp7_);
	_tmp8_ = preferences_create_shortcuts (self);
	_tmp9_ = _tmp8_;
	gtk_stack_add_titled (_data52_->stack, (GtkWidget*) _tmp9_, "shortcuts", _ ("Shortcuts"));
	_g_object_unref0 (_tmp9_);
	_tmp10_ = preferences_create_advanced (self);
	_tmp11_ = _tmp10_;
	gtk_stack_add_titled (_data52_->stack, (GtkWidget*) _tmp11_, "advanced", _ ("Advanced"));
	_g_object_unref0 (_tmp11_);
	g_signal_connect_data ((GObject*) _data52_->stack, "notify", (GCallback) ___lambda84__g_object_notify, block52_data_ref (_data52_), (GClosureNotify) block52_data_unref, 0);
	_tmp12_ = _g_object_ref0 (_data52_->stack);
	_tmp13_ = (GtkStackSwitcher*) gtk_stack_switcher_new ();
	gtk_widget_set_halign ((GtkWidget*) _tmp13_, GTK_ALIGN_CENTER);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp13_, TRUE);
	gtk_stack_switcher_set_stack (_tmp13_, _tmp12_);
	_g_object_unref0 (_tmp12_);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp13_, 10);
	g_object_ref_sink (_tmp13_);
	switcher = _tmp13_;
	utils_set_switcher_tab_widths ((GtkWidget*) switcher);
	_tmp14_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	g_object_ref_sink (_tmp14_);
	box = _tmp14_;
	gtk_box_append (box, (GtkWidget*) switcher);
	gtk_box_append (box, (GtkWidget*) _data52_->stack);
	_tmp15_ = gtk_dialog_get_content_area ((GtkDialog*) self);
	gtk_box_append (_tmp15_, (GtkWidget*) box);
	_tmp16_ = granite_dialog_add_button ((GraniteDialog*) self, _ ("Close"), (gint) GTK_RESPONSE_CLOSE);
	_tmp17_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, gtk_button_get_type (), GtkButton));
	close_button = _tmp17_;
	g_signal_connect_object (close_button, "clicked", (GCallback) ___lambda85__gtk_button_clicked, self, 0);
	_tmp18_ = g_simple_action_group_new ();
	actions = _tmp18_;
	g_action_map_add_action_entries ((GActionMap*) actions, PREFERENCES_action_entries, (gint) G_N_ELEMENTS (PREFERENCES_action_entries), self);
	gtk_widget_insert_action_group ((GtkWidget*) self, "prefs", (GActionGroup*) actions);
	g_signal_emit (self, preferences_signals[PREFERENCES_TAB_SWITCHED_SIGNAL], 0, "behavior");
	_g_object_unref0 (actions);
	_g_object_unref0 (close_button);
	_g_object_unref0 (box);
	_g_object_unref0 (switcher);
	block52_data_unref (_data52_);
	_data52_ = NULL;
	return self;
}

Preferences*
preferences_new (MainWindow* win)
{
	return preferences_construct (TYPE_PREFERENCES, win);
}

static Block53Data*
block53_data_ref (Block53Data* _data53_)
{
	g_atomic_int_inc (&_data53_->_ref_count_);
	return _data53_;
}

static void
block53_data_unref (void * _userdata_)
{
	Block53Data* _data53_;
	_data53_ = (Block53Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data53_->_ref_count_)) {
		Preferences* self;
		self = _data53_->self;
		_g_object_unref0 (_data53_->grid);
		_g_object_unref0 (self);
		g_slice_free (Block53Data, _data53_);
	}
}

static void
__lambda48_ (Block53Data* _data53_,
             const gchar* tab_name)
{
	Preferences* self;
	self = _data53_->self;
	g_return_if_fail (tab_name != NULL);
	if (g_strcmp0 (tab_name, "behavior") == 0) {
		GtkWidget* w = NULL;
		GtkWidget* _tmp0_;
		GtkWidget* _tmp1_;
		GtkWidget* _tmp2_;
		_tmp0_ = gtk_grid_get_child_at (_data53_->grid, 1, 0);
		_tmp1_ = _g_object_ref0 (_tmp0_);
		w = _tmp1_;
		_tmp2_ = w;
		gtk_widget_grab_focus (_tmp2_);
		_g_object_unref0 (w);
	}
}

static void
___lambda48__preferences_tab_switched (Preferences* _sender,
                                       const gchar* tab_name,
                                       gpointer self)
{
	__lambda48_ (self, tab_name);
}

static GtkGrid*
preferences_create_behavior (Preferences* self)
{
	Block53Data* _data53_;
	GtkGrid* _tmp0_ = NULL;
	gint row = 0;
	GtkLabel* _tmp1_;
	GtkLabel* _tmp2_;
	GtkSwitch* _tmp3_;
	GtkSwitch* _tmp4_;
	GtkImage* _tmp5_;
	GtkImage* _tmp6_;
	gint _tmp7_;
	GtkLabel* _tmp8_;
	GtkLabel* _tmp9_;
	GtkSwitch* _tmp10_;
	GtkSwitch* _tmp11_;
	GtkImage* _tmp12_;
	GtkImage* _tmp13_;
	gint _tmp14_;
	GtkLabel* _tmp15_;
	GtkLabel* _tmp16_;
	GtkSwitch* _tmp17_;
	GtkSwitch* _tmp18_;
	GtkImage* _tmp19_;
	GtkImage* _tmp20_;
	gint _tmp21_;
	GtkLabel* _tmp22_;
	GtkLabel* _tmp23_;
	GtkSwitch* _tmp24_;
	GtkSwitch* _tmp25_;
	gint _tmp26_;
	GtkLabel* _tmp27_;
	GtkLabel* _tmp28_;
	GtkSwitch* _tmp29_;
	GtkSwitch* _tmp30_;
	GtkImage* _tmp31_;
	GtkImage* _tmp32_;
	gint _tmp33_;
	GtkLabel* _tmp34_;
	GtkLabel* _tmp35_;
	GtkSwitch* _tmp36_;
	GtkSwitch* _tmp37_;
	GtkImage* _tmp38_;
	GtkImage* _tmp39_;
	gint _tmp40_;
	GtkLabel* _tmp41_;
	GtkLabel* _tmp42_;
	GtkSwitch* _tmp43_;
	GtkSwitch* _tmp44_;
	GtkImage* _tmp45_;
	GtkImage* _tmp46_;
	gint _tmp47_;
	GtkLabel* _tmp48_;
	GtkLabel* _tmp49_;
	GtkSwitch* _tmp50_;
	GtkSwitch* _tmp51_;
	GtkImage* _tmp52_;
	GtkImage* _tmp53_;
	gint _tmp54_;
	GtkLabel* _tmp55_;
	GtkLabel* _tmp56_;
	GtkSwitch* _tmp57_;
	GtkSwitch* _tmp58_;
	GtkImage* _tmp59_;
	GtkImage* _tmp60_;
	gint _tmp61_;
	GtkGrid* _tmp62_;
	GtkGrid* result;
	g_return_val_if_fail (self != NULL, NULL);
	_data53_ = g_slice_new0 (Block53Data);
	_data53_->_ref_count_ = 1;
	_data53_->self = g_object_ref (self);
	_tmp0_ = (GtkGrid*) gtk_grid_new ();
	gtk_widget_set_halign ((GtkWidget*) _tmp0_, GTK_ALIGN_CENTER);
	gtk_grid_set_column_spacing (_tmp0_, 12);
	gtk_grid_set_row_spacing (_tmp0_, 6);
	g_object_ref_sink (_tmp0_);
	_data53_->grid = _tmp0_;
	row = 0;
	_tmp1_ = preferences_make_label (self, _ ("Create new node from edit mode"), GTK_ALIGN_END);
	_tmp2_ = _tmp1_;
	gtk_grid_attach (_data53_->grid, (GtkWidget*) _tmp2_, 0, row, 1, 1);
	_g_object_unref0 (_tmp2_);
	_tmp3_ = preferences_make_switch (self, "new-node-from-edit");
	_tmp4_ = _tmp3_;
	gtk_grid_attach (_data53_->grid, (GtkWidget*) _tmp4_, 1, row, 1, 1);
	_g_object_unref0 (_tmp4_);
	_tmp5_ = preferences_make_info (self, _ ("Specifies if we should create a new node directly from edit mode if Re" \
"turn or Tab is pressed."));
	_tmp6_ = _tmp5_;
	gtk_grid_attach (_data53_->grid, (GtkWidget*) _tmp6_, 3, row, 1, 1);
	_g_object_unref0 (_tmp6_);
	_tmp7_ = row;
	row = _tmp7_ + 1;
	_tmp8_ = preferences_make_label (self, _ ("Newly attached nodes get style from parent"), GTK_ALIGN_END);
	_tmp9_ = _tmp8_;
	gtk_grid_attach (_data53_->grid, (GtkWidget*) _tmp9_, 0, row, 1, 1);
	_g_object_unref0 (_tmp9_);
	_tmp10_ = preferences_make_switch (self, "style-always-from-parent");
	_tmp11_ = _tmp10_;
	gtk_grid_attach (_data53_->grid, (GtkWidget*) _tmp11_, 1, row, 1, 1);
	_g_object_unref0 (_tmp11_);
	_tmp12_ = preferences_make_info (self, _ ("Specifies if a node is attached to a new parent, whether its style sho" \
"uld come from the new parent or its new siblings"));
	_tmp13_ = _tmp12_;
	gtk_grid_attach (_data53_->grid, (GtkWidget*) _tmp13_, 3, row, 1, 1);
	_g_object_unref0 (_tmp13_);
	_tmp14_ = row;
	row = _tmp14_ + 1;
	_tmp15_ = preferences_make_label (self, _ ("Automatically make embedded URLs into links"), GTK_ALIGN_END);
	_tmp16_ = _tmp15_;
	gtk_grid_attach (_data53_->grid, (GtkWidget*) _tmp16_, 0, row, 1, 1);
	_g_object_unref0 (_tmp16_);
	_tmp17_ = preferences_make_switch (self, "auto-parse-embedded-urls");
	_tmp18_ = _tmp17_;
	gtk_grid_attach (_data53_->grid, (GtkWidget*) _tmp18_, 1, row, 1, 1);
	_g_object_unref0 (_tmp18_);
	_tmp19_ = preferences_make_info (self, _ ("Specifies if embedded URLs found in node titles should be automaticall" \
"y highlighted."));
	_tmp20_ = _tmp19_;
	gtk_grid_attach (_data53_->grid, (GtkWidget*) _tmp20_, 3, row, 1, 1);
	_g_object_unref0 (_tmp20_);
	_tmp21_ = row;
	row = _tmp21_ + 1;
	_tmp22_ = preferences_make_label (self, _ ("Enable Markdown"), GTK_ALIGN_END);
	_tmp23_ = _tmp22_;
	gtk_grid_attach (_data53_->grid, (GtkWidget*) _tmp23_, 0, row, 1, 1);
	_g_object_unref0 (_tmp23_);
	_tmp24_ = preferences_make_switch (self, "enable-markdown");
	_tmp25_ = _tmp24_;
	gtk_grid_attach (_data53_->grid, (GtkWidget*) _tmp25_, 1, row, 1, 1);
	_g_object_unref0 (_tmp25_);
	_tmp26_ = row;
	row = _tmp26_ + 1;
	_tmp27_ = preferences_make_label (self, _ ("Enable Unicode input"), GTK_ALIGN_END);
	_tmp28_ = _tmp27_;
	gtk_grid_attach (_data53_->grid, (GtkWidget*) _tmp28_, 0, row, 1, 1);
	_g_object_unref0 (_tmp28_);
	_tmp29_ = preferences_make_switch (self, "enable-unicode-input");
	_tmp30_ = _tmp29_;
	gtk_grid_attach (_data53_->grid, (GtkWidget*) _tmp30_, 1, row, 1, 1);
	_g_object_unref0 (_tmp30_);
	_tmp31_ = preferences_make_info (self, _ ("Specifies if Unicode characters can be input using backslash prefixed " \
"descriptors (ex. \\pi)"));
	_tmp32_ = _tmp31_;
	gtk_grid_attach (_data53_->grid, (GtkWidget*) _tmp32_, 3, row, 1, 1);
	_g_object_unref0 (_tmp32_);
	_tmp33_ = row;
	row = _tmp33_ + 1;
	_tmp34_ = preferences_make_label (self, _ ("Create connection title on creation"), GTK_ALIGN_END);
	_tmp35_ = _tmp34_;
	gtk_grid_attach (_data53_->grid, (GtkWidget*) _tmp35_, 0, row, 1, 1);
	_g_object_unref0 (_tmp35_);
	_tmp36_ = preferences_make_switch (self, "edit-connection-title-on-creation");
	_tmp37_ = _tmp36_;
	gtk_grid_attach (_data53_->grid, (GtkWidget*) _tmp37_, 1, row, 1, 1);
	_g_object_unref0 (_tmp37_);
	_tmp38_ = preferences_make_info (self, _ ("Specifies if the connection title will be added and put into edit mode" \
" immediately after the connection is made."));
	_tmp39_ = _tmp38_;
	gtk_grid_attach (_data53_->grid, (GtkWidget*) _tmp39_, 3, row, 1, 1);
	_g_object_unref0 (_tmp39_);
	_tmp40_ = row;
	row = _tmp40_ + 1;
	_tmp41_ = preferences_make_label (self, _ ("Select items on mouse hover"), GTK_ALIGN_END);
	_tmp42_ = _tmp41_;
	gtk_grid_attach (_data53_->grid, (GtkWidget*) _tmp42_, 0, row, 1, 1);
	_g_object_unref0 (_tmp42_);
	_tmp43_ = preferences_make_switch (self, "select-on-hover");
	_tmp44_ = _tmp43_;
	gtk_grid_attach (_data53_->grid, (GtkWidget*) _tmp44_, 1, row, 1, 1);
	_g_object_unref0 (_tmp44_);
	_tmp45_ = preferences_make_info (self, _ ("If enabled, selects items when mouse cursor hovers over the item."));
	_tmp46_ = _tmp45_;
	gtk_grid_attach (_data53_->grid, (GtkWidget*) _tmp46_, 3, row, 1, 1);
	_g_object_unref0 (_tmp46_);
	_tmp47_ = row;
	row = _tmp47_ + 1;
	_tmp48_ = preferences_make_label (self, _ ("Rotate main branch link colors"), GTK_ALIGN_END);
	_tmp49_ = _tmp48_;
	gtk_grid_attach (_data53_->grid, (GtkWidget*) _tmp49_, 0, row, 1, 1);
	_g_object_unref0 (_tmp49_);
	_tmp50_ = preferences_make_switch (self, "rotate-main-link-colors");
	_tmp51_ = _tmp50_;
	gtk_grid_attach (_data53_->grid, (GtkWidget*) _tmp51_, 1, row, 1, 1);
	_g_object_unref0 (_tmp51_);
	_tmp52_ = preferences_make_info (self, _ ("If enabled, causes a new color to be used whenever a main branch is cr" \
"eated"));
	_tmp53_ = _tmp52_;
	gtk_grid_attach (_data53_->grid, (GtkWidget*) _tmp53_, 3, row, 1, 1);
	_g_object_unref0 (_tmp53_);
	_tmp54_ = row;
	row = _tmp54_ + 1;
	_tmp55_ = preferences_make_label (self, _ ("Keep backup files after saving"), GTK_ALIGN_END);
	_tmp56_ = _tmp55_;
	gtk_grid_attach (_data53_->grid, (GtkWidget*) _tmp56_, 0, row, 1, 1);
	_g_object_unref0 (_tmp56_);
	_tmp57_ = preferences_make_switch (self, "keep-backup-after-save");
	_tmp58_ = _tmp57_;
	gtk_grid_attach (_data53_->grid, (GtkWidget*) _tmp58_, 1, row, 1, 1);
	_g_object_unref0 (_tmp58_);
	_tmp59_ = preferences_make_info (self, _ ("Backup files are created prior to saving.  If enabled, the backup file" \
" is retained but is not used when re-opening the file.  If disabled, t" \
"he backup file is removed after save and used on re-opening file if it" \
" exists.  Backup files are hidden in the same directory as the origina" \
"l with a .bak extension."));
	_tmp60_ = _tmp59_;
	gtk_grid_attach (_data53_->grid, (GtkWidget*) _tmp60_, 3, row, 1, 1);
	_g_object_unref0 (_tmp60_);
	_tmp61_ = row;
	row = _tmp61_ + 1;
	g_signal_connect_data (self, "tab-switched", (GCallback) ___lambda48__preferences_tab_switched, block53_data_ref (_data53_), (GClosureNotify) block53_data_unref, 0);
	_tmp62_ = _g_object_ref0 (_data53_->grid);
	result = _tmp62_;
	block53_data_unref (_data53_);
	_data53_ = NULL;
	return result;
}

static Block54Data*
block54_data_ref (Block54Data* _data54_)
{
	g_atomic_int_inc (&_data54_->_ref_count_);
	return _data54_;
}

static void
block54_data_unref (void * _userdata_)
{
	Block54Data* _data54_;
	_data54_ = (Block54Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data54_->_ref_count_)) {
		Preferences* self;
		self = _data54_->self;
		_g_object_unref0 (_data54_->grid);
		_g_object_unref0 (self);
		g_slice_free (Block54Data, _data54_);
	}
}

static void
__lambda49_ (Block54Data* _data54_,
             const gchar* tab_name)
{
	Preferences* self;
	self = _data54_->self;
	g_return_if_fail (tab_name != NULL);
	if (g_strcmp0 (tab_name, "appearance") == 0) {
		GtkWidget* w = NULL;
		GtkWidget* _tmp0_;
		GtkWidget* _tmp1_;
		GtkWidget* _tmp2_;
		_tmp0_ = gtk_grid_get_child_at (_data54_->grid, 1, 0);
		_tmp1_ = _g_object_ref0 (_tmp0_);
		w = _tmp1_;
		_tmp2_ = w;
		gtk_widget_grab_focus (_tmp2_);
		_g_object_unref0 (w);
	}
}

static void
___lambda49__preferences_tab_switched (Preferences* _sender,
                                       const gchar* tab_name,
                                       gpointer self)
{
	__lambda49_ (self, tab_name);
}

static GtkGrid*
preferences_create_appearance (Preferences* self)
{
	Block54Data* _data54_;
	GtkGrid* _tmp0_ = NULL;
	gint row = 0;
	GtkLabel* _tmp1_;
	GtkLabel* _tmp2_;
	GtkMenuButton* _tmp3_;
	GtkMenuButton* _tmp4_;
	GtkImage* _tmp5_;
	GtkImage* _tmp6_;
	gint _tmp7_;
	GtkLabel* _tmp8_;
	GtkLabel* _tmp9_;
	GtkSwitch* _tmp10_;
	GtkSwitch* _tmp11_;
	gint _tmp12_;
	GtkLabel* _tmp13_;
	GtkLabel* _tmp14_;
	GtkSwitch* _tmp15_;
	GtkSwitch* _tmp16_;
	gint _tmp17_;
	GtkLabel* _tmp18_;
	GtkLabel* _tmp19_;
	GtkSwitch* _tmp20_;
	GtkSwitch* _tmp21_;
	GtkSpinButton* _tmp22_;
	GtkSpinButton* _tmp23_;
	GtkImage* _tmp24_;
	GtkImage* _tmp25_;
	gint _tmp26_;
	GtkLabel* _tmp27_;
	GtkLabel* _tmp28_;
	GtkSwitch* _tmp29_;
	GtkSwitch* _tmp30_;
	gint _tmp31_;
	GtkLabel* _tmp32_;
	GtkLabel* _tmp33_;
	MainWindow* _tmp34_;
	Templates* _tmp35_;
	Templates* _tmp36_;
	GtkMenuButton* _tmp37_;
	GtkMenuButton* _tmp38_;
	GtkImage* _tmp39_;
	GtkImage* _tmp40_;
	gint _tmp41_;
	GtkGrid* _tmp42_;
	GtkGrid* result;
	g_return_val_if_fail (self != NULL, NULL);
	_data54_ = g_slice_new0 (Block54Data);
	_data54_->_ref_count_ = 1;
	_data54_->self = g_object_ref (self);
	_tmp0_ = (GtkGrid*) gtk_grid_new ();
	gtk_widget_set_halign ((GtkWidget*) _tmp0_, GTK_ALIGN_CENTER);
	gtk_grid_set_column_spacing (_tmp0_, 12);
	gtk_grid_set_row_spacing (_tmp0_, 6);
	g_object_ref_sink (_tmp0_);
	_data54_->grid = _tmp0_;
	row = 0;
	_tmp1_ = preferences_make_label (self, _ ("Default theme"), GTK_ALIGN_END);
	_tmp2_ = _tmp1_;
	gtk_grid_attach (_data54_->grid, (GtkWidget*) _tmp2_, 0, row, 1, 1);
	_g_object_unref0 (_tmp2_);
	_tmp3_ = preferences_make_themes (self);
	_tmp4_ = _tmp3_;
	gtk_grid_attach (_data54_->grid, (GtkWidget*) _tmp4_, 1, row, 2, 1);
	_g_object_unref0 (_tmp4_);
	_tmp5_ = preferences_make_info (self, _ ("Sets the default theme to use for newly created mindmaps (use Map side" \
"bar panel to make immediate changes)."));
	_tmp6_ = _tmp5_;
	gtk_grid_attach (_data54_->grid, (GtkWidget*) _tmp6_, 3, row, 1, 1);
	_g_object_unref0 (_tmp6_);
	_tmp7_ = row;
	row = _tmp7_ + 1;
	_tmp8_ = preferences_make_label (self, _ ("Enable mindmap animations"), GTK_ALIGN_END);
	_tmp9_ = _tmp8_;
	gtk_grid_attach (_data54_->grid, (GtkWidget*) _tmp9_, 0, row, 1, 1);
	_g_object_unref0 (_tmp9_);
	_tmp10_ = preferences_make_switch (self, "enable-animations");
	_tmp11_ = _tmp10_;
	gtk_grid_attach (_data54_->grid, (GtkWidget*) _tmp11_, 1, row, 1, 1);
	_g_object_unref0 (_tmp11_);
	_tmp12_ = row;
	row = _tmp12_ + 1;
	_tmp13_ = preferences_make_label (self, _ ("Enable window animations"), GTK_ALIGN_END);
	_tmp14_ = _tmp13_;
	gtk_grid_attach (_data54_->grid, (GtkWidget*) _tmp14_, 0, row, 1, 1);
	_g_object_unref0 (_tmp14_);
	_tmp15_ = preferences_make_switch (self, "enable-ui-animations");
	_tmp16_ = _tmp15_;
	gtk_grid_attach (_data54_->grid, (GtkWidget*) _tmp16_, 1, row, 1, 1);
	_g_object_unref0 (_tmp16_);
	_tmp17_ = row;
	row = _tmp17_ + 1;
	_tmp18_ = preferences_make_label (self, _ ("Text field font size"), GTK_ALIGN_END);
	_tmp19_ = _tmp18_;
	gtk_grid_attach (_data54_->grid, (GtkWidget*) _tmp19_, 0, row, 1, 1);
	_g_object_unref0 (_tmp19_);
	_tmp20_ = preferences_make_switch (self, "text-field-use-custom-font-size");
	_tmp21_ = _tmp20_;
	gtk_grid_attach (_data54_->grid, (GtkWidget*) _tmp21_, 1, row, 1, 1);
	_g_object_unref0 (_tmp21_);
	_tmp22_ = preferences_make_spinner (self, "text-field-custom-font-size", 8, 24, 1);
	_tmp23_ = _tmp22_;
	gtk_grid_attach (_data54_->grid, (GtkWidget*) _tmp23_, 2, row, 1, 1);
	_g_object_unref0 (_tmp23_);
	_tmp24_ = preferences_make_info (self, _ ("Specifies the custom font size to use in text editing fields (i.e, qui" \
"ck entry or notes field)."));
	_tmp25_ = _tmp24_;
	gtk_grid_attach (_data54_->grid, (GtkWidget*) _tmp25_, 3, row, 1, 1);
	_g_object_unref0 (_tmp25_);
	_tmp26_ = row;
	row = _tmp26_ + 1;
	_tmp27_ = preferences_make_label (self, _ ("Colorize note fields"), GTK_ALIGN_END);
	_tmp28_ = _tmp27_;
	gtk_grid_attach (_data54_->grid, (GtkWidget*) _tmp28_, 0, row, 1, 1);
	_g_object_unref0 (_tmp28_);
	_tmp29_ = preferences_make_switch (self, "colorize-notes");
	_tmp30_ = _tmp29_;
	gtk_grid_attach (_data54_->grid, (GtkWidget*) _tmp30_, 1, row, 1, 1);
	_g_object_unref0 (_tmp30_);
	_tmp31_ = row;
	row = _tmp31_ + 1;
	_tmp32_ = preferences_make_label (self, _ ("Default global style"), GTK_ALIGN_END);
	_tmp33_ = _tmp32_;
	gtk_grid_attach (_data54_->grid, (GtkWidget*) _tmp33_, 0, row, 1, 1);
	_g_object_unref0 (_tmp33_);
	_tmp34_ = self->priv->_win;
	_tmp35_ = main_window_get_templates (_tmp34_);
	_tmp36_ = _tmp35_;
	_tmp37_ = preferences_make_global_style (self, _tmp36_);
	_tmp38_ = _tmp37_;
	gtk_grid_attach (_data54_->grid, (GtkWidget*) _tmp38_, 1, row, 2, 1);
	_g_object_unref0 (_tmp38_);
	_tmp39_ = preferences_make_info (self, _ ("Specifies the global style to use for newly created mindmaps."));
	_tmp40_ = _tmp39_;
	gtk_grid_attach (_data54_->grid, (GtkWidget*) _tmp40_, 3, row, 1, 1);
	_g_object_unref0 (_tmp40_);
	_tmp41_ = row;
	row = _tmp41_ + 1;
	g_signal_connect_data (self, "tab-switched", (GCallback) ___lambda49__preferences_tab_switched, block54_data_ref (_data54_), (GClosureNotify) block54_data_unref, 0);
	_tmp42_ = _g_object_ref0 (_data54_->grid);
	result = _tmp42_;
	block54_data_unref (_data54_);
	_data54_ = NULL;
	return result;
}

static Block55Data*
block55_data_ref (Block55Data* _data55_)
{
	g_atomic_int_inc (&_data55_->_ref_count_);
	return _data55_;
}

static void
block55_data_unref (void * _userdata_)
{
	Block55Data* _data55_;
	_data55_ = (Block55Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data55_->_ref_count_)) {
		Preferences* self;
		self = _data55_->self;
		_g_object_unref0 (_data55_->editor);
		_g_object_unref0 (self);
		g_slice_free (Block55Data, _data55_);
	}
}

static void
__lambda66_ (Preferences* self)
{
	preferences_save_tags (self);
}

static void
___lambda66__tag_editor_tag_changed (TagEditor* _sender,
                                     Tag* tag,
                                     Tag* orig_tag,
                                     gpointer self)
{
	__lambda66_ ((Preferences*) self);
}

static void
__lambda67_ (Preferences* self)
{
	preferences_save_tags (self);
}

static void
___lambda67__tag_editor_tag_added (TagEditor* _sender,
                                   Tag* tag,
                                   gpointer self)
{
	__lambda67_ ((Preferences*) self);
}

static void
__lambda68_ (Preferences* self)
{
	preferences_save_tags (self);
}

static void
___lambda68__tag_editor_tag_removed (TagEditor* _sender,
                                     Tag* tag,
                                     gint index,
                                     gpointer self)
{
	__lambda68_ ((Preferences*) self);
}

static void
__lambda69_ (Block55Data* _data55_,
             const gchar* tab_name)
{
	Preferences* self;
	self = _data55_->self;
	g_return_if_fail (tab_name != NULL);
	if (g_strcmp0 (tab_name, "tags") == 0) {
		gtk_widget_grab_focus ((GtkWidget*) _data55_->editor);
	}
}

static void
___lambda69__preferences_tab_switched (Preferences* _sender,
                                       const gchar* tab_name,
                                       gpointer self)
{
	__lambda69_ (self, tab_name);
}

static GtkBox*
preferences_create_tags (Preferences* self)
{
	Block55Data* _data55_;
	Tags* _tmp0_;
	Tags* _tmp1_;
	GSettings* _tmp2_;
	GVariant* _tmp3_;
	GVariant* _tmp4_;
	GtkLabel* note = NULL;
	GtkLabel* _tmp5_ = NULL;
	MainWindow* _tmp6_;
	TagEditor* _tmp7_;
	Tags* _tmp8_;
	GtkBox* box = NULL;
	GtkBox* _tmp9_;
	GtkBox* result;
	g_return_val_if_fail (self != NULL, NULL);
	_data55_ = g_slice_new0 (Block55Data);
	_data55_->_ref_count_ = 1;
	_data55_->self = g_object_ref (self);
	_tmp0_ = tags_new ();
	_tags_unref0 (self->priv->_tags);
	self->priv->_tags = _tmp0_;
	_tmp1_ = self->priv->_tags;
	_tmp2_ = minder_settings;
	_tmp3_ = g_settings_get_value (_tmp2_, "starting-tags");
	_tmp4_ = _tmp3_;
	tags_load_variant (_tmp1_, _tmp4_);
	_g_variant_unref0 (_tmp4_);
	_tmp5_ = (GtkLabel*) gtk_label_new (_ ("Tags in this list will be the starting list of tags for new mindmaps."));
	gtk_label_set_wrap (_tmp5_, TRUE);
	gtk_label_set_wrap_mode (_tmp5_, PANGO_WRAP_WORD);
	g_object_ref_sink (_tmp5_);
	note = _tmp5_;
	_tmp6_ = self->priv->_win;
	_tmp7_ = tag_editor_new (_tmp6_, FALSE);
	g_object_ref_sink (_tmp7_);
	_data55_->editor = _tmp7_;
	_tmp8_ = self->priv->_tags;
	tag_editor_set_tags (_data55_->editor, _tmp8_);
	g_signal_connect_object (_data55_->editor, "tag-changed", (GCallback) ___lambda66__tag_editor_tag_changed, self, 0);
	g_signal_connect_object (_data55_->editor, "tag-added", (GCallback) ___lambda67__tag_editor_tag_added, self, 0);
	g_signal_connect_object (_data55_->editor, "tag-removed", (GCallback) ___lambda68__tag_editor_tag_removed, self, 0);
	_tmp9_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 10);
	g_object_ref_sink (_tmp9_);
	box = _tmp9_;
	gtk_box_append (box, (GtkWidget*) note);
	gtk_box_append (box, (GtkWidget*) _data55_->editor);
	g_signal_connect_data (self, "tab-switched", (GCallback) ___lambda69__preferences_tab_switched, block55_data_ref (_data55_), (GClosureNotify) block55_data_unref, 0);
	result = box;
	_g_object_unref0 (note);
	block55_data_unref (_data55_);
	_data55_ = NULL;
	return result;
}

static void
preferences_save_tags (Preferences* self)
{
	GSettings* _tmp0_;
	Tags* _tmp1_;
	GVariant* _tmp2_;
	GVariant* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = minder_settings;
	_tmp1_ = self->priv->_tags;
	_tmp2_ = tags_save_variant (_tmp1_);
	_tmp3_ = _tmp2_;
	g_settings_set_value (_tmp0_, "starting-tags", _tmp3_);
	_g_variant_unref0 (_tmp3_);
}

static Block56Data*
block56_data_ref (Block56Data* _data56_)
{
	g_atomic_int_inc (&_data56_->_ref_count_);
	return _data56_;
}

static void
block56_data_unref (void * _userdata_)
{
	Block56Data* _data56_;
	_data56_ = (Block56Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data56_->_ref_count_)) {
		Preferences* self;
		self = _data56_->self;
		_g_object_unref0 (_data56_->search);
		_g_object_unref0 (_data56_->search_btn);
		_g_object_unref0 (_data56_->grid);
		_g_object_unref0 (self);
		g_slice_free (Block56Data, _data56_);
	}
}

static void
__lambda79_ (Block56Data* _data56_)
{
	Preferences* self;
	GtkGrid* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	GtkGrid* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	self = _data56_->self;
	_tmp0_ = _data56_->grid;
	_tmp1_ = gtk_editable_get_text ((GtkEditable*) _data56_->search);
	_tmp2_ = _tmp1_;
	preferences_update_search_results (self, _tmp0_, _tmp2_);
	_tmp3_ = _data56_->grid;
	_tmp4_ = gtk_editable_get_text ((GtkEditable*) _data56_->search);
	_tmp5_ = _tmp4_;
	gtk_grid_set_row_homogeneous (_tmp3_, g_strcmp0 (_tmp5_, "") == 0);
}

static void
___lambda79__gtk_search_entry_search_changed (GtkSearchEntry* _sender,
                                              gpointer self)
{
	__lambda79_ (self);
}

static void
__lambda80_ (Block56Data* _data56_)
{
	Preferences* self;
	gboolean _tmp0_;
	gboolean _tmp1_;
	self = _data56_->self;
	_tmp0_ = gtk_widget_get_visible ((GtkWidget*) _data56_->search);
	_tmp1_ = _tmp0_;
	gtk_widget_set_visible ((GtkWidget*) _data56_->search, !_tmp1_);
	gtk_editable_set_text ((GtkEditable*) _data56_->search, "");
	gtk_widget_grab_focus ((GtkWidget*) _data56_->search);
}

static void
___lambda80__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
	__lambda80_ (self);
}

static gboolean
__lambda81_ (Block56Data* _data56_,
             guint keyval,
             guint keycode,
             GdkModifierType state)
{
	Preferences* self;
	gboolean result;
	self = _data56_->self;
	if (keyval == GDK_KEY_Escape) {
		gtk_widget_set_visible ((GtkWidget*) _data56_->search, FALSE);
		gtk_editable_set_text ((GtkEditable*) _data56_->search, "");
		gtk_widget_grab_focus ((GtkWidget*) _data56_->search_btn);
		result = TRUE;
		return result;
	}
	result = FALSE;
	return result;
}

static gboolean
___lambda81__gtk_event_controller_key_key_pressed (GtkEventControllerKey* _sender,
                                                   guint keyval,
                                                   guint keycode,
                                                   GdkModifierType state,
                                                   gpointer self)
{
	gboolean result;
	result = __lambda81_ (self, keyval, keycode, state);
	return result;
}

static void
__lambda82_ (Block56Data* _data56_,
             const gchar* tab_name)
{
	Preferences* self;
	self = _data56_->self;
	g_return_if_fail (tab_name != NULL);
	if (g_strcmp0 (tab_name, "shortcuts") == 0) {
		gtk_widget_grab_focus ((GtkWidget*) _data56_->search_btn);
	}
}

static void
___lambda82__preferences_tab_switched (Preferences* _sender,
                                       const gchar* tab_name,
                                       gpointer self)
{
	__lambda82_ (self, tab_name);
}

static GtkBox*
preferences_create_shortcuts (Preferences* self)
{
	Block56Data* _data56_;
	GtkGrid* _tmp0_ = NULL;
	gint row = 0;
	gboolean section_end_seen = FALSE;
	gboolean group_end_seen = FALSE;
	GtkScrolledWindow* sw = NULL;
	GtkGrid* _tmp45_;
	GtkWidget* _tmp46_;
	GtkScrolledWindow* _tmp47_ = NULL;
	gchar* _tmp48_;
	gchar* _tmp49_;
	const gchar* _tmp50_;
	GtkLabel* _tmp51_ = NULL;
	GMenu* default_menu = NULL;
	GMenu* _tmp52_;
	GMenu* clear_menu = NULL;
	GMenu* _tmp53_;
	GMenu* menu = NULL;
	GMenu* _tmp54_;
	GtkButton* _tmp55_;
	gchar* _tmp56_;
	gchar* _tmp57_;
	GtkSearchEntry* _tmp58_ = NULL;
	GtkEventControllerKey* search_key = NULL;
	GtkEventControllerKey* _tmp59_;
	GtkEventController* _tmp60_;
	GtkMenuButton* more = NULL;
	gchar* _tmp61_;
	GMenuModel* _tmp62_;
	GtkMenuButton* _tmp63_ = NULL;
	GtkBox* hbox = NULL;
	GtkBox* _tmp64_;
	GtkLabel* _tmp65_;
	GtkBox* box = NULL;
	GtkBox* _tmp66_;
	GtkBox* result;
	g_return_val_if_fail (self != NULL, NULL);
	_data56_ = g_slice_new0 (Block56Data);
	_data56_->_ref_count_ = 1;
	_data56_->self = g_object_ref (self);
	_tmp0_ = (GtkGrid*) gtk_grid_new ();
	gtk_widget_set_halign ((GtkWidget*) _tmp0_, GTK_ALIGN_CENTER);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp0_, 16);
	gtk_grid_set_column_spacing (_tmp0_, 12);
	gtk_grid_set_row_spacing (_tmp0_, 6);
	gtk_grid_set_row_homogeneous (_tmp0_, TRUE);
	g_object_ref_sink (_tmp0_);
	_data56_->grid = _tmp0_;
	row = 0;
	section_end_seen = FALSE;
	group_end_seen = FALSE;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp1_ = FALSE;
			_tmp1_ = TRUE;
			while (TRUE) {
				KeyCommand command = 0;
				if (!_tmp1_) {
					gint _tmp2_;
					_tmp2_ = i;
					i = _tmp2_ + 1;
				}
				_tmp1_ = FALSE;
				if (!(i < ((gint) KEY_COMMAND_NUM))) {
					break;
				}
				command = (KeyCommand) i;
				if (key_command_viewable (command)) {
					gint _tmp44_;
					if (key_command_is_section_start (command)) {
						GtkBox* box = NULL;
						GtkBox* _tmp3_;
						GtkLabel* l = NULL;
						gchar* _tmp7_;
						gchar* _tmp8_;
						gchar* _tmp9_;
						gchar* _tmp10_;
						gchar* _tmp11_;
						gchar* _tmp12_;
						GtkLabel* _tmp13_ = NULL;
						GtkLabel* _tmp14_;
						GtkBox* _tmp15_;
						GtkLabel* _tmp16_;
						GtkGrid* _tmp17_;
						GtkBox* _tmp18_;
						_tmp3_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
						g_object_ref_sink (_tmp3_);
						box = _tmp3_;
						if (section_end_seen) {
							GtkBox* _tmp4_;
							GtkSeparator* _tmp5_;
							GtkSeparator* _tmp6_;
							_tmp4_ = box;
							_tmp5_ = preferences_make_separator (self);
							_tmp6_ = _tmp5_;
							gtk_box_append (_tmp4_, (GtkWidget*) _tmp6_);
							_g_object_unref0 (_tmp6_);
						}
						_tmp7_ = key_command_shortcut_label (command);
						_tmp8_ = _tmp7_;
						_tmp9_ = g_strconcat ("<span size=\"large\" weight=\"bold\">", _tmp8_, NULL);
						_tmp10_ = _tmp9_;
						_tmp11_ = g_strconcat (_tmp10_, "</span>", NULL);
						_tmp12_ = _tmp11_;
						_tmp13_ = (GtkLabel*) gtk_label_new (_tmp12_);
						gtk_widget_set_halign ((GtkWidget*) _tmp13_, GTK_ALIGN_START);
						gtk_label_set_use_markup (_tmp13_, TRUE);
						g_object_ref_sink (_tmp13_);
						_tmp14_ = _tmp13_;
						_g_free0 (_tmp12_);
						_g_free0 (_tmp10_);
						_g_free0 (_tmp8_);
						l = _tmp14_;
						_tmp15_ = box;
						_tmp16_ = l;
						gtk_box_append (_tmp15_, (GtkWidget*) _tmp16_);
						_tmp17_ = _data56_->grid;
						_tmp18_ = box;
						gtk_grid_attach (_tmp17_, (GtkWidget*) _tmp18_, 0, row, 4, 1);
						group_end_seen = FALSE;
						_g_object_unref0 (l);
						_g_object_unref0 (box);
					} else {
						if (key_command_is_section_end (command)) {
							section_end_seen = TRUE;
						} else {
							if (key_command_is_group_start (command)) {
								GtkBox* box = NULL;
								GtkBox* _tmp19_;
								GtkLabel* l = NULL;
								gchar* _tmp23_;
								gchar* _tmp24_;
								GtkLabel* _tmp25_ = NULL;
								GtkLabel* _tmp26_;
								GtkLabel* _tmp27_;
								GtkBox* _tmp28_;
								GtkLabel* _tmp29_;
								GtkGrid* _tmp30_;
								GtkBox* _tmp31_;
								_tmp19_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
								g_object_ref_sink (_tmp19_);
								box = _tmp19_;
								if (group_end_seen) {
									GtkBox* _tmp20_;
									GtkSeparator* _tmp21_;
									GtkSeparator* _tmp22_;
									_tmp20_ = box;
									_tmp21_ = preferences_make_separator (self);
									_tmp22_ = _tmp21_;
									gtk_box_append (_tmp20_, (GtkWidget*) _tmp22_);
									_g_object_unref0 (_tmp22_);
								}
								_tmp23_ = key_command_shortcut_label (command);
								_tmp24_ = _tmp23_;
								_tmp25_ = (GtkLabel*) gtk_label_new (_tmp24_);
								gtk_widget_set_halign ((GtkWidget*) _tmp25_, GTK_ALIGN_START);
								g_object_ref_sink (_tmp25_);
								_tmp26_ = _tmp25_;
								_g_free0 (_tmp24_);
								l = _tmp26_;
								_tmp27_ = l;
								gtk_widget_add_css_class ((GtkWidget*) _tmp27_, "titled");
								_tmp28_ = box;
								_tmp29_ = l;
								gtk_box_append (_tmp28_, (GtkWidget*) _tmp29_);
								_tmp30_ = _data56_->grid;
								_tmp31_ = box;
								gtk_grid_attach (_tmp30_, (GtkWidget*) _tmp31_, 1, row, 3, 1);
								_g_object_unref0 (l);
								_g_object_unref0 (box);
							} else {
								if (key_command_is_group_end (command)) {
									group_end_seen = TRUE;
								} else {
									GtkLabel* prefix = NULL;
									GtkLabel* _tmp32_;
									GtkLabel* label = NULL;
									gchar* _tmp33_;
									gchar* _tmp34_;
									GtkLabel* _tmp35_;
									GtkLabel* _tmp36_;
									GtkStack* shortcut = NULL;
									GtkStack* _tmp37_;
									GtkGrid* _tmp38_;
									GtkLabel* _tmp39_;
									GtkGrid* _tmp40_;
									GtkLabel* _tmp41_;
									GtkGrid* _tmp42_;
									GtkStack* _tmp43_;
									_tmp32_ = preferences_make_label (self, "    ", GTK_ALIGN_END);
									prefix = _tmp32_;
									_tmp33_ = key_command_shortcut_label (command);
									_tmp34_ = _tmp33_;
									_tmp35_ = preferences_make_label (self, _tmp34_, GTK_ALIGN_END);
									_tmp36_ = _tmp35_;
									_g_free0 (_tmp34_);
									label = _tmp36_;
									_tmp37_ = preferences_make_shortcut (self, command);
									shortcut = _tmp37_;
									_tmp38_ = _data56_->grid;
									_tmp39_ = prefix;
									gtk_grid_attach (_tmp38_, (GtkWidget*) _tmp39_, 1, row, 1, 1);
									_tmp40_ = _data56_->grid;
									_tmp41_ = label;
									gtk_grid_attach (_tmp40_, (GtkWidget*) _tmp41_, 2, row, 1, 1);
									_tmp42_ = _data56_->grid;
									_tmp43_ = shortcut;
									gtk_grid_attach (_tmp42_, (GtkWidget*) _tmp43_, 3, row, 1, 1);
									_g_object_unref0 (shortcut);
									_g_object_unref0 (label);
									_g_object_unref0 (prefix);
								}
							}
						}
					}
					_tmp44_ = row;
					row = _tmp44_ + 1;
				}
			}
		}
	}
	_tmp45_ = _data56_->grid;
	_tmp46_ = _g_object_ref0 ((GtkWidget*) _tmp45_);
	_tmp47_ = (GtkScrolledWindow*) gtk_scrolled_window_new ();
	g_object_set (_tmp47_, "vscrollbar-policy", GTK_POLICY_AUTOMATIC, NULL);
	g_object_set (_tmp47_, "hscrollbar-policy", GTK_POLICY_NEVER, NULL);
	gtk_scrolled_window_set_overlay_scrolling (_tmp47_, FALSE);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp47_, TRUE);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp47_, TRUE);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp47_, 20);
	gtk_scrolled_window_set_child (_tmp47_, _tmp46_);
	_g_object_unref0 (_tmp46_);
	g_object_ref_sink (_tmp47_);
	sw = _tmp47_;
	gtk_widget_set_size_request ((GtkWidget*) sw, -1, 400);
	_tmp48_ = g_strdup (_ ("Double-click to edit shortcut.  Select + Delete to remove shortcut."));
	_g_free0 (self->priv->_shortcut_inst_start_str);
	self->priv->_shortcut_inst_start_str = _tmp48_;
	_tmp49_ = g_strdup (_ ("Escape to cancel.  Press key combination to set."));
	_g_free0 (self->priv->_shortcut_inst_edit_str);
	self->priv->_shortcut_inst_edit_str = _tmp49_;
	_tmp50_ = self->priv->_shortcut_inst_start_str;
	_tmp51_ = (GtkLabel*) gtk_label_new (_tmp50_);
	gtk_widget_set_halign ((GtkWidget*) _tmp51_, GTK_ALIGN_CENTER);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp51_, TRUE);
	g_object_ref_sink (_tmp51_);
	_g_object_unref0 (self->priv->_shortcut_instructions);
	self->priv->_shortcut_instructions = _tmp51_;
	_tmp52_ = g_menu_new ();
	default_menu = _tmp52_;
	g_menu_append (default_menu, _ ("Set Minder Defaults"), "prefs.action_set_minder_shortcuts");
	_tmp53_ = g_menu_new ();
	clear_menu = _tmp53_;
	g_menu_append (clear_menu, _ ("Clear All Shortcuts"), "prefs.action_clear_all_shortcuts");
	_tmp54_ = g_menu_new ();
	menu = _tmp54_;
	g_menu_append_section (menu, NULL, (GMenuModel*) default_menu);
	g_menu_append_section (menu, NULL, (GMenuModel*) clear_menu);
	_tmp55_ = (GtkButton*) gtk_button_new_from_icon_name ("system-search-symbolic");
	g_object_ref_sink (_tmp55_);
	_data56_->search_btn = _tmp55_;
	_tmp56_ = g_strdup (_ ("Search commands"));
	_tmp57_ = g_strdup (_ ("Search shortcuts"));
	_tmp58_ = (GtkSearchEntry*) gtk_search_entry_new ();
	gtk_widget_set_halign ((GtkWidget*) _tmp58_, GTK_ALIGN_FILL);
	g_object_set (_tmp58_, "placeholder-text", _tmp56_, NULL);
	_g_free0 (_tmp56_);
	gtk_widget_set_visible ((GtkWidget*) _tmp58_, FALSE);
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp58_, _tmp57_);
	_g_free0 (_tmp57_);
	g_object_ref_sink (_tmp58_);
	_data56_->search = _tmp58_;
	_tmp59_ = (GtkEventControllerKey*) gtk_event_controller_key_new ();
	search_key = _tmp59_;
	_tmp60_ = _g_object_ref0 ((GtkEventController*) search_key);
	gtk_widget_add_controller ((GtkWidget*) _data56_->search, _tmp60_);
	g_signal_connect_data (_data56_->search, "search-changed", (GCallback) ___lambda79__gtk_search_entry_search_changed, block56_data_ref (_data56_), (GClosureNotify) block56_data_unref, 0);
	g_signal_connect_data (_data56_->search_btn, "clicked", (GCallback) ___lambda80__gtk_button_clicked, block56_data_ref (_data56_), (GClosureNotify) block56_data_unref, 0);
	g_signal_connect_data (search_key, "key-pressed", (GCallback) ___lambda81__gtk_event_controller_key_key_pressed, block56_data_ref (_data56_), (GClosureNotify) block56_data_unref, 0);
	_tmp61_ = g_strdup ("view-more-symbolic");
	_tmp62_ = _g_object_ref0 ((GMenuModel*) menu);
	_tmp63_ = (GtkMenuButton*) gtk_menu_button_new ();
	gtk_widget_set_halign ((GtkWidget*) _tmp63_, GTK_ALIGN_END);
	gtk_menu_button_set_icon_name (_tmp63_, _tmp61_);
	_g_free0 (_tmp61_);
	gtk_menu_button_set_menu_model (_tmp63_, _tmp62_);
	_g_object_unref0 (_tmp62_);
	g_object_ref_sink (_tmp63_);
	more = _tmp63_;
	_tmp64_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5);
	g_object_ref_sink (_tmp64_);
	hbox = _tmp64_;
	_tmp65_ = self->priv->_shortcut_instructions;
	gtk_box_append (hbox, (GtkWidget*) _tmp65_);
	gtk_box_append (hbox, (GtkWidget*) _data56_->search_btn);
	gtk_box_append (hbox, (GtkWidget*) more);
	_tmp66_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
	g_object_ref_sink (_tmp66_);
	box = _tmp66_;
	gtk_box_append (box, (GtkWidget*) hbox);
	gtk_box_append (box, (GtkWidget*) _data56_->search);
	gtk_box_append (box, (GtkWidget*) sw);
	g_signal_connect_data (self, "tab-switched", (GCallback) ___lambda82__preferences_tab_switched, block56_data_ref (_data56_), (GClosureNotify) block56_data_unref, 0);
	result = box;
	_g_object_unref0 (hbox);
	_g_object_unref0 (more);
	_g_object_unref0 (search_key);
	_g_object_unref0 (menu);
	_g_object_unref0 (clear_menu);
	_g_object_unref0 (default_menu);
	_g_object_unref0 (sw);
	block56_data_unref (_data56_);
	_data56_ = NULL;
	return result;
}

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

static void
preferences_update_search_results (Preferences* self,
                                   GtkGrid* grid,
                                   const gchar* text)
{
	GtkWidget* current_section = NULL;
	GtkWidget* current_group = NULL;
	gint row = 0;
	g_return_if_fail (self != NULL);
	g_return_if_fail (grid != NULL);
	g_return_if_fail (text != NULL);
	current_section = NULL;
	current_group = NULL;
	row = 0;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				KeyCommand command = 0;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				if (!(i < ((gint) KEY_COMMAND_NUM))) {
					break;
				}
				command = (KeyCommand) i;
				if (key_command_viewable (command)) {
					gint _tmp30_;
					if (key_command_is_section_start (command)) {
						GtkWidget* _tmp2_;
						GtkWidget* _tmp3_;
						GtkWidget* _tmp4_;
						GtkWidget* _tmp5_;
						_tmp2_ = gtk_grid_get_child_at (grid, 0, row);
						_tmp3_ = _g_object_ref0 (_tmp2_);
						_g_object_unref0 (current_section);
						current_section = _tmp3_;
						_tmp4_ = current_section;
						_vala_assert (_tmp4_ != NULL, "current_section != null");
						_tmp5_ = current_section;
						if (_tmp5_ != NULL) {
							GtkWidget* _tmp6_;
							_tmp6_ = current_section;
							gtk_widget_set_visible (_tmp6_, FALSE);
						}
					} else {
						if (key_command_is_group_start (command)) {
							GtkWidget* _tmp7_;
							GtkWidget* _tmp8_;
							GtkWidget* _tmp9_;
							GtkWidget* _tmp10_;
							_tmp7_ = gtk_grid_get_child_at (grid, 1, row);
							_tmp8_ = _g_object_ref0 (_tmp7_);
							_g_object_unref0 (current_group);
							current_group = _tmp8_;
							_tmp9_ = current_group;
							_vala_assert (_tmp9_ != NULL, "current_group != null");
							_tmp10_ = current_group;
							if (_tmp10_ != NULL) {
								GtkWidget* _tmp11_;
								_tmp11_ = current_group;
								gtk_widget_set_visible (_tmp11_, FALSE);
							}
						} else {
							gboolean _tmp12_ = FALSE;
							if (!key_command_is_section_end (command)) {
								_tmp12_ = !key_command_is_group_end (command);
							} else {
								_tmp12_ = FALSE;
							}
							if (_tmp12_) {
								gboolean _tmp13_ = FALSE;
								gboolean matched = FALSE;
								if (g_strcmp0 (text, "") == 0) {
									_tmp13_ = TRUE;
								} else {
									gchar* _tmp14_;
									gchar* _tmp15_;
									gchar* _tmp16_;
									gchar* _tmp17_;
									gchar* _tmp18_;
									gchar* _tmp19_;
									_tmp14_ = key_command_shortcut_label (command);
									_tmp15_ = _tmp14_;
									_tmp16_ = g_utf8_strdown (_tmp15_, (gssize) -1);
									_tmp17_ = _tmp16_;
									_tmp18_ = g_utf8_strdown (text, (gssize) -1);
									_tmp19_ = _tmp18_;
									_tmp13_ = string_contains (_tmp17_, _tmp19_);
									_g_free0 (_tmp19_);
									_g_free0 (_tmp17_);
									_g_free0 (_tmp15_);
								}
								matched = _tmp13_;
								if (matched) {
									GtkWidget* _tmp20_;
									GtkWidget* _tmp22_;
									_tmp20_ = current_section;
									if (_tmp20_ != NULL) {
										GtkWidget* _tmp21_;
										_tmp21_ = current_section;
										gtk_widget_set_visible (_tmp21_, matched);
									}
									_tmp22_ = current_group;
									if (_tmp22_ != NULL) {
										GtkWidget* _tmp23_;
										_tmp23_ = current_group;
										gtk_widget_set_visible (_tmp23_, matched);
									}
								}
								{
									gint j = 0;
									j = 1;
									{
										gboolean _tmp24_ = FALSE;
										_tmp24_ = TRUE;
										while (TRUE) {
											GtkWidget* w = NULL;
											GtkWidget* _tmp26_;
											GtkWidget* _tmp27_;
											GtkWidget* _tmp28_;
											if (!_tmp24_) {
												gint _tmp25_;
												_tmp25_ = j;
												j = _tmp25_ + 1;
											}
											_tmp24_ = FALSE;
											if (!(j < 4)) {
												break;
											}
											_tmp26_ = gtk_grid_get_child_at (grid, j, row);
											_tmp27_ = _g_object_ref0 (_tmp26_);
											w = _tmp27_;
											_tmp28_ = w;
											if (_tmp28_ != NULL) {
												GtkWidget* _tmp29_;
												_tmp29_ = w;
												gtk_widget_set_visible (_tmp29_, matched);
											}
											_g_object_unref0 (w);
										}
									}
								}
							}
						}
					}
					_tmp30_ = row;
					row = _tmp30_ + 1;
				}
			}
		}
	}
	_g_object_unref0 (current_group);
	_g_object_unref0 (current_section);
}

static Block57Data*
block57_data_ref (Block57Data* _data57_)
{
	g_atomic_int_inc (&_data57_->_ref_count_);
	return _data57_;
}

static void
block57_data_unref (void * _userdata_)
{
	Block57Data* _data57_;
	_data57_ = (Block57Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data57_->_ref_count_)) {
		Preferences* self;
		self = _data57_->self;
		_g_object_unref0 (_data57_->grid);
		_g_object_unref0 (self);
		g_slice_free (Block57Data, _data57_);
	}
}

static void
__lambda83_ (Block57Data* _data57_,
             const gchar* tab_name)
{
	Preferences* self;
	self = _data57_->self;
	g_return_if_fail (tab_name != NULL);
	if (g_strcmp0 (tab_name, "advanced") == 0) {
		GtkWidget* w = NULL;
		GtkWidget* _tmp0_;
		GtkWidget* _tmp1_;
		GtkWidget* _tmp2_;
		_tmp0_ = gtk_grid_get_child_at (_data57_->grid, 0, 1);
		_tmp1_ = _g_object_ref0 (_tmp0_);
		w = _tmp1_;
		_tmp2_ = w;
		gtk_widget_grab_focus (_tmp2_);
		_g_object_unref0 (w);
	}
}

static void
___lambda83__preferences_tab_switched (Preferences* _sender,
                                       const gchar* tab_name,
                                       gpointer self)
{
	__lambda83_ (self, tab_name);
}

static GtkGrid*
preferences_create_advanced (Preferences* self)
{
	Block57Data* _data57_;
	GtkGrid* _tmp0_ = NULL;
	gint row = 0;
	GtkLabel* _tmp1_;
	GtkLabel* _tmp2_;
	GtkSwitch* _tmp3_;
	GtkSwitch* _tmp4_;
	gint _tmp5_;
	GtkLabel* _tmp6_;
	GtkLabel* _tmp7_;
	GtkSwitch* _tmp8_;
	GtkSwitch* _tmp9_;
	gint _tmp10_;
	GtkSeparator* _tmp11_;
	GtkSeparator* _tmp12_;
	gint _tmp13_;
	GtkBox* box = NULL;
	GtkBox* _tmp14_ = NULL;
	GtkLabel* _tmp15_;
	GtkLabel* _tmp16_;
	gint _tmp17_ = 0;
	gchar** _tmp18_;
	gchar** _tmp19_;
	gint _tmp19__length1;
	GtkDropDown* _tmp20_;
	GtkDropDown* _tmp21_;
	gint _tmp22_;
	GtkGrid* _tmp23_;
	GtkGrid* result;
	g_return_val_if_fail (self != NULL, NULL);
	_data57_ = g_slice_new0 (Block57Data);
	_data57_->_ref_count_ = 1;
	_data57_->self = g_object_ref (self);
	_tmp0_ = (GtkGrid*) gtk_grid_new ();
	gtk_widget_set_halign ((GtkWidget*) _tmp0_, GTK_ALIGN_CENTER);
	gtk_grid_set_column_spacing (_tmp0_, 12);
	gtk_grid_set_row_spacing (_tmp0_, 6);
	g_object_ref_sink (_tmp0_);
	_data57_->grid = _tmp0_;
	row = 0;
	_tmp1_ = preferences_make_label (self, _ ("Show upgrade dialog when file upgrade is needed"), GTK_ALIGN_END);
	_tmp2_ = _tmp1_;
	gtk_grid_attach (_data57_->grid, (GtkWidget*) _tmp2_, 0, row, 1, 1);
	_g_object_unref0 (_tmp2_);
	_tmp3_ = preferences_make_switch (self, "ask-for-upgrade-action");
	_tmp4_ = _tmp3_;
	gtk_grid_attach (_data57_->grid, (GtkWidget*) _tmp4_, 1, row, 1, 1);
	_g_object_unref0 (_tmp4_);
	_tmp5_ = row;
	row = _tmp5_ + 1;
	_tmp6_ = preferences_make_label (self, _ ("Show temporary directory containing current mindmap in map sidebar"), GTK_ALIGN_END);
	_tmp7_ = _tmp6_;
	gtk_grid_attach (_data57_->grid, (GtkWidget*) _tmp7_, 0, row, 1, 1);
	_g_object_unref0 (_tmp7_);
	_tmp8_ = preferences_make_switch (self, "show-temp-dir-in-map-sidebar");
	_tmp9_ = _tmp8_;
	gtk_grid_attach (_data57_->grid, (GtkWidget*) _tmp9_, 1, row, 1, 1);
	_g_object_unref0 (_tmp9_);
	_tmp10_ = row;
	row = _tmp10_ + 1;
	_tmp11_ = preferences_make_separator (self);
	_tmp12_ = _tmp11_;
	gtk_grid_attach (_data57_->grid, (GtkWidget*) _tmp12_, 0, row, 4, 1);
	_g_object_unref0 (_tmp12_);
	_tmp13_ = row;
	row = _tmp13_ + 1;
	_tmp14_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
	gtk_widget_set_halign ((GtkWidget*) _tmp14_, GTK_ALIGN_FILL);
	g_object_ref_sink (_tmp14_);
	box = _tmp14_;
	_tmp15_ = preferences_make_label (self, _ ("Default file upgrade action"), GTK_ALIGN_START);
	_tmp16_ = _tmp15_;
	gtk_box_append (box, (GtkWidget*) _tmp16_);
	_g_object_unref0 (_tmp16_);
	_tmp18_ = upgrade_action_labels (&_tmp17_);
	_tmp19_ = _tmp18_;
	_tmp19__length1 = _tmp17_;
	_tmp20_ = preferences_make_enum (self, "upgrade-action", _tmp19_, (gint) _tmp17_);
	_tmp21_ = _tmp20_;
	gtk_box_append (box, (GtkWidget*) _tmp21_);
	_g_object_unref0 (_tmp21_);
	_tmp19_ = (_vala_array_free (_tmp19_, _tmp19__length1, (GDestroyNotify) g_free), NULL);
	gtk_grid_attach (_data57_->grid, (GtkWidget*) box, 0, row, 5, 1);
	_tmp22_ = row;
	row = _tmp22_ + 1;
	g_signal_connect_data (self, "tab-switched", (GCallback) ___lambda83__preferences_tab_switched, block57_data_ref (_data57_), (GClosureNotify) block57_data_unref, 0);
	_tmp23_ = _g_object_ref0 (_data57_->grid);
	result = _tmp23_;
	_g_object_unref0 (box);
	block57_data_unref (_data57_);
	_data57_ = NULL;
	return result;
}

static GtkLabel*
preferences_make_label (Preferences* self,
                        const gchar* label,
                        GtkAlign align)
{
	GtkLabel* w = NULL;
	GtkLabel* _tmp0_ = NULL;
	GtkLabel* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (label != NULL, NULL);
	_tmp0_ = (GtkLabel*) gtk_label_new (label);
	gtk_widget_set_halign ((GtkWidget*) _tmp0_, align);
	g_object_ref_sink (_tmp0_);
	w = _tmp0_;
	result = w;
	return result;
}

static GtkSwitch*
preferences_make_switch (Preferences* self,
                         const gchar* setting)
{
	GtkSwitch* w = NULL;
	GtkSwitch* _tmp0_ = NULL;
	GSettings* _tmp1_;
	GtkSwitch* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (setting != NULL, NULL);
	_tmp0_ = (GtkSwitch*) gtk_switch_new ();
	gtk_widget_set_halign ((GtkWidget*) _tmp0_, GTK_ALIGN_START);
	gtk_widget_set_valign ((GtkWidget*) _tmp0_, GTK_ALIGN_CENTER);
	g_object_ref_sink (_tmp0_);
	w = _tmp0_;
	_tmp1_ = minder_settings;
	g_settings_bind (_tmp1_, setting, (GObject*) w, "active", G_SETTINGS_BIND_DEFAULT);
	result = w;
	return result;
}

static GtkSpinButton*
preferences_make_spinner (Preferences* self,
                          const gchar* setting,
                          gint min_value,
                          gint max_value,
                          gint step)
{
	GtkSpinButton* w = NULL;
	GtkSpinButton* _tmp0_;
	GSettings* _tmp1_;
	GtkSpinButton* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (setting != NULL, NULL);
	_tmp0_ = (GtkSpinButton*) gtk_spin_button_new_with_range ((gdouble) min_value, (gdouble) max_value, (gdouble) step);
	g_object_ref_sink (_tmp0_);
	w = _tmp0_;
	_tmp1_ = minder_settings;
	g_settings_bind (_tmp1_, setting, (GObject*) w, "value", G_SETTINGS_BIND_DEFAULT);
	result = w;
	return result;
}

static GtkDropDown*
preferences_make_enum (Preferences* self,
                       const gchar* setting,
                       gchar** labels,
                       gint labels_length1)
{
	GtkDropDown* w = NULL;
	GtkDropDown* _tmp0_ = NULL;
	GSettings* _tmp1_;
	GtkDropDown* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (setting != NULL, NULL);
	_tmp0_ = (GtkDropDown*) gtk_drop_down_new_from_strings (labels);
	gtk_widget_set_halign ((GtkWidget*) _tmp0_, GTK_ALIGN_FILL);
	g_object_ref_sink (_tmp0_);
	w = _tmp0_;
	_tmp1_ = minder_settings;
	g_settings_bind (_tmp1_, setting, (GObject*) w, "selected", G_SETTINGS_BIND_DEFAULT);
	result = w;
	return result;
}

static GtkImage*
preferences_make_info (Preferences* self,
                       const gchar* detail)
{
	GtkImage* w = NULL;
	gchar* _tmp0_;
	GtkImage* _tmp1_ = NULL;
	GtkImage* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (detail != NULL, NULL);
	_tmp0_ = g_strdup (detail);
	_tmp1_ = (GtkImage*) gtk_image_new_from_icon_name ("dialog-information-symbolic");
	gtk_widget_set_halign ((GtkWidget*) _tmp1_, GTK_ALIGN_START);
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp1_, _tmp0_);
	_g_free0 (_tmp0_);
	g_object_ref_sink (_tmp1_);
	w = _tmp1_;
	result = w;
	return result;
}

static Block58Data*
block58_data_ref (Block58Data* _data58_)
{
	g_atomic_int_inc (&_data58_->_ref_count_);
	return _data58_;
}

static void
block58_data_unref (void * _userdata_)
{
	Block58Data* _data58_;
	_data58_ = (Block58Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data58_->_ref_count_)) {
		Preferences* self;
		self = _data58_->self;
		_g_object_unref0 (_data58_->stack);
		_g_object_unref0 (_data58_->nl);
		_g_object_unref0 (_data58_->sl);
		_shortcut_unref0 (_data58_->shortcut);
		_g_free0 (_data58_->enter);
		_g_free0 (_data58_->disabled);
		_g_object_unref0 (self);
		g_slice_free (Block58Data, _data58_);
	}
}

static void
__lambda70_ (Block58Data* _data58_)
{
	Preferences* self;
	GtkShortcutLabel* _tmp0_;
	self = _data58_->self;
	_tmp0_ = _data58_->sl;
	gtk_widget_add_css_class ((GtkWidget*) _tmp0_, "shortcut-selected");
}

static void
___lambda70__gtk_event_controller_focus_enter (GtkEventControllerFocus* _sender,
                                               gpointer self)
{
	__lambda70_ (self);
}

static void
__lambda71_ (Block58Data* _data58_)
{
	Preferences* self;
	GtkShortcutLabel* _tmp0_;
	self = _data58_->self;
	_tmp0_ = _data58_->sl;
	gtk_widget_remove_css_class ((GtkWidget*) _tmp0_, "shortcut-selected");
}

static void
___lambda71__gtk_event_controller_focus_leave (GtkEventControllerFocus* _sender,
                                               gpointer self)
{
	__lambda71_ (self);
}

static void
__lambda72_ (Block58Data* _data58_,
             gint n_press,
             gdouble x,
             gdouble y)
{
	Preferences* self;
	GtkShortcutLabel* _tmp0_;
	self = _data58_->self;
	_tmp0_ = _data58_->sl;
	gtk_widget_grab_focus ((GtkWidget*) _tmp0_);
	if (n_press == 2) {
		GtkEditableLabel* _tmp1_;
		const gchar* _tmp2_;
		GtkLabel* _tmp3_;
		const gchar* _tmp4_;
		GtkStack* _tmp5_;
		GtkEditableLabel* _tmp6_;
		_tmp1_ = _data58_->nl;
		_tmp2_ = _data58_->enter;
		gtk_editable_set_text ((GtkEditable*) _tmp1_, _tmp2_);
		_tmp3_ = self->priv->_shortcut_instructions;
		_tmp4_ = self->priv->_shortcut_inst_edit_str;
		gtk_label_set_label (_tmp3_, _tmp4_);
		_tmp5_ = _data58_->stack;
		gtk_stack_set_visible_child_name (_tmp5_, "unset");
		_tmp6_ = _data58_->nl;
		gtk_widget_grab_focus ((GtkWidget*) _tmp6_);
	}
}

static void
___lambda72__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                        gint n_press,
                                        gdouble x,
                                        gdouble y,
                                        gpointer self)
{
	__lambda72_ (self, n_press, x, y);
}

static gboolean
__lambda73_ (Block58Data* _data58_,
             guint keyval,
             guint keycode,
             GdkModifierType state)
{
	Preferences* self;
	gboolean _tmp0_ = FALSE;
	gboolean result;
	self = _data58_->self;
	if (keyval == GDK_KEY_Delete) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = keyval == GDK_KEY_BackSpace;
	}
	if (_tmp0_) {
		MainWindow* _tmp1_;
		Shortcuts* _tmp2_;
		Shortcuts* _tmp3_;
		GtkEditableLabel* _tmp4_;
		const gchar* _tmp5_;
		GtkEditableLabel* _tmp6_;
		GtkStack* _tmp7_;
		GtkEditableLabel* _tmp8_;
		_tmp1_ = self->priv->_win;
		_tmp2_ = main_window_get_shortcuts (_tmp1_);
		_tmp3_ = _tmp2_;
		shortcuts_clear_shortcut (_tmp3_, _data58_->command);
		_shortcut_unref0 (_data58_->shortcut);
		_data58_->shortcut = NULL;
		_tmp4_ = _data58_->nl;
		_tmp5_ = _data58_->disabled;
		gtk_editable_set_text ((GtkEditable*) _tmp4_, _tmp5_);
		_tmp6_ = _data58_->nl;
		gtk_widget_set_cursor_from_name ((GtkWidget*) _tmp6_, "pointer");
		_tmp7_ = _data58_->stack;
		gtk_stack_set_visible_child_name (_tmp7_, "unset");
		_tmp8_ = _data58_->nl;
		gtk_widget_grab_focus ((GtkWidget*) _tmp8_);
		result = TRUE;
		return result;
	} else {
		if (keyval == GDK_KEY_Return) {
			GtkEditableLabel* _tmp9_;
			const gchar* _tmp10_;
			GtkEditableLabel* _tmp11_;
			GtkLabel* _tmp12_;
			const gchar* _tmp13_;
			GtkStack* _tmp14_;
			GtkEditableLabel* _tmp15_;
			_tmp9_ = _data58_->nl;
			_tmp10_ = _data58_->enter;
			gtk_editable_set_text ((GtkEditable*) _tmp9_, _tmp10_);
			_tmp11_ = _data58_->nl;
			gtk_widget_set_cursor_from_name ((GtkWidget*) _tmp11_, "text");
			_tmp12_ = self->priv->_shortcut_instructions;
			_tmp13_ = self->priv->_shortcut_inst_edit_str;
			gtk_label_set_label (_tmp12_, _tmp13_);
			_tmp14_ = _data58_->stack;
			gtk_stack_set_visible_child_name (_tmp14_, "unset");
			_tmp15_ = _data58_->nl;
			gtk_widget_grab_focus ((GtkWidget*) _tmp15_);
			result = TRUE;
			return result;
		}
	}
	result = FALSE;
	return result;
}

static gboolean
___lambda73__gtk_event_controller_key_key_pressed (GtkEventControllerKey* _sender,
                                                   guint keyval,
                                                   guint keycode,
                                                   GdkModifierType state,
                                                   gpointer self)
{
	gboolean result;
	result = __lambda73_ (self, keyval, keycode, state);
	return result;
}

static void
__lambda74_ (Block58Data* _data58_)
{
	Preferences* self;
	GtkEditableLabel* _tmp0_;
	self = _data58_->self;
	_tmp0_ = _data58_->nl;
	gtk_widget_add_css_class ((GtkWidget*) _tmp0_, "shortcut-selected");
}

static void
___lambda74__gtk_event_controller_focus_enter (GtkEventControllerFocus* _sender,
                                               gpointer self)
{
	__lambda74_ (self);
}

static void
__lambda75_ (Block58Data* _data58_)
{
	Preferences* self;
	GtkEditableLabel* _tmp0_;
	GtkEditableLabel* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	self = _data58_->self;
	_tmp0_ = _data58_->nl;
	gtk_widget_remove_css_class ((GtkWidget*) _tmp0_, "shortcut-selected");
	_tmp1_ = _data58_->nl;
	_tmp2_ = gtk_editable_get_text ((GtkEditable*) _tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = _data58_->enter;
	if (g_strcmp0 (_tmp3_, _tmp4_) == 0) {
		Shortcut* _tmp5_;
		GtkLabel* _tmp11_;
		const gchar* _tmp12_;
		_tmp5_ = _data58_->shortcut;
		if (_tmp5_ != NULL) {
			GtkStack* _tmp6_;
			GtkShortcutLabel* _tmp7_;
			_tmp6_ = _data58_->stack;
			gtk_stack_set_visible_child_name (_tmp6_, "set");
			_tmp7_ = _data58_->sl;
			gtk_widget_grab_focus ((GtkWidget*) _tmp7_);
		} else {
			GtkEditableLabel* _tmp8_;
			const gchar* _tmp9_;
			GtkEditableLabel* _tmp10_;
			_tmp8_ = _data58_->nl;
			_tmp9_ = _data58_->disabled;
			gtk_editable_set_text ((GtkEditable*) _tmp8_, _tmp9_);
			_tmp10_ = _data58_->nl;
			gtk_widget_set_cursor_from_name ((GtkWidget*) _tmp10_, "pointer");
		}
		_tmp11_ = self->priv->_shortcut_instructions;
		_tmp12_ = self->priv->_shortcut_inst_start_str;
		gtk_label_set_label (_tmp11_, _tmp12_);
	}
}

static void
___lambda75__gtk_event_controller_focus_leave (GtkEventControllerFocus* _sender,
                                               gpointer self)
{
	__lambda75_ (self);
}

static void
__lambda76_ (Block58Data* _data58_,
             gint n_press,
             gdouble x,
             gdouble y)
{
	Preferences* self;
	GtkEditableLabel* _tmp0_;
	self = _data58_->self;
	_tmp0_ = _data58_->nl;
	gtk_widget_grab_focus ((GtkWidget*) _tmp0_);
	if (n_press == 2) {
		GtkEditableLabel* _tmp1_;
		const gchar* _tmp2_;
		GtkEditableLabel* _tmp3_;
		GtkLabel* _tmp4_;
		const gchar* _tmp5_;
		_tmp1_ = _data58_->nl;
		_tmp2_ = _data58_->enter;
		gtk_editable_set_text ((GtkEditable*) _tmp1_, _tmp2_);
		_tmp3_ = _data58_->nl;
		gtk_widget_set_cursor_from_name ((GtkWidget*) _tmp3_, "text");
		_tmp4_ = self->priv->_shortcut_instructions;
		_tmp5_ = self->priv->_shortcut_inst_edit_str;
		gtk_label_set_label (_tmp4_, _tmp5_);
	}
}

static void
___lambda76__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                        gint n_press,
                                        gdouble x,
                                        gdouble y,
                                        gpointer self)
{
	__lambda76_ (self, n_press, x, y);
}

static gpointer
_shortcut_ref0 (gpointer self)
{
	return self ? shortcut_ref (self) : NULL;
}

static gboolean
__lambda77_ (Block58Data* _data58_,
             guint keyval,
             guint keycode,
             GdkModifierType state)
{
	Preferences* self;
	GtkEditableLabel* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gboolean result;
	self = _data58_->self;
	_tmp0_ = _data58_->nl;
	_tmp1_ = gtk_editable_get_text ((GtkEditable*) _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _data58_->disabled;
	if (g_strcmp0 (_tmp2_, _tmp3_) == 0) {
		if (keyval == GDK_KEY_Return) {
			GtkEditableLabel* _tmp4_;
			const gchar* _tmp5_;
			GtkEditableLabel* _tmp6_;
			GtkLabel* _tmp7_;
			const gchar* _tmp8_;
			_tmp4_ = _data58_->nl;
			_tmp5_ = _data58_->enter;
			gtk_editable_set_text ((GtkEditable*) _tmp4_, _tmp5_);
			_tmp6_ = _data58_->nl;
			gtk_widget_set_cursor_from_name ((GtkWidget*) _tmp6_, "text");
			_tmp7_ = self->priv->_shortcut_instructions;
			_tmp8_ = self->priv->_shortcut_inst_edit_str;
			gtk_label_set_label (_tmp7_, _tmp8_);
			result = TRUE;
			return result;
		}
	} else {
		gboolean _tmp9_ = FALSE;
		if (keyval == GDK_KEY_Delete) {
			_tmp9_ = TRUE;
		} else {
			_tmp9_ = keyval == GDK_KEY_BackSpace;
		}
		if (_tmp9_) {
			MainWindow* _tmp10_;
			Shortcuts* _tmp11_;
			Shortcuts* _tmp12_;
			GtkEditableLabel* _tmp13_;
			const gchar* _tmp14_;
			GtkEditableLabel* _tmp15_;
			GtkLabel* _tmp16_;
			const gchar* _tmp17_;
			_tmp10_ = self->priv->_win;
			_tmp11_ = main_window_get_shortcuts (_tmp10_);
			_tmp12_ = _tmp11_;
			shortcuts_clear_shortcut (_tmp12_, _data58_->command);
			_shortcut_unref0 (_data58_->shortcut);
			_data58_->shortcut = NULL;
			_tmp13_ = _data58_->nl;
			_tmp14_ = _data58_->disabled;
			gtk_editable_set_text ((GtkEditable*) _tmp13_, _tmp14_);
			_tmp15_ = _data58_->nl;
			gtk_widget_set_cursor_from_name ((GtkWidget*) _tmp15_, "pointer");
			_tmp16_ = self->priv->_shortcut_instructions;
			_tmp17_ = self->priv->_shortcut_inst_start_str;
			gtk_label_set_label (_tmp16_, _tmp17_);
		} else {
			if (keyval == GDK_KEY_Escape) {
				Shortcut* _tmp18_;
				GtkLabel* _tmp24_;
				const gchar* _tmp25_;
				_tmp18_ = _data58_->shortcut;
				if (_tmp18_ != NULL) {
					GtkStack* _tmp19_;
					GtkShortcutLabel* _tmp20_;
					_tmp19_ = _data58_->stack;
					gtk_stack_set_visible_child_name (_tmp19_, "set");
					_tmp20_ = _data58_->sl;
					gtk_widget_grab_focus ((GtkWidget*) _tmp20_);
				} else {
					GtkEditableLabel* _tmp21_;
					const gchar* _tmp22_;
					GtkEditableLabel* _tmp23_;
					_tmp21_ = _data58_->nl;
					_tmp22_ = _data58_->disabled;
					gtk_editable_set_text ((GtkEditable*) _tmp21_, _tmp22_);
					_tmp23_ = _data58_->nl;
					gtk_widget_set_cursor_from_name ((GtkWidget*) _tmp23_, "pointer");
				}
				_tmp24_ = self->priv->_shortcut_instructions;
				_tmp25_ = self->priv->_shortcut_inst_start_str;
				gtk_label_set_label (_tmp24_, _tmp25_);
			} else {
				gboolean _tmp26_ = FALSE;
				gboolean _tmp27_ = FALSE;
				gboolean _tmp28_ = FALSE;
				gboolean _tmp29_ = FALSE;
				gboolean _tmp30_ = FALSE;
				gboolean _tmp31_ = FALSE;
				if (keyval != GDK_KEY_Control_L) {
					_tmp31_ = keyval != GDK_KEY_Control_R;
				} else {
					_tmp31_ = FALSE;
				}
				if (_tmp31_) {
					_tmp30_ = keyval != GDK_KEY_Shift_L;
				} else {
					_tmp30_ = FALSE;
				}
				if (_tmp30_) {
					_tmp29_ = keyval != GDK_KEY_Shift_L;
				} else {
					_tmp29_ = FALSE;
				}
				if (_tmp29_) {
					_tmp28_ = keyval != GDK_KEY_Alt_L;
				} else {
					_tmp28_ = FALSE;
				}
				if (_tmp28_) {
					_tmp27_ = keyval != GDK_KEY_Alt_R;
				} else {
					_tmp27_ = FALSE;
				}
				if (_tmp27_) {
					_tmp26_ = keyval != ((guint) 0);
				} else {
					_tmp26_ = FALSE;
				}
				if (_tmp26_) {
					gboolean control = FALSE;
					gboolean shift = FALSE;
					gboolean alt = FALSE;
					Shortcut* conflict = NULL;
					MainWindow* _tmp32_;
					Shortcuts* _tmp33_;
					Shortcuts* _tmp34_;
					Shortcut* _tmp35_;
					Shortcut* scut = NULL;
					Shortcut* _tmp36_;
					Shortcut* _tmp37_;
					control = (gboolean) ((state & GDK_CONTROL_MASK) == GDK_CONTROL_MASK);
					shift = (gboolean) ((state & GDK_SHIFT_MASK) == GDK_SHIFT_MASK);
					alt = (gboolean) ((state & GDK_ALT_MASK) == GDK_ALT_MASK);
					_tmp32_ = self->priv->_win;
					_tmp33_ = main_window_get_shortcuts (_tmp32_);
					_tmp34_ = _tmp33_;
					_tmp35_ = shortcuts_shortcut_conflicts_with (_tmp34_, keyval, control, shift, alt, _data58_->command);
					conflict = _tmp35_;
					_tmp36_ = shortcut_new (keyval, control, shift, alt, _data58_->command);
					scut = _tmp36_;
					_tmp37_ = conflict;
					if (_tmp37_ == NULL) {
						Shortcut* _tmp38_;
						Shortcut* _tmp39_;
						MainWindow* _tmp40_;
						Shortcuts* _tmp41_;
						Shortcuts* _tmp42_;
						Shortcut* _tmp43_;
						GtkShortcutLabel* _tmp44_;
						Shortcut* _tmp45_;
						gchar* _tmp46_;
						gchar* _tmp47_;
						GtkStack* _tmp48_;
						GtkShortcutLabel* _tmp49_;
						GtkLabel* _tmp50_;
						const gchar* _tmp51_;
						_tmp38_ = scut;
						_tmp39_ = _shortcut_ref0 (_tmp38_);
						_shortcut_unref0 (_data58_->shortcut);
						_data58_->shortcut = _tmp39_;
						_tmp40_ = self->priv->_win;
						_tmp41_ = main_window_get_shortcuts (_tmp40_);
						_tmp42_ = _tmp41_;
						_tmp43_ = _data58_->shortcut;
						shortcuts_set_shortcut (_tmp42_, _tmp43_);
						_tmp44_ = _data58_->sl;
						_tmp45_ = _data58_->shortcut;
						_tmp46_ = shortcut_get_accelerator (_tmp45_);
						_tmp47_ = _tmp46_;
						gtk_shortcut_label_set_accelerator (_tmp44_, _tmp47_);
						_g_free0 (_tmp47_);
						_tmp48_ = _data58_->stack;
						gtk_stack_set_visible_child_name (_tmp48_, "set");
						_tmp49_ = _data58_->sl;
						gtk_widget_grab_focus ((GtkWidget*) _tmp49_);
						_tmp50_ = self->priv->_shortcut_instructions;
						_tmp51_ = self->priv->_shortcut_inst_start_str;
						gtk_label_set_label (_tmp50_, _tmp51_);
					} else {
						Shortcut* _tmp52_;
						Shortcut* _tmp53_;
						_tmp52_ = scut;
						_tmp53_ = conflict;
						preferences_show_conflict_dialog (self, _tmp52_, _tmp53_);
					}
					_shortcut_unref0 (scut);
					_shortcut_unref0 (conflict);
				}
			}
		}
		result = TRUE;
		return result;
	}
	result = FALSE;
	return result;
}

static gboolean
___lambda77__gtk_event_controller_key_key_pressed (GtkEventControllerKey* _sender,
                                                   guint keyval,
                                                   guint keycode,
                                                   GdkModifierType state,
                                                   gpointer self)
{
	gboolean result;
	result = __lambda77_ (self, keyval, keycode, state);
	return result;
}

static GtkStack*
preferences_make_shortcut (Preferences* self,
                           KeyCommand command)
{
	Block58Data* _data58_;
	gchar* _tmp0_;
	gchar* _tmp1_;
	MainWindow* _tmp2_;
	Shortcuts* _tmp3_;
	Shortcuts* _tmp4_;
	Shortcut* _tmp5_;
	gchar* _tmp6_ = NULL;
	Shortcut* _tmp7_;
	GtkShortcutLabel* _tmp11_ = NULL;
	GtkShortcutLabel* _tmp12_;
	GtkShortcutLabel* _tmp13_;
	GtkEventControllerFocus* sl_focus = NULL;
	GtkEventControllerFocus* _tmp14_;
	GtkEventControllerKey* sl_key = NULL;
	GtkEventControllerKey* _tmp15_;
	GtkGestureClick* sl_click = NULL;
	GtkGestureClick* _tmp16_ = NULL;
	GtkShortcutLabel* _tmp17_;
	GtkEventControllerFocus* _tmp18_;
	GtkEventController* _tmp19_;
	GtkShortcutLabel* _tmp20_;
	GtkEventControllerKey* _tmp21_;
	GtkEventController* _tmp22_;
	GtkShortcutLabel* _tmp23_;
	GtkGestureClick* _tmp24_;
	GtkEventController* _tmp25_;
	const gchar* _tmp26_;
	GtkEditableLabel* _tmp27_ = NULL;
	GtkEditableLabel* _tmp28_;
	GtkEditableLabel* _tmp29_;
	GtkEventControllerFocus* nl_focus = NULL;
	GtkEventControllerFocus* _tmp30_;
	GtkEventControllerKey* nl_key = NULL;
	GtkEventControllerKey* _tmp31_;
	GtkGestureClick* nl_click = NULL;
	GtkGestureClick* _tmp32_ = NULL;
	GtkEditableLabel* _tmp33_;
	GtkEventControllerFocus* _tmp34_;
	GtkEventController* _tmp35_;
	GtkEditableLabel* _tmp36_;
	GtkEventControllerKey* _tmp37_;
	GtkEventController* _tmp38_;
	GtkEditableLabel* _tmp39_;
	GtkGestureClick* _tmp40_;
	GtkEventController* _tmp41_;
	GtkStack* _tmp42_;
	GtkStack* _tmp43_;
	GtkShortcutLabel* _tmp44_;
	GtkStack* _tmp45_;
	GtkEditableLabel* _tmp46_;
	const gchar* _tmp47_ = NULL;
	Shortcut* _tmp48_;
	GtkStack* _tmp49_;
	GtkEventControllerFocus* _tmp50_;
	GtkEventControllerFocus* _tmp51_;
	GtkGestureClick* _tmp52_;
	GtkEventControllerKey* _tmp53_;
	GtkEventControllerFocus* _tmp54_;
	GtkEventControllerFocus* _tmp55_;
	GtkGestureClick* _tmp56_;
	GtkEventControllerKey* _tmp57_;
	GtkStack* _tmp58_;
	GtkStack* _tmp59_;
	GtkStack* result;
	g_return_val_if_fail (self != NULL, NULL);
	_data58_ = g_slice_new0 (Block58Data);
	_data58_->_ref_count_ = 1;
	_data58_->self = g_object_ref (self);
	_data58_->command = command;
	_tmp0_ = g_strdup (_ ("None"));
	_data58_->disabled = _tmp0_;
	_tmp1_ = g_strdup (_ ("Enter shortcut"));
	_data58_->enter = _tmp1_;
	_tmp2_ = self->priv->_win;
	_tmp3_ = main_window_get_shortcuts (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = shortcuts_get_shortcut (_tmp4_, _data58_->command);
	_data58_->shortcut = _tmp5_;
	_tmp7_ = _data58_->shortcut;
	if (_tmp7_ != NULL) {
		Shortcut* _tmp8_;
		gchar* _tmp9_;
		_tmp8_ = _data58_->shortcut;
		_tmp9_ = shortcut_get_accelerator (_tmp8_);
		_g_free0 (_tmp6_);
		_tmp6_ = _tmp9_;
	} else {
		gchar* _tmp10_;
		_tmp10_ = g_strdup ("");
		_g_free0 (_tmp6_);
		_tmp6_ = _tmp10_;
	}
	_tmp11_ = (GtkShortcutLabel*) gtk_shortcut_label_new (_tmp6_);
	gtk_widget_set_halign ((GtkWidget*) _tmp11_, GTK_ALIGN_START);
	gtk_widget_set_can_focus ((GtkWidget*) _tmp11_, key_command_editable (_data58_->command));
	gtk_widget_set_focusable ((GtkWidget*) _tmp11_, key_command_editable (_data58_->command));
	g_object_ref_sink (_tmp11_);
	_data58_->sl = _tmp11_;
	_tmp12_ = _data58_->sl;
	gtk_widget_add_css_class ((GtkWidget*) _tmp12_, "shortcut-unselected");
	_tmp13_ = _data58_->sl;
	gtk_widget_set_cursor_from_name ((GtkWidget*) _tmp13_, "pointer");
	_tmp14_ = (GtkEventControllerFocus*) gtk_event_controller_focus_new ();
	sl_focus = _tmp14_;
	_tmp15_ = (GtkEventControllerKey*) gtk_event_controller_key_new ();
	sl_key = _tmp15_;
	_tmp16_ = (GtkGestureClick*) gtk_gesture_click_new ();
	gtk_gesture_single_set_button ((GtkGestureSingle*) _tmp16_, (guint) GDK_BUTTON_PRIMARY);
	sl_click = _tmp16_;
	_tmp17_ = _data58_->sl;
	_tmp18_ = sl_focus;
	_tmp19_ = _g_object_ref0 ((GtkEventController*) _tmp18_);
	gtk_widget_add_controller ((GtkWidget*) _tmp17_, _tmp19_);
	_tmp20_ = _data58_->sl;
	_tmp21_ = sl_key;
	_tmp22_ = _g_object_ref0 ((GtkEventController*) _tmp21_);
	gtk_widget_add_controller ((GtkWidget*) _tmp20_, _tmp22_);
	_tmp23_ = _data58_->sl;
	_tmp24_ = sl_click;
	_tmp25_ = _g_object_ref0 ((GtkEventController*) _tmp24_);
	gtk_widget_add_controller ((GtkWidget*) _tmp23_, _tmp25_);
	_tmp26_ = _data58_->disabled;
	_tmp27_ = (GtkEditableLabel*) gtk_editable_label_new (_tmp26_);
	gtk_widget_set_halign ((GtkWidget*) _tmp27_, GTK_ALIGN_START);
	gtk_editable_set_editable ((GtkEditable*) _tmp27_, FALSE);
	gtk_widget_set_can_focus ((GtkWidget*) _tmp27_, key_command_editable (_data58_->command));
	gtk_widget_set_focusable ((GtkWidget*) _tmp27_, key_command_editable (_data58_->command));
	g_object_ref_sink (_tmp27_);
	_data58_->nl = _tmp27_;
	_tmp28_ = _data58_->nl;
	gtk_widget_add_css_class ((GtkWidget*) _tmp28_, "shortcut-unselected");
	_tmp29_ = _data58_->nl;
	gtk_widget_set_cursor_from_name ((GtkWidget*) _tmp29_, "pointer");
	_tmp30_ = (GtkEventControllerFocus*) gtk_event_controller_focus_new ();
	nl_focus = _tmp30_;
	_tmp31_ = (GtkEventControllerKey*) gtk_event_controller_key_new ();
	nl_key = _tmp31_;
	_tmp32_ = (GtkGestureClick*) gtk_gesture_click_new ();
	gtk_gesture_single_set_button ((GtkGestureSingle*) _tmp32_, (guint) GDK_BUTTON_PRIMARY);
	nl_click = _tmp32_;
	_tmp33_ = _data58_->nl;
	_tmp34_ = nl_focus;
	_tmp35_ = _g_object_ref0 ((GtkEventController*) _tmp34_);
	gtk_widget_add_controller ((GtkWidget*) _tmp33_, _tmp35_);
	_tmp36_ = _data58_->nl;
	_tmp37_ = nl_key;
	_tmp38_ = _g_object_ref0 ((GtkEventController*) _tmp37_);
	gtk_widget_add_controller ((GtkWidget*) _tmp36_, _tmp38_);
	_tmp39_ = _data58_->nl;
	_tmp40_ = nl_click;
	_tmp41_ = _g_object_ref0 ((GtkEventController*) _tmp40_);
	gtk_widget_add_controller ((GtkWidget*) _tmp39_, _tmp41_);
	_tmp42_ = (GtkStack*) gtk_stack_new ();
	g_object_ref_sink (_tmp42_);
	_data58_->stack = _tmp42_;
	_tmp43_ = _data58_->stack;
	_tmp44_ = _data58_->sl;
	gtk_stack_add_named (_tmp43_, (GtkWidget*) _tmp44_, "set");
	_tmp45_ = _data58_->stack;
	_tmp46_ = _data58_->nl;
	gtk_stack_add_named (_tmp45_, (GtkWidget*) _tmp46_, "unset");
	_tmp48_ = _data58_->shortcut;
	if (_tmp48_ != NULL) {
		_tmp47_ = "set";
	} else {
		_tmp47_ = "unset";
	}
	_tmp49_ = _data58_->stack;
	gtk_stack_set_visible_child_name (_tmp49_, _tmp47_);
	_tmp50_ = sl_focus;
	g_signal_connect_data (_tmp50_, "enter", (GCallback) ___lambda70__gtk_event_controller_focus_enter, block58_data_ref (_data58_), (GClosureNotify) block58_data_unref, 0);
	_tmp51_ = sl_focus;
	g_signal_connect_data (_tmp51_, "leave", (GCallback) ___lambda71__gtk_event_controller_focus_leave, block58_data_ref (_data58_), (GClosureNotify) block58_data_unref, 0);
	_tmp52_ = sl_click;
	g_signal_connect_data (_tmp52_, "pressed", (GCallback) ___lambda72__gtk_gesture_click_pressed, block58_data_ref (_data58_), (GClosureNotify) block58_data_unref, 0);
	_tmp53_ = sl_key;
	g_signal_connect_data (_tmp53_, "key-pressed", (GCallback) ___lambda73__gtk_event_controller_key_key_pressed, block58_data_ref (_data58_), (GClosureNotify) block58_data_unref, 0);
	_tmp54_ = nl_focus;
	g_signal_connect_data (_tmp54_, "enter", (GCallback) ___lambda74__gtk_event_controller_focus_enter, block58_data_ref (_data58_), (GClosureNotify) block58_data_unref, 0);
	_tmp55_ = nl_focus;
	g_signal_connect_data (_tmp55_, "leave", (GCallback) ___lambda75__gtk_event_controller_focus_leave, block58_data_ref (_data58_), (GClosureNotify) block58_data_unref, 0);
	_tmp56_ = nl_click;
	g_signal_connect_data (_tmp56_, "pressed", (GCallback) ___lambda76__gtk_gesture_click_pressed, block58_data_ref (_data58_), (GClosureNotify) block58_data_unref, 0);
	_tmp57_ = nl_key;
	g_signal_connect_data (_tmp57_, "key-pressed", (GCallback) ___lambda77__gtk_event_controller_key_key_pressed, block58_data_ref (_data58_), (GClosureNotify) block58_data_unref, 0);
	_tmp58_ = _data58_->stack;
	_tmp59_ = _g_object_ref0 (_tmp58_);
	result = _tmp59_;
	_g_object_unref0 (nl_click);
	_g_object_unref0 (nl_key);
	_g_object_unref0 (nl_focus);
	_g_object_unref0 (sl_click);
	_g_object_unref0 (sl_key);
	_g_object_unref0 (sl_focus);
	_g_free0 (_tmp6_);
	block58_data_unref (_data58_);
	_data58_ = NULL;
	return result;
}

static Block59Data*
block59_data_ref (Block59Data* _data59_)
{
	g_atomic_int_inc (&_data59_->_ref_count_);
	return _data59_;
}

static void
block59_data_unref (void * _userdata_)
{
	Block59Data* _data59_;
	_data59_ = (Block59Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data59_->_ref_count_)) {
		Preferences* self;
		self = _data59_->self;
		_g_object_unref0 (_data59_->dialog);
		_g_object_unref0 (self);
		g_slice_free (Block59Data, _data59_);
	}
}

static void
__lambda78_ (Block59Data* _data59_,
             gint id)
{
	Preferences* self;
	self = _data59_->self;
	g_signal_emit_by_name ((GtkDialog*) _data59_->dialog, "close");
}

static void
___lambda78__gtk_dialog_response (GtkDialog* _sender,
                                  gint response_id,
                                  gpointer self)
{
	__lambda78_ (self, response_id);
}

static void
preferences_show_conflict_dialog (Preferences* self,
                                  Shortcut* attempt,
                                  Shortcut* conflict)
{
	Block59Data* _data59_;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	KeyCommand _tmp4_;
	KeyCommand _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	GtkWindow* _tmp10_;
	GraniteMessageDialog* _tmp11_ = NULL;
	GraniteMessageDialog* _tmp12_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (attempt != NULL);
	g_return_if_fail (conflict != NULL);
	_data59_ = g_slice_new0 (Block59Data);
	_data59_->_ref_count_ = 1;
	_data59_->self = g_object_ref (self);
	_tmp0_ = shortcut_get_accelerator (attempt);
	_tmp1_ = _tmp0_;
	_tmp2_ = granite_accel_to_string (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = shortcut_get_command (conflict);
	_tmp5_ = _tmp4_;
	_tmp6_ = key_command_shortcut_label (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = g_strdup_printf (_ ("%s conflicts with '%s'"), _tmp3_, _tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = _g_object_ref0 ((GtkWindow*) self);
	_tmp11_ = granite_message_dialog_new_with_image_from_icon_name (_ ("Unable to set new shortcut due to conflicts"), _tmp9_, "dialog-error", GTK_BUTTONS_CLOSE);
	gtk_window_set_modal ((GtkWindow*) _tmp11_, TRUE);
	gtk_window_set_transient_for ((GtkWindow*) _tmp11_, _tmp10_);
	_g_object_unref0 (_tmp10_);
	g_object_ref_sink (_tmp11_);
	_tmp12_ = _tmp11_;
	_g_free0 (_tmp9_);
	_g_free0 (_tmp7_);
	_g_free0 (_tmp3_);
	_g_free0 (_tmp1_);
	_data59_->dialog = _tmp12_;
	g_signal_connect_data ((GtkDialog*) _data59_->dialog, "response", (GCallback) ___lambda78__gtk_dialog_response, block59_data_ref (_data59_), (GClosureNotify) block59_data_unref, 0);
	gtk_window_present ((GtkWindow*) _data59_->dialog);
	block59_data_unref (_data59_);
	_data59_ = NULL;
}

static GtkSeparator*
preferences_make_separator (Preferences* self)
{
	GtkSeparator* s = NULL;
	GtkSeparator* _tmp0_;
	GtkSeparator* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = (GtkSeparator*) gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
	g_object_ref_sink (_tmp0_);
	s = _tmp0_;
	result = s;
	return result;
}

static void
_g_free0_ (gpointer var)
{
	var = (g_free (var), NULL);
}

static void
_vala_gchar_free_function_content_of (gpointer data)
{
	gchar* self;
	self = *((gchar**) data);
	_g_free0_ (self);
}

static GtkMenuButton*
preferences_make_themes (Preferences* self)
{
	GArray* names = NULL;
	GArray* _tmp0_;
	MainWindow* _tmp1_;
	Themes* _tmp2_;
	Themes* _tmp3_;
	GMenu* menu = NULL;
	GMenu* _tmp4_;
	MainWindow* _tmp26_;
	Themes* _tmp27_;
	Themes* _tmp28_;
	GSettings* _tmp29_;
	gchar* _tmp30_;
	gchar* _tmp31_;
	Theme* _tmp32_;
	Theme* _tmp33_;
	const gchar* _tmp34_;
	const gchar* _tmp35_;
	gchar* _tmp36_;
	GMenu* _tmp37_;
	GMenuModel* _tmp38_;
	GtkMenuButton* _tmp39_ = NULL;
	GtkMenuButton* _tmp40_;
	GtkMenuButton* _tmp41_;
	GtkMenuButton* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_array_new (TRUE, TRUE, sizeof (gchar*));
	g_array_set_clear_func (_tmp0_, (GDestroyNotify) _vala_gchar_free_function_content_of);
	names = _tmp0_;
	_tmp1_ = self->priv->_win;
	_tmp2_ = main_window_get_themes (_tmp1_);
	_tmp3_ = _tmp2_;
	themes_names (_tmp3_, &names);
	_tmp4_ = g_menu_new ();
	menu = _tmp4_;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp5_ = FALSE;
			_tmp5_ = TRUE;
			while (TRUE) {
				GArray* _tmp7_;
				gchar* name = NULL;
				GArray* _tmp8_;
				const gchar* _tmp9_;
				gchar* _tmp10_;
				gchar* lbl = NULL;
				MainWindow* _tmp11_;
				Themes* _tmp12_;
				Themes* _tmp13_;
				const gchar* _tmp14_;
				Theme* _tmp15_;
				Theme* _tmp16_;
				const gchar* _tmp17_;
				const gchar* _tmp18_;
				gchar* _tmp19_;
				gchar* _tmp20_;
				GMenu* _tmp21_;
				const gchar* _tmp22_;
				const gchar* _tmp23_;
				gchar* _tmp24_;
				gchar* _tmp25_;
				if (!_tmp5_) {
					gint _tmp6_;
					_tmp6_ = i;
					i = _tmp6_ + 1;
				}
				_tmp5_ = FALSE;
				_tmp7_ = names;
				if (!(((guint) i) < _tmp7_->len)) {
					break;
				}
				_tmp8_ = names;
				_tmp9_ = g_array_index (_tmp8_, gchar*, (guint) i);
				_tmp10_ = g_strdup (_tmp9_);
				name = _tmp10_;
				_tmp11_ = self->priv->_win;
				_tmp12_ = main_window_get_themes (_tmp11_);
				_tmp13_ = _tmp12_;
				_tmp14_ = name;
				_tmp15_ = themes_get_theme (_tmp13_, _tmp14_);
				_tmp16_ = _tmp15_;
				_tmp17_ = theme_get_label (_tmp16_);
				_tmp18_ = _tmp17_;
				_tmp19_ = g_strdup (_tmp18_);
				_tmp20_ = _tmp19_;
				_g_object_unref0 (_tmp16_);
				lbl = _tmp20_;
				_tmp21_ = menu;
				_tmp22_ = lbl;
				_tmp23_ = name;
				_tmp24_ = g_strdup_printf ("prefs.action_set_default_theme('%s')", _tmp23_);
				_tmp25_ = _tmp24_;
				g_menu_append (_tmp21_, _tmp22_, _tmp25_);
				_g_free0 (_tmp25_);
				_g_free0 (lbl);
				_g_free0 (name);
			}
		}
	}
	_tmp26_ = self->priv->_win;
	_tmp27_ = main_window_get_themes (_tmp26_);
	_tmp28_ = _tmp27_;
	_tmp29_ = minder_settings;
	_tmp30_ = g_settings_get_string (_tmp29_, "default-theme");
	_tmp31_ = _tmp30_;
	_tmp32_ = themes_get_theme (_tmp28_, _tmp31_);
	_tmp33_ = _tmp32_;
	_tmp34_ = theme_get_label (_tmp33_);
	_tmp35_ = _tmp34_;
	_tmp36_ = g_strdup (_tmp35_);
	_tmp37_ = menu;
	_tmp38_ = _g_object_ref0 ((GMenuModel*) _tmp37_);
	_tmp39_ = (GtkMenuButton*) gtk_menu_button_new ();
	gtk_menu_button_set_label (_tmp39_, _tmp36_);
	_g_free0 (_tmp36_);
	gtk_menu_button_set_menu_model (_tmp39_, _tmp38_);
	_g_object_unref0 (_tmp38_);
	g_object_ref_sink (_tmp39_);
	_g_object_unref0 (self->priv->_theme_mb);
	self->priv->_theme_mb = _tmp39_;
	_g_object_unref0 (_tmp33_);
	_g_free0 (_tmp31_);
	_tmp40_ = self->priv->_theme_mb;
	_tmp41_ = _g_object_ref0 (_tmp40_);
	result = _tmp41_;
	_g_object_unref0 (menu);
	_g_array_unref0 (names);
	return result;
}

static void
preferences_action_set_default_theme (Preferences* self,
                                      GSimpleAction* action,
                                      GVariant* variant)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	if (variant != NULL) {
		gchar* name = NULL;
		const gchar* _tmp0_;
		gchar* _tmp1_;
		GSettings* _tmp2_;
		const gchar* _tmp3_;
		GtkMenuButton* _tmp4_;
		MainWindow* _tmp5_;
		Themes* _tmp6_;
		Themes* _tmp7_;
		const gchar* _tmp8_;
		Theme* _tmp9_;
		Theme* _tmp10_;
		const gchar* _tmp11_;
		const gchar* _tmp12_;
		_tmp0_ = g_variant_get_string (variant, NULL);
		_tmp1_ = g_strdup (_tmp0_);
		name = _tmp1_;
		_tmp2_ = minder_settings;
		_tmp3_ = name;
		g_settings_set_string (_tmp2_, "default-theme", _tmp3_);
		_tmp4_ = self->priv->_theme_mb;
		_tmp5_ = self->priv->_win;
		_tmp6_ = main_window_get_themes (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp8_ = name;
		_tmp9_ = themes_get_theme (_tmp7_, _tmp8_);
		_tmp10_ = _tmp9_;
		_tmp11_ = theme_get_label (_tmp10_);
		_tmp12_ = _tmp11_;
		gtk_menu_button_set_label (_tmp4_, _tmp12_);
		_g_object_unref0 (_tmp10_);
		_g_free0 (name);
	}
}

static void
__lambda46_ (Preferences* self)
{
	MainWindow* _tmp0_;
	Shortcuts* _tmp1_;
	Shortcuts* _tmp2_;
	_tmp0_ = self->priv->_win;
	_tmp1_ = main_window_get_shortcuts (_tmp0_);
	_tmp2_ = _tmp1_;
	shortcuts_clear_all_shortcuts (_tmp2_);
}

static void
___lambda46__confirmation_dialog_func (gpointer self)
{
	__lambda46_ ((Preferences*) self);
}

static void
preferences_action_clear_all_shortcuts (Preferences* self)
{
	g_return_if_fail (self != NULL);
	utils_create_confirmation_dialog ((GtkWindow*) self, _ ("Clear all shortcuts?"), _ ("Current shortcut settings will be lost"), ___lambda46__confirmation_dialog_func, self);
}

static void
__lambda47_ (Preferences* self)
{
	MainWindow* _tmp0_;
	Shortcuts* _tmp1_;
	Shortcuts* _tmp2_;
	MainWindow* _tmp3_;
	Shortcuts* _tmp4_;
	Shortcuts* _tmp5_;
	_tmp0_ = self->priv->_win;
	_tmp1_ = main_window_get_shortcuts (_tmp0_);
	_tmp2_ = _tmp1_;
	shortcuts_restore_default_shortcuts (_tmp2_);
	_tmp3_ = self->priv->_win;
	_tmp4_ = main_window_get_shortcuts (_tmp3_);
	_tmp5_ = _tmp4_;
	shortcuts_save (_tmp5_);
}

static void
___lambda47__confirmation_dialog_func (gpointer self)
{
	__lambda47_ ((Preferences*) self);
}

static void
preferences_action_set_minder_shortcuts (Preferences* self)
{
	g_return_if_fail (self != NULL);
	utils_create_confirmation_dialog ((GtkWindow*) self, _ ("Use Minder Default Shortcuts?"), _ ("Current shortcut settings will be lost"), ___lambda47__confirmation_dialog_func, self);
}

static void
preferences_action_set_style_builtin (Preferences* self,
                                      GSimpleAction* action,
                                      GVariant* variant)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	if (variant != NULL) {
		GSettings* _tmp0_;
		GSettings* _tmp1_;
		_tmp0_ = minder_settings;
		g_settings_set_int (_tmp0_, "default-global-style", (gint) g_variant_get_int32 (variant));
		_tmp1_ = minder_settings;
		g_settings_set_string (_tmp1_, "default-global-style-name", "");
		preferences_set_global_style_label (self);
	}
}

static void
preferences_action_set_style_named (Preferences* self,
                                    GSimpleAction* action,
                                    GVariant* variant)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	if (variant != NULL) {
		GSettings* _tmp0_;
		GSettings* _tmp1_;
		const gchar* _tmp2_;
		_tmp0_ = minder_settings;
		g_settings_set_int (_tmp0_, "default-global-style", 2);
		_tmp1_ = minder_settings;
		_tmp2_ = g_variant_get_string (variant, NULL);
		g_settings_set_string (_tmp1_, "default-global-style-name", _tmp2_);
		preferences_set_global_style_label (self);
	}
}

static void
preferences_set_global_style_label (Preferences* self)
{
	gchar* label = NULL;
	gchar* _tmp0_;
	gint style = 0;
	GSettings* _tmp1_;
	GtkMenuButton* _tmp7_;
	const gchar* _tmp8_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (_ ("Minder Default"));
	label = _tmp0_;
	_tmp1_ = minder_settings;
	style = g_settings_get_int (_tmp1_, "default-global-style");
	if (style == 1) {
		gchar* _tmp2_;
		_tmp2_ = g_strdup (_ ("Last Used"));
		_g_free0 (label);
		label = _tmp2_;
	} else {
		if (style >= 2) {
			GSettings* _tmp3_;
			gchar* _tmp4_;
			gchar* _tmp5_;
			gchar* _tmp6_;
			_tmp3_ = minder_settings;
			_tmp4_ = g_settings_get_string (_tmp3_, "default-global-style-name");
			_tmp5_ = _tmp4_;
			_tmp6_ = g_strdup_printf (_ ("Named Style: %s"), _tmp5_);
			_g_free0 (label);
			label = _tmp6_;
			_g_free0 (_tmp5_);
		}
	}
	_tmp7_ = self->priv->_style_menu;
	_tmp8_ = label;
	gtk_menu_button_set_label (_tmp7_, _tmp8_);
	_g_free0 (label);
}

static GtkMenuButton*
preferences_make_global_style (Preferences* self,
                               Templates* templates)
{
	TemplateGroup* gtemplates = NULL;
	TemplateGroup* _tmp0_;
	GArray* names = NULL;
	TemplateGroup* _tmp1_;
	GArray* _tmp2_;
	GMenu* builtin = NULL;
	GMenu* _tmp3_;
	GMenu* _tmp4_;
	GMenu* _tmp5_;
	GMenu* named = NULL;
	GMenu* _tmp6_;
	GMenu* menu = NULL;
	GMenu* _tmp19_;
	GMenu* _tmp20_;
	GMenu* _tmp21_;
	GMenuModel* _tmp22_;
	GtkMenuButton* _tmp23_ = NULL;
	GtkMenuButton* _tmp24_;
	GtkMenuButton* _tmp25_;
	GtkMenuButton* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (templates != NULL, NULL);
	_tmp0_ = templates_get_template_group (templates, TEMPLATE_TYPE_STYLE_GENERAL);
	gtemplates = _tmp0_;
	_tmp1_ = gtemplates;
	_tmp2_ = template_group_get_names (_tmp1_);
	names = _tmp2_;
	_tmp3_ = g_menu_new ();
	builtin = _tmp3_;
	_tmp4_ = builtin;
	g_menu_append (_tmp4_, _ ("Minder Default"), "prefs.action_set_style_builtin(0)");
	_tmp5_ = builtin;
	g_menu_append (_tmp5_, _ ("Last Used"), "prefs.action_set_style_builtin(1)");
	_tmp6_ = g_menu_new ();
	named = _tmp6_;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp7_ = FALSE;
			_tmp7_ = TRUE;
			while (TRUE) {
				GArray* _tmp9_;
				GMenu* _tmp10_;
				GArray* _tmp11_;
				const gchar* _tmp12_;
				gchar* _tmp13_;
				gchar* _tmp14_;
				GArray* _tmp15_;
				const gchar* _tmp16_;
				gchar* _tmp17_;
				gchar* _tmp18_;
				if (!_tmp7_) {
					gint _tmp8_;
					_tmp8_ = i;
					i = _tmp8_ + 1;
				}
				_tmp7_ = FALSE;
				_tmp9_ = names;
				if (!(((guint) i) < _tmp9_->len)) {
					break;
				}
				_tmp10_ = named;
				_tmp11_ = names;
				_tmp12_ = g_array_index (_tmp11_, gchar*, (guint) i);
				_tmp13_ = g_strdup_printf (_ ("Named Style: %s"), _tmp12_);
				_tmp14_ = _tmp13_;
				_tmp15_ = names;
				_tmp16_ = g_array_index (_tmp15_, gchar*, (guint) i);
				_tmp17_ = g_strdup_printf ("prefs.action_set_style_named('%s')", _tmp16_);
				_tmp18_ = _tmp17_;
				g_menu_append (_tmp10_, _tmp14_, _tmp18_);
				_g_free0 (_tmp18_);
				_g_free0 (_tmp14_);
			}
		}
	}
	_tmp19_ = g_menu_new ();
	menu = _tmp19_;
	_tmp20_ = builtin;
	g_menu_append_section (menu, NULL, (GMenuModel*) _tmp20_);
	_tmp21_ = named;
	g_menu_append_section (menu, NULL, (GMenuModel*) _tmp21_);
	_tmp22_ = _g_object_ref0 ((GMenuModel*) menu);
	_tmp23_ = (GtkMenuButton*) gtk_menu_button_new ();
	gtk_menu_button_set_menu_model (_tmp23_, _tmp22_);
	_g_object_unref0 (_tmp22_);
	g_object_ref_sink (_tmp23_);
	_g_object_unref0 (self->priv->_style_menu);
	self->priv->_style_menu = _tmp23_;
	preferences_set_global_style_label (self);
	_tmp24_ = self->priv->_style_menu;
	_tmp25_ = _g_object_ref0 (_tmp24_);
	result = _tmp25_;
	_g_object_unref0 (menu);
	_g_object_unref0 (named);
	_g_object_unref0 (builtin);
	_g_array_unref0 (names);
	_template_group_unref0 (gtemplates);
	return result;
}

static void
preferences_class_init (PreferencesClass * klass,
                        gpointer klass_data)
{
	preferences_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &Preferences_private_offset);
	G_OBJECT_CLASS (klass)->finalize = preferences_finalize;
	preferences_signals[PREFERENCES_TAB_SWITCHED_SIGNAL] = g_signal_new ("tab-switched", TYPE_PREFERENCES, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING);
}

static void
preferences_instance_init (Preferences * self,
                           gpointer klass)
{
	self->priv = preferences_get_instance_private (self);
}

static void
preferences_finalize (GObject * obj)
{
	Preferences * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_PREFERENCES, Preferences);
	_g_object_unref0 (self->priv->_win);
	_g_object_unref0 (self->priv->_theme_mb);
	_g_free0 (self->priv->_shortcut_inst_start_str);
	_g_free0 (self->priv->_shortcut_inst_edit_str);
	_g_object_unref0 (self->priv->_shortcut_instructions);
	_tags_unref0 (self->priv->_tags);
	_g_object_unref0 (self->priv->_style_menu);
	G_OBJECT_CLASS (preferences_parent_class)->finalize (obj);
}

static GType
preferences_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PreferencesClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) preferences_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Preferences), 0, (GInstanceInitFunc) preferences_instance_init, NULL };
	GType preferences_type_id;
	preferences_type_id = g_type_register_static (GRANITE_TYPE_DIALOG, "Preferences", &g_define_type_info, 0);
	Preferences_private_offset = g_type_add_instance_private (preferences_type_id, sizeof (PreferencesPrivate));
	return preferences_type_id;
}

GType
preferences_get_type (void)
{
	static volatile gsize preferences_type_id__once = 0;
	if (g_once_init_enter (&preferences_type_id__once)) {
		GType preferences_type_id;
		preferences_type_id = preferences_get_type_once ();
		g_once_init_leave (&preferences_type_id__once, preferences_type_id);
	}
	return preferences_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 inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

