preferences-dialog.c 69.9 KB
Newer Older
1
/* preferences-dialog.c generated by valac 0.42.3, the Vala compiler
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
 * generated from preferences-dialog.vala, do not modify */

/* -*- Mode: vala; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * Gnome Nibbles: Gnome Worm Game
 * Copyright (C) 2015 Gabriel Ivascu <ivascu.gabriel59@gmail.com>
 *
 * 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 3 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, see <http://www.gnu.org/licenses/>.
 */

22

23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <gio/gio.h>
#include <gee.h>
#include <glib/gi18n-lib.h>
#include <stdlib.h>
#include <string.h>
#include <gdk/gdk.h>


#define TYPE_PREFERENCES_DIALOG (preferences_dialog_get_type ())
#define PREFERENCES_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PREFERENCES_DIALOG, PreferencesDialog))
#define PREFERENCES_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PREFERENCES_DIALOG, PreferencesDialogClass))
#define IS_PREFERENCES_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PREFERENCES_DIALOG))
#define IS_PREFERENCES_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PREFERENCES_DIALOG))
#define PREFERENCES_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PREFERENCES_DIALOG, PreferencesDialogClass))

typedef struct _PreferencesDialog PreferencesDialog;
typedef struct _PreferencesDialogClass PreferencesDialogClass;
typedef struct _PreferencesDialogPrivate PreferencesDialogPrivate;
44 45 46 47 48
enum  {
	PREFERENCES_DIALOG_0_PROPERTY,
	PREFERENCES_DIALOG_NUM_PROPERTIES
};
static GParamSpec* preferences_dialog_properties[PREFERENCES_DIALOG_NUM_PROPERTIES];
49
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
50 51
#define _g_free0(var) (var = (g_free (var), NULL))
#define __vala_GtkTreePath_free0(var) ((var == NULL) ? NULL : (var = (_vala_GtkTreePath_free (var), NULL)))
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91

struct _PreferencesDialog {
	GtkDialog parent_instance;
	PreferencesDialogPrivate * priv;
};

struct _PreferencesDialogClass {
	GtkDialogClass parent_class;
};

struct _PreferencesDialogPrivate {
	GtkApplicationWindow* window;
	GSettings* settings;
	GeeArrayList* worm_settings;
	GtkNotebook* notebook;
	GtkRadioButton* beginner_radio_button;
	GtkRadioButton* slow_radio_button;
	GtkRadioButton* medium_radio_button;
	GtkRadioButton* fast_radio_button;
	GtkCheckButton* sound_check_button;
	GtkCheckButton* fakes_check_button;
	GtkListStore* list_store_1;
	GtkListStore* list_store_2;
	GtkListStore* list_store_3;
	GtkListStore* list_store_4;
	GtkTreeView* tree_view_1;
	GtkTreeView* tree_view_2;
	GtkTreeView* tree_view_3;
	GtkTreeView* tree_view_4;
	GtkComboBoxText* combo_box_1;
	GtkComboBoxText* combo_box_2;
	GtkComboBoxText* combo_box_3;
	GtkComboBoxText* combo_box_4;
	GeeArrayList* radio_buttons;
	GeeArrayList* list_stores;
	GeeArrayList* tree_views;
	GeeArrayList* combo_boxes;
};


92
static gint PreferencesDialog_private_offset;
93 94 95
static gpointer preferences_dialog_parent_class = NULL;

GType preferences_dialog_get_type (void) G_GNUC_CONST;
96 97 98 99 100 101 102
PreferencesDialog* preferences_dialog_new (GtkApplicationWindow* window,
                                           GSettings* settings,
                                           GeeArrayList* worm_settings);
PreferencesDialog* preferences_dialog_construct (GType object_type,
                                                 GtkApplicationWindow* window,
                                                 GSettings* settings,
                                                 GeeArrayList* worm_settings);
103
static void __lambda4_ (PreferencesDialog* self);
104 105 106
static void ___lambda4__gtk_dialog_response (GtkDialog* _sender,
                                      gint response_id,
                                      gpointer self);
107
#define NIBBLES_GAME_MAX_SPEED 4
108 109 110 111
static void preferences_dialog_radio_button_toggled_cb (PreferencesDialog* self,
                                                 GtkToggleButton* button);
static void _preferences_dialog_radio_button_toggled_cb_gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                                            gpointer self);
112
static void preferences_dialog_sound_toggled_cb (PreferencesDialog* self);
113 114
static void _preferences_dialog_sound_toggled_cb_gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                                     gpointer self);
115
static void preferences_dialog_fakes_toggles_cb (PreferencesDialog* self);
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
static void _preferences_dialog_fakes_toggles_cb_gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                                     gpointer self);
static void preferences_dialog_accel_edited_cb (PreferencesDialog* self,
                                         GtkCellRendererAccel* cell,
                                         const gchar* path_string,
                                         guint keyval,
                                         GdkModifierType mask,
                                         guint hardware_keycode);
static void _preferences_dialog_accel_edited_cb_gtk_cell_renderer_accel_accel_edited (GtkCellRendererAccel* _sender,
                                                                               const gchar* path_string,
                                                                               guint accel_key,
                                                                               GdkModifierType accel_mods,
                                                                               guint hardware_keycode,
                                                                               gpointer self);
static void preferences_dialog_accel_cleared_cb (PreferencesDialog* self,
                                          GtkCellRendererAccel* cell,
                                          const gchar* path_string);
static void _preferences_dialog_accel_cleared_cb_gtk_cell_renderer_accel_accel_cleared (GtkCellRendererAccel* _sender,
                                                                                 const gchar* path_string,
                                                                                 gpointer self);
136 137
#define NIBBLES_VIEW_NUM_COLORS 6
gchar* nibbles_view_colorval_name (gint colorval);
138 139 140 141 142
static void preferences_dialog_combo_box_changed_cb (PreferencesDialog* self,
                                              GtkComboBox* combo_box);
