~ubuntu-branches/debian/jessie/cheese/jessie

« back to all changes in this revision

Viewing changes to src/cheese-preferences.c

  • Committer: Package Import Robot
  • Author(s): Andreas Henriksson
  • Date: 2014-04-02 21:39:33 UTC
  • mfrom: (1.5.1) (15.1.7 experimental)
  • Revision ID: package-import@ubuntu.com-20140402213933-r0w3gna0pv7q7085
Tags: 3.12.0-1
* New upstream release.
* Revert changes done in 3.10.1-3
  - i.e. lower gnome-desktop build-dependency again.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* cheese-preferences.c generated by valac 0.21.2.4-6740f, the Vala compiler
 
1
/* cheese-preferences.c generated by valac 0.23.3.20-47868, the Vala compiler
2
2
 * generated from cheese-preferences.vala, do not modify */
3
3
 
4
4
/*
24
24
 
25
25
#include <glib.h>
26
26
#include <glib-object.h>
 
27
#include <gtk/gtk.h>
27
28
#include <cheese-camera.h>
28
29
#include <gio/gio.h>
29
 
#include <gtk/gtk.h>
30
30
#include <cheese-fileutil.h>
31
 
#include <cheese-config.h>
32
 
#include <float.h>
33
 
#include <math.h>
34
31
#include <stdlib.h>
35
32
#include <string.h>
36
33
#include <cheese-camera-device.h>
 
34
#include <float.h>
 
35
#include <math.h>
37
36
#include <gdk/gdk.h>
38
37
 
39
38
 
48
47
typedef struct _CheesePreferencesDialogClass CheesePreferencesDialogClass;
49
48
typedef struct _CheesePreferencesDialogPrivate CheesePreferencesDialogPrivate;
50
49
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
 
50
typedef struct _Block1Data Block1Data;
51
51
#define _g_free0(var) (var = (g_free (var), NULL))
52
 
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
53
 
typedef struct _Block1Data Block1Data;
 
52
#define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))
 
53
#define __vala_CheeseVideoFormat_free0(var) ((var == NULL) ? NULL : (var = (_vala_CheeseVideoFormat_free (var), NULL)))
54
54
typedef struct _Block2Data Block2Data;
55
55
 
56
56
struct _CheesePreferencesDialog {
57
 
        GObject parent_instance;
 
57
        GtkDialog parent_instance;
58
58
        CheesePreferencesDialogPrivate * priv;
59
59
};
60
60
 
61
61
struct _CheesePreferencesDialogClass {
62
 
        GObjectClass parent_class;
 
62
        GtkDialogClass parent_class;
63
63
};
64
64
 
65
65
struct _CheesePreferencesDialogPrivate {
66
66
        CheeseCamera* camera;
67
67
        GSettings* settings;
68
 
        GtkDialog* dialog;
69
68
        GtkComboBox* photo_resolution_combo;
70
69
        GtkComboBox* video_resolution_combo;
71
70
        GtkComboBox* source_combo;
74
73
        GtkAdjustment* contrast_adjustment;
75
74
        GtkAdjustment* hue_adjustment;
76
75
        GtkAdjustment* saturation_adjustment;
77
 
        GtkScale* brightness_scale;
78
 
        GtkScale* contrast_scale;
79
 
        GtkScale* hue_scale;
80
 
        GtkScale* saturation_scale;
81
76
        GtkSpinButton* burst_repeat_spin;
82
77
        GtkSpinButton* burst_delay_spin;
83
78
        GtkCheckButton* countdown_check;
87
82
 
88
83
struct _Block1Data {
89
84
        int _ref_count_;
90
 
        CheesePreferencesDialog * self;
 
85
        CheesePreferencesDialog* self;
91
86
        GtkListStore* resolution_model;
92
87
};
93
88
 
94
89
struct _Block2Data {
95
90
        int _ref_count_;
96
 
        CheesePreferencesDialog * self;
 
91
        CheesePreferencesDialog* self;
97
92
        GtkTreeIter iter;
98
93
        CheeseCameraDevice* active_device;
99
94
        gboolean device_removed;
119
114
static void cheese_preferences_dialog_setup_resolutions_for_device (CheesePreferencesDialog* self, CheeseCameraDevice* device);
120
115
static Block1Data* block1_data_ref (Block1Data* _data1_);
121
116
static void block1_data_unref (void * _userdata_);
122
 
static void __lambda3_ (Block1Data* _data1_, CheeseVideoFormat* format);
123
 
static void ___lambda3__gfunc (gconstpointer data, gpointer self);
124
 
void cheese_preferences_dialog_on_source_change (GtkComboBox* combo, CheesePreferencesDialog* self);
125
 
void cheese_preferences_dialog_on_photo_resolution_change (GtkComboBox* combo, CheesePreferencesDialog* self);
126
 
void cheese_preferences_dialog_on_video_resolution_change (GtkComboBox* combo, CheesePreferencesDialog* self);
127
 
void cheese_preferences_dialog_on_delete (GtkDialog* dialog, CheesePreferencesDialog* self);
128
 
void cheese_preferences_dialog_on_dialog_close (GtkButton* button, CheesePreferencesDialog* self);
129
 
void cheese_preferences_dialog_on_dialog_help (GtkButton* button, CheesePreferencesDialog* self);
130
 
void cheese_preferences_dialog_on_countdown_toggle (GtkCheckButton* checkbutton, CheesePreferencesDialog* self);
131
 
void cheese_preferences_dialog_on_flash_toggle (GtkCheckButton* checkbutton, CheesePreferencesDialog* self);
132
 
void cheese_preferences_dialog_on_burst_repeat_change (GtkSpinButton* spinbutton, CheesePreferencesDialog* self);
133
 
void cheese_preferences_dialog_on_burst_delay_change (GtkSpinButton* spinbutton, CheesePreferencesDialog* self);
134
 
void cheese_preferences_dialog_on_brightness_change (GtkAdjustment* adjustment, CheesePreferencesDialog* self);
135
 
void cheese_preferences_dialog_on_contrast_change (GtkAdjustment* adjustment, CheesePreferencesDialog* self);
136
 
void cheese_preferences_dialog_on_hue_change (GtkAdjustment* adjustment, CheesePreferencesDialog* self);
137
 
void cheese_preferences_dialog_on_saturation_change (GtkAdjustment* adjustment, CheesePreferencesDialog* self);
 
117
static void __lambda4_ (Block1Data* _data1_, CheeseVideoFormat* format);
 
118
static void ___lambda4__gfunc (gconstpointer data, gpointer self);
 
119
static void cheese_preferences_dialog_on_source_change (CheesePreferencesDialog* self, GtkComboBox* combo);
 
120
static void _cheese_preferences_dialog_on_source_change_gtk_combo_box_changed (GtkComboBox* _sender, gpointer self);
 
121
static void cheese_preferences_dialog_on_photo_resolution_change (CheesePreferencesDialog* self, GtkComboBox* combo);
 
122
static void _vala_CheeseVideoFormat_free (CheeseVideoFormat* self);
 
123
static void _cheese_preferences_dialog_on_photo_resolution_change_gtk_combo_box_changed (GtkComboBox* _sender, gpointer self);
 
124
static void cheese_preferences_dialog_on_video_resolution_change (CheesePreferencesDialog* self, GtkComboBox* combo);
 
125
static void _cheese_preferences_dialog_on_video_resolution_change_gtk_combo_box_changed (GtkComboBox* _sender, gpointer self);
 
126
static gboolean cheese_preferences_dialog_on_delete (CheesePreferencesDialog* self);
 
127
static gboolean _cheese_preferences_dialog_on_delete_gtk_widget_delete_event (GtkWidget* _sender, GdkEventAny* event, gpointer self);
 
128
static void cheese_preferences_dialog_on_dialog_close (CheesePreferencesDialog* self, GtkButton* button);
 
129
static void _cheese_preferences_dialog_on_dialog_close_gtk_button_clicked (GtkButton* _sender, gpointer self);
 
130
static void cheese_preferences_dialog_on_dialog_help (CheesePreferencesDialog* self, GtkButton* button);
 
131
static void _cheese_preferences_dialog_on_dialog_help_gtk_button_clicked (GtkButton* _sender, gpointer self);
 
132
static void cheese_preferences_dialog_on_burst_delay_change (CheesePreferencesDialog* self, GtkSpinButton* spinbutton);
 
133
static void _cheese_preferences_dialog_on_burst_delay_change_gtk_spin_button_value_changed (GtkSpinButton* _sender, gpointer self);
 
134
static void cheese_preferences_dialog_on_brightness_change (CheesePreferencesDialog* self, GtkAdjustment* adjustment);
 
135
static void _cheese_preferences_dialog_on_brightness_change_gtk_adjustment_value_changed (GtkAdjustment* _sender, gpointer self);
 
136
static void cheese_preferences_dialog_on_contrast_change (CheesePreferencesDialog* self, GtkAdjustment* adjustment);
 
137
static void _cheese_preferences_dialog_on_contrast_change_gtk_adjustment_value_changed (GtkAdjustment* _sender, gpointer self);
 
138
static void cheese_preferences_dialog_on_hue_change (CheesePreferencesDialog* self, GtkAdjustment* adjustment);
 
139
static void _cheese_preferences_dialog_on_hue_change_gtk_adjustment_value_changed (GtkAdjustment* _sender, gpointer self);
 
140
static void cheese_preferences_dialog_on_saturation_change (CheesePreferencesDialog* self, GtkAdjustment* adjustment);
 
141
static void _cheese_preferences_dialog_on_saturation_change_gtk_adjustment_value_changed (GtkAdjustment* _sender, gpointer self);
138
142
static Block2Data* block2_data_ref (Block2Data* _data2_);
139
143
static void block2_data_unref (void * _userdata_);
140
 
static void ___lambda4_ (Block2Data* _data2_, void* device);
 
144
static void ___lambda5_ (Block2Data* _data2_, void* device);
141
145
static void cheese_preferences_dialog_remove_camera_device (CheesePreferencesDialog* self, GtkTreeIter* iter, CheeseCameraDevice* device_node, CheeseCameraDevice* active_device_node);
142
 
static void ____lambda4__gfunc (gconstpointer data, gpointer self);
 
146
static void ____lambda5__gfunc (gconstpointer data, gpointer self);
143
147
static void cheese_preferences_dialog_set_new_available_camera_device (CheesePreferencesDialog* self, GtkTreeIter* iter);
144
 
void cheese_preferences_dialog_show (CheesePreferencesDialog* self);
145
 
void cheese_preferences_dialog_hide (CheesePreferencesDialog* self);
146
148
void cheese_preferences_dialog_set_current_mode (CheesePreferencesDialog* self, CheeseMediaMode mode);
147
149
static void cheese_preferences_dialog_finalize (GObject* obj);
148
150
 
153
155
 
154
156
 
155
157
static void _cheese_preferences_dialog_on_camera_update_num_camera_devices_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
156
 
        cheese_preferences_dialog_on_camera_update_num_camera_devices (self);
 
158
        cheese_preferences_dialog_on_camera_update_num_camera_devices ((CheesePreferencesDialog*) self);
157
159
}
158
160
 
159
161
 
162
164
        CheeseCamera* _tmp0_ = NULL;
163
165
        CheeseCamera* _tmp1_ = NULL;
164
166
        GSettings* _tmp2_ = NULL;
165
 
        GtkBuilder* builder = NULL;
166
 
        GtkBuilder* _tmp3_ = NULL;
167
 
        GObject* _tmp7_ = NULL;
168
 
        GtkDialog* _tmp8_ = NULL;
169
 
        GObject* _tmp9_ = NULL;
170
 
        GtkAdjustment* _tmp10_ = NULL;
171
 
        GObject* _tmp11_ = NULL;
172
 
        GtkAdjustment* _tmp12_ = NULL;
173
 
        GtkAdjustment* _tmp13_ = NULL;
174
 
        GtkAdjustment* _tmp14_ = NULL;
175
 
        GtkAdjustment* _tmp15_ = NULL;
176
 
        GObject* _tmp16_ = NULL;
177
 
        GtkAdjustment* _tmp17_ = NULL;
178
 
        GObject* _tmp18_ = NULL;
179
 
        GtkAdjustment* _tmp19_ = NULL;
180
 
        GObject* _tmp20_ = NULL;
181
 
        GtkScale* _tmp21_ = NULL;
182
 
        GObject* _tmp22_ = NULL;
183
 
        GtkScale* _tmp23_ = NULL;
184
 
        GObject* _tmp24_ = NULL;
185
 
        GtkScale* _tmp25_ = NULL;
186
 
        GObject* _tmp26_ = NULL;
187
 
        GtkScale* _tmp27_ = NULL;
188
 
        GtkScale* _tmp28_ = NULL;
189
 
        GtkScale* _tmp29_ = NULL;
190
 
        GtkScale* _tmp30_ = NULL;
191
 
        GtkScale* _tmp31_ = NULL;
192
 
        GObject* _tmp32_ = NULL;
193
 
        GtkComboBox* _tmp33_ = NULL;
194
 
        GObject* _tmp34_ = NULL;
195
 
        GtkComboBox* _tmp35_ = NULL;
196
 
        GObject* _tmp36_ = NULL;
197
 
        GtkComboBox* _tmp37_ = NULL;
198
 
        GObject* _tmp38_ = NULL;
199
 
        GtkSpinButton* _tmp39_ = NULL;
200
 
        GObject* _tmp40_ = NULL;
201
 
        GtkSpinButton* _tmp41_ = NULL;
202
 
        GObject* _tmp42_ = NULL;
203
 
        GtkCheckButton* _tmp43_ = NULL;
204
 
        GObject* _tmp44_ = NULL;
205
 
        GtkCheckButton* _tmp45_ = NULL;
206
 
        CheeseCamera* _tmp46_ = NULL;
207
 
        GError * _inner_error_ = NULL;
 
167
        CheeseCamera* _tmp3_ = NULL;
208
168
        g_return_val_if_fail (camera != NULL, NULL);
209
169
        self = (CheesePreferencesDialog*) g_object_new (object_type, NULL);
210
170
        _tmp0_ = camera;
214
174
        _tmp2_ = g_settings_new ("org.gnome.Cheese");
215
175
        _g_object_unref0 (self->priv->settings);
216
176
        self->priv->settings = _tmp2_;
217
 
        _tmp3_ = gtk_builder_new ();
218
 
        builder = _tmp3_;
219
 
        {
220
 
                gchar* _tmp4_ = NULL;
221
 
                gchar* _tmp5_ = NULL;
222
 
                _tmp4_ = g_build_filename (PACKAGE_DATADIR, "cheese-prefs.ui", NULL);
223
 
                _tmp5_ = _tmp4_;
224
 
                gtk_builder_add_from_file (builder, _tmp5_, &_inner_error_);
225
 
                _g_free0 (_tmp5_);
226
 
                if (_inner_error_ != NULL) {
227
 
                        goto __catch5_g_error;
228
 
                }
229
 
        }
230
 
        goto __finally5;
231
 
        __catch5_g_error:
232
 
        {
233
 
                GError* err = NULL;
234
 
                const gchar* _tmp6_ = NULL;
235
 
                err = _inner_error_;
236
 
                _inner_error_ = NULL;
237
 
                _tmp6_ = err->message;
238
 
                g_error ("cheese-preferences.vala:69: Error: %s", _tmp6_);
239
 
                _g_error_free0 (err);
240
 
        }
241
 
        __finally5:
242
 
        if (_inner_error_ != NULL) {
243
 
                _g_object_unref0 (builder);
244
 
                g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
245
 
                g_clear_error (&_inner_error_);
246
 
                return NULL;
247
 
        }
248
 
        _tmp7_ = gtk_builder_get_object (builder, "cheese_prefs_dialog");
249
 
        _tmp8_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp7_, GTK_TYPE_DIALOG) ? ((GtkDialog*) _tmp7_) : NULL);
250
 
        _g_object_unref0 (self->priv->dialog);
251
 
        self->priv->dialog = _tmp8_;
252
 
        _tmp9_ = gtk_builder_get_object (builder, "brightness_adjustment");
253
 
        _tmp10_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp9_, GTK_TYPE_ADJUSTMENT) ? ((GtkAdjustment*) _tmp9_) : NULL);
254
 
        _g_object_unref0 (self->priv->brightness_adjustment);
255
 
        self->priv->brightness_adjustment = _tmp10_;
256
 
        _tmp11_ = gtk_builder_get_object (builder, "contrast_adjustment");
257
 
        _tmp12_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp11_, GTK_TYPE_ADJUSTMENT) ? ((GtkAdjustment*) _tmp11_) : NULL;
258
 
        _tmp13_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp12_, GTK_TYPE_ADJUSTMENT) ? ((GtkAdjustment*) _tmp12_) : NULL;
259
 
        _tmp14_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp13_, GTK_TYPE_ADJUSTMENT) ? ((GtkAdjustment*) _tmp13_) : NULL;
260
 
        _tmp15_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp14_, GTK_TYPE_ADJUSTMENT) ? ((GtkAdjustment*) _tmp14_) : NULL);
261
 
        _g_object_unref0 (self->priv->contrast_adjustment);
262
 
        self->priv->contrast_adjustment = _tmp15_;
263
 
        _tmp16_ = gtk_builder_get_object (builder, "hue_adjustment");
264
 
        _tmp17_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp16_, GTK_TYPE_ADJUSTMENT) ? ((GtkAdjustment*) _tmp16_) : NULL);
265
 
        _g_object_unref0 (self->priv->hue_adjustment);
266
 
        self->priv->hue_adjustment = _tmp17_;
267
 
        _tmp18_ = gtk_builder_get_object (builder, "saturation_adjustment");
268
 
        _tmp19_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp18_, GTK_TYPE_ADJUSTMENT) ? ((GtkAdjustment*) _tmp18_) : NULL);
269
 
        _g_object_unref0 (self->priv->saturation_adjustment);
270
 
        self->priv->saturation_adjustment = _tmp19_;
271
 
        _tmp20_ = gtk_builder_get_object (builder, "brightness_scale");
272
 
        _tmp21_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp20_, GTK_TYPE_SCALE) ? ((GtkScale*) _tmp20_) : NULL);
273
 
        _g_object_unref0 (self->priv->brightness_scale);
274
 
        self->priv->brightness_scale = _tmp21_;
275
 
        _tmp22_ = gtk_builder_get_object (builder, "contrast_scale");
276
 
        _tmp23_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp22_, GTK_TYPE_SCALE) ? ((GtkScale*) _tmp22_) : NULL);
277
 
        _g_object_unref0 (self->priv->contrast_scale);
278
 
        self->priv->contrast_scale = _tmp23_;
279
 
        _tmp24_ = gtk_builder_get_object (builder, "hue_scale");
280
 
        _tmp25_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp24_, GTK_TYPE_SCALE) ? ((GtkScale*) _tmp24_) : NULL);
281
 
        _g_object_unref0 (self->priv->hue_scale);
282
 
        self->priv->hue_scale = _tmp25_;
283
 
        _tmp26_ = gtk_builder_get_object (builder, "saturation_scale");
284
 
        _tmp27_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp26_, GTK_TYPE_SCALE) ? ((GtkScale*) _tmp26_) : NULL);
285
 
        _g_object_unref0 (self->priv->saturation_scale);
286
 
        self->priv->saturation_scale = _tmp27_;
287
 
        _tmp28_ = self->priv->brightness_scale;
288
 
        gtk_scale_add_mark (_tmp28_, (gdouble) 0, GTK_POS_BOTTOM, NULL);
289
 
        _tmp29_ = self->priv->contrast_scale;
290
 
        gtk_scale_add_mark (_tmp29_, (gdouble) 1, GTK_POS_BOTTOM, NULL);
291
 
        _tmp30_ = self->priv->hue_scale;
292
 
        gtk_scale_add_mark (_tmp30_, (gdouble) 0, GTK_POS_BOTTOM, NULL);
293
 
        _tmp31_ = self->priv->saturation_scale;
294
 
        gtk_scale_add_mark (_tmp31_, (gdouble) 1, GTK_POS_BOTTOM, NULL);
295
 
        _tmp32_ = gtk_builder_get_object (builder, "photo_resolution_combo_box");
296
 
        _tmp33_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp32_, GTK_TYPE_COMBO_BOX) ? ((GtkComboBox*) _tmp32_) : NULL);
297
 
        _g_object_unref0 (self->priv->photo_resolution_combo);
298
 
        self->priv->photo_resolution_combo = _tmp33_;
299
 
        _tmp34_ = gtk_builder_get_object (builder, "video_resolution_combo_box");
300
 
        _tmp35_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp34_, GTK_TYPE_COMBO_BOX) ? ((GtkComboBox*) _tmp34_) : NULL);
301
 
        _g_object_unref0 (self->priv->video_resolution_combo);
302
 
        self->priv->video_resolution_combo = _tmp35_;
303
 
        _tmp36_ = gtk_builder_get_object (builder, "camera_combo_box");
304
 
        _tmp37_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp36_, GTK_TYPE_COMBO_BOX) ? ((GtkComboBox*) _tmp36_) : NULL);
305
 
        _g_object_unref0 (self->priv->source_combo);
306
 
        self->priv->source_combo = _tmp37_;
307
 
        _tmp38_ = gtk_builder_get_object (builder, "burst_repeat");
308
 
        _tmp39_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp38_, GTK_TYPE_SPIN_BUTTON) ? ((GtkSpinButton*) _tmp38_) : NULL);
309
 
        _g_object_unref0 (self->priv->burst_repeat_spin);
310
 
        self->priv->burst_repeat_spin = _tmp39_;
311
 
        _tmp40_ = gtk_builder_get_object (builder, "burst_delay");
312
 
        _tmp41_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp40_, GTK_TYPE_SPIN_BUTTON) ? ((GtkSpinButton*) _tmp40_) : NULL);
313
 
        _g_object_unref0 (self->priv->burst_delay_spin);
314
 
        self->priv->burst_delay_spin = _tmp41_;
315
 
        _tmp42_ = gtk_builder_get_object (builder, "countdown");
316
 
        _tmp43_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp42_, GTK_TYPE_CHECK_BUTTON) ? ((GtkCheckButton*) _tmp42_) : NULL);
317
 
        _g_object_unref0 (self->priv->countdown_check);
318
 
        self->priv->countdown_check = _tmp43_;
319
 
        _tmp44_ = gtk_builder_get_object (builder, "flash");
320
 
        _tmp45_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp44_, GTK_TYPE_CHECK_BUTTON) ? ((GtkCheckButton*) _tmp44_) : NULL);
321
 
        _g_object_unref0 (self->priv->flash_check);
322
 
        self->priv->flash_check = _tmp45_;
323
177
        cheese_preferences_dialog_setup_combo_box_models (self);
324
178
        cheese_preferences_dialog_initialize_camera_devices (self);
325
179
        cheese_preferences_dialog_initialize_values_from_settings (self);
326
 
        gtk_builder_connect_signals (builder, self);
327
 
        _tmp46_ = camera;
328
 
        g_signal_connect_object ((GObject*) _tmp46_, "notify::num-camera-devices", (GCallback) _cheese_preferences_dialog_on_camera_update_num_camera_devices_g_object_notify, self, 0);
329
 
        _g_object_unref0 (builder);
 
180
        _tmp3_ = camera;
 
181
        g_signal_connect_object ((GObject*) _tmp3_, "notify::num-camera-devices", (GCallback) _cheese_preferences_dialog_on_camera_update_num_camera_devices_g_object_notify, self, 0);
330
182
        return self;
331
183
}
332
184
 
372
224
   * Initialize and populate the camera device combo box model.
373
225
   */
