summaryrefslogtreecommitdiff
path: root/src/dialogs
diff options
context:
space:
mode:
Diffstat (limited to 'src/dialogs')
-rw-r--r--src/dialogs/AdjustDateTimeDialog.c2300
-rw-r--r--src/dialogs/AdjustDateTimeDialog.vala343
-rw-r--r--src/dialogs/EntryMultiCompletion.c1073
-rw-r--r--src/dialogs/EntryMultiCompletion.vala97
-rw-r--r--src/dialogs/ExportDialog.c2084
-rw-r--r--src/dialogs/ExportDialog.vala343
-rw-r--r--src/dialogs/MultiTextEntryDialog.c293
-rw-r--r--src/dialogs/MultiTextEntryDialog.vala43
-rw-r--r--src/dialogs/Preferences.c3328
-rw-r--r--src/dialogs/Preferences.vala468
-rw-r--r--src/dialogs/ProgressDialog.c714
-rw-r--r--src/dialogs/ProgressDialog.vala178
-rw-r--r--src/dialogs/SetBackground.c295
-rw-r--r--src/dialogs/SetBackground.vala38
-rw-r--r--src/dialogs/SetBackgroundSlideshow.c499
-rw-r--r--src/dialogs/SetBackgroundSlideshow.vala78
-rw-r--r--src/dialogs/TextEntry.c400
-rw-r--r--src/dialogs/TextEntry.vala66
-rw-r--r--src/dialogs/WelcomeDialog.c1432
-rw-r--r--src/dialogs/WelcomeDialog.vala208
20 files changed, 14280 insertions, 0 deletions
diff --git a/src/dialogs/AdjustDateTimeDialog.c b/src/dialogs/AdjustDateTimeDialog.c
new file mode 100644
index 0000000..fe412df
--- /dev/null
+++ b/src/dialogs/AdjustDateTimeDialog.c
@@ -0,0 +1,2300 @@
+/* AdjustDateTimeDialog.c generated by valac 0.40.4, the Vala compiler
+ * generated from AdjustDateTimeDialog.vala, do not modify */
+
+/* Copyright 2016 Software Freedom Conservancy Inc.
+ * Copyright 2017 Jens Georg <mail@jensge.org>
+ *
+ * This software is licensed under the GNU LGPL (version 2.1 or later).
+ * See the COPYING file in this distribution.
+ */
+
+
+#include <glib.h>
+#include <glib-object.h>
+#include <gtk/gtk.h>
+#include <time.h>
+#include <stdlib.h>
+#include <string.h>
+#include <glib/gi18n-lib.h>
+#include <float.h>
+#include <math.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
+
+
+#define TYPE_ADJUST_DATE_TIME_DIALOG (adjust_date_time_dialog_get_type ())
+#define ADJUST_DATE_TIME_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ADJUST_DATE_TIME_DIALOG, AdjustDateTimeDialog))
+#define ADJUST_DATE_TIME_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ADJUST_DATE_TIME_DIALOG, AdjustDateTimeDialogClass))
+#define IS_ADJUST_DATE_TIME_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ADJUST_DATE_TIME_DIALOG))
+#define IS_ADJUST_DATE_TIME_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ADJUST_DATE_TIME_DIALOG))
+#define ADJUST_DATE_TIME_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ADJUST_DATE_TIME_DIALOG, AdjustDateTimeDialogClass))
+
+typedef struct _AdjustDateTimeDialog AdjustDateTimeDialog;
+typedef struct _AdjustDateTimeDialogClass AdjustDateTimeDialogClass;
+typedef struct _AdjustDateTimeDialogPrivate AdjustDateTimeDialogPrivate;
+
+#define ADJUST_DATE_TIME_DIALOG_TYPE_TIME_SYSTEM (adjust_date_time_dialog_time_system_get_type ())
+enum {
+ ADJUST_DATE_TIME_DIALOG_0_PROPERTY,
+ ADJUST_DATE_TIME_DIALOG_NUM_PROPERTIES
+};
+static GParamSpec* adjust_date_time_dialog_properties[ADJUST_DATE_TIME_DIALOG_NUM_PROPERTIES];
+#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
+
+#define TYPE_DATA_OBJECT (data_object_get_type ())
+#define DATA_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DATA_OBJECT, DataObject))
+#define DATA_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DATA_OBJECT, DataObjectClass))
+#define IS_DATA_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DATA_OBJECT))
+#define IS_DATA_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DATA_OBJECT))
+#define DATA_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DATA_OBJECT, DataObjectClass))
+
+typedef struct _DataObject DataObject;
+typedef struct _DataObjectClass DataObjectClass;
+
+#define TYPE_DATA_SOURCE (data_source_get_type ())
+#define DATA_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DATA_SOURCE, DataSource))
+#define DATA_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DATA_SOURCE, DataSourceClass))
+#define IS_DATA_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DATA_SOURCE))
+#define IS_DATA_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DATA_SOURCE))
+#define DATA_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DATA_SOURCE, DataSourceClass))
+
+typedef struct _DataSource DataSource;
+typedef struct _DataSourceClass DataSourceClass;
+
+#define TYPE_THUMBNAIL_SOURCE (thumbnail_source_get_type ())
+#define THUMBNAIL_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_THUMBNAIL_SOURCE, ThumbnailSource))
+#define THUMBNAIL_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_THUMBNAIL_SOURCE, ThumbnailSourceClass))
+#define IS_THUMBNAIL_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_THUMBNAIL_SOURCE))
+#define IS_THUMBNAIL_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_THUMBNAIL_SOURCE))
+#define THUMBNAIL_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_THUMBNAIL_SOURCE, ThumbnailSourceClass))
+
+typedef struct _ThumbnailSource ThumbnailSource;
+typedef struct _ThumbnailSourceClass ThumbnailSourceClass;
+
+#define TYPE_MEDIA_SOURCE (media_source_get_type ())
+#define MEDIA_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MEDIA_SOURCE, MediaSource))
+#define MEDIA_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MEDIA_SOURCE, MediaSourceClass))
+#define IS_MEDIA_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MEDIA_SOURCE))
+#define IS_MEDIA_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MEDIA_SOURCE))
+#define MEDIA_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MEDIA_SOURCE, MediaSourceClass))
+
+typedef struct _MediaSource MediaSource;
+typedef struct _MediaSourceClass MediaSourceClass;
+
+#define TYPE_DATEABLE (dateable_get_type ())
+#define DATEABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DATEABLE, Dateable))
+#define IS_DATEABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DATEABLE))
+#define DATEABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_DATEABLE, DateableIface))
+
+typedef struct _Dateable Dateable;
+typedef struct _DateableIface DateableIface;
+
+#define TYPE_PAGE_WINDOW (page_window_get_type ())
+#define PAGE_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PAGE_WINDOW, PageWindow))
+#define PAGE_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PAGE_WINDOW, PageWindowClass))
+#define IS_PAGE_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PAGE_WINDOW))
+#define IS_PAGE_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PAGE_WINDOW))
+#define PAGE_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PAGE_WINDOW, PageWindowClass))
+
+typedef struct _PageWindow PageWindow;
+typedef struct _PageWindowClass PageWindowClass;
+
+#define TYPE_APP_WINDOW (app_window_get_type ())
+#define APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_APP_WINDOW, AppWindow))
+#define APP_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_APP_WINDOW, AppWindowClass))
+#define IS_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_APP_WINDOW))
+#define IS_APP_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_APP_WINDOW))
+#define APP_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_APP_WINDOW, AppWindowClass))
+
+typedef struct _AppWindow AppWindow;
+typedef struct _AppWindowClass AppWindowClass;
+
+#define TYPE_CONFIGURATION_FACADE (configuration_facade_get_type ())
+#define CONFIGURATION_FACADE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CONFIGURATION_FACADE, ConfigurationFacade))
+#define CONFIGURATION_FACADE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CONFIGURATION_FACADE, ConfigurationFacadeClass))
+#define IS_CONFIGURATION_FACADE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CONFIGURATION_FACADE))
+#define IS_CONFIGURATION_FACADE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CONFIGURATION_FACADE))
+#define CONFIGURATION_FACADE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CONFIGURATION_FACADE, ConfigurationFacadeClass))
+
+typedef struct _ConfigurationFacade ConfigurationFacade;
+typedef struct _ConfigurationFacadeClass ConfigurationFacadeClass;
+
+#define CONFIG_TYPE_FACADE (config_facade_get_type ())
+#define CONFIG_FACADE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONFIG_TYPE_FACADE, ConfigFacade))
+#define CONFIG_FACADE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONFIG_TYPE_FACADE, ConfigFacadeClass))
+#define CONFIG_IS_FACADE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONFIG_TYPE_FACADE))
+#define CONFIG_IS_FACADE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONFIG_TYPE_FACADE))
+#define CONFIG_FACADE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONFIG_TYPE_FACADE, ConfigFacadeClass))
+
+typedef struct _ConfigFacade ConfigFacade;
+typedef struct _ConfigFacadeClass ConfigFacadeClass;
+#define _g_free0(var) (var = (g_free (var), NULL))
+#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
+#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
+#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
+#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
+#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
+
+struct _AdjustDateTimeDialog {
+ GtkDialog parent_instance;
+ AdjustDateTimeDialogPrivate * priv;
+};
+
+struct _AdjustDateTimeDialogClass {
+ GtkDialogClass parent_class;
+};
+
+typedef enum {
+ ADJUST_DATE_TIME_DIALOG_TIME_SYSTEM_AM,
+ ADJUST_DATE_TIME_DIALOG_TIME_SYSTEM_PM,
+ ADJUST_DATE_TIME_DIALOG_TIME_SYSTEM_24HR
+} AdjustDateTimeDialogTimeSystem;
+
+struct _AdjustDateTimeDialogPrivate {
+ gboolean no_original_time;
+ time_t original_time;
+ GtkLabel* original_time_label;
+ GtkCalendar* calendar;
+ GtkSpinButton* hour;
+ GtkSpinButton* minute;
+ GtkSpinButton* second;
+ GtkComboBoxText* system;
+ GtkRadioButton* relativity_radio_button;
+ GtkRadioButton* batch_radio_button;
+ GtkCheckButton* modify_originals_check_button;
+ GtkLabel* notification;
+ AdjustDateTimeDialogTimeSystem previous_time_system;
+};
+
+struct _DateableIface {
+ GTypeInterface parent_iface;
+ void (*set_exposure_time) (Dateable* self, time_t target_time);
+ time_t (*get_exposure_time) (Dateable* self);
+};
+
+
+static gpointer adjust_date_time_dialog_parent_class = NULL;
+
+GType adjust_date_time_dialog_get_type (void) G_GNUC_CONST;
+static GType adjust_date_time_dialog_time_system_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
+#define ADJUST_DATE_TIME_DIALOG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_ADJUST_DATE_TIME_DIALOG, AdjustDateTimeDialogPrivate))
+#define ADJUST_DATE_TIME_DIALOG_SECONDS_IN_DAY ((gint64) ((60 * 60) * 24))
+#define ADJUST_DATE_TIME_DIALOG_SECONDS_IN_HOUR ((gint64) (60 * 60))
+#define ADJUST_DATE_TIME_DIALOG_SECONDS_IN_MINUTE ((gint64) 60)
+#define ADJUST_DATE_TIME_DIALOG_YEAR_OFFSET 1900
+#define ADJUST_DATE_TIME_DIALOG_CALENDAR_THUMBNAIL_SCALE 1
+GType data_object_get_type (void) G_GNUC_CONST;
+GType data_source_get_type (void) G_GNUC_CONST;
+GType thumbnail_source_get_type (void) G_GNUC_CONST;
+GType media_source_get_type (void) G_GNUC_CONST;
+GType dateable_get_type (void) G_GNUC_CONST;
+AdjustDateTimeDialog* adjust_date_time_dialog_new (Dateable* source,
+ gint photo_count,
+ gboolean display_options,
+ gboolean contains_video,
+ gboolean only_video);
+AdjustDateTimeDialog* adjust_date_time_dialog_construct (GType object_type,
+ Dateable* source,
+ gint photo_count,
+ gboolean display_options,
+ gboolean contains_video,
+ gboolean only_video);
+gint resources_use_header_bar (void);
+GType page_window_get_type (void) G_GNUC_CONST;
+GType app_window_get_type (void) G_GNUC_CONST;
+AppWindow* app_window_get_instance (void);
+#define RESOURCES_CANCEL_LABEL _ ("_Cancel")
+#define RESOURCES_OK_LABEL _ ("_OK")
+#define RESOURCES_ADJUST_DATE_TIME_LABEL _ ("Adjust Date and Time")
+static void adjust_date_time_dialog_on_time_changed (AdjustDateTimeDialog* self);
+static void _adjust_date_time_dialog_on_time_changed_gtk_calendar_day_selected (GtkCalendar* _sender,
+ gpointer self);
+static void _adjust_date_time_dialog_on_time_changed_gtk_calendar_month_changed (GtkCalendar* _sender,
+ gpointer self);
+static void _adjust_date_time_dialog_on_time_changed_gtk_calendar_next_year (GtkCalendar* _sender,
+ gpointer self);
+static void _adjust_date_time_dialog_on_time_changed_gtk_calendar_prev_year (GtkCalendar* _sender,
+ gpointer self);
+GType configuration_facade_get_type (void) G_GNUC_CONST;
+GType config_facade_get_type (void) G_GNUC_CONST;
+ConfigFacade* config_facade_get_instance (void);
+gboolean configuration_facade_get_use_24_hour_time (ConfigurationFacade* self);
+static gboolean adjust_date_time_dialog_on_spin_button_output (AdjustDateTimeDialog* self,
+ GtkSpinButton* button);
+static gboolean _adjust_date_time_dialog_on_spin_button_output_gtk_spin_button_output (GtkSpinButton* _sender,
+ gpointer self);
+static void adjust_date_time_dialog_on_time_system_changed (AdjustDateTimeDialog* self);
+static void _adjust_date_time_dialog_on_time_system_changed_gtk_combo_box_changed (GtkComboBox* _sender,
+ gpointer self);
+gboolean configuration_facade_get_keep_relativity (ConfigurationFacade* self);
+static void _adjust_date_time_dialog_on_time_changed_gtk_toggle_button_toggled (GtkToggleButton* _sender,
+ gpointer self);
+gboolean configuration_facade_get_commit_metadata_to_masters (ConfigurationFacade* self);
+GdkPixbuf* thumbnail_source_get_thumbnail (ThumbnailSource* self,
+ gint scale,
+ GError** error);
+gchar* data_object_to_string (DataObject* self);
+time_t dateable_get_exposure_time (Dateable* self);
+static void adjust_date_time_dialog_set_time (AdjustDateTimeDialog* self,
+ struct tm* time);
+static void adjust_date_time_dialog_set_original_time_label (AdjustDateTimeDialog* self,
+ gboolean use_24_hr_format);
+static time_t adjust_date_time_dialog_get_time (AdjustDateTimeDialog* self);
+gboolean adjust_date_time_dialog_execute (AdjustDateTimeDialog* self,
+ gint64* time_shift,
+ gboolean* keep_relativity,
+ gboolean* modify_originals);
+void configuration_facade_set_keep_relativity (ConfigurationFacade* self,
+ gboolean keep_relativity);
+void configuration_facade_set_modify_originals (ConfigurationFacade* self,
+ gboolean modify_originals);
+void configuration_facade_set_use_24_hour_time (ConfigurationFacade* self,
+ gboolean use_24_hour_time);
+static void adjust_date_time_dialog_finalize (GObject * obj);
+
+
+static GType
+adjust_date_time_dialog_time_system_get_type (void)
+{
+ static volatile gsize adjust_date_time_dialog_time_system_type_id__volatile = 0;
+ if (g_once_init_enter (&adjust_date_time_dialog_time_system_type_id__volatile)) {
+ static const GEnumValue values[] = {{ADJUST_DATE_TIME_DIALOG_TIME_SYSTEM_AM, "ADJUST_DATE_TIME_DIALOG_TIME_SYSTEM_AM", "am"}, {ADJUST_DATE_TIME_DIALOG_TIME_SYSTEM_PM, "ADJUST_DATE_TIME_DIALOG_TIME_SYSTEM_PM", "pm"}, {ADJUST_DATE_TIME_DIALOG_TIME_SYSTEM_24HR, "ADJUST_DATE_TIME_DIALOG_TIME_SYSTEM_24HR", "24hr"}, {0, NULL, NULL}};
+ GType adjust_date_time_dialog_time_system_type_id;
+ adjust_date_time_dialog_time_system_type_id = g_enum_register_static ("AdjustDateTimeDialogTimeSystem", values);
+ g_once_init_leave (&adjust_date_time_dialog_time_system_type_id__volatile, adjust_date_time_dialog_time_system_type_id);
+ }
+ return adjust_date_time_dialog_time_system_type_id__volatile;
+}
+
+
+static void
+_adjust_date_time_dialog_on_time_changed_gtk_calendar_day_selected (GtkCalendar* _sender,
+ gpointer self)
+{
+#line 53 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ adjust_date_time_dialog_on_time_changed ((AdjustDateTimeDialog*) self);
+#line 276 "AdjustDateTimeDialog.c"
+}
+
+
+static void
+_adjust_date_time_dialog_on_time_changed_gtk_calendar_month_changed (GtkCalendar* _sender,
+ gpointer self)
+{
+#line 54 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ adjust_date_time_dialog_on_time_changed ((AdjustDateTimeDialog*) self);
+#line 286 "AdjustDateTimeDialog.c"
+}
+
+
+static void
+_adjust_date_time_dialog_on_time_changed_gtk_calendar_next_year (GtkCalendar* _sender,
+ gpointer self)
+{
+#line 55 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ adjust_date_time_dialog_on_time_changed ((AdjustDateTimeDialog*) self);
+#line 296 "AdjustDateTimeDialog.c"
+}
+
+
+static void
+_adjust_date_time_dialog_on_time_changed_gtk_calendar_prev_year (GtkCalendar* _sender,
+ gpointer self)
+{
+#line 56 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ adjust_date_time_dialog_on_time_changed ((AdjustDateTimeDialog*) self);
+#line 306 "AdjustDateTimeDialog.c"
+}
+
+
+static gboolean
+_adjust_date_time_dialog_on_spin_button_output_gtk_spin_button_output (GtkSpinButton* _sender,
+ gpointer self)
+{
+ gboolean result;
+ result = adjust_date_time_dialog_on_spin_button_output ((AdjustDateTimeDialog*) self, _sender);
+#line 63 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ return result;
+#line 318 "AdjustDateTimeDialog.c"
+}
+
+
+static void
+_adjust_date_time_dialog_on_time_system_changed_gtk_combo_box_changed (GtkComboBox* _sender,
+ gpointer self)
+{
+#line 81 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ adjust_date_time_dialog_on_time_system_changed ((AdjustDateTimeDialog*) self);
+#line 328 "AdjustDateTimeDialog.c"
+}
+
+
+static void
+_adjust_date_time_dialog_on_time_changed_gtk_toggle_button_toggled (GtkToggleButton* _sender,
+ gpointer self)
+{
+#line 103 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ adjust_date_time_dialog_on_time_changed ((AdjustDateTimeDialog*) self);
+#line 338 "AdjustDateTimeDialog.c"
+}
+
+
+static void
+g_time_gm (time_t time,
+ struct tm* result)
+{
+ struct tm _result_ = {0};
+ struct tm _tmp0_ = {0};
+#line 2861 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ gmtime_r (&time, &_tmp0_);
+#line 2861 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ _result_ = _tmp0_;
+#line 2862 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ *result = _result_;
+#line 2862 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ return;
+#line 356 "AdjustDateTimeDialog.c"
+}
+
+
+static gchar*
+g_time_format (struct tm *self,
+ const gchar* format)
+{
+ gchar* result = NULL;
+ gchar* buffer = NULL;
+ gchar* _tmp0_;
+ gint buffer_length1;
+ gint _buffer_size_;
+ gchar* _tmp1_;
+ gint _tmp1__length1;
+ gchar* _tmp2_;
+ gint _tmp2__length1;
+ gchar* _tmp3_;
+#line 2874 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ g_return_val_if_fail (format != NULL, NULL);
+#line 2875 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ _tmp0_ = g_new0 (gchar, 64);
+#line 2875 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ buffer = _tmp0_;
+#line 2875 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ buffer_length1 = 64;
+#line 2875 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ _buffer_size_ = buffer_length1;
+#line 2876 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ _tmp1_ = buffer;
+#line 2876 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ _tmp1__length1 = buffer_length1;
+#line 2876 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ strftime (_tmp1_, _tmp1__length1, format, &(*self));
+#line 2877 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ _tmp2_ = buffer;
+#line 2877 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ _tmp2__length1 = buffer_length1;
+#line 2877 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ _tmp3_ = g_strdup ((const gchar*) _tmp2_);
+#line 2877 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ result = _tmp3_;
+#line 2877 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ buffer = (g_free (buffer), NULL);
+#line 2877 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ return result;
+#line 402 "AdjustDateTimeDialog.c"
+}
+
+
+static gpointer
+_g_object_ref0 (gpointer self)
+{
+#line 155 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ return self ? g_object_ref (self) : NULL;
+#line 411 "AdjustDateTimeDialog.c"
+}
+
+
+static void
+g_time_local (time_t time,
+ struct tm* result)
+{
+ struct tm _result_ = {0};
+ struct tm _tmp0_ = {0};
+#line 2866 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ localtime_r (&time, &_tmp0_);
+#line 2866 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ _result_ = _tmp0_;
+#line 2867 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ *result = _result_;
+#line 2867 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ return;
+#line 429 "AdjustDateTimeDialog.c"
+}
+
+
+AdjustDateTimeDialog*
+adjust_date_time_dialog_construct (GType object_type,
+ Dateable* source,
+ gint photo_count,
+ gboolean display_options,
+ gboolean contains_video,
+ gboolean only_video)
+{
+ AdjustDateTimeDialog * self = NULL;
+ AppWindow* _tmp0_;
+ AppWindow* _tmp1_;
+ GtkCalendar* _tmp2_;
+ GtkCalendar* _tmp3_;
+ GtkCalendar* _tmp4_;
+ GtkCalendar* _tmp5_;
+ GtkCalendar* _tmp6_;
+ GtkCalendar* _tmp7_;
+ ConfigFacade* _tmp8_;
+ ConfigFacade* _tmp9_;
+ gboolean _tmp10_;
+ GtkSpinButton* _tmp13_;
+ GtkSpinButton* _tmp14_;
+ GtkSpinButton* _tmp15_;
+ GtkSpinButton* _tmp16_;
+ GtkSpinButton* _tmp17_;
+ GtkSpinButton* _tmp18_;
+ GtkSpinButton* _tmp19_;
+ GtkSpinButton* _tmp20_;
+ GtkSpinButton* _tmp21_;
+ GtkSpinButton* _tmp22_;
+ GtkSpinButton* _tmp23_;
+ GtkComboBoxText* _tmp24_;
+ GtkComboBoxText* _tmp25_;
+ GtkComboBoxText* _tmp26_;
+ GtkComboBoxText* _tmp27_;
+ GtkComboBoxText* _tmp28_;
+ GtkBox* clock = NULL;
+ GtkBox* _tmp29_;
+ GtkBox* _tmp30_;
+ GtkSpinButton* _tmp31_;
+ GtkBox* _tmp32_;
+ GtkLabel* _tmp33_;
+ GtkLabel* _tmp34_;
+ GtkBox* _tmp35_;
+ GtkSpinButton* _tmp36_;
+ GtkBox* _tmp37_;
+ GtkLabel* _tmp38_;
+ GtkLabel* _tmp39_;
+ GtkBox* _tmp40_;
+ GtkSpinButton* _tmp41_;
+ GtkBox* _tmp42_;
+ GtkComboBoxText* _tmp43_;
+ GtkRadioButton* _tmp44_;
+ GtkRadioButton* _tmp45_;
+ ConfigFacade* _tmp46_;
+ ConfigFacade* _tmp47_;
+ gboolean _tmp48_ = FALSE;
+ GtkRadioButton* _tmp49_;
+ GtkRadioButton* _tmp50_;
+ GSList* _tmp51_;
+ GtkRadioButton* _tmp52_;
+ GtkRadioButton* _tmp53_;
+ ConfigFacade* _tmp54_;
+ ConfigFacade* _tmp55_;
+ gboolean _tmp56_ = FALSE;
+ GtkRadioButton* _tmp57_;
+ GtkRadioButton* _tmp58_;
+ gboolean _tmp65_ = FALSE;
+ ConfigFacade* _tmp66_;
+ ConfigFacade* _tmp67_;
+ gboolean _tmp68_;
+ GtkCheckButton* _tmp69_;
+ gboolean _tmp70_ = FALSE;
+ GtkCheckButton* _tmp75_;
+ GtkBox* time_content = NULL;
+ GtkBox* _tmp76_;
+ GtkBox* picker = NULL;
+ GtkBox* _tmp77_;
+ GtkComboBoxText* combo = NULL;
+ GtkComboBoxText* _tmp78_;
+ GtkBox* _tmp87_;
+ GtkComboBoxText* _tmp88_;
+ GtkSpinButton* spin = NULL;
+ GtkSpinButton* _tmp89_;
+ GtkBox* _tmp90_;
+ GtkSpinButton* _tmp91_;
+ GtkSpinButton* _tmp92_;
+ GtkCalendar* _tmp93_;
+ GtkComboBoxText* _tmp94_;
+ GtkCalendar* _tmp95_;
+ GtkBox* _tmp96_;
+ GtkBox* _tmp97_;
+ GtkBox* _tmp98_;
+ GtkCalendar* _tmp99_;
+ GtkBox* _tmp100_;
+ GtkBox* _tmp101_;
+ GdkPixbuf* preview = NULL;
+ GtkBox* image_content = NULL;
+ GtkBox* _tmp113_;
+ GtkBox* _tmp114_;
+ GtkBox* _tmp115_;
+ GtkImage* _tmp116_ = NULL;
+ GdkPixbuf* _tmp117_;
+ GtkImage* image = NULL;
+ GtkImage* _tmp121_;
+ GtkLabel* _tmp122_;
+ GtkBox* _tmp123_;
+ GtkImage* _tmp124_;
+ GtkBox* _tmp125_;
+ GtkLabel* _tmp126_;
+ GtkBox* hbox = NULL;
+ GtkBox* _tmp127_;
+ GtkBox* _tmp128_;
+ GtkBox* _tmp129_;
+ GtkBox* _tmp130_;
+ GtkBox* _tmp131_;
+ GtkBox* _tmp132_;
+ GtkBox* _tmp133_;
+ GtkBox* _tmp134_;
+ GtkBox* _tmp135_;
+ GtkBox* _tmp136_;
+ GtkBox* _tmp137_;
+ GtkBox* _tmp138_;
+ GtkLabel* _tmp139_;
+ GtkLabel* _tmp140_;
+ GtkLabel* _tmp141_;
+ GtkBox* _tmp142_;
+ GtkLabel* _tmp143_;
+ time_t _tmp144_;
+ time_t _tmp146_;
+ struct tm _tmp147_ = {0};
+ ConfigFacade* _tmp148_;
+ ConfigFacade* _tmp149_;
+ GError * _inner_error_ = NULL;
+#line 37 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_return_val_if_fail (IS_DATEABLE (source), NULL);
+#line 39 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _vala_assert (source != NULL, "source != null");
+#line 41 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ self = (AdjustDateTimeDialog*) g_object_new (object_type, "use-header-bar", resources_use_header_bar (), NULL);
+#line 43 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_window_set_modal (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), TRUE);
+#line 44 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_window_set_resizable (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), FALSE);
+#line 45 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp0_ = app_window_get_instance ();
+#line 45 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp1_ = _tmp0_;
+#line 45 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_window_set_transient_for (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_window_get_type (), GtkWindow));
+#line 45 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (_tmp1_);
+#line 47 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_dialog_add_buttons (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_dialog_get_type (), GtkDialog), RESOURCES_CANCEL_LABEL, GTK_RESPONSE_CANCEL, RESOURCES_OK_LABEL, GTK_RESPONSE_OK, NULL);
+#line 49 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_window_set_title (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), RESOURCES_ADJUST_DATE_TIME_LABEL);
+#line 51 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp2_ = (GtkCalendar*) gtk_calendar_new ();
+#line 51 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_object_ref_sink (_tmp2_);
+#line 51 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (self->priv->calendar);
+#line 51 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ self->priv->calendar = _tmp2_;
+#line 52 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp3_ = self->priv->calendar;
+#line 52 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_object_set (_tmp3_, "show-heading", FALSE, NULL);
+#line 53 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp4_ = self->priv->calendar;
+#line 53 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_signal_connect_object (_tmp4_, "day-selected", (GCallback) _adjust_date_time_dialog_on_time_changed_gtk_calendar_day_selected, self, 0);
+#line 54 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp5_ = self->priv->calendar;
+#line 54 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_signal_connect_object (_tmp5_, "month-changed", (GCallback) _adjust_date_time_dialog_on_time_changed_gtk_calendar_month_changed, self, 0);
+#line 55 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp6_ = self->priv->calendar;
+#line 55 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_signal_connect_object (_tmp6_, "next-year", (GCallback) _adjust_date_time_dialog_on_time_changed_gtk_calendar_next_year, self, 0);
+#line 56 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp7_ = self->priv->calendar;
+#line 56 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_signal_connect_object (_tmp7_, "prev-year", (GCallback) _adjust_date_time_dialog_on_time_changed_gtk_calendar_prev_year, self, 0);
+#line 58 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp8_ = config_facade_get_instance ();
+#line 58 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp9_ = _tmp8_;
+#line 58 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp10_ = configuration_facade_get_use_24_hour_time (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
+#line 58 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (_tmp9_);
+#line 58 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ if (_tmp10_) {
+#line 627 "AdjustDateTimeDialog.c"
+ GtkSpinButton* _tmp11_;
+#line 59 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp11_ = (GtkSpinButton*) gtk_spin_button_new_with_range ((gdouble) 0, (gdouble) 23, (gdouble) 1);
+#line 59 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_object_ref_sink (_tmp11_);
+#line 59 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (self->priv->hour);
+#line 59 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ self->priv->hour = _tmp11_;
+#line 637 "AdjustDateTimeDialog.c"
+ } else {
+ GtkSpinButton* _tmp12_;
+#line 61 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp12_ = (GtkSpinButton*) gtk_spin_button_new_with_range ((gdouble) 1, (gdouble) 12, (gdouble) 1);
+#line 61 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_object_ref_sink (_tmp12_);
+#line 61 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (self->priv->hour);
+#line 61 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ self->priv->hour = _tmp12_;
+#line 648 "AdjustDateTimeDialog.c"
+ }
+#line 63 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp13_ = self->priv->hour;
+#line 63 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_signal_connect_object (_tmp13_, "output", (GCallback) _adjust_date_time_dialog_on_spin_button_output_gtk_spin_button_output, self, 0);
+#line 64 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp14_ = self->priv->hour;
+#line 64 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_entry_set_width_chars (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, gtk_entry_get_type (), GtkEntry), 2);
+#line 65 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp15_ = self->priv->hour;
+#line 65 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_entry_set_max_width_chars (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, gtk_entry_get_type (), GtkEntry), 2);
+#line 67 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp16_ = (GtkSpinButton*) gtk_spin_button_new_with_range ((gdouble) 0, (gdouble) 59, (gdouble) 1);
+#line 67 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_object_ref_sink (_tmp16_);
+#line 67 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (self->priv->minute);
+#line 67 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ self->priv->minute = _tmp16_;
+#line 68 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp17_ = self->priv->minute;
+#line 68 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_entry_set_width_chars (G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, gtk_entry_get_type (), GtkEntry), 2);
+#line 69 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp18_ = self->priv->minute;
+#line 69 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_entry_set_max_width_chars (G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, gtk_entry_get_type (), GtkEntry), 2);
+#line 70 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp19_ = self->priv->minute;
+#line 70 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_signal_connect_object (_tmp19_, "output", (GCallback) _adjust_date_time_dialog_on_spin_button_output_gtk_spin_button_output, self, 0);
+#line 72 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp20_ = (GtkSpinButton*) gtk_spin_button_new_with_range ((gdouble) 0, (gdouble) 59, (gdouble) 1);
+#line 72 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_object_ref_sink (_tmp20_);
+#line 72 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (self->priv->second);
+#line 72 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ self->priv->second = _tmp20_;
+#line 73 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp21_ = self->priv->second;
+#line 73 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_entry_set_width_chars (G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, gtk_entry_get_type (), GtkEntry), 2);
+#line 74 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp22_ = self->priv->second;
+#line 74 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_entry_set_max_width_chars (G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, gtk_entry_get_type (), GtkEntry), 2);
+#line 75 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp23_ = self->priv->second;
+#line 75 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_signal_connect_object (_tmp23_, "output", (GCallback) _adjust_date_time_dialog_on_spin_button_output_gtk_spin_button_output, self, 0);
+#line 77 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp24_ = (GtkComboBoxText*) gtk_combo_box_text_new ();
+#line 77 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_object_ref_sink (_tmp24_);
+#line 77 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (self->priv->system);
+#line 77 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ self->priv->system = _tmp24_;
+#line 78 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp25_ = self->priv->system;
+#line 78 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_combo_box_text_append_text (_tmp25_, _ ("AM"));
+#line 79 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp26_ = self->priv->system;
+#line 79 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_combo_box_text_append_text (_tmp26_, _ ("PM"));
+#line 80 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp27_ = self->priv->system;
+#line 80 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_combo_box_text_append_text (_tmp27_, _ ("24 Hr"));
+#line 81 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp28_ = self->priv->system;
+#line 81 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp28_, gtk_combo_box_get_type (), GtkComboBox), "changed", (GCallback) _adjust_date_time_dialog_on_time_system_changed_gtk_combo_box_changed, self, 0);
+#line 83 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp29_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 3);
+#line 83 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_object_ref_sink (_tmp29_);
+#line 83 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ clock = _tmp29_;
+#line 85 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp30_ = clock;
+#line 85 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp31_ = self->priv->hour;
+#line 85 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_box_pack_start (_tmp30_, G_TYPE_CHECK_INSTANCE_CAST (_tmp31_, gtk_widget_get_type (), GtkWidget), FALSE, FALSE, (guint) 0);
+#line 86 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp32_ = clock;
+#line 86 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp33_ = (GtkLabel*) gtk_label_new (":");
+#line 86 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_object_ref_sink (_tmp33_);
+#line 86 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp34_ = _tmp33_;
+#line 86 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_box_pack_start (_tmp32_, G_TYPE_CHECK_INSTANCE_CAST (_tmp34_, gtk_widget_get_type (), GtkWidget), FALSE, FALSE, (guint) 0);
+#line 86 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (_tmp34_);
+#line 87 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp35_ = clock;
+#line 87 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp36_ = self->priv->minute;
+#line 87 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_box_pack_start (_tmp35_, G_TYPE_CHECK_INSTANCE_CAST (_tmp36_, gtk_widget_get_type (), GtkWidget), FALSE, FALSE, (guint) 0);
+#line 88 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp37_ = clock;
+#line 88 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp38_ = (GtkLabel*) gtk_label_new (":");
+#line 88 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_object_ref_sink (_tmp38_);
+#line 88 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp39_ = _tmp38_;
+#line 88 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_box_pack_start (_tmp37_, G_TYPE_CHECK_INSTANCE_CAST (_tmp39_, gtk_widget_get_type (), GtkWidget), FALSE, FALSE, (guint) 0);
+#line 88 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (_tmp39_);
+#line 89 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp40_ = clock;
+#line 89 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp41_ = self->priv->second;
+#line 89 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_box_pack_start (_tmp40_, G_TYPE_CHECK_INSTANCE_CAST (_tmp41_, gtk_widget_get_type (), GtkWidget), FALSE, FALSE, (guint) 0);
+#line 90 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp42_ = clock;
+#line 90 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp43_ = self->priv->system;
+#line 90 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_box_pack_start (_tmp42_, G_TYPE_CHECK_INSTANCE_CAST (_tmp43_, gtk_widget_get_type (), GtkWidget), FALSE, FALSE, (guint) 0);
+#line 92 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_dialog_set_default_response (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_dialog_get_type (), GtkDialog), (gint) GTK_RESPONSE_OK);
+#line 94 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp44_ = (GtkRadioButton*) gtk_radio_button_new_with_mnemonic (NULL, _ ("_Shift photos/videos by the same amount"));
+#line 94 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_object_ref_sink (_tmp44_);
+#line 94 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (self->priv->relativity_radio_button);
+#line 94 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ self->priv->relativity_radio_button = _tmp44_;
+#line 96 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp45_ = self->priv->relativity_radio_button;
+#line 96 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp46_ = config_facade_get_instance ();
+#line 96 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp47_ = _tmp46_;
+#line 96 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_toggle_button_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp45_, gtk_toggle_button_get_type (), GtkToggleButton), configuration_facade_get_keep_relativity (G_TYPE_CHECK_INSTANCE_CAST (_tmp47_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)));
+#line 96 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (_tmp47_);
+#line 97 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ if (display_options) {
+#line 97 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp48_ = photo_count > 1;
+#line 804 "AdjustDateTimeDialog.c"
+ } else {
+#line 97 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp48_ = FALSE;
+#line 808 "AdjustDateTimeDialog.c"
+ }
+#line 97 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp49_ = self->priv->relativity_radio_button;
+#line 97 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp49_, gtk_widget_get_type (), GtkWidget), _tmp48_);
+#line 99 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp50_ = self->priv->relativity_radio_button;
+#line 99 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp51_ = gtk_radio_button_get_group (_tmp50_);
+#line 99 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp52_ = (GtkRadioButton*) gtk_radio_button_new_with_mnemonic (_tmp51_, _ ("Set _all photos/videos to this time"));
+#line 99 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_object_ref_sink (_tmp52_);
+#line 99 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (self->priv->batch_radio_button);
+#line 99 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ self->priv->batch_radio_button = _tmp52_;
+#line 101 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp53_ = self->priv->batch_radio_button;
+#line 101 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp54_ = config_facade_get_instance ();
+#line 101 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp55_ = _tmp54_;
+#line 101 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_toggle_button_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp53_, gtk_toggle_button_get_type (), GtkToggleButton), !configuration_facade_get_keep_relativity (G_TYPE_CHECK_INSTANCE_CAST (_tmp55_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)));
+#line 101 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (_tmp55_);
+#line 102 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ if (display_options) {
+#line 102 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp56_ = photo_count > 1;
+#line 840 "AdjustDateTimeDialog.c"
+ } else {
+#line 102 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp56_ = FALSE;
+#line 844 "AdjustDateTimeDialog.c"
+ }
+#line 102 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp57_ = self->priv->batch_radio_button;
+#line 102 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp57_, gtk_widget_get_type (), GtkWidget), _tmp56_);
+#line 103 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp58_ = self->priv->batch_radio_button;
+#line 103 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp58_, gtk_toggle_button_get_type (), GtkToggleButton), "toggled", (GCallback) _adjust_date_time_dialog_on_time_changed_gtk_toggle_button_toggled, self, 0);
+#line 105 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ if (contains_video) {
+#line 856 "AdjustDateTimeDialog.c"
+ gchar* text = NULL;
+ gchar* _tmp59_;
+ const gchar* _tmp60_;
+ GtkCheckButton* _tmp61_;
+#line 106 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp59_ = g_strdup (ngettext ("_Modify original photo file", "_Modify original photo files", (gulong) photo_count));
+#line 106 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ text = _tmp59_;
+#line 108 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp60_ = text;
+#line 108 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp61_ = (GtkCheckButton*) gtk_check_button_new_with_mnemonic (_tmp60_);
+#line 108 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_object_ref_sink (_tmp61_);
+#line 108 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (self->priv->modify_originals_check_button);
+#line 108 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ self->priv->modify_originals_check_button = _tmp61_;
+#line 105 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_free0 (text);
+#line 877 "AdjustDateTimeDialog.c"
+ } else {
+ gchar* text = NULL;
+ gchar* _tmp62_;
+ const gchar* _tmp63_;
+ GtkCheckButton* _tmp64_;
+#line 110 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp62_ = g_strdup (ngettext ("_Modify original file", "_Modify original files", (gulong) photo_count));
+#line 110 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ text = _tmp62_;
+#line 111 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp63_ = text;
+#line 111 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp64_ = (GtkCheckButton*) gtk_check_button_new_with_mnemonic (_tmp63_);
+#line 111 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_object_ref_sink (_tmp64_);
+#line 111 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (self->priv->modify_originals_check_button);
+#line 111 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ self->priv->modify_originals_check_button = _tmp64_;
+#line 105 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_free0 (text);
+#line 899 "AdjustDateTimeDialog.c"
+ }
+#line 114 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp66_ = config_facade_get_instance ();
+#line 114 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp67_ = _tmp66_;
+#line 114 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp68_ = configuration_facade_get_commit_metadata_to_masters (G_TYPE_CHECK_INSTANCE_CAST (_tmp67_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
+#line 114 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (_tmp67_);
+#line 114 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ if (_tmp68_) {
+#line 115 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp65_ = display_options;
+#line 913 "AdjustDateTimeDialog.c"
+ } else {
+#line 114 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp65_ = FALSE;
+#line 917 "AdjustDateTimeDialog.c"
+ }
+#line 114 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp69_ = self->priv->modify_originals_check_button;
+#line 114 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_toggle_button_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp69_, gtk_toggle_button_get_type (), GtkToggleButton), _tmp65_);
+#line 116 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ if (!only_video) {
+#line 925 "AdjustDateTimeDialog.c"
+ gboolean _tmp71_ = FALSE;
+ ConfigFacade* _tmp72_;
+ ConfigFacade* _tmp73_;
+ gboolean _tmp74_;
+#line 117 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp72_ = config_facade_get_instance ();
+#line 117 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp73_ = _tmp72_;
+#line 117 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp74_ = !configuration_facade_get_commit_metadata_to_masters (G_TYPE_CHECK_INSTANCE_CAST (_tmp73_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
+#line 117 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (_tmp73_);
+#line 117 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ if (_tmp74_) {
+#line 117 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp71_ = display_options;
+#line 942 "AdjustDateTimeDialog.c"
+ } else {
+#line 117 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp71_ = FALSE;
+#line 946 "AdjustDateTimeDialog.c"
+ }
+#line 117 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp70_ = _tmp71_;
+#line 950 "AdjustDateTimeDialog.c"
+ } else {
+#line 116 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp70_ = FALSE;
+#line 954 "AdjustDateTimeDialog.c"
+ }
+#line 116 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp75_ = self->priv->modify_originals_check_button;
+#line 116 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp75_, gtk_widget_get_type (), GtkWidget), _tmp70_);
+#line 119 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp76_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
+#line 119 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_object_ref_sink (_tmp76_);
+#line 119 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ time_content = _tmp76_;
+#line 121 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp77_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5);
+#line 121 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_object_ref_sink (_tmp77_);
+#line 121 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ picker = _tmp77_;
+#line 122 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp78_ = (GtkComboBoxText*) gtk_combo_box_text_new ();
+#line 122 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_object_ref_sink (_tmp78_);
+#line 122 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ combo = _tmp78_;
+#line 978 "AdjustDateTimeDialog.c"
+ {
+ gint i = 0;
+#line 123 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ i = 0;
+#line 983 "AdjustDateTimeDialog.c"
+ {
+ gboolean _tmp79_ = FALSE;
+#line 123 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp79_ = TRUE;
+#line 123 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ while (TRUE) {
+#line 990 "AdjustDateTimeDialog.c"
+ gint _tmp81_;
+ GtkComboBoxText* _tmp82_;
+ gint _tmp83_;
+ struct tm _tmp84_ = {0};
+ gchar* _tmp85_;
+ gchar* _tmp86_;
+#line 123 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ if (!_tmp79_) {
+#line 999 "AdjustDateTimeDialog.c"
+ gint _tmp80_;
+#line 123 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp80_ = i;
+#line 123 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ i = _tmp80_ + 1;
+#line 1005 "AdjustDateTimeDialog.c"
+ }
+#line 123 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp79_ = FALSE;
+#line 123 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp81_ = i;
+#line 123 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ if (!(_tmp81_ < 12)) {
+#line 123 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ break;
+#line 1015 "AdjustDateTimeDialog.c"
+ }
+#line 124 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp82_ = combo;
+#line 124 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp83_ = i;
+#line 124 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_time_gm ((time_t) (_tmp83_ * 2764800), &_tmp84_);
+#line 124 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp85_ = g_time_format (&_tmp84_, "%B");
+#line 124 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp86_ = _tmp85_;
+#line 124 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_combo_box_text_append_text (_tmp82_, _tmp86_);
+#line 124 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_free0 (_tmp86_);
+#line 1031 "AdjustDateTimeDialog.c"
+ }
+ }
+ }
+#line 126 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp87_ = picker;
+#line 126 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp88_ = combo;
+#line 126 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_box_pack_start (_tmp87_, G_TYPE_CHECK_INSTANCE_CAST (_tmp88_, gtk_widget_get_type (), GtkWidget), FALSE, FALSE, (guint) 0);
+#line 128 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp89_ = (GtkSpinButton*) gtk_spin_button_new_with_range ((gdouble) 0, (gdouble) (G_MAXINT >> 9), (gdouble) 1);
+#line 128 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_object_ref_sink (_tmp89_);
+#line 128 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ spin = _tmp89_;
+#line 129 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp90_ = picker;
+#line 129 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp91_ = spin;
+#line 129 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_box_pack_end (_tmp90_, G_TYPE_CHECK_INSTANCE_CAST (_tmp91_, gtk_widget_get_type (), GtkWidget), FALSE, FALSE, (guint) 0);
+#line 130 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp92_ = spin;
+#line 130 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp93_ = self->priv->calendar;
+#line 130 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_object_bind_property_with_closures (G_TYPE_CHECK_INSTANCE_CAST (_tmp92_, G_TYPE_OBJECT, GObject), "value", G_TYPE_CHECK_INSTANCE_CAST (_tmp93_, G_TYPE_OBJECT, GObject), "year", G_BINDING_BIDIRECTIONAL, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
+#line 131 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp94_ = combo;
+#line 131 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp95_ = self->priv->calendar;
+#line 131 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_object_bind_property_with_closures (G_TYPE_CHECK_INSTANCE_CAST (_tmp94_, G_TYPE_OBJECT, GObject), "active", G_TYPE_CHECK_INSTANCE_CAST (_tmp95_, G_TYPE_OBJECT, GObject), "month", G_BINDING_BIDIRECTIONAL, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
+#line 133 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp96_ = time_content;
+#line 133 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp97_ = picker;
+#line 133 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_box_pack_start (_tmp96_, G_TYPE_CHECK_INSTANCE_CAST (_tmp97_, gtk_widget_get_type (), GtkWidget), FALSE, FALSE, (guint) 0);
+#line 134 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp98_ = time_content;
+#line 134 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp99_ = self->priv->calendar;
+#line 134 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_box_pack_start (_tmp98_, G_TYPE_CHECK_INSTANCE_CAST (_tmp99_, gtk_widget_get_type (), GtkWidget), TRUE, FALSE, (guint) 0);
+#line 135 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp100_ = time_content;
+#line 135 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp101_ = clock;
+#line 135 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_box_pack_start (_tmp100_, G_TYPE_CHECK_INSTANCE_CAST (_tmp101_, gtk_widget_get_type (), GtkWidget), TRUE, FALSE, (guint) 0);
+#line 137 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ if (display_options) {
+#line 1085 "AdjustDateTimeDialog.c"
+ GtkBox* _tmp102_;
+ GtkRadioButton* _tmp103_;
+ GtkBox* _tmp104_;
+ GtkRadioButton* _tmp105_;
+ GtkBox* _tmp106_;
+ GtkCheckButton* _tmp107_;
+#line 138 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp102_ = time_content;
+#line 138 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp103_ = self->priv->relativity_radio_button;
+#line 138 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_box_pack_start (_tmp102_, G_TYPE_CHECK_INSTANCE_CAST (_tmp103_, gtk_widget_get_type (), GtkWidget), TRUE, FALSE, (guint) 0);
+#line 139 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp104_ = time_content;
+#line 139 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp105_ = self->priv->batch_radio_button;
+#line 139 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_box_pack_start (_tmp104_, G_TYPE_CHECK_INSTANCE_CAST (_tmp105_, gtk_widget_get_type (), GtkWidget), TRUE, FALSE, (guint) 0);
+#line 140 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp106_ = time_content;
+#line 140 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp107_ = self->priv->modify_originals_check_button;
+#line 140 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_box_pack_start (_tmp106_, G_TYPE_CHECK_INSTANCE_CAST (_tmp107_, gtk_widget_get_type (), GtkWidget), TRUE, FALSE, (guint) 0);
+#line 1110 "AdjustDateTimeDialog.c"
+ }
+#line 143 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ preview = NULL;
+#line 1114 "AdjustDateTimeDialog.c"
+ {
+ GdkPixbuf* _tmp108_ = NULL;
+ GdkPixbuf* _tmp109_;
+ GdkPixbuf* _tmp110_;
+#line 147 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp109_ = thumbnail_source_get_thumbnail (G_TYPE_CHECK_INSTANCE_CAST (source, TYPE_THUMBNAIL_SOURCE, ThumbnailSource), ADJUST_DATE_TIME_DIALOG_CALENDAR_THUMBNAIL_SCALE, &_inner_error_);
+#line 147 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp108_ = _tmp109_;
+#line 147 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ if (G_UNLIKELY (_inner_error_ != NULL)) {
+#line 1125 "AdjustDateTimeDialog.c"
+ goto __catch25_g_error;
+ }
+#line 147 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp110_ = _tmp108_;
+#line 147 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp108_ = NULL;
+#line 147 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (preview);
+#line 147 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ preview = _tmp110_;
+#line 144 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (_tmp108_);
+#line 1138 "AdjustDateTimeDialog.c"
+ }
+ goto __finally25;
+ __catch25_g_error:
+ {
+ GError* err = NULL;
+ gchar* _tmp111_;
+ gchar* _tmp112_;
+#line 144 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ err = _inner_error_;
+#line 144 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _inner_error_ = NULL;
+#line 149 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp111_ = data_object_to_string (G_TYPE_CHECK_INSTANCE_CAST (source, TYPE_DATA_OBJECT, DataObject));
+#line 149 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp112_ = _tmp111_;
+#line 149 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_warning ("AdjustDateTimeDialog.vala:149: Unable to fetch preview for %s", _tmp112_);
+#line 149 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_free0 (_tmp112_);
+#line 144 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_error_free0 (err);
+#line 1160 "AdjustDateTimeDialog.c"
+ }
+ __finally25:
+#line 144 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ if (G_UNLIKELY (_inner_error_ != NULL)) {
+#line 144 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (preview);
+#line 144 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (spin);
+#line 144 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (combo);
+#line 144 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (picker);
+#line 144 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (time_content);
+#line 144 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (clock);
+#line 144 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ 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);
+#line 144 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_clear_error (&_inner_error_);
+#line 144 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ return NULL;
+#line 1183 "AdjustDateTimeDialog.c"
+ }
+#line 152 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp113_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+#line 152 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_object_ref_sink (_tmp113_);
+#line 152 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ image_content = _tmp113_;
+#line 153 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp114_ = image_content;
+#line 153 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_widget_set_valign (G_TYPE_CHECK_INSTANCE_CAST (_tmp114_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_START);
+#line 154 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp115_ = image_content;
+#line 154 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_box_set_homogeneous (_tmp115_, TRUE);
+#line 155 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp117_ = preview;
+#line 155 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ if (_tmp117_ != NULL) {
+#line 1203 "AdjustDateTimeDialog.c"
+ GdkPixbuf* _tmp118_;
+ GtkImage* _tmp119_;
+#line 155 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp118_ = preview;
+#line 155 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp119_ = (GtkImage*) gtk_image_new_from_pixbuf (_tmp118_);
+#line 155 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_object_ref_sink (_tmp119_);
+#line 155 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (_tmp116_);
+#line 155 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp116_ = _tmp119_;
+#line 1216 "AdjustDateTimeDialog.c"
+ } else {
+ GtkImage* _tmp120_;
+#line 155 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp120_ = (GtkImage*) gtk_image_new ();
+#line 155 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_object_ref_sink (_tmp120_);
+#line 155 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (_tmp116_);
+#line 155 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp116_ = _tmp120_;
+#line 1227 "AdjustDateTimeDialog.c"
+ }
+#line 155 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp121_ = _g_object_ref0 (_tmp116_);
+#line 155 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ image = _tmp121_;
+#line 156 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp122_ = (GtkLabel*) gtk_label_new (NULL);
+#line 156 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_object_ref_sink (_tmp122_);
+#line 156 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (self->priv->original_time_label);
+#line 156 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ self->priv->original_time_label = _tmp122_;
+#line 157 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp123_ = image_content;
+#line 157 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp124_ = image;
+#line 157 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_box_pack_start (_tmp123_, G_TYPE_CHECK_INSTANCE_CAST (_tmp124_, gtk_widget_get_type (), GtkWidget), TRUE, FALSE, (guint) 0);
+#line 158 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp125_ = image_content;
+#line 158 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp126_ = self->priv->original_time_label;
+#line 158 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_box_pack_start (_tmp125_, G_TYPE_CHECK_INSTANCE_CAST (_tmp126_, gtk_widget_get_type (), GtkWidget), TRUE, FALSE, (guint) 0);
+#line 160 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp127_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
+#line 160 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_object_ref_sink (_tmp127_);
+#line 160 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ hbox = _tmp127_;
+#line 161 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp128_ = hbox;
+#line 161 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_container_set_border_width (G_TYPE_CHECK_INSTANCE_CAST (_tmp128_, gtk_container_get_type (), GtkContainer), (guint) 3);
+#line 162 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp129_ = hbox;
+#line 162 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp130_ = image_content;
+#line 162 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_box_pack_start (_tmp129_, G_TYPE_CHECK_INSTANCE_CAST (_tmp130_, gtk_widget_get_type (), GtkWidget), TRUE, FALSE, (guint) 0);
+#line 163 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp131_ = hbox;
+#line 163 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp132_ = time_content;
+#line 163 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_box_pack_start (_tmp131_, G_TYPE_CHECK_INSTANCE_CAST (_tmp132_, gtk_widget_get_type (), GtkWidget), TRUE, FALSE, (guint) 0);
+#line 164 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp133_ = hbox;
+#line 164 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_widget_set_halign (G_TYPE_CHECK_INSTANCE_CAST (_tmp133_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_CENTER);
+#line 165 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp134_ = hbox;
+#line 165 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_widget_set_valign (G_TYPE_CHECK_INSTANCE_CAST (_tmp134_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_CENTER);
+#line 166 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp135_ = hbox;
+#line 166 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_widget_set_hexpand (G_TYPE_CHECK_INSTANCE_CAST (_tmp135_, gtk_widget_get_type (), GtkWidget), FALSE);
+#line 167 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp136_ = hbox;
+#line 167 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_widget_set_vexpand (G_TYPE_CHECK_INSTANCE_CAST (_tmp136_, gtk_widget_get_type (), GtkWidget), FALSE);
+#line 169 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp137_ = gtk_dialog_get_content_area (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_dialog_get_type (), GtkDialog));
+#line 169 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp138_ = hbox;
+#line 169 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_box_pack_start (G_TYPE_CHECK_INSTANCE_CAST (_tmp137_, gtk_box_get_type (), GtkBox), G_TYPE_CHECK_INSTANCE_CAST (_tmp138_, gtk_widget_get_type (), GtkWidget), TRUE, FALSE, (guint) 0);
+#line 171 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp139_ = (GtkLabel*) gtk_label_new ("");
+#line 171 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_object_ref_sink (_tmp139_);
+#line 171 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (self->priv->notification);
+#line 171 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ self->priv->notification = _tmp139_;
+#line 172 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp140_ = self->priv->notification;
+#line 172 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_label_set_line_wrap (_tmp140_, TRUE);
+#line 173 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp141_ = self->priv->notification;
+#line 173 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_label_set_justify (_tmp141_, GTK_JUSTIFY_CENTER);
+#line 175 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp142_ = gtk_dialog_get_content_area (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_dialog_get_type (), GtkDialog));
+#line 175 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp143_ = self->priv->notification;
+#line 175 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_box_pack_start (G_TYPE_CHECK_INSTANCE_CAST (_tmp142_, gtk_box_get_type (), GtkBox), G_TYPE_CHECK_INSTANCE_CAST (_tmp143_, gtk_widget_get_type (), GtkWidget), TRUE, TRUE, (guint) 0);
+#line 177 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ self->priv->original_time = dateable_get_exposure_time (source);
+#line 179 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp144_ = self->priv->original_time;
+#line 179 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ if (_tmp144_ == ((time_t) 0)) {
+#line 1325 "AdjustDateTimeDialog.c"
+ time_t _tmp145_;
+#line 180 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp145_ = time (NULL);
+#line 180 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ self->priv->original_time = _tmp145_;
+#line 181 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ self->priv->no_original_time = TRUE;
+#line 1333 "AdjustDateTimeDialog.c"
+ }
+#line 184 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp146_ = self->priv->original_time;
+#line 184 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_time_local (_tmp146_, &_tmp147_);
+#line 184 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ adjust_date_time_dialog_set_time (self, &_tmp147_);
+#line 185 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp148_ = config_facade_get_instance ();
+#line 185 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp149_ = _tmp148_;
+#line 185 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ adjust_date_time_dialog_set_original_time_label (self, configuration_facade_get_use_24_hour_time (G_TYPE_CHECK_INSTANCE_CAST (_tmp149_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)));
+#line 185 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (_tmp149_);
+#line 37 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (hbox);
+#line 37 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (image);
+#line 37 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (_tmp116_);
+#line 37 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (image_content);
+#line 37 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (preview);
+#line 37 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (spin);
+#line 37 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (combo);
+#line 37 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (picker);
+#line 37 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (time_content);
+#line 37 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (clock);
+#line 37 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ return self;
+#line 1371 "AdjustDateTimeDialog.c"
+}
+
+
+AdjustDateTimeDialog*
+adjust_date_time_dialog_new (Dateable* source,
+ gint photo_count,
+ gboolean display_options,
+ gboolean contains_video,
+ gboolean only_video)
+{
+#line 37 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ return adjust_date_time_dialog_construct (TYPE_ADJUST_DATE_TIME_DIALOG, source, photo_count, display_options, contains_video, only_video);
+#line 1384 "AdjustDateTimeDialog.c"
+}
+
+
+static void
+adjust_date_time_dialog_set_time (AdjustDateTimeDialog* self,
+ struct tm* time)
+{
+ GtkCalendar* _tmp0_;
+ struct tm _tmp1_;
+ gint _tmp2_;
+ struct tm _tmp3_;
+ gint _tmp4_;
+ GtkCalendar* _tmp5_;
+ struct tm _tmp6_;
+ gint _tmp7_;
+ GtkCalendar* _tmp8_;
+ GtkCalendar* _tmp9_;
+ ConfigFacade* _tmp10_;
+ ConfigFacade* _tmp11_;
+ gboolean _tmp12_;
+ GtkSpinButton* _tmp27_;
+ struct tm _tmp28_;
+ gint _tmp29_;
+ GtkSpinButton* _tmp30_;
+ struct tm _tmp31_;
+ gint _tmp32_;
+ GtkComboBoxText* _tmp33_;
+#line 188 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_return_if_fail (IS_ADJUST_DATE_TIME_DIALOG (self));
+#line 188 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_return_if_fail (time != NULL);
+#line 189 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp0_ = self->priv->calendar;
+#line 189 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp1_ = *time;
+#line 189 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp2_ = _tmp1_.tm_mon;
+#line 189 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp3_ = *time;
+#line 189 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp4_ = _tmp3_.tm_year;
+#line 189 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_calendar_select_month (_tmp0_, (guint) _tmp2_, (guint) (_tmp4_ + ADJUST_DATE_TIME_DIALOG_YEAR_OFFSET));
+#line 190 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp5_ = self->priv->calendar;
+#line 190 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp6_ = *time;
+#line 190 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp7_ = _tmp6_.tm_mday;
+#line 190 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_calendar_select_day (_tmp5_, (guint) _tmp7_);
+#line 191 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp8_ = self->priv->calendar;
+#line 191 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_object_notify (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, G_TYPE_OBJECT, GObject), "year");
+#line 192 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp9_ = self->priv->calendar;
+#line 192 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_object_notify (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, G_TYPE_OBJECT, GObject), "month");
+#line 194 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp10_ = config_facade_get_instance ();
+#line 194 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp11_ = _tmp10_;
+#line 194 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp12_ = configuration_facade_get_use_24_hour_time (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
+#line 194 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (_tmp11_);
+#line 194 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ if (_tmp12_) {
+#line 1454 "AdjustDateTimeDialog.c"
+ GtkComboBoxText* _tmp13_;
+ GtkSpinButton* _tmp14_;
+ struct tm _tmp15_;
+ gint _tmp16_;
+#line 195 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp13_ = self->priv->system;
+#line 195 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_combo_box_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, gtk_combo_box_get_type (), GtkComboBox), (gint) ADJUST_DATE_TIME_DIALOG_TIME_SYSTEM_24HR);
+#line 196 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp14_ = self->priv->hour;
+#line 196 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp15_ = *time;
+#line 196 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp16_ = _tmp15_.tm_hour;
+#line 196 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_spin_button_set_value (_tmp14_, (gdouble) _tmp16_);
+#line 1471 "AdjustDateTimeDialog.c"
+ } else {
+ gint AMPM_hour = 0;
+ struct tm _tmp17_;
+ gint _tmp18_;
+ gint _tmp19_ = 0;
+ gint _tmp20_;
+ GtkSpinButton* _tmp22_;
+ AdjustDateTimeDialogTimeSystem _tmp23_ = 0;
+ struct tm _tmp24_;
+ gint _tmp25_;
+ GtkComboBoxText* _tmp26_;
+#line 198 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp17_ = *time;
+#line 198 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp18_ = _tmp17_.tm_hour;
+#line 198 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ AMPM_hour = _tmp18_ % 12;
+#line 199 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp20_ = AMPM_hour;
+#line 199 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ if (_tmp20_ == 0) {
+#line 199 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp19_ = 12;
+#line 1495 "AdjustDateTimeDialog.c"
+ } else {
+ gint _tmp21_;
+#line 199 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp21_ = AMPM_hour;
+#line 199 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp19_ = _tmp21_;
+#line 1502 "AdjustDateTimeDialog.c"
+ }
+#line 199 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp22_ = self->priv->hour;
+#line 199 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_spin_button_set_value (_tmp22_, (gdouble) _tmp19_);
+#line 200 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp24_ = *time;
+#line 200 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp25_ = _tmp24_.tm_hour;
+#line 200 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ if (_tmp25_ >= 12) {
+#line 200 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp23_ = ADJUST_DATE_TIME_DIALOG_TIME_SYSTEM_PM;
+#line 1516 "AdjustDateTimeDialog.c"
+ } else {
+#line 200 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp23_ = ADJUST_DATE_TIME_DIALOG_TIME_SYSTEM_AM;
+#line 1520 "AdjustDateTimeDialog.c"
+ }
+#line 200 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp26_ = self->priv->system;
+#line 200 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_combo_box_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp26_, gtk_combo_box_get_type (), GtkComboBox), (gint) _tmp23_);
+#line 1526 "AdjustDateTimeDialog.c"
+ }
+#line 203 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp27_ = self->priv->minute;
+#line 203 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp28_ = *time;
+#line 203 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp29_ = _tmp28_.tm_min;
+#line 203 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_spin_button_set_value (_tmp27_, (gdouble) _tmp29_);
+#line 204 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp30_ = self->priv->second;
+#line 204 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp31_ = *time;
+#line 204 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp32_ = _tmp31_.tm_sec;
+#line 204 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_spin_button_set_value (_tmp30_, (gdouble) _tmp32_);
+#line 206 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp33_ = self->priv->system;
+#line 206 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ self->priv->previous_time_system = (AdjustDateTimeDialogTimeSystem) gtk_combo_box_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp33_, gtk_combo_box_get_type (), GtkComboBox));
+#line 1548 "AdjustDateTimeDialog.c"
+}
+
+
+static void
+adjust_date_time_dialog_set_original_time_label (AdjustDateTimeDialog* self,
+ gboolean use_24_hr_format)
+{
+ gboolean _tmp0_;
+ const gchar* _tmp1_ = NULL;
+ GtkLabel* _tmp2_;
+ time_t _tmp3_;
+ struct tm _tmp4_ = {0};
+ gchar* _tmp5_;
+ gchar* _tmp6_;
+ gchar* _tmp7_;
+ gchar* _tmp8_;
+#line 209 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_return_if_fail (IS_ADJUST_DATE_TIME_DIALOG (self));
+#line 210 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp0_ = self->priv->no_original_time;
+#line 210 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ if (_tmp0_) {
+#line 211 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ return;
+#line 1573 "AdjustDateTimeDialog.c"
+ }
+#line 214 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ if (use_24_hr_format) {
+#line 214 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp1_ = _ ("%m/%d/%Y, %H:%M:%S");
+#line 1579 "AdjustDateTimeDialog.c"
+ } else {
+#line 215 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp1_ = _ ("%m/%d/%Y, %I:%M:%S %p");
+#line 1583 "AdjustDateTimeDialog.c"
+ }
+#line 213 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp2_ = self->priv->original_time_label;
+#line 213 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp3_ = self->priv->original_time;
+#line 213 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_time_local (_tmp3_, &_tmp4_);
+#line 213 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp5_ = g_time_format (&_tmp4_, _tmp1_);
+#line 213 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp6_ = _tmp5_;
+#line 213 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp7_ = g_strconcat (_ ("Original: "), _tmp6_, NULL);
+#line 213 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp8_ = _tmp7_;
+#line 213 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_label_set_text (_tmp2_, _tmp8_);
+#line 213 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_free0 (_tmp8_);
+#line 213 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_free0 (_tmp6_);
+#line 1605 "AdjustDateTimeDialog.c"
+}
+
+
+static time_t
+adjust_date_time_dialog_get_time (AdjustDateTimeDialog* self)
+{
+ time_t result = 0;
+ struct tm time = {0};
+ GtkSpinButton* _tmp0_;
+ GtkSpinButton* _tmp1_;
+ gint hour = 0;
+ GtkSpinButton* _tmp2_;
+ gint _tmp3_ = 0;
+ gboolean _tmp4_ = FALSE;
+ gint _tmp5_;
+ gint _tmp8_ = 0;
+ GtkComboBoxText* _tmp9_;
+ gint _tmp10_;
+ guint year = 0U;
+ guint month = 0U;
+ guint day = 0U;
+ GtkCalendar* _tmp11_;
+ guint _tmp12_ = 0U;
+ guint _tmp13_ = 0U;
+ guint _tmp14_ = 0U;
+#line 218 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_return_val_if_fail (IS_ADJUST_DATE_TIME_DIALOG (self), 0);
+#line 219 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ memset (&time, 0, sizeof (struct tm));
+#line 221 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp0_ = self->priv->second;
+#line 221 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ time.tm_sec = (gint) gtk_spin_button_get_value (_tmp0_);
+#line 222 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp1_ = self->priv->minute;
+#line 222 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ time.tm_min = (gint) gtk_spin_button_get_value (_tmp1_);
+#line 225 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp2_ = self->priv->hour;
+#line 225 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ hour = (gint) gtk_spin_button_get_value (_tmp2_);
+#line 226 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp5_ = hour;
+#line 226 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ if (_tmp5_ == 12) {
+#line 1651 "AdjustDateTimeDialog.c"
+ GtkComboBoxText* _tmp6_;
+#line 226 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp6_ = self->priv->system;
+#line 226 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp4_ = gtk_combo_box_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, gtk_combo_box_get_type (), GtkComboBox)) != ((gint) ADJUST_DATE_TIME_DIALOG_TIME_SYSTEM_24HR);
+#line 1657 "AdjustDateTimeDialog.c"
+ } else {
+#line 226 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp4_ = FALSE;
+#line 1661 "AdjustDateTimeDialog.c"
+ }
+#line 226 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ if (_tmp4_) {
+#line 226 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp3_ = 0;
+#line 1667 "AdjustDateTimeDialog.c"
+ } else {
+ gint _tmp7_;
+#line 226 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp7_ = hour;
+#line 226 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp3_ = _tmp7_;
+#line 1674 "AdjustDateTimeDialog.c"
+ }
+#line 226 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ time.tm_hour = _tmp3_;
+#line 227 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp9_ = self->priv->system;
+#line 227 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ if (gtk_combo_box_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, gtk_combo_box_get_type (), GtkComboBox)) == ((gint) ADJUST_DATE_TIME_DIALOG_TIME_SYSTEM_PM)) {
+#line 227 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp8_ = 12;
+#line 1684 "AdjustDateTimeDialog.c"
+ } else {
+#line 227 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp8_ = 0;
+#line 1688 "AdjustDateTimeDialog.c"
+ }
+#line 227 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp10_ = time.tm_hour;
+#line 227 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ time.tm_hour = _tmp10_ + _tmp8_;
+#line 230 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp11_ = self->priv->calendar;
+#line 230 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_calendar_get_date (_tmp11_, &_tmp12_, &_tmp13_, &_tmp14_);
+#line 230 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ year = _tmp12_;
+#line 230 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ month = _tmp13_;
+#line 230 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ day = _tmp14_;
+#line 231 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ time.tm_year = ((gint) year) - ADJUST_DATE_TIME_DIALOG_YEAR_OFFSET;
+#line 232 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ time.tm_mon = (gint) month;
+#line 233 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ time.tm_mday = (gint) day;
+#line 235 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ time.tm_isdst = -1;
+#line 237 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ result = mktime (&time);
+#line 237 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ return result;
+#line 1716 "AdjustDateTimeDialog.c"
+}
+
+
+gboolean
+adjust_date_time_dialog_execute (AdjustDateTimeDialog* self,
+ gint64* time_shift,
+ gboolean* keep_relativity,
+ gboolean* modify_originals)
+{
+ gint64 _vala_time_shift = 0LL;
+ gboolean _vala_keep_relativity = FALSE;
+ gboolean _vala_modify_originals = FALSE;
+ gboolean result = FALSE;
+ gboolean response = FALSE;
+#line 240 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_return_val_if_fail (IS_ADJUST_DATE_TIME_DIALOG (self), FALSE);
+#line 242 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_widget_show_all (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
+#line 244 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ response = FALSE;
+#line 246 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ if (gtk_dialog_run (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_dialog_get_type (), GtkDialog)) == ((gint) GTK_RESPONSE_OK)) {
+#line 1739 "AdjustDateTimeDialog.c"
+ gboolean _tmp0_;
+ GtkRadioButton* _tmp2_;
+ GtkRadioButton* _tmp3_;
+ gboolean _tmp4_;
+ gboolean _tmp5_;
+ GtkCheckButton* _tmp9_;
+ GtkCheckButton* _tmp10_;
+ gboolean _tmp11_;
+ gboolean _tmp12_;
+#line 247 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp0_ = self->priv->no_original_time;
+#line 247 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ if (_tmp0_) {
+#line 248 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _vala_time_shift = (gint64) adjust_date_time_dialog_get_time (self);
+#line 1755 "AdjustDateTimeDialog.c"
+ } else {
+ time_t _tmp1_;
+#line 250 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp1_ = self->priv->original_time;
+#line 250 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _vala_time_shift = (gint64) (adjust_date_time_dialog_get_time (self) - _tmp1_);
+#line 1762 "AdjustDateTimeDialog.c"
+ }
+#line 252 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp2_ = self->priv->relativity_radio_button;
+#line 252 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _vala_keep_relativity = gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_toggle_button_get_type (), GtkToggleButton));
+#line 254 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp3_ = self->priv->relativity_radio_button;
+#line 254 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp4_ = gtk_widget_get_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_widget_get_type (), GtkWidget));
+#line 254 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp5_ = _tmp4_;
+#line 254 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ if (_tmp5_) {
+#line 1776 "AdjustDateTimeDialog.c"
+ ConfigFacade* _tmp6_;
+ ConfigFacade* _tmp7_;
+ gboolean _tmp8_;
+#line 255 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp6_ = config_facade_get_instance ();
+#line 255 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp7_ = _tmp6_;
+#line 255 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp8_ = _vala_keep_relativity;
+#line 255 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ configuration_facade_set_keep_relativity (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), _tmp8_);
+#line 255 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (_tmp7_);
+#line 1790 "AdjustDateTimeDialog.c"
+ }
+#line 257 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp9_ = self->priv->modify_originals_check_button;
+#line 257 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _vala_modify_originals = gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, gtk_toggle_button_get_type (), GtkToggleButton));
+#line 259 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp10_ = self->priv->modify_originals_check_button;
+#line 259 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp11_ = gtk_widget_get_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, gtk_widget_get_type (), GtkWidget));
+#line 259 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp12_ = _tmp11_;
+#line 259 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ if (_tmp12_) {
+#line 1804 "AdjustDateTimeDialog.c"
+ ConfigFacade* _tmp13_;
+ ConfigFacade* _tmp14_;
+ gboolean _tmp15_;
+#line 260 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp13_ = config_facade_get_instance ();
+#line 260 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp14_ = _tmp13_;
+#line 260 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp15_ = _vala_modify_originals;
+#line 260 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ configuration_facade_set_modify_originals (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), _tmp15_);
+#line 260 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (_tmp14_);
+#line 1818 "AdjustDateTimeDialog.c"
+ }
+#line 262 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ response = TRUE;
+#line 1822 "AdjustDateTimeDialog.c"
+ } else {
+#line 264 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _vala_time_shift = (gint64) 0;
+#line 265 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _vala_keep_relativity = TRUE;
+#line 266 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _vala_modify_originals = FALSE;
+#line 1830 "AdjustDateTimeDialog.c"
+ }
+#line 269 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_widget_destroy (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
+#line 271 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ result = response;
+#line 271 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ if (time_shift) {
+#line 271 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ *time_shift = _vala_time_shift;
+#line 1840 "AdjustDateTimeDialog.c"
+ }
+#line 271 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ if (keep_relativity) {
+#line 271 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ *keep_relativity = _vala_keep_relativity;
+#line 1846 "AdjustDateTimeDialog.c"
+ }
+#line 271 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ if (modify_originals) {
+#line 271 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ *modify_originals = _vala_modify_originals;
+#line 1852 "AdjustDateTimeDialog.c"
+ }
+#line 271 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ return result;
+#line 1856 "AdjustDateTimeDialog.c"
+}
+
+
+static gboolean
+adjust_date_time_dialog_on_spin_button_output (AdjustDateTimeDialog* self,
+ GtkSpinButton* button)
+{
+ gboolean result = FALSE;
+ gchar* _tmp0_;
+ gchar* _tmp1_;
+#line 274 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_return_val_if_fail (IS_ADJUST_DATE_TIME_DIALOG (self), FALSE);
+#line 274 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_return_val_if_fail (GTK_IS_SPIN_BUTTON (button), FALSE);
+#line 275 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp0_ = g_strdup_printf ("%02d", (gint) gtk_spin_button_get_value (button));
+#line 275 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp1_ = _tmp0_;
+#line 275 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_entry_set_text (G_TYPE_CHECK_INSTANCE_CAST (button, gtk_entry_get_type (), GtkEntry), _tmp1_);
+#line 275 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_free0 (_tmp1_);
+#line 277 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ adjust_date_time_dialog_on_time_changed (self);
+#line 279 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ result = TRUE;
+#line 279 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ return result;
+#line 1885 "AdjustDateTimeDialog.c"
+}
+
+
+static void
+adjust_date_time_dialog_on_time_changed (AdjustDateTimeDialog* self)
+{
+ gint64 time_shift = 0LL;
+ time_t _tmp0_;
+ GtkCalendar* _tmp1_;
+ GtkCalendar* _tmp2_;
+ GtkComboBoxText* _tmp3_;
+ gboolean _tmp4_ = FALSE;
+ gboolean _tmp5_ = FALSE;
+ gint64 _tmp6_;
+#line 282 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_return_if_fail (IS_ADJUST_DATE_TIME_DIALOG (self));
+#line 283 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp0_ = self->priv->original_time;
+#line 283 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ time_shift = ((gint64) adjust_date_time_dialog_get_time (self)) - ((gint64) _tmp0_);
+#line 284 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp1_ = self->priv->calendar;
+#line 284 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_object_notify (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, G_TYPE_OBJECT, GObject), "year");
+#line 285 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp2_ = self->priv->calendar;
+#line 285 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_object_notify (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, G_TYPE_OBJECT, GObject), "month");
+#line 287 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp3_ = self->priv->system;
+#line 287 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ self->priv->previous_time_system = (AdjustDateTimeDialogTimeSystem) gtk_combo_box_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_combo_box_get_type (), GtkComboBox));
+#line 289 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp6_ = time_shift;
+#line 289 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ if (_tmp6_ == ((gint64) 0)) {
+#line 289 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp5_ = TRUE;
+#line 1924 "AdjustDateTimeDialog.c"
+ } else {
+ gboolean _tmp7_;
+#line 289 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp7_ = self->priv->no_original_time;
+#line 289 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp5_ = _tmp7_;
+#line 1931 "AdjustDateTimeDialog.c"
+ }
+#line 289 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ if (_tmp5_) {
+#line 289 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp4_ = TRUE;
+#line 1937 "AdjustDateTimeDialog.c"
+ } else {
+ gboolean _tmp8_ = FALSE;
+ GtkRadioButton* _tmp9_;
+#line 289 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp9_ = self->priv->batch_radio_button;
+#line 289 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ if (gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, gtk_toggle_button_get_type (), GtkToggleButton))) {
+#line 1945 "AdjustDateTimeDialog.c"
+ GtkRadioButton* _tmp10_;
+ gboolean _tmp11_;
+ gboolean _tmp12_;
+#line 290 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp10_ = self->priv->batch_radio_button;
+#line 290 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp11_ = gtk_widget_get_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, gtk_widget_get_type (), GtkWidget));
+#line 290 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp12_ = _tmp11_;
+#line 290 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp8_ = _tmp12_;
+#line 1957 "AdjustDateTimeDialog.c"
+ } else {
+#line 289 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp8_ = FALSE;
+#line 1961 "AdjustDateTimeDialog.c"
+ }
+#line 289 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp4_ = _tmp8_;
+#line 1965 "AdjustDateTimeDialog.c"
+ }
+#line 289 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ if (_tmp4_) {
+#line 1969 "AdjustDateTimeDialog.c"
+ GtkLabel* _tmp13_;
+#line 291 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp13_ = self->priv->notification;
+#line 291 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_widget_hide (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, gtk_widget_get_type (), GtkWidget));
+#line 1975 "AdjustDateTimeDialog.c"
+ } else {
+ gboolean forward = FALSE;
+ gint64 _tmp14_;
+ gint days = 0;
+ gint hours = 0;
+ gint minutes = 0;
+ gint seconds = 0;
+ gint64 _tmp15_;
+ gint64 _tmp16_;
+ gint64 _tmp17_;
+ gint64 _tmp18_;
+ gint64 _tmp19_;
+ gint64 _tmp20_;
+ gint64 _tmp21_;
+ const gchar* _tmp22_ = NULL;
+ gboolean _tmp23_;
+ gchar* shift_status = NULL;
+ gchar* _tmp24_;
+ GtkLabel* _tmp25_;
+ const gchar* _tmp26_;
+ gint _tmp27_;
+ gint _tmp28_;
+ gint _tmp29_;
+ gint _tmp30_;
+ gint _tmp31_;
+ gint _tmp32_;
+ gint _tmp33_;
+ gint _tmp34_;
+ gchar* _tmp35_;
+ gchar* _tmp36_;
+ GtkLabel* _tmp37_;
+#line 293 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp14_ = time_shift;
+#line 293 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ forward = _tmp14_ > ((gint64) 0);
+#line 296 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp15_ = time_shift;
+#line 296 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ time_shift = llabs (_tmp15_);
+#line 298 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp16_ = time_shift;
+#line 298 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ days = (gint) (_tmp16_ / ADJUST_DATE_TIME_DIALOG_SECONDS_IN_DAY);
+#line 299 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp17_ = time_shift;
+#line 299 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ time_shift = _tmp17_ % ADJUST_DATE_TIME_DIALOG_SECONDS_IN_DAY;
+#line 300 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp18_ = time_shift;
+#line 300 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ hours = (gint) (_tmp18_ / ADJUST_DATE_TIME_DIALOG_SECONDS_IN_HOUR);
+#line 301 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp19_ = time_shift;
+#line 301 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ time_shift = _tmp19_ % ADJUST_DATE_TIME_DIALOG_SECONDS_IN_HOUR;
+#line 302 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp20_ = time_shift;
+#line 302 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ minutes = (gint) (_tmp20_ / ADJUST_DATE_TIME_DIALOG_SECONDS_IN_MINUTE);
+#line 303 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp21_ = time_shift;
+#line 303 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ seconds = (gint) (_tmp21_ % ADJUST_DATE_TIME_DIALOG_SECONDS_IN_MINUTE);
+#line 305 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp23_ = forward;
+#line 305 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ if (_tmp23_) {
+#line 306 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp22_ = _ ("Exposure time will be shifted forward by\n" \
+"%d %s, %d %s, %d %s, and %d %s.");
+#line 2045 "AdjustDateTimeDialog.c"
+ } else {
+#line 307 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp22_ = _ ("Exposure time will be shifted backward by\n" \
+"%d %s, %d %s, %d %s, and %d %s.");
+#line 2049 "AdjustDateTimeDialog.c"
+ }
+#line 305 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp24_ = g_strdup (_tmp22_);
+#line 305 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ shift_status = _tmp24_;
+#line 309 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp25_ = self->priv->notification;
+#line 309 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp26_ = shift_status;
+#line 309 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp27_ = days;
+#line 309 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp28_ = days;
+#line 309 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp29_ = hours;
+#line 309 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp30_ = hours;
+#line 309 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp31_ = minutes;
+#line 309 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp32_ = minutes;
+#line 309 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp33_ = seconds;
+#line 309 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp34_ = seconds;
+#line 309 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp35_ = g_strdup_printf (_tmp26_, _tmp27_, ngettext ("day", "days", (gulong) _tmp28_), _tmp29_, ngettext ("hour", "hours", (gulong) _tmp30_), _tmp31_, ngettext ("minute", "minutes", (gulong) _tmp32_), _tmp33_, ngettext ("second", "seconds", (gulong) _tmp34_));
+#line 309 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp36_ = _tmp35_;
+#line 309 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_label_set_text (_tmp25_, _tmp36_);
+#line 309 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_free0 (_tmp36_);
+#line 314 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp37_ = self->priv->notification;
+#line 314 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_widget_show (G_TYPE_CHECK_INSTANCE_CAST (_tmp37_, gtk_widget_get_type (), GtkWidget));
+#line 289 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_free0 (shift_status);
+#line 2089 "AdjustDateTimeDialog.c"
+ }
+}
+
+
+static void
+adjust_date_time_dialog_on_time_system_changed (AdjustDateTimeDialog* self)
+{
+ AdjustDateTimeDialogTimeSystem _tmp0_;
+ GtkComboBoxText* _tmp1_;
+ ConfigFacade* _tmp2_;
+ ConfigFacade* _tmp3_;
+ GtkComboBoxText* _tmp4_;
+ GtkComboBoxText* _tmp5_;
+#line 318 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_return_if_fail (IS_ADJUST_DATE_TIME_DIALOG (self));
+#line 319 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp0_ = self->priv->previous_time_system;
+#line 319 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp1_ = self->priv->system;
+#line 319 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ if (_tmp0_ == gtk_combo_box_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_combo_box_get_type (), GtkComboBox))) {
+#line 320 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ return;
+#line 2113 "AdjustDateTimeDialog.c"
+ }
+#line 322 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp2_ = config_facade_get_instance ();
+#line 322 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp3_ = _tmp2_;
+#line 322 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp4_ = self->priv->system;
+#line 322 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ configuration_facade_set_use_24_hour_time (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), gtk_combo_box_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_combo_box_get_type (), GtkComboBox)) == ((gint) ADJUST_DATE_TIME_DIALOG_TIME_SYSTEM_24HR));
+#line 322 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (_tmp3_);
+#line 324 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp5_ = self->priv->system;
+#line 324 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ if (gtk_combo_box_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, gtk_combo_box_get_type (), GtkComboBox)) == ((gint) ADJUST_DATE_TIME_DIALOG_TIME_SYSTEM_24HR)) {
+#line 2129 "AdjustDateTimeDialog.c"
+ gint _tmp6_ = 0;
+ GtkSpinButton* _tmp7_;
+ gint time = 0;
+ gint _tmp9_ = 0;
+ AdjustDateTimeDialogTimeSystem _tmp10_;
+ gint _tmp11_;
+ GtkSpinButton* _tmp12_;
+ GtkSpinButton* _tmp13_;
+ gint _tmp14_;
+#line 325 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp7_ = self->priv->hour;
+#line 325 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ if (gtk_spin_button_get_value (_tmp7_) == 12.0) {
+#line 325 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp6_ = 0;
+#line 2145 "AdjustDateTimeDialog.c"
+ } else {
+ GtkSpinButton* _tmp8_;
+#line 325 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp8_ = self->priv->hour;
+#line 325 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp6_ = (gint) gtk_spin_button_get_value (_tmp8_);
+#line 2152 "AdjustDateTimeDialog.c"
+ }
+#line 325 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ time = _tmp6_;
+#line 326 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp10_ = self->priv->previous_time_system;
+#line 326 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ if (_tmp10_ == ADJUST_DATE_TIME_DIALOG_TIME_SYSTEM_PM) {
+#line 326 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp9_ = 12;
+#line 2162 "AdjustDateTimeDialog.c"
+ } else {
+#line 326 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp9_ = 0;
+#line 2166 "AdjustDateTimeDialog.c"
+ }
+#line 326 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp11_ = time;
+#line 326 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ time = _tmp11_ + _tmp9_;
+#line 328 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp12_ = self->priv->hour;
+#line 328 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_spin_button_set_range (_tmp12_, (gdouble) 0, (gdouble) 23);
+#line 329 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ adjust_date_time_dialog_set_original_time_label (self, TRUE);
+#line 331 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp13_ = self->priv->hour;
+#line 331 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp14_ = time;
+#line 331 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_spin_button_set_value (_tmp13_, (gdouble) _tmp14_);
+#line 2184 "AdjustDateTimeDialog.c"
+ } else {
+ gint AMPM_hour = 0;
+ GtkSpinButton* _tmp15_;
+ GtkSpinButton* _tmp16_;
+ gint _tmp17_ = 0;
+ gint _tmp18_;
+ GtkSpinButton* _tmp20_;
+#line 333 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp15_ = self->priv->hour;
+#line 333 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ AMPM_hour = ((gint) gtk_spin_button_get_value (_tmp15_)) % 12;
+#line 335 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp16_ = self->priv->hour;
+#line 335 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_spin_button_set_range (_tmp16_, (gdouble) 1, (gdouble) 12);
+#line 336 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ adjust_date_time_dialog_set_original_time_label (self, FALSE);
+#line 338 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp18_ = AMPM_hour;
+#line 338 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ if (_tmp18_ == 0) {
+#line 338 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp17_ = 12;
+#line 2208 "AdjustDateTimeDialog.c"
+ } else {
+ gint _tmp19_;
+#line 338 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp19_ = AMPM_hour;
+#line 338 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp17_ = _tmp19_;
+#line 2215 "AdjustDateTimeDialog.c"
+ }
+#line 338 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _tmp20_ = self->priv->hour;
+#line 338 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ gtk_spin_button_set_value (_tmp20_, (gdouble) _tmp17_);
+#line 2221 "AdjustDateTimeDialog.c"
+ }
+#line 341 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ adjust_date_time_dialog_on_time_changed (self);
+#line 2225 "AdjustDateTimeDialog.c"
+}
+
+
+static void
+adjust_date_time_dialog_class_init (AdjustDateTimeDialogClass * klass)
+{
+#line 8 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ adjust_date_time_dialog_parent_class = g_type_class_peek_parent (klass);
+#line 8 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ g_type_class_add_private (klass, sizeof (AdjustDateTimeDialogPrivate));
+#line 8 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ G_OBJECT_CLASS (klass)->finalize = adjust_date_time_dialog_finalize;
+#line 2238 "AdjustDateTimeDialog.c"
+}
+
+
+static void
+adjust_date_time_dialog_instance_init (AdjustDateTimeDialog * self)
+{
+#line 8 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ self->priv = ADJUST_DATE_TIME_DIALOG_GET_PRIVATE (self);
+#line 13 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ self->priv->no_original_time = FALSE;
+#line 2249 "AdjustDateTimeDialog.c"
+}
+
+
+static void
+adjust_date_time_dialog_finalize (GObject * obj)
+{
+ AdjustDateTimeDialog * self;
+#line 8 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_ADJUST_DATE_TIME_DIALOG, AdjustDateTimeDialog);
+#line 18 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (self->priv->original_time_label);
+#line 19 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (self->priv->calendar);
+#line 20 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (self->priv->hour);
+#line 21 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (self->priv->minute);
+#line 22 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (self->priv->second);
+#line 23 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (self->priv->system);
+#line 24 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (self->priv->relativity_radio_button);
+#line 25 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (self->priv->batch_radio_button);
+#line 26 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (self->priv->modify_originals_check_button);
+#line 27 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ _g_object_unref0 (self->priv->notification);
+#line 8 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala"
+ G_OBJECT_CLASS (adjust_date_time_dialog_parent_class)->finalize (obj);
+#line 2281 "AdjustDateTimeDialog.c"
+}
+
+
+GType
+adjust_date_time_dialog_get_type (void)
+{
+ static volatile gsize adjust_date_time_dialog_type_id__volatile = 0;
+ if (g_once_init_enter (&adjust_date_time_dialog_type_id__volatile)) {
+ static const GTypeInfo g_define_type_info = { sizeof (AdjustDateTimeDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) adjust_date_time_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (AdjustDateTimeDialog), 0, (GInstanceInitFunc) adjust_date_time_dialog_instance_init, NULL };
+ GType adjust_date_time_dialog_type_id;
+ adjust_date_time_dialog_type_id = g_type_register_static (gtk_dialog_get_type (), "AdjustDateTimeDialog", &g_define_type_info, 0);
+ g_once_init_leave (&adjust_date_time_dialog_type_id__volatile, adjust_date_time_dialog_type_id);
+ }
+ return adjust_date_time_dialog_type_id__volatile;
+}
+
+
+
diff --git a/src/dialogs/AdjustDateTimeDialog.vala b/src/dialogs/AdjustDateTimeDialog.vala
new file mode 100644
index 0000000..cf2685b
--- /dev/null
+++ b/src/dialogs/AdjustDateTimeDialog.vala
@@ -0,0 +1,343 @@
+/* Copyright 2016 Software Freedom Conservancy Inc.
+ * Copyright 2017 Jens Georg <mail@jensge.org>
+ *
+ * This software is licensed under the GNU LGPL (version 2.1 or later).
+ * See the COPYING file in this distribution.
+ */
+
+public class AdjustDateTimeDialog : Gtk.Dialog {
+ private const int64 SECONDS_IN_DAY = 60 * 60 * 24;
+ private const int64 SECONDS_IN_HOUR = 60 * 60;
+ private const int64 SECONDS_IN_MINUTE = 60;
+ private const int YEAR_OFFSET = 1900;
+ private bool no_original_time = false;
+
+ private const int CALENDAR_THUMBNAIL_SCALE = 1;
+
+ time_t original_time;
+ Gtk.Label original_time_label;
+ Gtk.Calendar calendar;
+ Gtk.SpinButton hour;
+ Gtk.SpinButton minute;
+ Gtk.SpinButton second;
+ Gtk.ComboBoxText system;
+ Gtk.RadioButton relativity_radio_button;
+ Gtk.RadioButton batch_radio_button;
+ Gtk.CheckButton modify_originals_check_button;
+ Gtk.Label notification;
+
+ private enum TimeSystem {
+ AM,
+ PM,
+ 24HR;
+ }
+
+ TimeSystem previous_time_system;
+
+ public AdjustDateTimeDialog(Dateable source, int photo_count, bool display_options = true,
+ bool contains_video = false, bool only_video = false) {
+ assert(source != null);
+
+ Object(use_header_bar: Resources.use_header_bar());
+
+ set_modal(true);
+ set_resizable(false);
+ set_transient_for(AppWindow.get_instance());
+
+ add_buttons(Resources.CANCEL_LABEL, Gtk.ResponseType.CANCEL,
+ Resources.OK_LABEL, Gtk.ResponseType.OK);
+ set_title(Resources.ADJUST_DATE_TIME_LABEL);
+
+ calendar = new Gtk.Calendar();
+ calendar.show_heading = false;
+ calendar.day_selected.connect(on_time_changed);
+ calendar.month_changed.connect(on_time_changed);
+ calendar.next_year.connect(on_time_changed);
+ calendar.prev_year.connect(on_time_changed);
+
+ if (Config.Facade.get_instance().get_use_24_hour_time())
+ hour = new Gtk.SpinButton.with_range(0, 23, 1);
+ else
+ hour = new Gtk.SpinButton.with_range(1, 12, 1);
+
+ hour.output.connect(on_spin_button_output);
+ hour.set_width_chars(2);
+ hour.set_max_width_chars(2);
+
+ minute = new Gtk.SpinButton.with_range(0, 59, 1);
+ minute.set_width_chars(2);
+ minute.set_max_width_chars(2);
+ minute.output.connect(on_spin_button_output);
+
+ second = new Gtk.SpinButton.with_range(0, 59, 1);
+ second.set_width_chars(2);
+ second.set_max_width_chars(2);
+ second.output.connect(on_spin_button_output);
+
+ system = new Gtk.ComboBoxText();
+ system.append_text(_("AM"));
+ system.append_text(_("PM"));
+ system.append_text(_("24 Hr"));
+ system.changed.connect(on_time_system_changed);
+
+ Gtk.Box clock = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 3);
+
+ clock.pack_start(hour, false, false, 0);
+ clock.pack_start(new Gtk.Label(":"), false, false, 0); // internationalize?
+ clock.pack_start(minute, false, false, 0);
+ clock.pack_start(new Gtk.Label(":"), false, false, 0);
+ clock.pack_start(second, false, false, 0);
+ clock.pack_start(system, false, false, 0);
+
+ set_default_response(Gtk.ResponseType.OK);
+
+ relativity_radio_button = new Gtk.RadioButton.with_mnemonic(null,
+ _("_Shift photos/videos by the same amount"));
+ relativity_radio_button.set_active(Config.Facade.get_instance().get_keep_relativity());
+ relativity_radio_button.sensitive = display_options && photo_count > 1;
+
+ batch_radio_button = new Gtk.RadioButton.with_mnemonic(relativity_radio_button.get_group(),
+ _("Set _all photos/videos to this time"));
+ batch_radio_button.set_active(!Config.Facade.get_instance().get_keep_relativity());
+ batch_radio_button.sensitive = display_options && photo_count > 1;
+ batch_radio_button.toggled.connect(on_time_changed);
+
+ if (contains_video) {
+ var text = ngettext ("_Modify original photo file", "_Modify original photo files",
+ photo_count);
+ modify_originals_check_button = new Gtk.CheckButton.with_mnemonic(text);
+ } else {
+ var text = ngettext ("_Modify original file", "_Modify original files", photo_count);
+ modify_originals_check_button = new Gtk.CheckButton.with_mnemonic(text);
+ }
+
+ modify_originals_check_button.set_active(Config.Facade.get_instance().get_commit_metadata_to_masters() &&
+ display_options);
+ modify_originals_check_button.sensitive = (!only_video) &&
+ (!Config.Facade.get_instance().get_commit_metadata_to_masters() && display_options);
+
+ Gtk.Box time_content = new Gtk.Box(Gtk.Orientation.VERTICAL, 5);
+
+ var picker = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 5);
+ var combo = new Gtk.ComboBoxText();
+ for (int i = 0; i < 12; i++){
+ combo.append_text(Time.gm((i * 2764800)).format("%B"));
+ }
+ picker.pack_start(combo, false, false, 0);
+ // Limits taken from GtkCalendar
+ var spin = new Gtk.SpinButton.with_range(0, int.MAX >> 9, 1);
+ picker.pack_end(spin, false, false, 0);
+ spin.bind_property("value", calendar, "year", GLib.BindingFlags.BIDIRECTIONAL);
+ combo.bind_property("active", calendar, "month", GLib.BindingFlags.BIDIRECTIONAL);
+
+ time_content.pack_start(picker, false, false, 0);
+ time_content.pack_start(calendar, true, false, 0);
+ time_content.pack_start(clock, true, false, 0);
+
+ if (display_options) {
+ time_content.pack_start(relativity_radio_button, true, false, 0);
+ time_content.pack_start(batch_radio_button, true, false, 0);
+ time_content.pack_start(modify_originals_check_button, true, false, 0);
+ }
+
+ Gdk.Pixbuf preview = null;
+ try {
+ // Instead of calling get_pixbuf() here, we use the thumbnail instead;
+ // this was needed for Videos, since they don't support get_pixbuf().
+ preview = source.get_thumbnail(CALENDAR_THUMBNAIL_SCALE);
+ } catch (Error err) {
+ warning("Unable to fetch preview for %s", source.to_string());
+ }
+
+ Gtk.Box image_content = new Gtk.Box(Gtk.Orientation.VERTICAL, 0);
+ image_content.set_valign(Gtk.Align.START);
+ image_content.set_homogeneous(true);
+ Gtk.Image image = (preview != null) ? new Gtk.Image.from_pixbuf(preview) : new Gtk.Image();
+ original_time_label = new Gtk.Label(null);
+ image_content.pack_start(image, true, false, 0);
+ image_content.pack_start(original_time_label, true, false, 0);
+
+ Gtk.Box hbox = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 10);
+ hbox.set_border_width(3);
+ hbox.pack_start(image_content, true, false, 0);
+ hbox.pack_start(time_content, true, false, 0);
+ hbox.halign = Gtk.Align.CENTER;
+ hbox.valign = Gtk.Align.CENTER;
+ hbox.hexpand = false;
+ hbox.vexpand = false;
+
+ ((Gtk.Box) get_content_area()).pack_start(hbox, true, false, 0);
+
+ notification = new Gtk.Label("");
+ notification.set_line_wrap(true);
+ notification.set_justify(Gtk.Justification.CENTER);
+
+ ((Gtk.Box) get_content_area()).pack_start(notification, true, true, 0);
+
+ original_time = source.get_exposure_time();
+
+ if (original_time == 0) {
+ original_time = time_t();
+ no_original_time = true;
+ }
+
+ set_time(Time.local(original_time));
+ set_original_time_label(Config.Facade.get_instance().get_use_24_hour_time());
+ }
+
+ private void set_time(Time time) {
+ calendar.select_month(time.month, time.year + YEAR_OFFSET);
+ calendar.select_day(time.day);
+ calendar.notify_property("year");
+ calendar.notify_property("month");
+
+ if (Config.Facade.get_instance().get_use_24_hour_time()) {
+ system.set_active(TimeSystem.24HR);
+ hour.set_value(time.hour);
+ } else {
+ int AMPM_hour = time.hour % 12;
+ hour.set_value((AMPM_hour == 0) ? 12 : AMPM_hour);
+ system.set_active((time.hour >= 12) ? TimeSystem.PM : TimeSystem.AM);
+ }
+
+ minute.set_value(time.minute);
+ second.set_value(time.second);
+
+ previous_time_system = (TimeSystem) system.get_active();
+ }
+
+ private void set_original_time_label(bool use_24_hr_format) {
+ if (no_original_time)
+ return;
+
+ original_time_label.set_text(_("Original: ") +
+ Time.local(original_time).format(use_24_hr_format ? _("%m/%d/%Y, %H:%M:%S") :
+ _("%m/%d/%Y, %I:%M:%S %p")));
+ }
+
+ private time_t get_time() {
+ Time time = Time();
+
+ time.second = (int) second.get_value();
+ time.minute = (int) minute.get_value();
+
+ // convert to 24 hr
+ int hour = (int) hour.get_value();
+ time.hour = (hour == 12 && system.get_active() != TimeSystem.24HR) ? 0 : hour;
+ time.hour += ((system.get_active() == TimeSystem.PM) ? 12 : 0);
+
+ uint year, month, day;
+ calendar.get_date(out year, out month, out day);
+ time.year = ((int) year) - YEAR_OFFSET;
+ time.month = (int) month;
+ time.day = (int) day;
+
+ time.isdst = -1;
+
+ return time.mktime();
+ }
+
+ public bool execute(out int64 time_shift, out bool keep_relativity,
+ out bool modify_originals) {
+ show_all();
+
+ bool response = false;
+
+ if (run() == Gtk.ResponseType.OK) {
+ if (no_original_time)
+ time_shift = (int64) get_time();
+ else
+ time_shift = (int64) (get_time() - original_time);
+
+ keep_relativity = relativity_radio_button.get_active();
+
+ if (relativity_radio_button.sensitive)
+ Config.Facade.get_instance().set_keep_relativity(keep_relativity);
+
+ modify_originals = modify_originals_check_button.get_active();
+
+ if (modify_originals_check_button.sensitive)
+ Config.Facade.get_instance().set_modify_originals(modify_originals);
+
+ response = true;
+ } else {
+ time_shift = 0;
+ keep_relativity = true;
+ modify_originals = false;
+ }
+
+ destroy();
+
+ return response;
+ }
+
+ private bool on_spin_button_output(Gtk.SpinButton button) {
+ button.set_text("%02d".printf((int) button.get_value()));
+
+ on_time_changed();
+
+ return true;
+ }
+
+ private void on_time_changed() {
+ int64 time_shift = ((int64) get_time() - (int64) original_time);
+ calendar.notify_property("year");
+ calendar.notify_property("month");
+
+ previous_time_system = (TimeSystem) system.get_active();
+
+ if (time_shift == 0 || no_original_time || (batch_radio_button.get_active() &&
+ batch_radio_button.sensitive)) {
+ notification.hide();
+ } else {
+ bool forward = time_shift > 0;
+ int days, hours, minutes, seconds;
+
+ time_shift = time_shift.abs();
+
+ days = (int) (time_shift / SECONDS_IN_DAY);
+ time_shift = time_shift % SECONDS_IN_DAY;
+ hours = (int) (time_shift / SECONDS_IN_HOUR);
+ time_shift = time_shift % SECONDS_IN_HOUR;
+ minutes = (int) (time_shift / SECONDS_IN_MINUTE);
+ seconds = (int) (time_shift % SECONDS_IN_MINUTE);
+
+ string shift_status = (forward) ?
+ _("Exposure time will be shifted forward by\n%d %s, %d %s, %d %s, and %d %s.") :
+ _("Exposure time will be shifted backward by\n%d %s, %d %s, %d %s, and %d %s.");
+
+ notification.set_text(shift_status.printf(days, ngettext("day", "days", days),
+ hours, ngettext("hour", "hours", hours), minutes,
+ ngettext("minute", "minutes", minutes), seconds,
+ ngettext("second", "seconds", seconds)));
+
+ notification.show();
+ }
+ }
+
+ private void on_time_system_changed() {
+ if (previous_time_system == system.get_active())
+ return;
+
+ Config.Facade.get_instance().set_use_24_hour_time(system.get_active() == TimeSystem.24HR);
+
+ if (system.get_active() == TimeSystem.24HR) {
+ int time = (hour.get_value() == 12.0) ? 0 : (int) hour.get_value();
+ time = time + ((previous_time_system == TimeSystem.PM) ? 12 : 0);
+
+ hour.set_range(0, 23);
+ set_original_time_label(true);
+
+ hour.set_value(time);
+ } else {
+ int AMPM_hour = ((int) hour.get_value()) % 12;
+
+ hour.set_range(1, 12);
+ set_original_time_label(false);
+
+ hour.set_value((AMPM_hour == 0) ? 12 : AMPM_hour);
+ }
+
+ on_time_changed();
+ }
+}
diff --git a/src/dialogs/EntryMultiCompletion.c b/src/dialogs/EntryMultiCompletion.c
new file mode 100644
index 0000000..4006725
--- /dev/null
+++ b/src/dialogs/EntryMultiCompletion.c
@@ -0,0 +1,1073 @@
+/* EntryMultiCompletion.c generated by valac 0.40.4, the Vala compiler
+ * generated from EntryMultiCompletion.vala, do not modify */
+
+/* Copyright 2016 Software Freedom Conservancy Inc.
+ * Copyright 2017 Jens Georg <mail@jensge.org>
+ *
+ * This software is licensed under the GNU LGPL (version 2.1 or later).
+ * See the COPYING file in this distribution.
+ */
+/* Entry completion for values separated by separators (e.g. comma in the case of tags)*/
+/* Partly inspired by the class of the same name in gtkmm-utils by Marko Anastasov*/
+
+
+#include <glib.h>
+#include <glib-object.h>
+#include <gtk/gtk.h>
+#include <stdlib.h>
+#include <string.h>
+#include <gee.h>
+
+
+#define TYPE_ENTRY_MULTI_COMPLETION (entry_multi_completion_get_type ())
+#define ENTRY_MULTI_COMPLETION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ENTRY_MULTI_COMPLETION, EntryMultiCompletion))
+#define ENTRY_MULTI_COMPLETION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ENTRY_MULTI_COMPLETION, EntryMultiCompletionClass))
+#define IS_ENTRY_MULTI_COMPLETION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ENTRY_MULTI_COMPLETION))
+#define IS_ENTRY_MULTI_COMPLETION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ENTRY_MULTI_COMPLETION))
+#define ENTRY_MULTI_COMPLETION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ENTRY_MULTI_COMPLETION, EntryMultiCompletionClass))
+
+typedef struct _EntryMultiCompletion EntryMultiCompletion;
+typedef struct _EntryMultiCompletionClass EntryMultiCompletionClass;
+typedef struct _EntryMultiCompletionPrivate EntryMultiCompletionPrivate;
+enum {
+ ENTRY_MULTI_COMPLETION_0_PROPERTY,
+ ENTRY_MULTI_COMPLETION_NUM_PROPERTIES
+};
+static GParamSpec* entry_multi_completion_properties[ENTRY_MULTI_COMPLETION_NUM_PROPERTIES];
+#define _g_free0(var) (var = (g_free (var), NULL))
+#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
+#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
+#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
+#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
+#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
+
+struct _EntryMultiCompletion {
+ GtkEntryCompletion parent_instance;
+ EntryMultiCompletionPrivate * priv;
+};
+
+struct _EntryMultiCompletionClass {
+ GtkEntryCompletionClass parent_class;
+};
+
+struct _EntryMultiCompletionPrivate {
+ gchar* delimiter;
+};
+
+
+static gpointer entry_multi_completion_parent_class = NULL;
+
+GType entry_multi_completion_get_type (void) G_GNUC_CONST;
+#define ENTRY_MULTI_COMPLETION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_ENTRY_MULTI_COMPLETION, EntryMultiCompletionPrivate))
+EntryMultiCompletion* entry_multi_completion_new (GeeCollection* completion_list,
+ const gchar* delimiter);
+EntryMultiCompletion* entry_multi_completion_construct (GType object_type,
+ GeeCollection* completion_list,
+ const gchar* delimiter);
+static GtkListStore* entry_multi_completion_create_completion_store (GeeCollection* completion_list);
+static gboolean entry_multi_completion_match_func (EntryMultiCompletion* self,
+ GtkEntryCompletion* completion,
+ const gchar* key,
+ GtkTreeIter* iter);
+static gboolean _entry_multi_completion_match_func_gtk_entry_completion_match_func (GtkEntryCompletion* completion,
+ const gchar* key,
+ GtkTreeIter* iter,
+ gpointer self);
+static gchar* entry_multi_completion_get_last_part (const gchar* s,
+ const gchar* delimiter);
+static gboolean entry_multi_completion_real_match_selected (GtkEntryCompletion* base,
+ GtkTreeModel* model,
+ GtkTreeIter* iter);
+static void entry_multi_completion_finalize (GObject * obj);
+static void _vala_array_destroy (gpointer array,
+ gint array_length,
+ GDestroyNotify destroy_func);
+static void _vala_array_free (gpointer array,
+ gint array_length,
+ GDestroyNotify destroy_func);
+static gint _vala_array_length (gpointer array);
+
+
+static gboolean
+_entry_multi_completion_match_func_gtk_entry_completion_match_func (GtkEntryCompletion* completion,
+ const gchar* key,
+ GtkTreeIter* iter,
+ gpointer self)
+{
+ gboolean result;
+ result = entry_multi_completion_match_func ((EntryMultiCompletion*) self, completion, key, iter);
+#line 19 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ return result;
+#line 102 "EntryMultiCompletion.c"
+}
+
+
+EntryMultiCompletion*
+entry_multi_completion_construct (GType object_type,
+ GeeCollection* completion_list,
+ const gchar* delimiter)
+{
+ EntryMultiCompletion * self = NULL;
+ gboolean _tmp0_ = FALSE;
+ gchar* _tmp3_;
+ GtkListStore* _tmp4_;
+ GtkListStore* _tmp5_;
+#line 13 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ g_return_val_if_fail (GEE_IS_COLLECTION (completion_list), NULL);
+#line 13 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ self = (EntryMultiCompletion*) g_object_new (object_type, NULL);
+#line 14 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ if (delimiter == NULL) {
+#line 14 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp0_ = TRUE;
+#line 124 "EntryMultiCompletion.c"
+ } else {
+ gint _tmp1_;
+ gint _tmp2_;
+#line 14 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp1_ = strlen (delimiter);
+#line 14 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp2_ = _tmp1_;
+#line 14 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp0_ = _tmp2_ == 1;
+#line 134 "EntryMultiCompletion.c"
+ }
+#line 14 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _vala_assert (_tmp0_, "delimiter == null || delimiter.length == 1");
+#line 15 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp3_ = g_strdup (delimiter);
+#line 15 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _g_free0 (self->priv->delimiter);
+#line 15 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ self->priv->delimiter = _tmp3_;
+#line 17 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp4_ = entry_multi_completion_create_completion_store (completion_list);
+#line 17 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp5_ = _tmp4_;
+#line 17 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ gtk_entry_completion_set_model (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_entry_completion_get_type (), GtkEntryCompletion), G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, gtk_tree_model_get_type (), GtkTreeModel));
+#line 17 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _g_object_unref0 (_tmp5_);
+#line 18 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ gtk_entry_completion_set_text_column (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_entry_completion_get_type (), GtkEntryCompletion), 0);
+#line 19 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ gtk_entry_completion_set_match_func (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_entry_completion_get_type (), GtkEntryCompletion), _entry_multi_completion_match_func_gtk_entry_completion_match_func, g_object_ref (self), g_object_unref);
+#line 13 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ return self;
+#line 158 "EntryMultiCompletion.c"
+}
+
+
+EntryMultiCompletion*
+entry_multi_completion_new (GeeCollection* completion_list,
+ const gchar* delimiter)
+{
+#line 13 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ return entry_multi_completion_construct (TYPE_ENTRY_MULTI_COMPLETION, completion_list, delimiter);
+#line 168 "EntryMultiCompletion.c"
+}
+
+
+static GtkListStore*
+entry_multi_completion_create_completion_store (GeeCollection* completion_list)
+{
+ GtkListStore* result = NULL;
+ GtkListStore* completion_store = NULL;
+ GtkListStore* _tmp0_;
+ GtkTreeIter store_iter = {0};
+ GeeIterator* completion_iter = NULL;
+ GeeIterator* _tmp1_;
+#line 22 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ g_return_val_if_fail (GEE_IS_COLLECTION (completion_list), NULL);
+#line 23 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp0_ = gtk_list_store_new (1, G_TYPE_STRING, -1);
+#line 23 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ completion_store = _tmp0_;
+#line 25 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp1_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (completion_list, GEE_TYPE_ITERABLE, GeeIterable));
+#line 25 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ completion_iter = _tmp1_;
+#line 26 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ while (TRUE) {
+#line 193 "EntryMultiCompletion.c"
+ GeeIterator* _tmp2_;
+ GtkListStore* _tmp3_;
+ GtkTreeIter _tmp4_ = {0};
+ GtkListStore* _tmp5_;
+ GtkTreeIter _tmp6_;
+ GeeIterator* _tmp7_;
+ gpointer _tmp8_;
+ gchar* _tmp9_;
+#line 26 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp2_ = completion_iter;
+#line 26 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ if (!gee_iterator_next (_tmp2_)) {
+#line 26 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ break;
+#line 208 "EntryMultiCompletion.c"
+ }
+#line 27 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp3_ = completion_store;
+#line 27 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ gtk_list_store_append (_tmp3_, &_tmp4_);
+#line 27 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ store_iter = _tmp4_;
+#line 28 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp5_ = completion_store;
+#line 28 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp6_ = store_iter;
+#line 28 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp7_ = completion_iter;
+#line 28 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp8_ = gee_iterator_get (_tmp7_);
+#line 28 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp9_ = (gchar*) _tmp8_;
+#line 28 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ gtk_list_store_set (_tmp5_, &_tmp6_, 0, _tmp9_, -1, -1);
+#line 28 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _g_free0 (_tmp9_);
+#line 230 "EntryMultiCompletion.c"
+ }
+#line 31 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ result = completion_store;
+#line 31 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _g_object_unref0 (completion_iter);
+#line 31 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ return result;
+#line 238 "EntryMultiCompletion.c"
+}
+
+
+static gpointer
+_g_object_ref0 (gpointer self)
+{
+#line 35 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ return self ? g_object_ref (self) : NULL;
+#line 247 "EntryMultiCompletion.c"
+}
+
+
+static gchar*
+string_strip (const gchar* self)
+{
+ gchar* result = NULL;
+ gchar* _result_ = NULL;
+ gchar* _tmp0_;
+ const gchar* _tmp1_;
+#line 1248 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ g_return_val_if_fail (self != NULL, NULL);
+#line 1249 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ _tmp0_ = g_strdup (self);
+#line 1249 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ _result_ = _tmp0_;
+#line 1250 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ _tmp1_ = _result_;
+#line 1250 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ g_strstrip (_tmp1_);
+#line 1251 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ result = _result_;
+#line 1251 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ return result;
+#line 272 "EntryMultiCompletion.c"
+}
+
+
+static gboolean
+string_contains (const gchar* self,
+ const gchar* needle)
+{
+ gboolean result = FALSE;
+ gchar* _tmp0_;
+#line 1417 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ g_return_val_if_fail (self != NULL, FALSE);
+#line 1417 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ g_return_val_if_fail (needle != NULL, FALSE);
+#line 1418 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ _tmp0_ = strstr ((gchar*) self, (gchar*) needle);
+#line 1418 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ result = _tmp0_ != NULL;
+#line 1418 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ return result;
+#line 292 "EntryMultiCompletion.c"
+}
+
+
+static gint
+string_last_index_of_char (const gchar* self,
+ gunichar c,
+ gint start_index)
+{
+ gint result = 0;
+ gchar* _result_ = NULL;
+ gchar* _tmp0_;
+ gchar* _tmp1_;
+#line 1055 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ g_return_val_if_fail (self != NULL, 0);
+#line 1056 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ _tmp0_ = g_utf8_strrchr (((gchar*) self) + start_index, (gssize) -1, c);
+#line 1056 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ _result_ = _tmp0_;
+#line 1058 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ _tmp1_ = _result_;
+#line 1058 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ if (_tmp1_ != NULL) {
+#line 315 "EntryMultiCompletion.c"
+ gchar* _tmp2_;
+#line 1059 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ _tmp2_ = _result_;
+#line 1059 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ result = (gint) (_tmp2_ - ((gchar*) self));
+#line 1059 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ return result;
+#line 323 "EntryMultiCompletion.c"
+ } else {
+#line 1061 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ result = -1;
+#line 1061 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ return result;
+#line 329 "EntryMultiCompletion.c"
+ }
+}
+
+
+static gchar
+string_get (const gchar* self,
+ glong index)
+{
+ gchar result = '\0';
+ gchar _tmp0_;
+#line 1124 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ g_return_val_if_fail (self != NULL, '\0');
+#line 1125 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ _tmp0_ = ((gchar*) self)[index];
+#line 1125 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ result = _tmp0_;
+#line 1125 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ return result;
+#line 348 "EntryMultiCompletion.c"
+}
+
+
+static gboolean
+entry_multi_completion_match_func (EntryMultiCompletion* self,
+ GtkEntryCompletion* completion,
+ const gchar* key,
+ GtkTreeIter* iter)
+{
+ gboolean result = FALSE;
+ GtkTreeModel* model = NULL;
+ GtkTreeModel* _tmp0_;
+ GtkTreeModel* _tmp1_;
+ gchar* possible_match = NULL;
+ GtkTreeModel* _tmp2_;
+ GtkTreeIter _tmp3_;
+ const gchar* _tmp4_;
+ gchar* _tmp5_;
+ gchar* _tmp6_;
+ gchar* _tmp7_;
+ gchar* normed_key = NULL;
+ gchar* _tmp8_;
+ const gchar* _tmp9_;
+#line 34 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ g_return_val_if_fail (IS_ENTRY_MULTI_COMPLETION (self), FALSE);
+#line 34 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ g_return_val_if_fail (GTK_IS_ENTRY_COMPLETION (completion), FALSE);
+#line 34 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ g_return_val_if_fail (key != NULL, FALSE);
+#line 34 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ g_return_val_if_fail (iter != NULL, FALSE);
+#line 35 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp0_ = gtk_entry_completion_get_model (completion);
+#line 35 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp1_ = _g_object_ref0 (_tmp0_);
+#line 35 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ model = _tmp1_;
+#line 37 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp2_ = model;
+#line 37 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp3_ = *iter;
+#line 37 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ gtk_tree_model_get (_tmp2_, &_tmp3_, 0, &possible_match, -1);
+#line 43 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp4_ = possible_match;
+#line 43 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp5_ = g_utf8_casefold (_tmp4_, (gssize) -1);
+#line 43 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp6_ = _tmp5_;
+#line 43 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp7_ = g_utf8_normalize (_tmp6_, (gssize) -1, G_NORMALIZE_ALL_COMPOSE);
+#line 43 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _g_free0 (possible_match);
+#line 43 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ possible_match = _tmp7_;
+#line 43 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _g_free0 (_tmp6_);
+#line 44 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp8_ = g_utf8_normalize (key, (gssize) -1, G_NORMALIZE_ALL_COMPOSE);
+#line 44 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ normed_key = _tmp8_;
+#line 46 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp9_ = self->priv->delimiter;
+#line 46 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ if (_tmp9_ == NULL) {
+#line 414 "EntryMultiCompletion.c"
+ const gchar* _tmp10_;
+ const gchar* _tmp11_;
+ gchar* _tmp12_;
+ gchar* _tmp13_;
+ gboolean _tmp14_;
+#line 47 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp10_ = possible_match;
+#line 47 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp11_ = normed_key;
+#line 47 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp12_ = string_strip (_tmp11_);
+#line 47 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp13_ = _tmp12_;
+#line 47 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp14_ = g_str_has_prefix (_tmp10_, _tmp13_);
+#line 47 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _g_free0 (_tmp13_);
+#line 47 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ result = _tmp14_;
+#line 47 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _g_free0 (normed_key);
+#line 47 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _g_free0 (possible_match);
+#line 47 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _g_object_unref0 (model);
+#line 47 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ return result;
+#line 442 "EntryMultiCompletion.c"
+ } else {
+ const gchar* _tmp15_;
+ const gchar* _tmp16_;
+ gchar* last_part = NULL;
+ const gchar* _tmp23_;
+ gchar* _tmp24_;
+ gchar* _tmp25_;
+ const gchar* _tmp26_;
+ gchar* _tmp27_;
+ gchar* _tmp28_;
+ const gchar* _tmp29_;
+ gint _tmp30_;
+ gint _tmp31_;
+ const gchar* _tmp32_;
+ const gchar* _tmp33_;
+ gchar* _tmp34_;
+ gchar* _tmp35_;
+ gboolean _tmp36_;
+#line 49 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp15_ = normed_key;
+#line 49 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp16_ = self->priv->delimiter;
+#line 49 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ if (string_contains (_tmp15_, _tmp16_)) {
+#line 467 "EntryMultiCompletion.c"
+ gint offset = 0;
+ const gchar* _tmp17_;
+ const gchar* _tmp18_;
+ const gchar* _tmp19_;
+ gint position = 0;
+ GtkWidget* _tmp20_;
+ gint _tmp21_;
+ gint _tmp22_;
+#line 51 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp17_ = normed_key;
+#line 51 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp18_ = normed_key;
+#line 51 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp19_ = self->priv->delimiter;
+#line 51 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ offset = g_utf8_strlen (_tmp17_, (gssize) string_last_index_of_char (_tmp18_, (gunichar) string_get (_tmp19_, (glong) 0), 0));
+#line 52 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp20_ = gtk_entry_completion_get_entry (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_entry_completion_get_type (), GtkEntryCompletion));
+#line 52 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ position = gtk_editable_get_position (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, gtk_entry_get_type (), GtkEntry), gtk_editable_get_type (), GtkEditable));
+#line 53 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp21_ = position;
+#line 53 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp22_ = offset;
+#line 53 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ if (_tmp21_ <= _tmp22_) {
+#line 54 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ result = FALSE;
+#line 54 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _g_free0 (normed_key);
+#line 54 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _g_free0 (possible_match);
+#line 54 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _g_object_unref0 (model);
+#line 54 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ return result;
+#line 504 "EntryMultiCompletion.c"
+ }
+ }
+#line 57 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp23_ = normed_key;
+#line 57 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp24_ = string_strip (_tmp23_);
+#line 57 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp25_ = _tmp24_;
+#line 57 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp26_ = self->priv->delimiter;
+#line 57 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp27_ = entry_multi_completion_get_last_part (_tmp25_, _tmp26_);
+#line 57 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp28_ = _tmp27_;
+#line 57 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _g_free0 (_tmp25_);
+#line 57 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ last_part = _tmp28_;
+#line 59 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp29_ = last_part;
+#line 59 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp30_ = strlen (_tmp29_);
+#line 59 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp31_ = _tmp30_;
+#line 59 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ if (_tmp31_ == 0) {
+#line 60 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ result = FALSE;
+#line 60 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _g_free0 (last_part);
+#line 60 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _g_free0 (normed_key);
+#line 60 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _g_free0 (possible_match);
+#line 60 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _g_object_unref0 (model);
+#line 60 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ return result;
+#line 543 "EntryMultiCompletion.c"
+ }
+#line 62 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp32_ = possible_match;
+#line 62 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp33_ = last_part;
+#line 62 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp34_ = string_strip (_tmp33_);
+#line 62 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp35_ = _tmp34_;
+#line 62 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp36_ = g_str_has_prefix (_tmp32_, _tmp35_);
+#line 62 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _g_free0 (_tmp35_);
+#line 62 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ result = _tmp36_;
+#line 62 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _g_free0 (last_part);
+#line 62 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _g_free0 (normed_key);
+#line 62 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _g_free0 (possible_match);
+#line 62 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _g_object_unref0 (model);
+#line 62 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ return result;
+#line 569 "EntryMultiCompletion.c"
+ }
+#line 34 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _g_free0 (normed_key);
+#line 34 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _g_free0 (possible_match);
+#line 34 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _g_object_unref0 (model);
+#line 577 "EntryMultiCompletion.c"
+}
+
+
+static glong
+string_strnlen (gchar* str,
+ glong maxlen)
+{
+ glong result = 0L;
+ gchar* end = NULL;
+ gchar* _tmp0_;
+ gchar* _tmp1_;
+#line 1336 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ _tmp0_ = memchr (str, 0, (gsize) maxlen);
+#line 1336 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ end = _tmp0_;
+#line 1337 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ _tmp1_ = end;
+#line 1337 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ if (_tmp1_ == NULL) {
+#line 1338 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ result = maxlen;
+#line 1338 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ return result;
+#line 601 "EntryMultiCompletion.c"
+ } else {
+ gchar* _tmp2_;
+#line 1340 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ _tmp2_ = end;
+#line 1340 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ result = (glong) (_tmp2_ - str);
+#line 1340 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ return result;
+#line 610 "EntryMultiCompletion.c"
+ }
+}
+
+
+static gchar*
+string_substring (const gchar* self,
+ glong offset,
+ glong len)
+{
+ gchar* result = NULL;
+ glong string_length = 0L;
+ gboolean _tmp0_ = FALSE;
+ glong _tmp6_;
+ gchar* _tmp7_;
+#line 1347 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ g_return_val_if_fail (self != NULL, NULL);
+#line 1349 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ if (offset >= ((glong) 0)) {
+#line 1349 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ _tmp0_ = len >= ((glong) 0);
+#line 631 "EntryMultiCompletion.c"
+ } else {
+#line 1349 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ _tmp0_ = FALSE;
+#line 635 "EntryMultiCompletion.c"
+ }
+#line 1349 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ if (_tmp0_) {
+#line 1351 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ string_length = string_strnlen ((gchar*) self, offset + len);
+#line 641 "EntryMultiCompletion.c"
+ } else {
+ gint _tmp1_;
+ gint _tmp2_;
+#line 1353 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ _tmp1_ = strlen (self);
+#line 1353 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ _tmp2_ = _tmp1_;
+#line 1353 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ string_length = (glong) _tmp2_;
+#line 651 "EntryMultiCompletion.c"
+ }
+#line 1356 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ if (offset < ((glong) 0)) {
+#line 655 "EntryMultiCompletion.c"
+ glong _tmp3_;
+#line 1357 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ _tmp3_ = string_length;
+#line 1357 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ offset = _tmp3_ + offset;
+#line 1358 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ g_return_val_if_fail (offset >= ((glong) 0), NULL);
+#line 663 "EntryMultiCompletion.c"
+ } else {
+ glong _tmp4_;
+#line 1360 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ _tmp4_ = string_length;
+#line 1360 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ g_return_val_if_fail (offset <= _tmp4_, NULL);
+#line 670 "EntryMultiCompletion.c"
+ }
+#line 1362 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ if (len < ((glong) 0)) {
+#line 674 "EntryMultiCompletion.c"
+ glong _tmp5_;
+#line 1363 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ _tmp5_ = string_length;
+#line 1363 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ len = _tmp5_ - offset;
+#line 680 "EntryMultiCompletion.c"
+ }
+#line 1365 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ _tmp6_ = string_length;
+#line 1365 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ g_return_val_if_fail ((offset + len) <= _tmp6_, NULL);
+#line 1366 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ _tmp7_ = g_strndup (((gchar*) self) + offset, (gsize) len);
+#line 1366 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ result = _tmp7_;
+#line 1366 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ return result;
+#line 692 "EntryMultiCompletion.c"
+}
+
+
+static gboolean
+entry_multi_completion_real_match_selected (GtkEntryCompletion* base,
+ GtkTreeModel* model,
+ GtkTreeIter* iter)
+{
+ EntryMultiCompletion * self;
+ gboolean result = FALSE;
+ gchar* match = NULL;
+ GtkTreeIter _tmp0_;
+ GtkEntry* entry = NULL;
+ GtkWidget* _tmp1_;
+ GtkEntry* _tmp2_;
+ gchar* old_text = NULL;
+ GtkEntry* _tmp3_;
+ const gchar* _tmp4_;
+ gchar* _tmp5_;
+ const gchar* _tmp6_;
+ gint _tmp7_;
+ gint _tmp8_;
+ const gchar* _tmp20_ = NULL;
+ const gchar* _tmp21_;
+ gchar* new_text = NULL;
+ const gchar* _tmp22_;
+ const gchar* _tmp23_;
+ gchar* _tmp24_;
+ gchar* _tmp25_;
+ const gchar* _tmp26_;
+ gchar* _tmp27_;
+ gchar* _tmp28_;
+ gchar* _tmp29_;
+ gchar* _tmp30_;
+ GtkEntry* _tmp31_;
+ GtkEntry* _tmp32_;
+ gint _tmp33_;
+ gint _tmp34_;
+#line 66 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_ENTRY_MULTI_COMPLETION, EntryMultiCompletion);
+#line 66 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ g_return_val_if_fail (GTK_IS_TREE_MODEL (model), FALSE);
+#line 66 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ g_return_val_if_fail (iter != NULL, FALSE);
+#line 68 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp0_ = *iter;
+#line 68 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ gtk_tree_model_get (model, &_tmp0_, 0, &match, -1);
+#line 70 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp1_ = gtk_entry_completion_get_entry (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_entry_completion_get_type (), GtkEntryCompletion));
+#line 70 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_entry_get_type (), GtkEntry));
+#line 70 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ entry = _tmp2_;
+#line 72 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp3_ = entry;
+#line 72 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp4_ = gtk_entry_get_text (_tmp3_);
+#line 72 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp5_ = g_utf8_normalize (_tmp4_, (gssize) -1, G_NORMALIZE_ALL_COMPOSE);
+#line 72 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ old_text = _tmp5_;
+#line 73 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp6_ = old_text;
+#line 73 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp7_ = strlen (_tmp6_);
+#line 73 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp8_ = _tmp7_;
+#line 73 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ if (_tmp8_ > 0) {
+#line 763 "EntryMultiCompletion.c"
+ const gchar* _tmp9_;
+ const gchar* _tmp10_;
+#line 74 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp9_ = old_text;
+#line 74 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp10_ = self->priv->delimiter;
+#line 74 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ if (string_contains (_tmp9_, _tmp10_)) {
+#line 772 "EntryMultiCompletion.c"
+ const gchar* _tmp11_ = NULL;
+ const gchar* _tmp12_;
+ const gchar* _tmp13_;
+ const gchar* _tmp14_;
+ const gchar* _tmp15_;
+ gchar* _tmp16_;
+ gchar* _tmp17_;
+ gchar* _tmp18_;
+#line 75 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp12_ = self->priv->delimiter;
+#line 75 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ if (g_strcmp0 (_tmp12_, " ") != 0) {
+#line 75 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp11_ = " ";
+#line 787 "EntryMultiCompletion.c"
+ } else {
+#line 75 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp11_ = "";
+#line 791 "EntryMultiCompletion.c"
+ }
+#line 75 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp13_ = old_text;
+#line 75 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp14_ = old_text;
+#line 75 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp15_ = self->priv->delimiter;
+#line 75 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp16_ = string_substring (_tmp13_, (glong) 0, (glong) (string_last_index_of_char (_tmp14_, (gunichar) string_get (_tmp15_, (glong) 0), 0) + 1));
+#line 75 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp17_ = _tmp16_;
+#line 75 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp18_ = g_strconcat (_tmp17_, _tmp11_, NULL);
+#line 75 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _g_free0 (old_text);
+#line 75 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ old_text = _tmp18_;
+#line 75 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _g_free0 (_tmp17_);
+#line 811 "EntryMultiCompletion.c"
+ } else {
+ gchar* _tmp19_;
+#line 77 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp19_ = g_strdup ("");
+#line 77 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _g_free0 (old_text);
+#line 77 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ old_text = _tmp19_;
+#line 820 "EntryMultiCompletion.c"
+ }
+ }
+#line 80 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp21_ = self->priv->delimiter;
+#line 80 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ if (g_strcmp0 (_tmp21_, " ") != 0) {
+#line 80 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp20_ = " ";
+#line 829 "EntryMultiCompletion.c"
+ } else {
+#line 80 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp20_ = "";
+#line 833 "EntryMultiCompletion.c"
+ }
+#line 80 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp22_ = old_text;
+#line 80 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp23_ = match;
+#line 80 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp24_ = g_strconcat (_tmp22_, _tmp23_, NULL);
+#line 80 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp25_ = _tmp24_;
+#line 80 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp26_ = self->priv->delimiter;
+#line 80 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp27_ = g_strconcat (_tmp25_, _tmp26_, NULL);
+#line 80 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp28_ = _tmp27_;
+#line 80 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp29_ = g_strconcat (_tmp28_, _tmp20_, NULL);
+#line 80 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp30_ = _tmp29_;
+#line 80 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _g_free0 (_tmp28_);
+#line 80 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _g_free0 (_tmp25_);
+#line 80 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ new_text = _tmp30_;
+#line 81 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp31_ = entry;
+#line 81 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ gtk_entry_set_text (_tmp31_, new_text);
+#line 82 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp32_ = entry;
+#line 82 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp33_ = strlen (new_text);
+#line 82 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp34_ = _tmp33_;
+#line 82 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ gtk_editable_set_position (G_TYPE_CHECK_INSTANCE_CAST (_tmp32_, gtk_editable_get_type (), GtkEditable), (gint) _tmp34_);
+#line 84 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ result = TRUE;
+#line 84 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _g_free0 (new_text);
+#line 84 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _g_free0 (old_text);
+#line 84 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _g_object_unref0 (entry);
+#line 84 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _g_free0 (match);
+#line 84 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ return result;
+#line 883 "EntryMultiCompletion.c"
+}
+
+
+static gchar*
+entry_multi_completion_get_last_part (const gchar* s,
+ const gchar* delimiter)
+{
+ gchar* result = NULL;
+ gchar** split = NULL;
+ gchar** _tmp0_;
+ gchar** _tmp1_;
+ gint split_length1;
+ gint _split_size_;
+ gboolean _tmp2_ = FALSE;
+ gchar** _tmp3_;
+ gint _tmp3__length1;
+#line 88 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ g_return_val_if_fail (s != NULL, NULL);
+#line 88 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ g_return_val_if_fail (delimiter != NULL, NULL);
+#line 89 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp1_ = _tmp0_ = g_strsplit (s, delimiter, 0);
+#line 89 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ split = _tmp1_;
+#line 89 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ split_length1 = _vala_array_length (_tmp0_);
+#line 89 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _split_size_ = split_length1;
+#line 91 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp3_ = split;
+#line 91 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp3__length1 = split_length1;
+#line 91 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ if (_tmp3_ != NULL) {
+#line 918 "EntryMultiCompletion.c"
+ gchar** _tmp4_;
+ gint _tmp4__length1;
+ const gchar* _tmp5_;
+#line 91 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp4_ = split;
+#line 91 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp4__length1 = split_length1;
+#line 91 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp5_ = _tmp4_[0];
+#line 91 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp2_ = _tmp5_ != NULL;
+#line 930 "EntryMultiCompletion.c"
+ } else {
+#line 91 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp2_ = FALSE;
+#line 934 "EntryMultiCompletion.c"
+ }
+#line 91 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ if (_tmp2_) {
+#line 938 "EntryMultiCompletion.c"
+ gchar** _tmp6_;
+ gint _tmp6__length1;
+ gchar** _tmp7_;
+ gint _tmp7__length1;
+ const gchar* _tmp8_;
+ gchar* _tmp9_;
+#line 92 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp6_ = split;
+#line 92 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp6__length1 = split_length1;
+#line 92 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp7_ = split;
+#line 92 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp7__length1 = split_length1;
+#line 92 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp8_ = _tmp6_[_tmp7__length1 - 1];
+#line 92 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp9_ = g_strdup (_tmp8_);
+#line 92 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ result = _tmp9_;
+#line 92 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ split = (_vala_array_free (split, split_length1, (GDestroyNotify) g_free), NULL);
+#line 92 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ return result;
+#line 963 "EntryMultiCompletion.c"
+ } else {
+ gchar* _tmp10_;
+#line 94 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _tmp10_ = g_strdup ("");
+#line 94 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ result = _tmp10_;
+#line 94 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ split = (_vala_array_free (split, split_length1, (GDestroyNotify) g_free), NULL);
+#line 94 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ return result;
+#line 974 "EntryMultiCompletion.c"
+ }
+#line 88 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ split = (_vala_array_free (split, split_length1, (GDestroyNotify) g_free), NULL);
+#line 978 "EntryMultiCompletion.c"
+}
+
+
+static void
+entry_multi_completion_class_init (EntryMultiCompletionClass * klass)
+{
+#line 10 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ entry_multi_completion_parent_class = g_type_class_peek_parent (klass);
+#line 10 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ g_type_class_add_private (klass, sizeof (EntryMultiCompletionPrivate));
+#line 10 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ ((GtkEntryCompletionClass *) klass)->match_selected = (gboolean (*) (GtkEntryCompletion *, GtkTreeModel*, GtkTreeIter*)) entry_multi_completion_real_match_selected;
+#line 10 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ G_OBJECT_CLASS (klass)->finalize = entry_multi_completion_finalize;
+#line 993 "EntryMultiCompletion.c"
+}
+
+
+static void
+entry_multi_completion_instance_init (EntryMultiCompletion * self)
+{
+#line 10 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ self->priv = ENTRY_MULTI_COMPLETION_GET_PRIVATE (self);
+#line 1002 "EntryMultiCompletion.c"
+}
+
+
+static void
+entry_multi_completion_finalize (GObject * obj)
+{
+ EntryMultiCompletion * self;
+#line 10 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_ENTRY_MULTI_COMPLETION, EntryMultiCompletion);
+#line 11 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ _g_free0 (self->priv->delimiter);
+#line 10 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala"
+ G_OBJECT_CLASS (entry_multi_completion_parent_class)->finalize (obj);
+#line 1016 "EntryMultiCompletion.c"
+}
+
+
+GType
+entry_multi_completion_get_type (void)
+{
+ static volatile gsize entry_multi_completion_type_id__volatile = 0;
+ if (g_once_init_enter (&entry_multi_completion_type_id__volatile)) {
+ static const GTypeInfo g_define_type_info = { sizeof (EntryMultiCompletionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) entry_multi_completion_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (EntryMultiCompletion), 0, (GInstanceInitFunc) entry_multi_completion_instance_init, NULL };
+ GType entry_multi_completion_type_id;
+ entry_multi_completion_type_id = g_type_register_static (gtk_entry_completion_get_type (), "EntryMultiCompletion", &g_define_type_info, 0);
+ g_once_init_leave (&entry_multi_completion_type_id__volatile, entry_multi_completion_type_id);
+ }
+ return entry_multi_completion_type_id__volatile;
+}
+
+
+static void
+_vala_array_destroy (gpointer array,
+ gint array_length,
+ GDestroyNotify destroy_func)
+{
+ if ((array != NULL) && (destroy_func != NULL)) {
+ int i;
+ for (i = 0; i < array_length; i = i + 1) {
+ if (((gpointer*) array)[i] != NULL) {
+ destroy_func (((gpointer*) array)[i]);
+ }
+ }
+ }
+}
+
+
+static void
+_vala_array_free (gpointer array,
+ gint array_length,
+ GDestroyNotify destroy_func)
+{
+ _vala_array_destroy (array, array_length, destroy_func);
+ g_free (array);
+}
+
+
+static gint
+_vala_array_length (gpointer array)
+{
+ int length;
+ length = 0;
+ if (array) {
+ while (((gpointer*) array)[length]) {
+ length++;
+ }
+ }
+ return length;
+}
+
+
+
diff --git a/src/dialogs/EntryMultiCompletion.vala b/src/dialogs/EntryMultiCompletion.vala
new file mode 100644
index 0000000..8700f21
--- /dev/null
+++ b/src/dialogs/EntryMultiCompletion.vala
@@ -0,0 +1,97 @@
+/* Copyright 2016 Software Freedom Conservancy Inc.
+ * Copyright 2017 Jens Georg <mail@jensge.org>
+ *
+ * This software is licensed under the GNU LGPL (version 2.1 or later).
+ * See the COPYING file in this distribution.
+ */
+
+// Entry completion for values separated by separators (e.g. comma in the case of tags)
+// Partly inspired by the class of the same name in gtkmm-utils by Marko Anastasov
+public class EntryMultiCompletion : Gtk.EntryCompletion {
+ private string delimiter;
+
+ public EntryMultiCompletion(Gee.Collection<string> completion_list, string? delimiter) {
+ assert(delimiter == null || delimiter.length == 1);
+ this.delimiter = delimiter;
+
+ set_model(create_completion_store(completion_list));
+ set_text_column(0);
+ set_match_func(match_func);
+ }
+
+ private static Gtk.ListStore create_completion_store(Gee.Collection<string> completion_list) {
+ Gtk.ListStore completion_store = new Gtk.ListStore(1, typeof(string));
+ Gtk.TreeIter store_iter;
+ Gee.Iterator<string> completion_iter = completion_list.iterator();
+ while (completion_iter.next()) {
+ completion_store.append(out store_iter);
+ completion_store.set(store_iter, 0, completion_iter.get(), -1);
+ }
+
+ return completion_store;
+ }
+
+ private bool match_func(Gtk.EntryCompletion completion, string key, Gtk.TreeIter iter) {
+ Gtk.TreeModel model = completion.get_model();
+ string possible_match;
+ model.get(iter, 0, out possible_match);
+
+ // Normalize key and possible matches to allow comparison of non-ASCII characters.
+ // Use a "COMPOSE" normalization to allow comparison to the position value returned by
+ // Gtk.Entry, i.e. one character=one position. Using the default normalization a character
+ // like "é" or "ö" would have a length of two.
+ possible_match = possible_match.casefold().normalize(-1, NormalizeMode.ALL_COMPOSE);
+ string normed_key = key.normalize(-1, NormalizeMode.ALL_COMPOSE);
+
+ if (delimiter == null) {
+ return possible_match.has_prefix(normed_key.strip());
+ } else {
+ if (normed_key.contains(delimiter)) {
+ // check whether cursor is before last delimiter
+ int offset = normed_key.char_count(normed_key.last_index_of_char(delimiter[0]));
+ int position = ((Gtk.Entry) get_entry()).get_position();
+ if (position <= offset)
+ return false; // TODO: Autocompletion for tags not last in list
+ }
+
+ string last_part = get_last_part(normed_key.strip(), delimiter);
+
+ if (last_part.length == 0)
+ return false; // need at least one character to show matches
+
+ return possible_match.has_prefix(last_part.strip());
+ }
+ }
+
+ public override bool match_selected(Gtk.TreeModel model, Gtk.TreeIter iter) {
+ string match;
+ model.get(iter, 0, out match);
+
+ Gtk.Entry entry = (Gtk.Entry)get_entry();
+
+ string old_text = entry.get_text().normalize(-1, NormalizeMode.ALL_COMPOSE);
+ if (old_text.length > 0) {
+ if (old_text.contains(delimiter)) {
+ old_text = old_text.substring(0, old_text.last_index_of_char(delimiter[0]) + 1) + (delimiter != " " ? " " : "");
+ } else
+ old_text = "";
+ }
+
+ string new_text = old_text + match + delimiter + (delimiter != " " ? " " : "");
+ entry.set_text(new_text);
+ entry.set_position((int) new_text.length);
+
+ return true;
+ }
+
+ // Find last string after any delimiter
+ private static string get_last_part(string s, string delimiter) {
+ string[] split = s.split(delimiter);
+
+ if((split != null) && (split[0] != null)) {
+ return split[split.length - 1];
+ } else {
+ return "";
+ }
+ }
+}
diff --git a/src/dialogs/ExportDialog.c b/src/dialogs/ExportDialog.c
new file mode 100644
index 0000000..f20dd78
--- /dev/null
+++ b/src/dialogs/ExportDialog.c
@@ -0,0 +1,2084 @@
+/* ExportDialog.c generated by valac 0.40.4, the Vala compiler
+ * generated from ExportDialog.vala, do not modify */
+
+/* Copyright 2016 Software Freedom Conservancy Inc.
+ * Copyright 2017 Jens Georg <mail@jensge.org>
+ *
+ * This software is licensed under the GNU LGPL (version 2.1 or later).
+ * See the COPYING file in this distribution.
+ */
+
+
+#include <glib.h>
+#include <glib-object.h>
+#include <gtk/gtk.h>
+#include <gee.h>
+#include <stdlib.h>
+#include <string.h>
+#include <glib/gi18n-lib.h>
+
+
+#define TYPE_EXPORT_DIALOG (export_dialog_get_type ())
+#define EXPORT_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_EXPORT_DIALOG, ExportDialog))
+#define EXPORT_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_EXPORT_DIALOG, ExportDialogClass))
+#define IS_EXPORT_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_EXPORT_DIALOG))
+#define IS_EXPORT_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_EXPORT_DIALOG))
+#define EXPORT_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_EXPORT_DIALOG, ExportDialogClass))
+
+typedef struct _ExportDialog ExportDialog;
+typedef struct _ExportDialogClass ExportDialogClass;
+typedef struct _ExportDialogPrivate ExportDialogPrivate;
+enum {
+ EXPORT_DIALOG_0_PROPERTY,
+ EXPORT_DIALOG_NUM_PROPERTIES
+};
+static GParamSpec* export_dialog_properties[EXPORT_DIALOG_NUM_PROPERTIES];
+
+#define TYPE_SCALE_CONSTRAINT (scale_constraint_get_type ())
+
+#define TYPE_EXPORT_FORMAT_PARAMETERS (export_format_parameters_get_type ())
+
+#define TYPE_EXPORT_FORMAT_MODE (export_format_mode_get_type ())
+
+#define TYPE_PHOTO_FILE_FORMAT (photo_file_format_get_type ())
+
+#define JPEG_TYPE_QUALITY (jpeg_quality_get_type ())
+typedef struct _ExportFormatParameters ExportFormatParameters;
+#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
+
+#define TYPE_CONFIGURATION_FACADE (configuration_facade_get_type ())
+#define CONFIGURATION_FACADE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CONFIGURATION_FACADE, ConfigurationFacade))
+#define CONFIGURATION_FACADE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CONFIGURATION_FACADE, ConfigurationFacadeClass))
+#define IS_CONFIGURATION_FACADE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CONFIGURATION_FACADE))
+#define IS_CONFIGURATION_FACADE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CONFIGURATION_FACADE))
+#define CONFIGURATION_FACADE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CONFIGURATION_FACADE, ConfigurationFacadeClass))
+
+typedef struct _ConfigurationFacade ConfigurationFacade;
+typedef struct _ConfigurationFacadeClass ConfigurationFacadeClass;
+
+#define CONFIG_TYPE_FACADE (config_facade_get_type ())
+#define CONFIG_FACADE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONFIG_TYPE_FACADE, ConfigFacade))
+#define CONFIG_FACADE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONFIG_TYPE_FACADE, ConfigFacadeClass))
+#define CONFIG_IS_FACADE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONFIG_TYPE_FACADE))
+#define CONFIG_IS_FACADE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONFIG_TYPE_FACADE))
+#define CONFIG_FACADE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONFIG_TYPE_FACADE, ConfigFacadeClass))
+
+typedef struct _ConfigFacade ConfigFacade;
+typedef struct _ConfigFacadeClass ConfigFacadeClass;
+#define _g_free0(var) (var = (g_free (var), NULL))
+
+#define TYPE_PHOTO_FILE_FORMAT_PROPERTIES (photo_file_format_properties_get_type ())
+#define PHOTO_FILE_FORMAT_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHOTO_FILE_FORMAT_PROPERTIES, PhotoFileFormatProperties))
+#define PHOTO_FILE_FORMAT_PROPERTIES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHOTO_FILE_FORMAT_PROPERTIES, PhotoFileFormatPropertiesClass))
+#define IS_PHOTO_FILE_FORMAT_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHOTO_FILE_FORMAT_PROPERTIES))
+#define IS_PHOTO_FILE_FORMAT_PROPERTIES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHOTO_FILE_FORMAT_PROPERTIES))
+#define PHOTO_FILE_FORMAT_PROPERTIES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHOTO_FILE_FORMAT_PROPERTIES, PhotoFileFormatPropertiesClass))
+
+typedef struct _PhotoFileFormatProperties PhotoFileFormatProperties;
+typedef struct _PhotoFileFormatPropertiesClass PhotoFileFormatPropertiesClass;
+#define _photo_file_format_properties_unref0(var) ((var == NULL) ? NULL : (var = (photo_file_format_properties_unref (var), NULL)))
+#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
+#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
+#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
+#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
+
+struct _ExportDialog {
+ GtkDialog parent_instance;
+ ExportDialogPrivate * priv;
+};
+
+struct _ExportDialogClass {
+ GtkDialogClass parent_class;
+};
+
+struct _ExportDialogPrivate {
+ GtkGrid* table;
+ GtkComboBoxText* quality_combo;
+ GtkComboBoxText* constraint_combo;
+ GtkComboBoxText* format_combo;
+ GtkSwitch* export_metadata;
+ GeeArrayList* format_options;
+ GtkEntry* pixels_entry;
+ GtkWidget* ok_button;
+ gboolean in_insert;
+};
+
+typedef enum {
+ SCALE_CONSTRAINT_ORIGINAL,
+ SCALE_CONSTRAINT_DIMENSIONS,
+ SCALE_CONSTRAINT_WIDTH,
+ SCALE_CONSTRAINT_HEIGHT,
+ SCALE_CONSTRAINT_FILL_VIEWPORT
+} ScaleConstraint;
+
+typedef enum {
+ EXPORT_FORMAT_MODE_UNMODIFIED,
+ EXPORT_FORMAT_MODE_CURRENT,
+ EXPORT_FORMAT_MODE_SPECIFIED,
+ EXPORT_FORMAT_MODE_LAST
+} ExportFormatMode;
+
+typedef enum {
+ PHOTO_FILE_FORMAT_JFIF,
+ PHOTO_FILE_FORMAT_RAW,
+ PHOTO_FILE_FORMAT_PNG,
+ PHOTO_FILE_FORMAT_TIFF,
+ PHOTO_FILE_FORMAT_BMP,
+ PHOTO_FILE_FORMAT_UNKNOWN
+} PhotoFileFormat;
+
+typedef enum {
+ JPEG_QUALITY_LOW = 50,
+ JPEG_QUALITY_MEDIUM = 75,
+ JPEG_QUALITY_HIGH = 90,
+ JPEG_QUALITY_MAXIMUM = 100
+} JpegQuality;
+
+struct _ExportFormatParameters {
+ ExportFormatMode mode;
+ PhotoFileFormat specified_format;
+ JpegQuality quality;
+ gboolean export_metadata;
+};
+
+
+static gpointer export_dialog_parent_class = NULL;
+static ScaleConstraint export_dialog_current_constraint;
+static ScaleConstraint export_dialog_current_constraint = SCALE_CONSTRAINT_ORIGINAL;
+static ExportFormatParameters export_dialog_current_parameters;
+static ExportFormatParameters export_dialog_current_parameters = {0};
+static gint export_dialog_current_scale;
+static gint export_dialog_current_scale = 0;
+
+GType export_dialog_get_type (void) G_GNUC_CONST;
+#define EXPORT_DIALOG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_EXPORT_DIALOG, ExportDialogPrivate))
+GType scale_constraint_get_type (void) G_GNUC_CONST;
+GType export_format_parameters_get_type (void) G_GNUC_CONST;
+GType export_format_mode_get_type (void) G_GNUC_CONST;
+GType photo_file_format_get_type (void) G_GNUC_CONST;
+GType jpeg_quality_get_type (void) G_GNUC_CONST;
+ExportFormatParameters* export_format_parameters_dup (const ExportFormatParameters* self);
+void export_format_parameters_free (ExportFormatParameters* self);
+void export_format_parameters_current (ExportFormatParameters* result);
+#define EXPORT_DIALOG_DEFAULT_SCALE 1200
+#define EXPORT_DIALOG_NUM_SPECIAL_FORMATS 2
+#define EXPORT_DIALOG_UNMODIFIED_FORMAT_LABEL _ ("Unmodified")
+#define EXPORT_DIALOG_CURRENT_FORMAT_LABEL _ ("Current")
+ExportDialog* export_dialog_new (const gchar* title);
+ExportDialog* export_dialog_construct (GType object_type,
+ const gchar* title);
+gint resources_use_header_bar (void);
+GType configuration_facade_get_type (void) G_GNUC_CONST;
+GType config_facade_get_type (void) G_GNUC_CONST;
+ConfigFacade* config_facade_get_instance (void);
+ExportFormatMode configuration_facade_get_export_export_format_mode (ConfigurationFacade* self);
+PhotoFileFormat configuration_facade_get_export_photo_file_format (ConfigurationFacade* self);
+JpegQuality configuration_facade_get_export_quality (ConfigurationFacade* self);
+gboolean configuration_facade_get_export_export_metadata (ConfigurationFacade* self);
+ScaleConstraint configuration_facade_get_export_constraint (ConfigurationFacade* self);
+gint configuration_facade_get_export_scale (ConfigurationFacade* self);
+gchar* jpeg_quality_to_string (JpegQuality self);
+gchar* scale_constraint_to_string (ScaleConstraint self);
+static void export_dialog_format_add_option (ExportDialog* self,
+ const gchar* format_name);
+PhotoFileFormat* photo_file_format_get_writeable (int* result_length1);
+gpointer photo_file_format_properties_ref (gpointer instance);
+void photo_file_format_properties_unref (gpointer instance);
+GParamSpec* param_spec_photo_file_format_properties (const gchar* name,
+ const gchar* nick,
+ const gchar* blurb,
+ GType object_type,
+ GParamFlags flags);
+void value_set_photo_file_format_properties (GValue* value,
+ gpointer v_object);
+void value_take_photo_file_format_properties (GValue* value,
+ gpointer v_object);
+gpointer value_get_photo_file_format_properties (const GValue* value);
+GType photo_file_format_properties_get_type (void) G_GNUC_CONST;
+PhotoFileFormatProperties* photo_file_format_get_properties (PhotoFileFormat self);
+gchar* photo_file_format_properties_get_user_visible_name (PhotoFileFormatProperties* self);
+static void export_dialog_on_constraint_changed (ExportDialog* self);
+static void _export_dialog_on_constraint_changed_gtk_combo_box_changed (GtkComboBox* _sender,
+ gpointer self);
+static void export_dialog_on_format_changed (ExportDialog* self);
+static void _export_dialog_on_format_changed_gtk_combo_box_changed (GtkComboBox* _sender,
+ gpointer self);
+static void export_dialog_on_pixels_changed (ExportDialog* self);
+static void _export_dialog_on_pixels_changed_gtk_editable_changed (GtkEditable* _sender,
+ gpointer self);
+static void export_dialog_on_pixels_insert_text (ExportDialog* self,
+ const gchar* text,
+ gint length,
+ gint* position);
+static void _export_dialog_on_pixels_insert_text_gtk_editable_insert_text (GtkEditable* _sender,
+ const gchar* new_text,
+ gint new_text_length,
+ gint* position,
+ gpointer self);
+static void export_dialog_on_activate (ExportDialog* self);
+static void _export_dialog_on_activate_gtk_entry_activate (GtkEntry* _sender,
+ gpointer self);
+static void export_dialog_add_label (ExportDialog* self,
+ const gchar* text,
+ gint x,
+ gint y,
+ GtkWidget* widget);
+static void export_dialog_add_control (ExportDialog* self,
+ GtkWidget* widget,
+ gint x,
+ gint y);
+#define RESOURCES_CANCEL_LABEL _ ("_Cancel")
+#define RESOURCES_OK_LABEL _ ("_OK")
+static void export_dialog_format_set_active_text (ExportDialog* self,
+ const gchar* text);
+static PhotoFileFormat export_dialog_get_specified_format (ExportDialog* self);
+static gchar* export_dialog_get_label_for_parameters (ExportDialog* self,
+ ExportFormatParameters* params);
+gboolean export_dialog_execute (ExportDialog* self,
+ gint* scale,
+ ScaleConstraint* constraint,
+ ExportFormatParameters* parameters);
+gboolean photo_file_format_can_write (PhotoFileFormat self);
+PhotoFileFormat photo_file_format_get_system_default_format (void);
+void configuration_facade_set_export_export_format_mode (ConfigurationFacade* self,
+ ExportFormatMode export_format_mode);
+void configuration_facade_set_export_photo_file_format (ConfigurationFacade* self,
+ PhotoFileFormat photo_file_format);
+void configuration_facade_set_export_quality (ConfigurationFacade* self,
+ JpegQuality quality);
+void configuration_facade_set_export_export_metadata (ConfigurationFacade* self,
+ gboolean export_metadata);
+void configuration_facade_set_export_constraint (ConfigurationFacade* self,
+ ScaleConstraint constraint);
+void configuration_facade_set_export_scale (ConfigurationFacade* self,
+ gint scale);
+static void export_dialog_finalize (GObject * obj);
+
+const ScaleConstraint EXPORT_DIALOG_CONSTRAINT_ARRAY[4] = {SCALE_CONSTRAINT_ORIGINAL, SCALE_CONSTRAINT_DIMENSIONS, SCALE_CONSTRAINT_WIDTH, SCALE_CONSTRAINT_HEIGHT};
+const JpegQuality EXPORT_DIALOG_QUALITY_ARRAY[4] = {JPEG_QUALITY_LOW, JPEG_QUALITY_MEDIUM, JPEG_QUALITY_HIGH, JPEG_QUALITY_MAXIMUM};
+
+static void
+_export_dialog_on_constraint_changed_gtk_combo_box_changed (GtkComboBox* _sender,
+ gpointer self)
+{
+#line 83 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ export_dialog_on_constraint_changed ((ExportDialog*) self);
+#line 267 "ExportDialog.c"
+}
+
+
+static void
+_export_dialog_on_format_changed_gtk_combo_box_changed (GtkComboBox* _sender,
+ gpointer self)
+{
+#line 84 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ export_dialog_on_format_changed ((ExportDialog*) self);
+#line 277 "ExportDialog.c"
+}
+
+
+static void
+_export_dialog_on_pixels_changed_gtk_editable_changed (GtkEditable* _sender,
+ gpointer self)
+{
+#line 85 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ export_dialog_on_pixels_changed ((ExportDialog*) self);
+#line 287 "ExportDialog.c"
+}
+
+
+static void
+_export_dialog_on_pixels_insert_text_gtk_editable_insert_text (GtkEditable* _sender,
+ const gchar* new_text,
+ gint new_text_length,
+ gint* position,
+ gpointer self)
+{
+#line 86 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ export_dialog_on_pixels_insert_text ((ExportDialog*) self, new_text, new_text_length, position);
+#line 300 "ExportDialog.c"
+}
+
+
+static void
+_export_dialog_on_activate_gtk_entry_activate (GtkEntry* _sender,
+ gpointer self)
+{
+#line 87 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ export_dialog_on_activate ((ExportDialog*) self);
+#line 310 "ExportDialog.c"
+}
+
+
+static gpointer
+_g_object_ref0 (gpointer self)
+{
+#line 116 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ return self ? g_object_ref (self) : NULL;
+#line 319 "ExportDialog.c"
+}
+
+
+ExportDialog*
+export_dialog_construct (GType object_type,
+ const gchar* title)
+{
+ ExportDialog * self = NULL;
+ ConfigFacade* config = NULL;
+ ConfigFacade* _tmp0_;
+ ConfigFacade* _tmp1_;
+ ConfigFacade* _tmp2_;
+ ConfigFacade* _tmp3_;
+ ConfigFacade* _tmp4_;
+ ConfigFacade* _tmp5_;
+ ConfigFacade* _tmp6_;
+ GtkComboBoxText* _tmp7_;
+ gint ctr = 0;
+ GtkComboBoxText* _tmp18_;
+ GtkComboBoxText* _tmp28_;
+ gint _tmp29_;
+ PhotoFileFormat* _tmp30_;
+ GtkEntry* _tmp36_;
+ GtkEntry* _tmp37_;
+ GtkEntry* _tmp38_;
+ gint _tmp39_;
+ gchar* _tmp40_;
+ gchar* _tmp41_;
+ GtkComboBoxText* _tmp42_;
+ GtkComboBoxText* _tmp43_;
+ GtkEntry* _tmp44_;
+ GtkEntry* _tmp45_;
+ GtkEntry* _tmp46_;
+ GtkComboBoxText* _tmp47_;
+ GtkComboBoxText* _tmp48_;
+ GtkComboBoxText* _tmp49_;
+ GtkComboBoxText* _tmp50_;
+ GtkComboBoxText* _tmp51_;
+ GtkComboBoxText* _tmp52_;
+ GtkEntry* _tmp53_;
+ GtkEntry* _tmp54_;
+ GtkSwitch* _tmp55_;
+ GtkSwitch* _tmp56_;
+ GtkSwitch* _tmp57_;
+ GtkSwitch* _tmp58_;
+ GtkSwitch* _tmp59_;
+ GtkGrid* _tmp60_;
+ GtkGrid* _tmp61_;
+ GtkGrid* _tmp62_;
+ GtkBox* _tmp63_;
+ GtkGrid* _tmp64_;
+ GtkWidget* _tmp65_;
+ GtkWidget* _tmp66_;
+ GtkWidget* _tmp67_;
+ GtkWidget* _tmp68_;
+ GtkWidget* _tmp69_;
+ ScaleConstraint _tmp70_;
+ GtkWidget* _tmp73_;
+#line 38 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ g_return_val_if_fail (title != NULL, NULL);
+#line 39 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ self = (ExportDialog*) g_object_new (object_type, "use-header-bar", resources_use_header_bar (), NULL);
+#line 41 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_window_set_title (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), title);
+#line 42 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_window_set_resizable (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), FALSE);
+#line 45 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp0_ = config_facade_get_instance ();
+#line 45 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ config = _tmp0_;
+#line 46 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp1_ = config;
+#line 46 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ export_dialog_current_parameters.mode = configuration_facade_get_export_export_format_mode (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
+#line 47 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp2_ = config;
+#line 47 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ export_dialog_current_parameters.specified_format = configuration_facade_get_export_photo_file_format (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
+#line 48 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp3_ = config;
+#line 48 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ export_dialog_current_parameters.quality = configuration_facade_get_export_quality (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
+#line 49 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp4_ = config;
+#line 49 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ export_dialog_current_parameters.export_metadata = configuration_facade_get_export_export_metadata (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
+#line 50 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp5_ = config;
+#line 50 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ export_dialog_current_constraint = configuration_facade_get_export_constraint (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
+#line 51 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp6_ = config;
+#line 51 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ export_dialog_current_scale = configuration_facade_get_export_scale (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
+#line 53 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp7_ = (GtkComboBoxText*) gtk_combo_box_text_new ();
+#line 53 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ g_object_ref_sink (_tmp7_);
+#line 53 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _g_object_unref0 (self->priv->quality_combo);
+#line 53 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ self->priv->quality_combo = _tmp7_;
+#line 54 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ ctr = 0;
+#line 424 "ExportDialog.c"
+ {
+ JpegQuality* quality_collection = NULL;
+ gint quality_collection_length1 = 0;
+ gint _quality_collection_size_ = 0;
+ gint quality_it = 0;
+#line 55 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ quality_collection = EXPORT_DIALOG_QUALITY_ARRAY;
+#line 55 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ quality_collection_length1 = G_N_ELEMENTS (EXPORT_DIALOG_QUALITY_ARRAY);
+#line 55 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ for (quality_it = 0; quality_it < G_N_ELEMENTS (EXPORT_DIALOG_QUALITY_ARRAY); quality_it = quality_it + 1) {
+#line 436 "ExportDialog.c"
+ JpegQuality quality = 0;
+#line 55 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ quality = quality_collection[quality_it];
+#line 440 "ExportDialog.c"
+ {
+ GtkComboBoxText* _tmp8_;
+ JpegQuality _tmp9_;
+ gchar* _tmp10_;
+ gchar* _tmp11_;
+ JpegQuality _tmp12_;
+ ExportFormatParameters _tmp13_;
+ JpegQuality _tmp14_;
+ gint _tmp17_;
+#line 56 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp8_ = self->priv->quality_combo;
+#line 56 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp9_ = quality;
+#line 56 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp10_ = jpeg_quality_to_string (_tmp9_);
+#line 56 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp11_ = _tmp10_;
+#line 56 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_combo_box_text_append_text (_tmp8_, _tmp11_);
+#line 56 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _g_free0 (_tmp11_);
+#line 57 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp12_ = quality;
+#line 57 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp13_ = export_dialog_current_parameters;
+#line 57 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp14_ = _tmp13_.quality;
+#line 57 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ if (_tmp12_ == _tmp14_) {
+#line 470 "ExportDialog.c"
+ GtkComboBoxText* _tmp15_;
+ gint _tmp16_;
+#line 58 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp15_ = self->priv->quality_combo;
+#line 58 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp16_ = ctr;
+#line 58 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_combo_box_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, gtk_combo_box_get_type (), GtkComboBox), _tmp16_);
+#line 479 "ExportDialog.c"
+ }
+#line 59 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp17_ = ctr;
+#line 59 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ ctr = _tmp17_ + 1;
+#line 485 "ExportDialog.c"
+ }
+ }
+ }
+#line 62 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp18_ = (GtkComboBoxText*) gtk_combo_box_text_new ();
+#line 62 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ g_object_ref_sink (_tmp18_);
+#line 62 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _g_object_unref0 (self->priv->constraint_combo);
+#line 62 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ self->priv->constraint_combo = _tmp18_;
+#line 63 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ ctr = 0;
+#line 499 "ExportDialog.c"
+ {
+ ScaleConstraint* constraint_collection = NULL;
+ gint constraint_collection_length1 = 0;
+ gint _constraint_collection_size_ = 0;
+ gint constraint_it = 0;
+#line 64 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ constraint_collection = EXPORT_DIALOG_CONSTRAINT_ARRAY;
+#line 64 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ constraint_collection_length1 = G_N_ELEMENTS (EXPORT_DIALOG_CONSTRAINT_ARRAY);
+#line 64 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ for (constraint_it = 0; constraint_it < G_N_ELEMENTS (EXPORT_DIALOG_CONSTRAINT_ARRAY); constraint_it = constraint_it + 1) {
+#line 511 "ExportDialog.c"
+ ScaleConstraint constraint = 0;
+#line 64 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ constraint = constraint_collection[constraint_it];
+#line 515 "ExportDialog.c"
+ {
+ GtkComboBoxText* _tmp19_;
+ ScaleConstraint _tmp20_;
+ gchar* _tmp21_;
+ gchar* _tmp22_;
+ ScaleConstraint _tmp23_;
+ ScaleConstraint _tmp24_;
+ gint _tmp27_;
+#line 65 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp19_ = self->priv->constraint_combo;
+#line 65 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp20_ = constraint;
+#line 65 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp21_ = scale_constraint_to_string (_tmp20_);
+#line 65 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp22_ = _tmp21_;
+#line 65 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_combo_box_text_append_text (_tmp19_, _tmp22_);
+#line 65 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _g_free0 (_tmp22_);
+#line 66 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp23_ = constraint;
+#line 66 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp24_ = export_dialog_current_constraint;
+#line 66 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ if (_tmp23_ == _tmp24_) {
+#line 542 "ExportDialog.c"
+ GtkComboBoxText* _tmp25_;
+ gint _tmp26_;
+#line 67 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp25_ = self->priv->constraint_combo;
+#line 67 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp26_ = ctr;
+#line 67 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_combo_box_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, gtk_combo_box_get_type (), GtkComboBox), _tmp26_);
+#line 551 "ExportDialog.c"
+ }
+#line 68 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp27_ = ctr;
+#line 68 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ ctr = _tmp27_ + 1;
+#line 557 "ExportDialog.c"
+ }
+ }
+ }
+#line 71 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp28_ = (GtkComboBoxText*) gtk_combo_box_text_new ();
+#line 71 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ g_object_ref_sink (_tmp28_);
+#line 71 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _g_object_unref0 (self->priv->format_combo);
+#line 71 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ self->priv->format_combo = _tmp28_;
+#line 72 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ export_dialog_format_add_option (self, EXPORT_DIALOG_UNMODIFIED_FORMAT_LABEL);
+#line 73 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ export_dialog_format_add_option (self, EXPORT_DIALOG_CURRENT_FORMAT_LABEL);
+#line 74 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp30_ = photo_file_format_get_writeable (&_tmp29_);
+#line 575 "ExportDialog.c"
+ {
+ PhotoFileFormat* format_collection = NULL;
+ gint format_collection_length1 = 0;
+ gint _format_collection_size_ = 0;
+ gint format_it = 0;
+#line 74 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ format_collection = _tmp30_;
+#line 74 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ format_collection_length1 = _tmp29_;
+#line 74 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ for (format_it = 0; format_it < _tmp29_; format_it = format_it + 1) {
+#line 587 "ExportDialog.c"
+ PhotoFileFormat format = 0;
+#line 74 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ format = format_collection[format_it];
+#line 591 "ExportDialog.c"
+ {
+ PhotoFileFormat _tmp31_;
+ PhotoFileFormatProperties* _tmp32_;
+ PhotoFileFormatProperties* _tmp33_;
+ gchar* _tmp34_;
+ gchar* _tmp35_;
+#line 75 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp31_ = format;
+#line 75 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp32_ = photo_file_format_get_properties (_tmp31_);
+#line 75 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp33_ = _tmp32_;
+#line 75 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp34_ = photo_file_format_properties_get_user_visible_name (_tmp33_);
+#line 75 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp35_ = _tmp34_;
+#line 75 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ export_dialog_format_add_option (self, _tmp35_);
+#line 75 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _g_free0 (_tmp35_);
+#line 75 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _photo_file_format_properties_unref0 (_tmp33_);
+#line 614 "ExportDialog.c"
+ }
+ }
+#line 74 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ format_collection = (g_free (format_collection), NULL);
+#line 619 "ExportDialog.c"
+ }
+#line 78 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp36_ = (GtkEntry*) gtk_entry_new ();
+#line 78 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ g_object_ref_sink (_tmp36_);
+#line 78 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _g_object_unref0 (self->priv->pixels_entry);
+#line 78 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ self->priv->pixels_entry = _tmp36_;
+#line 79 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp37_ = self->priv->pixels_entry;
+#line 79 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_entry_set_max_length (_tmp37_, 6);
+#line 80 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp38_ = self->priv->pixels_entry;
+#line 80 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp39_ = export_dialog_current_scale;
+#line 80 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp40_ = g_strdup_printf ("%d", _tmp39_);
+#line 80 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp41_ = _tmp40_;
+#line 80 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_entry_set_text (_tmp38_, _tmp41_);
+#line 80 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _g_free0 (_tmp41_);
+#line 83 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp42_ = self->priv->constraint_combo;
+#line 83 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp42_, gtk_combo_box_get_type (), GtkComboBox), "changed", (GCallback) _export_dialog_on_constraint_changed_gtk_combo_box_changed, self, 0);
+#line 84 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp43_ = self->priv->format_combo;
+#line 84 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp43_, gtk_combo_box_get_type (), GtkComboBox), "changed", (GCallback) _export_dialog_on_format_changed_gtk_combo_box_changed, self, 0);
+#line 85 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp44_ = self->priv->pixels_entry;
+#line 85 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp44_, gtk_editable_get_type (), GtkEditable), "changed", (GCallback) _export_dialog_on_pixels_changed_gtk_editable_changed, self, 0);
+#line 86 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp45_ = self->priv->pixels_entry;
+#line 86 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp45_, gtk_editable_get_type (), GtkEditable), "insert-text", (GCallback) _export_dialog_on_pixels_insert_text_gtk_editable_insert_text, self, 0);
+#line 87 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp46_ = self->priv->pixels_entry;
+#line 87 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ g_signal_connect_object (_tmp46_, "activate", (GCallback) _export_dialog_on_activate_gtk_entry_activate, self, 0);
+#line 90 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp47_ = self->priv->format_combo;
+#line 90 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ export_dialog_add_label (self, _ ("_Format:"), 0, 0, G_TYPE_CHECK_INSTANCE_CAST (_tmp47_, gtk_widget_get_type (), GtkWidget));
+#line 91 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp48_ = self->priv->format_combo;
+#line 91 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ export_dialog_add_control (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp48_, gtk_widget_get_type (), GtkWidget), 1, 0);
+#line 93 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp49_ = self->priv->quality_combo;
+#line 93 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ export_dialog_add_label (self, _ ("_Quality:"), 0, 1, G_TYPE_CHECK_INSTANCE_CAST (_tmp49_, gtk_widget_get_type (), GtkWidget));
+#line 94 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp50_ = self->priv->quality_combo;
+#line 94 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ export_dialog_add_control (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp50_, gtk_widget_get_type (), GtkWidget), 1, 1);
+#line 96 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp51_ = self->priv->constraint_combo;
+#line 96 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ export_dialog_add_label (self, _ ("_Scaling constraint:"), 0, 2, G_TYPE_CHECK_INSTANCE_CAST (_tmp51_, gtk_widget_get_type (), GtkWidget));
+#line 97 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp52_ = self->priv->constraint_combo;
+#line 97 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ export_dialog_add_control (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp52_, gtk_widget_get_type (), GtkWidget), 1, 2);
+#line 99 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp53_ = self->priv->pixels_entry;
+#line 99 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ export_dialog_add_label (self, _ ("_Pixels:"), 0, 3, G_TYPE_CHECK_INSTANCE_CAST (_tmp53_, gtk_widget_get_type (), GtkWidget));
+#line 100 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp54_ = self->priv->pixels_entry;
+#line 100 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ export_dialog_add_control (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp54_, gtk_widget_get_type (), GtkWidget), 1, 3);
+#line 102 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp55_ = (GtkSwitch*) gtk_switch_new ();
+#line 102 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ g_object_ref_sink (_tmp55_);
+#line 102 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _g_object_unref0 (self->priv->export_metadata);
+#line 102 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ self->priv->export_metadata = _tmp55_;
+#line 103 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp56_ = self->priv->export_metadata;
+#line 103 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ export_dialog_add_label (self, _ ("Export _metadata:"), 0, 4, G_TYPE_CHECK_INSTANCE_CAST (_tmp56_, gtk_widget_get_type (), GtkWidget));
+#line 104 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp57_ = self->priv->export_metadata;
+#line 104 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ export_dialog_add_control (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp57_, gtk_widget_get_type (), GtkWidget), 1, 4);
+#line 105 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp58_ = self->priv->export_metadata;
+#line 105 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_switch_set_active (_tmp58_, TRUE);
+#line 106 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp59_ = self->priv->export_metadata;
+#line 106 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_widget_set_halign (G_TYPE_CHECK_INSTANCE_CAST (_tmp59_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_START);
+#line 108 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp60_ = self->priv->table;
+#line 108 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_grid_set_row_spacing (_tmp60_, (guint) 6);
+#line 109 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp61_ = self->priv->table;
+#line 109 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_grid_set_column_spacing (_tmp61_, (guint) 12);
+#line 110 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp62_ = self->priv->table;
+#line 110 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_container_set_border_width (G_TYPE_CHECK_INSTANCE_CAST (_tmp62_, gtk_container_get_type (), GtkContainer), (guint) 18);
+#line 112 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp63_ = gtk_dialog_get_content_area (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_dialog_get_type (), GtkDialog));
+#line 112 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp64_ = self->priv->table;
+#line 112 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (_tmp63_, gtk_box_get_type (), GtkBox), gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp64_, gtk_widget_get_type (), GtkWidget));
+#line 115 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_dialog_add_button (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_dialog_get_type (), GtkDialog), RESOURCES_CANCEL_LABEL, (gint) GTK_RESPONSE_CANCEL);
+#line 116 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp65_ = gtk_dialog_add_button (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_dialog_get_type (), GtkDialog), RESOURCES_OK_LABEL, (gint) GTK_RESPONSE_OK);
+#line 116 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp66_ = _g_object_ref0 (_tmp65_);
+#line 116 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _g_object_unref0 (self->priv->ok_button);
+#line 116 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ self->priv->ok_button = _tmp66_;
+#line 117 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_dialog_set_default_response (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_dialog_get_type (), GtkDialog), (gint) GTK_RESPONSE_OK);
+#line 119 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp67_ = self->priv->ok_button;
+#line 119 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_widget_set_can_default (_tmp67_, TRUE);
+#line 120 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp68_ = self->priv->ok_button;
+#line 120 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ g_object_set (_tmp68_, "has-default", TRUE, NULL);
+#line 121 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp69_ = self->priv->ok_button;
+#line 121 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_window_set_default (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), _tmp69_);
+#line 123 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp70_ = export_dialog_current_constraint;
+#line 123 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ if (_tmp70_ == SCALE_CONSTRAINT_ORIGINAL) {
+#line 767 "ExportDialog.c"
+ GtkEntry* _tmp71_;
+ GtkComboBoxText* _tmp72_;
+#line 124 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp71_ = self->priv->pixels_entry;
+#line 124 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp71_, gtk_widget_get_type (), GtkWidget), FALSE);
+#line 125 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp72_ = self->priv->quality_combo;
+#line 125 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp72_, gtk_widget_get_type (), GtkWidget), FALSE);
+#line 778 "ExportDialog.c"
+ }
+#line 128 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp73_ = self->priv->ok_button;
+#line 128 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_widget_grab_focus (_tmp73_);
+#line 38 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _g_object_unref0 (config);
+#line 38 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ return self;
+#line 788 "ExportDialog.c"
+}
+
+
+ExportDialog*
+export_dialog_new (const gchar* title)
+{
+#line 38 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ return export_dialog_construct (TYPE_EXPORT_DIALOG, title);
+#line 797 "ExportDialog.c"
+}
+
+
+static void
+export_dialog_format_add_option (ExportDialog* self,
+ const gchar* format_name)
+{
+ GeeArrayList* _tmp0_;
+ GtkComboBoxText* _tmp1_;
+#line 131 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ g_return_if_fail (IS_EXPORT_DIALOG (self));
+#line 131 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ g_return_if_fail (format_name != NULL);
+#line 132 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp0_ = self->priv->format_options;
+#line 132 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), format_name);
+#line 133 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp1_ = self->priv->format_combo;
+#line 133 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_combo_box_text_append_text (_tmp1_, format_name);
+#line 819 "ExportDialog.c"
+}
+
+
+static void
+export_dialog_format_set_active_text (ExportDialog* self,
+ const gchar* text)
+{
+ gint selection_ticker = 0;
+#line 136 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ g_return_if_fail (IS_EXPORT_DIALOG (self));
+#line 136 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ g_return_if_fail (text != NULL);
+#line 137 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ selection_ticker = 0;
+#line 834 "ExportDialog.c"
+ {
+ GeeArrayList* _current_text_list = NULL;
+ GeeArrayList* _tmp0_;
+ GeeArrayList* _tmp1_;
+ gint _current_text_size = 0;
+ GeeArrayList* _tmp2_;
+ gint _tmp3_;
+ gint _tmp4_;
+ gint _current_text_index = 0;
+#line 139 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp0_ = self->priv->format_options;
+#line 139 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp1_ = _g_object_ref0 (_tmp0_);
+#line 139 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _current_text_list = _tmp1_;
+#line 139 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp2_ = _current_text_list;
+#line 139 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp3_ = gee_abstract_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection));
+#line 139 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp4_ = _tmp3_;
+#line 139 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _current_text_size = _tmp4_;
+#line 139 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _current_text_index = -1;
+#line 139 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ while (TRUE) {
+#line 862 "ExportDialog.c"
+ gint _tmp5_;
+ gint _tmp6_;
+ gint _tmp7_;
+ gchar* current_text = NULL;
+ GeeArrayList* _tmp8_;
+ gint _tmp9_;
+ gpointer _tmp10_;
+ const gchar* _tmp11_;
+ gint _tmp14_;
+#line 139 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp5_ = _current_text_index;
+#line 139 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _current_text_index = _tmp5_ + 1;
+#line 139 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp6_ = _current_text_index;
+#line 139 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp7_ = _current_text_size;
+#line 139 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ if (!(_tmp6_ < _tmp7_)) {
+#line 139 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ break;
+#line 884 "ExportDialog.c"
+ }
+#line 139 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp8_ = _current_text_list;
+#line 139 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp9_ = _current_text_index;
+#line 139 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp10_ = gee_abstract_list_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, GEE_TYPE_ABSTRACT_LIST, GeeAbstractList), _tmp9_);
+#line 139 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ current_text = (gchar*) _tmp10_;
+#line 140 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp11_ = current_text;
+#line 140 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ if (g_strcmp0 (_tmp11_, text) == 0) {
+#line 898 "ExportDialog.c"
+ GtkComboBoxText* _tmp12_;
+ gint _tmp13_;
+#line 141 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp12_ = self->priv->format_combo;
+#line 141 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp13_ = selection_ticker;
+#line 141 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_combo_box_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, gtk_combo_box_get_type (), GtkComboBox), _tmp13_);
+#line 142 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _g_free0 (current_text);
+#line 142 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _g_object_unref0 (_current_text_list);
+#line 142 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ return;
+#line 913 "ExportDialog.c"
+ }
+#line 144 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp14_ = selection_ticker;
+#line 144 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ selection_ticker = _tmp14_ + 1;
+#line 139 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _g_free0 (current_text);
+#line 921 "ExportDialog.c"
+ }
+#line 139 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _g_object_unref0 (_current_text_list);
+#line 925 "ExportDialog.c"
+ }
+#line 147 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ g_error ("ExportDialog.vala:147: format_set_active_text: text '%s' isn't in comb" \
+"o box", text);
+#line 929 "ExportDialog.c"
+}
+
+
+static PhotoFileFormat
+export_dialog_get_specified_format (ExportDialog* self)
+{
+ PhotoFileFormat result = 0;
+ gint index = 0;
+ GtkComboBoxText* _tmp0_;
+ gint _tmp1_;
+ gint _tmp2_;
+ PhotoFileFormat* writeable_formats = NULL;
+ gint _tmp3_;
+ PhotoFileFormat* _tmp4_;
+ gint writeable_formats_length1;
+ gint _writeable_formats_size_;
+ gint _tmp5_;
+ PhotoFileFormat _tmp6_;
+#line 150 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ g_return_val_if_fail (IS_EXPORT_DIALOG (self), 0);
+#line 151 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp0_ = self->priv->format_combo;
+#line 151 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ index = gtk_combo_box_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_combo_box_get_type (), GtkComboBox));
+#line 152 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp1_ = index;
+#line 152 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ if (_tmp1_ < EXPORT_DIALOG_NUM_SPECIAL_FORMATS) {
+#line 153 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ index = EXPORT_DIALOG_NUM_SPECIAL_FORMATS;
+#line 960 "ExportDialog.c"
+ }
+#line 155 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp2_ = index;
+#line 155 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ index = _tmp2_ - EXPORT_DIALOG_NUM_SPECIAL_FORMATS;
+#line 156 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp4_ = photo_file_format_get_writeable (&_tmp3_);
+#line 156 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ writeable_formats = _tmp4_;
+#line 156 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ writeable_formats_length1 = _tmp3_;
+#line 156 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _writeable_formats_size_ = writeable_formats_length1;
+#line 157 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp5_ = index;
+#line 157 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp6_ = writeable_formats[_tmp5_];
+#line 157 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ result = _tmp6_;
+#line 157 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ writeable_formats = (g_free (writeable_formats), NULL);
+#line 157 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ return result;
+#line 984 "ExportDialog.c"
+}
+
+
+static gchar*
+export_dialog_get_label_for_parameters (ExportDialog* self,
+ ExportFormatParameters* params)
+{
+ gchar* result = NULL;
+ ExportFormatParameters _tmp0_;
+ ExportFormatMode _tmp1_;
+#line 160 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ g_return_val_if_fail (IS_EXPORT_DIALOG (self), NULL);
+#line 160 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ g_return_val_if_fail (params != NULL, NULL);
+#line 161 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp0_ = *params;
+#line 161 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp1_ = _tmp0_.mode;
+#line 161 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ switch (_tmp1_) {
+#line 161 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ case EXPORT_FORMAT_MODE_UNMODIFIED:
+#line 1007 "ExportDialog.c"
+ {
+ gchar* _tmp2_;
+#line 163 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp2_ = g_strdup (EXPORT_DIALOG_UNMODIFIED_FORMAT_LABEL);
+#line 163 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ result = _tmp2_;
+#line 163 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ return result;
+#line 1016 "ExportDialog.c"
+ }
+#line 161 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ case EXPORT_FORMAT_MODE_CURRENT:
+#line 1020 "ExportDialog.c"
+ {
+ gchar* _tmp3_;
+#line 166 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp3_ = g_strdup (EXPORT_DIALOG_CURRENT_FORMAT_LABEL);
+#line 166 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ result = _tmp3_;
+#line 166 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ return result;
+#line 1029 "ExportDialog.c"
+ }
+#line 161 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ case EXPORT_FORMAT_MODE_SPECIFIED:
+#line 1033 "ExportDialog.c"
+ {
+ ExportFormatParameters _tmp4_;
+ PhotoFileFormat _tmp5_;
+ PhotoFileFormatProperties* _tmp6_;
+ PhotoFileFormatProperties* _tmp7_;
+ gchar* _tmp8_;
+ gchar* _tmp9_;
+#line 169 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp4_ = *params;
+#line 169 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp5_ = _tmp4_.specified_format;
+#line 169 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp6_ = photo_file_format_get_properties (_tmp5_);
+#line 169 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp7_ = _tmp6_;
+#line 169 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp8_ = photo_file_format_properties_get_user_visible_name (_tmp7_);
+#line 169 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp9_ = _tmp8_;
+#line 169 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _photo_file_format_properties_unref0 (_tmp7_);
+#line 169 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ result = _tmp9_;
+#line 169 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ return result;
+#line 1059 "ExportDialog.c"
+ }
+ default:
+ {
+#line 172 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ g_error ("ExportDialog.vala:172: get_label_for_parameters: unrecognized export f" \
+"ormat mode");
+#line 1065 "ExportDialog.c"
+ }
+ }
+}
+
+
+gboolean
+export_dialog_execute (ExportDialog* self,
+ gint* scale,
+ ScaleConstraint* constraint,
+ ExportFormatParameters* parameters)
+{
+ gint _vala_scale = 0;
+ ScaleConstraint _vala_constraint = 0;
+ gboolean result = FALSE;
+ ExportFormatParameters _tmp0_;
+ ExportFormatMode _tmp1_;
+ ExportFormatParameters _tmp4_;
+ ExportFormatMode _tmp5_;
+ ExportFormatParameters _tmp12_;
+ gchar* _tmp13_;
+ gchar* _tmp14_;
+ gboolean ok = FALSE;
+ gboolean _tmp15_;
+#line 179 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ g_return_val_if_fail (IS_EXPORT_DIALOG (self), FALSE);
+#line 179 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ g_return_val_if_fail (parameters != NULL, FALSE);
+#line 181 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_widget_show_all (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
+#line 185 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp0_ = *parameters;
+#line 185 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp1_ = _tmp0_.mode;
+#line 185 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ if (_tmp1_ != EXPORT_FORMAT_MODE_LAST) {
+#line 1101 "ExportDialog.c"
+ ScaleConstraint _tmp2_;
+ GtkComboBoxText* _tmp3_;
+#line 186 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _vala_constraint = SCALE_CONSTRAINT_ORIGINAL;
+#line 186 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp2_ = _vala_constraint;
+#line 186 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ export_dialog_current_constraint = _tmp2_;
+#line 187 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp3_ = self->priv->constraint_combo;
+#line 187 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_combo_box_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_combo_box_get_type (), GtkComboBox), 0);
+#line 1114 "ExportDialog.c"
+ }
+#line 190 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp4_ = *parameters;
+#line 190 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp5_ = _tmp4_.mode;
+#line 190 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ if (_tmp5_ == EXPORT_FORMAT_MODE_LAST) {
+#line 1122 "ExportDialog.c"
+ ExportFormatParameters _tmp6_;
+#line 191 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp6_ = export_dialog_current_parameters;
+#line 191 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ *parameters = _tmp6_;
+#line 1128 "ExportDialog.c"
+ } else {
+ gboolean _tmp7_ = FALSE;
+ ExportFormatParameters _tmp8_;
+ ExportFormatMode _tmp9_;
+#line 192 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp8_ = *parameters;
+#line 192 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp9_ = _tmp8_.mode;
+#line 192 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ if (_tmp9_ == EXPORT_FORMAT_MODE_SPECIFIED) {
+#line 1139 "ExportDialog.c"
+ ExportFormatParameters _tmp10_;
+ PhotoFileFormat _tmp11_;
+#line 192 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp10_ = *parameters;
+#line 192 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp11_ = _tmp10_.specified_format;
+#line 192 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp7_ = !photo_file_format_can_write (_tmp11_);
+#line 1148 "ExportDialog.c"
+ } else {
+#line 192 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp7_ = FALSE;
+#line 1152 "ExportDialog.c"
+ }
+#line 192 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ if (_tmp7_) {
+#line 193 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ (*parameters).specified_format = photo_file_format_get_system_default_format ();
+#line 1158 "ExportDialog.c"
+ }
+ }
+#line 195 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp12_ = *parameters;
+#line 195 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp13_ = export_dialog_get_label_for_parameters (self, &_tmp12_);
+#line 195 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp14_ = _tmp13_;
+#line 195 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ export_dialog_format_set_active_text (self, _tmp14_);
+#line 195 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _g_free0 (_tmp14_);
+#line 196 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ export_dialog_on_format_changed (self);
+#line 198 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ ok = gtk_dialog_run (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_dialog_get_type (), GtkDialog)) == ((gint) GTK_RESPONSE_OK);
+#line 199 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp15_ = ok;
+#line 199 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ if (_tmp15_) {
+#line 1179 "ExportDialog.c"
+ gint index = 0;
+ GtkComboBoxText* _tmp16_;
+ gint _tmp17_;
+ gint _tmp18_;
+ ScaleConstraint _tmp19_;
+ ScaleConstraint _tmp20_;
+ GtkEntry* _tmp21_;
+ const gchar* _tmp22_;
+ ScaleConstraint _tmp23_;
+ gint _tmp25_;
+ gboolean _tmp26_ = FALSE;
+ GtkSwitch* _tmp27_;
+ gboolean _tmp28_;
+ gboolean _tmp29_;
+ GtkComboBoxText* _tmp33_;
+ gchar* _tmp34_;
+ gchar* _tmp35_;
+ gboolean _tmp36_;
+ ConfigFacade* config = NULL;
+ ConfigFacade* _tmp50_;
+ ConfigFacade* _tmp51_;
+ ExportFormatParameters _tmp52_;
+ ExportFormatMode _tmp53_;
+ ConfigFacade* _tmp54_;
+ ExportFormatParameters _tmp55_;
+ PhotoFileFormat _tmp56_;
+ ConfigFacade* _tmp57_;
+ ExportFormatParameters _tmp58_;
+ JpegQuality _tmp59_;
+ ConfigFacade* _tmp60_;
+ ExportFormatParameters _tmp61_;
+ gboolean _tmp62_;
+ ConfigFacade* _tmp63_;
+ ScaleConstraint _tmp64_;
+ ConfigFacade* _tmp65_;
+ gint _tmp66_;
+#line 200 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp16_ = self->priv->constraint_combo;
+#line 200 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ index = gtk_combo_box_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, gtk_combo_box_get_type (), GtkComboBox));
+#line 201 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp17_ = index;
+#line 201 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _vala_assert (_tmp17_ >= 0, "index >= 0");
+#line 202 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp18_ = index;
+#line 202 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp19_ = EXPORT_DIALOG_CONSTRAINT_ARRAY[_tmp18_];
+#line 202 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _vala_constraint = _tmp19_;
+#line 203 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp20_ = _vala_constraint;
+#line 203 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ export_dialog_current_constraint = _tmp20_;
+#line 205 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp21_ = self->priv->pixels_entry;
+#line 205 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp22_ = gtk_entry_get_text (_tmp21_);
+#line 205 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _vala_scale = atoi (_tmp22_);
+#line 206 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp23_ = _vala_constraint;
+#line 206 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ if (_tmp23_ != SCALE_CONSTRAINT_ORIGINAL) {
+#line 1244 "ExportDialog.c"
+ gint _tmp24_;
+#line 207 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp24_ = _vala_scale;
+#line 207 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _vala_assert (_tmp24_ > 0, "scale > 0");
+#line 1250 "ExportDialog.c"
+ }
+#line 208 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp25_ = _vala_scale;
+#line 208 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ export_dialog_current_scale = _tmp25_;
+#line 210 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp27_ = self->priv->export_metadata;
+#line 210 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp28_ = gtk_widget_get_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp27_, gtk_widget_get_type (), GtkWidget));
+#line 210 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp29_ = _tmp28_;
+#line 210 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ if (_tmp29_) {
+#line 1264 "ExportDialog.c"
+ GtkSwitch* _tmp30_;
+ gboolean _tmp31_;
+ gboolean _tmp32_;
+#line 210 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp30_ = self->priv->export_metadata;
+#line 210 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp31_ = gtk_switch_get_active (_tmp30_);
+#line 210 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp32_ = _tmp31_;
+#line 210 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp26_ = _tmp32_;
+#line 1276 "ExportDialog.c"
+ } else {
+#line 210 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp26_ = FALSE;
+#line 1280 "ExportDialog.c"
+ }
+#line 210 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ (*parameters).export_metadata = _tmp26_;
+#line 212 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp33_ = self->priv->format_combo;
+#line 212 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp34_ = gtk_combo_box_text_get_active_text (_tmp33_);
+#line 212 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp35_ = _tmp34_;
+#line 212 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp36_ = g_strcmp0 (_tmp35_, EXPORT_DIALOG_UNMODIFIED_FORMAT_LABEL) == 0;
+#line 212 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _g_free0 (_tmp35_);
+#line 212 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ if (_tmp36_) {
+#line 1296 "ExportDialog.c"
+ ExportFormatMode _tmp37_;
+#line 213 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ export_dialog_current_parameters.mode = EXPORT_FORMAT_MODE_UNMODIFIED;
+#line 213 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp37_ = export_dialog_current_parameters.mode;
+#line 213 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ (*parameters).mode = _tmp37_;
+#line 1304 "ExportDialog.c"
+ } else {
+ GtkComboBoxText* _tmp38_;
+ gchar* _tmp39_;
+ gchar* _tmp40_;
+ gboolean _tmp41_;
+#line 214 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp38_ = self->priv->format_combo;
+#line 214 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp39_ = gtk_combo_box_text_get_active_text (_tmp38_);
+#line 214 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp40_ = _tmp39_;
+#line 214 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp41_ = g_strcmp0 (_tmp40_, EXPORT_DIALOG_CURRENT_FORMAT_LABEL) == 0;
+#line 214 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _g_free0 (_tmp40_);
+#line 214 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ if (_tmp41_) {
+#line 1322 "ExportDialog.c"
+ ExportFormatMode _tmp42_;
+#line 215 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ export_dialog_current_parameters.mode = EXPORT_FORMAT_MODE_CURRENT;
+#line 215 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp42_ = export_dialog_current_parameters.mode;
+#line 215 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ (*parameters).mode = _tmp42_;
+#line 1330 "ExportDialog.c"
+ } else {
+ ExportFormatMode _tmp43_;
+ PhotoFileFormat _tmp44_;
+ ExportFormatParameters _tmp45_;
+ PhotoFileFormat _tmp46_;
+#line 217 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ export_dialog_current_parameters.mode = EXPORT_FORMAT_MODE_SPECIFIED;
+#line 217 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp43_ = export_dialog_current_parameters.mode;
+#line 217 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ (*parameters).mode = _tmp43_;
+#line 218 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ export_dialog_current_parameters.specified_format = export_dialog_get_specified_format (self);
+#line 218 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp44_ = export_dialog_current_parameters.specified_format;
+#line 218 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ (*parameters).specified_format = _tmp44_;
+#line 219 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp45_ = export_dialog_current_parameters;
+#line 219 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp46_ = _tmp45_.specified_format;
+#line 219 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ if (_tmp46_ == PHOTO_FILE_FORMAT_JFIF) {
+#line 1354 "ExportDialog.c"
+ GtkComboBoxText* _tmp47_;
+ JpegQuality _tmp48_;
+ JpegQuality _tmp49_;
+#line 220 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp47_ = self->priv->quality_combo;
+#line 220 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp48_ = EXPORT_DIALOG_QUALITY_ARRAY[gtk_combo_box_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp47_, gtk_combo_box_get_type (), GtkComboBox))];
+#line 220 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ export_dialog_current_parameters.quality = _tmp48_;
+#line 220 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp49_ = export_dialog_current_parameters.quality;
+#line 220 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ (*parameters).quality = _tmp49_;
+#line 1368 "ExportDialog.c"
+ }
+ }
+ }
+#line 224 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp50_ = config_facade_get_instance ();
+#line 224 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ config = _tmp50_;
+#line 225 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp51_ = config;
+#line 225 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp52_ = export_dialog_current_parameters;
+#line 225 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp53_ = _tmp52_.mode;
+#line 225 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ configuration_facade_set_export_export_format_mode (G_TYPE_CHECK_INSTANCE_CAST (_tmp51_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), _tmp53_);
+#line 226 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp54_ = config;
+#line 226 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp55_ = export_dialog_current_parameters;
+#line 226 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp56_ = _tmp55_.specified_format;
+#line 226 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ configuration_facade_set_export_photo_file_format (G_TYPE_CHECK_INSTANCE_CAST (_tmp54_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), _tmp56_);
+#line 227 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp57_ = config;
+#line 227 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp58_ = export_dialog_current_parameters;
+#line 227 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp59_ = _tmp58_.quality;
+#line 227 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ configuration_facade_set_export_quality (G_TYPE_CHECK_INSTANCE_CAST (_tmp57_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), _tmp59_);
+#line 228 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp60_ = config;
+#line 228 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp61_ = export_dialog_current_parameters;
+#line 228 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp62_ = _tmp61_.export_metadata;
+#line 228 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ configuration_facade_set_export_export_metadata (G_TYPE_CHECK_INSTANCE_CAST (_tmp60_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), _tmp62_);
+#line 229 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp63_ = config;
+#line 229 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp64_ = export_dialog_current_constraint;
+#line 229 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ configuration_facade_set_export_constraint (G_TYPE_CHECK_INSTANCE_CAST (_tmp63_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), _tmp64_);
+#line 230 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp65_ = config;
+#line 230 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp66_ = export_dialog_current_scale;
+#line 230 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ configuration_facade_set_export_scale (G_TYPE_CHECK_INSTANCE_CAST (_tmp65_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), _tmp66_);
+#line 199 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _g_object_unref0 (config);
+#line 1422 "ExportDialog.c"
+ } else {
+#line 232 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _vala_scale = 0;
+#line 233 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _vala_constraint = SCALE_CONSTRAINT_ORIGINAL;
+#line 1428 "ExportDialog.c"
+ }
+#line 236 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_widget_destroy (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
+#line 238 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ result = ok;
+#line 238 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ if (scale) {
+#line 238 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ *scale = _vala_scale;
+#line 1438 "ExportDialog.c"
+ }
+#line 238 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ if (constraint) {
+#line 238 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ *constraint = _vala_constraint;
+#line 1444 "ExportDialog.c"
+ }
+#line 238 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ return result;
+#line 1448 "ExportDialog.c"
+}
+
+
+static void
+export_dialog_add_label (ExportDialog* self,
+ const gchar* text,
+ gint x,
+ gint y,
+ GtkWidget* widget)
+{
+ GtkLabel* new_label = NULL;
+ GtkLabel* _tmp0_;
+ GtkLabel* _tmp1_;
+ GtkLabel* _tmp2_;
+ GtkLabel* _tmp3_;
+ GtkGrid* _tmp5_;
+ GtkLabel* _tmp6_;
+#line 241 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ g_return_if_fail (IS_EXPORT_DIALOG (self));
+#line 241 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ g_return_if_fail (text != NULL);
+#line 241 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ g_return_if_fail ((widget == NULL) || GTK_IS_WIDGET (widget));
+#line 242 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp0_ = (GtkLabel*) gtk_label_new_with_mnemonic (text);
+#line 242 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ g_object_ref_sink (_tmp0_);
+#line 242 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ new_label = _tmp0_;
+#line 243 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp1_ = new_label;
+#line 243 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_widget_set_halign (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_END);
+#line 244 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp2_ = new_label;
+#line 244 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_widget_set_valign (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_CENTER);
+#line 245 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp3_ = new_label;
+#line 245 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_label_set_use_underline (_tmp3_, TRUE);
+#line 247 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ if (widget != NULL) {
+#line 1492 "ExportDialog.c"
+ GtkLabel* _tmp4_;
+#line 248 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp4_ = new_label;
+#line 248 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_label_set_mnemonic_widget (_tmp4_, widget);
+#line 1498 "ExportDialog.c"
+ }
+#line 250 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp5_ = self->priv->table;
+#line 250 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp6_ = new_label;
+#line 250 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_grid_attach (_tmp5_, G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, gtk_widget_get_type (), GtkWidget), x, y, 1, 1);
+#line 241 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _g_object_unref0 (new_label);
+#line 1508 "ExportDialog.c"
+}
+
+
+static void
+export_dialog_add_control (ExportDialog* self,
+ GtkWidget* widget,
+ gint x,
+ gint y)
+{
+ GtkGrid* _tmp0_;
+#line 253 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ g_return_if_fail (IS_EXPORT_DIALOG (self));
+#line 253 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ g_return_if_fail (GTK_IS_WIDGET (widget));
+#line 254 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_widget_set_halign (widget, GTK_ALIGN_FILL);
+#line 255 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
+#line 256 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_widget_set_hexpand (widget, TRUE);
+#line 257 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_widget_set_vexpand (widget, TRUE);
+#line 259 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp0_ = self->priv->table;
+#line 259 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_grid_attach (_tmp0_, widget, x, y, 1, 1);
+#line 1535 "ExportDialog.c"
+}
+
+
+static void
+export_dialog_on_constraint_changed (ExportDialog* self)
+{
+ gboolean original = FALSE;
+ GtkComboBoxText* _tmp0_;
+ ScaleConstraint _tmp1_;
+ gboolean jpeg = FALSE;
+ GtkComboBoxText* _tmp2_;
+ gchar* _tmp3_;
+ gchar* _tmp4_;
+ PhotoFileFormatProperties* _tmp5_;
+ PhotoFileFormatProperties* _tmp6_;
+ gchar* _tmp7_;
+ gchar* _tmp8_;
+ gboolean _tmp9_;
+ GtkEntry* _tmp10_;
+ gboolean _tmp11_;
+ gboolean _tmp12_ = FALSE;
+ gboolean _tmp13_;
+ GtkComboBoxText* _tmp15_;
+ gboolean _tmp16_;
+#line 262 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ g_return_if_fail (IS_EXPORT_DIALOG (self));
+#line 263 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp0_ = self->priv->constraint_combo;
+#line 263 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp1_ = EXPORT_DIALOG_CONSTRAINT_ARRAY[gtk_combo_box_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_combo_box_get_type (), GtkComboBox))];
+#line 263 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ original = _tmp1_ == SCALE_CONSTRAINT_ORIGINAL;
+#line 264 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp2_ = self->priv->format_combo;
+#line 264 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp3_ = gtk_combo_box_text_get_active_text (_tmp2_);
+#line 264 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp4_ = _tmp3_;
+#line 264 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp5_ = photo_file_format_get_properties (PHOTO_FILE_FORMAT_JFIF);
+#line 264 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp6_ = _tmp5_;
+#line 264 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp7_ = photo_file_format_properties_get_user_visible_name (_tmp6_);
+#line 264 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp8_ = _tmp7_;
+#line 264 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp9_ = g_strcmp0 (_tmp4_, _tmp8_) == 0;
+#line 264 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _g_free0 (_tmp8_);
+#line 264 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _photo_file_format_properties_unref0 (_tmp6_);
+#line 264 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _g_free0 (_tmp4_);
+#line 264 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ jpeg = _tmp9_;
+#line 266 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp10_ = self->priv->pixels_entry;
+#line 266 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp11_ = original;
+#line 266 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, gtk_widget_get_type (), GtkWidget), !_tmp11_);
+#line 267 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp13_ = original;
+#line 267 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ if (!_tmp13_) {
+#line 1602 "ExportDialog.c"
+ gboolean _tmp14_;
+#line 267 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp14_ = jpeg;
+#line 267 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp12_ = _tmp14_;
+#line 1608 "ExportDialog.c"
+ } else {
+#line 267 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp12_ = FALSE;
+#line 1612 "ExportDialog.c"
+ }
+#line 267 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp15_ = self->priv->quality_combo;
+#line 267 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, gtk_widget_get_type (), GtkWidget), _tmp12_);
+#line 268 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp16_ = original;
+#line 268 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ if (_tmp16_) {
+#line 1622 "ExportDialog.c"
+ GtkWidget* _tmp17_;
+#line 269 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp17_ = self->priv->ok_button;
+#line 269 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_widget_set_sensitive (_tmp17_, TRUE);
+#line 1628 "ExportDialog.c"
+ } else {
+#line 271 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ export_dialog_on_pixels_changed (self);
+#line 1632 "ExportDialog.c"
+ }
+}
+
+
+static void
+export_dialog_on_format_changed (ExportDialog* self)
+{
+ gboolean original = FALSE;
+ GtkComboBoxText* _tmp0_;
+ ScaleConstraint _tmp1_;
+ GtkComboBoxText* _tmp2_;
+ gchar* _tmp3_;
+ gchar* _tmp4_;
+ gboolean _tmp5_;
+#line 274 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ g_return_if_fail (IS_EXPORT_DIALOG (self));
+#line 275 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp0_ = self->priv->constraint_combo;
+#line 275 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp1_ = EXPORT_DIALOG_CONSTRAINT_ARRAY[gtk_combo_box_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_combo_box_get_type (), GtkComboBox))];
+#line 275 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ original = _tmp1_ == SCALE_CONSTRAINT_ORIGINAL;
+#line 277 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp2_ = self->priv->format_combo;
+#line 277 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp3_ = gtk_combo_box_text_get_active_text (_tmp2_);
+#line 277 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp4_ = _tmp3_;
+#line 277 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp5_ = g_strcmp0 (_tmp4_, EXPORT_DIALOG_UNMODIFIED_FORMAT_LABEL) == 0;
+#line 277 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _g_free0 (_tmp4_);
+#line 277 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ if (_tmp5_) {
+#line 1667 "ExportDialog.c"
+ GtkComboBoxText* _tmp6_;
+ GtkComboBoxText* _tmp7_;
+ GtkComboBoxText* _tmp8_;
+ GtkEntry* _tmp9_;
+ GtkSwitch* _tmp10_;
+ GtkSwitch* _tmp11_;
+#line 282 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp6_ = self->priv->constraint_combo;
+#line 282 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_combo_box_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, gtk_combo_box_get_type (), GtkComboBox), 0);
+#line 283 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp7_ = self->priv->constraint_combo;
+#line 283 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, gtk_widget_get_type (), GtkWidget), FALSE);
+#line 284 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp8_ = self->priv->quality_combo;
+#line 284 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, gtk_widget_get_type (), GtkWidget), FALSE);
+#line 285 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp9_ = self->priv->pixels_entry;
+#line 285 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, gtk_widget_get_type (), GtkWidget), FALSE);
+#line 286 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp10_ = self->priv->export_metadata;
+#line 286 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_switch_set_active (_tmp10_, FALSE);
+#line 287 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp11_ = self->priv->export_metadata;
+#line 287 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, gtk_widget_get_type (), GtkWidget), FALSE);
+#line 1698 "ExportDialog.c"
+ } else {
+ GtkComboBoxText* _tmp12_;
+ gchar* _tmp13_;
+ gchar* _tmp14_;
+ gboolean _tmp15_;
+#line 288 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp12_ = self->priv->format_combo;
+#line 288 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp13_ = gtk_combo_box_text_get_active_text (_tmp12_);
+#line 288 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp14_ = _tmp13_;
+#line 288 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp15_ = g_strcmp0 (_tmp14_, EXPORT_DIALOG_CURRENT_FORMAT_LABEL) == 0;
+#line 288 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _g_free0 (_tmp14_);
+#line 288 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ if (_tmp15_) {
+#line 1716 "ExportDialog.c"
+ GtkComboBoxText* _tmp16_;
+ GtkComboBoxText* _tmp17_;
+ GtkEntry* _tmp18_;
+ gboolean _tmp19_;
+ GtkSwitch* _tmp20_;
+#line 295 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp16_ = self->priv->constraint_combo;
+#line 295 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, gtk_widget_get_type (), GtkWidget), TRUE);
+#line 296 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp17_ = self->priv->quality_combo;
+#line 296 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, gtk_widget_get_type (), GtkWidget), FALSE);
+#line 297 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp18_ = self->priv->pixels_entry;
+#line 297 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp19_ = original;
+#line 297 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, gtk_widget_get_type (), GtkWidget), !_tmp19_);
+#line 298 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp20_ = self->priv->export_metadata;
+#line 298 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, gtk_widget_get_type (), GtkWidget), TRUE);
+#line 1740 "ExportDialog.c"
+ } else {
+ GtkComboBoxText* _tmp21_;
+ gboolean jpeg = FALSE;
+ gboolean _tmp22_ = FALSE;
+ gboolean _tmp23_;
+ GtkComboBoxText* _tmp25_;
+ GtkSwitch* _tmp26_;
+#line 303 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp21_ = self->priv->constraint_combo;
+#line 303 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, gtk_widget_get_type (), GtkWidget), TRUE);
+#line 304 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ jpeg = export_dialog_get_specified_format (self) == PHOTO_FILE_FORMAT_JFIF;
+#line 305 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp23_ = original;
+#line 305 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ if (!_tmp23_) {
+#line 1758 "ExportDialog.c"
+ gboolean _tmp24_;
+#line 305 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp24_ = jpeg;
+#line 305 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp22_ = _tmp24_;
+#line 1764 "ExportDialog.c"
+ } else {
+#line 305 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp22_ = FALSE;
+#line 1768 "ExportDialog.c"
+ }
+#line 305 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp25_ = self->priv->quality_combo;
+#line 305 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, gtk_widget_get_type (), GtkWidget), _tmp22_);
+#line 306 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp26_ = self->priv->export_metadata;
+#line 306 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp26_, gtk_widget_get_type (), GtkWidget), TRUE);
+#line 1778 "ExportDialog.c"
+ }
+ }
+}
+
+
+static void
+export_dialog_on_activate (ExportDialog* self)
+{
+#line 310 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ g_return_if_fail (IS_EXPORT_DIALOG (self));
+#line 311 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_dialog_response (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_dialog_get_type (), GtkDialog), (gint) GTK_RESPONSE_OK);
+#line 1791 "ExportDialog.c"
+}
+
+
+static void
+export_dialog_on_pixels_changed (ExportDialog* self)
+{
+ gboolean _tmp0_ = FALSE;
+ GtkEntry* _tmp1_;
+ GtkWidget* _tmp4_;
+#line 314 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ g_return_if_fail (IS_EXPORT_DIALOG (self));
+#line 315 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp1_ = self->priv->pixels_entry;
+#line 315 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ if (((gint) gtk_entry_get_text_length (_tmp1_)) > 0) {
+#line 1807 "ExportDialog.c"
+ GtkEntry* _tmp2_;
+ const gchar* _tmp3_;
+#line 315 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp2_ = self->priv->pixels_entry;
+#line 315 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp3_ = gtk_entry_get_text (_tmp2_);
+#line 315 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp0_ = atoi (_tmp3_) > 0;
+#line 1816 "ExportDialog.c"
+ } else {
+#line 315 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp0_ = FALSE;
+#line 1820 "ExportDialog.c"
+ }
+#line 315 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp4_ = self->priv->ok_button;
+#line 315 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ gtk_widget_set_sensitive (_tmp4_, _tmp0_);
+#line 1826 "ExportDialog.c"
+}
+
+
+static gchar
+string_get (const gchar* self,
+ glong index)
+{
+ gchar result = '\0';
+ gchar _tmp0_;
+#line 1124 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ g_return_val_if_fail (self != NULL, '\0');
+#line 1125 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ _tmp0_ = ((gchar*) self)[index];
+#line 1125 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ result = _tmp0_;
+#line 1125 "/usr/share/vala-0.40/vapi/glib-2.0.vapi"
+ return result;
+#line 1844 "ExportDialog.c"
+}
+
+
+static void
+export_dialog_on_pixels_insert_text (ExportDialog* self,
+ const gchar* text,
+ gint length,
+ gint* position)
+{
+ gboolean _tmp0_;
+ gchar* new_text = NULL;
+ gchar* _tmp3_;
+ const gchar* _tmp13_;
+ gint _tmp14_;
+ gint _tmp15_;
+ GtkEntry* _tmp21_;
+#line 318 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ g_return_if_fail (IS_EXPORT_DIALOG (self));
+#line 318 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ g_return_if_fail (text != NULL);
+#line 320 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp0_ = self->priv->in_insert;
+#line 320 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ if (_tmp0_) {
+#line 321 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ return;
+#line 1871 "ExportDialog.c"
+ }
+#line 323 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ self->priv->in_insert = TRUE;
+#line 325 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ if (length == -1) {
+#line 1877 "ExportDialog.c"
+ gint _tmp1_;
+ gint _tmp2_;
+#line 326 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp1_ = strlen (text);
+#line 326 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp2_ = _tmp1_;
+#line 326 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ length = (gint) _tmp2_;
+#line 1886 "ExportDialog.c"
+ }
+#line 329 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp3_ = g_strdup ("");
+#line 329 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ new_text = _tmp3_;
+#line 1892 "ExportDialog.c"
+ {
+ gint ctr = 0;
+#line 330 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ ctr = 0;
+#line 1897 "ExportDialog.c"
+ {
+ gboolean _tmp4_ = FALSE;
+#line 330 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp4_ = TRUE;
+#line 330 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ while (TRUE) {
+#line 1904 "ExportDialog.c"
+ gint _tmp6_;
+ gint _tmp7_;
+#line 330 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ if (!_tmp4_) {
+#line 1909 "ExportDialog.c"
+ gint _tmp5_;
+#line 330 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp5_ = ctr;
+#line 330 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ ctr = _tmp5_ + 1;
+#line 1915 "ExportDialog.c"
+ }
+#line 330 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp4_ = FALSE;
+#line 330 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp6_ = ctr;
+#line 330 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ if (!(_tmp6_ < length)) {
+#line 330 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ break;
+#line 1925 "ExportDialog.c"
+ }
+#line 331 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp7_ = ctr;
+#line 331 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ if (g_ascii_isdigit (string_get (text, (glong) _tmp7_))) {
+#line 1931 "ExportDialog.c"
+ const gchar* _tmp8_;
+ gint _tmp9_;
+ gchar* _tmp10_;
+ gchar* _tmp11_;
+ gchar* _tmp12_;
+#line 332 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp8_ = new_text;
+#line 332 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp9_ = ctr;
+#line 332 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp10_ = g_strdup_printf ("%c", (gchar) string_get (text, (glong) _tmp9_));
+#line 332 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp11_ = _tmp10_;
+#line 332 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp12_ = g_strconcat (_tmp8_, _tmp11_, NULL);
+#line 332 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _g_free0 (new_text);
+#line 332 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ new_text = _tmp12_;
+#line 332 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _g_free0 (_tmp11_);
+#line 1953 "ExportDialog.c"
+ }
+ }
+ }
+ }
+#line 336 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp13_ = new_text;
+#line 336 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp14_ = strlen (_tmp13_);
+#line 336 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp15_ = _tmp14_;
+#line 336 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ if (_tmp15_ > 0) {
+#line 1966 "ExportDialog.c"
+ GtkEntry* _tmp16_;
+ const gchar* _tmp17_;
+ const gchar* _tmp18_;
+ gint _tmp19_;
+ gint _tmp20_;
+#line 337 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp16_ = self->priv->pixels_entry;
+#line 337 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp17_ = new_text;
+#line 337 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp18_ = new_text;
+#line 337 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp19_ = strlen (_tmp18_);
+#line 337 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp20_ = _tmp19_;
+#line 337 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ g_signal_emit_by_name (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, gtk_editable_get_type (), GtkEditable), "insert-text", _tmp17_, (gint) _tmp20_, position);
+#line 1984 "ExportDialog.c"
+ }
+#line 339 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp21_ = self->priv->pixels_entry;
+#line 339 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ g_signal_stop_emission_by_name (_tmp21_, "insert-text");
+#line 341 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ self->priv->in_insert = FALSE;
+#line 318 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _g_free0 (new_text);
+#line 1994 "ExportDialog.c"
+}
+
+
+static void
+export_dialog_class_init (ExportDialogClass * klass)
+{
+ ExportFormatParameters _tmp0_ = {0};
+#line 8 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ export_dialog_parent_class = g_type_class_peek_parent (klass);
+#line 8 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ g_type_class_add_private (klass, sizeof (ExportDialogPrivate));
+#line 8 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ G_OBJECT_CLASS (klass)->finalize = export_dialog_finalize;
+#line 25 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ export_format_parameters_current (&_tmp0_);
+#line 25 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ export_dialog_current_parameters = _tmp0_;
+#line 26 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ export_dialog_current_scale = EXPORT_DIALOG_DEFAULT_SCALE;
+#line 2014 "ExportDialog.c"
+}
+
+
+static void
+export_dialog_instance_init (ExportDialog * self)
+{
+ GtkGrid* _tmp0_;
+ GeeArrayList* _tmp1_;
+#line 8 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ self->priv = EXPORT_DIALOG_GET_PRIVATE (self);
+#line 28 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp0_ = (GtkGrid*) gtk_grid_new ();
+#line 28 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ g_object_ref_sink (_tmp0_);
+#line 28 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ self->priv->table = _tmp0_;
+#line 33 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _tmp1_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL);
+#line 33 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ self->priv->format_options = _tmp1_;
+#line 36 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ self->priv->in_insert = FALSE;
+#line 2037 "ExportDialog.c"
+}
+
+
+static void
+export_dialog_finalize (GObject * obj)
+{
+ ExportDialog * self;
+#line 8 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_EXPORT_DIALOG, ExportDialog);
+#line 28 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _g_object_unref0 (self->priv->table);
+#line 29 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _g_object_unref0 (self->priv->quality_combo);
+#line 30 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _g_object_unref0 (self->priv->constraint_combo);
+#line 31 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _g_object_unref0 (self->priv->format_combo);
+#line 32 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _g_object_unref0 (self->priv->export_metadata);
+#line 33 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _g_object_unref0 (self->priv->format_options);
+#line 34 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _g_object_unref0 (self->priv->pixels_entry);
+#line 35 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ _g_object_unref0 (self->priv->ok_button);
+#line 8 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala"
+ G_OBJECT_CLASS (export_dialog_parent_class)->finalize (obj);
+#line 2065 "ExportDialog.c"
+}
+
+
+GType
+export_dialog_get_type (void)
+{
+ static volatile gsize export_dialog_type_id__volatile = 0;
+ if (g_once_init_enter (&export_dialog_type_id__volatile)) {
+ static const GTypeInfo g_define_type_info = { sizeof (ExportDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) export_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ExportDialog), 0, (GInstanceInitFunc) export_dialog_instance_init, NULL };
+ GType export_dialog_type_id;
+ export_dialog_type_id = g_type_register_static (gtk_dialog_get_type (), "ExportDialog", &g_define_type_info, 0);
+ g_once_init_leave (&export_dialog_type_id__volatile, export_dialog_type_id);
+ }
+ return export_dialog_type_id__volatile;
+}
+
+
+
diff --git a/src/dialogs/ExportDialog.vala b/src/dialogs/ExportDialog.vala
new file mode 100644
index 0000000..5a61dc4
--- /dev/null
+++ b/src/dialogs/ExportDialog.vala
@@ -0,0 +1,343 @@
+/* Copyright 2016 Software Freedom Conservancy Inc.
+ * Copyright 2017 Jens Georg <mail@jensge.org>
+ *
+ * This software is licensed under the GNU LGPL (version 2.1 or later).
+ * See the COPYING file in this distribution.
+ */
+
+public class ExportDialog : Gtk.Dialog {
+ public const int DEFAULT_SCALE = 1200;
+
+ // "Unmodified" and "Current," though they appear in the "Format:" popup menu, really
+ // aren't formats so much as they are operating modes that determine specific formats.
+ // Hereafter we'll refer to these as "special formats."
+ public const int NUM_SPECIAL_FORMATS = 2;
+ public const string UNMODIFIED_FORMAT_LABEL = _("Unmodified");
+ public const string CURRENT_FORMAT_LABEL = _("Current");
+
+ public const ScaleConstraint[] CONSTRAINT_ARRAY = { ScaleConstraint.ORIGINAL,
+ ScaleConstraint.DIMENSIONS, ScaleConstraint.WIDTH, ScaleConstraint.HEIGHT };
+
+ public const Jpeg.Quality[] QUALITY_ARRAY = { Jpeg.Quality.LOW, Jpeg.Quality.MEDIUM,
+ Jpeg.Quality.HIGH, Jpeg.Quality.MAXIMUM };
+
+ private static ScaleConstraint current_constraint = ScaleConstraint.ORIGINAL;
+ private static ExportFormatParameters current_parameters = ExportFormatParameters.current();
+ private static int current_scale = DEFAULT_SCALE;
+
+ private Gtk.Grid table = new Gtk.Grid();
+ private Gtk.ComboBoxText quality_combo;
+ private Gtk.ComboBoxText constraint_combo;
+ private Gtk.ComboBoxText format_combo;
+ private Gtk.Switch export_metadata;
+ private Gee.ArrayList<string> format_options = new Gee.ArrayList<string>();
+ private Gtk.Entry pixels_entry;
+ private Gtk.Widget ok_button;
+ private bool in_insert = false;
+
+ public ExportDialog(string title) {
+ Object (use_header_bar: Resources.use_header_bar());
+
+ this.title = title;
+ resizable = false;
+
+ //get information about the export settings out of our config backend
+ Config.Facade config = Config.Facade.get_instance();
+ current_parameters.mode = config.get_export_export_format_mode(); //ExportFormatMode
+ current_parameters.specified_format = config.get_export_photo_file_format(); //PhotoFileFormat
+ current_parameters.quality = config.get_export_quality(); //quality
+ current_parameters.export_metadata = config.get_export_export_metadata(); //export metadata
+ current_constraint = config.get_export_constraint(); //constraint
+ current_scale = config.get_export_scale(); //scale
+
+ quality_combo = new Gtk.ComboBoxText();
+ int ctr = 0;
+ foreach (Jpeg.Quality quality in QUALITY_ARRAY) {
+ quality_combo.append_text(quality.to_string());
+ if (quality == current_parameters.quality)
+ quality_combo.set_active(ctr);
+ ctr++;
+ }
+
+ constraint_combo = new Gtk.ComboBoxText();
+ ctr = 0;
+ foreach (ScaleConstraint constraint in CONSTRAINT_ARRAY) {
+ constraint_combo.append_text(constraint.to_string());
+ if (constraint == current_constraint)
+ constraint_combo.set_active(ctr);
+ ctr++;
+ }
+
+ format_combo = new Gtk.ComboBoxText();
+ format_add_option(UNMODIFIED_FORMAT_LABEL);
+ format_add_option(CURRENT_FORMAT_LABEL);
+ foreach (PhotoFileFormat format in PhotoFileFormat.get_writeable()) {
+ format_add_option(format.get_properties().get_user_visible_name());
+ }
+
+ pixels_entry = new Gtk.Entry();
+ pixels_entry.set_max_length(6);
+ pixels_entry.set_text("%d".printf(current_scale));
+
+ // register after preparation to avoid signals during init
+ constraint_combo.changed.connect(on_constraint_changed);
+ format_combo.changed.connect(on_format_changed);
+ pixels_entry.changed.connect(on_pixels_changed);
+ pixels_entry.insert_text.connect(on_pixels_insert_text);
+ pixels_entry.activate.connect(on_activate);
+
+ // layout controls
+ add_label(_("_Format:"), 0, 0, format_combo);
+ add_control(format_combo, 1, 0);
+
+ add_label(_("_Quality:"), 0, 1, quality_combo);
+ add_control(quality_combo, 1, 1);
+
+ add_label(_("_Scaling constraint:"), 0, 2, constraint_combo);
+ add_control(constraint_combo, 1, 2);
+
+ add_label(_("_Pixels:"), 0, 3, pixels_entry);
+ add_control(pixels_entry, 1, 3);
+
+ export_metadata = new Gtk.Switch ();
+ add_label(_("Export _metadata:"), 0, 4, export_metadata);
+ add_control(export_metadata, 1, 4);
+ export_metadata.active = true;
+ export_metadata.halign = Gtk.Align.START;
+
+ table.set_row_spacing(6);
+ table.set_column_spacing(12);
+ table.set_border_width(18);
+
+ ((Gtk.Box) get_content_area()).add(table);
+
+ // add buttons to action area
+ add_button(Resources.CANCEL_LABEL, Gtk.ResponseType.CANCEL);
+ ok_button = add_button(Resources.OK_LABEL, Gtk.ResponseType.OK);
+ set_default_response(Gtk.ResponseType.OK);
+
+ ok_button.set_can_default(true);
+ ok_button.has_default = true;
+ set_default(ok_button);
+
+ if (current_constraint == ScaleConstraint.ORIGINAL) {
+ pixels_entry.sensitive = false;
+ quality_combo.sensitive = false;
+ }
+
+ ok_button.grab_focus();
+ }
+
+ private void format_add_option(string format_name) {
+ format_options.add(format_name);
+ format_combo.append_text(format_name);
+ }
+
+ private void format_set_active_text(string text) {
+ int selection_ticker = 0;
+
+ foreach (string current_text in format_options) {
+ if (current_text == text) {
+ format_combo.set_active(selection_ticker);
+ return;
+ }
+ selection_ticker++;
+ }
+
+ error("format_set_active_text: text '%s' isn't in combo box", text);
+ }
+
+ private PhotoFileFormat get_specified_format() {
+ int index = format_combo.get_active();
+ if (index < NUM_SPECIAL_FORMATS)
+ index = NUM_SPECIAL_FORMATS;
+
+ index -= NUM_SPECIAL_FORMATS;
+ PhotoFileFormat[] writeable_formats = PhotoFileFormat.get_writeable();
+ return writeable_formats[index];
+ }
+
+ private string get_label_for_parameters(ExportFormatParameters params) {
+ switch(params.mode) {
+ case ExportFormatMode.UNMODIFIED:
+ return UNMODIFIED_FORMAT_LABEL;
+
+ case ExportFormatMode.CURRENT:
+ return CURRENT_FORMAT_LABEL;
+
+ case ExportFormatMode.SPECIFIED:
+ return params.specified_format.get_properties().get_user_visible_name();
+
+ default:
+ error("get_label_for_parameters: unrecognized export format mode");
+ }
+ }
+
+ // unlike other parameters, which should be persisted across dialog executions, the
+ // format parameters must be set each time the dialog is executed -- this is why
+ // it's passed qualified as ref and not as out
+ public bool execute(out int scale, out ScaleConstraint constraint,
+ ref ExportFormatParameters parameters) {
+ show_all();
+
+ // if the export format mode isn't set to last (i.e., don't use the persisted settings),
+ // reset the scale constraint to original size
+ if (parameters.mode != ExportFormatMode.LAST) {
+ current_constraint = constraint = ScaleConstraint.ORIGINAL;
+ constraint_combo.set_active(0);
+ }
+
+ if (parameters.mode == ExportFormatMode.LAST)
+ parameters = current_parameters;
+ else if (parameters.mode == ExportFormatMode.SPECIFIED && !parameters.specified_format.can_write())
+ parameters.specified_format = PhotoFileFormat.get_system_default_format();
+
+ format_set_active_text(get_label_for_parameters(parameters));
+ on_format_changed();
+
+ bool ok = (run() == Gtk.ResponseType.OK);
+ if (ok) {
+ int index = constraint_combo.get_active();
+ assert(index >= 0);
+ constraint = CONSTRAINT_ARRAY[index];
+ current_constraint = constraint;
+
+ scale = int.parse(pixels_entry.get_text());
+ if (constraint != ScaleConstraint.ORIGINAL)
+ assert(scale > 0);
+ current_scale = scale;
+
+ parameters.export_metadata = export_metadata.sensitive ? export_metadata.active : false;
+
+ if (format_combo.get_active_text() == UNMODIFIED_FORMAT_LABEL) {
+ parameters.mode = current_parameters.mode = ExportFormatMode.UNMODIFIED;
+ } else if (format_combo.get_active_text() == CURRENT_FORMAT_LABEL) {
+ parameters.mode = current_parameters.mode = ExportFormatMode.CURRENT;
+ } else {
+ parameters.mode = current_parameters.mode = ExportFormatMode.SPECIFIED;
+ parameters.specified_format = current_parameters.specified_format = get_specified_format();
+ if (current_parameters.specified_format == PhotoFileFormat.JFIF)
+ parameters.quality = current_parameters.quality = QUALITY_ARRAY[quality_combo.get_active()];
+ }
+
+ //save current settings in config backend for reusing later
+ Config.Facade config = Config.Facade.get_instance();
+ config.set_export_export_format_mode(current_parameters.mode); //ExportFormatMode
+ config.set_export_photo_file_format(current_parameters.specified_format); //PhotoFileFormat
+ config.set_export_quality(current_parameters.quality); //quality
+ config.set_export_export_metadata(current_parameters.export_metadata); //export metadata
+ config.set_export_constraint(current_constraint); //constraint
+ config.set_export_scale(current_scale); //scale
+ } else {
+ scale = 0;
+ constraint = ScaleConstraint.ORIGINAL;
+ }
+
+ destroy();
+
+ return ok;
+ }
+
+ private void add_label(string text, int x, int y, Gtk.Widget? widget = null) {
+ Gtk.Label new_label = new Gtk.Label.with_mnemonic(text);
+ new_label.halign = Gtk.Align.END;
+ new_label.valign = Gtk.Align.CENTER;
+ new_label.set_use_underline(true);
+
+ if (widget != null)
+ new_label.set_mnemonic_widget(widget);
+
+ table.attach(new_label, x, y, 1, 1);
+ }
+
+ private void add_control(Gtk.Widget widget, int x, int y) {
+ widget.halign = Gtk.Align.FILL;
+ widget.valign = Gtk.Align.CENTER;
+ widget.hexpand = true;
+ widget.vexpand = true;
+
+ table.attach(widget, x, y, 1, 1);
+ }
+
+ private void on_constraint_changed() {
+ bool original = CONSTRAINT_ARRAY[constraint_combo.get_active()] == ScaleConstraint.ORIGINAL;
+ bool jpeg = format_combo.get_active_text() ==
+ PhotoFileFormat.JFIF.get_properties().get_user_visible_name();
+ pixels_entry.sensitive = !original;
+ quality_combo.sensitive = !original && jpeg;
+ if (original)
+ ok_button.sensitive = true;
+ else
+ on_pixels_changed();
+ }
+
+ private void on_format_changed() {
+ bool original = CONSTRAINT_ARRAY[constraint_combo.get_active()] == ScaleConstraint.ORIGINAL;
+
+ if (format_combo.get_active_text() == UNMODIFIED_FORMAT_LABEL) {
+ // if the user wishes to export the media unmodified, then we just copy the original
+ // files, so parameterizing size, quality, etc. is impossible -- these are all
+ // just as they are in the original file. In this case, we set the scale constraint to
+ // original and lock out all the controls
+ constraint_combo.set_active(0); /* 0 == original size */
+ constraint_combo.set_sensitive(false);
+ quality_combo.set_sensitive(false);
+ pixels_entry.sensitive = false;
+ export_metadata.active = false;
+ export_metadata.sensitive = false;
+ } else if (format_combo.get_active_text() == CURRENT_FORMAT_LABEL) {
+ // if the user wishes to export the media in its current format, we allow sizing but
+ // not JPEG quality customization, because in a batch of many photos, it's not
+ // guaranteed that all of them will be JPEGs or RAWs that get converted to JPEGs. Some
+ // could be PNGs, and PNG has no notion of quality. So lock out the quality control.
+ // If the user wants to set JPEG quality, he or she can explicitly specify the JPEG
+ // format.
+ constraint_combo.set_sensitive(true);
+ quality_combo.set_sensitive(false);
+ pixels_entry.sensitive = !original;
+ export_metadata.sensitive = true;
+ } else {
+ // if the user has chosen a specific format, then allow JPEG quality customization if
+ // the format is JPEG and the user is re-sizing the image, otherwise, disallow JPEG
+ // quality customization; always allow scaling.
+ constraint_combo.set_sensitive(true);
+ bool jpeg = get_specified_format() == PhotoFileFormat.JFIF;
+ quality_combo.sensitive = !original && jpeg;
+ export_metadata.sensitive = true;
+ }
+ }
+
+ private void on_activate() {
+ response(Gtk.ResponseType.OK);
+ }
+
+ private void on_pixels_changed() {
+ ok_button.sensitive = (pixels_entry.get_text_length() > 0) && (int.parse(pixels_entry.get_text()) > 0);
+ }
+
+ private void on_pixels_insert_text(string text, int length, ref int position) {
+ // This is necessary because SignalHandler.block_by_func() is not properly bound
+ if (in_insert)
+ return;
+
+ in_insert = true;
+
+ if (length == -1)
+ length = (int) text.length;
+
+ // only permit numeric text
+ string new_text = "";
+ for (int ctr = 0; ctr < length; ctr++) {
+ if (text[ctr].isdigit()) {
+ new_text += ((char) text[ctr]).to_string();
+ }
+ }
+
+ if (new_text.length > 0)
+ pixels_entry.insert_text(new_text, (int) new_text.length, ref position);
+
+ Signal.stop_emission_by_name(pixels_entry, "insert-text");
+
+ in_insert = false;
+ }
+}
diff --git a/src/dialogs/MultiTextEntryDialog.c b/src/dialogs/MultiTextEntryDialog.c
new file mode 100644
index 0000000..e33e415
--- /dev/null
+++ b/src/dialogs/MultiTextEntryDialog.c
@@ -0,0 +1,293 @@
+/* MultiTextEntryDialog.c generated by valac 0.40.4, the Vala compiler
+ * generated from MultiTextEntryDialog.vala, do not modify */
+
+/* Copyright 2016 Software Freedom Conservancy Inc.
+ * Copyright 2017 Jens Georg <mail@jensge.org>
+ *
+ * This software is licensed under the GNU LGPL (version 2.1 or later).
+ * See the COPYING file in this distribution.
+ */
+
+
+#include <glib.h>
+#include <glib-object.h>
+#include <gtk/gtk.h>
+#include <stdlib.h>
+#include <string.h>
+
+
+#define TYPE_MULTI_TEXT_ENTRY_DIALOG (multi_text_entry_dialog_get_type ())
+#define MULTI_TEXT_ENTRY_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MULTI_TEXT_ENTRY_DIALOG, MultiTextEntryDialog))
+#define MULTI_TEXT_ENTRY_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MULTI_TEXT_ENTRY_DIALOG, MultiTextEntryDialogClass))
+#define IS_MULTI_TEXT_ENTRY_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MULTI_TEXT_ENTRY_DIALOG))
+#define IS_MULTI_TEXT_ENTRY_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MULTI_TEXT_ENTRY_DIALOG))
+#define MULTI_TEXT_ENTRY_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MULTI_TEXT_ENTRY_DIALOG, MultiTextEntryDialogClass))
+
+typedef struct _MultiTextEntryDialog MultiTextEntryDialog;
+typedef struct _MultiTextEntryDialogClass MultiTextEntryDialogClass;
+typedef struct _MultiTextEntryDialogPrivate MultiTextEntryDialogPrivate;
+enum {
+ MULTI_TEXT_ENTRY_DIALOG_0_PROPERTY,
+ MULTI_TEXT_ENTRY_DIALOG_NUM_PROPERTIES
+};
+static GParamSpec* multi_text_entry_dialog_properties[MULTI_TEXT_ENTRY_DIALOG_NUM_PROPERTIES];
+#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
+
+#define TYPE_PAGE_WINDOW (page_window_get_type ())
+#define PAGE_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PAGE_WINDOW, PageWindow))
+#define PAGE_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PAGE_WINDOW, PageWindowClass))
+#define IS_PAGE_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PAGE_WINDOW))
+#define IS_PAGE_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PAGE_WINDOW))
+#define PAGE_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PAGE_WINDOW, PageWindowClass))
+
+typedef struct _PageWindow PageWindow;
+typedef struct _PageWindowClass PageWindowClass;
+
+#define TYPE_APP_WINDOW (app_window_get_type ())
+#define APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_APP_WINDOW, AppWindow))
+#define APP_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_APP_WINDOW, AppWindowClass))
+#define IS_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_APP_WINDOW))
+#define IS_APP_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_APP_WINDOW))
+#define APP_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_APP_WINDOW, AppWindowClass))
+
+typedef struct _AppWindow AppWindow;
+typedef struct _AppWindowClass AppWindowClass;
+#define _g_free0(var) (var = (g_free (var), NULL))
+
+struct _MultiTextEntryDialog {
+ GtkDialog parent_instance;
+ MultiTextEntryDialogPrivate * priv;
+};
+
+struct _MultiTextEntryDialogClass {
+ GtkDialogClass parent_class;
+};
+
+typedef gboolean (*MultiTextEntryDialogOnModifyValidateType) (const gchar* text, void* user_data);
+struct _MultiTextEntryDialogPrivate {
+ MultiTextEntryDialogOnModifyValidateType on_modify_validate;
+ gpointer on_modify_validate_target;
+ GtkTextView* entry;
+};
+
+
+static gpointer multi_text_entry_dialog_parent_class = NULL;
+
+GType multi_text_entry_dialog_get_type (void) G_GNUC_CONST;
+#define MULTI_TEXT_ENTRY_DIALOG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_MULTI_TEXT_ENTRY_DIALOG, MultiTextEntryDialogPrivate))
+MultiTextEntryDialog* multi_text_entry_dialog_new (void);
+MultiTextEntryDialog* multi_text_entry_dialog_construct (GType object_type);
+gint resources_use_header_bar (void);
+void multi_text_entry_dialog_setup (MultiTextEntryDialog* self,
+ MultiTextEntryDialogOnModifyValidateType modify_validate,
+ void* modify_validate_target,
+ const gchar* title,
+ const gchar* label,
+ const gchar* initial_text);
+GType page_window_get_type (void) G_GNUC_CONST;
+GType app_window_get_type (void) G_GNUC_CONST;
+AppWindow* app_window_get_instance (void);
+gchar* multi_text_entry_dialog_execute (MultiTextEntryDialog* self);
+static void multi_text_entry_dialog_finalize (GObject * obj);
+
+
+MultiTextEntryDialog*
+multi_text_entry_dialog_construct (GType object_type)
+{
+ MultiTextEntryDialog * self = NULL;
+#line 17 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ self = (MultiTextEntryDialog*) g_object_new (object_type, "use-header-bar", resources_use_header_bar (), NULL);
+#line 16 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ return self;
+#line 103 "MultiTextEntryDialog.c"
+}
+
+
+MultiTextEntryDialog*
+multi_text_entry_dialog_new (void)
+{
+#line 16 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ return multi_text_entry_dialog_construct (TYPE_MULTI_TEXT_ENTRY_DIALOG);
+#line 112 "MultiTextEntryDialog.c"
+}
+
+
+void
+multi_text_entry_dialog_setup (MultiTextEntryDialog* self,
+ MultiTextEntryDialogOnModifyValidateType modify_validate,
+ void* modify_validate_target,
+ const gchar* title,
+ const gchar* label,
+ const gchar* initial_text)
+{
+ AppWindow* _tmp0_;
+ AppWindow* _tmp1_;
+ GdkWindow* _tmp2_;
+ AppWindow* _tmp3_;
+ AppWindow* _tmp4_;
+ const gchar* _tmp5_ = NULL;
+ GtkTextView* _tmp6_;
+ GtkTextBuffer* _tmp7_;
+ GtkTextBuffer* _tmp8_;
+ GtkTextView* _tmp9_;
+#line 20 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ g_return_if_fail (IS_MULTI_TEXT_ENTRY_DIALOG (self));
+#line 20 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ g_return_if_fail (title != NULL);
+#line 20 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ g_return_if_fail (label != NULL);
+#line 21 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ gtk_window_set_title (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), title);
+#line 22 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ _tmp0_ = app_window_get_instance ();
+#line 22 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ _tmp1_ = _tmp0_;
+#line 22 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ _tmp2_ = gtk_widget_get_parent_window (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_widget_get_type (), GtkWidget));
+#line 22 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ gtk_widget_set_parent_window (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), _tmp2_);
+#line 22 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ _g_object_unref0 (_tmp1_);
+#line 23 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ _tmp3_ = app_window_get_instance ();
+#line 23 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ _tmp4_ = _tmp3_;
+#line 23 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ gtk_window_set_transient_for (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_window_get_type (), GtkWindow));
+#line 23 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ _g_object_unref0 (_tmp4_);
+#line 24 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ self->priv->on_modify_validate = modify_validate;
+#line 24 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ self->priv->on_modify_validate_target = modify_validate_target;
+#line 26 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ if (initial_text != NULL) {
+#line 26 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ _tmp5_ = initial_text;
+#line 168 "MultiTextEntryDialog.c"
+ } else {
+#line 26 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ _tmp5_ = "";
+#line 172 "MultiTextEntryDialog.c"
+ }
+#line 26 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ _tmp6_ = self->priv->entry;
+#line 26 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ _tmp7_ = gtk_text_view_get_buffer (_tmp6_);
+#line 26 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ _tmp8_ = _tmp7_;
+#line 26 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ g_object_set (_tmp8_, "text", _tmp5_, NULL);
+#line 28 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ _tmp9_ = self->priv->entry;
+#line 28 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ gtk_widget_grab_focus (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, gtk_widget_get_type (), GtkWidget));
+#line 186 "MultiTextEntryDialog.c"
+}
+
+
+gchar*
+multi_text_entry_dialog_execute (MultiTextEntryDialog* self)
+{
+ gchar* result = NULL;
+ gchar* text = NULL;
+#line 31 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ g_return_val_if_fail (IS_MULTI_TEXT_ENTRY_DIALOG (self), NULL);
+#line 32 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ text = NULL;
+#line 34 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ gtk_widget_show_all (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
+#line 36 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ if (gtk_dialog_run (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_dialog_get_type (), GtkDialog)) == ((gint) GTK_RESPONSE_OK)) {
+#line 203 "MultiTextEntryDialog.c"
+ GtkTextView* _tmp0_;
+ GtkTextBuffer* _tmp1_;
+ GtkTextBuffer* _tmp2_;
+ gchar* _tmp3_;
+ gchar* _tmp4_;
+#line 37 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ _tmp0_ = self->priv->entry;
+#line 37 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ _tmp1_ = gtk_text_view_get_buffer (_tmp0_);
+#line 37 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ _tmp2_ = _tmp1_;
+#line 37 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ g_object_get (_tmp2_, "text", &_tmp3_, NULL);
+#line 37 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ _tmp4_ = _tmp3_;
+#line 37 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ _g_free0 (text);
+#line 37 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ text = _tmp4_;
+#line 223 "MultiTextEntryDialog.c"
+ }
+#line 39 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ gtk_widget_destroy (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
+#line 41 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ result = text;
+#line 41 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ return result;
+#line 231 "MultiTextEntryDialog.c"
+}
+
+
+static void
+multi_text_entry_dialog_class_init (MultiTextEntryDialogClass * klass)
+{
+ gint MultiTextEntryDialog_private_offset;
+#line 9 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ multi_text_entry_dialog_parent_class = g_type_class_peek_parent (klass);
+#line 9 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ g_type_class_add_private (klass, sizeof (MultiTextEntryDialogPrivate));
+#line 9 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ G_OBJECT_CLASS (klass)->finalize = multi_text_entry_dialog_finalize;
+#line 9 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ MultiTextEntryDialog_private_offset = g_type_class_get_instance_private_offset (klass);
+#line 9 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/Shotwell/ui/multitextentrydialog.ui");
+#line 9 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "entry", FALSE, MultiTextEntryDialog_private_offset + G_STRUCT_OFFSET (MultiTextEntryDialogPrivate, entry));
+#line 251 "MultiTextEntryDialog.c"
+}
+
+
+static void
+multi_text_entry_dialog_instance_init (MultiTextEntryDialog * self)
+{
+#line 9 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ self->priv = MULTI_TEXT_ENTRY_DIALOG_GET_PRIVATE (self);
+#line 9 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ gtk_widget_init_template (GTK_WIDGET (self));
+#line 262 "MultiTextEntryDialog.c"
+}
+
+
+static void
+multi_text_entry_dialog_finalize (GObject * obj)
+{
+ MultiTextEntryDialog * self;
+#line 9 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_MULTI_TEXT_ENTRY_DIALOG, MultiTextEntryDialog);
+#line 14 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ _g_object_unref0 (self->priv->entry);
+#line 9 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala"
+ G_OBJECT_CLASS (multi_text_entry_dialog_parent_class)->finalize (obj);
+#line 276 "MultiTextEntryDialog.c"
+}
+
+
+GType
+multi_text_entry_dialog_get_type (void)
+{
+ static volatile gsize multi_text_entry_dialog_type_id__volatile = 0;
+ if (g_once_init_enter (&multi_text_entry_dialog_type_id__volatile)) {
+ static const GTypeInfo g_define_type_info = { sizeof (MultiTextEntryDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) multi_text_entry_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MultiTextEntryDialog), 0, (GInstanceInitFunc) multi_text_entry_dialog_instance_init, NULL };
+ GType multi_text_entry_dialog_type_id;
+ multi_text_entry_dialog_type_id = g_type_register_static (gtk_dialog_get_type (), "MultiTextEntryDialog", &g_define_type_info, 0);
+ g_once_init_leave (&multi_text_entry_dialog_type_id__volatile, multi_text_entry_dialog_type_id);
+ }
+ return multi_text_entry_dialog_type_id__volatile;
+}
+
+
+
diff --git a/src/dialogs/MultiTextEntryDialog.vala b/src/dialogs/MultiTextEntryDialog.vala
new file mode 100644
index 0000000..42e5318
--- /dev/null
+++ b/src/dialogs/MultiTextEntryDialog.vala
@@ -0,0 +1,43 @@
+/* Copyright 2016 Software Freedom Conservancy Inc.
+ * Copyright 2017 Jens Georg <mail@jensge.org>
+ *
+ * This software is licensed under the GNU LGPL (version 2.1 or later).
+ * See the COPYING file in this distribution.
+ */
+
+[GtkTemplate (ui = "/org/gnome/Shotwell/ui/multitextentrydialog.ui")]
+public class MultiTextEntryDialog : Gtk.Dialog {
+ public delegate bool OnModifyValidateType(string text);
+
+ private unowned OnModifyValidateType on_modify_validate;
+ [GtkChild]
+ private Gtk.TextView entry;
+
+ public MultiTextEntryDialog() {
+ Object (use_header_bar: Resources.use_header_bar());
+ }
+
+ public void setup(OnModifyValidateType? modify_validate, string title, string label, string? initial_text) {
+ set_title(title);
+ set_parent_window(AppWindow.get_instance().get_parent_window());
+ set_transient_for(AppWindow.get_instance());
+ on_modify_validate = modify_validate;
+
+ entry.buffer.text = (initial_text != null ? initial_text : "");
+
+ entry.grab_focus();
+ }
+
+ public string? execute() {
+ string? text = null;
+
+ show_all();
+
+ if (run() == Gtk.ResponseType.OK)
+ text = entry.buffer.text;
+
+ destroy();
+
+ return text;
+ }
+}
diff --git a/src/dialogs/Preferences.c b/src/dialogs/Preferences.c
new file mode 100644
index 0000000..7a77423
--- /dev/null
+++ b/src/dialogs/Preferences.c
@@ -0,0 +1,3328 @@
+/* Preferences.c generated by valac 0.40.4, the Vala compiler
+ * generated from Preferences.vala, do not modify */
+
+/* Copyright 2016 Software Freedom Conservancy Inc.
+ * Copyright 2017 Jens Georg <mail@jensge.org>
+ *
+ * This software is licensed under the GNU LGPL (version 2.1 or later).
+ * See the COPYING file in this distribution.
+ */
+
+
+#include <glib.h>
+#include <glib-object.h>
+#include <gtk/gtk.h>
+#include <gio/gio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <gee.h>
+#include <gdk/gdk.h>
+#include <float.h>
+#include <math.h>
+#include <glib/gi18n-lib.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <gobject/gvaluecollector.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;
+
+#define TYPE_SORTED_LIST (sorted_list_get_type ())
+#define SORTED_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SORTED_LIST, SortedList))
+#define SORTED_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SORTED_LIST, SortedListClass))
+#define IS_SORTED_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SORTED_LIST))
+#define IS_SORTED_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SORTED_LIST))
+#define SORTED_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SORTED_LIST, SortedListClass))
+
+typedef struct _SortedList SortedList;
+typedef struct _SortedListClass SortedListClass;
+
+#define PREFERENCES_DIALOG_TYPE_PATH_FORMAT (preferences_dialog_path_format_get_type ())
+#define PREFERENCES_DIALOG_PATH_FORMAT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PREFERENCES_DIALOG_TYPE_PATH_FORMAT, PreferencesDialogPathFormat))
+#define PREFERENCES_DIALOG_PATH_FORMAT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PREFERENCES_DIALOG_TYPE_PATH_FORMAT, PreferencesDialogPathFormatClass))
+#define PREFERENCES_DIALOG_IS_PATH_FORMAT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PREFERENCES_DIALOG_TYPE_PATH_FORMAT))
+#define PREFERENCES_DIALOG_IS_PATH_FORMAT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PREFERENCES_DIALOG_TYPE_PATH_FORMAT))
+#define PREFERENCES_DIALOG_PATH_FORMAT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PREFERENCES_DIALOG_TYPE_PATH_FORMAT, PreferencesDialogPathFormatClass))
+
+typedef struct _PreferencesDialogPathFormat PreferencesDialogPathFormat;
+typedef struct _PreferencesDialogPathFormatClass PreferencesDialogPathFormatClass;
+
+#define PLUGINS_TYPE_MANIFEST_WIDGET_MEDIATOR (plugins_manifest_widget_mediator_get_type ())
+#define PLUGINS_MANIFEST_WIDGET_MEDIATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PLUGINS_TYPE_MANIFEST_WIDGET_MEDIATOR, PluginsManifestWidgetMediator))
+#define PLUGINS_MANIFEST_WIDGET_MEDIATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PLUGINS_TYPE_MANIFEST_WIDGET_MEDIATOR, PluginsManifestWidgetMediatorClass))
+#define PLUGINS_IS_MANIFEST_WIDGET_MEDIATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PLUGINS_TYPE_MANIFEST_WIDGET_MEDIATOR))
+#define PLUGINS_IS_MANIFEST_WIDGET_MEDIATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PLUGINS_TYPE_MANIFEST_WIDGET_MEDIATOR))
+#define PLUGINS_MANIFEST_WIDGET_MEDIATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PLUGINS_TYPE_MANIFEST_WIDGET_MEDIATOR, PluginsManifestWidgetMediatorClass))
+
+typedef struct _PluginsManifestWidgetMediator PluginsManifestWidgetMediator;
+typedef struct _PluginsManifestWidgetMediatorClass PluginsManifestWidgetMediatorClass;
+enum {
+ PREFERENCES_DIALOG_0_PROPERTY,
+ PREFERENCES_DIALOG_NUM_PROPERTIES
+};
+static GParamSpec* preferences_dialog_properties[PREFERENCES_DIALOG_NUM_PROPERTIES];
+#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
+#define _g_free0(var) (var = (g_free (var), NULL))
+#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
+
+#define TYPE_PAGE_WINDOW (page_window_get_type ())
+#define PAGE_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PAGE_WINDOW, PageWindow))
+#define PAGE_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PAGE_WINDOW, PageWindowClass))
+#define IS_PAGE_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PAGE_WINDOW))
+#define IS_PAGE_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PAGE_WINDOW))
+#define PAGE_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PAGE_WINDOW, PageWindowClass))
+
+typedef struct _PageWindow PageWindow;
+typedef struct _PageWindowClass PageWindowClass;
+
+#define TYPE_APP_WINDOW (app_window_get_type ())
+#define APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_APP_WINDOW, AppWindow))
+#define APP_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_APP_WINDOW, AppWindowClass))
+#define IS_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_APP_WINDOW))
+#define IS_APP_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_APP_WINDOW))
+#define APP_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_APP_WINDOW, AppWindowClass))
+
+typedef struct _AppWindow AppWindow;
+typedef struct _AppWindowClass AppWindowClass;
+
+#define TYPE_CONFIGURATION_FACADE (configuration_facade_get_type ())
+#define CONFIGURATION_FACADE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CONFIGURATION_FACADE, ConfigurationFacade))
+#define CONFIGURATION_FACADE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CONFIGURATION_FACADE, ConfigurationFacadeClass))
+#define IS_CONFIGURATION_FACADE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CONFIGURATION_FACADE))
+#define IS_CONFIGURATION_FACADE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CONFIGURATION_FACADE))
+#define CONFIGURATION_FACADE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CONFIGURATION_FACADE, ConfigurationFacadeClass))
+
+typedef struct _ConfigurationFacade ConfigurationFacade;
+typedef struct _ConfigurationFacadeClass ConfigurationFacadeClass;
+
+#define CONFIG_TYPE_FACADE (config_facade_get_type ())
+#define CONFIG_FACADE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONFIG_TYPE_FACADE, ConfigFacade))
+#define CONFIG_FACADE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONFIG_TYPE_FACADE, ConfigFacadeClass))
+#define CONFIG_IS_FACADE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONFIG_TYPE_FACADE))
+#define CONFIG_IS_FACADE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONFIG_TYPE_FACADE))
+#define CONFIG_FACADE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONFIG_TYPE_FACADE, ConfigFacadeClass))
+
+typedef struct _ConfigFacade ConfigFacade;
+typedef struct _ConfigFacadeClass ConfigFacadeClass;
+
+#define TYPE_RAW_DEVELOPER (raw_developer_get_type ())
+
+#define TYPE_PHOTO_FILE_FORMAT (photo_file_format_get_type ())
+#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
+typedef struct _PreferencesDialogPathFormatPrivate PreferencesDialogPathFormatPrivate;
+#define _preferences_dialog_path_format_unref0(var) ((var == NULL) ? NULL : (var = (preferences_dialog_path_format_unref (var), NULL)))
+typedef struct _PreferencesDialogParamSpecPathFormat PreferencesDialogParamSpecPathFormat;
+#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
+#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
+#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
+#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
+
+struct _PreferencesDialog {
+ GtkDialog parent_instance;
+ PreferencesDialogPrivate * priv;
+};
+
+struct _PreferencesDialogClass {
+ GtkDialogClass parent_class;
+};
+
+struct _PreferencesDialogPrivate {
+ GtkAdjustment* bg_color_adjustment;
+ GtkScale* bg_color_slider;
+ GtkComboBox* photo_editor_combo;
+ GtkComboBox* raw_editor_combo;
+ SortedList* external_raw_apps;
+ SortedList* external_photo_apps;
+ GtkFileChooserButton* library_dir_button;
+ GtkComboBoxText* dir_pattern_combo;
+ GtkEntry* dir_pattern_entry;
+ GtkLabel* dir_pattern_example;
+ gboolean allow_closing;
+ gchar* lib_dir;
+ GeeArrayList* path_formats;
+ GDateTime* example_date;
+ GtkCheckButton* lowercase;
+ PluginsManifestWidgetMediator* plugins_mediator;
+ GtkComboBoxText* default_raw_developer_combo;
+ GtkCheckButton* autoimport;
+ GtkCheckButton* write_metadata;
+ GtkLabel* pattern_help;
+ GtkNotebook* preferences_notebook;
+ GtkRadioButton* transparent_checker_radio;
+ GtkRadioButton* transparent_solid_radio;
+ GtkColorButton* transparent_solid_color;
+ GtkRadioButton* transparent_none_radio;
+};
+
+typedef enum {
+ RAW_DEVELOPER_SHOTWELL = 0,
+ RAW_DEVELOPER_CAMERA,
+ RAW_DEVELOPER_EMBEDDED
+} RawDeveloper;
+
+typedef enum {
+ PHOTO_FILE_FORMAT_JFIF,
+ PHOTO_FILE_FORMAT_RAW,
+ PHOTO_FILE_FORMAT_PNG,
+ PHOTO_FILE_FORMAT_TIFF,
+ PHOTO_FILE_FORMAT_BMP,
+ PHOTO_FILE_FORMAT_UNKNOWN
+} PhotoFileFormat;
+
+struct _PreferencesDialogPathFormat {
+ GTypeInstance parent_instance;
+ volatile int ref_count;
+ PreferencesDialogPathFormatPrivate * priv;
+ gchar* name;
+ gchar* pattern;
+};
+
+struct _PreferencesDialogPathFormatClass {
+ GTypeClass parent_class;
+ void (*finalize) (PreferencesDialogPathFormat *self);
+};
+
+struct _PreferencesDialogParamSpecPathFormat {
+ GParamSpec parent_instance;
+};
+
+
+static gpointer preferences_dialog_parent_class = NULL;
+static PreferencesDialog* preferences_dialog_preferences_dialog;
+static PreferencesDialog* preferences_dialog_preferences_dialog = NULL;
+static gpointer preferences_dialog_path_format_parent_class = NULL;
+
+GType preferences_dialog_get_type (void) G_GNUC_CONST;
+GType sorted_list_get_type (void) G_GNUC_CONST;
+static gpointer preferences_dialog_path_format_ref (gpointer instance);
+static void preferences_dialog_path_format_unref (gpointer instance);
+static GParamSpec* preferences_dialog_param_spec_path_format (const gchar* name,
+ const gchar* nick,
+ const gchar* blurb,
+ GType object_type,
+ GParamFlags flags) G_GNUC_UNUSED;
+static void preferences_dialog_value_set_path_format (GValue* value,
+ gpointer v_object) G_GNUC_UNUSED;
+static void preferences_dialog_value_take_path_format (GValue* value,
+ gpointer v_object) G_GNUC_UNUSED;
+static gpointer preferences_dialog_value_get_path_format (const GValue* value) G_GNUC_UNUSED;
+static GType preferences_dialog_path_format_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
+GType plugins_manifest_widget_mediator_get_type (void) G_GNUC_CONST;
+#define PREFERENCES_DIALOG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_PREFERENCES_DIALOG, PreferencesDialogPrivate))
+PluginsManifestWidgetMediator* plugins_manifest_widget_mediator_new (void);
+PluginsManifestWidgetMediator* plugins_manifest_widget_mediator_construct (GType object_type);
+static PreferencesDialog* preferences_dialog_new (void);
+static PreferencesDialog* preferences_dialog_construct (GType object_type);
+gint resources_use_header_bar (void);
+GType page_window_get_type (void) G_GNUC_CONST;
+GType app_window_get_type (void) G_GNUC_CONST;
+AppWindow* app_window_get_instance (void);
+static gboolean preferences_dialog_on_delete (PreferencesDialog* self);
+static gboolean _preferences_dialog_on_delete_gtk_widget_delete_event (GtkWidget* _sender,
+ GdkEventAny* event,
+ gpointer self);
+static void preferences_dialog_on_close (PreferencesDialog* self);
+static void _preferences_dialog_on_close_gtk_dialog_response (GtkDialog* _sender,
+ gint response_id,
+ gpointer self);
+GType configuration_facade_get_type (void) G_GNUC_CONST;
+GType config_facade_get_type (void) G_GNUC_CONST;
+ConfigFacade* config_facade_get_instance (void);
+void config_facade_get_bg_color (ConfigFacade* self,
+ GdkRGBA* result);
+static void preferences_dialog_on_value_changed (PreferencesDialog* self);
+static void _preferences_dialog_on_value_changed_gtk_adjustment_value_changed (GtkAdjustment* _sender,
+ gpointer self);
+static gboolean preferences_dialog_on_bg_color_reset (PreferencesDialog* self,
+ GdkEventButton* event);
+static gboolean _preferences_dialog_on_bg_color_reset_gtk_widget_button_press_event (GtkWidget* _sender,
+ GdkEventButton* event,
+ gpointer self);
+static void preferences_dialog_on_radio_changed (PreferencesDialog* self);
+static void _preferences_dialog_on_radio_changed_gtk_toggle_button_toggled (GtkToggleButton* _sender,
+ gpointer self);
+gchar* configuration_facade_get_transparent_background_color (ConfigurationFacade* self);
+static void preferences_dialog_on_color_changed (PreferencesDialog* self);
+static void _preferences_dialog_on_color_changed_gtk_color_button_color_set (GtkColorButton* _sender,
+ gpointer self);
+gchar* configuration_facade_get_transparent_background_type (ConfigurationFacade* self);
+gchar* resources_get_help_path (void);
+#define RESOURCES_DIR_PATTERN_URI_SYSWIDE "help:shotwell/other-files"
+static gboolean preferences_dialog_on_local_pattern_help (PreferencesDialog* self,
+ const gchar* ignore);
+static gboolean _preferences_dialog_on_local_pattern_help_gtk_label_activate_link (GtkLabel* _sender,
+ const gchar* uri,
+ gpointer self);
+static void preferences_dialog_add_to_dir_formats (PreferencesDialog* self,
+ const gchar* name,
+ const gchar* pattern);
+static void preferences_dialog_on_dir_pattern_combo_changed (PreferencesDialog* self);
+static void _preferences_dialog_on_dir_pattern_combo_changed_gtk_combo_box_changed (GtkComboBox* _sender,
+ gpointer self);
+static void preferences_dialog_on_dir_pattern_entry_changed (PreferencesDialog* self);
+static void _preferences_dialog_on_dir_pattern_entry_changed_gtk_editable_changed (GtkEditable* _sender,
+ gpointer self);
+static void preferences_dialog_on_lowercase_toggled (PreferencesDialog* self);
+static void _preferences_dialog_on_lowercase_toggled_gtk_toggle_button_toggled (GtkToggleButton* _sender,
+ gpointer self);
+void preferences_dialog_populate_preference_options (PreferencesDialog* self);
+static void preferences_dialog_on_photo_editor_changed (PreferencesDialog* self);
+static void _preferences_dialog_on_photo_editor_changed_gtk_combo_box_changed (GtkComboBox* _sender,
+ gpointer self);
+static void preferences_dialog_on_raw_editor_changed (PreferencesDialog* self);
+static void _preferences_dialog_on_raw_editor_changed_gtk_combo_box_changed (GtkComboBox* _sender,
+ gpointer self);
+gboolean configuration_facade_get_auto_import_from_library (ConfigurationFacade* self);
+gboolean configuration_facade_get_commit_metadata_to_masters (ConfigurationFacade* self);
+GType raw_developer_get_type (void) G_GNUC_CONST;
+gchar* raw_developer_get_label (RawDeveloper self);
+static void preferences_dialog_set_raw_developer_combo (PreferencesDialog* self,
+ RawDeveloper d);
+RawDeveloper configuration_facade_get_default_raw_developer (ConfigurationFacade* self);
+static void preferences_dialog_on_default_raw_developer_changed (PreferencesDialog* self);
+static void _preferences_dialog_on_default_raw_developer_changed_gtk_combo_box_changed (GtkComboBox* _sender,
+ gpointer self);
+static void preferences_dialog_populate_app_combo_box (PreferencesDialog* self,
+ GtkComboBox* combo_box,
+ gchar** mime_types,
+ int mime_types_length1,
+ const gchar* current_app_executable,
+ SortedList* * external_apps);
+gchar** photo_file_format_get_editable_mime_types (int* result_length1);
+gchar* configuration_facade_get_external_photo_app (ConfigurationFacade* self);
+GType photo_file_format_get_type (void) G_GNUC_CONST;
+gchar** photo_file_format_get_mime_types (PhotoFileFormat self,
+ int* result_length1);
+gchar* configuration_facade_get_external_raw_app (ConfigurationFacade* self);
+static void preferences_dialog_setup_dir_pattern (PreferencesDialog* self,
+ GtkComboBox* combo_box,
+ GtkEntry* entry);
+gboolean configuration_facade_get_use_lowercase_filenames (ConfigurationFacade* self);
+void configuration_facade_set_transparent_background_type (ConfigurationFacade* self,
+ const gchar* type);
+void configuration_facade_set_transparent_background_color (ConfigurationFacade* self,
+ const gchar* color_name);
+void resources_launch_help (GdkScreen* screen,
+ const gchar* anchor,
+ GError** error);
+SortedList* desktop_integration_get_apps_for_mime_types (gchar** mime_types,
+ int mime_types_length1);
+GdkPixbuf* scale_pixbuf (GdkPixbuf* pixbuf,
+ gint scale,
+ GdkInterpType interp,
+ gboolean scale_up);
+#define RESOURCES_DEFAULT_ICON_SCALE 24
+gint sorted_list_index_of (SortedList* self,
+ gconstpointer search);
+gchar* configuration_facade_get_directory_pattern (ConfigurationFacade* self);
+gchar* configuration_facade_get_directory_pattern_custom (ConfigurationFacade* self);
+gboolean is_string_empty (const gchar* s);
+void preferences_dialog_show_preferences (void);
+GFile* app_dirs_get_import_dir (void);
+static void preferences_dialog_commit_on_close (PreferencesDialog* self);
+void config_facade_commit_bg_color (ConfigFacade* self);
+void configuration_facade_set_auto_import_from_library (ConfigurationFacade* self,
+ gboolean auto_import);
+void configuration_facade_set_commit_metadata_to_masters (ConfigurationFacade* self,
+ gboolean commit_metadata);
+void app_dirs_set_import_dir (const gchar* path);
+void configuration_facade_set_directory_pattern_custom (ConfigurationFacade* self,
+ const gchar* s);
+void configuration_facade_set_directory_pattern (ConfigurationFacade* self,
+ const gchar* s);
+static gboolean preferences_dialog_get_allow_closing (PreferencesDialog* self);
+static void preferences_dialog_set_background_color (PreferencesDialog* self,
+ gdouble bg_color_value);
+gboolean has_only_key_modifier (GdkModifierType field,
+ GdkModifierType mask);
+void parse_color (const gchar* spec,
+ GdkRGBA* result);
+#define CONFIG_FACADE_DEFAULT_BG_COLOR "#444"
+static void preferences_dialog_set_allow_closing (PreferencesDialog* self,
+ gboolean allow);
+void config_facade_set_bg_color (ConfigFacade* self,
+ GdkRGBA* color);
+static void preferences_dialog_to_grayscale (PreferencesDialog* self,
+ gdouble color_value,
+ GdkRGBA* result);
+gpointer sorted_list_get_at (SortedList* self,
+ gint index);
+void configuration_facade_set_external_photo_app (ConfigurationFacade* self,
+ const gchar* external_photo_app);
+gchar* desktop_integration_get_app_open_command (GAppInfo* app_info);
+void configuration_facade_set_external_raw_app (ConfigurationFacade* self,
+ const gchar* external_raw_app);
+static RawDeveloper preferences_dialog_raw_developer_from_combo (PreferencesDialog* self);
+void configuration_facade_set_default_raw_developer (ConfigurationFacade* self,
+ RawDeveloper d);
+static void preferences_dialog_on_current_folder_changed (PreferencesDialog* self);
+static gboolean preferences_dialog_real_map_event (GtkWidget* base,
+ GdkEventAny* event);
+static void _preferences_dialog_on_current_folder_changed_gtk_file_chooser_current_folder_changed (GtkFileChooser* _sender,
+ gpointer self);
+static PreferencesDialogPathFormat* preferences_dialog_path_format_new (const gchar* name,
+ const gchar* pattern);
+static PreferencesDialogPathFormat* preferences_dialog_path_format_construct (GType object_type,
+ const gchar* name,
+ const gchar* pattern);
+void configuration_facade_set_use_lowercase_filenames (ConfigurationFacade* self,
+ gboolean b);
+static void preferences_dialog_path_format_finalize (PreferencesDialogPathFormat * obj);
+static void preferences_dialog_finalize (GObject * obj);
+static void _vala_array_destroy (gpointer array,
+ gint array_length,
+ GDestroyNotify destroy_func);
+static void _vala_array_free (gpointer array,
+ gint array_length,
+ GDestroyNotify destroy_func);
+static gint _vala_array_length (gpointer array);
+
+
+static gboolean
+_preferences_dialog_on_delete_gtk_widget_delete_event (GtkWidget* _sender,
+ GdkEventAny* event,
+ gpointer self)
+{
+ gboolean result;
+ result = preferences_dialog_on_delete ((PreferencesDialog*) self);
+#line 72 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ return result;
+#line 399 "Preferences.c"
+}
+
+
+static void
+_preferences_dialog_on_close_gtk_dialog_response (GtkDialog* _sender,
+ gint response_id,
+ gpointer self)
+{
+#line 73 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ preferences_dialog_on_close ((PreferencesDialog*) self);
+#line 410 "Preferences.c"
+}
+
+
+static void
+_preferences_dialog_on_value_changed_gtk_adjustment_value_changed (GtkAdjustment* _sender,
+ gpointer self)
+{
+#line 77 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ preferences_dialog_on_value_changed ((PreferencesDialog*) self);
+#line 420 "Preferences.c"
+}
+
+
+static gboolean
+_preferences_dialog_on_bg_color_reset_gtk_widget_button_press_event (GtkWidget* _sender,
+ GdkEventButton* event,
+ gpointer self)
+{
+ gboolean result;
+ result = preferences_dialog_on_bg_color_reset ((PreferencesDialog*) self, event);
+#line 79 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ return result;
+#line 433 "Preferences.c"
+}
+
+
+static void
+_preferences_dialog_on_radio_changed_gtk_toggle_button_toggled (GtkToggleButton* _sender,
+ gpointer self)
+{
+#line 81 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ preferences_dialog_on_radio_changed ((PreferencesDialog*) self);
+#line 443 "Preferences.c"
+}
+
+
+static void
+_preferences_dialog_on_color_changed_gtk_color_button_color_set (GtkColorButton* _sender,
+ gpointer self)
+{
+#line 92 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ preferences_dialog_on_color_changed ((PreferencesDialog*) self);
+#line 453 "Preferences.c"
+}
+
+
+static gboolean
+_preferences_dialog_on_local_pattern_help_gtk_label_activate_link (GtkLabel* _sender,
+ const gchar* uri,
+ gpointer self)
+{
+ gboolean result;
+ result = preferences_dialog_on_local_pattern_help ((PreferencesDialog*) self, uri);
+#line 120 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ return result;
+#line 466 "Preferences.c"
+}
+
+
+static void
+_preferences_dialog_on_dir_pattern_combo_changed_gtk_combo_box_changed (GtkComboBox* _sender,
+ gpointer self)
+{
+#line 131 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ preferences_dialog_on_dir_pattern_combo_changed ((PreferencesDialog*) self);
+#line 476 "Preferences.c"
+}
+
+
+static void
+_preferences_dialog_on_dir_pattern_entry_changed_gtk_editable_changed (GtkEditable* _sender,
+ gpointer self)
+{
+#line 132 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ preferences_dialog_on_dir_pattern_entry_changed ((PreferencesDialog*) self);
+#line 486 "Preferences.c"
+}
+
+
+static void
+_preferences_dialog_on_lowercase_toggled_gtk_toggle_button_toggled (GtkToggleButton* _sender,
+ gpointer self)
+{
+#line 134 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ preferences_dialog_on_lowercase_toggled ((PreferencesDialog*) self);
+#line 496 "Preferences.c"
+}
+
+
+static void
+_preferences_dialog_on_photo_editor_changed_gtk_combo_box_changed (GtkComboBox* _sender,
+ gpointer self)
+{
+#line 140 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ preferences_dialog_on_photo_editor_changed ((PreferencesDialog*) self);
+#line 506 "Preferences.c"
+}
+
+
+static void
+_preferences_dialog_on_raw_editor_changed_gtk_combo_box_changed (GtkComboBox* _sender,
+ gpointer self)
+{
+#line 141 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ preferences_dialog_on_raw_editor_changed ((PreferencesDialog*) self);
+#line 516 "Preferences.c"
+}
+
+
+static void
+_preferences_dialog_on_default_raw_developer_changed_gtk_combo_box_changed (GtkComboBox* _sender,
+ gpointer self)
+{
+#line 150 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ preferences_dialog_on_default_raw_developer_changed ((PreferencesDialog*) self);
+#line 526 "Preferences.c"
+}
+
+
+static PreferencesDialog*
+preferences_dialog_construct (GType object_type)
+{
+ PreferencesDialog * self = NULL;
+ AppWindow* _tmp0_;
+ AppWindow* _tmp1_;
+ GdkWindow* _tmp2_;
+ AppWindow* _tmp3_;
+ AppWindow* _tmp4_;
+ GtkAdjustment* _tmp5_;
+ GtkAdjustment* _tmp6_;
+ ConfigFacade* _tmp7_;
+ ConfigFacade* _tmp8_;
+ GdkRGBA _tmp9_ = {0};
+ gdouble _tmp10_;
+ GtkAdjustment* _tmp11_;
+ GtkScale* _tmp12_;
+ GtkRadioButton* _tmp13_;
+ GtkRadioButton* _tmp14_;
+ GtkRadioButton* _tmp15_;
+ GtkRadioButton* _tmp16_;
+ GtkColorButton* _tmp17_;
+ GdkRGBA color = {0};
+ ConfigFacade* _tmp18_;
+ ConfigFacade* _tmp19_;
+ gchar* _tmp20_;
+ gchar* _tmp21_;
+ GtkColorButton* _tmp22_;
+ GdkRGBA _tmp23_;
+ GtkColorButton* _tmp24_;
+ ConfigFacade* _tmp25_;
+ ConfigFacade* _tmp26_;
+ gchar* _tmp27_;
+ gchar* _tmp28_;
+ gchar* _tmp29_;
+ GQuark _tmp31_ = 0U;
+#line 94 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ static GQuark _tmp30_label0 = 0;
+#line 94 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ static GQuark _tmp30_label1 = 0;
+#line 570 "Preferences.c"
+ gchar* help_path = NULL;
+ gchar* _tmp35_;
+ const gchar* _tmp36_;
+ gchar* _tmp48_;
+ gchar* _tmp49_;
+ gchar* _tmp50_;
+ gchar* _tmp51_;
+ gchar* _tmp52_;
+ gchar* _tmp53_;
+ GtkComboBoxText* _tmp54_;
+ GtkEntry* _tmp55_;
+ GtkCheckButton* _tmp56_;
+ GtkNotebook* _tmp57_;
+ GtkWidget* _tmp58_;
+ PluginsManifestWidgetMediator* _tmp59_;
+ GtkComboBox* _tmp60_;
+ GtkComboBox* _tmp61_;
+ GtkCheckButton* _tmp62_;
+ ConfigFacade* _tmp63_;
+ ConfigFacade* _tmp64_;
+ GtkCheckButton* _tmp65_;
+ ConfigFacade* _tmp66_;
+ ConfigFacade* _tmp67_;
+ GtkComboBoxText* _tmp68_;
+ gchar* _tmp69_;
+ gchar* _tmp70_;
+ GtkComboBoxText* _tmp71_;
+ gchar* _tmp72_;
+ gchar* _tmp73_;
+ ConfigFacade* _tmp74_;
+ ConfigFacade* _tmp75_;
+ GtkComboBoxText* _tmp76_;
+#line 68 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ self = (PreferencesDialog*) g_object_new (object_type, "use-header-bar", resources_use_header_bar (), NULL);
+#line 70 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp0_ = app_window_get_instance ();
+#line 70 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp1_ = _tmp0_;
+#line 70 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp2_ = gtk_widget_get_parent_window (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_widget_get_type (), GtkWidget));
+#line 70 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_widget_set_parent_window (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), _tmp2_);
+#line 70 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (_tmp1_);
+#line 71 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp3_ = app_window_get_instance ();
+#line 71 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp4_ = _tmp3_;
+#line 71 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_window_set_transient_for (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_window_get_type (), GtkWindow));
+#line 71 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (_tmp4_);
+#line 72 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), "delete-event", (GCallback) _preferences_dialog_on_delete_gtk_widget_delete_event, self, 0);
+#line 73 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_dialog_get_type (), GtkDialog), "response", (GCallback) _preferences_dialog_on_close_gtk_dialog_response, self, 0);
+#line 75 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp5_ = self->priv->bg_color_adjustment;
+#line 75 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp6_ = self->priv->bg_color_adjustment;
+#line 75 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp7_ = config_facade_get_instance ();
+#line 75 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp8_ = _tmp7_;
+#line 75 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ config_facade_get_bg_color (_tmp8_, &_tmp9_);
+#line 75 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp10_ = _tmp9_.red;
+#line 75 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_adjustment_set_value (_tmp5_, gtk_adjustment_get_upper (_tmp6_) - (_tmp10_ * 65535.0));
+#line 75 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (_tmp8_);
+#line 77 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp11_ = self->priv->bg_color_adjustment;
+#line 77 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_signal_connect_object (_tmp11_, "value-changed", (GCallback) _preferences_dialog_on_value_changed_gtk_adjustment_value_changed, self, 0);
+#line 79 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp12_ = self->priv->bg_color_slider;
+#line 79 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, gtk_widget_get_type (), GtkWidget), "button-press-event", (GCallback) _preferences_dialog_on_bg_color_reset_gtk_widget_button_press_event, self, 0);
+#line 81 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp13_ = self->priv->transparent_checker_radio;
+#line 81 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, gtk_toggle_button_get_type (), GtkToggleButton), "toggled", (GCallback) _preferences_dialog_on_radio_changed_gtk_toggle_button_toggled, self, 0);
+#line 82 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp14_ = self->priv->transparent_solid_radio;
+#line 82 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, gtk_toggle_button_get_type (), GtkToggleButton), "toggled", (GCallback) _preferences_dialog_on_radio_changed_gtk_toggle_button_toggled, self, 0);
+#line 83 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp15_ = self->priv->transparent_none_radio;
+#line 83 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, gtk_toggle_button_get_type (), GtkToggleButton), "toggled", (GCallback) _preferences_dialog_on_radio_changed_gtk_toggle_button_toggled, self, 0);
+#line 85 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp16_ = self->priv->transparent_solid_radio;
+#line 85 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp17_ = self->priv->transparent_solid_color;
+#line 85 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_object_bind_property_with_closures (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, G_TYPE_OBJECT, GObject), "active", G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, G_TYPE_OBJECT, GObject), "sensitive", G_BINDING_DEFAULT, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
+#line 89 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ memset (&color, 0, sizeof (GdkRGBA));
+#line 90 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp18_ = config_facade_get_instance ();
+#line 90 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp19_ = _tmp18_;
+#line 90 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp20_ = configuration_facade_get_transparent_background_color (G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
+#line 90 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp21_ = _tmp20_;
+#line 90 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gdk_rgba_parse (&color, _tmp21_);
+#line 90 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_free0 (_tmp21_);
+#line 90 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (_tmp19_);
+#line 91 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp22_ = self->priv->transparent_solid_color;
+#line 91 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp23_ = color;
+#line 91 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_color_chooser_set_rgba (G_TYPE_CHECK_INSTANCE_TYPE (_tmp22_, gtk_color_chooser_get_type ()) ? ((GtkColorChooser*) _tmp22_) : NULL, &_tmp23_);
+#line 92 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp24_ = self->priv->transparent_solid_color;
+#line 92 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_signal_connect_object (_tmp24_, "color-set", (GCallback) _preferences_dialog_on_color_changed_gtk_color_button_color_set, self, 0);
+#line 94 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp25_ = config_facade_get_instance ();
+#line 94 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp26_ = _tmp25_;
+#line 94 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp27_ = configuration_facade_get_transparent_background_type (G_TYPE_CHECK_INSTANCE_CAST (_tmp26_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
+#line 94 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp28_ = _tmp27_;
+#line 94 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (_tmp26_);
+#line 94 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp29_ = _tmp28_;
+#line 94 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp31_ = (NULL == _tmp29_) ? 0 : g_quark_from_string (_tmp29_);
+#line 94 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_free (_tmp29_);
+#line 94 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (_tmp31_ == ((0 != _tmp30_label0) ? _tmp30_label0 : (_tmp30_label0 = g_quark_from_static_string ("checkered")))) {
+#line 94 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ switch (0) {
+#line 715 "Preferences.c"
+ default:
+ {
+ GtkRadioButton* _tmp32_;
+#line 96 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp32_ = self->priv->transparent_checker_radio;
+#line 96 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_toggle_button_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp32_, gtk_toggle_button_get_type (), GtkToggleButton), TRUE);
+#line 97 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ break;
+#line 725 "Preferences.c"
+ }
+ }
+ } else if (_tmp31_ == ((0 != _tmp30_label1) ? _tmp30_label1 : (_tmp30_label1 = g_quark_from_static_string ("solid")))) {
+#line 94 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ switch (0) {
+#line 731 "Preferences.c"
+ default:
+ {
+ GtkRadioButton* _tmp33_;
+#line 99 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp33_ = self->priv->transparent_solid_radio;
+#line 99 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_toggle_button_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp33_, gtk_toggle_button_get_type (), GtkToggleButton), TRUE);
+#line 100 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ break;
+#line 741 "Preferences.c"
+ }
+ }
+ } else {
+#line 94 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ switch (0) {
+#line 747 "Preferences.c"
+ default:
+ {
+ GtkRadioButton* _tmp34_;
+#line 102 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp34_ = self->priv->transparent_none_radio;
+#line 102 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_toggle_button_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp34_, gtk_toggle_button_get_type (), GtkToggleButton), TRUE);
+#line 103 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ break;
+#line 757 "Preferences.c"
+ }
+ }
+ }
+#line 111 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp35_ = resources_get_help_path ();
+#line 111 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ help_path = _tmp35_;
+#line 113 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp36_ = help_path;
+#line 113 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (_tmp36_ == NULL) {
+#line 769 "Preferences.c"
+ GtkLabel* _tmp37_;
+ gchar* _tmp38_;
+ gchar* _tmp39_;
+ gchar* _tmp40_;
+ gchar* _tmp41_;
+#line 115 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp37_ = self->priv->pattern_help;
+#line 115 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp38_ = g_strconcat ("<a href=\"" RESOURCES_DIR_PATTERN_URI_SYSWIDE "\">", _ ("(Help)"), NULL);
+#line 115 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp39_ = _tmp38_;
+#line 115 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp40_ = g_strconcat (_tmp39_, "</a>", NULL);
+#line 115 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp41_ = _tmp40_;
+#line 115 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_label_set_markup (_tmp37_, _tmp41_);
+#line 115 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_free0 (_tmp41_);
+#line 115 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_free0 (_tmp39_);
+#line 791 "Preferences.c"
+ } else {
+ GtkLabel* _tmp42_;
+ gchar* _tmp43_;
+ gchar* _tmp44_;
+ gchar* _tmp45_;
+ gchar* _tmp46_;
+ GtkLabel* _tmp47_;
+#line 119 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp42_ = self->priv->pattern_help;
+#line 119 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp43_ = g_strconcat ("<a href=\"dummy:\">", _ ("(Help)"), NULL);
+#line 119 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp44_ = _tmp43_;
+#line 119 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp45_ = g_strconcat (_tmp44_, "</a>", NULL);
+#line 119 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp46_ = _tmp45_;
+#line 119 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_label_set_markup (_tmp42_, _tmp46_);
+#line 119 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_free0 (_tmp46_);
+#line 119 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_free0 (_tmp44_);
+#line 120 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp47_ = self->priv->pattern_help;
+#line 120 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_signal_connect_object (_tmp47_, "activate-link", (GCallback) _preferences_dialog_on_local_pattern_help_gtk_label_activate_link, self, 0);
+#line 819 "Preferences.c"
+ }
+#line 123 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp48_ = g_strdup_printf (_ ("Year%sMonth%sDay"), G_DIR_SEPARATOR_S, G_DIR_SEPARATOR_S);
+#line 123 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp49_ = _tmp48_;
+#line 123 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ preferences_dialog_add_to_dir_formats (self, _tmp49_, "%Y" G_DIR_SEPARATOR_S "%m" G_DIR_SEPARATOR_S "%d");
+#line 123 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_free0 (_tmp49_);
+#line 125 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp50_ = g_strdup_printf (_ ("Year%sMonth"), G_DIR_SEPARATOR_S);
+#line 125 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp51_ = _tmp50_;
+#line 125 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ preferences_dialog_add_to_dir_formats (self, _tmp51_, "%Y" G_DIR_SEPARATOR_S "%m");
+#line 125 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_free0 (_tmp51_);
+#line 127 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp52_ = g_strdup_printf (_ ("Year%sMonth-Day"), G_DIR_SEPARATOR_S);
+#line 127 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp53_ = _tmp52_;
+#line 127 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ preferences_dialog_add_to_dir_formats (self, _tmp53_, "%Y" G_DIR_SEPARATOR_S "%m-%d");
+#line 127 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_free0 (_tmp53_);
+#line 129 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ preferences_dialog_add_to_dir_formats (self, _ ("Year-Month-Day"), "%Y-%m-%d");
+#line 130 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ preferences_dialog_add_to_dir_formats (self, _ ("Custom"), NULL);
+#line 131 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp54_ = self->priv->dir_pattern_combo;
+#line 131 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp54_, gtk_combo_box_get_type (), GtkComboBox), "changed", (GCallback) _preferences_dialog_on_dir_pattern_combo_changed_gtk_combo_box_changed, self, 0);
+#line 132 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp55_ = self->priv->dir_pattern_entry;
+#line 132 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp55_, gtk_editable_get_type (), GtkEditable), "changed", (GCallback) _preferences_dialog_on_dir_pattern_entry_changed_gtk_editable_changed, self, 0);
+#line 134 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp56_ = self->priv->lowercase;
+#line 134 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp56_, gtk_toggle_button_get_type (), GtkToggleButton), "toggled", (GCallback) _preferences_dialog_on_lowercase_toggled_gtk_toggle_button_toggled, self, 0);
+#line 136 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp57_ = self->priv->preferences_notebook;
+#line 136 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp58_ = gtk_notebook_get_nth_page (_tmp57_, 2);
+#line 136 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp59_ = self->priv->plugins_mediator;
+#line 136 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_container_add (G_TYPE_CHECK_INSTANCE_TYPE (_tmp58_, gtk_container_get_type ()) ? ((GtkContainer*) _tmp58_) : NULL, G_TYPE_CHECK_INSTANCE_CAST (_tmp59_, gtk_widget_get_type (), GtkWidget));
+#line 138 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ preferences_dialog_populate_preference_options (self);
+#line 140 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp60_ = self->priv->photo_editor_combo;
+#line 140 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_signal_connect_object (_tmp60_, "changed", (GCallback) _preferences_dialog_on_photo_editor_changed_gtk_combo_box_changed, self, 0);
+#line 141 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp61_ = self->priv->raw_editor_combo;
+#line 141 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_signal_connect_object (_tmp61_, "changed", (GCallback) _preferences_dialog_on_raw_editor_changed_gtk_combo_box_changed, self, 0);
+#line 143 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp62_ = self->priv->autoimport;
+#line 143 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp63_ = config_facade_get_instance ();
+#line 143 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp64_ = _tmp63_;
+#line 143 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_toggle_button_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp62_, gtk_toggle_button_get_type (), GtkToggleButton), configuration_facade_get_auto_import_from_library (G_TYPE_CHECK_INSTANCE_CAST (_tmp64_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)));
+#line 143 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (_tmp64_);
+#line 145 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp65_ = self->priv->write_metadata;
+#line 145 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp66_ = config_facade_get_instance ();
+#line 145 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp67_ = _tmp66_;
+#line 145 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_toggle_button_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp65_, gtk_toggle_button_get_type (), GtkToggleButton), configuration_facade_get_commit_metadata_to_masters (G_TYPE_CHECK_INSTANCE_CAST (_tmp67_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)));
+#line 145 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (_tmp67_);
+#line 147 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp68_ = self->priv->default_raw_developer_combo;
+#line 147 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp69_ = raw_developer_get_label (RAW_DEVELOPER_CAMERA);
+#line 147 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp70_ = _tmp69_;
+#line 147 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_combo_box_text_append_text (_tmp68_, _tmp70_);
+#line 147 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_free0 (_tmp70_);
+#line 148 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp71_ = self->priv->default_raw_developer_combo;
+#line 148 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp72_ = raw_developer_get_label (RAW_DEVELOPER_SHOTWELL);
+#line 148 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp73_ = _tmp72_;
+#line 148 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_combo_box_text_append_text (_tmp71_, _tmp73_);
+#line 148 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_free0 (_tmp73_);
+#line 149 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp74_ = config_facade_get_instance ();
+#line 149 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp75_ = _tmp74_;
+#line 149 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ preferences_dialog_set_raw_developer_combo (self, configuration_facade_get_default_raw_developer (G_TYPE_CHECK_INSTANCE_CAST (_tmp75_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)));
+#line 149 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (_tmp75_);
+#line 150 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp76_ = self->priv->default_raw_developer_combo;
+#line 150 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp76_, gtk_combo_box_get_type (), GtkComboBox), "changed", (GCallback) _preferences_dialog_on_default_raw_developer_changed_gtk_combo_box_changed, self, 0);
+#line 67 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_free0 (help_path);
+#line 67 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ return self;
+#line 935 "Preferences.c"
+}
+
+
+static PreferencesDialog*
+preferences_dialog_new (void)
+{
+#line 67 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ return preferences_dialog_construct (TYPE_PREFERENCES_DIALOG);
+#line 944 "Preferences.c"
+}
+
+
+void
+preferences_dialog_populate_preference_options (PreferencesDialog* self)
+{
+ GtkComboBox* _tmp0_;
+ gint _tmp1_;
+ gchar** _tmp2_;
+ gchar** _tmp3_;
+ gint _tmp3__length1;
+ ConfigFacade* _tmp4_;
+ ConfigFacade* _tmp5_;
+ gchar* _tmp6_;
+ gchar* _tmp7_;
+ SortedList* _tmp8_ = NULL;
+ GtkComboBox* _tmp9_;
+ gint _tmp10_;
+ gchar** _tmp11_;
+ gchar** _tmp12_;
+ gint _tmp12__length1;
+ ConfigFacade* _tmp13_;
+ ConfigFacade* _tmp14_;
+ gchar* _tmp15_;
+ gchar* _tmp16_;
+ SortedList* _tmp17_ = NULL;
+ GtkComboBoxText* _tmp18_;
+ GtkEntry* _tmp19_;
+ GtkCheckButton* _tmp20_;
+ ConfigFacade* _tmp21_;
+ ConfigFacade* _tmp22_;
+#line 153 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_return_if_fail (IS_PREFERENCES_DIALOG (self));
+#line 154 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp0_ = self->priv->photo_editor_combo;
+#line 154 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp2_ = photo_file_format_get_editable_mime_types (&_tmp1_);
+#line 154 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp3_ = _tmp2_;
+#line 154 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp3__length1 = _tmp1_;
+#line 154 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp4_ = config_facade_get_instance ();
+#line 154 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp5_ = _tmp4_;
+#line 154 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp6_ = configuration_facade_get_external_photo_app (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
+#line 154 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp7_ = _tmp6_;
+#line 154 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ preferences_dialog_populate_app_combo_box (self, _tmp0_, _tmp3_, _tmp1_, _tmp7_, &_tmp8_);
+#line 154 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (self->priv->external_photo_apps);
+#line 154 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ self->priv->external_photo_apps = _tmp8_;
+#line 154 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_free0 (_tmp7_);
+#line 154 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (_tmp5_);
+#line 154 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp3_ = (_vala_array_free (_tmp3_, _tmp3__length1, (GDestroyNotify) g_free), NULL);
+#line 157 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp9_ = self->priv->raw_editor_combo;
+#line 157 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp11_ = photo_file_format_get_mime_types (PHOTO_FILE_FORMAT_RAW, &_tmp10_);
+#line 157 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp12_ = _tmp11_;
+#line 157 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp12__length1 = _tmp10_;
+#line 157 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp13_ = config_facade_get_instance ();
+#line 157 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp14_ = _tmp13_;
+#line 157 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp15_ = configuration_facade_get_external_raw_app (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
+#line 157 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp16_ = _tmp15_;
+#line 157 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ preferences_dialog_populate_app_combo_box (self, _tmp9_, _tmp12_, _tmp10_, _tmp16_, &_tmp17_);
+#line 157 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (self->priv->external_raw_apps);
+#line 157 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ self->priv->external_raw_apps = _tmp17_;
+#line 157 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_free0 (_tmp16_);
+#line 157 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (_tmp14_);
+#line 157 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp12_ = (_vala_array_free (_tmp12_, _tmp12__length1, (GDestroyNotify) g_free), NULL);
+#line 160 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp18_ = self->priv->dir_pattern_combo;
+#line 160 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp19_ = self->priv->dir_pattern_entry;
+#line 160 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ preferences_dialog_setup_dir_pattern (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, gtk_combo_box_get_type (), GtkComboBox), _tmp19_);
+#line 162 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp20_ = self->priv->lowercase;
+#line 162 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp21_ = config_facade_get_instance ();
+#line 162 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp22_ = _tmp21_;
+#line 162 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_toggle_button_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, gtk_toggle_button_get_type (), GtkToggleButton), configuration_facade_get_use_lowercase_filenames (G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)));
+#line 162 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (_tmp22_);
+#line 1050 "Preferences.c"
+}
+
+
+static void
+preferences_dialog_on_radio_changed (PreferencesDialog* self)
+{
+ ConfigFacade* config = NULL;
+ ConfigFacade* _tmp0_;
+ GtkRadioButton* _tmp1_;
+ gboolean _tmp2_;
+ gboolean _tmp3_;
+#line 165 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_return_if_fail (IS_PREFERENCES_DIALOG (self));
+#line 166 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp0_ = config_facade_get_instance ();
+#line 166 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ config = _tmp0_;
+#line 168 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp1_ = self->priv->transparent_checker_radio;
+#line 168 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp2_ = gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_toggle_button_get_type (), GtkToggleButton));
+#line 168 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp3_ = _tmp2_;
+#line 168 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (_tmp3_) {
+#line 1076 "Preferences.c"
+ ConfigFacade* _tmp4_;
+#line 169 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp4_ = config;
+#line 169 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ configuration_facade_set_transparent_background_type (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), "checkered");
+#line 1082 "Preferences.c"
+ } else {
+ GtkRadioButton* _tmp5_;
+ gboolean _tmp6_;
+ gboolean _tmp7_;
+#line 170 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp5_ = self->priv->transparent_solid_radio;
+#line 170 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp6_ = gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, gtk_toggle_button_get_type (), GtkToggleButton));
+#line 170 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp7_ = _tmp6_;
+#line 170 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (_tmp7_) {
+#line 1095 "Preferences.c"
+ ConfigFacade* _tmp8_;
+#line 171 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp8_ = config;
+#line 171 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ configuration_facade_set_transparent_background_type (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), "solid");
+#line 1101 "Preferences.c"
+ } else {
+ ConfigFacade* _tmp9_;
+#line 173 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp9_ = config;
+#line 173 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ configuration_facade_set_transparent_background_type (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), "none");
+#line 1108 "Preferences.c"
+ }
+ }
+#line 165 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (config);
+#line 1113 "Preferences.c"
+}
+
+
+static void
+preferences_dialog_on_color_changed (PreferencesDialog* self)
+{
+ gchar* color = NULL;
+ GtkColorButton* _tmp0_;
+ GdkRGBA _tmp1_ = {0};
+ GdkRGBA _tmp2_;
+ gchar* _tmp3_;
+ ConfigFacade* _tmp4_;
+ ConfigFacade* _tmp5_;
+#line 177 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_return_if_fail (IS_PREFERENCES_DIALOG (self));
+#line 178 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp0_ = self->priv->transparent_solid_color;
+#line 178 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_color_chooser_get_rgba (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, gtk_color_chooser_get_type ()) ? ((GtkColorChooser*) _tmp0_) : NULL, &_tmp1_);
+#line 178 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp2_ = _tmp1_;
+#line 178 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp3_ = gdk_rgba_to_string (&_tmp2_);
+#line 178 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ color = _tmp3_;
+#line 179 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp4_ = config_facade_get_instance ();
+#line 179 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp5_ = _tmp4_;
+#line 179 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ configuration_facade_set_transparent_background_color (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), color);
+#line 179 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (_tmp5_);
+#line 177 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_free0 (color);
+#line 1149 "Preferences.c"
+}
+
+
+static gboolean
+preferences_dialog_on_local_pattern_help (PreferencesDialog* self,
+ const gchar* ignore)
+{
+ gboolean result = FALSE;
+ GError * _inner_error_ = NULL;
+#line 184 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_return_val_if_fail (IS_PREFERENCES_DIALOG (self), FALSE);
+#line 184 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_return_val_if_fail (ignore != NULL, FALSE);
+#line 1163 "Preferences.c"
+ {
+ AppWindow* _tmp0_;
+ AppWindow* _tmp1_;
+ GdkScreen* _tmp2_;
+#line 186 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp0_ = app_window_get_instance ();
+#line 186 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp1_ = _tmp0_;
+#line 186 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp2_ = gtk_window_get_screen (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_window_get_type (), GtkWindow));
+#line 186 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ resources_launch_help (_tmp2_, "other-files.page", &_inner_error_);
+#line 186 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (_tmp1_);
+#line 186 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (G_UNLIKELY (_inner_error_ != NULL)) {
+#line 1180 "Preferences.c"
+ goto __catch22_g_error;
+ }
+ }
+ goto __finally22;
+ __catch22_g_error:
+ {
+ GError* e = NULL;
+ GError* _tmp3_;
+ const gchar* _tmp4_;
+#line 185 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ e = _inner_error_;
+#line 185 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _inner_error_ = NULL;
+#line 188 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp3_ = e;
+#line 188 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp4_ = _tmp3_->message;
+#line 188 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_message ("Preferences.vala:188: Unable to launch help: %s", _tmp4_);
+#line 185 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_error_free0 (e);
+#line 1202 "Preferences.c"
+ }
+ __finally22:
+#line 185 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (G_UNLIKELY (_inner_error_ != NULL)) {
+#line 1207 "Preferences.c"
+ gboolean _tmp5_ = FALSE;
+#line 185 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ 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);
+#line 185 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_clear_error (&_inner_error_);
+#line 185 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ return _tmp5_;
+#line 1215 "Preferences.c"
+ }
+#line 190 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ result = TRUE;
+#line 190 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ return result;
+#line 1221 "Preferences.c"
+}
+
+
+static gpointer
+_g_object_ref0 (gpointer self)
+{
+#line 220 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ return self ? g_object_ref (self) : NULL;
+#line 1230 "Preferences.c"
+}
+
+
+static void
+preferences_dialog_populate_app_combo_box (PreferencesDialog* self,
+ GtkComboBox* combo_box,
+ gchar** mime_types,
+ int mime_types_length1,
+ const gchar* current_app_executable,
+ SortedList* * external_apps)
+{
+ SortedList* _vala_external_apps = NULL;
+ SortedList* _tmp0_;
+ SortedList* _tmp1_;
+ gint _tmp2_;
+ gint _tmp3_;
+ GtkCellRendererPixbuf* pixbuf_renderer = NULL;
+ GtkCellRendererPixbuf* _tmp4_;
+ GtkCellRendererText* text_renderer = NULL;
+ GtkCellRendererText* _tmp5_;
+ GtkCellRendererPixbuf* _tmp6_;
+ GtkCellRendererText* _tmp7_;
+ GtkCellRendererPixbuf* _tmp8_;
+ GtkCellRendererText* _tmp9_;
+ GtkListStore* combo_store = NULL;
+ GtkListStore* _tmp10_;
+ GtkTreeIter iter = {0};
+ gint current_app = 0;
+ GtkListStore* _tmp57_;
+ gint _tmp58_;
+ GError * _inner_error_ = NULL;
+#line 193 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_return_if_fail (IS_PREFERENCES_DIALOG (self));
+#line 193 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_return_if_fail (GTK_IS_COMBO_BOX (combo_box));
+#line 193 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_return_if_fail (current_app_executable != NULL);
+#line 196 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _vala_assert (mime_types_length1 != 0, "mime_types.length != 0");
+#line 197 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp0_ = desktop_integration_get_apps_for_mime_types (mime_types, mime_types_length1);
+#line 197 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (_vala_external_apps);
+#line 197 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _vala_external_apps = _tmp0_;
+#line 199 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp1_ = _vala_external_apps;
+#line 199 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp2_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_COLLECTION, GeeCollection));
+#line 199 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp3_ = _tmp2_;
+#line 199 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (_tmp3_ == 0) {
+#line 200 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (external_apps) {
+#line 200 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ *external_apps = _vala_external_apps;
+#line 1288 "Preferences.c"
+ } else {
+#line 200 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (_vala_external_apps);
+#line 1292 "Preferences.c"
+ }
+#line 200 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ return;
+#line 1296 "Preferences.c"
+ }
+#line 203 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp4_ = (GtkCellRendererPixbuf*) gtk_cell_renderer_pixbuf_new ();
+#line 203 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_object_ref_sink (_tmp4_);
+#line 203 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ pixbuf_renderer = _tmp4_;
+#line 204 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp5_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
+#line 204 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_object_ref_sink (_tmp5_);
+#line 204 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ text_renderer = _tmp5_;
+#line 205 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_cell_layout_clear (G_TYPE_CHECK_INSTANCE_CAST (combo_box, gtk_cell_layout_get_type (), GtkCellLayout));
+#line 206 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp6_ = pixbuf_renderer;
+#line 206 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_cell_layout_pack_start (G_TYPE_CHECK_INSTANCE_CAST (combo_box, gtk_cell_layout_get_type (), GtkCellLayout), G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, gtk_cell_renderer_get_type (), GtkCellRenderer), FALSE);
+#line 207 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp7_ = text_renderer;
+#line 207 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_cell_layout_pack_start (G_TYPE_CHECK_INSTANCE_CAST (combo_box, gtk_cell_layout_get_type (), GtkCellLayout), G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, gtk_cell_renderer_get_type (), GtkCellRenderer), FALSE);
+#line 208 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp8_ = pixbuf_renderer;
+#line 208 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_cell_layout_add_attribute (G_TYPE_CHECK_INSTANCE_CAST (combo_box, gtk_cell_layout_get_type (), GtkCellLayout), G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, gtk_cell_renderer_get_type (), GtkCellRenderer), "pixbuf", 0);
+#line 209 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp9_ = text_renderer;
+#line 209 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_cell_layout_add_attribute (G_TYPE_CHECK_INSTANCE_CAST (combo_box, gtk_cell_layout_get_type (), GtkCellLayout), G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, gtk_cell_renderer_get_type (), GtkCellRenderer), "text", 1);
+#line 212 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp10_ = gtk_list_store_new (2, gdk_pixbuf_get_type (), G_TYPE_STRING, -1);
+#line 212 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ combo_store = _tmp10_;
+#line 215 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ current_app = -1;
+#line 1334 "Preferences.c"
+ {
+ GeeIterator* _app_it = NULL;
+ SortedList* _tmp11_;
+ GeeIterator* _tmp12_;
+#line 217 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp11_ = _vala_external_apps;
+#line 217 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp12_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, GEE_TYPE_ITERABLE, GeeIterable));
+#line 217 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _app_it = _tmp12_;
+#line 217 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ while (TRUE) {
+#line 1347 "Preferences.c"
+ GeeIterator* _tmp13_;
+ GAppInfo* app = NULL;
+ GeeIterator* _tmp14_;
+ gpointer _tmp15_;
+ GtkListStore* _tmp16_;
+ GtkTreeIter _tmp17_ = {0};
+ GIcon* app_icon = NULL;
+ GAppInfo* _tmp18_;
+ GIcon* _tmp19_;
+ GIcon* _tmp20_;
+ GtkListStore* _tmp48_;
+ GtkTreeIter _tmp49_;
+ GAppInfo* _tmp50_;
+ const gchar* _tmp51_;
+ GValue _tmp52_ = {0};
+ GAppInfo* _tmp53_;
+ const gchar* _tmp54_;
+#line 217 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp13_ = _app_it;
+#line 217 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (!gee_iterator_next (_tmp13_)) {
+#line 217 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ break;
+#line 1371 "Preferences.c"
+ }
+#line 217 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp14_ = _app_it;
+#line 217 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp15_ = gee_iterator_get (_tmp14_);
+#line 217 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ app = (GAppInfo*) _tmp15_;
+#line 218 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp16_ = combo_store;
+#line 218 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_list_store_append (_tmp16_, &_tmp17_);
+#line 218 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ iter = _tmp17_;
+#line 220 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp18_ = app;
+#line 220 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp19_ = g_app_info_get_icon (_tmp18_);
+#line 220 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp20_ = _g_object_ref0 (_tmp19_);
+#line 220 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ app_icon = _tmp20_;
+#line 1393 "Preferences.c"
+ {
+ GIcon* _tmp21_;
+#line 222 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp21_ = app_icon;
+#line 222 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp21_, g_file_icon_get_type ())) {
+#line 1400 "Preferences.c"
+ GdkPixbuf* _tmp22_ = NULL;
+ GIcon* _tmp23_;
+ GFile* _tmp24_;
+ gchar* _tmp25_;
+ gchar* _tmp26_;
+ GdkPixbuf* _tmp27_;
+ GdkPixbuf* _tmp28_;
+ GtkListStore* _tmp29_;
+ GtkTreeIter _tmp30_;
+ GdkPixbuf* _tmp31_;
+ GValue _tmp32_ = {0};
+#line 223 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp23_ = app_icon;
+#line 223 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp24_ = g_file_icon_get_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, g_file_icon_get_type (), GFileIcon));
+#line 223 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp25_ = g_file_get_path (_tmp24_);
+#line 223 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp26_ = _tmp25_;
+#line 223 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp27_ = gdk_pixbuf_new_from_file (_tmp26_, &_inner_error_);
+#line 223 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp28_ = _tmp27_;
+#line 223 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_free0 (_tmp26_);
+#line 223 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp22_ = _tmp28_;
+#line 223 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (G_UNLIKELY (_inner_error_ != NULL)) {
+#line 1430 "Preferences.c"
+ goto __catch23_g_error;
+ }
+#line 223 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp29_ = combo_store;
+#line 223 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp30_ = iter;
+#line 223 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp31_ = scale_pixbuf (_tmp22_, RESOURCES_DEFAULT_ICON_SCALE, GDK_INTERP_BILINEAR, FALSE);
+#line 223 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_value_init (&_tmp32_, gdk_pixbuf_get_type ());
+#line 223 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_value_take_object (&_tmp32_, _tmp31_);
+#line 223 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_list_store_set_value (_tmp29_, &_tmp30_, 0, &_tmp32_);
+#line 223 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ G_IS_VALUE (&_tmp32_) ? (g_value_unset (&_tmp32_), NULL) : NULL;
+#line 222 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (_tmp22_);
+#line 1449 "Preferences.c"
+ } else {
+ GIcon* _tmp33_;
+#line 226 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp33_ = app_icon;
+#line 226 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp33_, g_themed_icon_get_type ())) {
+#line 1456 "Preferences.c"
+ GdkPixbuf* icon_pixbuf = NULL;
+ GtkIconTheme* _tmp34_;
+ GIcon* _tmp35_;
+ gchar** _tmp36_;
+ gchar** _tmp37_;
+ const gchar* _tmp38_;
+ GdkPixbuf* _tmp39_;
+ GtkListStore* _tmp40_;
+ GtkTreeIter _tmp41_;
+ GdkPixbuf* _tmp42_;
+ GValue _tmp43_ = {0};
+#line 227 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp34_ = gtk_icon_theme_get_default ();
+#line 227 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp35_ = app_icon;
+#line 227 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp37_ = _tmp36_ = g_themed_icon_get_names (G_TYPE_CHECK_INSTANCE_CAST (_tmp35_, g_themed_icon_get_type (), GThemedIcon));
+#line 227 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp38_ = _tmp37_[0];
+#line 227 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp39_ = gtk_icon_theme_load_icon (_tmp34_, _tmp38_, RESOURCES_DEFAULT_ICON_SCALE, GTK_ICON_LOOKUP_FORCE_SIZE, &_inner_error_);
+#line 227 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ icon_pixbuf = _tmp39_;
+#line 227 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (G_UNLIKELY (_inner_error_ != NULL)) {
+#line 1482 "Preferences.c"
+ goto __catch23_g_error;
+ }
+#line 231 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp40_ = combo_store;
+#line 231 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp41_ = iter;
+#line 231 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp42_ = icon_pixbuf;
+#line 231 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_value_init (&_tmp43_, gdk_pixbuf_get_type ());
+#line 231 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_value_set_object (&_tmp43_, _tmp42_);
+#line 231 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_list_store_set_value (_tmp40_, &_tmp41_, 0, &_tmp43_);
+#line 231 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ G_IS_VALUE (&_tmp43_) ? (g_value_unset (&_tmp43_), NULL) : NULL;
+#line 226 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (icon_pixbuf);
+#line 1501 "Preferences.c"
+ }
+ }
+ }
+ goto __finally23;
+ __catch23_g_error:
+ {
+ GError* _error_ = NULL;
+ GError* _tmp44_;
+ const gchar* _tmp45_;
+ gchar* _tmp46_;
+ gchar* _tmp47_;
+#line 221 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _error_ = _inner_error_;
+#line 221 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _inner_error_ = NULL;
+#line 234 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp44_ = _error_;
+#line 234 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp45_ = _tmp44_->message;
+#line 234 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp46_ = g_strconcat ("Error loading icon pixbuf: ", _tmp45_, NULL);
+#line 234 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp47_ = _tmp46_;
+#line 234 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_warning ("Preferences.vala:234: %s", _tmp47_);
+#line 234 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_free0 (_tmp47_);
+#line 221 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_error_free0 (_error_);
+#line 1531 "Preferences.c"
+ }
+ __finally23:
+#line 221 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (G_UNLIKELY (_inner_error_ != NULL)) {
+#line 221 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (app_icon);
+#line 221 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (app);
+#line 221 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (_app_it);
+#line 221 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (combo_store);
+#line 221 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (text_renderer);
+#line 221 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (pixbuf_renderer);
+#line 221 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ 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);
+#line 221 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_clear_error (&_inner_error_);
+#line 221 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ return;
+#line 1554 "Preferences.c"
+ }
+#line 237 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp48_ = combo_store;
+#line 237 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp49_ = iter;
+#line 237 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp50_ = app;
+#line 237 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp51_ = g_app_info_get_name (_tmp50_);
+#line 237 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_value_init (&_tmp52_, G_TYPE_STRING);
+#line 237 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_value_set_string (&_tmp52_, _tmp51_);
+#line 237 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_list_store_set_value (_tmp48_, &_tmp49_, 1, &_tmp52_);
+#line 237 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ G_IS_VALUE (&_tmp52_) ? (g_value_unset (&_tmp52_), NULL) : NULL;
+#line 239 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp53_ = app;
+#line 239 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp54_ = g_app_info_get_commandline (_tmp53_);
+#line 239 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (g_strcmp0 (_tmp54_, current_app_executable) == 0) {
+#line 1578 "Preferences.c"
+ SortedList* _tmp55_;
+ GAppInfo* _tmp56_;
+#line 240 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp55_ = _vala_external_apps;
+#line 240 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp56_ = app;
+#line 240 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ current_app = sorted_list_index_of (_tmp55_, _tmp56_);
+#line 1587 "Preferences.c"
+ }
+#line 217 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (app_icon);
+#line 217 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (app);
+#line 1593 "Preferences.c"
+ }
+#line 217 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (_app_it);
+#line 1597 "Preferences.c"
+ }
+#line 245 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp57_ = combo_store;
+#line 245 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_combo_box_set_model (combo_box, G_TYPE_CHECK_INSTANCE_CAST (_tmp57_, gtk_tree_model_get_type (), GtkTreeModel));
+#line 247 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp58_ = current_app;
+#line 247 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (_tmp58_ != -1) {
+#line 1607 "Preferences.c"
+ gint _tmp59_;
+#line 248 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp59_ = current_app;
+#line 248 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_combo_box_set_active (combo_box, _tmp59_);
+#line 1613 "Preferences.c"
+ }
+#line 193 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (combo_store);
+#line 193 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (text_renderer);
+#line 193 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (pixbuf_renderer);
+#line 193 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (external_apps) {
+#line 193 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ *external_apps = _vala_external_apps;
+#line 1625 "Preferences.c"
+ } else {
+#line 193 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (_vala_external_apps);
+#line 1629 "Preferences.c"
+ }
+}
+
+
+static void
+preferences_dialog_setup_dir_pattern (PreferencesDialog* self,
+ GtkComboBox* combo_box,
+ GtkEntry* entry)
+{
+ gchar* pattern = NULL;
+ ConfigFacade* _tmp0_;
+ ConfigFacade* _tmp1_;
+ gchar* _tmp2_;
+ gchar* _tmp3_;
+ gboolean found = FALSE;
+ const gchar* _tmp4_;
+ gboolean _tmp29_;
+#line 251 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_return_if_fail (IS_PREFERENCES_DIALOG (self));
+#line 251 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_return_if_fail (GTK_IS_COMBO_BOX (combo_box));
+#line 251 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_return_if_fail (GTK_IS_ENTRY (entry));
+#line 252 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp0_ = config_facade_get_instance ();
+#line 252 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp1_ = _tmp0_;
+#line 252 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp2_ = configuration_facade_get_directory_pattern (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
+#line 252 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp3_ = _tmp2_;
+#line 252 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (_tmp1_);
+#line 252 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ pattern = _tmp3_;
+#line 253 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ found = FALSE;
+#line 254 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp4_ = pattern;
+#line 254 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (NULL != _tmp4_) {
+#line 1671 "Preferences.c"
+ gint i = 0;
+#line 256 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ i = 0;
+#line 1675 "Preferences.c"
+ {
+ GeeArrayList* _pf_list = NULL;
+ GeeArrayList* _tmp5_;
+ GeeArrayList* _tmp6_;
+ gint _pf_size = 0;
+ GeeArrayList* _tmp7_;
+ gint _tmp8_;
+ gint _tmp9_;
+ gint _pf_index = 0;
+#line 257 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp5_ = self->priv->path_formats;
+#line 257 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp6_ = _g_object_ref0 (_tmp5_);
+#line 257 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _pf_list = _tmp6_;
+#line 257 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp7_ = _pf_list;
+#line 257 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp8_ = gee_abstract_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection));
+#line 257 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp9_ = _tmp8_;
+#line 257 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _pf_size = _tmp9_;
+#line 257 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _pf_index = -1;
+#line 257 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ while (TRUE) {
+#line 1703 "Preferences.c"
+ gint _tmp10_;
+ gint _tmp11_;
+ gint _tmp12_;
+ PreferencesDialogPathFormat* pf = NULL;
+ GeeArrayList* _tmp13_;
+ gint _tmp14_;
+ gpointer _tmp15_;
+ PreferencesDialogPathFormat* _tmp16_;
+ const gchar* _tmp17_;
+ const gchar* _tmp18_;
+ gint _tmp20_;
+#line 257 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp10_ = _pf_index;
+#line 257 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _pf_index = _tmp10_ + 1;
+#line 257 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp11_ = _pf_index;
+#line 257 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp12_ = _pf_size;
+#line 257 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (!(_tmp11_ < _tmp12_)) {
+#line 257 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ break;
+#line 1727 "Preferences.c"
+ }
+#line 257 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp13_ = _pf_list;
+#line 257 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp14_ = _pf_index;
+#line 257 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp15_ = gee_abstract_list_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, GEE_TYPE_ABSTRACT_LIST, GeeAbstractList), _tmp14_);
+#line 257 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ pf = (PreferencesDialogPathFormat*) _tmp15_;
+#line 258 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp16_ = pf;
+#line 258 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp17_ = _tmp16_->pattern;
+#line 258 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp18_ = pattern;
+#line 258 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (g_strcmp0 (_tmp17_, _tmp18_) == 0) {
+#line 1745 "Preferences.c"
+ gint _tmp19_;
+#line 259 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp19_ = i;
+#line 259 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_combo_box_set_active (combo_box, _tmp19_);
+#line 260 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ found = TRUE;
+#line 261 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _preferences_dialog_path_format_unref0 (pf);
+#line 261 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ break;
+#line 1757 "Preferences.c"
+ }
+#line 263 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp20_ = i;
+#line 263 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ i = _tmp20_ + 1;
+#line 257 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _preferences_dialog_path_format_unref0 (pf);
+#line 1765 "Preferences.c"
+ }
+#line 257 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (_pf_list);
+#line 1769 "Preferences.c"
+ }
+ } else {
+ gchar* s = NULL;
+ ConfigFacade* _tmp21_;
+ ConfigFacade* _tmp22_;
+ gchar* _tmp23_;
+ gchar* _tmp24_;
+ const gchar* _tmp25_;
+#line 267 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp21_ = config_facade_get_instance ();
+#line 267 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp22_ = _tmp21_;
+#line 267 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp23_ = configuration_facade_get_directory_pattern_custom (G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
+#line 267 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp24_ = _tmp23_;
+#line 267 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (_tmp22_);
+#line 267 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ s = _tmp24_;
+#line 268 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp25_ = s;
+#line 268 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (!is_string_empty (_tmp25_)) {
+#line 1794 "Preferences.c"
+ GeeArrayList* _tmp26_;
+ gint _tmp27_;
+ gint _tmp28_;
+#line 269 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp26_ = self->priv->path_formats;
+#line 269 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp27_ = gee_abstract_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp26_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection));
+#line 269 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp28_ = _tmp27_;
+#line 269 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_combo_box_set_active (combo_box, _tmp28_ - 1);
+#line 270 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ found = TRUE;
+#line 1808 "Preferences.c"
+ }
+#line 254 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_free0 (s);
+#line 1812 "Preferences.c"
+ }
+#line 274 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp29_ = found;
+#line 274 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (!_tmp29_) {
+#line 275 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_combo_box_set_active (combo_box, 0);
+#line 1820 "Preferences.c"
+ }
+#line 278 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ preferences_dialog_on_dir_pattern_combo_changed (self);
+#line 251 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_free0 (pattern);
+#line 1826 "Preferences.c"
+}
+
+
+void
+preferences_dialog_show_preferences (void)
+{
+ PreferencesDialog* _tmp0_;
+ PreferencesDialog* _tmp2_;
+ PreferencesDialog* _tmp3_;
+ PreferencesDialog* _tmp4_;
+ GtkFileChooserButton* _tmp5_;
+ GFile* _tmp6_;
+ GFile* _tmp7_;
+ gchar* _tmp8_;
+ gchar* _tmp9_;
+ PreferencesDialog* _tmp10_;
+#line 282 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp0_ = preferences_dialog_preferences_dialog;
+#line 282 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (_tmp0_ == NULL) {
+#line 1847 "Preferences.c"
+ PreferencesDialog* _tmp1_;
+#line 283 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp1_ = preferences_dialog_new ();
+#line 283 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_object_ref_sink (_tmp1_);
+#line 283 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (preferences_dialog_preferences_dialog);
+#line 283 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ preferences_dialog_preferences_dialog = _tmp1_;
+#line 1857 "Preferences.c"
+ }
+#line 285 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp2_ = preferences_dialog_preferences_dialog;
+#line 285 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ preferences_dialog_populate_preference_options (_tmp2_);
+#line 286 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp3_ = preferences_dialog_preferences_dialog;
+#line 286 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_widget_show_all (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_widget_get_type (), GtkWidget));
+#line 287 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp4_ = preferences_dialog_preferences_dialog;
+#line 287 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp5_ = _tmp4_->priv->library_dir_button;
+#line 287 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp6_ = app_dirs_get_import_dir ();
+#line 287 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp7_ = _tmp6_;
+#line 287 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp8_ = g_file_get_path (_tmp7_);
+#line 287 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp9_ = _tmp8_;
+#line 287 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_file_chooser_set_current_folder (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, gtk_file_chooser_get_type (), GtkFileChooser), _tmp9_);
+#line 287 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_free0 (_tmp9_);
+#line 287 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (_tmp7_);
+#line 291 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp10_ = preferences_dialog_preferences_dialog;
+#line 291 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_window_present (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, gtk_window_get_type (), GtkWindow));
+#line 1889 "Preferences.c"
+}
+
+
+static void
+preferences_dialog_commit_on_close (PreferencesDialog* self)
+{
+ ConfigFacade* _tmp0_;
+ ConfigFacade* _tmp1_;
+ ConfigFacade* _tmp2_;
+ ConfigFacade* _tmp3_;
+ GtkCheckButton* _tmp4_;
+ gboolean _tmp5_;
+ gboolean _tmp6_;
+ ConfigFacade* _tmp7_;
+ ConfigFacade* _tmp8_;
+ GtkCheckButton* _tmp9_;
+ gboolean _tmp10_;
+ gboolean _tmp11_;
+ const gchar* _tmp12_;
+ PreferencesDialogPathFormat* pf = NULL;
+ GeeArrayList* _tmp14_;
+ GtkComboBoxText* _tmp15_;
+ gpointer _tmp16_;
+ PreferencesDialogPathFormat* _tmp17_;
+ const gchar* _tmp18_;
+#line 296 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_return_if_fail (IS_PREFERENCES_DIALOG (self));
+#line 297 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp0_ = config_facade_get_instance ();
+#line 297 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp1_ = _tmp0_;
+#line 297 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ config_facade_commit_bg_color (_tmp1_);
+#line 297 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (_tmp1_);
+#line 298 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp2_ = config_facade_get_instance ();
+#line 298 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp3_ = _tmp2_;
+#line 298 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp4_ = self->priv->autoimport;
+#line 298 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp5_ = gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_toggle_button_get_type (), GtkToggleButton));
+#line 298 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp6_ = _tmp5_;
+#line 298 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ configuration_facade_set_auto_import_from_library (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), _tmp6_);
+#line 298 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (_tmp3_);
+#line 299 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp7_ = config_facade_get_instance ();
+#line 299 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp8_ = _tmp7_;
+#line 299 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp9_ = self->priv->write_metadata;
+#line 299 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp10_ = gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, gtk_toggle_button_get_type (), GtkToggleButton));
+#line 299 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp11_ = _tmp10_;
+#line 299 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ configuration_facade_set_commit_metadata_to_masters (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), _tmp11_);
+#line 299 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (_tmp8_);
+#line 301 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp12_ = self->priv->lib_dir;
+#line 301 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (_tmp12_ != NULL) {
+#line 1957 "Preferences.c"
+ const gchar* _tmp13_;
+#line 302 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp13_ = self->priv->lib_dir;
+#line 302 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ app_dirs_set_import_dir (_tmp13_);
+#line 1963 "Preferences.c"
+ }
+#line 304 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp14_ = self->priv->path_formats;
+#line 304 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp15_ = self->priv->dir_pattern_combo;
+#line 304 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp16_ = gee_abstract_list_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, GEE_TYPE_ABSTRACT_LIST, GeeAbstractList), gtk_combo_box_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, gtk_combo_box_get_type (), GtkComboBox)));
+#line 304 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ pf = (PreferencesDialogPathFormat*) _tmp16_;
+#line 305 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp17_ = pf;
+#line 305 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp18_ = _tmp17_->pattern;
+#line 305 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (NULL == _tmp18_) {
+#line 1979 "Preferences.c"
+ ConfigFacade* _tmp19_;
+ ConfigFacade* _tmp20_;
+ GtkEntry* _tmp21_;
+ const gchar* _tmp22_;
+ const gchar* _tmp23_;
+ ConfigFacade* _tmp24_;
+ ConfigFacade* _tmp25_;
+#line 306 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp19_ = config_facade_get_instance ();
+#line 306 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp20_ = _tmp19_;
+#line 306 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp21_ = self->priv->dir_pattern_entry;
+#line 306 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp22_ = gtk_entry_get_text (_tmp21_);
+#line 306 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp23_ = _tmp22_;
+#line 306 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ configuration_facade_set_directory_pattern_custom (G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), _tmp23_);
+#line 306 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (_tmp20_);
+#line 307 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp24_ = config_facade_get_instance ();
+#line 307 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp25_ = _tmp24_;
+#line 307 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ configuration_facade_set_directory_pattern (G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), NULL);
+#line 307 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (_tmp25_);
+#line 2009 "Preferences.c"
+ } else {
+ ConfigFacade* _tmp26_;
+ ConfigFacade* _tmp27_;
+ PreferencesDialogPathFormat* _tmp28_;
+ const gchar* _tmp29_;
+#line 309 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp26_ = config_facade_get_instance ();
+#line 309 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp27_ = _tmp26_;
+#line 309 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp28_ = pf;
+#line 309 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp29_ = _tmp28_->pattern;
+#line 309 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ configuration_facade_set_directory_pattern (G_TYPE_CHECK_INSTANCE_CAST (_tmp27_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), _tmp29_);
+#line 309 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (_tmp27_);
+#line 2027 "Preferences.c"
+ }
+#line 296 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _preferences_dialog_path_format_unref0 (pf);
+#line 2031 "Preferences.c"
+}
+
+
+static gboolean
+preferences_dialog_on_delete (PreferencesDialog* self)
+{
+ gboolean result = FALSE;
+#line 313 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_return_val_if_fail (IS_PREFERENCES_DIALOG (self), FALSE);
+#line 314 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (!preferences_dialog_get_allow_closing (self)) {
+#line 315 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ result = TRUE;
+#line 315 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ return result;
+#line 2047 "Preferences.c"
+ }
+#line 317 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ preferences_dialog_commit_on_close (self);
+#line 318 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ result = gtk_widget_hide_on_delete (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
+#line 318 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ return result;
+#line 2055 "Preferences.c"
+}
+
+
+static void
+preferences_dialog_on_close (PreferencesDialog* self)
+{
+#line 321 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_return_if_fail (IS_PREFERENCES_DIALOG (self));
+#line 322 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (!preferences_dialog_get_allow_closing (self)) {
+#line 323 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ return;
+#line 2068 "Preferences.c"
+ }
+#line 325 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_widget_hide (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
+#line 326 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ preferences_dialog_commit_on_close (self);
+#line 2074 "Preferences.c"
+}
+
+
+static void
+preferences_dialog_on_value_changed (PreferencesDialog* self)
+{
+ GtkAdjustment* _tmp0_;
+ GtkAdjustment* _tmp1_;
+#line 329 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_return_if_fail (IS_PREFERENCES_DIALOG (self));
+#line 330 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp0_ = self->priv->bg_color_adjustment;
+#line 330 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp1_ = self->priv->bg_color_adjustment;
+#line 330 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ preferences_dialog_set_background_color (self, ((gdouble) (gtk_adjustment_get_upper (_tmp0_) - gtk_adjustment_get_value (_tmp1_))) / 65535.0);
+#line 2091 "Preferences.c"
+}
+
+
+static gboolean
+preferences_dialog_on_bg_color_reset (PreferencesDialog* self,
+ GdkEventButton* event)
+{
+ gboolean result = FALSE;
+ gboolean _tmp0_ = FALSE;
+ gboolean _tmp1_ = FALSE;
+ guint _tmp2_;
+#line 334 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_return_val_if_fail (IS_PREFERENCES_DIALOG (self), FALSE);
+#line 334 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_return_val_if_fail (event != NULL, FALSE);
+#line 335 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp2_ = event->button;
+#line 335 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (_tmp2_ == ((guint) 1)) {
+#line 2111 "Preferences.c"
+ GdkEventType _tmp3_;
+#line 335 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp3_ = event->type;
+#line 335 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp1_ = _tmp3_ == GDK_BUTTON_PRESS;
+#line 2117 "Preferences.c"
+ } else {
+#line 335 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp1_ = FALSE;
+#line 2121 "Preferences.c"
+ }
+#line 335 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (_tmp1_) {
+#line 2125 "Preferences.c"
+ GdkModifierType _tmp4_;
+#line 336 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp4_ = event->state;
+#line 336 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp0_ = has_only_key_modifier (_tmp4_, GDK_CONTROL_MASK);
+#line 2131 "Preferences.c"
+ } else {
+#line 335 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp0_ = FALSE;
+#line 2135 "Preferences.c"
+ }
+#line 335 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (_tmp0_) {
+#line 2139 "Preferences.c"
+ GtkScale* _tmp5_;
+ GtkAdjustment* _tmp6_;
+ GdkRGBA _tmp7_ = {0};
+ gdouble _tmp8_;
+#line 338 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp5_ = self->priv->bg_color_slider;
+#line 338 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp6_ = self->priv->bg_color_adjustment;
+#line 338 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ parse_color (CONFIG_FACADE_DEFAULT_BG_COLOR, &_tmp7_);
+#line 338 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp8_ = _tmp7_.red;
+#line 338 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_range_set_value (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, gtk_range_get_type (), GtkRange), gtk_adjustment_get_upper (_tmp6_) - (_tmp8_ * 65536.0f));
+#line 340 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ preferences_dialog_on_value_changed (self);
+#line 342 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ result = TRUE;
+#line 342 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ return result;
+#line 2160 "Preferences.c"
+ }
+#line 345 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ result = FALSE;
+#line 345 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ return result;
+#line 2166 "Preferences.c"
+}
+
+
+static void
+preferences_dialog_on_dir_pattern_combo_changed (PreferencesDialog* self)
+{
+ PreferencesDialogPathFormat* pf = NULL;
+ GeeArrayList* _tmp0_;
+ GtkComboBoxText* _tmp1_;
+ gpointer _tmp2_;
+ PreferencesDialogPathFormat* _tmp3_;
+ const gchar* _tmp4_;
+#line 348 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_return_if_fail (IS_PREFERENCES_DIALOG (self));
+#line 349 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp0_ = self->priv->path_formats;
+#line 349 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp1_ = self->priv->dir_pattern_combo;
+#line 349 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp2_ = gee_abstract_list_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_ABSTRACT_LIST, GeeAbstractList), gtk_combo_box_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_combo_box_get_type (), GtkComboBox)));
+#line 349 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ pf = (PreferencesDialogPathFormat*) _tmp2_;
+#line 350 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp3_ = pf;
+#line 350 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp4_ = _tmp3_->pattern;
+#line 350 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (NULL == _tmp4_) {
+#line 2195 "Preferences.c"
+ gchar* dir_pattern = NULL;
+ ConfigFacade* _tmp5_;
+ ConfigFacade* _tmp6_;
+ gchar* _tmp7_;
+ gchar* _tmp8_;
+ const gchar* _tmp9_;
+ GtkEntry* _tmp11_;
+ const gchar* _tmp12_;
+ GtkEntry* _tmp13_;
+ GtkEntry* _tmp14_;
+#line 352 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp5_ = config_facade_get_instance ();
+#line 352 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp6_ = _tmp5_;
+#line 352 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp7_ = configuration_facade_get_directory_pattern_custom (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
+#line 352 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp8_ = _tmp7_;
+#line 352 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (_tmp6_);
+#line 352 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ dir_pattern = _tmp8_;
+#line 353 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp9_ = dir_pattern;
+#line 353 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (is_string_empty (_tmp9_)) {
+#line 2222 "Preferences.c"
+ gchar* _tmp10_;
+#line 354 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp10_ = g_strdup ("");
+#line 354 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_free0 (dir_pattern);
+#line 354 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ dir_pattern = _tmp10_;
+#line 2230 "Preferences.c"
+ }
+#line 355 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp11_ = self->priv->dir_pattern_entry;
+#line 355 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp12_ = dir_pattern;
+#line 355 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_entry_set_text (_tmp11_, _tmp12_);
+#line 356 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp13_ = self->priv->dir_pattern_entry;
+#line 356 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_object_set (_tmp13_, "editable", TRUE, NULL);
+#line 357 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp14_ = self->priv->dir_pattern_entry;
+#line 357 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, gtk_widget_get_type (), GtkWidget), TRUE);
+#line 350 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_free0 (dir_pattern);
+#line 2248 "Preferences.c"
+ } else {
+ GtkEntry* _tmp15_;
+ PreferencesDialogPathFormat* _tmp16_;
+ const gchar* _tmp17_;
+ GtkEntry* _tmp18_;
+ GtkEntry* _tmp19_;
+#line 359 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp15_ = self->priv->dir_pattern_entry;
+#line 359 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp16_ = pf;
+#line 359 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp17_ = _tmp16_->pattern;
+#line 359 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_entry_set_text (_tmp15_, _tmp17_);
+#line 360 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp18_ = self->priv->dir_pattern_entry;
+#line 360 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_object_set (_tmp18_, "editable", FALSE, NULL);
+#line 361 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp19_ = self->priv->dir_pattern_entry;
+#line 361 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, gtk_widget_get_type (), GtkWidget), FALSE);
+#line 2271 "Preferences.c"
+ }
+#line 348 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _preferences_dialog_path_format_unref0 (pf);
+#line 2275 "Preferences.c"
+}
+
+
+static void
+preferences_dialog_on_dir_pattern_entry_changed (PreferencesDialog* self)
+{
+ gchar* example = NULL;
+ GDateTime* _tmp0_;
+ GtkEntry* _tmp1_;
+ const gchar* _tmp2_;
+ const gchar* _tmp3_;
+ gchar* _tmp4_;
+ gboolean _tmp5_ = FALSE;
+ const gchar* _tmp6_;
+#line 365 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_return_if_fail (IS_PREFERENCES_DIALOG (self));
+#line 366 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp0_ = self->priv->example_date;
+#line 366 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp1_ = self->priv->dir_pattern_entry;
+#line 366 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp2_ = gtk_entry_get_text (_tmp1_);
+#line 366 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp3_ = _tmp2_;
+#line 366 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp4_ = g_date_time_format (_tmp0_, _tmp3_);
+#line 366 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ example = _tmp4_;
+#line 367 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp6_ = example;
+#line 367 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (is_string_empty (_tmp6_)) {
+#line 2308 "Preferences.c"
+ GtkEntry* _tmp7_;
+ const gchar* _tmp8_;
+ const gchar* _tmp9_;
+#line 367 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp7_ = self->priv->dir_pattern_entry;
+#line 367 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp8_ = gtk_entry_get_text (_tmp7_);
+#line 367 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp9_ = _tmp8_;
+#line 367 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp5_ = !is_string_empty (_tmp9_);
+#line 2320 "Preferences.c"
+ } else {
+#line 367 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp5_ = FALSE;
+#line 2324 "Preferences.c"
+ }
+#line 367 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (_tmp5_) {
+#line 2328 "Preferences.c"
+ GtkLabel* _tmp10_;
+ GtkEntry* _tmp11_;
+ GtkEntry* _tmp12_;
+#line 369 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp10_ = self->priv->dir_pattern_example;
+#line 369 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_label_set_text (_tmp10_, _ ("Invalid pattern"));
+#line 370 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp11_ = self->priv->dir_pattern_entry;
+#line 370 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_entry_set_icon_from_icon_name (_tmp11_, GTK_ENTRY_ICON_SECONDARY, "dialog-error");
+#line 371 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp12_ = self->priv->dir_pattern_entry;
+#line 371 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_entry_set_icon_activatable (_tmp12_, GTK_ENTRY_ICON_SECONDARY, FALSE);
+#line 372 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ preferences_dialog_set_allow_closing (self, FALSE);
+#line 2346 "Preferences.c"
+ } else {
+ GtkLabel* _tmp13_;
+ const gchar* _tmp14_;
+ GtkEntry* _tmp15_;
+#line 375 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp13_ = self->priv->dir_pattern_example;
+#line 375 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp14_ = example;
+#line 375 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_label_set_text (_tmp13_, _tmp14_);
+#line 376 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp15_ = self->priv->dir_pattern_entry;
+#line 376 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_entry_set_icon_from_icon_name (_tmp15_, GTK_ENTRY_ICON_SECONDARY, NULL);
+#line 377 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ preferences_dialog_set_allow_closing (self, TRUE);
+#line 2363 "Preferences.c"
+ }
+#line 365 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_free0 (example);
+#line 2367 "Preferences.c"
+}
+
+
+static void
+preferences_dialog_set_allow_closing (PreferencesDialog* self,
+ gboolean allow)
+{
+#line 381 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_return_if_fail (IS_PREFERENCES_DIALOG (self));
+#line 382 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_window_set_deletable (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), allow);
+#line 383 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ self->priv->allow_closing = allow;
+#line 2381 "Preferences.c"
+}
+
+
+static gboolean
+preferences_dialog_get_allow_closing (PreferencesDialog* self)
+{
+ gboolean result = FALSE;
+ gboolean _tmp0_;
+#line 386 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_return_val_if_fail (IS_PREFERENCES_DIALOG (self), FALSE);
+#line 387 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp0_ = self->priv->allow_closing;
+#line 387 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ result = _tmp0_;
+#line 387 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ return result;
+#line 2398 "Preferences.c"
+}
+
+
+static void
+preferences_dialog_set_background_color (PreferencesDialog* self,
+ gdouble bg_color_value)
+{
+ ConfigFacade* _tmp0_;
+ ConfigFacade* _tmp1_;
+ GdkRGBA _tmp2_ = {0};
+#line 390 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_return_if_fail (IS_PREFERENCES_DIALOG (self));
+#line 391 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp0_ = config_facade_get_instance ();
+#line 391 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp1_ = _tmp0_;
+#line 391 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ preferences_dialog_to_grayscale (self, bg_color_value, &_tmp2_);
+#line 391 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ config_facade_set_bg_color (_tmp1_, &_tmp2_);
+#line 391 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (_tmp1_);
+#line 2421 "Preferences.c"
+}
+
+
+static void
+preferences_dialog_to_grayscale (PreferencesDialog* self,
+ gdouble color_value,
+ GdkRGBA* result)
+{
+ GdkRGBA color = {0};
+#line 394 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_return_if_fail (IS_PREFERENCES_DIALOG (self));
+#line 395 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ memset (&color, 0, sizeof (GdkRGBA));
+#line 397 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ color.red = color_value;
+#line 398 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ color.green = color_value;
+#line 399 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ color.blue = color_value;
+#line 400 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ color.alpha = 1.0;
+#line 402 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ *result = color;
+#line 402 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ return;
+#line 2447 "Preferences.c"
+}
+
+
+static void
+preferences_dialog_on_photo_editor_changed (PreferencesDialog* self)
+{
+ gint _tmp0_ = 0;
+ GtkComboBox* _tmp1_;
+ SortedList* _tmp2_;
+ gint _tmp3_;
+ gint _tmp4_;
+ gint photo_app_choice_index = 0;
+ GAppInfo* app = NULL;
+ SortedList* _tmp9_;
+ gpointer _tmp10_;
+ ConfigFacade* _tmp11_;
+ ConfigFacade* _tmp12_;
+ gchar* _tmp13_;
+ gchar* _tmp14_;
+ gchar* _tmp15_;
+ gchar* _tmp16_;
+#line 405 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_return_if_fail (IS_PREFERENCES_DIALOG (self));
+#line 406 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp1_ = self->priv->photo_editor_combo;
+#line 406 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp2_ = self->priv->external_photo_apps;
+#line 406 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp3_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GEE_TYPE_COLLECTION, GeeCollection));
+#line 406 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp4_ = _tmp3_;
+#line 406 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (gtk_combo_box_get_active (_tmp1_) < _tmp4_) {
+#line 2481 "Preferences.c"
+ GtkComboBox* _tmp5_;
+#line 407 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp5_ = self->priv->photo_editor_combo;
+#line 407 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp0_ = gtk_combo_box_get_active (_tmp5_);
+#line 2487 "Preferences.c"
+ } else {
+ SortedList* _tmp6_;
+ gint _tmp7_;
+ gint _tmp8_;
+#line 407 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp6_ = self->priv->external_photo_apps;
+#line 407 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp7_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, GEE_TYPE_COLLECTION, GeeCollection));
+#line 407 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp8_ = _tmp7_;
+#line 407 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp0_ = _tmp8_;
+#line 2500 "Preferences.c"
+ }
+#line 406 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ photo_app_choice_index = _tmp0_;
+#line 409 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp9_ = self->priv->external_photo_apps;
+#line 409 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp10_ = sorted_list_get_at (_tmp9_, photo_app_choice_index);
+#line 409 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ app = (GAppInfo*) _tmp10_;
+#line 411 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp11_ = config_facade_get_instance ();
+#line 411 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp12_ = _tmp11_;
+#line 411 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp13_ = desktop_integration_get_app_open_command (app);
+#line 411 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp14_ = _tmp13_;
+#line 411 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ configuration_facade_set_external_photo_app (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), _tmp14_);
+#line 411 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_free0 (_tmp14_);
+#line 411 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (_tmp12_);
+#line 413 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp15_ = desktop_integration_get_app_open_command (app);
+#line 413 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp16_ = _tmp15_;
+#line 413 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_debug ("Preferences.vala:413: setting external photo editor to: %s", _tmp16_);
+#line 413 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_free0 (_tmp16_);
+#line 405 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (app);
+#line 2534 "Preferences.c"
+}
+
+
+static void
+preferences_dialog_on_raw_editor_changed (PreferencesDialog* self)
+{
+ gint _tmp0_ = 0;
+ GtkComboBox* _tmp1_;
+ SortedList* _tmp2_;
+ gint _tmp3_;
+ gint _tmp4_;
+ gint raw_app_choice_index = 0;
+ GAppInfo* app = NULL;
+ SortedList* _tmp9_;
+ gpointer _tmp10_;
+ ConfigFacade* _tmp11_;
+ ConfigFacade* _tmp12_;
+ const gchar* _tmp13_;
+ const gchar* _tmp14_;
+#line 416 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_return_if_fail (IS_PREFERENCES_DIALOG (self));
+#line 417 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp1_ = self->priv->raw_editor_combo;
+#line 417 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp2_ = self->priv->external_raw_apps;
+#line 417 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp3_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GEE_TYPE_COLLECTION, GeeCollection));
+#line 417 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp4_ = _tmp3_;
+#line 417 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (gtk_combo_box_get_active (_tmp1_) < _tmp4_) {
+#line 2566 "Preferences.c"
+ GtkComboBox* _tmp5_;
+#line 418 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp5_ = self->priv->raw_editor_combo;
+#line 418 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp0_ = gtk_combo_box_get_active (_tmp5_);
+#line 2572 "Preferences.c"
+ } else {
+ SortedList* _tmp6_;
+ gint _tmp7_;
+ gint _tmp8_;
+#line 418 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp6_ = self->priv->external_raw_apps;
+#line 418 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp7_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, GEE_TYPE_COLLECTION, GeeCollection));
+#line 418 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp8_ = _tmp7_;
+#line 418 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp0_ = _tmp8_;
+#line 2585 "Preferences.c"
+ }
+#line 417 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ raw_app_choice_index = _tmp0_;
+#line 420 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp9_ = self->priv->external_raw_apps;
+#line 420 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp10_ = sorted_list_get_at (_tmp9_, raw_app_choice_index);
+#line 420 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ app = (GAppInfo*) _tmp10_;
+#line 422 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp11_ = config_facade_get_instance ();
+#line 422 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp12_ = _tmp11_;
+#line 422 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp13_ = g_app_info_get_commandline (app);
+#line 422 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ configuration_facade_set_external_raw_app (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), _tmp13_);
+#line 422 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (_tmp12_);
+#line 424 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp14_ = g_app_info_get_commandline (app);
+#line 424 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_debug ("Preferences.vala:424: setting external raw editor to: %s", _tmp14_);
+#line 416 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (app);
+#line 2611 "Preferences.c"
+}
+
+
+static RawDeveloper
+preferences_dialog_raw_developer_from_combo (PreferencesDialog* self)
+{
+ RawDeveloper result = 0;
+ GtkComboBoxText* _tmp0_;
+#line 427 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_return_val_if_fail (IS_PREFERENCES_DIALOG (self), 0);
+#line 428 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp0_ = self->priv->default_raw_developer_combo;
+#line 428 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (gtk_combo_box_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_combo_box_get_type (), GtkComboBox)) == 0) {
+#line 429 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ result = RAW_DEVELOPER_CAMERA;
+#line 429 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ return result;
+#line 2630 "Preferences.c"
+ }
+#line 430 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ result = RAW_DEVELOPER_SHOTWELL;
+#line 430 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ return result;
+#line 2636 "Preferences.c"
+}
+
+
+static void
+preferences_dialog_set_raw_developer_combo (PreferencesDialog* self,
+ RawDeveloper d)
+{
+#line 433 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_return_if_fail (IS_PREFERENCES_DIALOG (self));
+#line 434 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (d == RAW_DEVELOPER_CAMERA) {
+#line 2648 "Preferences.c"
+ GtkComboBoxText* _tmp0_;
+#line 435 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp0_ = self->priv->default_raw_developer_combo;
+#line 435 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_combo_box_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_combo_box_get_type (), GtkComboBox), 0);
+#line 2654 "Preferences.c"
+ } else {
+ GtkComboBoxText* _tmp1_;
+#line 437 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp1_ = self->priv->default_raw_developer_combo;
+#line 437 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_combo_box_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_combo_box_get_type (), GtkComboBox), 1);
+#line 2661 "Preferences.c"
+ }
+}
+
+
+static void
+preferences_dialog_on_default_raw_developer_changed (PreferencesDialog* self)
+{
+ ConfigFacade* _tmp0_;
+ ConfigFacade* _tmp1_;
+#line 440 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_return_if_fail (IS_PREFERENCES_DIALOG (self));
+#line 441 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp0_ = config_facade_get_instance ();
+#line 441 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp1_ = _tmp0_;
+#line 441 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ configuration_facade_set_default_raw_developer (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), preferences_dialog_raw_developer_from_combo (self));
+#line 441 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (_tmp1_);
+#line 2681 "Preferences.c"
+}
+
+
+static void
+preferences_dialog_on_current_folder_changed (PreferencesDialog* self)
+{
+ GtkFileChooserButton* _tmp0_;
+ gchar* _tmp1_;
+#line 444 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_return_if_fail (IS_PREFERENCES_DIALOG (self));
+#line 445 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp0_ = self->priv->library_dir_button;
+#line 445 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp1_ = gtk_file_chooser_get_filename (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_file_chooser_get_type (), GtkFileChooser));
+#line 445 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_free0 (self->priv->lib_dir);
+#line 445 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ self->priv->lib_dir = _tmp1_;
+#line 2700 "Preferences.c"
+}
+
+
+static void
+_preferences_dialog_on_current_folder_changed_gtk_file_chooser_current_folder_changed (GtkFileChooser* _sender,
+ gpointer self)
+{
+#line 454 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ preferences_dialog_on_current_folder_changed ((PreferencesDialog*) self);
+#line 2710 "Preferences.c"
+}
+
+
+static gboolean
+preferences_dialog_real_map_event (GtkWidget* base,
+ GdkEventAny* event)
+{
+ PreferencesDialog * self;
+ gboolean result = FALSE;
+ gboolean _result_ = FALSE;
+ GtkFileChooserButton* _tmp0_;
+#line 448 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PREFERENCES_DIALOG, PreferencesDialog);
+#line 448 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_return_val_if_fail (event != NULL, FALSE);
+#line 449 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _result_ = GTK_WIDGET_CLASS (preferences_dialog_parent_class)->map_event (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_dialog_get_type (), GtkDialog), gtk_widget_get_type (), GtkWidget), event);
+#line 454 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp0_ = self->priv->library_dir_button;
+#line 454 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_file_chooser_get_type (), GtkFileChooser), "current-folder-changed", (GCallback) _preferences_dialog_on_current_folder_changed_gtk_file_chooser_current_folder_changed, self, 0);
+#line 456 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ result = _result_;
+#line 456 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ return result;
+#line 2736 "Preferences.c"
+}
+
+
+static void
+preferences_dialog_add_to_dir_formats (PreferencesDialog* self,
+ const gchar* name,
+ const gchar* pattern)
+{
+ PreferencesDialogPathFormat* pf = NULL;
+ PreferencesDialogPathFormat* _tmp0_;
+ GeeArrayList* _tmp1_;
+ GtkComboBoxText* _tmp2_;
+#line 459 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_return_if_fail (IS_PREFERENCES_DIALOG (self));
+#line 459 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_return_if_fail (name != NULL);
+#line 460 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp0_ = preferences_dialog_path_format_new (name, pattern);
+#line 460 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ pf = _tmp0_;
+#line 461 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp1_ = self->priv->path_formats;
+#line 461 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), pf);
+#line 462 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp2_ = self->priv->dir_pattern_combo;
+#line 462 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_combo_box_text_append_text (_tmp2_, name);
+#line 459 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _preferences_dialog_path_format_unref0 (pf);
+#line 2767 "Preferences.c"
+}
+
+
+static void
+preferences_dialog_on_lowercase_toggled (PreferencesDialog* self)
+{
+ ConfigFacade* _tmp0_;
+ ConfigFacade* _tmp1_;
+ GtkCheckButton* _tmp2_;
+#line 465 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_return_if_fail (IS_PREFERENCES_DIALOG (self));
+#line 466 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp0_ = config_facade_get_instance ();
+#line 466 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp1_ = _tmp0_;
+#line 466 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp2_ = self->priv->lowercase;
+#line 466 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ configuration_facade_set_use_lowercase_filenames (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_toggle_button_get_type (), GtkToggleButton)));
+#line 466 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (_tmp1_);
+#line 2789 "Preferences.c"
+}
+
+
+static PreferencesDialogPathFormat*
+preferences_dialog_path_format_construct (GType object_type,
+ const gchar* name,
+ const gchar* pattern)
+{
+ PreferencesDialogPathFormat* self = NULL;
+ gchar* _tmp0_;
+ gchar* _tmp1_;
+#line 11 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_return_val_if_fail (name != NULL, NULL);
+#line 11 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ self = (PreferencesDialogPathFormat*) g_type_create_instance (object_type);
+#line 12 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp0_ = g_strdup (name);
+#line 12 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_free0 (self->name);
+#line 12 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ self->name = _tmp0_;
+#line 13 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp1_ = g_strdup (pattern);
+#line 13 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_free0 (self->pattern);
+#line 13 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ self->pattern = _tmp1_;
+#line 11 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ return self;
+#line 2819 "Preferences.c"
+}
+
+
+static PreferencesDialogPathFormat*
+preferences_dialog_path_format_new (const gchar* name,
+ const gchar* pattern)
+{
+#line 11 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ return preferences_dialog_path_format_construct (PREFERENCES_DIALOG_TYPE_PATH_FORMAT, name, pattern);
+#line 2829 "Preferences.c"
+}
+
+
+static void
+preferences_dialog_value_path_format_init (GValue* value)
+{
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ value->data[0].v_pointer = NULL;
+#line 2838 "Preferences.c"
+}
+
+
+static void
+preferences_dialog_value_path_format_free_value (GValue* value)
+{
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (value->data[0].v_pointer) {
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ preferences_dialog_path_format_unref (value->data[0].v_pointer);
+#line 2849 "Preferences.c"
+ }
+}
+
+
+static void
+preferences_dialog_value_path_format_copy_value (const GValue* src_value,
+ GValue* dest_value)
+{
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (src_value->data[0].v_pointer) {
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ dest_value->data[0].v_pointer = preferences_dialog_path_format_ref (src_value->data[0].v_pointer);
+#line 2862 "Preferences.c"
+ } else {
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ dest_value->data[0].v_pointer = NULL;
+#line 2866 "Preferences.c"
+ }
+}
+
+
+static gpointer
+preferences_dialog_value_path_format_peek_pointer (const GValue* value)
+{
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ return value->data[0].v_pointer;
+#line 2876 "Preferences.c"
+}
+
+
+static gchar*
+preferences_dialog_value_path_format_collect_value (GValue* value,
+ guint n_collect_values,
+ GTypeCValue* collect_values,
+ guint collect_flags)
+{
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (collect_values[0].v_pointer) {
+#line 2888 "Preferences.c"
+ PreferencesDialogPathFormat * object;
+ object = collect_values[0].v_pointer;
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (object->parent_instance.g_class == NULL) {
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
+#line 2895 "Preferences.c"
+ } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
+#line 2899 "Preferences.c"
+ }
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ value->data[0].v_pointer = preferences_dialog_path_format_ref (object);
+#line 2903 "Preferences.c"
+ } else {
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ value->data[0].v_pointer = NULL;
+#line 2907 "Preferences.c"
+ }
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ return NULL;
+#line 2911 "Preferences.c"
+}
+
+
+static gchar*
+preferences_dialog_value_path_format_lcopy_value (const GValue* value,
+ guint n_collect_values,
+ GTypeCValue* collect_values,
+ guint collect_flags)
+{
+ PreferencesDialogPathFormat ** object_p;
+ object_p = collect_values[0].v_pointer;
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (!object_p) {
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
+#line 2927 "Preferences.c"
+ }
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (!value->data[0].v_pointer) {
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ *object_p = NULL;
+#line 2933 "Preferences.c"
+ } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ *object_p = value->data[0].v_pointer;
+#line 2937 "Preferences.c"
+ } else {
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ *object_p = preferences_dialog_path_format_ref (value->data[0].v_pointer);
+#line 2941 "Preferences.c"
+ }
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ return NULL;
+#line 2945 "Preferences.c"
+}
+
+
+static GParamSpec*
+preferences_dialog_param_spec_path_format (const gchar* name,
+ const gchar* nick,
+ const gchar* blurb,
+ GType object_type,
+ GParamFlags flags)
+{
+ PreferencesDialogParamSpecPathFormat* spec;
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_return_val_if_fail (g_type_is_a (object_type, PREFERENCES_DIALOG_TYPE_PATH_FORMAT), NULL);
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ G_PARAM_SPEC (spec)->value_type = object_type;
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ return G_PARAM_SPEC (spec);
+#line 2965 "Preferences.c"
+}
+
+
+static gpointer
+preferences_dialog_value_get_path_format (const GValue* value)
+{
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PREFERENCES_DIALOG_TYPE_PATH_FORMAT), NULL);
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ return value->data[0].v_pointer;
+#line 2976 "Preferences.c"
+}
+
+
+static void
+preferences_dialog_value_set_path_format (GValue* value,
+ gpointer v_object)
+{
+ PreferencesDialogPathFormat * old;
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PREFERENCES_DIALOG_TYPE_PATH_FORMAT));
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ old = value->data[0].v_pointer;
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (v_object) {
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PREFERENCES_DIALOG_TYPE_PATH_FORMAT));
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ value->data[0].v_pointer = v_object;
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ preferences_dialog_path_format_ref (value->data[0].v_pointer);
+#line 2999 "Preferences.c"
+ } else {
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ value->data[0].v_pointer = NULL;
+#line 3003 "Preferences.c"
+ }
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (old) {
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ preferences_dialog_path_format_unref (old);
+#line 3009 "Preferences.c"
+ }
+}
+
+
+static void
+preferences_dialog_value_take_path_format (GValue* value,
+ gpointer v_object)
+{
+ PreferencesDialogPathFormat * old;
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PREFERENCES_DIALOG_TYPE_PATH_FORMAT));
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ old = value->data[0].v_pointer;
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (v_object) {
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PREFERENCES_DIALOG_TYPE_PATH_FORMAT));
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ value->data[0].v_pointer = v_object;
+#line 3031 "Preferences.c"
+ } else {
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ value->data[0].v_pointer = NULL;
+#line 3035 "Preferences.c"
+ }
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (old) {
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ preferences_dialog_path_format_unref (old);
+#line 3041 "Preferences.c"
+ }
+}
+
+
+static void
+preferences_dialog_path_format_class_init (PreferencesDialogPathFormatClass * klass)
+{
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ preferences_dialog_path_format_parent_class = g_type_class_peek_parent (klass);
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ ((PreferencesDialogPathFormatClass *) klass)->finalize = preferences_dialog_path_format_finalize;
+#line 3053 "Preferences.c"
+}
+
+
+static void
+preferences_dialog_path_format_instance_init (PreferencesDialogPathFormat * self)
+{
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ self->ref_count = 1;
+#line 3062 "Preferences.c"
+}
+
+
+static void
+preferences_dialog_path_format_finalize (PreferencesDialogPathFormat * obj)
+{
+ PreferencesDialogPathFormat * self;
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, PREFERENCES_DIALOG_TYPE_PATH_FORMAT, PreferencesDialogPathFormat);
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_signal_handlers_destroy (self);
+#line 15 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_free0 (self->name);
+#line 16 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_free0 (self->pattern);
+#line 3078 "Preferences.c"
+}
+
+
+static GType
+preferences_dialog_path_format_get_type (void)
+{
+ static volatile gsize preferences_dialog_path_format_type_id__volatile = 0;
+ if (g_once_init_enter (&preferences_dialog_path_format_type_id__volatile)) {
+ static const GTypeValueTable g_define_type_value_table = { preferences_dialog_value_path_format_init, preferences_dialog_value_path_format_free_value, preferences_dialog_value_path_format_copy_value, preferences_dialog_value_path_format_peek_pointer, "p", preferences_dialog_value_path_format_collect_value, "p", preferences_dialog_value_path_format_lcopy_value };
+ static const GTypeInfo g_define_type_info = { sizeof (PreferencesDialogPathFormatClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) preferences_dialog_path_format_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PreferencesDialogPathFormat), 0, (GInstanceInitFunc) preferences_dialog_path_format_instance_init, &g_define_type_value_table };
+ static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
+ GType preferences_dialog_path_format_type_id;
+ preferences_dialog_path_format_type_id = g_type_register_fundamental (g_type_fundamental_next (), "PreferencesDialogPathFormat", &g_define_type_info, &g_define_type_fundamental_info, 0);
+ g_once_init_leave (&preferences_dialog_path_format_type_id__volatile, preferences_dialog_path_format_type_id);
+ }
+ return preferences_dialog_path_format_type_id__volatile;
+}
+
+
+static gpointer
+preferences_dialog_path_format_ref (gpointer instance)
+{
+ PreferencesDialogPathFormat * self;
+ self = instance;
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_atomic_int_inc (&self->ref_count);
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ return instance;
+#line 3107 "Preferences.c"
+}
+
+
+static void
+preferences_dialog_path_format_unref (gpointer instance)
+{
+ PreferencesDialogPathFormat * self;
+ self = instance;
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ if (g_atomic_int_dec_and_test (&self->ref_count)) {
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ PREFERENCES_DIALOG_PATH_FORMAT_GET_CLASS (self)->finalize (self);
+#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_type_free_instance ((GTypeInstance *) self);
+#line 3122 "Preferences.c"
+ }
+}
+
+
+static void
+preferences_dialog_class_init (PreferencesDialogClass * klass)
+{
+ gint PreferencesDialog_private_offset;
+#line 9 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ preferences_dialog_parent_class = g_type_class_peek_parent (klass);
+#line 9 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_type_class_add_private (klass, sizeof (PreferencesDialogPrivate));
+#line 9 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ ((GtkWidgetClass *) klass)->map_event = (gboolean (*) (GtkWidget *, GdkEventAny*)) preferences_dialog_real_map_event;
+#line 9 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ G_OBJECT_CLASS (klass)->finalize = preferences_dialog_finalize;
+#line 9 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ PreferencesDialog_private_offset = g_type_class_get_instance_private_offset (klass);
+#line 9 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/Shotwell/ui/preferences_dialog.ui");
+#line 9 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "bg_color_adjustment", FALSE, PreferencesDialog_private_offset + G_STRUCT_OFFSET (PreferencesDialogPrivate, bg_color_adjustment));
+#line 9 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "bg_color_slider", FALSE, PreferencesDialog_private_offset + G_STRUCT_OFFSET (PreferencesDialogPrivate, bg_color_slider));
+#line 9 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "photo_editor_combo", FALSE, PreferencesDialog_private_offset + G_STRUCT_OFFSET (PreferencesDialogPrivate, photo_editor_combo));
+#line 9 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "raw_editor_combo", FALSE, PreferencesDialog_private_offset + G_STRUCT_OFFSET (PreferencesDialogPrivate, raw_editor_combo));
+#line 9 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "library_dir_button", FALSE, PreferencesDialog_private_offset + G_STRUCT_OFFSET (PreferencesDialogPrivate, library_dir_button));
+#line 9 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "dir_pattern_combo", FALSE, PreferencesDialog_private_offset + G_STRUCT_OFFSET (PreferencesDialogPrivate, dir_pattern_combo));
+#line 9 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "dir_pattern_entry", FALSE, PreferencesDialog_private_offset + G_STRUCT_OFFSET (PreferencesDialogPrivate, dir_pattern_entry));
+#line 9 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "dir_pattern_example", FALSE, PreferencesDialog_private_offset + G_STRUCT_OFFSET (PreferencesDialogPrivate, dir_pattern_example));
+#line 9 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "lowercase", FALSE, PreferencesDialog_private_offset + G_STRUCT_OFFSET (PreferencesDialogPrivate, lowercase));
+#line 9 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "default_raw_developer_combo", FALSE, PreferencesDialog_private_offset + G_STRUCT_OFFSET (PreferencesDialogPrivate, default_raw_developer_combo));
+#line 9 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "autoimport", FALSE, PreferencesDialog_private_offset + G_STRUCT_OFFSET (PreferencesDialogPrivate, autoimport));
+#line 9 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "write_metadata", FALSE, PreferencesDialog_private_offset + G_STRUCT_OFFSET (PreferencesDialogPrivate, write_metadata));
+#line 9 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "pattern_help", FALSE, PreferencesDialog_private_offset + G_STRUCT_OFFSET (PreferencesDialogPrivate, pattern_help));
+#line 9 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "preferences_notebook", FALSE, PreferencesDialog_private_offset + G_STRUCT_OFFSET (PreferencesDialogPrivate, preferences_notebook));
+#line 9 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "transparent_checker_radio", FALSE, PreferencesDialog_private_offset + G_STRUCT_OFFSET (PreferencesDialogPrivate, transparent_checker_radio));
+#line 9 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "transparent_solid_radio", FALSE, PreferencesDialog_private_offset + G_STRUCT_OFFSET (PreferencesDialogPrivate, transparent_solid_radio));
+#line 9 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "transparent_solid_color", FALSE, PreferencesDialog_private_offset + G_STRUCT_OFFSET (PreferencesDialogPrivate, transparent_solid_color));
+#line 9 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "transparent_none_radio", FALSE, PreferencesDialog_private_offset + G_STRUCT_OFFSET (PreferencesDialogPrivate, transparent_none_radio));
+#line 3179 "Preferences.c"
+}
+
+
+static void
+preferences_dialog_instance_init (PreferencesDialog * self)
+{
+ GeeArrayList* _tmp0_;
+ GDateTime* _tmp1_;
+ PluginsManifestWidgetMediator* _tmp2_;
+#line 9 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ self->priv = PREFERENCES_DIALOG_GET_PRIVATE (self);
+#line 39 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ self->priv->allow_closing = FALSE;
+#line 40 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ self->priv->lib_dir = NULL;
+#line 41 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp0_ = gee_array_list_new (PREFERENCES_DIALOG_TYPE_PATH_FORMAT, (GBoxedCopyFunc) preferences_dialog_path_format_ref, (GDestroyNotify) preferences_dialog_path_format_unref, NULL, NULL, NULL);
+#line 41 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ self->priv->path_formats = _tmp0_;
+#line 42 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp1_ = g_date_time_new_local (2009, 3, 10, 18, 16, (gdouble) 11);
+#line 42 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ self->priv->example_date = _tmp1_;
+#line 45 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _tmp2_ = plugins_manifest_widget_mediator_new ();
+#line 45 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ g_object_ref_sink (_tmp2_);
+#line 45 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ self->priv->plugins_mediator = _tmp2_;
+#line 9 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ gtk_widget_init_template (GTK_WIDGET (self));
+#line 3211 "Preferences.c"
+}
+
+
+static void
+preferences_dialog_finalize (GObject * obj)
+{
+ PreferencesDialog * self;
+#line 9 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_PREFERENCES_DIALOG, PreferencesDialog);
+#line 22 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (self->priv->bg_color_adjustment);
+#line 24 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (self->priv->bg_color_slider);
+#line 26 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (self->priv->photo_editor_combo);
+#line 28 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (self->priv->raw_editor_combo);
+#line 29 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (self->priv->external_raw_apps);
+#line 30 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (self->priv->external_photo_apps);
+#line 32 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (self->priv->library_dir_button);
+#line 34 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (self->priv->dir_pattern_combo);
+#line 36 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (self->priv->dir_pattern_entry);
+#line 38 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (self->priv->dir_pattern_example);
+#line 40 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_free0 (self->priv->lib_dir);
+#line 41 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (self->priv->path_formats);
+#line 42 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_date_time_unref0 (self->priv->example_date);
+#line 44 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (self->priv->lowercase);
+#line 45 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (self->priv->plugins_mediator);
+#line 47 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (self->priv->default_raw_developer_combo);
+#line 50 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (self->priv->autoimport);
+#line 52 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (self->priv->write_metadata);
+#line 54 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (self->priv->pattern_help);
+#line 56 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (self->priv->preferences_notebook);
+#line 59 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (self->priv->transparent_checker_radio);
+#line 61 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (self->priv->transparent_solid_radio);
+#line 63 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (self->priv->transparent_solid_color);
+#line 65 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ _g_object_unref0 (self->priv->transparent_none_radio);
+#line 9 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala"
+ G_OBJECT_CLASS (preferences_dialog_parent_class)->finalize (obj);
+#line 3271 "Preferences.c"
+}
+
+
+GType
+preferences_dialog_get_type (void)
+{
+ static volatile gsize preferences_dialog_type_id__volatile = 0;
+ if (g_once_init_enter (&preferences_dialog_type_id__volatile)) {
+ static const GTypeInfo g_define_type_info = { sizeof (PreferencesDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) preferences_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PreferencesDialog), 0, (GInstanceInitFunc) preferences_dialog_instance_init, NULL };
+ GType preferences_dialog_type_id;
+ preferences_dialog_type_id = g_type_register_static (gtk_dialog_get_type (), "PreferencesDialog", &g_define_type_info, 0);
+ g_once_init_leave (&preferences_dialog_type_id__volatile, preferences_dialog_type_id);
+ }
+ return preferences_dialog_type_id__volatile;
+}
+
+
+static void
+_vala_array_destroy (gpointer array,
+ gint array_length,
+ GDestroyNotify destroy_func)
+{
+ if ((array != NULL) && (destroy_func != NULL)) {
+ int i;
+ for (i = 0; i < array_length; i = i + 1) {
+ if (((gpointer*) array)[i] != NULL) {
+ destroy_func (((gpointer*) array)[i]);
+ }
+ }
+ }
+}
+
+
+static void
+_vala_array_free (gpointer array,
+ gint array_length,
+ GDestroyNotify destroy_func)
+{
+ _vala_array_destroy (array, array_length, destroy_func);
+ g_free (array);
+}
+
+
+static gint
+_vala_array_length (gpointer array)
+{
+ int length;
+ length = 0;
+ if (array) {
+ while (((gpointer*) array)[length]) {
+ length++;
+ }
+ }
+ return length;
+}
+
+
+
diff --git a/src/dialogs/Preferences.vala b/src/dialogs/Preferences.vala
new file mode 100644
index 0000000..0a18547
--- /dev/null
+++ b/src/dialogs/Preferences.vala
@@ -0,0 +1,468 @@
+/* Copyright 2016 Software Freedom Conservancy Inc.
+ * Copyright 2017 Jens Georg <mail@jensge.org>
+ *
+ * This software is licensed under the GNU LGPL (version 2.1 or later).
+ * See the COPYING file in this distribution.
+ */
+
+[GtkTemplate (ui = "/org/gnome/Shotwell/ui/preferences_dialog.ui")]
+public class PreferencesDialog : Gtk.Dialog {
+ private class PathFormat {
+ public PathFormat(string name, string? pattern) {
+ this.name = name;
+ this.pattern = pattern;
+ }
+ public string name;
+ public string? pattern;
+ }
+
+ private static PreferencesDialog preferences_dialog;
+
+ [GtkChild]
+ private Gtk.Adjustment bg_color_adjustment;
+ [GtkChild]
+ private Gtk.Scale bg_color_slider;
+ [GtkChild]
+ private Gtk.ComboBox photo_editor_combo;
+ [GtkChild]
+ private Gtk.ComboBox raw_editor_combo;
+ private SortedList<AppInfo> external_raw_apps;
+ private SortedList<AppInfo> external_photo_apps;
+ [GtkChild]
+ private Gtk.FileChooserButton library_dir_button;
+ [GtkChild]
+ private Gtk.ComboBoxText dir_pattern_combo;
+ [GtkChild]
+ private Gtk.Entry dir_pattern_entry;
+ [GtkChild]
+ private Gtk.Label dir_pattern_example;
+ private bool allow_closing = false;
+ private string? lib_dir = null;
+ private Gee.ArrayList<PathFormat> path_formats = new Gee.ArrayList<PathFormat>();
+ private GLib.DateTime example_date = new GLib.DateTime.local(2009, 3, 10, 18, 16, 11);
+ [GtkChild]
+ private Gtk.CheckButton lowercase;
+ private Plugins.ManifestWidgetMediator plugins_mediator = new Plugins.ManifestWidgetMediator();
+ [GtkChild]
+ private Gtk.ComboBoxText default_raw_developer_combo;
+
+ [GtkChild]
+ private Gtk.CheckButton autoimport;
+ [GtkChild]
+ private Gtk.CheckButton write_metadata;
+ [GtkChild]
+ private Gtk.Label pattern_help;
+ [GtkChild]
+ private Gtk.Notebook preferences_notebook;
+
+ [GtkChild]
+ private Gtk.RadioButton transparent_checker_radio;
+ [GtkChild]
+ private Gtk.RadioButton transparent_solid_radio;
+ [GtkChild]
+ private Gtk.ColorButton transparent_solid_color;
+ [GtkChild]
+ private Gtk.RadioButton transparent_none_radio;
+
+ private PreferencesDialog() {
+ Object (use_header_bar: Resources.use_header_bar());
+
+ set_parent_window(AppWindow.get_instance().get_parent_window());
+ set_transient_for(AppWindow.get_instance());
+ delete_event.connect(on_delete);
+ response.connect(on_close);
+
+ bg_color_adjustment.set_value(bg_color_adjustment.get_upper() -
+ (Config.Facade.get_instance().get_bg_color().red * 65535.0));
+ bg_color_adjustment.value_changed.connect(on_value_changed);
+
+ bg_color_slider.button_press_event.connect(on_bg_color_reset);
+
+ transparent_checker_radio.toggled.connect(on_radio_changed);
+ transparent_solid_radio.toggled.connect(on_radio_changed);
+ transparent_none_radio.toggled.connect(on_radio_changed);
+
+ transparent_solid_radio.bind_property("active",
+ transparent_solid_color,
+ "sensitive");
+
+ Gdk.RGBA color = Gdk.RGBA();
+ color.parse(Config.Facade.get_instance().get_transparent_background_color());
+ (transparent_solid_color as Gtk.ColorChooser).rgba = color;
+ transparent_solid_color.color_set.connect(on_color_changed);
+
+ switch (Config.Facade.get_instance().get_transparent_background_type()) {
+ case "checkered":
+ transparent_checker_radio.active = true;
+ break;
+ case "solid":
+ transparent_solid_radio.active = true;
+ break;
+ default:
+ transparent_none_radio.active = true;
+ break;
+ }
+
+ // Ticket #3162 - Move dir pattern blurb into Gnome help.
+ // Because specifying a particular snippet of the help requires
+ // us to know where its located, we can't hardcode a URL anymore;
+ // instead, we ask for the help path, and if we find it, we tell
+ // yelp to read from there, otherwise, we read from system-wide.
+ string help_path = Resources.get_help_path();
+
+ if (help_path == null) {
+ // We're installed system-wide, so use the system help.
+ pattern_help.set_markup("<a href=\"" + Resources.DIR_PATTERN_URI_SYSWIDE + "\">" + _("(Help)") + "</a>");
+ } else {
+ // We're being run from the build directory; we'll have to handle clicks to this
+ // link manually ourselves, due to a limitation of help: URIs.
+ pattern_help.set_markup("<a href=\"dummy:\">" + _("(Help)") + "</a>");
+ pattern_help.activate_link.connect(on_local_pattern_help);
+ }
+
+ add_to_dir_formats(_("Year%sMonth%sDay").printf(Path.DIR_SEPARATOR_S, Path.DIR_SEPARATOR_S),
+ "%Y" + Path.DIR_SEPARATOR_S + "%m" + Path.DIR_SEPARATOR_S + "%d");
+ add_to_dir_formats(_("Year%sMonth").printf(Path.DIR_SEPARATOR_S), "%Y" +
+ Path.DIR_SEPARATOR_S + "%m");
+ add_to_dir_formats(_("Year%sMonth-Day").printf(Path.DIR_SEPARATOR_S),
+ "%Y" + Path.DIR_SEPARATOR_S + "%m-%d");
+ add_to_dir_formats(_("Year-Month-Day"), "%Y-%m-%d");
+ add_to_dir_formats(_("Custom"), null); // Custom must always be last.
+ dir_pattern_combo.changed.connect(on_dir_pattern_combo_changed);
+ dir_pattern_entry.changed.connect(on_dir_pattern_entry_changed);
+
+ lowercase.toggled.connect(on_lowercase_toggled);
+
+ (preferences_notebook.get_nth_page (2) as Gtk.Container).add (plugins_mediator);
+
+ populate_preference_options();
+
+ photo_editor_combo.changed.connect(on_photo_editor_changed);
+ raw_editor_combo.changed.connect(on_raw_editor_changed);
+
+ autoimport.set_active(Config.Facade.get_instance().get_auto_import_from_library());
+
+ write_metadata.set_active(Config.Facade.get_instance().get_commit_metadata_to_masters());
+
+ default_raw_developer_combo.append_text(RawDeveloper.CAMERA.get_label());
+ default_raw_developer_combo.append_text(RawDeveloper.SHOTWELL.get_label());
+ set_raw_developer_combo(Config.Facade.get_instance().get_default_raw_developer());
+ default_raw_developer_combo.changed.connect(on_default_raw_developer_changed);
+ }
+
+ public void populate_preference_options() {
+ populate_app_combo_box(photo_editor_combo, PhotoFileFormat.get_editable_mime_types(),
+ Config.Facade.get_instance().get_external_photo_app(), out external_photo_apps);
+
+ populate_app_combo_box(raw_editor_combo, PhotoFileFormat.RAW.get_mime_types(),
+ Config.Facade.get_instance().get_external_raw_app(), out external_raw_apps);
+
+ setup_dir_pattern(dir_pattern_combo, dir_pattern_entry);
+
+ lowercase.set_active(Config.Facade.get_instance().get_use_lowercase_filenames());
+ }
+
+ private void on_radio_changed() {
+ var config = Config.Facade.get_instance();
+
+ if (transparent_checker_radio.active) {
+ config.set_transparent_background_type("checkered");
+ } else if (transparent_solid_radio.active) {
+ config.set_transparent_background_type("solid");
+ } else {
+ config.set_transparent_background_type("none");
+ }
+ }
+
+ private void on_color_changed() {
+ var color = (transparent_solid_color as Gtk.ColorChooser).rgba.to_string();
+ Config.Facade.get_instance().set_transparent_background_color(color);
+ }
+
+ // Ticket #3162, part II - if we're not yet installed, then we have to manually launch
+ // the help viewer and specify the full path to the subsection we want...
+ private bool on_local_pattern_help(string ignore) {
+ try {
+ Resources.launch_help(AppWindow.get_instance().get_screen(), "other-files.page");
+ } catch (Error e) {
+ message("Unable to launch help: %s", e.message);
+ }
+ return true;
+ }
+
+ private void populate_app_combo_box(Gtk.ComboBox combo_box, string[] mime_types,
+ string current_app_executable, out SortedList<AppInfo> external_apps) {
+ // get list of all applications for the given mime types
+ assert(mime_types.length != 0);
+ external_apps = DesktopIntegration.get_apps_for_mime_types(mime_types);
+
+ if (external_apps.size == 0)
+ return;
+
+ // populate application ComboBox with app names and icons
+ Gtk.CellRendererPixbuf pixbuf_renderer = new Gtk.CellRendererPixbuf();
+ Gtk.CellRendererText text_renderer = new Gtk.CellRendererText();
+ combo_box.clear();
+ combo_box.pack_start(pixbuf_renderer, false);
+ combo_box.pack_start(text_renderer, false);
+ combo_box.add_attribute(pixbuf_renderer, "pixbuf", 0);
+ combo_box.add_attribute(text_renderer, "text", 1);
+
+ // TODO: need more space between icons and text
+ Gtk.ListStore combo_store = new Gtk.ListStore(2, typeof(Gdk.Pixbuf), typeof(string));
+ Gtk.TreeIter iter;
+
+ int current_app = -1;
+
+ foreach (AppInfo app in external_apps) {
+ combo_store.append(out iter);
+
+ Icon app_icon = app.get_icon();
+ try {
+ if (app_icon is FileIcon) {
+ combo_store.set_value(iter, 0, scale_pixbuf(new Gdk.Pixbuf.from_file(
+ ((FileIcon) app_icon).get_file().get_path()), Resources.DEFAULT_ICON_SCALE,
+ Gdk.InterpType.BILINEAR, false));
+ } else if (app_icon is ThemedIcon) {
+ Gdk.Pixbuf icon_pixbuf =
+ Gtk.IconTheme.get_default().load_icon(((ThemedIcon) app_icon).get_names()[0],
+ Resources.DEFAULT_ICON_SCALE, Gtk.IconLookupFlags.FORCE_SIZE);
+
+ combo_store.set_value(iter, 0, icon_pixbuf);
+ }
+ } catch (GLib.Error error) {
+ warning("Error loading icon pixbuf: " + error.message);
+ }
+
+ combo_store.set_value(iter, 1, app.get_name());
+
+ if (app.get_commandline() == current_app_executable)
+ current_app = external_apps.index_of(app);
+ }
+
+ // TODO: allow users to choose unlisted applications like Nautilus's "Open with -> Other Application..."
+
+ combo_box.set_model(combo_store);
+
+ if (current_app != -1)
+ combo_box.set_active(current_app);
+ }
+
+ private void setup_dir_pattern(Gtk.ComboBox combo_box, Gtk.Entry entry) {
+ string? pattern = Config.Facade.get_instance().get_directory_pattern();
+ bool found = false;
+ if (null != pattern) {
+ // Locate pre-built text.
+ int i = 0;
+ foreach (PathFormat pf in path_formats) {
+ if (pf.pattern == pattern) {
+ combo_box.set_active(i);
+ found = true;
+ break;
+ }
+ i++;
+ }
+ } else {
+ // Custom path.
+ string? s = Config.Facade.get_instance().get_directory_pattern_custom();
+ if (!is_string_empty(s)) {
+ combo_box.set_active(path_formats.size - 1); // Assume "custom" is last.
+ found = true;
+ }
+ }
+
+ if (!found) {
+ combo_box.set_active(0);
+ }
+
+ on_dir_pattern_combo_changed();
+ }
+
+ public static void show_preferences() {
+ if (preferences_dialog == null)
+ preferences_dialog = new PreferencesDialog();
+
+ preferences_dialog.populate_preference_options();
+ preferences_dialog.show_all();
+ preferences_dialog.library_dir_button.set_current_folder(AppDirs.get_import_dir().get_path());
+
+ // Ticket #3001: Cause the dialog to become active if the user chooses 'Preferences'
+ // from the menus a second time.
+ preferences_dialog.present();
+ }
+
+ // For items that should only be committed when the dialog is closed, not as soon as the change
+ // is made.
+ private void commit_on_close() {
+ Config.Facade.get_instance().commit_bg_color();
+ Config.Facade.get_instance().set_auto_import_from_library(autoimport.active);
+ Config.Facade.get_instance().set_commit_metadata_to_masters(write_metadata.active);
+
+ if (lib_dir != null)
+ AppDirs.set_import_dir(lib_dir);
+
+ PathFormat pf = path_formats.get(dir_pattern_combo.get_active());
+ if (null == pf.pattern) {
+ Config.Facade.get_instance().set_directory_pattern_custom(dir_pattern_entry.text);
+ Config.Facade.get_instance().set_directory_pattern(null);
+ } else {
+ Config.Facade.get_instance().set_directory_pattern(pf.pattern);
+ }
+ }
+
+ private bool on_delete() {
+ if (!get_allow_closing())
+ return true;
+
+ commit_on_close();
+ return hide_on_delete(); //prevent widgets from getting destroyed
+ }
+
+ private void on_close() {
+ if (!get_allow_closing())
+ return;
+
+ hide();
+ commit_on_close();
+ }
+
+ private void on_value_changed() {
+ set_background_color((double)(bg_color_adjustment.get_upper() -
+ bg_color_adjustment.get_value()) / 65535.0);
+ }
+
+ private bool on_bg_color_reset(Gdk.EventButton event) {
+ if (event.button == 1 && event.type == Gdk.EventType.BUTTON_PRESS
+ && has_only_key_modifier(event.state, Gdk.ModifierType.CONTROL_MASK)) {
+ // Left Mouse Button and CTRL pressed
+ bg_color_slider.set_value(bg_color_adjustment.get_upper() -
+ (parse_color(Config.Facade.DEFAULT_BG_COLOR).red * 65536.0f));
+ on_value_changed();
+
+ return true;
+ }
+
+ return false;
+ }
+
+ private void on_dir_pattern_combo_changed() {
+ PathFormat pf = path_formats.get(dir_pattern_combo.get_active());
+ if (null == pf.pattern) {
+ // Custom format.
+ string? dir_pattern = Config.Facade.get_instance().get_directory_pattern_custom();
+ if (is_string_empty(dir_pattern))
+ dir_pattern = "";
+ dir_pattern_entry.set_text(dir_pattern);
+ dir_pattern_entry.editable = true;
+ dir_pattern_entry.sensitive = true;
+ } else {
+ dir_pattern_entry.set_text(pf.pattern);
+ dir_pattern_entry.editable = false;
+ dir_pattern_entry.sensitive = false;
+ }
+ }
+
+ private void on_dir_pattern_entry_changed() {
+ string example = example_date.format(dir_pattern_entry.text);
+ if (is_string_empty(example) && !is_string_empty(dir_pattern_entry.text)) {
+ // Invalid pattern.
+ dir_pattern_example.set_text(_("Invalid pattern"));
+ dir_pattern_entry.set_icon_from_icon_name(Gtk.EntryIconPosition.SECONDARY, "dialog-error");
+ dir_pattern_entry.set_icon_activatable(Gtk.EntryIconPosition.SECONDARY, false);
+ set_allow_closing(false);
+ } else {
+ // Valid pattern.
+ dir_pattern_example.set_text(example);
+ dir_pattern_entry.set_icon_from_icon_name(Gtk.EntryIconPosition.SECONDARY, null);
+ set_allow_closing(true);
+ }
+ }
+
+ private void set_allow_closing(bool allow) {
+ set_deletable(allow);
+ allow_closing = allow;
+ }
+
+ private bool get_allow_closing() {
+ return allow_closing;
+ }
+
+ private void set_background_color(double bg_color_value) {
+ Config.Facade.get_instance().set_bg_color(to_grayscale(bg_color_value));
+ }
+
+ private Gdk.RGBA to_grayscale(double color_value) {
+ Gdk.RGBA color = Gdk.RGBA();
+
+ color.red = color_value;
+ color.green = color_value;
+ color.blue = color_value;
+ color.alpha = 1.0;
+
+ return color;
+ }
+
+ private void on_photo_editor_changed() {
+ int photo_app_choice_index = (photo_editor_combo.get_active() < external_photo_apps.size) ?
+ photo_editor_combo.get_active() : external_photo_apps.size;
+
+ AppInfo app = external_photo_apps.get_at(photo_app_choice_index);
+
+ Config.Facade.get_instance().set_external_photo_app(DesktopIntegration.get_app_open_command(app));
+
+ debug("setting external photo editor to: %s", DesktopIntegration.get_app_open_command(app));
+ }
+
+ private void on_raw_editor_changed() {
+ int raw_app_choice_index = (raw_editor_combo.get_active() < external_raw_apps.size) ?
+ raw_editor_combo.get_active() : external_raw_apps.size;
+
+ AppInfo app = external_raw_apps.get_at(raw_app_choice_index);
+
+ Config.Facade.get_instance().set_external_raw_app(app.get_commandline());
+
+ debug("setting external raw editor to: %s", app.get_commandline());
+ }
+
+ private RawDeveloper raw_developer_from_combo() {
+ if (default_raw_developer_combo.get_active() == 0)
+ return RawDeveloper.CAMERA;
+ return RawDeveloper.SHOTWELL;
+ }
+
+ private void set_raw_developer_combo(RawDeveloper d) {
+ if (d == RawDeveloper.CAMERA)
+ default_raw_developer_combo.set_active(0);
+ else
+ default_raw_developer_combo.set_active(1);
+ }
+
+ private void on_default_raw_developer_changed() {
+ Config.Facade.get_instance().set_default_raw_developer(raw_developer_from_combo());
+ }
+
+ private void on_current_folder_changed() {
+ lib_dir = library_dir_button.get_filename();
+ }
+
+ public override bool map_event(Gdk.EventAny event) {
+ var result = base.map_event(event);
+ // Set the signal for the lib dir button after the dialog is displayed,
+ // because the FileChooserButton has a nasty habit of selecting a
+ // different folder when displayed if the provided path doesn't exist.
+ // See ticket #3000 for more info.
+ library_dir_button.current_folder_changed.connect(on_current_folder_changed);
+
+ return result;
+ }
+
+ private void add_to_dir_formats(string name, string? pattern) {
+ PathFormat pf = new PathFormat(name, pattern);
+ path_formats.add(pf);
+ dir_pattern_combo.append_text(name);
+ }
+
+ private void on_lowercase_toggled() {
+ Config.Facade.get_instance().set_use_lowercase_filenames(lowercase.get_active());
+ }
+}
diff --git a/src/dialogs/ProgressDialog.c b/src/dialogs/ProgressDialog.c
new file mode 100644
index 0000000..7098e20
--- /dev/null
+++ b/src/dialogs/ProgressDialog.c
@@ -0,0 +1,714 @@
+/* ProgressDialog.c generated by valac 0.40.4, the Vala compiler
+ * generated from ProgressDialog.vala, do not modify */
+
+/* Copyright 2016 Software Freedom Conservancy Inc.
+ * Copyright 2017 Jens Georg <mail@jensge.org>
+ *
+ * This software is licensed under the GNU LGPL (version 2.1 or later).
+ * See the COPYING file in this distribution.
+ */
+
+
+#include <glib.h>
+#include <glib-object.h>
+#include <gtk/gtk.h>
+#include <gio/gio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <gdk/gdk.h>
+#include <glib/gi18n-lib.h>
+#include <float.h>
+#include <math.h>
+
+
+#define TYPE_PROGRESS_DIALOG (progress_dialog_get_type ())
+#define PROGRESS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PROGRESS_DIALOG, ProgressDialog))
+#define PROGRESS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PROGRESS_DIALOG, ProgressDialogClass))
+#define IS_PROGRESS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PROGRESS_DIALOG))
+#define IS_PROGRESS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PROGRESS_DIALOG))
+#define PROGRESS_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PROGRESS_DIALOG, ProgressDialogClass))
+
+typedef struct _ProgressDialog ProgressDialog;
+typedef struct _ProgressDialogClass ProgressDialogClass;
+typedef struct _ProgressDialogPrivate ProgressDialogPrivate;
+enum {
+ PROGRESS_DIALOG_0_PROPERTY,
+ PROGRESS_DIALOG_NUM_PROPERTIES
+};
+static GParamSpec* progress_dialog_properties[PROGRESS_DIALOG_NUM_PROPERTIES];
+#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
+#define _g_free0(var) (var = (g_free (var), NULL))
+#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
+#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
+#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
+#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
+
+struct _ProgressDialog {
+ GtkWindow parent_instance;
+ ProgressDialogPrivate * priv;
+};
+
+struct _ProgressDialogClass {
+ GtkWindowClass parent_class;
+};
+
+struct _ProgressDialogPrivate {
+ GtkProgressBar* progress_bar;
+ GtkButton* cancel_button;
+ GCancellable* cancellable;
+ guint64 last_count;
+ gint update_every;
+ gint minimum_on_screen_time_msec;
+ gulong time_started;
+};
+
+
+static gpointer progress_dialog_parent_class = NULL;
+
+GType progress_dialog_get_type (void) G_GNUC_CONST;
+#define PROGRESS_DIALOG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_PROGRESS_DIALOG, ProgressDialogPrivate))
+ProgressDialog* progress_dialog_new (GtkWindow* owner,
+ const gchar* text,
+ GCancellable* cancellable);
+ProgressDialog* progress_dialog_construct (GType object_type,
+ GtkWindow* owner,
+ const gchar* text,
+ GCancellable* cancellable);
+#define RESOURCES_CANCEL_LABEL _ ("_Cancel")
+static void progress_dialog_on_cancel (ProgressDialog* self);
+static void _progress_dialog_on_cancel_gtk_button_clicked (GtkButton* _sender,
+ gpointer self);
+static gboolean progress_dialog_on_window_closed (ProgressDialog* self);
+static gboolean _progress_dialog_on_window_closed_gtk_widget_delete_event (GtkWidget* _sender,
+ GdkEventAny* event,
+ gpointer self);
+gulong now_ms (void);
+static void progress_dialog_real_realize (GtkWidget* base);
+void progress_dialog_update_display_every (ProgressDialog* self,
+ gint update_every);
+void progress_dialog_set_minimum_on_screen_time_msec (ProgressDialog* self,
+ gint minimum_on_screen_time_msec);
+void progress_dialog_set_fraction (ProgressDialog* self,
+ gint current,
+ gint total);
+void progress_dialog_set_percentage (ProgressDialog* self,
+ gdouble pct);
+static void progress_dialog_maybe_show_all (ProgressDialog* self,
+ gdouble pct);
+void progress_dialog_set_status (ProgressDialog* self,
+ const gchar* text);
+gboolean progress_dialog_monitor (ProgressDialog* self,
+ guint64 count,
+ guint64 total,
+ gboolean do_event_loop);
+void spin_event_loop (void);
+void progress_dialog_close (ProgressDialog* self);
+static void progress_dialog_finalize (GObject * obj);
+
+
+static gpointer
+_g_object_ref0 (gpointer self)
+{
+#line 21 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ return self ? g_object_ref (self) : NULL;
+#line 115 "ProgressDialog.c"
+}
+
+
+static void
+_progress_dialog_on_cancel_gtk_button_clicked (GtkButton* _sender,
+ gpointer self)
+{
+#line 38 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ progress_dialog_on_cancel ((ProgressDialog*) self);
+#line 125 "ProgressDialog.c"
+}
+
+
+static gboolean
+_progress_dialog_on_window_closed_gtk_widget_delete_event (GtkWidget* _sender,
+ GdkEventAny* event,
+ gpointer self)
+{
+ gboolean result;
+ result = progress_dialog_on_window_closed ((ProgressDialog*) self);
+#line 39 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ return result;
+#line 138 "ProgressDialog.c"
+}
+
+
+ProgressDialog*
+progress_dialog_construct (GType object_type,
+ GtkWindow* owner,
+ const gchar* text,
+ GCancellable* cancellable)
+{
+ ProgressDialog * self = NULL;
+ GCancellable* _tmp0_;
+ GtkProgressBar* _tmp1_;
+ GtkProgressBar* _tmp2_;
+ GtkBox* vbox_bar = NULL;
+ GtkBox* _tmp3_;
+ GtkBox* _tmp4_;
+ GtkProgressBar* _tmp5_;
+ GtkBox* hbox = NULL;
+ GtkBox* _tmp8_;
+ GtkBox* _tmp9_;
+ GtkBox* _tmp10_;
+ GtkButton* _tmp11_;
+ GtkLabel* primary_text_label = NULL;
+ GtkLabel* _tmp14_;
+ gchar* _tmp15_;
+ gchar* _tmp16_;
+ GtkBox* vbox = NULL;
+ GtkBox* _tmp17_;
+ GtkBox* _tmp18_;
+#line 20 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ g_return_val_if_fail ((owner == NULL) || GTK_IS_WINDOW (owner), NULL);
+#line 20 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ g_return_val_if_fail (text != NULL, NULL);
+#line 20 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ g_return_val_if_fail ((cancellable == NULL) || G_IS_CANCELLABLE (cancellable), NULL);
+#line 20 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ self = (ProgressDialog*) g_object_new (object_type, NULL);
+#line 21 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp0_ = _g_object_ref0 (cancellable);
+#line 21 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _g_object_unref0 (self->priv->cancellable);
+#line 21 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ self->priv->cancellable = _tmp0_;
+#line 23 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ gtk_window_set_title (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), text);
+#line 24 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ gtk_window_set_resizable (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), FALSE);
+#line 25 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ if (owner != NULL) {
+#line 26 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ gtk_window_set_transient_for (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), owner);
+#line 190 "ProgressDialog.c"
+ }
+#line 27 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ gtk_window_set_modal (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), TRUE);
+#line 28 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ gtk_window_set_type_hint (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), GDK_WINDOW_TYPE_HINT_DIALOG);
+#line 30 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp1_ = self->priv->progress_bar;
+#line 30 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ gtk_widget_set_size_request (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_widget_get_type (), GtkWidget), 300, -1);
+#line 31 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp2_ = self->priv->progress_bar;
+#line 31 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ gtk_progress_bar_set_show_text (_tmp2_, TRUE);
+#line 33 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp3_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+#line 33 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ g_object_ref_sink (_tmp3_);
+#line 33 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ vbox_bar = _tmp3_;
+#line 34 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp4_ = vbox_bar;
+#line 34 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp5_ = self->priv->progress_bar;
+#line 34 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ gtk_box_pack_start (_tmp4_, G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, gtk_widget_get_type (), GtkWidget), TRUE, FALSE, (guint) 0);
+#line 36 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ if (cancellable != NULL) {
+#line 218 "ProgressDialog.c"
+ GtkButton* _tmp6_;
+ GtkButton* _tmp7_;
+#line 37 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp6_ = (GtkButton*) gtk_button_new_with_mnemonic (RESOURCES_CANCEL_LABEL);
+#line 37 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ g_object_ref_sink (_tmp6_);
+#line 37 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _g_object_unref0 (self->priv->cancel_button);
+#line 37 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ self->priv->cancel_button = _tmp6_;
+#line 38 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp7_ = self->priv->cancel_button;
+#line 38 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ g_signal_connect_object (_tmp7_, "clicked", (GCallback) _progress_dialog_on_cancel_gtk_button_clicked, self, 0);
+#line 39 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), "delete-event", (GCallback) _progress_dialog_on_window_closed_gtk_widget_delete_event, self, 0);
+#line 235 "ProgressDialog.c"
+ }
+#line 42 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp8_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
+#line 42 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ g_object_ref_sink (_tmp8_);
+#line 42 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ hbox = _tmp8_;
+#line 43 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp9_ = hbox;
+#line 43 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp10_ = vbox_bar;
+#line 43 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ gtk_box_pack_start (_tmp9_, G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, gtk_widget_get_type (), GtkWidget), TRUE, FALSE, (guint) 0);
+#line 44 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp11_ = self->priv->cancel_button;
+#line 44 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ if (_tmp11_ != NULL) {
+#line 253 "ProgressDialog.c"
+ GtkBox* _tmp12_;
+ GtkButton* _tmp13_;
+#line 45 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp12_ = hbox;
+#line 45 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp13_ = self->priv->cancel_button;
+#line 45 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ gtk_box_pack_end (_tmp12_, G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, gtk_widget_get_type (), GtkWidget), FALSE, FALSE, (guint) 0);
+#line 262 "ProgressDialog.c"
+ }
+#line 47 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp14_ = (GtkLabel*) gtk_label_new ("");
+#line 47 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ g_object_ref_sink (_tmp14_);
+#line 47 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ primary_text_label = _tmp14_;
+#line 48 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp15_ = g_strdup_printf ("<span weight=\"bold\">%s</span>", text);
+#line 48 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp16_ = _tmp15_;
+#line 48 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ gtk_label_set_markup (primary_text_label, _tmp16_);
+#line 48 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _g_free0 (_tmp16_);
+#line 49 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ gtk_label_set_xalign (primary_text_label, 0.0f);
+#line 50 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ gtk_label_set_yalign (primary_text_label, 0.5f);
+#line 52 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp17_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
+#line 52 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ g_object_ref_sink (_tmp17_);
+#line 52 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ vbox = _tmp17_;
+#line 53 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ gtk_box_pack_start (vbox, G_TYPE_CHECK_INSTANCE_CAST (primary_text_label, gtk_widget_get_type (), GtkWidget), FALSE, FALSE, (guint) 0);
+#line 54 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp18_ = hbox;
+#line 54 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ gtk_box_pack_start (vbox, G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, gtk_widget_get_type (), GtkWidget), TRUE, FALSE, (guint) 0);
+#line 55 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ gtk_widget_set_halign (G_TYPE_CHECK_INSTANCE_CAST (vbox, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_CENTER);
+#line 56 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ gtk_widget_set_valign (G_TYPE_CHECK_INSTANCE_CAST (vbox, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_CENTER);
+#line 57 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ gtk_widget_set_hexpand (G_TYPE_CHECK_INSTANCE_CAST (vbox, gtk_widget_get_type (), GtkWidget), TRUE);
+#line 58 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ gtk_widget_set_vexpand (G_TYPE_CHECK_INSTANCE_CAST (vbox, gtk_widget_get_type (), GtkWidget), TRUE);
+#line 59 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ gtk_widget_set_margin_start (G_TYPE_CHECK_INSTANCE_CAST (vbox, gtk_widget_get_type (), GtkWidget), 12);
+#line 60 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ gtk_widget_set_margin_end (G_TYPE_CHECK_INSTANCE_CAST (vbox, gtk_widget_get_type (), GtkWidget), 12);
+#line 61 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ gtk_widget_set_margin_top (G_TYPE_CHECK_INSTANCE_CAST (vbox, gtk_widget_get_type (), GtkWidget), 12);
+#line 62 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ gtk_widget_set_margin_bottom (G_TYPE_CHECK_INSTANCE_CAST (vbox, gtk_widget_get_type (), GtkWidget), 12);
+#line 64 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (vbox, gtk_widget_get_type (), GtkWidget));
+#line 66 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ self->priv->time_started = now_ms ();
+#line 20 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _g_object_unref0 (vbox);
+#line 20 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _g_object_unref0 (primary_text_label);
+#line 20 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _g_object_unref0 (hbox);
+#line 20 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _g_object_unref0 (vbox_bar);
+#line 20 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ return self;
+#line 324 "ProgressDialog.c"
+}
+
+
+ProgressDialog*
+progress_dialog_new (GtkWindow* owner,
+ const gchar* text,
+ GCancellable* cancellable)
+{
+#line 20 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ return progress_dialog_construct (TYPE_PROGRESS_DIALOG, owner, text, cancellable);
+#line 335 "ProgressDialog.c"
+}
+
+
+static void
+progress_dialog_real_realize (GtkWidget* base)
+{
+ ProgressDialog * self;
+ GCancellable* _tmp0_;
+#line 69 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PROGRESS_DIALOG, ProgressDialog);
+#line 70 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ GTK_WIDGET_CLASS (progress_dialog_parent_class)->realize (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), gtk_widget_get_type (), GtkWidget));
+#line 73 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp0_ = self->priv->cancellable;
+#line 73 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ if (_tmp0_ == NULL) {
+#line 352 "ProgressDialog.c"
+ GdkWindow* _tmp1_;
+#line 74 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp1_ = gtk_widget_get_window (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
+#line 74 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ gdk_window_set_functions (_tmp1_, GDK_FUNC_MOVE);
+#line 358 "ProgressDialog.c"
+ }
+}
+
+
+void
+progress_dialog_update_display_every (ProgressDialog* self,
+ gint update_every)
+{
+#line 77 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ g_return_if_fail (IS_PROGRESS_DIALOG (self));
+#line 78 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _vala_assert (update_every >= 1, "update_every >= 1");
+#line 80 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ self->priv->update_every = update_every;
+#line 373 "ProgressDialog.c"
+}
+
+
+void
+progress_dialog_set_minimum_on_screen_time_msec (ProgressDialog* self,
+ gint minimum_on_screen_time_msec)
+{
+#line 83 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ g_return_if_fail (IS_PROGRESS_DIALOG (self));
+#line 84 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ self->priv->minimum_on_screen_time_msec = minimum_on_screen_time_msec;
+#line 385 "ProgressDialog.c"
+}
+
+
+void
+progress_dialog_set_fraction (ProgressDialog* self,
+ gint current,
+ gint total)
+{
+#line 87 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ g_return_if_fail (IS_PROGRESS_DIALOG (self));
+#line 88 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ progress_dialog_set_percentage (self, ((gdouble) current) / ((gdouble) total));
+#line 398 "ProgressDialog.c"
+}
+
+
+void
+progress_dialog_set_percentage (ProgressDialog* self,
+ gdouble pct)
+{
+ GtkProgressBar* _tmp0_;
+ GtkProgressBar* _tmp1_;
+ gchar* _tmp2_;
+ gchar* _tmp3_;
+#line 91 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ g_return_if_fail (IS_PROGRESS_DIALOG (self));
+#line 92 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ pct = CLAMP (pct, 0.0, 1.0);
+#line 94 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ progress_dialog_maybe_show_all (self, pct);
+#line 96 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp0_ = self->priv->progress_bar;
+#line 96 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ gtk_progress_bar_set_fraction (_tmp0_, pct);
+#line 97 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp1_ = self->priv->progress_bar;
+#line 97 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp2_ = g_strdup_printf (_ ("%d%%"), (gint) (pct * 100.0));
+#line 97 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp3_ = _tmp2_;
+#line 97 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ gtk_progress_bar_set_text (_tmp1_, _tmp3_);
+#line 97 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _g_free0 (_tmp3_);
+#line 430 "ProgressDialog.c"
+}
+
+
+void
+progress_dialog_set_status (ProgressDialog* self,
+ const gchar* text)
+{
+ GtkProgressBar* _tmp0_;
+#line 105 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ g_return_if_fail (IS_PROGRESS_DIALOG (self));
+#line 105 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ g_return_if_fail (text != NULL);
+#line 106 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp0_ = self->priv->progress_bar;
+#line 106 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ gtk_progress_bar_set_text (_tmp0_, text);
+#line 112 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ gtk_widget_show_all (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
+#line 449 "ProgressDialog.c"
+}
+
+
+gboolean
+progress_dialog_monitor (ProgressDialog* self,
+ guint64 count,
+ guint64 total,
+ gboolean do_event_loop)
+{
+ gboolean result = FALSE;
+ gboolean _tmp0_ = FALSE;
+ guint64 _tmp1_;
+ gboolean _tmp4_ = FALSE;
+ GCancellable* _tmp5_;
+ gboolean keep_going = FALSE;
+#line 116 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ g_return_val_if_fail (IS_PROGRESS_DIALOG (self), FALSE);
+#line 117 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp1_ = self->priv->last_count;
+#line 117 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ if (_tmp1_ == G_MAXUINT64) {
+#line 117 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp0_ = TRUE;
+#line 473 "ProgressDialog.c"
+ } else {
+ guint64 _tmp2_;
+ gint _tmp3_;
+#line 117 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp2_ = self->priv->last_count;
+#line 117 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp3_ = self->priv->update_every;
+#line 117 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp0_ = (count - _tmp2_) >= ((guint64) _tmp3_);
+#line 483 "ProgressDialog.c"
+ }
+#line 117 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ if (_tmp0_) {
+#line 118 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ progress_dialog_set_percentage (self, ((gdouble) count) / ((gdouble) total));
+#line 119 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ self->priv->last_count = count;
+#line 491 "ProgressDialog.c"
+ }
+#line 122 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp5_ = self->priv->cancellable;
+#line 122 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ if (_tmp5_ != NULL) {
+#line 497 "ProgressDialog.c"
+ GCancellable* _tmp6_;
+#line 122 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp6_ = self->priv->cancellable;
+#line 122 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp4_ = !g_cancellable_is_cancelled (_tmp6_);
+#line 503 "ProgressDialog.c"
+ } else {
+#line 122 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp4_ = TRUE;
+#line 507 "ProgressDialog.c"
+ }
+#line 122 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ keep_going = _tmp4_;
+#line 130 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ if (do_event_loop) {
+#line 131 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ spin_event_loop ();
+#line 515 "ProgressDialog.c"
+ }
+#line 133 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ result = keep_going;
+#line 133 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ return result;
+#line 521 "ProgressDialog.c"
+}
+
+
+void
+progress_dialog_close (ProgressDialog* self)
+{
+#line 136 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ g_return_if_fail (IS_PROGRESS_DIALOG (self));
+#line 141 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ gtk_widget_hide (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
+#line 142 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ gtk_widget_destroy (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
+#line 534 "ProgressDialog.c"
+}
+
+
+static gboolean
+progress_dialog_on_window_closed (ProgressDialog* self)
+{
+ gboolean result = FALSE;
+#line 145 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ g_return_val_if_fail (IS_PROGRESS_DIALOG (self), FALSE);
+#line 146 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ progress_dialog_on_cancel (self);
+#line 147 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ result = FALSE;
+#line 147 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ return result;
+#line 550 "ProgressDialog.c"
+}
+
+
+static void
+progress_dialog_on_cancel (ProgressDialog* self)
+{
+ GCancellable* _tmp0_;
+ GtkButton* _tmp2_;
+#line 151 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ g_return_if_fail (IS_PROGRESS_DIALOG (self));
+#line 152 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp0_ = self->priv->cancellable;
+#line 152 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ if (_tmp0_ != NULL) {
+#line 565 "ProgressDialog.c"
+ GCancellable* _tmp1_;
+#line 153 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp1_ = self->priv->cancellable;
+#line 153 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ g_cancellable_cancel (_tmp1_);
+#line 571 "ProgressDialog.c"
+ }
+#line 155 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp2_ = self->priv->cancel_button;
+#line 155 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_widget_get_type (), GtkWidget), FALSE);
+#line 577 "ProgressDialog.c"
+}
+
+
+static void
+progress_dialog_maybe_show_all (ProgressDialog* self,
+ gdouble pct)
+{
+ gboolean _tmp0_ = FALSE;
+ gboolean _tmp1_;
+ gboolean _tmp2_;
+#line 158 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ g_return_if_fail (IS_PROGRESS_DIALOG (self));
+#line 161 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp1_ = gtk_widget_get_visible (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
+#line 161 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp2_ = _tmp1_;
+#line 161 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ if (!_tmp2_) {
+#line 596 "ProgressDialog.c"
+ gulong _tmp3_;
+ gint _tmp4_;
+#line 161 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp3_ = self->priv->time_started;
+#line 161 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp4_ = self->priv->minimum_on_screen_time_msec;
+#line 161 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp0_ = (now_ms () - _tmp3_) > ((gulong) _tmp4_);
+#line 605 "ProgressDialog.c"
+ } else {
+#line 161 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp0_ = FALSE;
+#line 609 "ProgressDialog.c"
+ }
+#line 161 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ if (_tmp0_) {
+#line 613 "ProgressDialog.c"
+ gdouble pps = 0.0;
+ gint _tmp5_;
+ gdouble ttc = 0.0;
+ gdouble _tmp6_;
+ gdouble _tmp7_;
+ gint _tmp8_;
+#line 163 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp5_ = self->priv->minimum_on_screen_time_msec;
+#line 163 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ pps = (pct * 100.0) / _tmp5_;
+#line 165 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp6_ = pps;
+#line 165 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ ttc = 100.0 / _tmp6_;
+#line 168 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp7_ = ttc;
+#line 168 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp8_ = self->priv->minimum_on_screen_time_msec;
+#line 168 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ if (_tmp7_ > ((gdouble) _tmp8_)) {
+#line 173 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ gtk_widget_show_all (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
+#line 174 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ spin_event_loop ();
+#line 638 "ProgressDialog.c"
+ }
+ }
+}
+
+
+static void
+progress_dialog_class_init (ProgressDialogClass * klass)
+{
+#line 8 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ progress_dialog_parent_class = g_type_class_peek_parent (klass);
+#line 8 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ g_type_class_add_private (klass, sizeof (ProgressDialogPrivate));
+#line 8 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ ((GtkWidgetClass *) klass)->realize = (void (*) (GtkWidget *)) progress_dialog_real_realize;
+#line 8 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ G_OBJECT_CLASS (klass)->finalize = progress_dialog_finalize;
+#line 655 "ProgressDialog.c"
+}
+
+
+static void
+progress_dialog_instance_init (ProgressDialog * self)
+{
+ GtkProgressBar* _tmp0_;
+#line 8 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ self->priv = PROGRESS_DIALOG_GET_PRIVATE (self);
+#line 9 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _tmp0_ = (GtkProgressBar*) gtk_progress_bar_new ();
+#line 9 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ g_object_ref_sink (_tmp0_);
+#line 9 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ self->priv->progress_bar = _tmp0_;
+#line 10 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ self->priv->cancel_button = NULL;
+#line 12 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ self->priv->last_count = G_MAXUINT64;
+#line 13 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ self->priv->update_every = 1;
+#line 14 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ self->priv->minimum_on_screen_time_msec = 500;
+#line 679 "ProgressDialog.c"
+}
+
+
+static void
+progress_dialog_finalize (GObject * obj)
+{
+ ProgressDialog * self;
+#line 8 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_PROGRESS_DIALOG, ProgressDialog);
+#line 9 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _g_object_unref0 (self->priv->progress_bar);
+#line 10 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _g_object_unref0 (self->priv->cancel_button);
+#line 11 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ _g_object_unref0 (self->priv->cancellable);
+#line 8 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala"
+ G_OBJECT_CLASS (progress_dialog_parent_class)->finalize (obj);
+#line 697 "ProgressDialog.c"
+}
+
+
+GType
+progress_dialog_get_type (void)
+{
+ static volatile gsize progress_dialog_type_id__volatile = 0;
+ if (g_once_init_enter (&progress_dialog_type_id__volatile)) {
+ static const GTypeInfo g_define_type_info = { sizeof (ProgressDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) progress_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProgressDialog), 0, (GInstanceInitFunc) progress_dialog_instance_init, NULL };
+ GType progress_dialog_type_id;
+ progress_dialog_type_id = g_type_register_static (gtk_window_get_type (), "ProgressDialog", &g_define_type_info, 0);
+ g_once_init_leave (&progress_dialog_type_id__volatile, progress_dialog_type_id);
+ }
+ return progress_dialog_type_id__volatile;
+}
+
+
+
diff --git a/src/dialogs/ProgressDialog.vala b/src/dialogs/ProgressDialog.vala
new file mode 100644
index 0000000..9368764
--- /dev/null
+++ b/src/dialogs/ProgressDialog.vala
@@ -0,0 +1,178 @@
+/* Copyright 2016 Software Freedom Conservancy Inc.
+ * Copyright 2017 Jens Georg <mail@jensge.org>
+ *
+ * This software is licensed under the GNU LGPL (version 2.1 or later).
+ * See the COPYING file in this distribution.
+ */
+
+public class ProgressDialog : Gtk.Window {
+ private Gtk.ProgressBar progress_bar = new Gtk.ProgressBar();
+ private Gtk.Button cancel_button = null;
+ private Cancellable cancellable;
+ private uint64 last_count = uint64.MAX;
+ private int update_every = 1;
+ private int minimum_on_screen_time_msec = 500;
+ private ulong time_started;
+#if UNITY_SUPPORT
+ UnityProgressBar uniprobar = UnityProgressBar.get_instance();
+#endif
+
+ public ProgressDialog(Gtk.Window? owner, string text, Cancellable? cancellable = null) {
+ this.cancellable = cancellable;
+
+ set_title(text);
+ set_resizable(false);
+ if (owner != null)
+ set_transient_for(owner);
+ set_modal(true);
+ set_type_hint(Gdk.WindowTypeHint.DIALOG);
+
+ progress_bar.set_size_request(300, -1);
+ progress_bar.set_show_text(true);
+
+ Gtk.Box vbox_bar = new Gtk.Box(Gtk.Orientation.VERTICAL, 0);
+ vbox_bar.pack_start(progress_bar, true, false, 0);
+
+ if (cancellable != null) {
+ cancel_button = new Gtk.Button.with_mnemonic(Resources.CANCEL_LABEL);
+ cancel_button.clicked.connect(on_cancel);
+ delete_event.connect(on_window_closed);
+ }
+
+ Gtk.Box hbox = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 8);
+ hbox.pack_start(vbox_bar, true, false, 0);
+ if (cancel_button != null)
+ hbox.pack_end(cancel_button, false, false, 0);
+
+ Gtk.Label primary_text_label = new Gtk.Label("");
+ primary_text_label.set_markup("<span weight=\"bold\">%s</span>".printf(text));
+ primary_text_label.xalign = 0.0f;
+ primary_text_label.yalign = 0.5f;
+
+ Gtk.Box vbox = new Gtk.Box(Gtk.Orientation.VERTICAL, 12);
+ vbox.pack_start(primary_text_label, false, false, 0);
+ vbox.pack_start(hbox, true, false, 0);
+ vbox.halign = Gtk.Align.CENTER;
+ vbox.valign = Gtk.Align.CENTER;
+ vbox.hexpand = true;
+ vbox.vexpand = true;
+ vbox.margin_start = 12;
+ vbox.margin_end = 12;
+ vbox.margin_top = 12;
+ vbox.margin_bottom = 12;
+
+ add(vbox);
+
+ time_started = now_ms();
+ }
+
+ public override void realize() {
+ base.realize();
+
+ // if unable to cancel the progress bar, remove the close button
+ if (cancellable == null)
+ get_window().set_functions(Gdk.WMFunction.MOVE);
+ }
+
+ public void update_display_every(int update_every) {
+ assert(update_every >= 1);
+
+ this.update_every = update_every;
+ }
+
+ public void set_minimum_on_screen_time_msec(int minimum_on_screen_time_msec) {
+ this.minimum_on_screen_time_msec = minimum_on_screen_time_msec;
+ }
+
+ public void set_fraction(int current, int total) {
+ set_percentage((double) current / (double) total);
+ }
+
+ public void set_percentage(double pct) {
+ pct = pct.clamp(0.0, 1.0);
+
+ maybe_show_all(pct);
+
+ progress_bar.set_fraction(pct);
+ progress_bar.set_text(_("%d%%").printf((int) (pct * 100.0)));
+
+#if UNITY_SUPPORT
+ //UnityProgressBar: set progress
+ uniprobar.set_progress(pct);
+#endif
+ }
+
+ public void set_status(string text) {
+ progress_bar.set_text(text);
+
+#if UNITY_SUPPORT
+ //UnityProgressBar: try to draw progress bar
+ uniprobar.set_visible(true);
+#endif
+ show_all();
+ }
+
+ // This can be used as a ProgressMonitor delegate.
+ public bool monitor(uint64 count, uint64 total, bool do_event_loop = true) {
+ if ((last_count == uint64.MAX) || (count - last_count) >= update_every) {
+ set_percentage((double) count / (double) total);
+ last_count = count;
+ }
+
+ bool keep_going = (cancellable != null) ? !cancellable.is_cancelled() : true;
+
+ // TODO: get rid of this. non-trivial, as some progress-monitor operations are blocking
+ // and need to allow the event loop to spin
+ //
+ // Important: Since it's possible the progress dialog might be destroyed inside this call,
+ // avoid referring to "this" afterwards at all costs (in case all refs have been dropped)
+
+ if (do_event_loop)
+ spin_event_loop();
+
+ return keep_going;
+ }
+
+ public new void close() {
+#if UNITY_SUPPORT
+ //UnityProgressBar: reset
+ uniprobar.reset();
+#endif
+ hide();
+ destroy();
+ }
+
+ private bool on_window_closed() {
+ on_cancel();
+ return false; // return false so that the system handler will remove the window from
+ // the screen
+ }
+
+ private void on_cancel() {
+ if (cancellable != null)
+ cancellable.cancel();
+
+ cancel_button.sensitive = false;
+ }
+
+ private void maybe_show_all(double pct) {
+ // Appear only after a while because some jobs may take only a
+ // fraction of second to complete so there's no point in showing progress.
+ if (!this.visible && now_ms() - time_started > minimum_on_screen_time_msec) {
+ // calculate percents completed in one ms
+ double pps = pct * 100.0 / minimum_on_screen_time_msec;
+ // calculate [very rough] estimate of time to complete in ms
+ double ttc = 100.0 / pps;
+ // If there is still more work to do for at least MINIMUM_ON_SCREEN_TIME_MSEC,
+ // finally display the dialog.
+ if (ttc > minimum_on_screen_time_msec) {
+#if UNITY_SUPPORT
+ //UnityProgressBar: try to draw progress bar
+ uniprobar.set_visible(true);
+#endif
+ show_all();
+ spin_event_loop();
+ }
+ }
+ }
+}
diff --git a/src/dialogs/SetBackground.c b/src/dialogs/SetBackground.c
new file mode 100644
index 0000000..88577ce
--- /dev/null
+++ b/src/dialogs/SetBackground.c
@@ -0,0 +1,295 @@
+/* SetBackground.c generated by valac 0.40.4, the Vala compiler
+ * generated from SetBackground.vala, do not modify */
+
+/* Copyright 2016 Software Freedom Conservancy Inc.
+ * Copyright 2017 Jens Georg <mail@jensge.org>
+ *
+ * This software is licensed under the GNU LGPL (version 2.1 or later).
+ * See the COPYING file in this distribution.
+ */
+
+
+#include <glib.h>
+#include <glib-object.h>
+#include <gtk/gtk.h>
+
+
+#define TYPE_SET_BACKGROUND_PHOTO_DIALOG (set_background_photo_dialog_get_type ())
+#define SET_BACKGROUND_PHOTO_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SET_BACKGROUND_PHOTO_DIALOG, SetBackgroundPhotoDialog))
+#define SET_BACKGROUND_PHOTO_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SET_BACKGROUND_PHOTO_DIALOG, SetBackgroundPhotoDialogClass))
+#define IS_SET_BACKGROUND_PHOTO_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SET_BACKGROUND_PHOTO_DIALOG))
+#define IS_SET_BACKGROUND_PHOTO_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SET_BACKGROUND_PHOTO_DIALOG))
+#define SET_BACKGROUND_PHOTO_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SET_BACKGROUND_PHOTO_DIALOG, SetBackgroundPhotoDialogClass))
+
+typedef struct _SetBackgroundPhotoDialog SetBackgroundPhotoDialog;
+typedef struct _SetBackgroundPhotoDialogClass SetBackgroundPhotoDialogClass;
+typedef struct _SetBackgroundPhotoDialogPrivate SetBackgroundPhotoDialogPrivate;
+enum {
+ SET_BACKGROUND_PHOTO_DIALOG_0_PROPERTY,
+ SET_BACKGROUND_PHOTO_DIALOG_NUM_PROPERTIES
+};
+static GParamSpec* set_background_photo_dialog_properties[SET_BACKGROUND_PHOTO_DIALOG_NUM_PROPERTIES];
+#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
+
+#define TYPE_PAGE_WINDOW (page_window_get_type ())
+#define PAGE_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PAGE_WINDOW, PageWindow))
+#define PAGE_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PAGE_WINDOW, PageWindowClass))
+#define IS_PAGE_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PAGE_WINDOW))
+#define IS_PAGE_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PAGE_WINDOW))
+#define PAGE_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PAGE_WINDOW, PageWindowClass))
+
+typedef struct _PageWindow PageWindow;
+typedef struct _PageWindowClass PageWindowClass;
+
+#define TYPE_APP_WINDOW (app_window_get_type ())
+#define APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_APP_WINDOW, AppWindow))
+#define APP_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_APP_WINDOW, AppWindowClass))
+#define IS_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_APP_WINDOW))
+#define IS_APP_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_APP_WINDOW))
+#define APP_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_APP_WINDOW, AppWindowClass))
+
+typedef struct _AppWindow AppWindow;
+typedef struct _AppWindowClass AppWindowClass;
+
+struct _SetBackgroundPhotoDialog {
+ GtkDialog parent_instance;
+ SetBackgroundPhotoDialogPrivate * priv;
+};
+
+struct _SetBackgroundPhotoDialogClass {
+ GtkDialogClass parent_class;
+};
+
+struct _SetBackgroundPhotoDialogPrivate {
+ GtkCheckButton* desktop_background_checkbox;
+ GtkCheckButton* screensaver_checkbox;
+};
+
+
+static gpointer set_background_photo_dialog_parent_class = NULL;
+
+GType set_background_photo_dialog_get_type (void) G_GNUC_CONST;
+#define SET_BACKGROUND_PHOTO_DIALOG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_SET_BACKGROUND_PHOTO_DIALOG, SetBackgroundPhotoDialogPrivate))
+SetBackgroundPhotoDialog* set_background_photo_dialog_new (void);
+SetBackgroundPhotoDialog* set_background_photo_dialog_construct (GType object_type);
+gint resources_use_header_bar (void);
+GType page_window_get_type (void) G_GNUC_CONST;
+GType app_window_get_type (void) G_GNUC_CONST;
+AppWindow* app_window_get_instance (void);
+static void set_background_photo_dialog_on_checkbox_clicked (SetBackgroundPhotoDialog* self);
+static void _set_background_photo_dialog_on_checkbox_clicked_gtk_toggle_button_toggled (GtkToggleButton* _sender,
+ gpointer self);
+gboolean set_background_photo_dialog_execute (SetBackgroundPhotoDialog* self,
+ gboolean* desktop_background,
+ gboolean* screensaver);
+static void set_background_photo_dialog_finalize (GObject * obj);
+
+
+SetBackgroundPhotoDialog*
+set_background_photo_dialog_construct (GType object_type)
+{
+ SetBackgroundPhotoDialog * self = NULL;
+ AppWindow* _tmp0_;
+ AppWindow* _tmp1_;
+#line 16 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ self = (SetBackgroundPhotoDialog*) g_object_new (object_type, "use-header-bar", resources_use_header_bar (), NULL);
+#line 17 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ _tmp0_ = app_window_get_instance ();
+#line 17 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ _tmp1_ = _tmp0_;
+#line 17 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ gtk_window_set_transient_for (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_window_get_type (), GtkWindow));
+#line 17 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ _g_object_unref0 (_tmp1_);
+#line 15 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ return self;
+#line 107 "SetBackground.c"
+}
+
+
+SetBackgroundPhotoDialog*
+set_background_photo_dialog_new (void)
+{
+#line 15 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ return set_background_photo_dialog_construct (TYPE_SET_BACKGROUND_PHOTO_DIALOG);
+#line 116 "SetBackground.c"
+}
+
+
+static void
+set_background_photo_dialog_on_checkbox_clicked (SetBackgroundPhotoDialog* self)
+{
+ gboolean _tmp0_ = FALSE;
+ GtkCheckButton* _tmp1_;
+ gboolean _tmp2_;
+ gboolean _tmp3_;
+#line 21 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ g_return_if_fail (IS_SET_BACKGROUND_PHOTO_DIALOG (self));
+#line 23 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ _tmp1_ = self->priv->desktop_background_checkbox;
+#line 23 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ _tmp2_ = gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_toggle_button_get_type (), GtkToggleButton));
+#line 23 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ _tmp3_ = _tmp2_;
+#line 23 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ if (_tmp3_) {
+#line 23 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ _tmp0_ = TRUE;
+#line 139 "SetBackground.c"
+ } else {
+ GtkCheckButton* _tmp4_;
+ gboolean _tmp5_;
+ gboolean _tmp6_;
+#line 24 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ _tmp4_ = self->priv->screensaver_checkbox;
+#line 24 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ _tmp5_ = gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_toggle_button_get_type (), GtkToggleButton));
+#line 24 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ _tmp6_ = _tmp5_;
+#line 24 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ _tmp0_ = _tmp6_;
+#line 152 "SetBackground.c"
+ }
+#line 22 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ gtk_dialog_set_response_sensitive (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_dialog_get_type (), GtkDialog), (gint) GTK_RESPONSE_OK, _tmp0_);
+#line 156 "SetBackground.c"
+}
+
+
+static void
+_set_background_photo_dialog_on_checkbox_clicked_gtk_toggle_button_toggled (GtkToggleButton* _sender,
+ gpointer self)
+{
+#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ set_background_photo_dialog_on_checkbox_clicked ((SetBackgroundPhotoDialog*) self);
+#line 166 "SetBackground.c"
+}
+
+
+gboolean
+set_background_photo_dialog_execute (SetBackgroundPhotoDialog* self,
+ gboolean* desktop_background,
+ gboolean* screensaver)
+{
+ gboolean _vala_desktop_background = FALSE;
+ gboolean _vala_screensaver = FALSE;
+ gboolean result = FALSE;
+ gboolean _result_ = FALSE;
+ GtkCheckButton* _tmp0_;
+ gboolean _tmp1_;
+ gboolean _tmp2_;
+ GtkCheckButton* _tmp3_;
+ gboolean _tmp4_;
+ gboolean _tmp5_;
+#line 27 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ g_return_val_if_fail (IS_SET_BACKGROUND_PHOTO_DIALOG (self), FALSE);
+#line 28 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ gtk_widget_show_all (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
+#line 29 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ _result_ = gtk_dialog_run (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_dialog_get_type (), GtkDialog)) == ((gint) GTK_RESPONSE_OK);
+#line 30 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ gtk_widget_hide (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
+#line 32 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ _tmp0_ = self->priv->desktop_background_checkbox;
+#line 32 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ _tmp1_ = gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_toggle_button_get_type (), GtkToggleButton));
+#line 32 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ _tmp2_ = _tmp1_;
+#line 32 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ _vala_desktop_background = _tmp2_;
+#line 33 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ _tmp3_ = self->priv->screensaver_checkbox;
+#line 33 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ _tmp4_ = gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_toggle_button_get_type (), GtkToggleButton));
+#line 33 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ _tmp5_ = _tmp4_;
+#line 33 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ _vala_screensaver = _tmp5_;
+#line 35 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ gtk_widget_destroy (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
+#line 36 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ result = _result_;
+#line 36 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ if (desktop_background) {
+#line 36 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ *desktop_background = _vala_desktop_background;
+#line 217 "SetBackground.c"
+ }
+#line 36 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ if (screensaver) {
+#line 36 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ *screensaver = _vala_screensaver;
+#line 223 "SetBackground.c"
+ }
+#line 36 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ return result;
+#line 227 "SetBackground.c"
+}
+
+
+static void
+set_background_photo_dialog_class_init (SetBackgroundPhotoDialogClass * klass)
+{
+ gint SetBackgroundPhotoDialog_private_offset;
+#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ set_background_photo_dialog_parent_class = g_type_class_peek_parent (klass);
+#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ g_type_class_add_private (klass, sizeof (SetBackgroundPhotoDialogPrivate));
+#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ G_OBJECT_CLASS (klass)->finalize = set_background_photo_dialog_finalize;
+#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ SetBackgroundPhotoDialog_private_offset = g_type_class_get_instance_private_offset (klass);
+#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/Shotwell/ui/set_background_dialog.ui");
+#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "desktop_background_checkbox", FALSE, SetBackgroundPhotoDialog_private_offset + G_STRUCT_OFFSET (SetBackgroundPhotoDialogPrivate, desktop_background_checkbox));
+#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "screensaver_checkbox", FALSE, SetBackgroundPhotoDialog_private_offset + G_STRUCT_OFFSET (SetBackgroundPhotoDialogPrivate, screensaver_checkbox));
+#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_checkbox_clicked", G_CALLBACK(_set_background_photo_dialog_on_checkbox_clicked_gtk_toggle_button_toggled));
+#line 251 "SetBackground.c"
+}
+
+
+static void
+set_background_photo_dialog_instance_init (SetBackgroundPhotoDialog * self)
+{
+#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ self->priv = SET_BACKGROUND_PHOTO_DIALOG_GET_PRIVATE (self);
+#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ gtk_widget_init_template (GTK_WIDGET (self));
+#line 262 "SetBackground.c"
+}
+
+
+static void
+set_background_photo_dialog_finalize (GObject * obj)
+{
+ SetBackgroundPhotoDialog * self;
+#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_SET_BACKGROUND_PHOTO_DIALOG, SetBackgroundPhotoDialog);
+#line 11 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ _g_object_unref0 (self->priv->desktop_background_checkbox);
+#line 13 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ _g_object_unref0 (self->priv->screensaver_checkbox);
+#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala"
+ G_OBJECT_CLASS (set_background_photo_dialog_parent_class)->finalize (obj);
+#line 278 "SetBackground.c"
+}
+
+
+GType
+set_background_photo_dialog_get_type (void)
+{
+ static volatile gsize set_background_photo_dialog_type_id__volatile = 0;
+ if (g_once_init_enter (&set_background_photo_dialog_type_id__volatile)) {
+ static const GTypeInfo g_define_type_info = { sizeof (SetBackgroundPhotoDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) set_background_photo_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SetBackgroundPhotoDialog), 0, (GInstanceInitFunc) set_background_photo_dialog_instance_init, NULL };
+ GType set_background_photo_dialog_type_id;
+ set_background_photo_dialog_type_id = g_type_register_static (gtk_dialog_get_type (), "SetBackgroundPhotoDialog", &g_define_type_info, 0);
+ g_once_init_leave (&set_background_photo_dialog_type_id__volatile, set_background_photo_dialog_type_id);
+ }
+ return set_background_photo_dialog_type_id__volatile;
+}
+
+
+
diff --git a/src/dialogs/SetBackground.vala b/src/dialogs/SetBackground.vala
new file mode 100644
index 0000000..d9a77c4
--- /dev/null
+++ b/src/dialogs/SetBackground.vala
@@ -0,0 +1,38 @@
+/* Copyright 2016 Software Freedom Conservancy Inc.
+ * Copyright 2017 Jens Georg <mail@jensge.org>
+ *
+ * This software is licensed under the GNU LGPL (version 2.1 or later).
+ * See the COPYING file in this distribution.
+ */
+
+[GtkTemplate (ui = "/org/gnome/Shotwell/ui/set_background_dialog.ui")]
+public class SetBackgroundPhotoDialog : Gtk.Dialog {
+ [GtkChild]
+ private Gtk.CheckButton desktop_background_checkbox;
+ [GtkChild]
+ private Gtk.CheckButton screensaver_checkbox;
+
+ public SetBackgroundPhotoDialog() {
+ Object(use_header_bar: Resources.use_header_bar());
+ this.set_transient_for (AppWindow.get_instance());
+ }
+
+ [GtkCallback]
+ private void on_checkbox_clicked() {
+ set_response_sensitive (Gtk.ResponseType.OK,
+ desktop_background_checkbox.active ||
+ screensaver_checkbox.active);
+ }
+
+ public bool execute(out bool desktop_background, out bool screensaver) {
+ this.show_all();
+ var result = this.run() == Gtk.ResponseType.OK;
+ this.hide ();
+
+ desktop_background = desktop_background_checkbox.active;
+ screensaver = screensaver_checkbox.active;
+
+ this.destroy();
+ return result;
+ }
+}
diff --git a/src/dialogs/SetBackgroundSlideshow.c b/src/dialogs/SetBackgroundSlideshow.c
new file mode 100644
index 0000000..aa581d4
--- /dev/null
+++ b/src/dialogs/SetBackgroundSlideshow.c
@@ -0,0 +1,499 @@
+/* SetBackgroundSlideshow.c generated by valac 0.40.4, the Vala compiler
+ * generated from SetBackgroundSlideshow.vala, do not modify */
+
+/* Copyright 2016 Software Freedom Conservancy Inc.
+ * Copyright 2017 Jens Georg <mail@jensge.org>
+ *
+ * This software is licensed under the GNU LGPL (version 2.1 or later).
+ * See the COPYING file in this distribution.
+ */
+
+
+#include <glib.h>
+#include <glib-object.h>
+#include <gtk/gtk.h>
+#include <float.h>
+#include <math.h>
+#include <stdlib.h>
+#include <string.h>
+#include <glib/gi18n-lib.h>
+
+
+#define TYPE_SET_BACKGROUND_SLIDESHOW_DIALOG (set_background_slideshow_dialog_get_type ())
+#define SET_BACKGROUND_SLIDESHOW_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SET_BACKGROUND_SLIDESHOW_DIALOG, SetBackgroundSlideshowDialog))
+#define SET_BACKGROUND_SLIDESHOW_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SET_BACKGROUND_SLIDESHOW_DIALOG, SetBackgroundSlideshowDialogClass))
+#define IS_SET_BACKGROUND_SLIDESHOW_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SET_BACKGROUND_SLIDESHOW_DIALOG))
+#define IS_SET_BACKGROUND_SLIDESHOW_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SET_BACKGROUND_SLIDESHOW_DIALOG))
+#define SET_BACKGROUND_SLIDESHOW_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SET_BACKGROUND_SLIDESHOW_DIALOG, SetBackgroundSlideshowDialogClass))
+
+typedef struct _SetBackgroundSlideshowDialog SetBackgroundSlideshowDialog;
+typedef struct _SetBackgroundSlideshowDialogClass SetBackgroundSlideshowDialogClass;
+typedef struct _SetBackgroundSlideshowDialogPrivate SetBackgroundSlideshowDialogPrivate;
+enum {
+ SET_BACKGROUND_SLIDESHOW_DIALOG_0_PROPERTY,
+ SET_BACKGROUND_SLIDESHOW_DIALOG_NUM_PROPERTIES
+};
+static GParamSpec* set_background_slideshow_dialog_properties[SET_BACKGROUND_SLIDESHOW_DIALOG_NUM_PROPERTIES];
+#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
+
+#define TYPE_PAGE_WINDOW (page_window_get_type ())
+#define PAGE_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PAGE_WINDOW, PageWindow))
+#define PAGE_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PAGE_WINDOW, PageWindowClass))
+#define IS_PAGE_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PAGE_WINDOW))
+#define IS_PAGE_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PAGE_WINDOW))
+#define PAGE_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PAGE_WINDOW, PageWindowClass))
+
+typedef struct _PageWindow PageWindow;
+typedef struct _PageWindowClass PageWindowClass;
+
+#define TYPE_APP_WINDOW (app_window_get_type ())
+#define APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_APP_WINDOW, AppWindow))
+#define APP_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_APP_WINDOW, AppWindowClass))
+#define IS_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_APP_WINDOW))
+#define IS_APP_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_APP_WINDOW))
+#define APP_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_APP_WINDOW, AppWindowClass))
+
+typedef struct _AppWindow AppWindow;
+typedef struct _AppWindowClass AppWindowClass;
+#define _g_free0(var) (var = (g_free (var), NULL))
+
+struct _SetBackgroundSlideshowDialog {
+ GtkDialog parent_instance;
+ SetBackgroundSlideshowDialogPrivate * priv;
+};
+
+struct _SetBackgroundSlideshowDialogClass {
+ GtkDialogClass parent_class;
+};
+
+struct _SetBackgroundSlideshowDialogPrivate {
+ GtkCheckButton* desktop_background_checkbox;
+ GtkCheckButton* screensaver_checkbox;
+ GtkScale* delay_scale;
+ GtkLabel* delay_value_label;
+ gint delay_value;
+};
+
+
+static gpointer set_background_slideshow_dialog_parent_class = NULL;
+
+GType set_background_slideshow_dialog_get_type (void) G_GNUC_CONST;
+#define SET_BACKGROUND_SLIDESHOW_DIALOG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_SET_BACKGROUND_SLIDESHOW_DIALOG, SetBackgroundSlideshowDialogPrivate))
+SetBackgroundSlideshowDialog* set_background_slideshow_dialog_new (void);
+SetBackgroundSlideshowDialog* set_background_slideshow_dialog_construct (GType object_type);
+gint resources_use_header_bar (void);
+GType page_window_get_type (void) G_GNUC_CONST;
+GType app_window_get_type (void) G_GNUC_CONST;
+AppWindow* app_window_get_instance (void);
+static void set_background_slideshow_dialog_real_constructed (GObject* base);
+static void set_background_slideshow_dialog_on_delay_scale_value_changed (SetBackgroundSlideshowDialog* self);
+static void set_background_slideshow_dialog_on_checkbox_clicked (SetBackgroundSlideshowDialog* self);
+static void _set_background_slideshow_dialog_on_checkbox_clicked_gtk_toggle_button_toggled (GtkToggleButton* _sender,
+ gpointer self);
+static void _set_background_slideshow_dialog_on_delay_scale_value_changed_gtk_range_value_changed (GtkRange* _sender,
+ gpointer self);
+gboolean set_background_slideshow_dialog_execute (SetBackgroundSlideshowDialog* self,
+ gint* delay_value,
+ gboolean* desktop_background,
+ gboolean* screensaver);
+static void set_background_slideshow_dialog_finalize (GObject * obj);
+
+
+SetBackgroundSlideshowDialog*
+set_background_slideshow_dialog_construct (GType object_type)
+{
+ SetBackgroundSlideshowDialog * self = NULL;
+ AppWindow* _tmp0_;
+ AppWindow* _tmp1_;
+#line 22 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ self = (SetBackgroundSlideshowDialog*) g_object_new (object_type, "use-header-bar", resources_use_header_bar (), NULL);
+#line 23 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _tmp0_ = app_window_get_instance ();
+#line 23 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _tmp1_ = _tmp0_;
+#line 23 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ gtk_window_set_transient_for (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_window_get_type (), GtkWindow));
+#line 23 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _g_object_unref0 (_tmp1_);
+#line 21 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ return self;
+#line 121 "SetBackgroundSlideshow.c"
+}
+
+
+SetBackgroundSlideshowDialog*
+set_background_slideshow_dialog_new (void)
+{
+#line 21 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ return set_background_slideshow_dialog_construct (TYPE_SET_BACKGROUND_SLIDESHOW_DIALOG);
+#line 130 "SetBackgroundSlideshow.c"
+}
+
+
+static void
+set_background_slideshow_dialog_real_constructed (GObject* base)
+{
+ SetBackgroundSlideshowDialog * self;
+#line 26 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_SET_BACKGROUND_SLIDESHOW_DIALOG, SetBackgroundSlideshowDialog);
+#line 27 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ set_background_slideshow_dialog_on_delay_scale_value_changed (self);
+#line 142 "SetBackgroundSlideshow.c"
+}
+
+
+static void
+set_background_slideshow_dialog_on_checkbox_clicked (SetBackgroundSlideshowDialog* self)
+{
+ gboolean _tmp0_ = FALSE;
+ GtkCheckButton* _tmp1_;
+ gboolean _tmp2_;
+ gboolean _tmp3_;
+#line 31 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ g_return_if_fail (IS_SET_BACKGROUND_SLIDESHOW_DIALOG (self));
+#line 33 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _tmp1_ = self->priv->desktop_background_checkbox;
+#line 33 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _tmp2_ = gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_toggle_button_get_type (), GtkToggleButton));
+#line 33 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _tmp3_ = _tmp2_;
+#line 33 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ if (_tmp3_) {
+#line 33 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _tmp0_ = TRUE;
+#line 165 "SetBackgroundSlideshow.c"
+ } else {
+ GtkCheckButton* _tmp4_;
+ gboolean _tmp5_;
+ gboolean _tmp6_;
+#line 34 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _tmp4_ = self->priv->screensaver_checkbox;
+#line 34 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _tmp5_ = gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_toggle_button_get_type (), GtkToggleButton));
+#line 34 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _tmp6_ = _tmp5_;
+#line 34 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _tmp0_ = _tmp6_;
+#line 178 "SetBackgroundSlideshow.c"
+ }
+#line 32 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ gtk_dialog_set_response_sensitive (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_dialog_get_type (), GtkDialog), (gint) GTK_RESPONSE_OK, _tmp0_);
+#line 182 "SetBackgroundSlideshow.c"
+}
+
+
+static void
+_set_background_slideshow_dialog_on_checkbox_clicked_gtk_toggle_button_toggled (GtkToggleButton* _sender,
+ gpointer self)
+{
+#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ set_background_slideshow_dialog_on_checkbox_clicked ((SetBackgroundSlideshowDialog*) self);
+#line 192 "SetBackgroundSlideshow.c"
+}
+
+
+static void
+set_background_slideshow_dialog_on_delay_scale_value_changed (SetBackgroundSlideshowDialog* self)
+{
+ gdouble value = 0.0;
+ GtkScale* _tmp0_;
+ GtkAdjustment* _tmp1_;
+ GtkAdjustment* _tmp2_;
+ gdouble _tmp3_;
+ gdouble _tmp4_;
+ gdouble _tmp5_;
+ gchar* text = NULL;
+ gint _tmp6_;
+ GtkLabel* _tmp23_;
+ const gchar* _tmp24_;
+#line 38 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ g_return_if_fail (IS_SET_BACKGROUND_SLIDESHOW_DIALOG (self));
+#line 39 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _tmp0_ = self->priv->delay_scale;
+#line 39 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _tmp1_ = gtk_range_get_adjustment (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_range_get_type (), GtkRange));
+#line 39 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _tmp2_ = _tmp1_;
+#line 39 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _tmp3_ = gtk_adjustment_get_value (_tmp2_);
+#line 39 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _tmp4_ = _tmp3_;
+#line 39 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ value = _tmp4_;
+#line 44 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _tmp5_ = value;
+#line 44 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ self->priv->delay_value = (gint) (((((pow (_tmp5_, (gdouble) 5) / pow ((gdouble) 90, (gdouble) 5)) * 60) * 60) * 24) + 5);
+#line 48 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _tmp6_ = self->priv->delay_value;
+#line 48 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ if (_tmp6_ < 60) {
+#line 232 "SetBackgroundSlideshow.c"
+ gint _tmp7_;
+ gint _tmp8_;
+ gchar* _tmp9_;
+#line 49 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _tmp7_ = self->priv->delay_value;
+#line 49 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _tmp8_ = self->priv->delay_value;
+#line 49 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _tmp9_ = g_strdup_printf (ngettext ("%d second", "%d seconds", (gulong) _tmp7_), _tmp8_);
+#line 49 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _g_free0 (text);
+#line 49 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ text = _tmp9_;
+#line 246 "SetBackgroundSlideshow.c"
+ } else {
+ gint _tmp10_;
+#line 50 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _tmp10_ = self->priv->delay_value;
+#line 50 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ if (_tmp10_ < (60 * 60)) {
+#line 253 "SetBackgroundSlideshow.c"
+ gint minutes = 0;
+ gint _tmp11_;
+ gint _tmp12_;
+ gint _tmp13_;
+ gchar* _tmp14_;
+ gint _tmp15_;
+#line 51 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _tmp11_ = self->priv->delay_value;
+#line 51 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ minutes = _tmp11_ / 60;
+#line 52 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _tmp12_ = minutes;
+#line 52 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _tmp13_ = minutes;
+#line 52 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _tmp14_ = g_strdup_printf (ngettext ("%d minute", "%d minutes", (gulong) _tmp12_), _tmp13_);
+#line 52 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _g_free0 (text);
+#line 52 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ text = _tmp14_;
+#line 53 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _tmp15_ = minutes;
+#line 53 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ self->priv->delay_value = _tmp15_ * 60;
+#line 278 "SetBackgroundSlideshow.c"
+ } else {
+ gint _tmp16_;
+#line 54 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _tmp16_ = self->priv->delay_value;
+#line 54 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ if (_tmp16_ < ((60 * 60) * 24)) {
+#line 285 "SetBackgroundSlideshow.c"
+ gint hours = 0;
+ gint _tmp17_;
+ gint _tmp18_;
+ gint _tmp19_;
+ gchar* _tmp20_;
+ gint _tmp21_;
+#line 55 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _tmp17_ = self->priv->delay_value;
+#line 55 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ hours = _tmp17_ / (60 * 60);
+#line 56 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _tmp18_ = hours;
+#line 56 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _tmp19_ = hours;
+#line 56 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _tmp20_ = g_strdup_printf (ngettext ("%d hour", "%d hours", (gulong) _tmp18_), _tmp19_);
+#line 56 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _g_free0 (text);
+#line 56 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ text = _tmp20_;
+#line 57 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _tmp21_ = hours;
+#line 57 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ self->priv->delay_value = _tmp21_ * (60 * 60);
+#line 310 "SetBackgroundSlideshow.c"
+ } else {
+ gchar* _tmp22_;
+#line 59 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _tmp22_ = g_strdup (_ ("1 day"));
+#line 59 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _g_free0 (text);
+#line 59 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ text = _tmp22_;
+#line 60 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ self->priv->delay_value = (60 * 60) * 24;
+#line 321 "SetBackgroundSlideshow.c"
+ }
+ }
+ }
+#line 63 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _tmp23_ = self->priv->delay_value_label;
+#line 63 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _tmp24_ = text;
+#line 63 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ gtk_label_set_label (_tmp23_, _tmp24_);
+#line 38 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _g_free0 (text);
+#line 333 "SetBackgroundSlideshow.c"
+}
+
+
+static void
+_set_background_slideshow_dialog_on_delay_scale_value_changed_gtk_range_value_changed (GtkRange* _sender,
+ gpointer self)
+{
+#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ set_background_slideshow_dialog_on_delay_scale_value_changed ((SetBackgroundSlideshowDialog*) self);
+#line 343 "SetBackgroundSlideshow.c"
+}
+
+
+gboolean
+set_background_slideshow_dialog_execute (SetBackgroundSlideshowDialog* self,
+ gint* delay_value,
+ gboolean* desktop_background,
+ gboolean* screensaver)
+{
+ gint _vala_delay_value = 0;
+ gboolean _vala_desktop_background = FALSE;
+ gboolean _vala_screensaver = FALSE;
+ gboolean result = FALSE;
+ gboolean _result_ = FALSE;
+ gint _tmp0_;
+ GtkCheckButton* _tmp1_;
+ gboolean _tmp2_;
+ gboolean _tmp3_;
+ GtkCheckButton* _tmp4_;
+ gboolean _tmp5_;
+ gboolean _tmp6_;
+#line 66 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ g_return_val_if_fail (IS_SET_BACKGROUND_SLIDESHOW_DIALOG (self), FALSE);
+#line 67 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ gtk_widget_show_all (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
+#line 68 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _result_ = gtk_dialog_run (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_dialog_get_type (), GtkDialog)) == ((gint) GTK_RESPONSE_OK);
+#line 69 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ gtk_widget_hide (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
+#line 71 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _tmp0_ = self->priv->delay_value;
+#line 71 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _vala_delay_value = _tmp0_;
+#line 72 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _tmp1_ = self->priv->desktop_background_checkbox;
+#line 72 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _tmp2_ = gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_toggle_button_get_type (), GtkToggleButton));
+#line 72 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _tmp3_ = _tmp2_;
+#line 72 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _vala_desktop_background = _tmp3_;
+#line 73 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _tmp4_ = self->priv->screensaver_checkbox;
+#line 73 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _tmp5_ = gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_toggle_button_get_type (), GtkToggleButton));
+#line 73 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _tmp6_ = _tmp5_;
+#line 73 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _vala_screensaver = _tmp6_;
+#line 75 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ gtk_widget_destroy (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
+#line 76 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ result = _result_;
+#line 76 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ if (delay_value) {
+#line 76 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ *delay_value = _vala_delay_value;
+#line 401 "SetBackgroundSlideshow.c"
+ }
+#line 76 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ if (desktop_background) {
+#line 76 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ *desktop_background = _vala_desktop_background;
+#line 407 "SetBackgroundSlideshow.c"
+ }
+#line 76 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ if (screensaver) {
+#line 76 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ *screensaver = _vala_screensaver;
+#line 413 "SetBackgroundSlideshow.c"
+ }
+#line 76 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ return result;
+#line 417 "SetBackgroundSlideshow.c"
+}
+
+
+static void
+set_background_slideshow_dialog_class_init (SetBackgroundSlideshowDialogClass * klass)
+{
+ gint SetBackgroundSlideshowDialog_private_offset;
+#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ set_background_slideshow_dialog_parent_class = g_type_class_peek_parent (klass);
+#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ g_type_class_add_private (klass, sizeof (SetBackgroundSlideshowDialogPrivate));
+#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ ((GObjectClass *) klass)->constructed = (void (*) (GObject *)) set_background_slideshow_dialog_real_constructed;
+#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ G_OBJECT_CLASS (klass)->finalize = set_background_slideshow_dialog_finalize;
+#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ SetBackgroundSlideshowDialog_private_offset = g_type_class_get_instance_private_offset (klass);
+#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/Shotwell/ui/set_background_slideshow_dialog.ui");
+#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "desktop_background_checkbox", FALSE, SetBackgroundSlideshowDialog_private_offset + G_STRUCT_OFFSET (SetBackgroundSlideshowDialogPrivate, desktop_background_checkbox));
+#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "screensaver_checkbox", FALSE, SetBackgroundSlideshowDialog_private_offset + G_STRUCT_OFFSET (SetBackgroundSlideshowDialogPrivate, screensaver_checkbox));
+#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "delay_scale", FALSE, SetBackgroundSlideshowDialog_private_offset + G_STRUCT_OFFSET (SetBackgroundSlideshowDialogPrivate, delay_scale));
+#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "delay_value_label", FALSE, SetBackgroundSlideshowDialog_private_offset + G_STRUCT_OFFSET (SetBackgroundSlideshowDialogPrivate, delay_value_label));
+#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_checkbox_clicked", G_CALLBACK(_set_background_slideshow_dialog_on_checkbox_clicked_gtk_toggle_button_toggled));
+#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_delay_scale_value_changed", G_CALLBACK(_set_background_slideshow_dialog_on_delay_scale_value_changed_gtk_range_value_changed));
+#line 449 "SetBackgroundSlideshow.c"
+}
+
+
+static void
+set_background_slideshow_dialog_instance_init (SetBackgroundSlideshowDialog * self)
+{
+#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ self->priv = SET_BACKGROUND_SLIDESHOW_DIALOG_GET_PRIVATE (self);
+#line 19 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ self->priv->delay_value = 0;
+#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ gtk_widget_init_template (GTK_WIDGET (self));
+#line 462 "SetBackgroundSlideshow.c"
+}
+
+
+static void
+set_background_slideshow_dialog_finalize (GObject * obj)
+{
+ SetBackgroundSlideshowDialog * self;
+#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_SET_BACKGROUND_SLIDESHOW_DIALOG, SetBackgroundSlideshowDialog);
+#line 11 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _g_object_unref0 (self->priv->desktop_background_checkbox);
+#line 13 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _g_object_unref0 (self->priv->screensaver_checkbox);
+#line 15 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _g_object_unref0 (self->priv->delay_scale);
+#line 17 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ _g_object_unref0 (self->priv->delay_value_label);
+#line 9 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala"
+ G_OBJECT_CLASS (set_background_slideshow_dialog_parent_class)->finalize (obj);
+#line 482 "SetBackgroundSlideshow.c"
+}
+
+
+GType
+set_background_slideshow_dialog_get_type (void)
+{
+ static volatile gsize set_background_slideshow_dialog_type_id__volatile = 0;
+ if (g_once_init_enter (&set_background_slideshow_dialog_type_id__volatile)) {
+ static const GTypeInfo g_define_type_info = { sizeof (SetBackgroundSlideshowDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) set_background_slideshow_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SetBackgroundSlideshowDialog), 0, (GInstanceInitFunc) set_background_slideshow_dialog_instance_init, NULL };
+ GType set_background_slideshow_dialog_type_id;
+ set_background_slideshow_dialog_type_id = g_type_register_static (gtk_dialog_get_type (), "SetBackgroundSlideshowDialog", &g_define_type_info, 0);
+ g_once_init_leave (&set_background_slideshow_dialog_type_id__volatile, set_background_slideshow_dialog_type_id);
+ }
+ return set_background_slideshow_dialog_type_id__volatile;
+}
+
+
+
diff --git a/src/dialogs/SetBackgroundSlideshow.vala b/src/dialogs/SetBackgroundSlideshow.vala
new file mode 100644
index 0000000..914af76
--- /dev/null
+++ b/src/dialogs/SetBackgroundSlideshow.vala
@@ -0,0 +1,78 @@
+/* Copyright 2016 Software Freedom Conservancy Inc.
+ * Copyright 2017 Jens Georg <mail@jensge.org>
+ *
+ * This software is licensed under the GNU LGPL (version 2.1 or later).
+ * See the COPYING file in this distribution.
+ */
+
+[GtkTemplate (ui = "/org/gnome/Shotwell/ui/set_background_slideshow_dialog.ui")]
+public class SetBackgroundSlideshowDialog : Gtk.Dialog {
+ [GtkChild]
+ private Gtk.CheckButton desktop_background_checkbox;
+ [GtkChild]
+ private Gtk.CheckButton screensaver_checkbox;
+ [GtkChild]
+ private Gtk.Scale delay_scale;
+ [GtkChild]
+ private Gtk.Label delay_value_label;
+
+ private int delay_value = 0;
+
+ public SetBackgroundSlideshowDialog() {
+ Object(use_header_bar: Resources.use_header_bar());
+ this.set_transient_for (AppWindow.get_instance());
+ }
+
+ public override void constructed () {
+ on_delay_scale_value_changed ();
+ }
+
+ [GtkCallback]
+ private void on_checkbox_clicked() {
+ set_response_sensitive (Gtk.ResponseType.OK,
+ desktop_background_checkbox.active ||
+ screensaver_checkbox.active);
+ }
+
+ [GtkCallback]
+ private void on_delay_scale_value_changed() {
+ double value = delay_scale.adjustment.value;
+
+ // f(x)=x^5 allows to have fine-grained values (seconds) to the left
+ // and very coarse-grained values (hours) to the right of the slider.
+ // We limit maximum value to 1 day and minimum to 5 seconds.
+ delay_value = (int) (Math.pow(value, 5) / Math.pow(90, 5) * 60 * 60 * 24 + 5);
+
+ // convert to text and remove fractions from values > 1 minute
+ string text;
+ if (delay_value < 60) {
+ text = ngettext("%d second", "%d seconds", delay_value).printf(delay_value);
+ } else if (delay_value < 60 * 60) {
+ int minutes = delay_value / 60;
+ text = ngettext("%d minute", "%d minutes", minutes).printf(minutes);
+ delay_value = minutes * 60;
+ } else if (delay_value < 60 * 60 * 24) {
+ int hours = delay_value / (60 * 60);
+ text = ngettext("%d hour", "%d hours", hours).printf(hours);
+ delay_value = hours * (60 * 60);
+ } else {
+ text = _("1 day");
+ delay_value = 60 * 60 * 24;
+ }
+
+ delay_value_label.label = text;
+ }
+
+ public bool execute(out int delay_value, out bool desktop_background, out bool screensaver) {
+ this.show_all();
+ var result = this.run() == Gtk.ResponseType.OK;
+ this.hide ();
+
+ delay_value = this.delay_value;
+ desktop_background = desktop_background_checkbox.active;
+ screensaver = screensaver_checkbox.active;
+
+ this.destroy();
+ return result;
+ }
+}
diff --git a/src/dialogs/TextEntry.c b/src/dialogs/TextEntry.c
new file mode 100644
index 0000000..97716a3
--- /dev/null
+++ b/src/dialogs/TextEntry.c
@@ -0,0 +1,400 @@
+/* TextEntry.c generated by valac 0.40.4, the Vala compiler
+ * generated from TextEntry.vala, do not modify */
+
+/* Copyright 2016 Software Freedom Conservancy Inc.
+ * Copyright 2017 Jens Georg <mail@jensge.org>
+ *
+ * This software is licensed under the GNU LGPL (version 2.1 or later).
+ * See the COPYING file in this distribution.
+ */
+
+
+#include <glib.h>
+#include <glib-object.h>
+#include <gtk/gtk.h>
+#include <stdlib.h>
+#include <string.h>
+#include <gee.h>
+
+
+#define TYPE_TEXT_ENTRY_DIALOG (text_entry_dialog_get_type ())
+#define TEXT_ENTRY_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TEXT_ENTRY_DIALOG, TextEntryDialog))
+#define TEXT_ENTRY_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TEXT_ENTRY_DIALOG, TextEntryDialogClass))
+#define IS_TEXT_ENTRY_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TEXT_ENTRY_DIALOG))
+#define IS_TEXT_ENTRY_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TEXT_ENTRY_DIALOG))
+#define TEXT_ENTRY_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TEXT_ENTRY_DIALOG, TextEntryDialogClass))
+
+typedef struct _TextEntryDialog TextEntryDialog;
+typedef struct _TextEntryDialogClass TextEntryDialogClass;
+typedef struct _TextEntryDialogPrivate TextEntryDialogPrivate;
+enum {
+ TEXT_ENTRY_DIALOG_0_PROPERTY,
+ TEXT_ENTRY_DIALOG_NUM_PROPERTIES
+};
+static GParamSpec* text_entry_dialog_properties[TEXT_ENTRY_DIALOG_NUM_PROPERTIES];
+#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
+
+#define TYPE_PAGE_WINDOW (page_window_get_type ())
+#define PAGE_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PAGE_WINDOW, PageWindow))
+#define PAGE_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PAGE_WINDOW, PageWindowClass))
+#define IS_PAGE_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PAGE_WINDOW))
+#define IS_PAGE_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PAGE_WINDOW))
+#define PAGE_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PAGE_WINDOW, PageWindowClass))
+
+typedef struct _PageWindow PageWindow;
+typedef struct _PageWindowClass PageWindowClass;
+
+#define TYPE_APP_WINDOW (app_window_get_type ())
+#define APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_APP_WINDOW, AppWindow))
+#define APP_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_APP_WINDOW, AppWindowClass))
+#define IS_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_APP_WINDOW))
+#define IS_APP_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_APP_WINDOW))
+#define APP_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_APP_WINDOW, AppWindowClass))
+
+typedef struct _AppWindow AppWindow;
+typedef struct _AppWindowClass AppWindowClass;
+
+#define TYPE_ENTRY_MULTI_COMPLETION (entry_multi_completion_get_type ())
+#define ENTRY_MULTI_COMPLETION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ENTRY_MULTI_COMPLETION, EntryMultiCompletion))
+#define ENTRY_MULTI_COMPLETION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ENTRY_MULTI_COMPLETION, EntryMultiCompletionClass))
+#define IS_ENTRY_MULTI_COMPLETION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ENTRY_MULTI_COMPLETION))
+#define IS_ENTRY_MULTI_COMPLETION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ENTRY_MULTI_COMPLETION))
+#define ENTRY_MULTI_COMPLETION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ENTRY_MULTI_COMPLETION, EntryMultiCompletionClass))
+
+typedef struct _EntryMultiCompletion EntryMultiCompletion;
+typedef struct _EntryMultiCompletionClass EntryMultiCompletionClass;
+#define _g_free0(var) (var = (g_free (var), NULL))
+
+struct _TextEntryDialog {
+ GtkDialog parent_instance;
+ TextEntryDialogPrivate * priv;
+};
+
+struct _TextEntryDialogClass {
+ GtkDialogClass parent_class;
+};
+
+typedef gboolean (*TextEntryDialogOnModifyValidateType) (const gchar* text, void* user_data);
+struct _TextEntryDialogPrivate {
+ TextEntryDialogOnModifyValidateType on_modify_validate;
+ gpointer on_modify_validate_target;
+ GtkEntry* entry;
+ GtkLabel* label;
+};
+
+
+static gpointer text_entry_dialog_parent_class = NULL;
+
+GType text_entry_dialog_get_type (void) G_GNUC_CONST;
+#define TEXT_ENTRY_DIALOG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_TEXT_ENTRY_DIALOG, TextEntryDialogPrivate))
+TextEntryDialog* text_entry_dialog_new (void);
+TextEntryDialog* text_entry_dialog_construct (GType object_type);
+gint resources_use_header_bar (void);
+void text_entry_dialog_setup (TextEntryDialog* self,
+ TextEntryDialogOnModifyValidateType modify_validate,
+ void* modify_validate_target,
+ const gchar* title,
+ const gchar* label,
+ const gchar* initial_text,
+ GeeCollection* completion_list,
+ const gchar* completion_delimiter);
+GType page_window_get_type (void) G_GNUC_CONST;
+GType app_window_get_type (void) G_GNUC_CONST;
+AppWindow* app_window_get_instance (void);
+void text_entry_dialog_on_entry_changed (TextEntryDialog* self);
+static void _text_entry_dialog_on_entry_changed_gtk_editable_changed (GtkEditable* _sender,
+ gpointer self);
+GType entry_multi_completion_get_type (void) G_GNUC_CONST;
+EntryMultiCompletion* entry_multi_completion_new (GeeCollection* completion_list,
+ const gchar* delimiter);
+EntryMultiCompletion* entry_multi_completion_construct (GType object_type,
+ GeeCollection* completion_list,
+ const gchar* delimiter);
+gchar* text_entry_dialog_execute (TextEntryDialog* self);
+static void text_entry_dialog_finalize (GObject * obj);
+
+
+TextEntryDialog*
+text_entry_dialog_construct (GType object_type)
+{
+ TextEntryDialog * self = NULL;
+#line 21 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ self = (TextEntryDialog*) g_object_new (object_type, "use-header-bar", resources_use_header_bar (), NULL);
+#line 20 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ return self;
+#line 126 "TextEntry.c"
+}
+
+
+TextEntryDialog*
+text_entry_dialog_new (void)
+{
+#line 20 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ return text_entry_dialog_construct (TYPE_TEXT_ENTRY_DIALOG);
+#line 135 "TextEntry.c"
+}
+
+
+static void
+_text_entry_dialog_on_entry_changed_gtk_editable_changed (GtkEditable* _sender,
+ gpointer self)
+{
+#line 35 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ text_entry_dialog_on_entry_changed ((TextEntryDialog*) self);
+#line 145 "TextEntry.c"
+}
+
+
+void
+text_entry_dialog_setup (TextEntryDialog* self,
+ TextEntryDialogOnModifyValidateType modify_validate,
+ void* modify_validate_target,
+ const gchar* title,
+ const gchar* label,
+ const gchar* initial_text,
+ GeeCollection* completion_list,
+ const gchar* completion_delimiter)
+{
+ AppWindow* _tmp0_;
+ AppWindow* _tmp1_;
+ GdkWindow* _tmp2_;
+ AppWindow* _tmp3_;
+ AppWindow* _tmp4_;
+ GtkLabel* _tmp5_;
+ const gchar* _tmp6_ = NULL;
+ GtkEntry* _tmp7_;
+ GtkEntry* _tmp8_;
+ GtkEntry* _tmp9_;
+#line 24 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ g_return_if_fail (IS_TEXT_ENTRY_DIALOG (self));
+#line 24 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ g_return_if_fail (title != NULL);
+#line 24 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ g_return_if_fail (label != NULL);
+#line 24 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ g_return_if_fail ((completion_list == NULL) || GEE_IS_COLLECTION (completion_list));
+#line 26 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ gtk_window_set_title (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), title);
+#line 27 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ _tmp0_ = app_window_get_instance ();
+#line 27 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ _tmp1_ = _tmp0_;
+#line 27 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ _tmp2_ = gtk_widget_get_parent_window (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_widget_get_type (), GtkWidget));
+#line 27 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ gtk_widget_set_parent_window (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), _tmp2_);
+#line 27 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ _g_object_unref0 (_tmp1_);
+#line 28 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ _tmp3_ = app_window_get_instance ();
+#line 28 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ _tmp4_ = _tmp3_;
+#line 28 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ gtk_window_set_transient_for (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_window_get_type (), GtkWindow));
+#line 28 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ _g_object_unref0 (_tmp4_);
+#line 29 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ self->priv->on_modify_validate = modify_validate;
+#line 29 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ self->priv->on_modify_validate_target = modify_validate_target;
+#line 31 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ _tmp5_ = self->priv->label;
+#line 31 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ gtk_label_set_text (_tmp5_, label);
+#line 33 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ if (initial_text != NULL) {
+#line 33 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ _tmp6_ = initial_text;
+#line 209 "TextEntry.c"
+ } else {
+#line 33 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ _tmp6_ = "";
+#line 213 "TextEntry.c"
+ }
+#line 33 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ _tmp7_ = self->priv->entry;
+#line 33 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ gtk_entry_set_text (_tmp7_, _tmp6_);
+#line 34 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ _tmp8_ = self->priv->entry;
+#line 34 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ gtk_widget_grab_focus (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, gtk_widget_get_type (), GtkWidget));
+#line 35 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ _tmp9_ = self->priv->entry;
+#line 35 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, gtk_editable_get_type (), GtkEditable), "changed", (GCallback) _text_entry_dialog_on_entry_changed_gtk_editable_changed, self, 0);
+#line 37 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ if (completion_list != NULL) {
+#line 229 "TextEntry.c"
+ EntryMultiCompletion* completion = NULL;
+ EntryMultiCompletion* _tmp10_;
+ GtkEntry* _tmp11_;
+ EntryMultiCompletion* _tmp12_;
+#line 38 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ _tmp10_ = entry_multi_completion_new (completion_list, completion_delimiter);
+#line 38 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ completion = _tmp10_;
+#line 40 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ _tmp11_ = self->priv->entry;
+#line 40 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ _tmp12_ = completion;
+#line 40 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ gtk_entry_set_completion (_tmp11_, G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, gtk_entry_completion_get_type (), GtkEntryCompletion));
+#line 37 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ _g_object_unref0 (completion);
+#line 246 "TextEntry.c"
+ }
+#line 43 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ gtk_dialog_set_default_response (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_dialog_get_type (), GtkDialog), (gint) GTK_RESPONSE_OK);
+#line 250 "TextEntry.c"
+}
+
+
+gchar*
+text_entry_dialog_execute (TextEntryDialog* self)
+{
+ gchar* result = NULL;
+ gchar* text = NULL;
+ TextEntryDialogOnModifyValidateType _tmp0_;
+ void* _tmp0__target;
+ GtkEntry* _tmp1_;
+ const gchar* _tmp2_;
+ GtkEntry* _tmp6_;
+ guint _tmp7_;
+#line 46 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ g_return_val_if_fail (IS_TEXT_ENTRY_DIALOG (self), NULL);
+#line 47 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ text = NULL;
+#line 50 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ _tmp0_ = self->priv->on_modify_validate;
+#line 50 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ _tmp0__target = self->priv->on_modify_validate_target;
+#line 50 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ _tmp1_ = self->priv->entry;
+#line 50 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ _tmp2_ = gtk_entry_get_text (_tmp1_);
+#line 50 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ gtk_dialog_set_response_sensitive (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_dialog_get_type (), GtkDialog), (gint) GTK_RESPONSE_OK, _tmp0_ (_tmp2_, _tmp0__target));
+#line 52 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ gtk_widget_show_all (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
+#line 54 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ if (gtk_dialog_run (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_dialog_get_type (), GtkDialog)) == ((gint) GTK_RESPONSE_OK)) {
+#line 283 "TextEntry.c"
+ GtkEntry* _tmp3_;
+ const gchar* _tmp4_;
+ gchar* _tmp5_;
+#line 55 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ _tmp3_ = self->priv->entry;
+#line 55 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ _tmp4_ = gtk_entry_get_text (_tmp3_);
+#line 55 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ _tmp5_ = g_strdup (_tmp4_);
+#line 55 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ _g_free0 (text);
+#line 55 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ text = _tmp5_;
+#line 297 "TextEntry.c"
+ }
+#line 57 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ _tmp6_ = self->priv->entry;
+#line 57 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ g_signal_parse_name ("changed", gtk_editable_get_type (), &_tmp7_, NULL, FALSE);
+#line 57 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, gtk_editable_get_type (), GtkEditable), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp7_, 0, NULL, (GCallback) _text_entry_dialog_on_entry_changed_gtk_editable_changed, self);
+#line 58 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ gtk_widget_destroy (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
+#line 60 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ result = text;
+#line 60 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ return result;
+#line 311 "TextEntry.c"
+}
+
+
+void
+text_entry_dialog_on_entry_changed (TextEntryDialog* self)
+{
+ TextEntryDialogOnModifyValidateType _tmp0_;
+ void* _tmp0__target;
+ GtkEntry* _tmp1_;
+ const gchar* _tmp2_;
+#line 63 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ g_return_if_fail (IS_TEXT_ENTRY_DIALOG (self));
+#line 64 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ _tmp0_ = self->priv->on_modify_validate;
+#line 64 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ _tmp0__target = self->priv->on_modify_validate_target;
+#line 64 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ _tmp1_ = self->priv->entry;
+#line 64 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ _tmp2_ = gtk_entry_get_text (_tmp1_);
+#line 64 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ gtk_dialog_set_response_sensitive (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_dialog_get_type (), GtkDialog), (gint) GTK_RESPONSE_OK, _tmp0_ (_tmp2_, _tmp0__target));
+#line 334 "TextEntry.c"
+}
+
+
+static void
+text_entry_dialog_class_init (TextEntryDialogClass * klass)
+{
+ gint TextEntryDialog_private_offset;
+#line 9 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ text_entry_dialog_parent_class = g_type_class_peek_parent (klass);
+#line 9 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ g_type_class_add_private (klass, sizeof (TextEntryDialogPrivate));
+#line 9 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ G_OBJECT_CLASS (klass)->finalize = text_entry_dialog_finalize;
+#line 9 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ TextEntryDialog_private_offset = g_type_class_get_instance_private_offset (klass);
+#line 9 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/Shotwell/ui/textentrydialog.ui");
+#line 9 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "entry", FALSE, TextEntryDialog_private_offset + G_STRUCT_OFFSET (TextEntryDialogPrivate, entry));
+#line 9 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "label", FALSE, TextEntryDialog_private_offset + G_STRUCT_OFFSET (TextEntryDialogPrivate, label));
+#line 356 "TextEntry.c"
+}
+
+
+static void
+text_entry_dialog_instance_init (TextEntryDialog * self)
+{
+#line 9 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ self->priv = TEXT_ENTRY_DIALOG_GET_PRIVATE (self);
+#line 9 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ gtk_widget_init_template (GTK_WIDGET (self));
+#line 367 "TextEntry.c"
+}
+
+
+static void
+text_entry_dialog_finalize (GObject * obj)
+{
+ TextEntryDialog * self;
+#line 9 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_TEXT_ENTRY_DIALOG, TextEntryDialog);
+#line 15 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ _g_object_unref0 (self->priv->entry);
+#line 18 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ _g_object_unref0 (self->priv->label);
+#line 9 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala"
+ G_OBJECT_CLASS (text_entry_dialog_parent_class)->finalize (obj);
+#line 383 "TextEntry.c"
+}
+
+
+GType
+text_entry_dialog_get_type (void)
+{
+ static volatile gsize text_entry_dialog_type_id__volatile = 0;
+ if (g_once_init_enter (&text_entry_dialog_type_id__volatile)) {
+ static const GTypeInfo g_define_type_info = { sizeof (TextEntryDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) text_entry_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TextEntryDialog), 0, (GInstanceInitFunc) text_entry_dialog_instance_init, NULL };
+ GType text_entry_dialog_type_id;
+ text_entry_dialog_type_id = g_type_register_static (gtk_dialog_get_type (), "TextEntryDialog", &g_define_type_info, 0);
+ g_once_init_leave (&text_entry_dialog_type_id__volatile, text_entry_dialog_type_id);
+ }
+ return text_entry_dialog_type_id__volatile;
+}
+
+
+
diff --git a/src/dialogs/TextEntry.vala b/src/dialogs/TextEntry.vala
new file mode 100644
index 0000000..d82fdbd
--- /dev/null
+++ b/src/dialogs/TextEntry.vala
@@ -0,0 +1,66 @@
+/* Copyright 2016 Software Freedom Conservancy Inc.
+ * Copyright 2017 Jens Georg <mail@jensge.org>
+ *
+ * This software is licensed under the GNU LGPL (version 2.1 or later).
+ * See the COPYING file in this distribution.
+ */
+
+[GtkTemplate (ui = "/org/gnome/Shotwell/ui/textentrydialog.ui")]
+public class TextEntryDialog : Gtk.Dialog {
+ public delegate bool OnModifyValidateType(string text);
+
+ private unowned OnModifyValidateType on_modify_validate;
+
+ [GtkChild]
+ private Gtk.Entry entry;
+
+ [GtkChild]
+ private Gtk.Label label;
+
+ public TextEntryDialog() {
+ Object (use_header_bar: Resources.use_header_bar());
+ }
+
+ public void setup(OnModifyValidateType? modify_validate, string title, string label,
+ string? initial_text, Gee.Collection<string>? completion_list, string? completion_delimiter) {
+ set_title(title);
+ set_parent_window(AppWindow.get_instance().get_parent_window());
+ set_transient_for(AppWindow.get_instance());
+ on_modify_validate = modify_validate;
+
+ this.label.set_text(label);
+
+ entry.set_text(initial_text != null ? initial_text : "");
+ entry.grab_focus();
+ entry.changed.connect(on_entry_changed);
+
+ if (completion_list != null) { // Textfield with autocompletion
+ EntryMultiCompletion completion = new EntryMultiCompletion(completion_list,
+ completion_delimiter);
+ entry.set_completion(completion);
+ }
+
+ set_default_response(Gtk.ResponseType.OK);
+ }
+
+ public string? execute() {
+ string? text = null;
+
+ // validate entry to start with
+ set_response_sensitive(Gtk.ResponseType.OK, on_modify_validate(entry.get_text()));
+
+ show_all();
+
+ if (run() == Gtk.ResponseType.OK)
+ text = entry.get_text();
+
+ entry.changed.disconnect(on_entry_changed);
+ destroy();
+
+ return text;
+ }
+
+ public void on_entry_changed() {
+ set_response_sensitive(Gtk.ResponseType.OK, on_modify_validate(entry.get_text()));
+ }
+}
diff --git a/src/dialogs/WelcomeDialog.c b/src/dialogs/WelcomeDialog.c
new file mode 100644
index 0000000..5cbd541
--- /dev/null
+++ b/src/dialogs/WelcomeDialog.c
@@ -0,0 +1,1432 @@
+/* WelcomeDialog.c generated by valac 0.40.4, the Vala compiler
+ * generated from WelcomeDialog.vala, do not modify */
+
+/* Copyright 2016 Software Freedom Conservancy Inc.
+ * Copyright 2017 Jens Georg <mail@jensge.org>
+ *
+ * This software is licensed under the GNU LGPL (version 2.1 or later).
+ * See the COPYING file in this distribution.
+ */
+
+
+#include <glib.h>
+#include <glib-object.h>
+#include <stdlib.h>
+#include <string.h>
+#include <gtk/gtk.h>
+#include <glib/gi18n-lib.h>
+#include <gdk/gdk.h>
+#include <gio/gio.h>
+
+
+#define TYPE_WELCOME_SERVICE_ENTRY (welcome_service_entry_get_type ())
+#define WELCOME_SERVICE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_WELCOME_SERVICE_ENTRY, WelcomeServiceEntry))
+#define IS_WELCOME_SERVICE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_WELCOME_SERVICE_ENTRY))
+#define WELCOME_SERVICE_ENTRY_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_WELCOME_SERVICE_ENTRY, WelcomeServiceEntryIface))
+
+typedef struct _WelcomeServiceEntry WelcomeServiceEntry;
+typedef struct _WelcomeServiceEntryIface WelcomeServiceEntryIface;
+
+#define TYPE_WELCOME_DIALOG (welcome_dialog_get_type ())
+#define WELCOME_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_WELCOME_DIALOG, WelcomeDialog))
+#define WELCOME_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_WELCOME_DIALOG, WelcomeDialogClass))
+#define IS_WELCOME_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_WELCOME_DIALOG))
+#define IS_WELCOME_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_WELCOME_DIALOG))
+#define WELCOME_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_WELCOME_DIALOG, WelcomeDialogClass))
+
+typedef struct _WelcomeDialog WelcomeDialog;
+typedef struct _WelcomeDialogClass WelcomeDialogClass;
+typedef struct _WelcomeDialogPrivate WelcomeDialogPrivate;
+
+#define SPIT_DATA_IMPORTS_TYPE_WELCOME_IMPORT_META_HOST (spit_data_imports_welcome_import_meta_host_get_type ())
+#define SPIT_DATA_IMPORTS_WELCOME_IMPORT_META_HOST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SPIT_DATA_IMPORTS_TYPE_WELCOME_IMPORT_META_HOST, SpitDataImportsWelcomeImportMetaHost))
+#define SPIT_DATA_IMPORTS_WELCOME_IMPORT_META_HOST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SPIT_DATA_IMPORTS_TYPE_WELCOME_IMPORT_META_HOST, SpitDataImportsWelcomeImportMetaHostClass))
+#define SPIT_DATA_IMPORTS_IS_WELCOME_IMPORT_META_HOST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SPIT_DATA_IMPORTS_TYPE_WELCOME_IMPORT_META_HOST))
+#define SPIT_DATA_IMPORTS_IS_WELCOME_IMPORT_META_HOST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SPIT_DATA_IMPORTS_TYPE_WELCOME_IMPORT_META_HOST))
+#define SPIT_DATA_IMPORTS_WELCOME_IMPORT_META_HOST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SPIT_DATA_IMPORTS_TYPE_WELCOME_IMPORT_META_HOST, SpitDataImportsWelcomeImportMetaHostClass))
+
+typedef struct _SpitDataImportsWelcomeImportMetaHost SpitDataImportsWelcomeImportMetaHost;
+typedef struct _SpitDataImportsWelcomeImportMetaHostClass SpitDataImportsWelcomeImportMetaHostClass;
+enum {
+ WELCOME_DIALOG_0_PROPERTY,
+ WELCOME_DIALOG_NUM_PROPERTIES
+};
+static GParamSpec* welcome_dialog_properties[WELCOME_DIALOG_NUM_PROPERTIES];
+#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
+#define _g_free0(var) (var = (g_free (var), NULL))
+#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
+
+struct _WelcomeServiceEntryIface {
+ GTypeInterface parent_iface;
+ gchar* (*get_service_name) (WelcomeServiceEntry* self);
+ void (*execute) (WelcomeServiceEntry* self);
+};
+
+struct _WelcomeDialog {
+ GtkDialog parent_instance;
+ WelcomeDialogPrivate * priv;
+};
+
+struct _WelcomeDialogClass {
+ GtkDialogClass parent_class;
+};
+
+struct _WelcomeDialogPrivate {
+ GtkCheckButton* hide_button;
+ GtkCheckButton* system_pictures_import_check;
+ GtkCheckButton** external_import_checks;
+ gint external_import_checks_length1;
+ gint _external_import_checks_size_;
+ WelcomeServiceEntry** external_import_entries;
+ gint external_import_entries_length1;
+ gint _external_import_entries_size_;
+ GtkLabel* secondary_text;
+ GtkLabel* instruction_header;
+ GtkBox* import_content;
+ GtkBox* import_action_checkbox_packer;
+ GtkBox* external_import_action_checkbox_packer;
+ SpitDataImportsWelcomeImportMetaHost* import_meta_host;
+ gboolean import_content_already_installed;
+ gboolean ok_clicked;
+};
+
+
+static gpointer welcome_dialog_parent_class = NULL;
+
+GType welcome_service_entry_get_type (void) G_GNUC_CONST;
+gchar* welcome_service_entry_get_service_name (WelcomeServiceEntry* self);
+void welcome_service_entry_execute (WelcomeServiceEntry* self);
+GType welcome_dialog_get_type (void) G_GNUC_CONST;
+GType spit_data_imports_welcome_import_meta_host_get_type (void) G_GNUC_CONST;
+#define WELCOME_DIALOG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_WELCOME_DIALOG, WelcomeDialogPrivate))
+WelcomeDialog* welcome_dialog_new (GtkWindow* owner);
+WelcomeDialog* welcome_dialog_construct (GType object_type,
+ GtkWindow* owner);
+gint resources_use_header_bar (void);
+SpitDataImportsWelcomeImportMetaHost* spit_data_imports_welcome_import_meta_host_new (WelcomeDialog* dialog);
+SpitDataImportsWelcomeImportMetaHost* spit_data_imports_welcome_import_meta_host_construct (GType object_type,
+ WelcomeDialog* dialog);
+static gboolean welcome_dialog_is_system_pictures_import_possible (void);
+#define RESOURCES_OK_LABEL _ ("_OK")
+gchar* get_display_pathname (GFile* file);
+GFile* app_dirs_get_import_dir (void);
+static void welcome_dialog_install_import_content (WelcomeDialog* self);
+void spit_data_imports_welcome_import_meta_host_start (SpitDataImportsWelcomeImportMetaHost* self);
+void welcome_dialog_install_service_entry (WelcomeDialog* self,
+ WelcomeServiceEntry* entry);
+static void _vala_array_add4 (WelcomeServiceEntry** * array,
+ int* length,
+ int* size,
+ WelcomeServiceEntry* value);
+static void _vala_array_add5 (GtkCheckButton** * array,
+ int* length,
+ int* size,
+ GtkCheckButton* value);
+static void welcome_dialog_on_dismiss (WelcomeDialog* self,
+ gint resp);
+gboolean welcome_dialog_execute (WelcomeDialog* self,
+ WelcomeServiceEntry*** selected_import_entries,
+ int* selected_import_entries_length1,
+ gboolean* do_system_pictures_import);
+static void _welcome_dialog_on_dismiss_gtk_dialog_response (GtkDialog* _sender,
+ gint response_id,
+ gpointer self);
+static void _vala_array_add6 (WelcomeServiceEntry** * array,
+ int* length,
+ int* size,
+ WelcomeServiceEntry* value);
+static WelcomeServiceEntry** _vala_array_dup1 (WelcomeServiceEntry** self,
+ int length);
+static void welcome_dialog_finalize (GObject * obj);
+static void _vala_array_destroy (gpointer array,
+ gint array_length,
+ GDestroyNotify destroy_func);
+static void _vala_array_free (gpointer array,
+ gint array_length,
+ GDestroyNotify destroy_func);
+
+
+gchar*
+welcome_service_entry_get_service_name (WelcomeServiceEntry* self)
+{
+#line 9 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ g_return_val_if_fail (IS_WELCOME_SERVICE_ENTRY (self), NULL);
+#line 9 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ return WELCOME_SERVICE_ENTRY_GET_INTERFACE (self)->get_service_name (self);
+#line 157 "WelcomeDialog.c"
+}
+
+
+void
+welcome_service_entry_execute (WelcomeServiceEntry* self)
+{
+#line 11 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ g_return_if_fail (IS_WELCOME_SERVICE_ENTRY (self));
+#line 11 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ WELCOME_SERVICE_ENTRY_GET_INTERFACE (self)->execute (self);
+#line 168 "WelcomeDialog.c"
+}
+
+
+static void
+welcome_service_entry_base_init (WelcomeServiceEntryIface * iface)
+{
+#line 8 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ static gboolean initialized = FALSE;
+#line 8 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ if (!initialized) {
+#line 8 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ initialized = TRUE;
+#line 181 "WelcomeDialog.c"
+ }
+}
+
+
+GType
+welcome_service_entry_get_type (void)
+{
+ static volatile gsize welcome_service_entry_type_id__volatile = 0;
+ if (g_once_init_enter (&welcome_service_entry_type_id__volatile)) {
+ static const GTypeInfo g_define_type_info = { sizeof (WelcomeServiceEntryIface), (GBaseInitFunc) welcome_service_entry_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
+ GType welcome_service_entry_type_id;
+ welcome_service_entry_type_id = g_type_register_static (G_TYPE_INTERFACE, "WelcomeServiceEntry", &g_define_type_info, 0);
+ g_type_interface_add_prerequisite (welcome_service_entry_type_id, G_TYPE_OBJECT);
+ g_once_init_leave (&welcome_service_entry_type_id__volatile, welcome_service_entry_type_id);
+ }
+ return welcome_service_entry_type_id__volatile;
+}
+
+
+static gpointer
+_g_object_ref0 (gpointer self)
+{
+#line 32 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ return self ? g_object_ref (self) : NULL;
+#line 206 "WelcomeDialog.c"
+}
+
+
+WelcomeDialog*
+welcome_dialog_construct (GType object_type,
+ GtkWindow* owner)
+{
+ WelcomeDialog * self = NULL;
+ SpitDataImportsWelcomeImportMetaHost* _tmp0_;
+ gboolean show_system_pictures_import = FALSE;
+ GtkWidget* ok_button = NULL;
+ GtkWidget* _tmp1_;
+ GtkWidget* _tmp2_;
+ GtkLabel* primary_text = NULL;
+ GtkLabel* _tmp3_;
+ GtkLabel* _tmp4_;
+ gchar* _tmp5_;
+ gchar* _tmp6_;
+ GtkLabel* _tmp7_;
+ GtkLabel* _tmp8_;
+ GtkLabel* _tmp9_;
+ GtkLabel* _tmp10_;
+ gchar* _tmp11_;
+ gchar* _tmp12_;
+ GtkLabel* _tmp13_;
+ GtkLabel* _tmp14_;
+ GtkImage* image = NULL;
+ GtkImage* _tmp15_;
+ GtkBox* header_text = NULL;
+ GtkBox* _tmp16_;
+ GtkBox* _tmp17_;
+ GtkLabel* _tmp18_;
+ GtkBox* _tmp19_;
+ GtkLabel* _tmp20_;
+ GtkBox* header_content = NULL;
+ GtkBox* _tmp21_;
+ GtkBox* _tmp22_;
+ GtkImage* _tmp23_;
+ GtkBox* _tmp24_;
+ GtkBox* _tmp25_;
+ GtkLabel* instructions = NULL;
+ GtkLabel* _tmp26_;
+ gchar* indent_prefix = NULL;
+ gchar* _tmp27_;
+ const gchar* _tmp28_ = NULL;
+ gchar* arrow_glyph = NULL;
+ gchar* _tmp29_;
+ GtkLabel* _tmp30_;
+ const gchar* _tmp31_;
+ gchar* _tmp32_;
+ gchar* _tmp33_;
+ const gchar* _tmp34_;
+ gchar* _tmp35_;
+ gchar* _tmp36_;
+ gchar* _tmp37_;
+ gchar* _tmp38_;
+ const gchar* _tmp39_;
+ gchar* _tmp40_;
+ gchar* _tmp41_;
+ gchar* _tmp42_;
+ gchar* _tmp43_;
+ const gchar* _tmp44_;
+ gchar* _tmp45_;
+ gchar* _tmp46_;
+ gchar* _tmp47_;
+ gchar* _tmp48_;
+ GtkLabel* _tmp49_;
+ GtkLabel* _tmp50_;
+ GtkBox* _tmp51_;
+ GtkBox* _tmp52_;
+ GtkBox* _tmp53_;
+ GtkBox* _tmp54_;
+ gboolean _tmp55_;
+ GtkLabel* _tmp66_;
+ GtkLabel* _tmp67_;
+ GtkLabel* _tmp68_;
+ GtkLabel* _tmp69_;
+ GtkBox* content = NULL;
+ GtkBox* _tmp70_;
+ GtkBox* _tmp71_;
+ GtkBox* _tmp72_;
+ GtkBox* _tmp73_;
+ GtkLabel* _tmp74_;
+ GtkCheckButton* _tmp75_;
+ GtkCheckButton* _tmp76_;
+ GtkCheckButton* _tmp77_;
+ GtkBox* _tmp78_;
+ GtkWidget* _tmp79_;
+ SpitDataImportsWelcomeImportMetaHost* _tmp80_;
+#line 28 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ g_return_val_if_fail (GTK_IS_WINDOW (owner), NULL);
+#line 29 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ self = (WelcomeDialog*) g_object_new (object_type, "use-header-bar", resources_use_header_bar (), NULL);
+#line 30 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp0_ = spit_data_imports_welcome_import_meta_host_new (self);
+#line 30 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_object_unref0 (self->priv->import_meta_host);
+#line 30 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ self->priv->import_meta_host = _tmp0_;
+#line 31 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ show_system_pictures_import = welcome_dialog_is_system_pictures_import_possible ();
+#line 32 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp1_ = gtk_dialog_add_button (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_dialog_get_type (), GtkDialog), RESOURCES_OK_LABEL, (gint) GTK_RESPONSE_CLOSE);
+#line 32 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp2_ = _g_object_ref0 (_tmp1_);
+#line 32 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ ok_button = _tmp2_;
+#line 33 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_dialog_set_default_response (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_dialog_get_type (), GtkDialog), (gint) GTK_RESPONSE_CLOSE);
+#line 35 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_window_set_title (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), _ ("Welcome!"));
+#line 36 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_window_set_resizable (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), FALSE);
+#line 37 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_window_set_type_hint (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), GDK_WINDOW_TYPE_HINT_DIALOG);
+#line 38 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_window_set_transient_for (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), owner);
+#line 40 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp3_ = (GtkLabel*) gtk_label_new ("");
+#line 40 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ g_object_ref_sink (_tmp3_);
+#line 40 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ primary_text = _tmp3_;
+#line 41 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp4_ = primary_text;
+#line 41 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp5_ = g_strdup_printf ("<span size=\"large\" weight=\"bold\">%s</span>", _ ("Welcome to Shotwell!"));
+#line 41 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp6_ = _tmp5_;
+#line 41 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_label_set_markup (_tmp4_, _tmp6_);
+#line 41 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_free0 (_tmp6_);
+#line 43 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp7_ = primary_text;
+#line 43 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_label_set_xalign (_tmp7_, 0.0f);
+#line 44 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp8_ = primary_text;
+#line 44 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_label_set_yalign (_tmp8_, 0.5f);
+#line 45 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp9_ = (GtkLabel*) gtk_label_new ("");
+#line 45 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ g_object_ref_sink (_tmp9_);
+#line 45 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_object_unref0 (self->priv->secondary_text);
+#line 45 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ self->priv->secondary_text = _tmp9_;
+#line 46 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp10_ = self->priv->secondary_text;
+#line 46 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp11_ = g_strdup_printf ("<span weight=\"normal\">%s</span>", _ ("To get started, import photos in any of these ways:"));
+#line 46 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp12_ = _tmp11_;
+#line 46 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_label_set_markup (_tmp10_, _tmp12_);
+#line 46 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_free0 (_tmp12_);
+#line 48 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp13_ = self->priv->secondary_text;
+#line 48 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_label_set_xalign (_tmp13_, 0.0f);
+#line 49 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp14_ = self->priv->secondary_text;
+#line 49 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_label_set_yalign (_tmp14_, 0.5f);
+#line 50 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp15_ = (GtkImage*) gtk_image_new_from_icon_name ("shotwell", (GtkIconSize) GTK_ICON_SIZE_DIALOG);
+#line 50 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ g_object_ref_sink (_tmp15_);
+#line 50 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ image = _tmp15_;
+#line 52 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp16_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+#line 52 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ g_object_ref_sink (_tmp16_);
+#line 52 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ header_text = _tmp16_;
+#line 53 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp17_ = header_text;
+#line 53 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp18_ = primary_text;
+#line 53 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_box_pack_start (_tmp17_, G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, gtk_widget_get_type (), GtkWidget), FALSE, FALSE, (guint) 5);
+#line 54 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp19_ = header_text;
+#line 54 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp20_ = self->priv->secondary_text;
+#line 54 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_box_pack_start (_tmp19_, G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, gtk_widget_get_type (), GtkWidget), FALSE, FALSE, (guint) 0);
+#line 56 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp21_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
+#line 56 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ g_object_ref_sink (_tmp21_);
+#line 56 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ header_content = _tmp21_;
+#line 57 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp22_ = header_content;
+#line 57 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp23_ = image;
+#line 57 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_box_pack_start (_tmp22_, G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, gtk_widget_get_type (), GtkWidget), FALSE, FALSE, (guint) 0);
+#line 58 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp24_ = header_content;
+#line 58 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp25_ = header_text;
+#line 58 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_box_pack_start (_tmp24_, G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, gtk_widget_get_type (), GtkWidget), FALSE, FALSE, (guint) 0);
+#line 60 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp26_ = (GtkLabel*) gtk_label_new ("");
+#line 60 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ g_object_ref_sink (_tmp26_);
+#line 60 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ instructions = _tmp26_;
+#line 61 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp27_ = g_strdup (" ");
+#line 61 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ indent_prefix = _tmp27_;
+#line 63 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ if (gtk_widget_get_direction (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget)) == GTK_TEXT_DIR_RTL) {
+#line 63 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp28_ = "◂";
+#line 430 "WelcomeDialog.c"
+ } else {
+#line 63 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp28_ = "▸";
+#line 434 "WelcomeDialog.c"
+ }
+#line 63 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp29_ = g_strdup (_tmp28_);
+#line 63 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ arrow_glyph = _tmp29_;
+#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp30_ = instructions;
+#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp31_ = indent_prefix;
+#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp32_ = g_strconcat (_tmp31_, "&#8226; %s\n", NULL);
+#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp33_ = _tmp32_;
+#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp34_ = indent_prefix;
+#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp35_ = g_strconcat (_tmp34_, "&#8226; %s\n", NULL);
+#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp36_ = _tmp35_;
+#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp37_ = g_strconcat (_tmp33_, _tmp36_, NULL);
+#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp38_ = _tmp37_;
+#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp39_ = indent_prefix;
+#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp40_ = g_strconcat (_tmp39_, "&#8226; %s", NULL);
+#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp41_ = _tmp40_;
+#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp42_ = g_strconcat (_tmp38_, _tmp41_, NULL);
+#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp43_ = _tmp42_;
+#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp44_ = arrow_glyph;
+#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp45_ = g_strdup_printf (_ ("Choose <span weight=\"bold\">File %s Import From Folder</span>"), _tmp44_);
+#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp46_ = _tmp45_;
+#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp47_ = g_strdup_printf (_tmp43_, _tmp46_, _ ("Drag and drop photos onto the Shotwell window"), _ ("Connect a camera to your computer and import"));
+#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp48_ = _tmp47_;
+#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_label_set_markup (_tmp30_, _tmp48_);
+#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_free0 (_tmp48_);
+#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_free0 (_tmp46_);
+#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_free0 (_tmp43_);
+#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_free0 (_tmp41_);
+#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_free0 (_tmp38_);
+#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_free0 (_tmp36_);
+#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_free0 (_tmp33_);
+#line 70 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp49_ = instructions;
+#line 70 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_label_set_xalign (_tmp49_, 0.0f);
+#line 71 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp50_ = instructions;
+#line 71 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_label_set_yalign (_tmp50_, 0.5f);
+#line 73 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp51_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
+#line 73 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ g_object_ref_sink (_tmp51_);
+#line 73 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_object_unref0 (self->priv->import_action_checkbox_packer);
+#line 73 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ self->priv->import_action_checkbox_packer = _tmp51_;
+#line 75 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp52_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
+#line 75 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ g_object_ref_sink (_tmp52_);
+#line 75 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_object_unref0 (self->priv->external_import_action_checkbox_packer);
+#line 75 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ self->priv->external_import_action_checkbox_packer = _tmp52_;
+#line 76 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp53_ = self->priv->import_action_checkbox_packer;
+#line 76 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp54_ = self->priv->external_import_action_checkbox_packer;
+#line 76 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp53_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp54_, gtk_widget_get_type (), GtkWidget));
+#line 78 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp55_ = show_system_pictures_import;
+#line 78 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ if (_tmp55_) {
+#line 528 "WelcomeDialog.c"
+ GFile* _tmp56_;
+ GFile* _tmp57_;
+ gchar* _tmp58_;
+ gchar* _tmp59_;
+ gchar* _tmp60_;
+ gchar* _tmp61_;
+ GtkCheckButton* _tmp62_;
+ GtkBox* _tmp63_;
+ GtkCheckButton* _tmp64_;
+ GtkCheckButton* _tmp65_;
+#line 79 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp56_ = app_dirs_get_import_dir ();
+#line 79 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp57_ = _tmp56_;
+#line 79 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp58_ = get_display_pathname (_tmp57_);
+#line 79 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp59_ = _tmp58_;
+#line 79 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp60_ = g_strdup_printf (_ ("_Import photos from your %s folder"), _tmp59_);
+#line 79 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp61_ = _tmp60_;
+#line 79 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp62_ = (GtkCheckButton*) gtk_check_button_new_with_mnemonic (_tmp61_);
+#line 79 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ g_object_ref_sink (_tmp62_);
+#line 79 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_object_unref0 (self->priv->system_pictures_import_check);
+#line 79 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ self->priv->system_pictures_import_check = _tmp62_;
+#line 79 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_free0 (_tmp61_);
+#line 79 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_free0 (_tmp59_);
+#line 79 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_object_unref0 (_tmp57_);
+#line 82 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp63_ = self->priv->import_action_checkbox_packer;
+#line 82 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp64_ = self->priv->system_pictures_import_check;
+#line 82 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp63_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp64_, gtk_widget_get_type (), GtkWidget));
+#line 83 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp65_ = self->priv->system_pictures_import_check;
+#line 83 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_toggle_button_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp65_, gtk_toggle_button_get_type (), GtkToggleButton), TRUE);
+#line 575 "WelcomeDialog.c"
+ }
+#line 86 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp66_ = (GtkLabel*) gtk_label_new (_ ("You can also import photos in any of these ways:"));
+#line 86 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ g_object_ref_sink (_tmp66_);
+#line 86 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_object_unref0 (self->priv->instruction_header);
+#line 86 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ self->priv->instruction_header = _tmp66_;
+#line 88 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp67_ = self->priv->instruction_header;
+#line 88 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_label_set_xalign (_tmp67_, 0.0f);
+#line 89 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp68_ = self->priv->instruction_header;
+#line 89 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_label_set_yalign (_tmp68_, 0.5f);
+#line 90 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp69_ = self->priv->instruction_header;
+#line 90 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_widget_set_margin_top (G_TYPE_CHECK_INSTANCE_CAST (_tmp69_, gtk_widget_get_type (), GtkWidget), 20);
+#line 92 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp70_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 16);
+#line 92 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ g_object_ref_sink (_tmp70_);
+#line 92 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ content = _tmp70_;
+#line 93 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp71_ = header_content;
+#line 93 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_box_pack_start (content, G_TYPE_CHECK_INSTANCE_CAST (_tmp71_, gtk_widget_get_type (), GtkWidget), TRUE, TRUE, (guint) 0);
+#line 94 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp72_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
+#line 94 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ g_object_ref_sink (_tmp72_);
+#line 94 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_object_unref0 (self->priv->import_content);
+#line 94 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ self->priv->import_content = _tmp72_;
+#line 95 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp73_ = self->priv->import_content;
+#line 95 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (content, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp73_, gtk_widget_get_type (), GtkWidget));
+#line 96 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp74_ = instructions;
+#line 96 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_box_pack_start (content, G_TYPE_CHECK_INSTANCE_CAST (_tmp74_, gtk_widget_get_type (), GtkWidget), FALSE, FALSE, (guint) 0);
+#line 98 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp75_ = (GtkCheckButton*) gtk_check_button_new_with_mnemonic (_ ("_Don’t show this message again"));
+#line 98 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ g_object_ref_sink (_tmp75_);
+#line 98 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_object_unref0 (self->priv->hide_button);
+#line 98 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ self->priv->hide_button = _tmp75_;
+#line 99 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp76_ = self->priv->hide_button;
+#line 99 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_toggle_button_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp76_, gtk_toggle_button_get_type (), GtkToggleButton), TRUE);
+#line 100 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp77_ = self->priv->hide_button;
+#line 100 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_box_pack_start (content, G_TYPE_CHECK_INSTANCE_CAST (_tmp77_, gtk_widget_get_type (), GtkWidget), FALSE, FALSE, (guint) 6);
+#line 101 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_widget_set_halign (G_TYPE_CHECK_INSTANCE_CAST (content, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_FILL);
+#line 102 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_widget_set_valign (G_TYPE_CHECK_INSTANCE_CAST (content, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_FILL);
+#line 103 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_widget_set_hexpand (G_TYPE_CHECK_INSTANCE_CAST (content, gtk_widget_get_type (), GtkWidget), FALSE);
+#line 104 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_widget_set_vexpand (G_TYPE_CHECK_INSTANCE_CAST (content, gtk_widget_get_type (), GtkWidget), FALSE);
+#line 105 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_widget_set_margin_top (G_TYPE_CHECK_INSTANCE_CAST (content, gtk_widget_get_type (), GtkWidget), 12);
+#line 106 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_widget_set_margin_bottom (G_TYPE_CHECK_INSTANCE_CAST (content, gtk_widget_get_type (), GtkWidget), 0);
+#line 107 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_widget_set_margin_start (G_TYPE_CHECK_INSTANCE_CAST (content, gtk_widget_get_type (), GtkWidget), 12);
+#line 108 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_widget_set_margin_end (G_TYPE_CHECK_INSTANCE_CAST (content, gtk_widget_get_type (), GtkWidget), 12);
+#line 110 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp78_ = gtk_dialog_get_content_area (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_dialog_get_type (), GtkDialog));
+#line 110 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_box_pack_start (G_TYPE_CHECK_INSTANCE_CAST (_tmp78_, gtk_box_get_type (), GtkBox), G_TYPE_CHECK_INSTANCE_CAST (content, gtk_widget_get_type (), GtkWidget), FALSE, FALSE, (guint) 0);
+#line 112 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp79_ = ok_button;
+#line 112 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_widget_grab_focus (_tmp79_);
+#line 114 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ welcome_dialog_install_import_content (self);
+#line 116 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp80_ = self->priv->import_meta_host;
+#line 116 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ spit_data_imports_welcome_import_meta_host_start (_tmp80_);
+#line 28 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_object_unref0 (content);
+#line 28 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_free0 (arrow_glyph);
+#line 28 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_free0 (indent_prefix);
+#line 28 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_object_unref0 (instructions);
+#line 28 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_object_unref0 (header_content);
+#line 28 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_object_unref0 (header_text);
+#line 28 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_object_unref0 (image);
+#line 28 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_object_unref0 (primary_text);
+#line 28 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_object_unref0 (ok_button);
+#line 28 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ return self;
+#line 689 "WelcomeDialog.c"
+}
+
+
+WelcomeDialog*
+welcome_dialog_new (GtkWindow* owner)
+{
+#line 28 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ return welcome_dialog_construct (TYPE_WELCOME_DIALOG, owner);
+#line 698 "WelcomeDialog.c"
+}
+
+
+static void
+welcome_dialog_install_import_content (WelcomeDialog* self)
+{
+ gboolean _tmp0_ = FALSE;
+ gboolean _tmp1_ = FALSE;
+ GtkCheckButton** _tmp2_;
+ gint _tmp2__length1;
+#line 119 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ g_return_if_fail (IS_WELCOME_DIALOG (self));
+#line 121 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp2_ = self->priv->external_import_checks;
+#line 121 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp2__length1 = self->priv->external_import_checks_length1;
+#line 121 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ if (_tmp2__length1 > 0) {
+#line 121 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp1_ = TRUE;
+#line 719 "WelcomeDialog.c"
+ } else {
+ GtkCheckButton* _tmp3_;
+#line 121 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp3_ = self->priv->system_pictures_import_check;
+#line 121 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp1_ = _tmp3_ != NULL;
+#line 726 "WelcomeDialog.c"
+ }
+#line 121 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ if (_tmp1_) {
+#line 730 "WelcomeDialog.c"
+ gboolean _tmp4_;
+#line 122 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp4_ = self->priv->import_content_already_installed;
+#line 122 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp0_ = _tmp4_ == FALSE;
+#line 736 "WelcomeDialog.c"
+ } else {
+#line 121 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp0_ = FALSE;
+#line 740 "WelcomeDialog.c"
+ }
+#line 120 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ if (_tmp0_) {
+#line 744 "WelcomeDialog.c"
+ GtkLabel* _tmp5_;
+ GtkBox* _tmp6_;
+ GtkBox* _tmp7_;
+ GtkBox* _tmp8_;
+ GtkLabel* _tmp9_;
+#line 124 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp5_ = self->priv->secondary_text;
+#line 124 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_label_set_markup (_tmp5_, "");
+#line 125 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp6_ = self->priv->import_content;
+#line 125 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp7_ = self->priv->import_action_checkbox_packer;
+#line 125 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, gtk_widget_get_type (), GtkWidget));
+#line 126 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp8_ = self->priv->import_content;
+#line 126 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp9_ = self->priv->instruction_header;
+#line 126 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, gtk_widget_get_type (), GtkWidget));
+#line 127 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ self->priv->import_content_already_installed = TRUE;
+#line 768 "WelcomeDialog.c"
+ }
+}
+
+
+static void
+_vala_array_add4 (WelcomeServiceEntry** * array,
+ int* length,
+ int* size,
+ WelcomeServiceEntry* value)
+{
+#line 133 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ if ((*length) == (*size)) {
+#line 133 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ *size = (*size) ? (2 * (*size)) : 4;
+#line 133 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ *array = g_renew (WelcomeServiceEntry*, *array, (*size) + 1);
+#line 785 "WelcomeDialog.c"
+ }
+#line 133 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ (*array)[(*length)++] = value;
+#line 133 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ (*array)[*length] = NULL;
+#line 791 "WelcomeDialog.c"
+}
+
+
+static void
+_vala_array_add5 (GtkCheckButton** * array,
+ int* length,
+ int* size,
+ GtkCheckButton* value)
+{
+#line 136 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ if ((*length) == (*size)) {
+#line 136 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ *size = (*size) ? (2 * (*size)) : 4;
+#line 136 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ *array = g_renew (GtkCheckButton*, *array, (*size) + 1);
+#line 807 "WelcomeDialog.c"
+ }
+#line 136 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ (*array)[(*length)++] = value;
+#line 136 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ (*array)[*length] = NULL;
+#line 813 "WelcomeDialog.c"
+}
+
+
+void
+welcome_dialog_install_service_entry (WelcomeDialog* self,
+ WelcomeServiceEntry* entry)
+{
+ gchar* _tmp0_;
+ gchar* _tmp1_;
+ gchar* _tmp2_;
+ gchar* _tmp3_;
+ WelcomeServiceEntry** _tmp4_;
+ gint _tmp4__length1;
+ WelcomeServiceEntry* _tmp5_;
+ GtkCheckButton* entry_check = NULL;
+ gchar* _tmp6_;
+ gchar* _tmp7_;
+ gchar* _tmp8_;
+ gchar* _tmp9_;
+ GtkCheckButton* _tmp10_;
+ GtkCheckButton* _tmp11_;
+ GtkCheckButton** _tmp12_;
+ gint _tmp12__length1;
+ GtkCheckButton* _tmp13_;
+ GtkBox* _tmp14_;
+#line 131 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ g_return_if_fail (IS_WELCOME_DIALOG (self));
+#line 131 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ g_return_if_fail (IS_WELCOME_SERVICE_ENTRY (entry));
+#line 132 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp0_ = welcome_service_entry_get_service_name (entry);
+#line 132 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp1_ = _tmp0_;
+#line 132 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp2_ = g_strdup_printf ("WelcomeDialog: Installing service entry for %s", _tmp1_);
+#line 132 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp3_ = _tmp2_;
+#line 132 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ g_debug ("WelcomeDialog.vala:132: %s", _tmp3_);
+#line 132 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_free0 (_tmp3_);
+#line 132 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_free0 (_tmp1_);
+#line 133 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp4_ = self->priv->external_import_entries;
+#line 133 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp4__length1 = self->priv->external_import_entries_length1;
+#line 133 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp5_ = _g_object_ref0 (entry);
+#line 133 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _vala_array_add4 (&self->priv->external_import_entries, &self->priv->external_import_entries_length1, &self->priv->_external_import_entries_size_, _tmp5_);
+#line 134 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp6_ = welcome_service_entry_get_service_name (entry);
+#line 134 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp7_ = _tmp6_;
+#line 134 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp8_ = g_strdup_printf (_ ("Import photos from your %s library"), _tmp7_);
+#line 134 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp9_ = _tmp8_;
+#line 134 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp10_ = (GtkCheckButton*) gtk_check_button_new_with_label (_tmp9_);
+#line 134 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ g_object_ref_sink (_tmp10_);
+#line 134 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp11_ = _tmp10_;
+#line 134 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_free0 (_tmp9_);
+#line 134 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_free0 (_tmp7_);
+#line 134 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ entry_check = _tmp11_;
+#line 136 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp12_ = self->priv->external_import_checks;
+#line 136 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp12__length1 = self->priv->external_import_checks_length1;
+#line 136 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp13_ = _g_object_ref0 (entry_check);
+#line 136 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _vala_array_add5 (&self->priv->external_import_checks, &self->priv->external_import_checks_length1, &self->priv->_external_import_checks_size_, _tmp13_);
+#line 137 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_toggle_button_set_active (G_TYPE_CHECK_INSTANCE_CAST (entry_check, gtk_toggle_button_get_type (), GtkToggleButton), TRUE);
+#line 138 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp14_ = self->priv->external_import_action_checkbox_packer;
+#line 138 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (entry_check, gtk_widget_get_type (), GtkWidget));
+#line 139 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ welcome_dialog_install_import_content (self);
+#line 131 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_object_unref0 (entry_check);
+#line 903 "WelcomeDialog.c"
+}
+
+
+/**
+ * Connected to the 'response' signal. This is part of a workaround
+ * for the fact that run()-ning this dialog can interfere with displaying
+ * images from a camera; please see #4997 for details.
+ */
+static void
+welcome_dialog_on_dismiss (WelcomeDialog* self,
+ gint resp)
+{
+#line 147 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ g_return_if_fail (IS_WELCOME_DIALOG (self));
+#line 148 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ if (resp == ((gint) GTK_RESPONSE_CLOSE)) {
+#line 149 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ self->priv->ok_clicked = TRUE;
+#line 922 "WelcomeDialog.c"
+ }
+#line 151 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_widget_hide (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
+#line 152 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_main_quit ();
+#line 928 "WelcomeDialog.c"
+}
+
+
+static void
+_welcome_dialog_on_dismiss_gtk_dialog_response (GtkDialog* _sender,
+ gint response_id,
+ gpointer self)
+{
+#line 158 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ welcome_dialog_on_dismiss ((WelcomeDialog*) self, response_id);
+#line 939 "WelcomeDialog.c"
+}
+
+
+static void
+_vala_array_add6 (WelcomeServiceEntry** * array,
+ int* length,
+ int* size,
+ WelcomeServiceEntry* value)
+{
+#line 181 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ if ((*length) == (*size)) {
+#line 181 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ *size = (*size) ? (2 * (*size)) : 4;
+#line 181 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ *array = g_renew (WelcomeServiceEntry*, *array, (*size) + 1);
+#line 955 "WelcomeDialog.c"
+ }
+#line 181 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ (*array)[(*length)++] = value;
+#line 181 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ (*array)[*length] = NULL;
+#line 961 "WelcomeDialog.c"
+}
+
+
+static WelcomeServiceEntry**
+_vala_array_dup1 (WelcomeServiceEntry** self,
+ int length)
+{
+ WelcomeServiceEntry** result;
+ int i;
+#line 183 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ result = g_new0 (WelcomeServiceEntry*, length + 1);
+#line 183 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ for (i = 0; i < length; i++) {
+#line 975 "WelcomeDialog.c"
+ WelcomeServiceEntry* _tmp0_;
+#line 183 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp0_ = _g_object_ref0 (self[i]);
+#line 183 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ result[i] = _tmp0_;
+#line 981 "WelcomeDialog.c"
+ }
+#line 183 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ return result;
+#line 985 "WelcomeDialog.c"
+}
+
+
+gboolean
+welcome_dialog_execute (WelcomeDialog* self,
+ WelcomeServiceEntry*** selected_import_entries,
+ int* selected_import_entries_length1,
+ gboolean* do_system_pictures_import)
+{
+ WelcomeServiceEntry** _vala_selected_import_entries = NULL;
+ int _vala_selected_import_entries_length1 = 0;
+ gboolean _vala_do_system_pictures_import = FALSE;
+ gboolean result = FALSE;
+ guint _tmp0_;
+ gboolean ok = FALSE;
+ gboolean _tmp1_;
+ gboolean show_dialog = FALSE;
+ gboolean _tmp2_;
+ WelcomeServiceEntry** _result_ = NULL;
+ WelcomeServiceEntry** _tmp4_;
+ gint _result__length1;
+ gint __result__size_;
+ WelcomeServiceEntry** _tmp17_;
+ gint _tmp17__length1;
+ WelcomeServiceEntry** _tmp18_;
+ gint _tmp18__length1;
+ gboolean _tmp19_ = FALSE;
+ GtkCheckButton* _tmp20_;
+#line 155 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ g_return_val_if_fail (IS_WELCOME_DIALOG (self), FALSE);
+#line 158 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_dialog_get_type (), GtkDialog), "response", (GCallback) _welcome_dialog_on_dismiss_gtk_dialog_response, self, 0);
+#line 159 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_widget_show_all (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
+#line 160 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_widget_show (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
+#line 165 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_main ();
+#line 169 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ g_signal_parse_name ("response", gtk_dialog_get_type (), &_tmp0_, NULL, FALSE);
+#line 169 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_dialog_get_type (), GtkDialog), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp0_, 0, NULL, (GCallback) _welcome_dialog_on_dismiss_gtk_dialog_response, self);
+#line 171 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp1_ = self->priv->ok_clicked;
+#line 171 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ ok = _tmp1_;
+#line 172 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ show_dialog = TRUE;
+#line 174 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp2_ = ok;
+#line 174 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ if (_tmp2_) {
+#line 1038 "WelcomeDialog.c"
+ GtkCheckButton* _tmp3_;
+#line 175 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp3_ = self->priv->hide_button;
+#line 175 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ show_dialog = !gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_toggle_button_get_type (), GtkToggleButton));
+#line 1044 "WelcomeDialog.c"
+ }
+#line 178 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp4_ = g_new0 (WelcomeServiceEntry*, 0 + 1);
+#line 178 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _result_ = _tmp4_;
+#line 178 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _result__length1 = 0;
+#line 178 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ __result__size_ = _result__length1;
+#line 1054 "WelcomeDialog.c"
+ {
+ gint i = 0;
+#line 179 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ i = 0;
+#line 1059 "WelcomeDialog.c"
+ {
+ gboolean _tmp5_ = FALSE;
+#line 179 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp5_ = TRUE;
+#line 179 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ while (TRUE) {
+#line 1066 "WelcomeDialog.c"
+ gint _tmp7_;
+ WelcomeServiceEntry** _tmp8_;
+ gint _tmp8__length1;
+ GtkCheckButton** _tmp9_;
+ gint _tmp9__length1;
+ gint _tmp10_;
+ GtkCheckButton* _tmp11_;
+#line 179 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ if (!_tmp5_) {
+#line 1076 "WelcomeDialog.c"
+ gint _tmp6_;
+#line 179 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp6_ = i;
+#line 179 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ i = _tmp6_ + 1;
+#line 1082 "WelcomeDialog.c"
+ }
+#line 179 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp5_ = FALSE;
+#line 179 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp7_ = i;
+#line 179 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp8_ = self->priv->external_import_entries;
+#line 179 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp8__length1 = self->priv->external_import_entries_length1;
+#line 179 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ if (!(_tmp7_ < _tmp8__length1)) {
+#line 179 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ break;
+#line 1096 "WelcomeDialog.c"
+ }
+#line 180 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp9_ = self->priv->external_import_checks;
+#line 180 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp9__length1 = self->priv->external_import_checks_length1;
+#line 180 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp10_ = i;
+#line 180 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp11_ = _tmp9_[_tmp10_];
+#line 180 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ if (gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, gtk_toggle_button_get_type (), GtkToggleButton)) == TRUE) {
+#line 1108 "WelcomeDialog.c"
+ WelcomeServiceEntry** _tmp12_;
+ gint _tmp12__length1;
+ WelcomeServiceEntry** _tmp13_;
+ gint _tmp13__length1;
+ gint _tmp14_;
+ WelcomeServiceEntry* _tmp15_;
+ WelcomeServiceEntry* _tmp16_;
+#line 181 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp12_ = _result_;
+#line 181 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp12__length1 = _result__length1;
+#line 181 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp13_ = self->priv->external_import_entries;
+#line 181 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp13__length1 = self->priv->external_import_entries_length1;
+#line 181 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp14_ = i;
+#line 181 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp15_ = _tmp13_[_tmp14_];
+#line 181 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp16_ = _g_object_ref0 (_tmp15_);
+#line 181 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _vala_array_add6 (&_result_, &_result__length1, &__result__size_, _tmp16_);
+#line 1132 "WelcomeDialog.c"
+ }
+ }
+ }
+ }
+#line 183 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp17_ = _result_;
+#line 183 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp17__length1 = _result__length1;
+#line 183 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp18_ = (_tmp17_ != NULL) ? _vala_array_dup1 (_tmp17_, _tmp17__length1) : ((gpointer) _tmp17_);
+#line 183 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp18__length1 = _tmp17__length1;
+#line 183 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _vala_selected_import_entries = (_vala_array_free (_vala_selected_import_entries, _vala_selected_import_entries_length1, (GDestroyNotify) g_object_unref), NULL);
+#line 183 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _vala_selected_import_entries = _tmp18_;
+#line 183 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _vala_selected_import_entries_length1 = _tmp18__length1;
+#line 185 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp20_ = self->priv->system_pictures_import_check;
+#line 185 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ if (_tmp20_ != NULL) {
+#line 1155 "WelcomeDialog.c"
+ GtkCheckButton* _tmp21_;
+#line 185 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp21_ = self->priv->system_pictures_import_check;
+#line 185 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp19_ = gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, gtk_toggle_button_get_type (), GtkToggleButton));
+#line 1161 "WelcomeDialog.c"
+ } else {
+#line 185 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp19_ = FALSE;
+#line 1165 "WelcomeDialog.c"
+ }
+#line 184 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _vala_do_system_pictures_import = _tmp19_;
+#line 187 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ gtk_widget_destroy (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
+#line 189 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ result = show_dialog;
+#line 189 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _result_ = (_vala_array_free (_result_, _result__length1, (GDestroyNotify) g_object_unref), NULL);
+#line 189 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ if (selected_import_entries) {
+#line 189 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ *selected_import_entries = _vala_selected_import_entries;
+#line 1179 "WelcomeDialog.c"
+ } else {
+#line 189 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _vala_selected_import_entries = (_vala_array_free (_vala_selected_import_entries, _vala_selected_import_entries_length1, (GDestroyNotify) g_object_unref), NULL);
+#line 1183 "WelcomeDialog.c"
+ }
+#line 189 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ if (selected_import_entries_length1) {
+#line 189 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ *selected_import_entries_length1 = _vala_selected_import_entries_length1;
+#line 1189 "WelcomeDialog.c"
+ }
+#line 189 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ if (do_system_pictures_import) {
+#line 189 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ *do_system_pictures_import = _vala_do_system_pictures_import;
+#line 1195 "WelcomeDialog.c"
+ }
+#line 189 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ return result;
+#line 1199 "WelcomeDialog.c"
+}
+
+
+static gboolean
+welcome_dialog_is_system_pictures_import_possible (void)
+{
+ gboolean result = FALSE;
+ GFile* system_pictures = NULL;
+ GFile* _tmp0_;
+ GFile* _tmp1_;
+ GFile* _tmp2_;
+ gboolean _tmp8_ = FALSE;
+ GError * _inner_error_ = NULL;
+#line 193 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp0_ = app_dirs_get_import_dir ();
+#line 193 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ system_pictures = _tmp0_;
+#line 194 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp1_ = system_pictures;
+#line 194 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ if (!g_file_query_exists (_tmp1_, NULL)) {
+#line 195 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ result = FALSE;
+#line 195 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_object_unref0 (system_pictures);
+#line 195 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ return result;
+#line 1227 "WelcomeDialog.c"
+ }
+#line 197 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp2_ = system_pictures;
+#line 197 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ if (!(g_file_query_file_type (_tmp2_, G_FILE_QUERY_INFO_NONE, NULL) == G_FILE_TYPE_DIRECTORY)) {
+#line 198 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ result = FALSE;
+#line 198 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_object_unref0 (system_pictures);
+#line 198 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ return result;
+#line 1239 "WelcomeDialog.c"
+ }
+ {
+ GFileEnumerator* syspics_child_enum = NULL;
+ GFile* _tmp3_;
+ GFileEnumerator* _tmp4_;
+ GFileInfo* _tmp5_ = NULL;
+ GFileEnumerator* _tmp6_;
+ GFileInfo* _tmp7_;
+#line 201 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp3_ = system_pictures;
+#line 201 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp4_ = g_file_enumerate_children (_tmp3_, "standard::*", G_FILE_QUERY_INFO_NONE, NULL, &_inner_error_);
+#line 201 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ syspics_child_enum = _tmp4_;
+#line 201 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ if (G_UNLIKELY (_inner_error_ != NULL)) {
+#line 1256 "WelcomeDialog.c"
+ goto __catch24_g_error;
+ }
+#line 203 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp6_ = syspics_child_enum;
+#line 203 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp7_ = g_file_enumerator_next_file (_tmp6_, NULL, &_inner_error_);
+#line 203 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp5_ = _tmp7_;
+#line 203 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ if (G_UNLIKELY (_inner_error_ != NULL)) {
+#line 203 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_object_unref0 (syspics_child_enum);
+#line 1269 "WelcomeDialog.c"
+ goto __catch24_g_error;
+ }
+#line 203 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ result = _tmp5_ != NULL;
+#line 203 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_object_unref0 (_tmp5_);
+#line 203 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_object_unref0 (syspics_child_enum);
+#line 203 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_object_unref0 (system_pictures);
+#line 203 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ return result;
+#line 1282 "WelcomeDialog.c"
+ }
+ goto __finally24;
+ __catch24_g_error:
+ {
+ GError* e = NULL;
+#line 200 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ e = _inner_error_;
+#line 200 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _inner_error_ = NULL;
+#line 205 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ result = FALSE;
+#line 205 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_error_free0 (e);
+#line 205 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_object_unref0 (system_pictures);
+#line 205 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ return result;
+#line 1300 "WelcomeDialog.c"
+ }
+ __finally24:
+#line 200 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_object_unref0 (system_pictures);
+#line 200 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ 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);
+#line 200 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ g_clear_error (&_inner_error_);
+#line 200 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ return _tmp8_;
+#line 1311 "WelcomeDialog.c"
+}
+
+
+static void
+welcome_dialog_class_init (WelcomeDialogClass * klass)
+{
+#line 14 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ welcome_dialog_parent_class = g_type_class_peek_parent (klass);
+#line 14 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ g_type_class_add_private (klass, sizeof (WelcomeDialogPrivate));
+#line 14 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ G_OBJECT_CLASS (klass)->finalize = welcome_dialog_finalize;
+#line 1324 "WelcomeDialog.c"
+}
+
+
+static void
+welcome_dialog_instance_init (WelcomeDialog * self)
+{
+ GtkCheckButton** _tmp0_;
+ WelcomeServiceEntry** _tmp1_;
+#line 14 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ self->priv = WELCOME_DIALOG_GET_PRIVATE (self);
+#line 16 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ self->priv->system_pictures_import_check = NULL;
+#line 17 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp0_ = g_new0 (GtkCheckButton*, 0 + 1);
+#line 17 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ self->priv->external_import_checks = _tmp0_;
+#line 17 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ self->priv->external_import_checks_length1 = 0;
+#line 17 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ self->priv->_external_import_checks_size_ = self->priv->external_import_checks_length1;
+#line 18 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _tmp1_ = g_new0 (WelcomeServiceEntry*, 0 + 1);
+#line 18 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ self->priv->external_import_entries = _tmp1_;
+#line 18 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ self->priv->external_import_entries_length1 = 0;
+#line 18 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ self->priv->_external_import_entries_size_ = self->priv->external_import_entries_length1;
+#line 25 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ self->priv->import_content_already_installed = FALSE;
+#line 26 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ self->priv->ok_clicked = FALSE;
+#line 1357 "WelcomeDialog.c"
+}
+
+
+static void
+welcome_dialog_finalize (GObject * obj)
+{
+ WelcomeDialog * self;
+#line 14 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_WELCOME_DIALOG, WelcomeDialog);
+#line 15 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_object_unref0 (self->priv->hide_button);
+#line 16 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_object_unref0 (self->priv->system_pictures_import_check);
+#line 17 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ self->priv->external_import_checks = (_vala_array_free (self->priv->external_import_checks, self->priv->external_import_checks_length1, (GDestroyNotify) g_object_unref), NULL);
+#line 18 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ self->priv->external_import_entries = (_vala_array_free (self->priv->external_import_entries, self->priv->external_import_entries_length1, (GDestroyNotify) g_object_unref), NULL);
+#line 19 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_object_unref0 (self->priv->secondary_text);
+#line 20 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_object_unref0 (self->priv->instruction_header);
+#line 21 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_object_unref0 (self->priv->import_content);
+#line 22 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_object_unref0 (self->priv->import_action_checkbox_packer);
+#line 23 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_object_unref0 (self->priv->external_import_action_checkbox_packer);
+#line 24 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ _g_object_unref0 (self->priv->import_meta_host);
+#line 14 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala"
+ G_OBJECT_CLASS (welcome_dialog_parent_class)->finalize (obj);
+#line 1389 "WelcomeDialog.c"
+}
+
+
+GType
+welcome_dialog_get_type (void)
+{
+ static volatile gsize welcome_dialog_type_id__volatile = 0;
+ if (g_once_init_enter (&welcome_dialog_type_id__volatile)) {
+ static const GTypeInfo g_define_type_info = { sizeof (WelcomeDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) welcome_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (WelcomeDialog), 0, (GInstanceInitFunc) welcome_dialog_instance_init, NULL };
+ GType welcome_dialog_type_id;
+ welcome_dialog_type_id = g_type_register_static (gtk_dialog_get_type (), "WelcomeDialog", &g_define_type_info, 0);
+ g_once_init_leave (&welcome_dialog_type_id__volatile, welcome_dialog_type_id);
+ }
+ return welcome_dialog_type_id__volatile;
+}
+
+
+static void
+_vala_array_destroy (gpointer array,
+ gint array_length,
+ GDestroyNotify destroy_func)
+{
+ if ((array != NULL) && (destroy_func != NULL)) {
+ int i;
+ for (i = 0; i < array_length; i = i + 1) {
+ if (((gpointer*) array)[i] != NULL) {
+ destroy_func (((gpointer*) array)[i]);
+ }
+ }
+ }
+}
+
+
+static void
+_vala_array_free (gpointer array,
+ gint array_length,
+ GDestroyNotify destroy_func)
+{
+ _vala_array_destroy (array, array_length, destroy_func);
+ g_free (array);
+}
+
+
+
diff --git a/src/dialogs/WelcomeDialog.vala b/src/dialogs/WelcomeDialog.vala
new file mode 100644
index 0000000..e40686d
--- /dev/null
+++ b/src/dialogs/WelcomeDialog.vala
@@ -0,0 +1,208 @@
+/* Copyright 2016 Software Freedom Conservancy Inc.
+ * Copyright 2017 Jens Georg <mail@jensge.org>
+ *
+ * This software is licensed under the GNU LGPL (version 2.1 or later).
+ * See the COPYING file in this distribution.
+ */
+
+public interface WelcomeServiceEntry : GLib.Object {
+ public abstract string get_service_name();
+
+ public abstract void execute();
+}
+
+public class WelcomeDialog : Gtk.Dialog {
+ Gtk.CheckButton hide_button;
+ Gtk.CheckButton? system_pictures_import_check = null;
+ Gtk.CheckButton[] external_import_checks = new Gtk.CheckButton[0];
+ WelcomeServiceEntry[] external_import_entries = new WelcomeServiceEntry[0];
+ Gtk.Label secondary_text;
+ Gtk.Label instruction_header;
+ Gtk.Box import_content;
+ Gtk.Box import_action_checkbox_packer;
+ Gtk.Box external_import_action_checkbox_packer;
+ Spit.DataImports.WelcomeImportMetaHost import_meta_host;
+ bool import_content_already_installed = false;
+ bool ok_clicked = false;
+
+ public WelcomeDialog(Gtk.Window owner) {
+ Object(use_header_bar : Resources.use_header_bar());
+ import_meta_host = new Spit.DataImports.WelcomeImportMetaHost(this);
+ bool show_system_pictures_import = is_system_pictures_import_possible();
+ Gtk.Widget ok_button = add_button(Resources.OK_LABEL, Gtk.ResponseType.CLOSE);
+ set_default_response(Gtk.ResponseType.CLOSE);
+
+ set_title(_("Welcome!"));
+ set_resizable(false);
+ set_type_hint(Gdk.WindowTypeHint.DIALOG);
+ set_transient_for(owner);
+
+ Gtk.Label primary_text = new Gtk.Label("");
+ primary_text.set_markup(
+ "<span size=\"large\" weight=\"bold\">%s</span>".printf(_("Welcome to Shotwell!")));
+ primary_text.xalign = 0.0f;
+ primary_text.yalign = 0.5f;
+ secondary_text = new Gtk.Label("");
+ secondary_text.set_markup("<span weight=\"normal\">%s</span>".printf(
+ _("To get started, import photos in any of these ways:")));
+ secondary_text.xalign = 0.0f;
+ secondary_text.yalign = 0.5f;
+ var image = new Gtk.Image.from_icon_name ("shotwell", Gtk.IconSize.DIALOG);
+
+ Gtk.Box header_text = new Gtk.Box(Gtk.Orientation.VERTICAL, 0);
+ header_text.pack_start(primary_text, false, false, 5);
+ header_text.pack_start(secondary_text, false, false, 0);
+
+ Gtk.Box header_content = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 12);
+ header_content.pack_start(image, false, false, 0);
+ header_content.pack_start(header_text, false, false, 0);
+
+ Gtk.Label instructions = new Gtk.Label("");
+ string indent_prefix = " "; // we can't tell what the indent prefix is going to be so assume we need one
+
+ string arrow_glyph = (get_direction() == Gtk.TextDirection.RTL) ? "◂" : "▸";
+
+ instructions.set_markup(((indent_prefix + "&#8226; %s\n") + (indent_prefix + "&#8226; %s\n")
+ + (indent_prefix + "&#8226; %s")).printf(
+ _("Choose <span weight=\"bold\">File %s Import From Folder</span>").printf(arrow_glyph),
+ _("Drag and drop photos onto the Shotwell window"),
+ _("Connect a camera to your computer and import")));
+ instructions.xalign = 0.0f;
+ instructions.yalign = 0.5f;
+
+ import_action_checkbox_packer = new Gtk.Box(Gtk.Orientation.VERTICAL, 2);
+
+ external_import_action_checkbox_packer = new Gtk.Box(Gtk.Orientation.VERTICAL, 2);
+ import_action_checkbox_packer.add(external_import_action_checkbox_packer);
+
+ if (show_system_pictures_import) {
+ system_pictures_import_check = new Gtk.CheckButton.with_mnemonic(
+ _("_Import photos from your %s folder").printf(
+ get_display_pathname(AppDirs.get_import_dir())));
+ import_action_checkbox_packer.add(system_pictures_import_check);
+ system_pictures_import_check.set_active(true);
+ }
+
+ instruction_header = new Gtk.Label(
+ _("You can also import photos in any of these ways:"));
+ instruction_header.xalign = 0.0f;
+ instruction_header.yalign = 0.5f;
+ instruction_header.set_margin_top(20);
+
+ Gtk.Box content = new Gtk.Box(Gtk.Orientation.VERTICAL, 16);
+ content.pack_start(header_content, true, true, 0);
+ import_content = new Gtk.Box(Gtk.Orientation.VERTICAL, 2);
+ content.add(import_content);
+ content.pack_start(instructions, false, false, 0);
+
+ hide_button = new Gtk.CheckButton.with_mnemonic(_("_Don’t show this message again"));
+ hide_button.set_active(true);
+ content.pack_start(hide_button, false, false, 6);
+ content.halign = Gtk.Align.FILL;
+ content.valign = Gtk.Align.FILL;
+ content.hexpand = false;
+ content.vexpand = false;
+ content.margin_top = 12;
+ content.margin_bottom = 0;
+ content.margin_start = 12;
+ content.margin_end = 12;
+
+ ((Gtk.Box) get_content_area()).pack_start(content, false, false, 0);
+
+ ok_button.grab_focus();
+
+ install_import_content();
+
+ import_meta_host.start();
+ }
+
+ private void install_import_content() {
+ if (
+ (external_import_checks.length > 0 || system_pictures_import_check != null) &&
+ (import_content_already_installed == false)
+ ) {
+ secondary_text.set_markup("");
+ import_content.add(import_action_checkbox_packer);
+ import_content.add(instruction_header);
+ import_content_already_installed = true;
+ }
+ }
+
+ public void install_service_entry(WelcomeServiceEntry entry) {
+ debug("WelcomeDialog: Installing service entry for %s".printf(entry.get_service_name()));
+ external_import_entries += entry;
+ Gtk.CheckButton entry_check = new Gtk.CheckButton.with_label(
+ _("Import photos from your %s library").printf(entry.get_service_name()));
+ external_import_checks += entry_check;
+ entry_check.set_active(true);
+ external_import_action_checkbox_packer.add(entry_check);
+ install_import_content();
+ }
+
+ /**
+ * Connected to the 'response' signal. This is part of a workaround
+ * for the fact that run()-ning this dialog can interfere with displaying
+ * images from a camera; please see #4997 for details.
+ */
+ private void on_dismiss(int resp) {
+ if (resp == Gtk.ResponseType.CLOSE) {
+ ok_clicked = true;
+ }
+ hide();
+ Gtk.main_quit();
+ }
+
+ public bool execute(out WelcomeServiceEntry[] selected_import_entries, out bool do_system_pictures_import) {
+ // it's unsafe to call run() here - it interferes with displaying
+ // images from a camera - so we process the dialog ourselves.
+ response.connect(on_dismiss);
+ show_all();
+ show();
+
+ // this will block the thread we're in until a matching call
+ // to main_quit() is encountered; this happens when either the window
+ // is closed or OK is clicked.
+ Gtk.main();
+
+ // at this point, the inner main loop will have been exited.
+ // we've got the response, so we don't need this signal anymore.
+ response.disconnect(on_dismiss);
+
+ bool ok = ok_clicked;
+ bool show_dialog = true;
+
+ if (ok)
+ show_dialog = !hide_button.get_active();
+
+ // Use a temporary variable as += cannot be used on parameters
+ WelcomeServiceEntry[] result = new WelcomeServiceEntry[0];
+ for (int i = 0; i < external_import_entries.length; i++) {
+ if (external_import_checks[i].get_active() == true)
+ result += external_import_entries[i];
+ }
+ selected_import_entries = result;
+ do_system_pictures_import =
+ (system_pictures_import_check != null) ? system_pictures_import_check.get_active() : false;
+
+ destroy();
+
+ return show_dialog;
+ }
+
+ private static bool is_system_pictures_import_possible() {
+ File system_pictures = AppDirs.get_import_dir();
+ if (!system_pictures.query_exists(null))
+ return false;
+
+ if (!(system_pictures.query_file_type(FileQueryInfoFlags.NONE, null) == FileType.DIRECTORY))
+ return false;
+
+ try {
+ FileEnumerator syspics_child_enum = system_pictures.enumerate_children("standard::*",
+ FileQueryInfoFlags.NONE, null);
+ return (syspics_child_enum.next_file(null) != null);
+ } catch (Error e) {
+ return false;
+ }
+ }
+}