static void _preferences_dialog_combo_box_changed_cb_gtk_combo_box_changed (GtkComboBox* _sender,
                                                                     gpointer self);
static void _vala_GtkTreePath_free (GtkTreePath* self);
143 144 145 146 147
#define NIBBLES_GAME_MAX_HUMANS 4
#define NIBBLES_GAME_MAX_WORMS 6
static void preferences_dialog_finalize (GObject * obj);


148 149 150 151 152 153 154
static inline gpointer
preferences_dialog_get_instance_private (PreferencesDialog* self)
{
	return G_STRUCT_MEMBER_P (self, PreferencesDialog_private_offset);
}


155 156 157
static gpointer
_g_object_ref0 (gpointer self)
{
158
#line 75 "preferences-dialog.vala"
159
	return self ? g_object_ref (self) : NULL;
160
#line 161 "preferences-dialog.c"
161 162 163
}


164 165 166
static void
__lambda4_ (PreferencesDialog* self)
{
167
#line 80 "preferences-dialog.vala"
168
	gtk_widget_destroy ((GtkWidget*) self);
169
#line 170 "preferences-dialog.c"
170 171 172
}


173 174 175 176 177
static void
___lambda4__gtk_dialog_response (GtkDialog* _sender,
                                 gint response_id,
                                 gpointer self)
{
178
#line 79 "preferences-dialog.vala"
179
	__lambda4_ ((PreferencesDialog*) self);
180
#line 181 "preferences-dialog.c"
181 182 183
}


184 185 186 187
static void
_preferences_dialog_radio_button_toggled_cb_gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                                       gpointer self)
{
188
#line 96 "preferences-dialog.vala"
189
	preferences_dialog_radio_button_toggled_cb ((PreferencesDialog*) self, _sender);
190
#line 191 "preferences-dialog.c"
191 192 193
}


194 195 196 197
static void
_preferences_dialog_sound_toggled_cb_gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                                gpointer self)
{
198
#line 101 "preferences-dialog.vala"
199
	preferences_dialog_sound_toggled_cb ((PreferencesDialog*) self);
200
#line 201 "preferences-dialog.c"
201 202 203
}


204 205 206 207
static void
_preferences_dialog_fakes_toggles_cb_gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                                gpointer self)
{
208
#line 105 "preferences-dialog.vala"
209
	preferences_dialog_fakes_toggles_cb ((PreferencesDialog*) self);
210
#line 211 "preferences-dialog.c"
211 212 213
}


214 215 216 217 218 219 220 221
static void
_preferences_dialog_accel_edited_cb_gtk_cell_renderer_accel_accel_edited (GtkCellRendererAccel* _sender,
                                                                          const gchar* path_string,
                                                                          guint accel_key,
                                                                          GdkModifierType accel_mods,
                                                                          guint hardware_keycode,
                                                                          gpointer self)
{
222
#line 145 "preferences-dialog.vala"
223
	preferences_dialog_accel_edited_cb ((PreferencesDialog*) self, _sender, path_string, accel_key, accel_mods, hardware_keycode);
224
#line 225 "preferences-dialog.c"
225 226 227
}


228 229 230 231 232
static void
_preferences_dialog_accel_cleared_cb_gtk_cell_renderer_accel_accel_cleared (GtkCellRendererAccel* _sender,
                                                                            const gchar* path_string,
                                                                            gpointer self)
{
233
#line 146 "preferences-dialog.vala"
234
	preferences_dialog_accel_cleared_cb ((PreferencesDialog*) self, _sender, path_string);
235
#line 236 "preferences-dialog.c"
236 237 238
}


239 240 241 242
static void
_preferences_dialog_combo_box_changed_cb_gtk_combo_box_changed (GtkComboBox* _sender,
                                                                gpointer self)
{
243
#line 167 "preferences-dialog.vala"
244
	preferences_dialog_combo_box_changed_cb ((PreferencesDialog*) self, _sender);
245
#line 246 "preferences-dialog.c"
246 247 248
}