374
226
static void _cheese_preferences_dialog_add_camera_device_gfunc (gconstpointer data, gpointer self) {
375
 
        cheese_preferences_dialog_add_camera_device (self, data);
 
227
        cheese_preferences_dialog_add_camera_device ((CheesePreferencesDialog*) self, data);
376
228
}
377
229
 
378
230
 
429
281
        Block1Data* _data1_;
430
282
        _data1_ = (Block1Data*) _userdata_;
431
283
        if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
432
 
                CheesePreferencesDialog * self;
 
284
                CheesePreferencesDialog* self;
433
285
                self = _data1_->self;
434
286
                _g_object_unref0 (_data1_->resolution_model);
435
287
                _g_object_unref0 (self);
438
290
}
439
291
 
440
292
 
441
 
static void __lambda3_ (Block1Data* _data1_, CheeseVideoFormat* format) {
442
 
        CheesePreferencesDialog * self;
 
293
static void __lambda4_ (Block1Data* _data1_, CheeseVideoFormat* format) {
 
294
        CheesePreferencesDialog* self;
443
295
        GtkTreeIter iter = {0};
444
296
        GtkListStore* _tmp0_ = NULL;
445
297
        GtkTreeIter _tmp1_ = {0};
464
316
        gint _tmp20_ = 0;
465
317
        CheeseVideoFormat* _tmp21_ = NULL;
466
318
        gint _tmp22_ = 0;
467
 
        gboolean _tmp28_ = FALSE;
468
 
        gboolean _tmp37_ = FALSE;
469
 
        GSettings* _tmp38_ = NULL;
470
 
        gint _tmp39_ = 0;
471
 
        CheeseVideoFormat* _tmp40_ = NULL;
472
 
        gint _tmp41_ = 0;
473
 
        gboolean _tmp46_ = FALSE;
 
319
        gboolean _tmp36_ = FALSE;
 
320
        GSettings* _tmp37_ = NULL;
 
321
        gint _tmp38_ = 0;
 
322
        CheeseVideoFormat* _tmp39_ = NULL;
 
323
        gint _tmp40_ = 0;
474
324
        self = _data1_->self;
475
325
        g_return_if_fail (format != NULL);
476
326
        _tmp0_ = _data1_->resolution_model;
516
366
        } else {
517
367
                _tmp17_ = FALSE;
518
368
        }
519
 
        _tmp28_ = _tmp17_;
520
 
        if (_tmp28_) {
521
 
                GtkComboBox* _tmp29_ = NULL;
522
 
                GtkTreeIter _tmp30_ = {0};
523
 
                GSettings* _tmp31_ = NULL;
524
 
                CheeseVideoFormat* _tmp32_ = NULL;
525
 
                gint _tmp33_ = 0;
526
 
                GSettings* _tmp34_ = NULL;
527
 
                CheeseVideoFormat* _tmp35_ = NULL;
528
 
                gint _tmp36_ = 0;
529
 
                _tmp29_ = self->priv->photo_resolution_combo;
530
 
                _tmp30_ = iter;
531
 
                gtk_combo_box_set_active_iter (_tmp29_, &_tmp30_);
532
 
                _tmp31_ = self->priv->settings;
533
 
                _tmp32_ = format;
534
 
                _tmp33_ = _tmp32_->width;
535
 
                g_settings_set_int (_tmp31_, "photo-x-resolution", _tmp33_);
536
 
                _tmp34_ = self->priv->settings;
537
 
                _tmp35_ = format;
538
 
                _tmp36_ = _tmp35_->height;
539
 
                g_settings_set_int (_tmp34_, "photo-y-resolution", _tmp36_);
 
369
        if (_tmp17_) {
 
370
                GtkComboBox* _tmp28_ = NULL;
 
371
                GtkTreeIter _tmp29_ = {0};
 
372
                GSettings* _tmp30_ = NULL;
 
373
                CheeseVideoFormat* _tmp31_ = NULL;
 
374
                gint _tmp32_ = 0;
 
375
                GSettings* _tmp33_ = NULL;
 
376
                CheeseVideoFormat* _tmp34_ = NULL;
 
377
                gint _tmp35_ = 0;
 
378
                _tmp28_ = self->priv->photo_resolution_combo;
 
379
                _tmp29_ = iter;
 
380
                gtk_combo_box_set_active_iter (_tmp28_, &_tmp29_);
 
381
                _tmp30_ = self->priv->settings;
 
382
                _tmp31_ = format;
 
383
                _tmp32_ = _tmp31_->width;
 
384
                g_settings_set_int (_tmp30_, "photo-x-resolution", _tmp32_);
 
385
                _tmp33_ = self->priv->settings;
 
386
                _tmp34_ = format;
 
387
                _tmp35_ = _tmp34_->height;
 
388
                g_settings_set_int (_tmp33_, "photo-y-resolution", _tmp35_);
540
389
        }
541
 
        _tmp38_ = self->priv->settings;
542
 
        _tmp39_ = g_settings_get_int (_tmp38_, "video-x-resolution");
543
 
        _tmp40_ = format;
544
 
        _tmp41_ = _tmp40_->width;
545
 
        if (_tmp39_ == _tmp41_) {
546
 
                GSettings* _tmp42_ = NULL;
547
 
                gint _tmp43_ = 0;
548
 
                CheeseVideoFormat* _tmp44_ = NULL;
549
 
                gint _tmp45_ = 0;
550
 
                _tmp42_ = self->priv->settings;
551
 
                _tmp43_ = g_settings_get_int (_tmp42_, "video-y-resolution");
552
 
                _tmp44_ = format;
553
 
                _tmp45_ = _tmp44_->height;
554
 
                _tmp37_ = _tmp43_ == _tmp45_;
 
390
        _tmp37_ = self->priv->settings;
 
391
        _tmp38_ = g_settings_get_int (_tmp37_, "video-x-resolution");
 
392
        _tmp39_ = format;
 
393
        _tmp40_ = _tmp39_->width;
 
394
        if (_tmp38_ == _tmp40_) {
 
395
                GSettings* _tmp41_ = NULL;
 
396
                gint _tmp42_ = 0;
 
397
                CheeseVideoFormat* _tmp43_ = NULL;
 
398
                gint _tmp44_ = 0;
 
399
                _tmp41_ = self->priv->settings;
 
400
                _tmp42_ = g_settings_get_int (_tmp41_, "video-y-resolution");
 
401
                _tmp43_ = format;
 
402
                _tmp44_ = _tmp43_->height;
 
403
                _tmp36_ = _tmp42_ == _tmp44_;
555
404
        } else {
556
 
                _tmp37_ = FALSE;
 
405
                _tmp36_ = FALSE;
557
406
        }
558
 
        _tmp46_ = _tmp37_;
559
 
        if (_tmp46_) {
560
 
                GtkComboBox* _tmp47_ = NULL;
561
 
                GtkTreeIter _tmp48_ = {0};
562
 
                _tmp47_ = self->priv->video_resolution_combo;
563
 
                _tmp48_ = iter;
564
 
                gtk_combo_box_set_active_iter (_tmp47_, &_tmp48_);
 
407
        if (_tmp36_) {
 
408
                GtkComboBox* _tmp45_ = NULL;
 
409
                GtkTreeIter _tmp46_ = {0};
 
410
                _tmp45_ = self->priv->video_resolution_combo;
 
411
                _tmp46_ = iter;
 
412
                gtk_combo_box_set_active_iter (_tmp45_, &_tmp46_);
565
413
        }
566
414
}
567
415
 
568
416
 
569
 
static void ___lambda3__gfunc (gconstpointer data, gpointer self) {
570
 
        __lambda3_ (self, data);
 
417
static void ___lambda4__gfunc (gconstpointer data, gpointer self) {
 
418
        __lambda4_ (self, (CheeseVideoFormat*) data);
571
419
}
572
420
 
573
421
 
601
449
        _tmp6_ = _data1_->resolution_model;
602
450
        gtk_combo_box_set_model (_tmp5_, (GtkTreeModel*) _tmp6_);
603
451
        _tmp7_ = formats;
604
 
        g_list_foreach (_tmp7_, ___lambda3__gfunc, _data1_);
 
452
        g_list_foreach (_tmp7_, ___lambda4__gfunc, _data1_);
605
453
        _tmp8_ = self->priv->video_resolution_combo;
606
454
        _tmp9_ = gtk_combo_box_get_active (_tmp8_);
607
455
        if (_tmp9_ == (-1)) {
627
475
                _tmp18_ = g_settings_get_int (_tmp17_, "photo-y-resolution");
628
476
                g_settings_set_int (_tmp16_, "video-y-resolution", _tmp18_);
629
477
        }
 
478
        _g_list_free0 (formats);
630
479
        block1_data_unref (_data1_);
631
480
        _data1_ = NULL;
632
481
}
633
482
 
634
483
 
635
484
/**
636
 
   * Take the user preferences from GSettings.
637
 
   */
 
485
     * Take the user preferences from GSettings.
 
486
     */
638
487
static void cheese_preferences_dialog_initialize_values_from_settings (CheesePreferencesDialog* self) {
639
488
        GtkAdjustment* _tmp0_ = NULL;
640
489
        GSettings* _tmp1_ = NULL;
648
497
        GtkAdjustment* _tmp9_ = NULL;
649
498
        GSettings* _tmp10_ = NULL;
650
499
        gdouble _tmp11_ = 0.0;
651
 
        GtkSpinButton* _tmp12_ = NULL;
652
 
        GSettings* _tmp13_ = NULL;
653
 
        gint _tmp14_ = 0;
654
 
        GtkSpinButton* _tmp15_ = NULL;
655
 
        GSettings* _tmp16_ = NULL;
656
 
        gint _tmp17_ = 0;
 
500
        GSettings* _tmp12_ = NULL;
 
501
        GtkSpinButton* _tmp13_ = NULL;
 
502
        GtkSpinButton* _tmp14_ = NULL;
 
503
        GSettings* _tmp15_ = NULL;
 
504
        gint _tmp16_ = 0;
 
505
        GSettings* _tmp17_ = NULL;
657
506
        GtkCheckButton* _tmp18_ = NULL;
658
507
        GSettings* _tmp19_ = NULL;
659
 
        gboolean _tmp20_ = FALSE;
660
 
        GtkCheckButton* _tmp21_ = NULL;
661
 
        GSettings* _tmp22_ = NULL;
662
 
        gboolean _tmp23_ = FALSE;
 
508
        GtkCheckButton* _tmp20_ = NULL;
663
509
        g_return_if_fail (self != NULL);
664
510
        _tmp0_ = self->priv->brightness_adjustment;
665
511
        _tmp1_ = self->priv->settings;
677
523
        _tmp10_ = self->priv->settings;
678
524
        _tmp11_ = g_settings_get_double (_tmp10_, "saturation");
679
525
        gtk_adjustment_set_value (_tmp9_, _tmp11_);
680
 
        _tmp12_ = self->priv->burst_repeat_spin;
681
 
        _tmp13_ = self->priv->settings;
682
 
        _tmp14_ = g_settings_get_int (_tmp13_, "burst-repeat");
683
 
        gtk_spin_button_set_value (_tmp12_, (gdouble) _tmp14_);
684
 
        _tmp15_ = self->priv->burst_delay_spin;
685
 
        _tmp16_ = self->priv->settings;
686
 
        _tmp17_ = g_settings_get_int (_tmp16_, "burst-delay");
687
 
        gtk_spin_button_set_value (_tmp15_, (gdouble) (_tmp17_ / 1000));
 
526
        _tmp12_ = self->priv->settings;
 
527
        _tmp13_ = self->priv->burst_repeat_spin;
 
528
        g_settings_bind (_tmp12_, "burst-repeat", (GObject*) _tmp13_, "value", G_SETTINGS_BIND_DEFAULT);
 
529
        _tmp14_ = self->priv->burst_delay_spin;
 
530
        _tmp15_ = self->priv->settings;
 
531
        _tmp16_ = g_settings_get_int (_tmp15_, "burst-delay");
 
532
        gtk_spin_button_set_value (_tmp14_, (gdouble) (_tmp16_ / 1000));
 
533
        _tmp17_ = self->priv->settings;
688
534
        _tmp18_ = self->priv->countdown_check;
 
535
        g_settings_bind (_tmp17_, "countdown", (GObject*) _tmp18_, "active", G_SETTINGS_BIND_DEFAULT);
689
536
        _tmp19_ = self->priv->settings;
690
 
        _tmp20_ = g_settings_get_boolean (_tmp19_, "countdown");
691
 
        gtk_toggle_button_set_active ((GtkToggleButton*) _tmp18_, _tmp20_);
692
 
        _tmp21_ = self->priv->flash_check;
693
 
        _tmp22_ = self->priv->settings;
694
 
        _tmp23_ = g_settings_get_boolean (_tmp22_, "flash");
695
 
        gtk_toggle_button_set_active ((GtkToggleButton*) _tmp21_, _tmp23_);
 
537
        _tmp20_ = self->priv->flash_check;
 
538
        g_settings_bind (_tmp19_, "flash", (GObject*) _tmp20_, "active", G_SETTINGS_BIND_DEFAULT);
696
539
}
697
540
 
698
541
 
701
544
   *
702
545
   * @param combo the video device combo box
703
546
   */
704
 
void cheese_preferences_dialog_on_source_change (GtkComboBox* combo, CheesePreferencesDialog* self) {
 
547
static void cheese_preferences_dialog_on_source_change (CheesePreferencesDialog* self, GtkComboBox* combo) {
705
548
        CheeseCamera* _tmp0_ = NULL;
706
549
        guint _tmp1_ = 0U;
707
550
        guint _tmp2_ = 0U;
749
592
}
750
593
 
751
594
 
 
595
static void _cheese_preferences_dialog_on_source_change_gtk_combo_box_changed (GtkComboBox* _sender, gpointer self) {
 
596
        cheese_preferences_dialog_on_source_change ((CheesePreferencesDialog*) self, _sender);
 
597
}
 
598
 
 
599
 
752
600
/**
753
601
   * Update the current photo capture resolution to the active iter of the
754
602
   * photo resolution combo box.
755
603
   *
756
604
   * @param combo the photo resolution combo box
757
605
   */
758
 
void cheese_preferences_dialog_on_photo_resolution_change (GtkComboBox* combo, CheesePreferencesDialog* self) {
 
606
static void _vala_CheeseVideoFormat_free (CheeseVideoFormat* self) {
 
607
        g_boxed_free (CHEESE_TYPE_VIDEO_FORMAT, self);
 
608
}
 
609
 
 
610
 
 
611
static void cheese_preferences_dialog_on_photo_resolution_change (CheesePreferencesDialog* self, GtkComboBox* combo) {
759
612
        GtkTreeIter iter = {0};
760
613
        CheeseVideoFormat* format = NULL;
761
614
        GtkComboBox* _tmp0_ = NULL;
766
619
        GtkTreeIter _tmp5_ = {0};
767
620
        gboolean _tmp6_ = FALSE;
768
621
        CheeseMediaMode _tmp7_ = 0;
769
 
        gboolean _tmp9_ = FALSE;
770
 
        GSettings* _tmp12_ = NULL;
771
 
        CheeseVideoFormat* _tmp13_ = NULL;
772
 
        gint _tmp14_ = 0;
773
 
        GSettings* _tmp15_ = NULL;
774
 
        CheeseVideoFormat* _tmp16_ = NULL;
775
 
        gint _tmp17_ = 0;
 
622
        GSettings* _tmp11_ = NULL;
 
623
        CheeseVideoFormat* _tmp12_ = NULL;
 
624
        gint _tmp13_ = 0;
 
625
        GSettings* _tmp14_ = NULL;
 
626
        CheeseVideoFormat* _tmp15_ = NULL;
 
627
        gint _tmp16_ = 0;
776
628
        g_return_if_fail (self != NULL);
777
629
        g_return_if_fail (combo != NULL);
778
630
        _tmp0_ = combo;
791
643
                _tmp8_ = self->priv->current_mode;
792
644
                _tmp6_ = _tmp8_ == CHEESE_MEDIA_MODE_BURST;
793
645
        }
794
 
        _tmp9_ = _tmp6_;
795
 
        if (_tmp9_) {
796
 
                CheeseCamera* _tmp10_ = NULL;
797
 
                CheeseVideoFormat* _tmp11_ = NULL;
798
 
                _tmp10_ = self->priv->camera;
799
 
                _tmp11_ = format;
800
 
                cheese_camera_set_video_format (_tmp10_, _tmp11_);
 
646
        if (_tmp6_) {
 
647
                CheeseCamera* _tmp9_ = NULL;
 
648
                CheeseVideoFormat* _tmp10_ = NULL;
 
649
                _tmp9_ = self->priv->camera;
 
650
                _tmp10_ = format;
 
651
                cheese_camera_set_video_format (_tmp9_, _tmp10_);
801
652
        }
802
 
        _tmp12_ = self->priv->settings;
803
 
        _tmp13_ = format;
804
 
        _tmp14_ = _tmp13_->width;
805
 
        g_settings_set_int (_tmp12_, "photo-x-resolution", _tmp14_);
806
 
        _tmp15_ = self->priv->settings;
807
 
        _tmp16_ = format;
808
 
        _tmp17_ = _tmp16_->height;
809
 
        g_settings_set_int (_tmp15_, "photo-y-resolution", _tmp17_);
 
653
        _tmp11_ = self->priv->settings;
 
654
        _tmp12_ = format;
 
655
        _tmp13_ = _tmp12_->width;
 
656
        g_settings_set_int (_tmp11_, "photo-x-resolution", _tmp13_);
 
657
        _tmp14_ = self->priv->settings;
 
658
        _tmp15_ = format;
 
659
        _tmp16_ = _tmp15_->height;
 
660
        g_settings_set_int (_tmp14_, "photo-y-resolution", _tmp16_);
 
661
        __vala_CheeseVideoFormat_free0 (format);
 
662
}
 
663
 
 
664
 
 
665
static void _cheese_preferences_dialog_on_photo_resolution_change_gtk_combo_box_changed (GtkComboBox* _sender, gpointer self) {
 
666
        cheese_preferences_dialog_on_photo_resolution_change ((CheesePreferencesDialog*) self, _sender);
810
667
}
811
668
 
812
669
 
816
673
   *
817
674
   * @param combo the video resolution combo box
818
675
   */
819
 
void cheese_preferences_dialog_on_video_resolution_change (GtkComboBox* combo, CheesePreferencesDialog* self) {
 
676
static void cheese_preferences_dialog_on_video_resolution_change (CheesePreferencesDialog* self, GtkComboBox* combo) {
820
677
        GtkTreeIter iter = {0};
821
678
        CheeseVideoFormat* format = NULL;
822
679
        GtkComboBox* _tmp0_ = NULL;
858
715
        _tmp13_ = format;
859
716
        _tmp14_ = _tmp13_->height;
860
717
        g_settings_set_int (_tmp12_, "video-y-resolution", _tmp14_);
861
 
}
862
 
 
863
 
 
864
 
/**
865
 
   * Hide the dialog when it is closed, rather than deleting it.
866
 
   *
867
 
   * @param dialog the dialog on which the delete event was generated
868
 
   */
869
 
void cheese_preferences_dialog_on_delete (GtkDialog* dialog, CheesePreferencesDialog* self) {
870
 
        GtkDialog* _tmp0_ = NULL;
871
 
        g_return_if_fail (self != NULL);
872
 
        g_return_if_fail (dialog != NULL);
873
 
        _tmp0_ = dialog;
874
 
        gtk_widget_hide_on_delete ((GtkWidget*) _tmp0_);
875
 
}
876
 
 
877
 
 
878
 
/**
879
 
   * Hide the dialog when it is closed, rather than deleting it.
880
 
   *
881
 
   * @param button the close button
882
 
   */
883
 
void cheese_preferences_dialog_on_dialog_close (GtkButton* button, CheesePreferencesDialog* self) {
884
 
        GtkDialog* _tmp0_ = NULL;
 
718
        __vala_CheeseVideoFormat_free0 (format);
 
719
}
 
720
 
 
721
 
 
722
static void _cheese_preferences_dialog_on_video_resolution_change_gtk_combo_box_changed (GtkComboBox* _sender, gpointer self) {
 
723
        cheese_preferences_dialog_on_video_resolution_change ((CheesePreferencesDialog*) self, _sender);
 
724
}
 
725
 
 
726
 
 
727
/**
 
728
    * Hide the dialog when it is closed, rather than deleting it.
 
729
    */
 
730
static gboolean cheese_preferences_dialog_on_delete (CheesePreferencesDialog* self) {
 
731
        gboolean result = FALSE;
 
732
        gboolean _tmp0_ = FALSE;
 
733
        g_return_val_if_fail (self != NULL, FALSE);
 
734
        _tmp0_ = gtk_widget_hide_on_delete ((GtkWidget*) self);
 
735
        result = _tmp0_;
 
736
        return result;
 
737
}
 
738
 
 
739
 
 
740
static gboolean _cheese_preferences_dialog_on_delete_gtk_widget_delete_event (GtkWidget* _sender, GdkEventAny* event, gpointer self) {
 
741
        gboolean result;
 
742
        result = cheese_preferences_dialog_on_delete ((CheesePreferencesDialog*) self);
 
743
        return result;
 
744
}
 
745
 
 
746
 
 
747
/**
 
748
    * Hide the dialog when it is closed, rather than deleting it.
 
749
    */
 
750
static void cheese_preferences_dialog_on_dialog_close (CheesePreferencesDialog* self, GtkButton* button) {
885
751
        g_return_if_fail (self != NULL);
886
752
        g_return_if_fail (button != NULL);
887
 
        _tmp0_ = self->priv->dialog;
888
 
        gtk_widget_hide ((GtkWidget*) _tmp0_);
 
753
        gtk_widget_hide ((GtkWidget*) self);
 
754
}
 
755
 
 
756
 
 
757
static void _cheese_preferences_dialog_on_dialog_close_gtk_button_clicked (GtkButton* _sender, gpointer self) {
 
758
        cheese_preferences_dialog_on_dialog_close ((CheesePreferencesDialog*) self, _sender);
889
759
}
890
760
 
891
761
 
892
762
/**
893
 
   * Show the help for the preferences dialog.
894
 
   *
895
 
   * @param button the help button
896
 
   */
897
 
void cheese_preferences_dialog_on_dialog_help (GtkButton* button, CheesePreferencesDialog* self) {
 
763
    * Show the help for the preferences dialog.
 
764
    *
 
765
    * @param button the help button
 
766
    */
 
767
static void cheese_preferences_dialog_on_dialog_help (CheesePreferencesDialog* self, GtkButton* button) {
898
768
        GError * _inner_error_ = NULL;
899
769
        g_return_if_fail (self != NULL);
900
770
        g_return_if_fail (button != NULL);
901
771
        {
902
 
                GtkDialog* _tmp0_ = NULL;
903
 
                GdkScreen* _tmp1_ = NULL;
904
 
                _tmp0_ = self->priv->dialog;
905
 
                _tmp1_ = gtk_window_get_screen ((GtkWindow*) _tmp0_);
906
 
                gtk_show_uri (_tmp1_, "help:cheese/index#preferences", (guint32) GDK_CURRENT_TIME, &_inner_error_);
 
772
                GdkScreen* _tmp0_ = NULL;
 
773
                _tmp0_ = gtk_window_get_screen ((GtkWindow*) self);
 
774
                gtk_show_uri (_tmp0_, "help:cheese/index#preferences", (guint32) GDK_CURRENT_TIME, &_inner_error_);
907
775
                if (_inner_error_ != NULL) {
908
 
                        goto __catch6_g_error;
 
776
                        goto __catch3_g_error;
909
777
                }
910
778
        }
911
 
        goto __finally6;
912
 
        __catch6_g_error:
 
779
        goto __finally3;
 
780
        __catch3_g_error:
913
781
        {
914
782
                g_clear_error (&_inner_error_);
915
783
                _inner_error_ = NULL;
916
 
                g_warning ("cheese-preferences.vala:317: %s", "Error showing help");
 
784
                g_warning ("cheese-preferences.vala:281: %s", "Error showing help");
917
785
        }
918
 
        __finally6:
 
786
        __finally3:
919
787
        if (_inner_error_ != NULL) {
920
788
                g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
921
789
                g_clear_error (&_inner_error_);
924
792
}
925
793
 
926
794
 
927
 
/**
928
 
   * Toggle the countdown GSetting when toggling the check button.
929
 
   *
930
 
   * @param checkbutton the countdown check button
931
 
   */
932
 
void cheese_preferences_dialog_on_countdown_toggle (GtkCheckButton* checkbutton, CheesePreferencesDialog* self) {
933
 
        GSettings* _tmp0_ = NULL;
934
 
        GtkCheckButton* _tmp1_ = NULL;
935
 
        gboolean _tmp2_ = FALSE;
936
 
        gboolean _tmp3_ = FALSE;
937
 
        g_return_if_fail (self != NULL);
938
 
        g_return_if_fail (checkbutton != NULL);
939
 
        _tmp0_ = self->priv->settings;
940
 
        _tmp1_ = checkbutton;
941
 
        _tmp2_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp1_);
942
 
        _tmp3_ = _tmp2_;
943
 
        g_settings_set_boolean (_tmp0_, "countdown", _tmp3_);
944
 
}
945
 
 
946
 
 
947
 
/**
948
 
   * Toggle the flash GSetting when toggling the check button.
949
 
   *
950
 
   * @param checkbutton the flash check button
951
 
   */
952
 
void cheese_preferences_dialog_on_flash_toggle (GtkCheckButton* checkbutton, CheesePreferencesDialog* self) {
953
 
        GSettings* _tmp0_ = NULL;
954
 
        GtkCheckButton* _tmp1_ = NULL;
955
 
        gboolean _tmp2_ = FALSE;
956
 
        gboolean _tmp3_ = FALSE;
957
 
        g_return_if_fail (self != NULL);
958
 
        g_return_if_fail (checkbutton != NULL);
959
 
        _tmp0_ = self->priv->settings;
960
 
        _tmp1_ = checkbutton;
961
 
        _tmp2_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp1_);
962
 
        _tmp3_ = _tmp2_;
963
 
        g_settings_set_boolean (_tmp0_, "flash", _tmp3_);
964
 
}
965
 
 
966
 
 
967
 
/**
968
 
   * Change the burst-repeat GSetting when changing the spin button.
969
 
   *
970
 
   * The burst repeat is the total number of photos to take in a single burst.
971
 
   *
972
 
   * @param spinbutton the burst-repeat spin button
973
 
   */
974
 
void cheese_preferences_dialog_on_burst_repeat_change (GtkSpinButton* spinbutton, CheesePreferencesDialog* self) {
975
 
        GSettings* _tmp0_ = NULL;
976
 
        GtkSpinButton* _tmp1_ = NULL;
977
 
        gdouble _tmp2_ = 0.0;
978
 
        gdouble _tmp3_ = 0.0;
979
 
        g_return_if_fail (self != NULL);
980
 
        g_return_if_fail (spinbutton != NULL);
981
 
        _tmp0_ = self->priv->settings;
982
 
        _tmp1_ = spinbutton;
983
 
        _tmp2_ = gtk_spin_button_get_value (_tmp1_);
984
 
        _tmp3_ = _tmp2_;
985
 
        g_settings_set_int (_tmp0_, "burst-repeat", (gint) _tmp3_);
 
795
static void _cheese_preferences_dialog_on_dialog_help_gtk_button_clicked (GtkButton* _sender, gpointer self) {
 
796
        cheese_preferences_dialog_on_dialog_help ((CheesePreferencesDialog*) self, _sender);
986
797
}
987
798
 
988
799
 
994
805
   *
995
806
   * @param spinbutton the burst-delay spin button
996
807
   */
997
 
void cheese_preferences_dialog_on_burst_delay_change (GtkSpinButton* spinbutton, CheesePreferencesDialog* self) {
 
808
static void cheese_preferences_dialog_on_burst_delay_change (CheesePreferencesDialog* self, GtkSpinButton* spinbutton) {
998
809
        GSettings* _tmp0_ = NULL;
999
810
        GtkSpinButton* _tmp1_ = NULL;
1000
811
        gdouble _tmp2_ = 0.0;
1009
820
}
1010
821
 
1011
822
 
 
823
static void _cheese_preferences_dialog_on_burst_delay_change_gtk_spin_button_value_changed (GtkSpinButton* _sender, gpointer self) {
 
824
        cheese_preferences_dialog_on_burst_delay_change ((CheesePreferencesDialog*) self, _sender);
 
825
}
 
826
 
 
827
 
1012
828
/**
1013
829
   * Change the brightness of the image, and update the GSetting, when changing
1014
830
   * the scale.
1015
831
   *
1016
832
   * @param adjustment the adjustment of the brightness Gtk.Scale
1017
833
   */
1018
 
void cheese_preferences_dialog_on_brightness_change (GtkAdjustment* adjustment, CheesePreferencesDialog* self) {
 
834
static void cheese_preferences_dialog_on_brightness_change (CheesePreferencesDialog* self, GtkAdjustment* adjustment) {
1019
835
        CheeseCamera* _tmp0_ = NULL;
1020
836
        GtkAdjustment* _tmp1_ = NULL;
1021
837
        gdouble _tmp2_ = 0.0;
1039
855
}
1040
856
 
1041
857
 
 
858
static void _cheese_preferences_dialog_on_brightness_change_gtk_adjustment_value_changed (GtkAdjustment* _sender, gpointer self) {
 
859
        cheese_preferences_dialog_on_brightness_change ((CheesePreferencesDialog*) self, _sender);
 
860
}
 
861
 
 
862
 
1042
863
/**
1043
864
   * Change the contrast of the image, and update the GSetting, when changing
1044
865
   * the scale.
1045
866
   *
1046
867
   * @param adjustment the adjustment of the contrast Gtk.Scale
1047
868
   */
1048
 
void cheese_preferences_dialog_on_contrast_change (GtkAdjustment* adjustment, CheesePreferencesDialog* self) {
 
869
static void cheese_preferences_dialog_on_contrast_change (CheesePreferencesDialog* self, GtkAdjustment* adjustment) {
1049
870
        CheeseCamera* _tmp0_ = NULL;
1050
871
        GtkAdjustment* _tmp1_ = NULL;
1051
872
        gdouble _tmp2_ = 0.0;
1069
890
}
1070
891
 
1071
892
 
 
893
static void _cheese_preferences_dialog_on_contrast_change_gtk_adjustment_value_changed (GtkAdjustment* _sender, gpointer self) {
 
894
        cheese_preferences_dialog_on_contrast_change ((CheesePreferencesDialog*) self, _sender);
 
895
}
 
896
 
 
897
 
1072
898
/**
1073
899
   * Change the hue of the image, and update the GSetting, when changing the
1074
900
   * scale.
1075
901
   *
1076
902
   * @param adjustment the adjustment of the hue Gtk.Scale
1077
903
   */
1078
 
void cheese_preferences_dialog_on_hue_change (GtkAdjustment* adjustment, CheesePreferencesDialog* self) {
 
904
static void cheese_preferences_dialog_on_hue_change (CheesePreferencesDialog* self, GtkAdjustment* adjustment) {
1079
905
        CheeseCamera* _tmp0_ = NULL;
1080
906
        GtkAdjustment* _tmp1_ = NULL;
1081
907
        gdouble _tmp2_ = 0.0;
1099
925
}
1100
926
 
1101
927
 
 
928
static void _cheese_preferences_dialog_on_hue_change_gtk_adjustment_value_changed (GtkAdjustment* _sender, gpointer self) {
 
929
        cheese_preferences_dialog_on_hue_change ((CheesePreferencesDialog*) self, _sender);
 
930
}
 
931
 
 
932
 
1102
933
/**
1103
934
   * Change the saturation of the image, and update the GSetting, when changing
1104
935
   * the scale.
1105
936
   *
1106
937
   * @param adjustment the adjustment of the saturation Gtk.Scale
1107
938
   */
1108
 
void cheese_preferences_dialog_on_saturation_change (GtkAdjustment* adjustment, CheesePreferencesDialog* self) {
 
939
static void cheese_preferences_dialog_on_saturation_change (CheesePreferencesDialog* self, GtkAdjustment* adjustment) {
1109
940
        CheeseCamera* _tmp0_ = NULL;
1110
941
        GtkAdjustment* _tmp1_ = NULL;
1111
942
        gdouble _tmp2_ = 0.0;
1129
960
}
1130
961
 
1131
962
 
 
963
static void _cheese_preferences_dialog_on_saturation_change_gtk_adjustment_value_changed (GtkAdjustment* _sender, gpointer self) {
 
964
        cheese_preferences_dialog_on_saturation_change ((CheesePreferencesDialog*) self, _sender);
 
965
}
 
966
 
 
967
 
1132
968
/**
1133
969
   * Update the video device combo box when a camera device was added or
1134
970
   * removed.
1143
979
        Block2Data* _data2_;
1144
980
        _data2_ = (Block2Data*) _userdata_;
1145
981
        if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
1146
 
                CheesePreferencesDialog * self;
 
982
                CheesePreferencesDialog* self;
1147
983
                self = _data2_->self;
1148
984
                _g_object_unref0 (_data2_->active_device);
1149
985
                _g_object_unref0 (self);
1152
988
}
1153
989
 
1154
990
 
1155
 
static void ___lambda4_ (Block2Data* _data2_, void* device) {
1156
 
        CheesePreferencesDialog * self;
 
991
static void ___lambda5_ (Block2Data* _data2_, void* device) {
 
992
        CheesePreferencesDialog* self;
1157
993
        CheeseCameraDevice* old_device = NULL;
1158
994
        void* _tmp0_ = NULL;
1159
995
        CheeseCameraDevice* _tmp1_ = NULL;
1204
1040
}
1205
1041
 
1206
1042
 
1207
 
static void ____lambda4__gfunc (gconstpointer data, gpointer self) {
1208
 
        ___lambda4_ (self, data);
 
1043
static void ____lambda5__gfunc (gconstpointer data, gpointer self) {
 
1044
        ___lambda5_ (self, data);
1209
1045
}
1210
1046
 
1211
1047
 
1273
1109
                gtk_tree_model_get ((GtkTreeModel*) _tmp16_, &_tmp17_, 1, &_data2_->active_device, -1, -1);
1274
1110
                _data2_->device_removed = FALSE;
1275
1111
                _tmp18_ = devices;
1276
 
                g_ptr_array_foreach (_tmp18_, ____lambda4__gfunc, _data2_);
 
1112
                g_ptr_array_foreach (_tmp18_, ____lambda5__gfunc, _data2_);
1277
1113
                _tmp19_ = _data2_->device_removed;
1278
1114
                if (!_tmp19_) {
1279
1115
                        CheeseCameraDevice* old_device = NULL;
1407
1243
        const gchar* _tmp7_ = NULL;
1408
1244
        const gchar* _tmp8_ = NULL;
1409
1245
        gint _tmp9_ = 0;
1410
 
        GtkListStore* _tmp14_ = NULL;
1411
 
        GtkTreeIter _tmp15_ = {0};
1412
 
        GtkListStore* _tmp16_ = NULL;
1413
 
        gint _tmp17_ = 0;
 
1246
        GtkListStore* _tmp13_ = NULL;
 
1247
        GtkTreeIter _tmp14_ = {0};
 
1248
        GtkListStore* _tmp15_ = NULL;
 
1249
        gint _tmp16_ = 0;
1414
1250
        g_return_if_fail (self != NULL);
1415
1251
        g_return_if_fail (iter != NULL);
1416
1252
        g_return_if_fail (device_node != NULL);
1436
1272
                        _tmp12_ = *iter;
1437
1273
                        cheese_preferences_dialog_set_new_available_camera_device (self, &_tmp12_);
1438
1274
                } else {
1439
 
                        GtkDialog* _tmp13_ = NULL;
1440
 
                        _tmp13_ = self->priv->dialog;
1441
 
                        gtk_widget_hide ((GtkWidget*) _tmp13_);
 
1275
                        gtk_widget_hide ((GtkWidget*) self);
1442
1276
                }
1443
1277
        }
1444
 
        _tmp14_ = self->priv->camera_model;
1445
 
        _tmp15_ = *iter;
1446
 
        gtk_list_store_remove (_tmp14_, &_tmp15_);
1447
 
        _tmp16_ = self->priv->camera_model;
1448
 
        _tmp17_ = gtk_tree_model_iter_n_children ((GtkTreeModel*) _tmp16_, NULL);
1449
 
        if (_tmp17_ <= 1) {
1450
 
                GtkComboBox* _tmp18_ = NULL;
1451
 
                _tmp18_ = self->priv->source_combo;
1452
 
                gtk_widget_set_sensitive ((GtkWidget*) _tmp18_, FALSE);
 
1278
        _tmp13_ = self->priv->camera_model;
 
1279
        _tmp14_ = *iter;
 
1280
        gtk_list_store_remove (_tmp13_, &_tmp14_);
 
1281
        _tmp15_ = self->priv->camera_model;
 
1282
        _tmp16_ = gtk_tree_model_iter_n_children ((GtkTreeModel*) _tmp15_, NULL);
 
1283
        if (_tmp16_ <= 1) {
 
1284
                GtkComboBox* _tmp17_ = NULL;
 
1285
                _tmp17_ = self->priv->source_combo;
 
1286
                gtk_widget_set_sensitive ((GtkWidget*) _tmp17_, FALSE);
1453
1287
        }
1454
1288
}
1455
1289
 
1488
1322
 
1489
1323
 
1490
1324
/**
1491
 
   * Show the dialog.
1492
 
   */
1493
 
void cheese_preferences_dialog_show (CheesePreferencesDialog* self) {
1494
 
        GtkDialog* _tmp0_ = NULL;
1495
 
        g_return_if_fail (self != NULL);
1496
 
        _tmp0_ = self->priv->dialog;
1497
 
        gtk_widget_show_all ((GtkWidget*) _tmp0_);
1498
 
}
1499
 
 
1500
 
 
1501
 
/**
1502
 
     * Hide the dialog.
1503
 
     */
1504
 
void cheese_preferences_dialog_hide (CheesePreferencesDialog* self) {
1505
 
        GtkDialog* _tmp0_ = NULL;
1506
 
        g_return_if_fail (self != NULL);
1507
 
        _tmp0_ = self->priv->dialog;
1508
 
        gtk_widget_hide ((GtkWidget*) _tmp0_);
1509
 
}
1510
 
 
1511
 
 
1512
 
/**
1513
1325
     * Set the current media mode (photo, video or burst).
1514
1326
     *
1515
1327
     * The current mode is used to update the video format on the Cheese.Camera
1526
1338
 
1527
1339
 
1528
1340
static void cheese_preferences_dialog_class_init (CheesePreferencesDialogClass * klass) {
 
1341
        gint CheesePreferencesDialog_private_offset;
1529
1342
        cheese_preferences_dialog_parent_class = g_type_class_peek_parent (klass);
1530
1343
        g_type_class_add_private (klass, sizeof (CheesePreferencesDialogPrivate));
1531
1344
        G_OBJECT_CLASS (klass)->finalize = cheese_preferences_dialog_finalize;
 
1345
        CheesePreferencesDialog_private_offset = g_type_class_get_instance_private_offset (klass);
 
1346
        gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/Cheese/cheese-prefs.ui");
 
1347
        gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "photo_resolution_combo", FALSE, CheesePreferencesDialog_private_offset + G_STRUCT_OFFSET (CheesePreferencesDialogPrivate, photo_resolution_combo));
 
1348
        gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "video_resolution_combo", FALSE, CheesePreferencesDialog_private_offset + G_STRUCT_OFFSET (CheesePreferencesDialogPrivate, video_resolution_combo));
 
1349
        gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "source_combo", FALSE, CheesePreferencesDialog_private_offset + G_STRUCT_OFFSET (CheesePreferencesDialogPrivate, source_combo));
 
1350
        gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "brightness_adjustment", FALSE, CheesePreferencesDialog_private_offset + G_STRUCT_OFFSET (CheesePreferencesDialogPrivate, brightness_adjustment));
 
1351
        gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "contrast_adjustment", FALSE, CheesePreferencesDialog_private_offset + G_STRUCT_OFFSET (CheesePreferencesDialogPrivate, contrast_adjustment));
 
1352
        gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "hue_adjustment", FALSE, CheesePreferencesDialog_private_offset + G_STRUCT_OFFSET (CheesePreferencesDialogPrivate, hue_adjustment));
 
1353
        gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "saturation_adjustment", FALSE, CheesePreferencesDialog_private_offset + G_STRUCT_OFFSET (CheesePreferencesDialogPrivate, saturation_adjustment));
 
1354
        gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "burst_repeat_spin", FALSE, CheesePreferencesDialog_private_offset + G_STRUCT_OFFSET (CheesePreferencesDialogPrivate, burst_repeat_spin));
 
1355
        gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "burst_delay_spin", FALSE, CheesePreferencesDialog_private_offset + G_STRUCT_OFFSET (CheesePreferencesDialogPrivate, burst_delay_spin));
 
1356
        gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "countdown_check", FALSE, CheesePreferencesDialog_private_offset + G_STRUCT_OFFSET (CheesePreferencesDialogPrivate, countdown_check));
 
1357
        gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "flash_check", FALSE, CheesePreferencesDialog_private_offset + G_STRUCT_OFFSET (CheesePreferencesDialogPrivate, flash_check));
 
1358
        gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_source_change", G_CALLBACK(_cheese_preferences_dialog_on_source_change_gtk_combo_box_changed));
 
1359
        gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_photo_resolution_change", G_CALLBACK(_cheese_preferences_dialog_on_photo_resolution_change_gtk_combo_box_changed));
 
1360
        gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_video_resolution_change", G_CALLBACK(_cheese_preferences_dialog_on_video_resolution_change_gtk_combo_box_changed));
 
1361
        gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_delete", G_CALLBACK(_cheese_preferences_dialog_on_delete_gtk_widget_delete_event));
 
1362
        gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_dialog_close", G_CALLBACK(_cheese_preferences_dialog_on_dialog_close_gtk_button_clicked));
 
1363
        gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_dialog_help", G_CALLBACK(_cheese_preferences_dialog_on_dialog_help_gtk_button_clicked));
 
1364
        gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_burst_delay_change", G_CALLBACK(_cheese_preferences_dialog_on_burst_delay_change_gtk_spin_button_value_changed));
 
1365
        gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_brightness_change", G_CALLBACK(_cheese_preferences_dialog_on_brightness_change_gtk_adjustment_value_changed));
 
1366
        gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_contrast_change", G_CALLBACK(_cheese_preferences_dialog_on_contrast_change_gtk_adjustment_value_changed));
 
1367
        gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_hue_change", G_CALLBACK(_cheese_preferences_dialog_on_hue_change_gtk_adjustment_value_changed));
 
1368
        gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_saturation_change", G_CALLBACK(_cheese_preferences_dialog_on_saturation_change_gtk_adjustment_value_changed));
1532
1369
}
1533
1370
 
1534
1371
 
1535
1372
static void cheese_preferences_dialog_instance_init (CheesePreferencesDialog * self) {
1536
1373
        self->priv = CHEESE_PREFERENCES_DIALOG_GET_PRIVATE (self);
 
1374
        gtk_widget_init_template (GTK_WIDGET (self));
1537
1375
}
1538
1376
 
1539
1377
 
1542
1380
        self = G_TYPE_CHECK_INSTANCE_CAST (obj, CHEESE_TYPE_PREFERENCES_DIALOG, CheesePreferencesDialog);
1543
1381
        _g_object_unref0 (self->priv->camera);
1544
1382
        _g_object_unref0 (self->priv->settings);
1545
 
        _g_object_unref0 (self->priv->dialog);
1546
1383
        _g_object_unref0 (self->priv->photo_resolution_combo);
1547
1384
        _g_object_unref0 (self->priv->video_resolution_combo);
1548
1385
        _g_object_unref0 (self->priv->source_combo);
1551
1388
        _g_object_unref0 (self->priv->contrast_adjustment);
1552
1389
        _g_object_unref0 (self->priv->hue_adjustment);
1553
1390
        _g_object_unref0 (self->priv->saturation_adjustment);
1554
 
        _g_object_unref0 (self->priv->brightness_scale);
1555
 
        _g_object_unref0 (self->priv->contrast_scale);
1556
 
        _g_object_unref0 (self->priv->hue_scale);
1557
 
        _g_object_unref0 (self->priv->saturation_scale);
1558
1391
        _g_object_unref0 (self->priv->burst_repeat_spin);
1559
1392
        _g_object_unref0 (self->priv->burst_delay_spin);
1560
1393
        _g_object_unref0 (self->priv->countdown_check);
1568
1401
        if (g_once_init_enter (&cheese_preferences_dialog_type_id__volatile)) {
1569
1402
                static const GTypeInfo g_define_type_info = { sizeof (CheesePreferencesDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) cheese_preferences_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (CheesePreferencesDialog), 0, (GInstanceInitFunc) cheese_preferences_dialog_instance_init, NULL };
1570
1403
                GType cheese_preferences_dialog_type_id;
1571
 
                cheese_preferences_dialog_type_id = g_type_register_static (G_TYPE_OBJECT, "CheesePreferencesDialog", &g_define_type_info, 0);
 
1404
                cheese_preferences_dialog_type_id = g_type_register_static (GTK_TYPE_DIALOG, "CheesePreferencesDialog", &g_define_type_info, 0);
1572
1405
                g_once_init_leave (&cheese_preferences_dialog_type_id__volatile, cheese_preferences_dialog_type_id);
1573
1406
        }
1574
1407
        return cheese_preferences_dialog_type_id__volatile;