249 250 251 252 253 254
PreferencesDialog*
preferences_dialog_construct (GType object_type,
                              GtkApplicationWindow* window,
                              GSettings* settings,
                              GeeArrayList* worm_settings)
{
255 256
	PreferencesDialog * self = NULL;
	GSettings* _tmp0_;
257 258
	GeeArrayList* _tmp1_;
	GtkApplicationWindow* _tmp2_;
259
	GeeArrayList* _tmp3_;
260 261 262 263
	GeeArrayList* _tmp4_;
	GtkRadioButton* _tmp5_;
	GeeArrayList* _tmp6_;
	GtkRadioButton* _tmp7_;
264 265 266 267
	GeeArrayList* _tmp8_;
	GtkRadioButton* _tmp9_;
	GeeArrayList* _tmp10_;
	GtkRadioButton* _tmp11_;
268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283
	GtkCheckButton* _tmp28_;
	GtkCheckButton* _tmp29_;
	GtkCheckButton* _tmp30_;
	GtkCheckButton* _tmp31_;
	GeeArrayList* _tmp32_;
	GeeArrayList* _tmp33_;
	GtkTreeView* _tmp34_;
	GeeArrayList* _tmp35_;
	GtkTreeView* _tmp36_;
	GeeArrayList* _tmp37_;
	GtkTreeView* _tmp38_;
	GeeArrayList* _tmp39_;
	GtkTreeView* _tmp40_;
	GeeArrayList* _tmp41_;
	GeeArrayList* _tmp42_;
	GtkListStore* _tmp43_;
284
	GeeArrayList* _tmp44_;
285
	GtkListStore* _tmp45_;
286
	GeeArrayList* _tmp46_;
287
	GtkListStore* _tmp47_;
288
	GeeArrayList* _tmp48_;
289 290 291 292 293 294 295 296 297 298
	GtkListStore* _tmp49_;
	GeeArrayList* _tmp109_;
	GeeArrayList* _tmp110_;
	GtkComboBoxText* _tmp111_;
	GeeArrayList* _tmp112_;
	GtkComboBoxText* _tmp113_;
	GeeArrayList* _tmp114_;
	GtkComboBoxText* _tmp115_;
	GeeArrayList* _tmp116_;
	GtkComboBoxText* _tmp117_;
299
#line 71 "preferences-dialog.vala"
300
	g_return_val_if_fail (window != NULL, NULL);
301
#line 71 "preferences-dialog.vala"
302
	g_return_val_if_fail (settings != NULL, NULL);
303
#line 71 "preferences-dialog.vala"
304
	g_return_val_if_fail (worm_settings != NULL, NULL);
305
#line 73 "preferences-dialog.vala"
306
	self = (PreferencesDialog*) g_object_new (object_type, "use-header-bar", 1, NULL);
307
#line 75 "preferences-dialog.vala"
308
	_tmp0_ = _g_object_ref0 (settings);
309
#line 75 "preferences-dialog.vala"
310
	_g_object_unref0 (self->priv->settings);
311
#line 75 "preferences-dialog.vala"
312
	self->priv->settings = _tmp0_;
313
#line 76 "preferences-dialog.vala"
314
	_tmp1_ = _g_object_ref0 (worm_settings);
315
#line 76 "preferences-dialog.vala"
316
	_g_object_unref0 (self->priv->worm_settings);
317
#line 76 "preferences-dialog.vala"
318
	self->priv->worm_settings = _tmp1_;
319
#line 77 "preferences-dialog.vala"
320
	_tmp2_ = _g_object_ref0 (window);
321
#line 77 "preferences-dialog.vala"
322
	_g_object_unref0 (self->priv->window);
323
#line 77 "preferences-dialog.vala"
324
	self->priv->window = _tmp2_;
325
#line 79 "preferences-dialog.vala"
326
	g_signal_connect_object ((GtkDialog*) self, "response", (GCallback) ___lambda4__gtk_dialog_response, self, 0);
327
#line 83 "preferences-dialog.vala"
328
	gtk_window_set_transient_for ((GtkWindow*) self, (GtkWindow*) window);
329
#line 86 "preferences-dialog.vala"
330
	_tmp3_ = gee_array_list_new (gtk_radio_button_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
331
#line 86 "preferences-dialog.vala"
332
	_g_object_unref0 (self->priv->radio_buttons);
333
#line 86 "preferences-dialog.vala"
334
	self->priv->radio_buttons = _tmp3_;
335
#line 87 "preferences-dialog.vala"
336
	_tmp4_ = self->priv->radio_buttons;
337
#line 87 "preferences-dialog.vala"
338
	_tmp5_ = self->priv->beginner_radio_button;
339
#line 87 "preferences-dialog.vala"
340
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp4_, _tmp5_);
341
#line 88 "preferences-dialog.vala"
342
	_tmp6_ = self->priv->radio_buttons;
343
#line 88 "preferences-dialog.vala"
344
	_tmp7_ = self->priv->slow_radio_button;
345
#line 88 "preferences-dialog.vala"
346
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp6_, _tmp7_);
347
#line 89 "preferences-dialog.vala"
348
	_tmp8_ = self->priv->radio_buttons;
349
#line 89 "preferences-dialog.vala"
350
	_tmp9_ = self->priv->medium_radio_button;
351
#line 89 "preferences-dialog.vala"
352
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp8_, _tmp9_);
353
#line 90 "preferences-dialog.vala"
354
	_tmp10_ = self->priv->radio_buttons;
355
#line 90 "preferences-dialog.vala"
356
	_tmp11_ = self->priv->fast_radio_button;
357
#line 90 "preferences-dialog.vala"
358
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp10_, _tmp11_);
359
#line 360 "preferences-dialog.c"
360
	{
361 362 363 364 365 366 367 368
		GeeArrayList* _radio_button_list = NULL;
		GeeArrayList* _tmp12_;
		GeeArrayList* _tmp13_;
		gint _radio_button_size = 0;
		GeeArrayList* _tmp14_;
		gint _tmp15_;
		gint _tmp16_;
		gint _radio_button_index = 0;
369
#line 92 "preferences-dialog.vala"
370
		_tmp12_ = self->priv->radio_buttons;
371
#line 92 "preferences-dialog.vala"
372
		_tmp13_ = _g_object_ref0 (_tmp12_);
373
#line 92 "preferences-dialog.vala"
374
		_radio_button_list = _tmp13_;
375
#line 92 "preferences-dialog.vala"
376
		_tmp14_ = _radio_button_list;
377
#line 92 "preferences-dialog.vala"
378
		_tmp15_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp14_);
379
#line 92 "preferences-dialog.vala"
380
		_tmp16_ = _tmp15_;
381
#line 92 "preferences-dialog.vala"
382
		_radio_button_size = _tmp16_;
383
#line 92 "preferences-dialog.vala"
384
		_radio_button_index = -1;
385
#line 92 "preferences-dialog.vala"
386
		while (TRUE) {
387
#line 388 "preferences-dialog.c"
388 389 390 391 392
			gint _tmp17_;
			gint _tmp18_;
			gint _tmp19_;
			GtkRadioButton* radio_button = NULL;
			GeeArrayList* _tmp20_;
393
			gint _tmp21_;
394 395 396 397 398 399 400
			gpointer _tmp22_;
			gint speed = 0;
			GeeArrayList* _tmp23_;
			GtkRadioButton* _tmp24_;
			GtkRadioButton* _tmp25_;
			gint _tmp26_;
			GtkRadioButton* _tmp27_;
401
#line 92 "preferences-dialog.vala"
402
			_tmp17_ = _radio_button_index;
403
#line 92 "preferences-dialog.vala"
404
			_radio_button_index = _tmp17_ + 1;
405
#line 92 "preferences-dialog.vala"
406
			_tmp18_ = _radio_button_index;
407
#line 92 "preferences-dialog.vala"
408
			_tmp19_ = _radio_button_size;
409
#line 92 "preferences-dialog.vala"
410
			if (!(_tmp18_ < _tmp19_)) {
411
#line 92 "preferences-dialog.vala"
412
				break;
413
#line 414 "preferences-dialog.c"
414
			}
415
#line 92 "preferences-dialog.vala"
416
			_tmp20_ = _radio_button_list;
417
#line 92 "preferences-dialog.vala"
418
			_tmp21_ = _radio_button_index;
419
#line 92 "preferences-dialog.vala"
420
			_tmp22_ = gee_abstract_list_get ((GeeAbstractList*) _tmp20_, _tmp21_);
421
#line 92 "preferences-dialog.vala"
422
			radio_button = (GtkRadioButton*) _tmp22_;
423
#line 94 "preferences-dialog.vala"
424
			_tmp23_ = self->priv->radio_buttons;
425
#line 94 "preferences-dialog.vala"
426
			_tmp24_ = radio_button;
427
#line 94 "preferences-dialog.vala"
428
			speed = NIBBLES_GAME_MAX_SPEED - gee_abstract_list_index_of ((GeeAbstractList*) _tmp23_, _tmp24_);
429
#line 95 "preferences-dialog.vala"
430
			_tmp25_ = radio_button;
431
#line 95 "preferences-dialog.vala"
432
			_tmp26_ = speed;
433
#line 95 "preferences-dialog.vala"
434
			gtk_toggle_button_set_active ((GtkToggleButton*) _tmp25_, _tmp26_ == g_settings_get_int (settings, "speed"));
435
#line 96 "preferences-dialog.vala"
436
			_tmp27_ = radio_button;
437
#line 96 "preferences-dialog.vala"
438
			g_signal_connect_object ((GtkToggleButton*) _tmp27_, "toggled", (GCallback) _preferences_dialog_radio_button_toggled_cb_gtk_toggle_button_toggled, self, 0);
439
#line 92 "preferences-dialog.vala"
440
			_g_object_unref0 (radio_button);
441
#line 442 "preferences-dialog.c"
442
		}
443
#line 92 "preferences-dialog.vala"
444
		_g_object_unref0 (_radio_button_list);
445
#line 446 "preferences-dialog.c"
446
	}
447
#line 100 "preferences-dialog.vala"
448
	_tmp28_ = self->priv->sound_check_button;
449
#line 100 "preferences-dialog.vala"
450
	gtk_toggle_button_set_active ((GtkToggleButton*) _tmp28_, g_settings_get_boolean (settings, "sound"));
451
#line 101 "preferences-dialog.vala"
452
	_tmp29_ = self->priv->sound_check_button;
453
#line 101 "preferences-dialog.vala"
454
	g_signal_connect_object ((GtkToggleButton*) _tmp29_, "toggled", (GCallback) _preferences_dialog_sound_toggled_cb_gtk_toggle_button_toggled, self, 0);
455
#line 104 "preferences-dialog.vala"
456
	_tmp30_ = self->priv->fakes_check_button;
457
#line 104 "preferences-dialog.vala"
458
	gtk_toggle_button_set_active ((GtkToggleButton*) _tmp30_, g_settings_get_boolean (settings, "fakes"));
459
#line 105 "preferences-dialog.vala"
460
	_tmp31_ = self->priv->fakes_check_button;
461
#line 105 "preferences-dialog.vala"
462
	g_signal_connect_object ((GtkToggleButton*) _tmp31_, "toggled", (GCallback) _preferences_dialog_fakes_toggles_cb_gtk_toggle_button_toggled, self, 0);
463
#line 108 "preferences-dialog.vala"
464
	_tmp32_ = gee_array_list_new (gtk_tree_view_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
465
#line 108 "preferences-dialog.vala"
466
	_g_object_unref0 (self->priv->tree_views);
467
#line 108 "preferences-dialog.vala"
468
	self->priv->tree_views = _tmp32_;
469
#line 109 "preferences-dialog.vala"
470
	_tmp33_ = self->priv->tree_views;
471
#line 109 "preferences-dialog.vala"
472
	_tmp34_ = self->priv->tree_view_1;
473
#line 109 "preferences-dialog.vala"
474
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp33_, _tmp34_);
475
#line 110 "preferences-dialog.vala"
476
	_tmp35_ = self->priv->tree_views;
477
#line 110 "preferences-dialog.vala"
478
	_tmp36_ = self->priv->tree_view_2;
479
#line 110 "preferences-dialog.vala"
480
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp35_, _tmp36_);
481
#line 111 "preferences-dialog.vala"
482
	_tmp37_ = self->priv->tree_views;
483
#line 111 "preferences-dialog.vala"
484
	_tmp38_ = self->priv->tree_view_3;
485
#line 111 "preferences-dialog.vala"
486
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp37_, _tmp38_);
487
#line 112 "preferences-dialog.vala"
488
	_tmp39_ = self->priv->tree_views;
489
#line 112 "preferences-dialog.vala"
490
	_tmp40_ = self->priv->tree_view_4;
491
#line 112 "preferences-dialog.vala"
492
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp39_, _tmp40_);
493
#line 114 "preferences-dialog.vala"
494
	_tmp41_ = gee_array_list_new (gtk_list_store_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
495
#line 114 "preferences-dialog.vala"
496
	_g_object_unref0 (self->priv->list_stores);
497
#line 114 "preferences-dialog.vala"
498
	self->priv->list_stores = _tmp41_;
499
#line 115 "preferences-dialog.vala"
500
	_tmp42_ = self->priv->list_stores;
501
#line 115 "preferences-dialog.vala"
502
	_tmp43_ = self->priv->list_store_1;
503
#line 115 "preferences-dialog.vala"
504
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp42_, _tmp43_);
505
#line 116 "preferences-dialog.vala"
506
	_tmp44_ = self->priv->list_stores;
507
#line 116 "preferences-dialog.vala"
508
	_tmp45_ = self->priv->list_store_2;
509
#line 116 "preferences-dialog.vala"
510
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp44_, _tmp45_);
511
#line 117 "preferences-dialog.vala"
512
	_tmp46_ = self->priv->list_stores;
513
#line 117 "preferences-dialog.vala"
514
	_tmp47_ = self->priv->list_store_3;
515
#line 117 "preferences-dialog.vala"
516
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp46_, _tmp47_);
517
#line 118 "preferences-dialog.vala"
518
	_tmp48_ = self->priv->list_stores;
519
#line 118 "preferences-dialog.vala"
520
	_tmp49_ = self->priv->list_store_4;
521
#line 118 "preferences-dialog.vala"
522
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp48_, _tmp49_);
523
#line 524 "preferences-dialog.c"
524
	{
525 526 527 528 529 530 531 532
		GeeArrayList* _list_store_list = NULL;
		GeeArrayList* _tmp50_;
		GeeArrayList* _tmp51_;
		gint _list_store_size = 0;
		GeeArrayList* _tmp52_;
		gint _tmp53_;
		gint _tmp54_;
		gint _list_store_index = 0;
533
#line 120 "preferences-dialog.vala"
534
		_tmp50_ = self->priv->list_stores;
535
#line 120 "preferences-dialog.vala"
536
		_tmp51_ = _g_object_ref0 (_tmp50_);
537
#line 120 "preferences-dialog.vala"
538
		_list_store_list = _tmp51_;
539
#line 120 "preferences-dialog.vala"
540
		_tmp52_ = _list_store_list;
541
#line 120 "preferences-dialog.vala"
542
		_tmp53_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp52_);
543
#line 120 "preferences-dialog.vala"
544
		_tmp54_ = _tmp53_;
545
#line 120 "preferences-dialog.vala"
546
		_list_store_size = _tmp54_;
547
#line 120 "preferences-dialog.vala"
548
		_list_store_index = -1;
549
#line 120 "preferences-dialog.vala"
550
		while (TRUE) {
551
#line 552 "preferences-dialog.c"
552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569
			gint _tmp55_;
			gint _tmp56_;
			gint _tmp57_;
			GtkListStore* list_store = NULL;
			GeeArrayList* _tmp58_;
			gint _tmp59_;
			gpointer _tmp60_;
			gint id = 0;
			GeeArrayList* _tmp61_;
			GtkListStore* _tmp62_;
			GtkTreeView* tree_view = NULL;
			GeeArrayList* _tmp63_;
			gint _tmp64_;
			gpointer _tmp65_;
			GtkTreeIter iter = {0};
			GtkListStore* _tmp66_;
			GtkTreeIter _tmp67_ = {0};
			gint keyval = 0;
570
			gint _tmp68_;
571 572 573 574 575
			gpointer _tmp69_;
			GSettings* _tmp70_;
			gint _tmp71_;
			GtkListStore* _tmp72_;
			GtkTreeIter _tmp73_;
576
			gint _tmp74_;
577 578 579 580 581 582 583 584 585 586
			GtkListStore* _tmp75_;
			GtkTreeIter _tmp76_ = {0};
			gint _tmp77_;
			gpointer _tmp78_;
			GSettings* _tmp79_;
			GtkListStore* _tmp80_;
			GtkTreeIter _tmp81_;
			gint _tmp82_;
			GtkListStore* _tmp83_;
			GtkTreeIter _tmp84_ = {0};
587
			gint _tmp85_;
588 589 590 591 592 593 594 595 596 597
			gpointer _tmp86_;
			GSettings* _tmp87_;
			GtkListStore* _tmp88_;
			GtkTreeIter _tmp89_;
			gint _tmp90_;
			GtkListStore* _tmp91_;
			GtkTreeIter _tmp92_ = {0};
			gint _tmp93_;
			gpointer _tmp94_;
			GSettings* _tmp95_;
598 599 600
			GtkListStore* _tmp96_;
			GtkTreeIter _tmp97_;
			gint _tmp98_;
601 602 603 604 605 606 607 608 609 610 611 612
			GtkCellRendererText* label_renderer = NULL;
			GtkCellRendererText* _tmp99_;
			GtkTreeView* _tmp100_;
			GtkCellRendererText* _tmp101_;
			GtkCellRendererAccel* key_renderer = NULL;
			GtkCellRendererAccel* _tmp102_;
			GtkCellRendererAccel* _tmp103_;
			GtkCellRendererAccel* _tmp104_;
			GtkCellRendererAccel* _tmp105_;
			GtkCellRendererAccel* _tmp106_;
			GtkTreeView* _tmp107_;
			GtkCellRendererAccel* _tmp108_;
613
#line 120 "preferences-dialog.vala"
614
			_tmp55_ = _list_store_index;
615
#line 120 "preferences-dialog.vala"
616
			_list_store_index = _tmp55_ + 1;
617
#line 120 "preferences-dialog.vala"
618
			_tmp56_ = _list_store_index;
619
#line 120 "preferences-dialog.vala"
620
			_tmp57_ = _list_store_size;
621
#line 120 "preferences-dialog.vala"
622
			if (!(_tmp56_ < _tmp57_)) {
623
#line 120 "preferences-dialog.vala"
624
				break;
625
#line 626 "preferences-dialog.c"
626
			}
627
#line 120 "preferences-dialog.vala"
628
			_tmp58_ = _list_store_list;
629
#line 120 "preferences-dialog.vala"
630
			_tmp59_ = _list_store_index;
631
#line 120 "preferences-dialog.vala"
632
			_tmp60_ = gee_abstract_list_get ((GeeAbstractList*) _tmp58_, _tmp59_);
633
#line 120 "preferences-dialog.vala"
634
			list_store = (GtkListStore*) _tmp60_;
635
#line 122 "preferences-dialog.vala"
636
			_tmp61_ = self->priv->list_stores;
637
#line 122 "preferences-dialog.vala"
638
			_tmp62_ = list_store;
639
#line 122 "preferences-dialog.vala"
640
			id = gee_abstract_list_index_of ((GeeAbstractList*) _tmp61_, _tmp62_);
641
#line 123 "preferences-dialog.vala"
642
			_tmp63_ = self->priv->tree_views;
643
#line 123 "preferences-dialog.vala"
644
			_tmp64_ = id;
645
#line 123 "preferences-dialog.vala"
646
			_tmp65_ = gee_abstract_list_get ((GeeAbstractList*) _tmp63_, _tmp64_);
647
#line 123 "preferences-dialog.vala"
648
			tree_view = (GtkTreeView*) _tmp65_;
649
#line 126 "preferences-dialog.vala"
650
			_tmp66_ = list_store;
651
#line 126 "preferences-dialog.vala"
652
			gtk_list_store_append (_tmp66_, &_tmp67_);
653
#line 126 "preferences-dialog.vala"
654
			iter = _tmp67_;
655
#line 127 "preferences-dialog.vala"
656
			_tmp68_ = id;
657
#line 127 "preferences-dialog.vala"
658
			_tmp69_ = gee_abstract_list_get ((GeeAbstractList*) worm_settings, _tmp68_);
659
#line 127 "preferences-dialog.vala"
660
			_tmp70_ = (GSettings*) _tmp69_;
661
#line 127 "preferences-dialog.vala"
662
			_tmp71_ = g_settings_get_int (_tmp70_, "key-up");
663
#line 127 "preferences-dialog.vala"
664
			_g_object_unref0 (_tmp70_);
665
#line 127 "preferences-dialog.vala"
666
			keyval = _tmp71_;
667
#line 128 "preferences-dialog.vala"
668
			_tmp72_ = list_store;
669
#line 128 "preferences-dialog.vala"
670
			_tmp73_ = iter;
671
#line 128 "preferences-dialog.vala"
672
			_tmp74_ = keyval;
673
#line 128 "preferences-dialog.vala"
674
			gtk_list_store_set (_tmp72_, &_tmp73_, 0, "key-up", 1, _ ("Move up"), 2, _tmp74_, -1);
675
#line 129 "preferences-dialog.vala"
676
			_tmp75_ = list_store;
677
#line 129 "preferences-dialog.vala"
678
			gtk_list_store_append (_tmp75_, &_tmp76_);
679
#line 129 "preferences-dialog.vala"
680
			iter = _tmp76_;
681
#line 130 "preferences-dialog.vala"
682
			_tmp77_ = id;
683
#line 130 "preferences-dialog.vala"
684
			_tmp78_ = gee_abstract_list_get ((GeeAbstractList*) worm_settings, _tmp77_);
685
#line 130 "preferences-dialog.vala"
686
			_tmp79_ = (GSettings*) _tmp78_;
687
#line 130 "preferences-dialog.vala"
688
			keyval = g_settings_get_int (_tmp79_, "key-down");
689
#line 130 "preferences-dialog.vala"
690
			_g_object_unref0 (_tmp79_);
691
#line 131 "preferences-dialog.vala"
692
			_tmp80_ = list_store;
693
#line 131 "preferences-dialog.vala"
694
			_tmp81_ = iter;
695
#line 131 "preferences-dialog.vala"
696
			_tmp82_ = keyval;
697
#line 131 "preferences-dialog.vala"
698
			gtk_list_store_set (_tmp80_, &_tmp81_, 0, "key-down", 1, _ ("Move down"), 2, _tmp82_, -1);
699
#line 132 "preferences-dialog.vala"
700
			_tmp83_ = list_store;
701
#line 132 "preferences-dialog.vala"
702
			gtk_list_store_append (_tmp83_, &_tmp84_);
703
#line 132 "preferences-dialog.vala"
704
			iter = _tmp84_;
705
#line 133 "preferences-dialog.vala"
706
			_tmp85_ = id;
707
#line 133 "preferences-dialog.vala"
708
			_tmp86_ = gee_abstract_list_get ((GeeAbstractList*) worm_settings, _tmp85_);
709
#line 133 "preferences-dialog.vala"
710
			_tmp87_ = (GSettings*) _tmp86_;
711
#line 133 "preferences-dialog.vala"
712
			keyval = g_settings_get_int (_tmp87_, "key-left");
713
#line 133 "preferences-dialog.vala"
714
			_g_object_unref0 (_tmp87_);
715
#line 134 "preferences-dialog.vala"
716
			_tmp88_ = list_store;
717
#line 134 "preferences-dialog.vala"
718
			_tmp89_ = iter;
719
#line 134 "preferences-dialog.vala"
720
			_tmp90_ = keyval;
721
#line 134 "preferences-dialog.vala"
722
			gtk_list_store_set (_tmp88_, &_tmp89_, 0, "key-left", 1, _ ("Move left"), 2, _tmp90_, -1);
723
#line 135 "preferences-dialog.vala"
724
			_tmp91_ = list_store;
725
#line 135 "preferences-dialog.vala"
726
			gtk_list_store_append (_tmp91_, &_tmp92_);
727
#line 135 "preferences-dialog.vala"
728
			iter = _tmp92_;
729
#line 136 "preferences-dialog.vala"
730
			_tmp93_ = id;
731
#line 136 "preferences-dialog.vala"
732
			_tmp94_ = gee_abstract_list_get ((GeeAbstractList*) worm_settings, _tmp93_);
733
#line 136 "preferences-dialog.vala"
734
			_tmp95_ = (GSettings*) _tmp94_;
735
#line 136 "preferences-dialog.vala"
736
			keyval = g_settings_get_int (_tmp95_, "key-right");
737
#line 136 "preferences-dialog.vala"
738
			_g_object_unref0 (_tmp95_);
739
#line 137 "preferences-dialog.vala"
740
			_tmp96_ = list_store;
741
#line 137 "preferences-dialog.vala"
742
			_tmp97_ = iter;
743
#line 137 "preferences-dialog.vala"
744
			_tmp98_ = keyval;
745
#line 137 "preferences-dialog.vala"
746
			gtk_list_store_set (_tmp96_, &_tmp97_, 0, "key-right", 1, _ ("Move right"), 2, _tmp98_, -1);
747
#line 139 "preferences-dialog.vala"
748
			_tmp99_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
749
#line 139 "preferences-dialog.vala"
750
			g_object_ref_sink (_tmp99_);
751
#line 139 "preferences-dialog.vala"
752
			label_renderer = _tmp99_;
753
#line 140 "preferences-dialog.vala"
754
			_tmp100_ = tree_view;
755
#line 140 "preferences-dialog.vala"
756
			_tmp101_ = label_renderer;
757
#line 140 "preferences-dialog.vala"
758
			gtk_tree_view_insert_column_with_attributes (_tmp100_, -1, _ ("Action"), (GtkCellRenderer*) _tmp101_, "text", 1, NULL);
759
#line 142 "preferences-dialog.vala"
760
			_tmp102_ = (GtkCellRendererAccel*) gtk_cell_renderer_accel_new ();
761
#line 142 "preferences-dialog.vala"
762
			g_object_ref_sink (_tmp102_);
763
#line 142 "preferences-dialog.vala"
764
			key_renderer = _tmp102_;
765
#line 143 "preferences-dialog.vala"
766
			_tmp103_ = key_renderer;
767
#line 143 "preferences-dialog.vala"
768
			g_object_set ((GtkCellRendererText*) _tmp103_, "editable", TRUE, NULL);
769
#line 144 "preferences-dialog.vala"
770
			_tmp104_ = key_renderer;
771
#line 144 "preferences-dialog.vala"
772
			g_object_set (_tmp104_, "accel-mode", GTK_CELL_RENDERER_ACCEL_MODE_OTHER, NULL);
773
#line 145 "preferences-dialog.vala"
774
			_tmp105_ = key_renderer;
775
#line 145 "preferences-dialog.vala"
776
			g_signal_connect_object (_tmp105_, "accel-edited", (GCallback) _preferences_dialog_accel_edited_cb_gtk_cell_renderer_accel_accel_edited, self, 0);
777
#line 146 "preferences-dialog.vala"
778
			_tmp106_ = key_renderer;
779
#line 146 "preferences-dialog.vala"
780
			g_signal_connect_object (_tmp106_, "accel-cleared", (GCallback) _preferences_dialog_accel_cleared_cb_gtk_cell_renderer_accel_accel_cleared, self, 0);
781
#line 147 "preferences-dialog.vala"
782
			_tmp107_ = tree_view;
783
#line 147 "preferences-dialog.vala"
784
			_tmp108_ = key_renderer;
785
#line 147 "preferences-dialog.vala"
786
			gtk_tree_view_insert_column_with_attributes (_tmp107_, -1, _ ("Key"), (GtkCellRenderer*) _tmp108_, "accel-key", 2, NULL);
787
#line 120 "preferences-dialog.vala"
788
			_g_object_unref0 (key_renderer);
789
#line 120 "preferences-dialog.vala"
790
			_g_object_unref0 (label_renderer);
791
#line 120 "preferences-dialog.vala"
792
			_g_object_unref0 (tree_view);
793
#line 120 "preferences-dialog.vala"
794
			_g_object_unref0 (list_store);
795
#line 796 "preferences-dialog.c"
796
		}
797
#line 120 "preferences-dialog.vala"
798
		_g_object_unref0 (_list_store_list);
799
#line 800 "preferences-dialog.c"
800
	}
801
#line 152 "preferences-dialog.vala"
802
	_tmp109_ = gee_array_list_new (gtk_combo_box_text_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
803
#line 152 "preferences-dialog.vala"
804
	_g_object_unref0 (self->priv->combo_boxes);
805
#line 152 "preferences-dialog.vala"
806
	self->priv->combo_boxes = _tmp109_;
807
#line 153 "preferences-dialog.vala"
808
	_tmp110_ = self->priv->combo_boxes;
809
#line 153 "preferences-dialog.vala"
810
	_tmp111_ = self->priv->combo_box_1;
811
#line 153 "preferences-dialog.vala"
812
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp110_, _tmp111_);
813
#line 154 "preferences-dialog.vala"
814
	_tmp112_ = self->priv->combo_boxes;
815
#line 154 "preferences-dialog.vala"
816
	_tmp113_ = self->priv->combo_box_2;
817
#line 154 "preferences-dialog.vala"
818
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp112_, _tmp113_);
819
#line 155 "preferences-dialog.vala"
820
	_tmp114_ = self->priv->combo_boxes;
821
#line 155 "preferences-dialog.vala"
822
	_tmp115_ = self->priv->combo_box_3;
823
#line 155 "preferences-dialog.vala"
824
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp114_, _tmp115_);
825
#line 156 "preferences-dialog.vala"
826
	_tmp116_ = self->priv->combo_boxes;
827
#line 156 "preferences-dialog.vala"
828
	_tmp117_ = self->priv->combo_box_4;
829
#line 156 "preferences-dialog.vala"
830
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp116_, _tmp117_);
831
#line 832 "preferences-dialog.c"
832
	{
833 834 835 836 837 838 839 840
		GeeArrayList* _combo_box_list = NULL;
		GeeArrayList* _tmp118_;
		GeeArrayList* _tmp119_;
		gint _combo_box_size = 0;
		GeeArrayList* _tmp120_;
		gint _tmp121_;
		gint _tmp122_;
		gint _combo_box_index = 0;
841
#line 158 "preferences-dialog.vala"
842
		_tmp118_ = self->priv->combo_boxes;
843
#line 158 "preferences-dialog.vala"
844
		_tmp119_ = _g_object_ref0 (_tmp118_);
845
#line 158 "preferences-dialog.vala"
846
		_combo_box_list = _tmp119_;
847
#line 158 "preferences-dialog.vala"
848
		_tmp120_ = _combo_box_list;
849
#line 158 "preferences-dialog.vala"
850
		_tmp121_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp120_);
851
#line 158 "preferences-dialog.vala"
852
		_tmp122_ = _tmp121_;
853
#line 158 "preferences-dialog.vala"
854
		_combo_box_size = _tmp122_;
855
#line 158 "preferences-dialog.vala"
856
		_combo_box_index = -1;
857
#line 158 "preferences-dialog.vala"
858
		while (TRUE) {
859
#line 860 "preferences-dialog.c"
860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875
			gint _tmp123_;
			gint _tmp124_;
			gint _tmp125_;
			GtkComboBoxText* combo_box = NULL;
			GeeArrayList* _tmp126_;
			gint _tmp127_;
			gpointer _tmp128_;
			gint id = 0;
			GeeArrayList* _tmp136_;
			GtkComboBoxText* _tmp137_;
			gint color = 0;
			gint _tmp138_;
			gpointer _tmp139_;
			GSettings* _tmp140_;
			gint _tmp141_;
			GtkComboBoxText* _tmp142_;
876
			gint _tmp143_;
877
			GtkComboBoxText* _tmp144_;
878
#line 158 "preferences-dialog.vala"
879
			_tmp123_ = _combo_box_index;
880
#line 158 "preferences-dialog.vala"
881
			_combo_box_index = _tmp123_ + 1;
882
#line 158 "preferences-dialog.vala"
883
			_tmp124_ = _combo_box_index;
884
#line 158 "preferences-dialog.vala"
885
			_tmp125_ = _combo_box_size;
886
#line 158 "preferences-dialog.vala"
887
			if (!(_tmp124_ < _tmp125_)) {
888
#line 158 "preferences-dialog.vala"
889
				break;
890
#line 891 "preferences-dialog.c"
891
			}
892
#line 158 "preferences-dialog.vala"
893
			_tmp126_ = _combo_box_list;
894
#line 158 "preferences-dialog.vala"
895
			_tmp127_ = _combo_box_index;
896
#line 158 "preferences-dialog.vala"
897
			_tmp128_ = gee_abstract_list_get ((GeeAbstractList*) _tmp126_, _tmp127_);
898
#line 158 "preferences-dialog.vala"
899
			combo_box = (GtkComboBoxText*) _tmp128_;
900
#line 901 "preferences-dialog.c"
901
			{
902
				gint i = 0;
903
#line 160 "preferences-dialog.vala"
904
				i = 0;
905
#line 906 "preferences-dialog.c"
906
				{
907
					gboolean _tmp129_ = FALSE;
908
#line 160 "preferences-dialog.vala"
909
					_tmp129_ = TRUE;
910
#line 160 "preferences-dialog.vala"
911
					while (TRUE) {
912
#line 913 "preferences-dialog.c"
913 914 915 916 917
						gint _tmp131_;
						GtkComboBoxText* _tmp132_;
						gint _tmp133_;
						gchar* _tmp134_;
						gchar* _tmp135_;
918
#line 160 "preferences-dialog.vala"
919
						if (!_tmp129_) {
920
#line 921 "preferences-dialog.c"
921
							gint _tmp130_;
922
#line 160 "preferences-dialog.vala"
923
							_tmp130_ = i;
924
#line 160 "preferences-dialog.vala"
925
							i = _tmp130_ + 1;
926
#line 927 "preferences-dialog.c"
927
						}
928
#line 160 "preferences-dialog.vala"
929
						_tmp129_ = FALSE;
930
#line 160 "preferences-dialog.vala"
931
						_tmp131_ = i;
932
#line 160 "preferences-dialog.vala"
933
						if (!(_tmp131_ < NIBBLES_VIEW_NUM_COLORS)) {
934
#line 160 "preferences-dialog.vala"
935
							break;
936
#line 937 "preferences-dialog.c"
937
						}
938
#line 161 "preferences-dialog.vala"
939
						_tmp132_ = combo_box;
940
#line 161 "preferences-dialog.vala"
941
						_tmp133_ = i;
942
#line 161 "preferences-dialog.vala"
943
						_tmp134_ = nibbles_view_colorval_name (_tmp133_);
944
#line 161 "preferences-dialog.vala"
945
						_tmp135_ = _tmp134_;
946
#line 161 "preferences-dialog.vala"
947
						gtk_combo_box_text_append_text (_tmp132_, _tmp135_);
948
#line 161 "preferences-dialog.vala"
949
						_g_free0 (_tmp135_);
950
#line 951 "preferences-dialog.c"
951 952 953
					}
				}
			}
954
#line 163 "preferences-dialog.vala"
955
			_tmp136_ = self->priv->combo_boxes;
956
#line 163 "preferences-dialog.vala"
957
			_tmp137_ = combo_box;
958
#line 163 "preferences-dialog.vala"
959
			id = gee_abstract_list_index_of ((GeeAbstractList*) _tmp136_, _tmp137_);
960
#line 165 "preferences-dialog.vala"