diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2018-05-01 14:34:32 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2018-05-01 14:34:32 +0200 |
commit | 49120f48474fc8fdc2448c75d961bc238213cfac (patch) | |
tree | 05bcdb95d65a807cf0f1ffffd066c09074b5cf56 /src/dialogs | |
parent | 2492891f112caac6076ce49721d9d5d78a152c3a (diff) |
New upstream version 0.28.2upstream/0.28.2
Diffstat (limited to 'src/dialogs')
-rw-r--r-- | src/dialogs/AdjustDateTimeDialog.c | 2353 | ||||
-rw-r--r-- | src/dialogs/AdjustDateTimeDialog.vala | 343 | ||||
-rw-r--r-- | src/dialogs/EntryMultiCompletion.c | 1124 | ||||
-rw-r--r-- | src/dialogs/EntryMultiCompletion.vala | 97 | ||||
-rw-r--r-- | src/dialogs/ExportDialog.c | 2107 | ||||
-rw-r--r-- | src/dialogs/ExportDialog.vala | 343 | ||||
-rw-r--r-- | src/dialogs/MultiTextEntryDialog.c | 286 | ||||
-rw-r--r-- | src/dialogs/MultiTextEntryDialog.vala | 43 | ||||
-rw-r--r-- | src/dialogs/Preferences.c | 3245 | ||||
-rw-r--r-- | src/dialogs/Preferences.vala | 468 | ||||
-rw-r--r-- | src/dialogs/ProgressDialog.c | 715 | ||||
-rw-r--r-- | src/dialogs/ProgressDialog.vala | 178 | ||||
-rw-r--r-- | src/dialogs/SetBackground.c | 274 | ||||
-rw-r--r-- | src/dialogs/SetBackground.vala | 38 | ||||
-rw-r--r-- | src/dialogs/SetBackgroundSlideshow.c | 474 | ||||
-rw-r--r-- | src/dialogs/SetBackgroundSlideshow.vala | 78 | ||||
-rw-r--r-- | src/dialogs/TextEntry.c | 398 | ||||
-rw-r--r-- | src/dialogs/TextEntry.vala | 66 | ||||
-rw-r--r-- | src/dialogs/WelcomeDialog.c | 1377 | ||||
-rw-r--r-- | src/dialogs/WelcomeDialog.vala | 208 |
20 files changed, 14215 insertions, 0 deletions
diff --git a/src/dialogs/AdjustDateTimeDialog.c b/src/dialogs/AdjustDateTimeDialog.c new file mode 100644 index 0000000..9eb3020 --- /dev/null +++ b/src/dialogs/AdjustDateTimeDialog.c @@ -0,0 +1,2353 @@ +/* AdjustDateTimeDialog.c generated by valac 0.36.6, 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 ()) +#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)) +enum { + ADJUST_DATE_TIME_DIALOG_DUMMY_PROPERTY +}; +#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 241 "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 248 "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 255 "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 262 "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 271 "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 278 "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 285 "AdjustDateTimeDialog.c" +} + + +static void g_time_gm (time_t time, struct tm* result) { + struct tm _result_ = {0}; + struct tm _tmp0_ = {0}; +#line 2841 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + gmtime_r (&time, &_tmp0_); +#line 2841 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _result_ = _tmp0_; +#line 2842 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + *result = _result_; +#line 2842 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + return; +#line 300 "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; + const gchar* _tmp2_; + gchar* _tmp3_; + gint _tmp3__length1; + gchar* _tmp4_; +#line 2854 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + g_return_val_if_fail (format != NULL, NULL); +#line 2855 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp0_ = g_new0 (gchar, 64); +#line 2855 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + buffer = _tmp0_; +#line 2855 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + buffer_length1 = 64; +#line 2855 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _buffer_size_ = buffer_length1; +#line 2856 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp1_ = buffer; +#line 2856 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp1__length1 = buffer_length1; +#line 2856 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp2_ = format; +#line 2856 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + strftime (_tmp1_, _tmp1__length1, _tmp2_, &(*self)); +#line 2857 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp3_ = buffer; +#line 2857 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp3__length1 = buffer_length1; +#line 2857 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp4_ = g_strdup ((const gchar*) _tmp3_); +#line 2857 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + result = _tmp4_; +#line 2857 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + buffer = (g_free (buffer), NULL); +#line 2857 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + return result; +#line 346 "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 353 "AdjustDateTimeDialog.c" +} + + +static void g_time_local (time_t time, struct tm* result) { + struct tm _result_ = {0}; + struct tm _tmp0_ = {0}; +#line 2846 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + localtime_r (&time, &_tmp0_); +#line 2846 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _result_ = _tmp0_; +#line 2847 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + *result = _result_; +#line 2847 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + return; +#line 368 "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; + Dateable* _tmp0_; + gint _tmp1_; + AppWindow* _tmp2_; + AppWindow* _tmp3_; + GtkCalendar* _tmp4_; + GtkCalendar* _tmp5_; + GtkCalendar* _tmp6_; + GtkCalendar* _tmp7_; + GtkCalendar* _tmp8_; + GtkCalendar* _tmp9_; + ConfigFacade* _tmp10_; + ConfigFacade* _tmp11_; + gboolean _tmp12_; + gboolean _tmp13_; + GtkSpinButton* _tmp16_; + GtkSpinButton* _tmp17_; + GtkSpinButton* _tmp18_; + GtkSpinButton* _tmp19_; + GtkSpinButton* _tmp20_; + GtkSpinButton* _tmp21_; + GtkSpinButton* _tmp22_; + GtkSpinButton* _tmp23_; + GtkSpinButton* _tmp24_; + GtkSpinButton* _tmp25_; + GtkSpinButton* _tmp26_; + GtkComboBoxText* _tmp27_; + GtkComboBoxText* _tmp28_; + GtkComboBoxText* _tmp29_; + GtkComboBoxText* _tmp30_; + GtkComboBoxText* _tmp31_; + GtkBox* clock = NULL; + GtkBox* _tmp32_; + GtkBox* _tmp33_; + GtkSpinButton* _tmp34_; + GtkBox* _tmp35_; + GtkLabel* _tmp36_; + GtkLabel* _tmp37_; + GtkBox* _tmp38_; + GtkSpinButton* _tmp39_; + GtkBox* _tmp40_; + GtkLabel* _tmp41_; + GtkLabel* _tmp42_; + GtkBox* _tmp43_; + GtkSpinButton* _tmp44_; + GtkBox* _tmp45_; + GtkComboBoxText* _tmp46_; + GtkRadioButton* _tmp47_; + GtkRadioButton* _tmp48_; + ConfigFacade* _tmp49_; + ConfigFacade* _tmp50_; + gboolean _tmp51_; + gboolean _tmp52_ = FALSE; + gboolean _tmp53_; + GtkRadioButton* _tmp55_; + GtkRadioButton* _tmp56_; + GSList* _tmp57_; + GtkRadioButton* _tmp58_; + GtkRadioButton* _tmp59_; + ConfigFacade* _tmp60_; + ConfigFacade* _tmp61_; + gboolean _tmp62_; + gboolean _tmp63_ = FALSE; + gboolean _tmp64_; + GtkRadioButton* _tmp66_; + GtkRadioButton* _tmp67_; + gboolean _tmp68_; + gboolean _tmp77_ = FALSE; + ConfigFacade* _tmp78_; + ConfigFacade* _tmp79_; + gboolean _tmp80_; + gboolean _tmp81_; + GtkCheckButton* _tmp83_; + gboolean _tmp84_ = FALSE; + gboolean _tmp85_; + GtkCheckButton* _tmp92_; + GtkBox* time_content = NULL; + GtkBox* _tmp93_; + GtkBox* picker = NULL; + GtkBox* _tmp94_; + GtkComboBoxText* combo = NULL; + GtkComboBoxText* _tmp95_; + GtkBox* _tmp104_; + GtkComboBoxText* _tmp105_; + GtkSpinButton* spin = NULL; + GtkSpinButton* _tmp106_; + GtkBox* _tmp107_; + GtkSpinButton* _tmp108_; + GtkSpinButton* _tmp109_; + GtkCalendar* _tmp110_; + GtkComboBoxText* _tmp111_; + GtkCalendar* _tmp112_; + GtkBox* _tmp113_; + GtkBox* _tmp114_; + GtkBox* _tmp115_; + GtkCalendar* _tmp116_; + GtkBox* _tmp117_; + GtkBox* _tmp118_; + gboolean _tmp119_; + GdkPixbuf* preview = NULL; + GtkBox* image_content = NULL; + GtkBox* _tmp133_; + GtkBox* _tmp134_; + GtkBox* _tmp135_; + GtkImage* _tmp136_ = NULL; + GdkPixbuf* _tmp137_; + GtkImage* image = NULL; + GtkImage* _tmp141_; + GtkLabel* _tmp142_; + GtkBox* _tmp143_; + GtkImage* _tmp144_; + GtkBox* _tmp145_; + GtkLabel* _tmp146_; + GtkBox* hbox = NULL; + GtkBox* _tmp147_; + GtkBox* _tmp148_; + GtkBox* _tmp149_; + GtkBox* _tmp150_; + GtkBox* _tmp151_; + GtkBox* _tmp152_; + GtkBox* _tmp153_; + GtkBox* _tmp154_; + GtkBox* _tmp155_; + GtkBox* _tmp156_; + GtkBox* _tmp157_; + GtkBox* _tmp158_; + GtkLabel* _tmp159_; + GtkLabel* _tmp160_; + GtkLabel* _tmp161_; + GtkBox* _tmp162_; + GtkLabel* _tmp163_; + Dateable* _tmp164_; + time_t _tmp165_; + time_t _tmp166_; + time_t _tmp168_; + struct tm _tmp169_ = {0}; + ConfigFacade* _tmp170_; + ConfigFacade* _tmp171_; + gboolean _tmp172_; + 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" + _tmp0_ = source; +#line 39 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _vala_assert (_tmp0_ != NULL, "source != null"); +#line 41 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp1_ = resources_use_header_bar (); +#line 41 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + self = (AdjustDateTimeDialog*) g_object_new (object_type, "use-header-bar", _tmp1_, 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" + _tmp2_ = app_window_get_instance (); +#line 45 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp3_ = _tmp2_; +#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 (_tmp3_, gtk_window_get_type (), GtkWindow)); +#line 45 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _g_object_unref0 (_tmp3_); +#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" + _tmp4_ = (GtkCalendar*) gtk_calendar_new (); +#line 51 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + g_object_ref_sink (_tmp4_); +#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 = _tmp4_; +#line 52 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp5_ = self->priv->calendar; +#line 52 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + g_object_set (_tmp5_, "show-heading", FALSE, NULL); +#line 53 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp6_ = self->priv->calendar; +#line 53 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + g_signal_connect_object (_tmp6_, "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" + _tmp7_ = self->priv->calendar; +#line 54 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + g_signal_connect_object (_tmp7_, "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" + _tmp8_ = self->priv->calendar; +#line 55 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + g_signal_connect_object (_tmp8_, "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" + _tmp9_ = self->priv->calendar; +#line 56 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + g_signal_connect_object (_tmp9_, "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" + _tmp10_ = config_facade_get_instance (); +#line 58 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp11_ = _tmp10_; +#line 58 "/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 58 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp13_ = _tmp12_; +#line 58 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _g_object_unref0 (_tmp11_); +#line 58 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + if (_tmp13_) { +#line 579 "AdjustDateTimeDialog.c" + GtkSpinButton* _tmp14_; +#line 59 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp14_ = (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 (_tmp14_); +#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 = _tmp14_; +#line 589 "AdjustDateTimeDialog.c" + } else { + GtkSpinButton* _tmp15_; +#line 61 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp15_ = (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 (_tmp15_); +#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 = _tmp15_; +#line 600 "AdjustDateTimeDialog.c" + } +#line 63 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp16_ = self->priv->hour; +#line 63 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + g_signal_connect_object (_tmp16_, "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" + _tmp17_ = self->priv->hour; +#line 64 "/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 65 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp18_ = self->priv->hour; +#line 65 "/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 67 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp19_ = (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 (_tmp19_); +#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 = _tmp19_; +#line 68 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp20_ = self->priv->minute; +#line 68 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_entry_set_width_chars (G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, gtk_entry_get_type (), GtkEntry), 2); +#line 69 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp21_ = self->priv->minute; +#line 69 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_entry_set_max_width_chars (G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, gtk_entry_get_type (), GtkEntry), 2); +#line 70 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp22_ = self->priv->minute; +#line 70 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + g_signal_connect_object (_tmp22_, "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" + _tmp23_ = (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 (_tmp23_); +#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 = _tmp23_; +#line 73 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp24_ = self->priv->second; +#line 73 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_entry_set_width_chars (G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, gtk_entry_get_type (), GtkEntry), 2); +#line 74 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp25_ = self->priv->second; +#line 74 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_entry_set_max_width_chars (G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, gtk_entry_get_type (), GtkEntry), 2); +#line 75 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp26_ = self->priv->second; +#line 75 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + g_signal_connect_object (_tmp26_, "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" + _tmp27_ = (GtkComboBoxText*) gtk_combo_box_text_new (); +#line 77 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + g_object_ref_sink (_tmp27_); +#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 = _tmp27_; +#line 78 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp28_ = self->priv->system; +#line 78 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_combo_box_text_append_text (_tmp28_, _ ("AM")); +#line 79 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp29_ = self->priv->system; +#line 79 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_combo_box_text_append_text (_tmp29_, _ ("PM")); +#line 80 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp30_ = self->priv->system; +#line 80 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_combo_box_text_append_text (_tmp30_, _ ("24 Hr")); +#line 81 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp31_ = self->priv->system; +#line 81 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp31_, 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" + _tmp32_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 3); +#line 83 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + g_object_ref_sink (_tmp32_); +#line 83 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + clock = _tmp32_; +#line 85 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp33_ = clock; +#line 85 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp34_ = self->priv->hour; +#line 85 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_box_pack_start (_tmp33_, 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" + _tmp35_ = clock; +#line 86 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp36_ = (GtkLabel*) gtk_label_new (":"); +#line 86 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + g_object_ref_sink (_tmp36_); +#line 86 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp37_ = _tmp36_; +#line 86 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_box_pack_start (_tmp35_, G_TYPE_CHECK_INSTANCE_CAST (_tmp37_, gtk_widget_get_type (), GtkWidget), FALSE, FALSE, (guint) 0); +#line 86 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _g_object_unref0 (_tmp37_); +#line 87 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp38_ = clock; +#line 87 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp39_ = self->priv->minute; +#line 87 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_box_pack_start (_tmp38_, 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" + _tmp40_ = clock; +#line 88 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp41_ = (GtkLabel*) gtk_label_new (":"); +#line 88 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + g_object_ref_sink (_tmp41_); +#line 88 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp42_ = _tmp41_; +#line 88 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_box_pack_start (_tmp40_, G_TYPE_CHECK_INSTANCE_CAST (_tmp42_, gtk_widget_get_type (), GtkWidget), FALSE, FALSE, (guint) 0); +#line 88 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _g_object_unref0 (_tmp42_); +#line 89 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp43_ = clock; +#line 89 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp44_ = self->priv->second; +#line 89 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_box_pack_start (_tmp43_, G_TYPE_CHECK_INSTANCE_CAST (_tmp44_, gtk_widget_get_type (), GtkWidget), FALSE, FALSE, (guint) 0); +#line 90 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp45_ = clock; +#line 90 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp46_ = self->priv->system; +#line 90 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_box_pack_start (_tmp45_, G_TYPE_CHECK_INSTANCE_CAST (_tmp46_, 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" + _tmp47_ = (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 (_tmp47_); +#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 = _tmp47_; +#line 96 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp48_ = self->priv->relativity_radio_button; +#line 96 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp49_ = config_facade_get_instance (); +#line 96 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp50_ = _tmp49_; +#line 96 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp51_ = configuration_facade_get_keep_relativity (G_TYPE_CHECK_INSTANCE_CAST (_tmp50_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)); +#line 96 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_toggle_button_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp48_, gtk_toggle_button_get_type (), GtkToggleButton), _tmp51_); +#line 96 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _g_object_unref0 (_tmp50_); +#line 97 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp53_ = display_options; +#line 97 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + if (_tmp53_) { +#line 758 "AdjustDateTimeDialog.c" + gint _tmp54_; +#line 97 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp54_ = photo_count; +#line 97 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp52_ = _tmp54_ > 1; +#line 764 "AdjustDateTimeDialog.c" + } else { +#line 97 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp52_ = FALSE; +#line 768 "AdjustDateTimeDialog.c" + } +#line 97 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp55_ = self->priv->relativity_radio_button; +#line 97 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp55_, gtk_widget_get_type (), GtkWidget), _tmp52_); +#line 99 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp56_ = self->priv->relativity_radio_button; +#line 99 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp57_ = gtk_radio_button_get_group (_tmp56_); +#line 99 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp58_ = (GtkRadioButton*) gtk_radio_button_new_with_mnemonic (_tmp57_, _ ("Set _all photos/videos to this time")); +#line 99 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + g_object_ref_sink (_tmp58_); +#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 = _tmp58_; +#line 101 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp59_ = self->priv->batch_radio_button; +#line 101 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp60_ = config_facade_get_instance (); +#line 101 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp61_ = _tmp60_; +#line 101 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp62_ = configuration_facade_get_keep_relativity (G_TYPE_CHECK_INSTANCE_CAST (_tmp61_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)); +#line 101 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_toggle_button_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp59_, gtk_toggle_button_get_type (), GtkToggleButton), !_tmp62_); +#line 101 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _g_object_unref0 (_tmp61_); +#line 102 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp64_ = display_options; +#line 102 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + if (_tmp64_) { +#line 802 "AdjustDateTimeDialog.c" + gint _tmp65_; +#line 102 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp65_ = photo_count; +#line 102 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp63_ = _tmp65_ > 1; +#line 808 "AdjustDateTimeDialog.c" + } else { +#line 102 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp63_ = FALSE; +#line 812 "AdjustDateTimeDialog.c" + } +#line 102 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp66_ = self->priv->batch_radio_button; +#line 102 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp66_, gtk_widget_get_type (), GtkWidget), _tmp63_); +#line 103 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp67_ = self->priv->batch_radio_button; +#line 103 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp67_, 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" + _tmp68_ = contains_video; +#line 105 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + if (_tmp68_) { +#line 826 "AdjustDateTimeDialog.c" + gchar* text = NULL; + gint _tmp69_; + gchar* _tmp70_; + const gchar* _tmp71_; + GtkCheckButton* _tmp72_; +#line 106 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp69_ = photo_count; +#line 106 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp70_ = g_strdup (ngettext ("_Modify original photo file", "_Modify original photo files", (gulong) _tmp69_)); +#line 106 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + text = _tmp70_; +#line 108 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp71_ = text; +#line 108 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp72_ = (GtkCheckButton*) gtk_check_button_new_with_mnemonic (_tmp71_); +#line 108 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + g_object_ref_sink (_tmp72_); +#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 = _tmp72_; +#line 105 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _g_free0 (text); +#line 850 "AdjustDateTimeDialog.c" + } else { + gchar* text = NULL; + gint _tmp73_; + gchar* _tmp74_; + const gchar* _tmp75_; + GtkCheckButton* _tmp76_; +#line 110 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp73_ = photo_count; +#line 110 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp74_ = g_strdup (ngettext ("_Modify original file", "_Modify original files", (gulong) _tmp73_)); +#line 110 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + text = _tmp74_; +#line 111 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp75_ = text; +#line 111 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp76_ = (GtkCheckButton*) gtk_check_button_new_with_mnemonic (_tmp75_); +#line 111 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + g_object_ref_sink (_tmp76_); +#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 = _tmp76_; +#line 105 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _g_free0 (text); +#line 875 "AdjustDateTimeDialog.c" + } +#line 114 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp78_ = config_facade_get_instance (); +#line 114 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp79_ = _tmp78_; +#line 114 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp80_ = configuration_facade_get_commit_metadata_to_masters (G_TYPE_CHECK_INSTANCE_CAST (_tmp79_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)); +#line 114 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp81_ = _tmp80_; +#line 114 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _g_object_unref0 (_tmp79_); +#line 114 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + if (_tmp81_) { +#line 889 "AdjustDateTimeDialog.c" + gboolean _tmp82_; +#line 115 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp82_ = display_options; +#line 115 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp77_ = _tmp82_; +#line 895 "AdjustDateTimeDialog.c" + } else { +#line 114 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp77_ = FALSE; +#line 899 "AdjustDateTimeDialog.c" + } +#line 114 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp83_ = 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 (_tmp83_, gtk_toggle_button_get_type (), GtkToggleButton), _tmp77_); +#line 116 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp85_ = only_video; +#line 116 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + if (!_tmp85_) { +#line 909 "AdjustDateTimeDialog.c" + gboolean _tmp86_ = FALSE; + ConfigFacade* _tmp87_; + ConfigFacade* _tmp88_; + gboolean _tmp89_; + gboolean _tmp90_; +#line 117 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp87_ = config_facade_get_instance (); +#line 117 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp88_ = _tmp87_; +#line 117 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp89_ = configuration_facade_get_commit_metadata_to_masters (G_TYPE_CHECK_INSTANCE_CAST (_tmp88_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)); +#line 117 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp90_ = !_tmp89_; +#line 117 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _g_object_unref0 (_tmp88_); +#line 117 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + if (_tmp90_) { +#line 927 "AdjustDateTimeDialog.c" + gboolean _tmp91_; +#line 117 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp91_ = display_options; +#line 117 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp86_ = _tmp91_; +#line 933 "AdjustDateTimeDialog.c" + } else { +#line 117 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp86_ = FALSE; +#line 937 "AdjustDateTimeDialog.c" + } +#line 117 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp84_ = _tmp86_; +#line 941 "AdjustDateTimeDialog.c" + } else { +#line 116 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp84_ = FALSE; +#line 945 "AdjustDateTimeDialog.c" + } +#line 116 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp92_ = 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 (_tmp92_, gtk_widget_get_type (), GtkWidget), _tmp84_); +#line 119 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp93_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 5); +#line 119 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + g_object_ref_sink (_tmp93_); +#line 119 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + time_content = _tmp93_; +#line 121 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp94_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5); +#line 121 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + g_object_ref_sink (_tmp94_); +#line 121 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + picker = _tmp94_; +#line 122 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp95_ = (GtkComboBoxText*) gtk_combo_box_text_new (); +#line 122 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + g_object_ref_sink (_tmp95_); +#line 122 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + combo = _tmp95_; +#line 969 "AdjustDateTimeDialog.c" + { + gint i = 0; +#line 123 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + i = 0; +#line 974 "AdjustDateTimeDialog.c" + { + gboolean _tmp96_ = FALSE; +#line 123 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp96_ = TRUE; +#line 123 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + while (TRUE) { +#line 981 "AdjustDateTimeDialog.c" + gint _tmp98_; + GtkComboBoxText* _tmp99_; + gint _tmp100_; + struct tm _tmp101_ = {0}; + gchar* _tmp102_; + gchar* _tmp103_; +#line 123 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + if (!_tmp96_) { +#line 990 "AdjustDateTimeDialog.c" + gint _tmp97_; +#line 123 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp97_ = i; +#line 123 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + i = _tmp97_ + 1; +#line 996 "AdjustDateTimeDialog.c" + } +#line 123 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp96_ = FALSE; +#line 123 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp98_ = i; +#line 123 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + if (!(_tmp98_ < 12)) { +#line 123 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + break; +#line 1006 "AdjustDateTimeDialog.c" + } +#line 124 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp99_ = combo; +#line 124 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp100_ = i; +#line 124 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + g_time_gm ((time_t) (_tmp100_ * 2764800), &_tmp101_); +#line 124 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp102_ = g_time_format (&_tmp101_, "%B"); +#line 124 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp103_ = _tmp102_; +#line 124 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_combo_box_text_append_text (_tmp99_, _tmp103_); +#line 124 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _g_free0 (_tmp103_); +#line 1022 "AdjustDateTimeDialog.c" + } + } + } +#line 126 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp104_ = picker; +#line 126 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp105_ = combo; +#line 126 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_box_pack_start (_tmp104_, G_TYPE_CHECK_INSTANCE_CAST (_tmp105_, gtk_widget_get_type (), GtkWidget), FALSE, FALSE, (guint) 0); +#line 128 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp106_ = (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 (_tmp106_); +#line 128 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + spin = _tmp106_; +#line 129 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp107_ = picker; +#line 129 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp108_ = spin; +#line 129 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_box_pack_end (_tmp107_, G_TYPE_CHECK_INSTANCE_CAST (_tmp108_, gtk_widget_get_type (), GtkWidget), FALSE, FALSE, (guint) 0); +#line 130 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp109_ = spin; +#line 130 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp110_ = self->priv->calendar; +#line 130 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + g_object_bind_property_with_closures (G_TYPE_CHECK_INSTANCE_CAST (_tmp109_, G_TYPE_OBJECT, GObject), "value", G_TYPE_CHECK_INSTANCE_CAST (_tmp110_, 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" + _tmp111_ = combo; +#line 131 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp112_ = self->priv->calendar; +#line 131 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + g_object_bind_property_with_closures (G_TYPE_CHECK_INSTANCE_CAST (_tmp111_, G_TYPE_OBJECT, GObject), "active", G_TYPE_CHECK_INSTANCE_CAST (_tmp112_, 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" + _tmp113_ = time_content; +#line 133 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp114_ = picker; +#line 133 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_box_pack_start (_tmp113_, G_TYPE_CHECK_INSTANCE_CAST (_tmp114_, gtk_widget_get_type (), GtkWidget), FALSE, FALSE, (guint) 0); +#line 134 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp115_ = time_content; +#line 134 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp116_ = self->priv->calendar; +#line 134 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_box_pack_start (_tmp115_, G_TYPE_CHECK_INSTANCE_CAST (_tmp116_, gtk_widget_get_type (), GtkWidget), TRUE, FALSE, (guint) 0); +#line 135 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp117_ = time_content; +#line 135 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp118_ = clock; +#line 135 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_box_pack_start (_tmp117_, G_TYPE_CHECK_INSTANCE_CAST (_tmp118_, gtk_widget_get_type (), GtkWidget), TRUE, FALSE, (guint) 0); +#line 137 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp119_ = display_options; +#line 137 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + if (_tmp119_) { +#line 1078 "AdjustDateTimeDialog.c" + GtkBox* _tmp120_; + GtkRadioButton* _tmp121_; + GtkBox* _tmp122_; + GtkRadioButton* _tmp123_; + GtkBox* _tmp124_; + GtkCheckButton* _tmp125_; +#line 138 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp120_ = time_content; +#line 138 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp121_ = self->priv->relativity_radio_button; +#line 138 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_box_pack_start (_tmp120_, G_TYPE_CHECK_INSTANCE_CAST (_tmp121_, gtk_widget_get_type (), GtkWidget), TRUE, FALSE, (guint) 0); +#line 139 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp122_ = time_content; +#line 139 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp123_ = self->priv->batch_radio_button; +#line 139 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_box_pack_start (_tmp122_, G_TYPE_CHECK_INSTANCE_CAST (_tmp123_, gtk_widget_get_type (), GtkWidget), TRUE, FALSE, (guint) 0); +#line 140 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp124_ = time_content; +#line 140 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp125_ = self->priv->modify_originals_check_button; +#line 140 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_box_pack_start (_tmp124_, G_TYPE_CHECK_INSTANCE_CAST (_tmp125_, gtk_widget_get_type (), GtkWidget), TRUE, FALSE, (guint) 0); +#line 1103 "AdjustDateTimeDialog.c" + } +#line 143 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + preview = NULL; +#line 1107 "AdjustDateTimeDialog.c" + { + GdkPixbuf* _tmp126_ = NULL; + Dateable* _tmp127_; + GdkPixbuf* _tmp128_; + GdkPixbuf* _tmp129_; +#line 147 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp127_ = source; +#line 147 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp128_ = thumbnail_source_get_thumbnail (G_TYPE_CHECK_INSTANCE_CAST (_tmp127_, TYPE_THUMBNAIL_SOURCE, ThumbnailSource), ADJUST_DATE_TIME_DIALOG_CALENDAR_THUMBNAIL_SCALE, &_inner_error_); +#line 147 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp126_ = _tmp128_; +#line 147 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 1121 "AdjustDateTimeDialog.c" + goto __catch25_g_error; + } +#line 147 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp129_ = _tmp126_; +#line 147 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp126_ = 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 = _tmp129_; +#line 144 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _g_object_unref0 (_tmp126_); +#line 1134 "AdjustDateTimeDialog.c" + } + goto __finally25; + __catch25_g_error: + { + GError* err = NULL; + Dateable* _tmp130_; + gchar* _tmp131_; + gchar* _tmp132_; +#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" + _tmp130_ = source; +#line 149 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp131_ = data_object_to_string (G_TYPE_CHECK_INSTANCE_CAST (_tmp130_, TYPE_DATA_OBJECT, DataObject)); +#line 149 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp132_ = _tmp131_; +#line 149 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + g_warning ("AdjustDateTimeDialog.vala:149: Unable to fetch preview for %s", _tmp132_); +#line 149 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _g_free0 (_tmp132_); +#line 144 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _g_error_free0 (err); +#line 1159 "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 1182 "AdjustDateTimeDialog.c" + } +#line 152 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp133_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); +#line 152 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + g_object_ref_sink (_tmp133_); +#line 152 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + image_content = _tmp133_; +#line 153 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp134_ = image_content; +#line 153 "/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_START); +#line 154 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp135_ = image_content; +#line 154 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_box_set_homogeneous (_tmp135_, TRUE); +#line 155 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp137_ = preview; +#line 155 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + if (_tmp137_ != NULL) { +#line 1202 "AdjustDateTimeDialog.c" + GdkPixbuf* _tmp138_; + GtkImage* _tmp139_; +#line 155 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp138_ = preview; +#line 155 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp139_ = (GtkImage*) gtk_image_new_from_pixbuf (_tmp138_); +#line 155 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + g_object_ref_sink (_tmp139_); +#line 155 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _g_object_unref0 (_tmp136_); +#line 155 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp136_ = _tmp139_; +#line 1215 "AdjustDateTimeDialog.c" + } else { + GtkImage* _tmp140_; +#line 155 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp140_ = (GtkImage*) gtk_image_new (); +#line 155 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + g_object_ref_sink (_tmp140_); +#line 155 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _g_object_unref0 (_tmp136_); +#line 155 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp136_ = _tmp140_; +#line 1226 "AdjustDateTimeDialog.c" + } +#line 155 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp141_ = _g_object_ref0 (_tmp136_); +#line 155 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + image = _tmp141_; +#line 156 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp142_ = (GtkLabel*) gtk_label_new (NULL); +#line 156 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + g_object_ref_sink (_tmp142_); +#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 = _tmp142_; +#line 157 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp143_ = image_content; +#line 157 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp144_ = image; +#line 157 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_box_pack_start (_tmp143_, G_TYPE_CHECK_INSTANCE_CAST (_tmp144_, gtk_widget_get_type (), GtkWidget), TRUE, FALSE, (guint) 0); +#line 158 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp145_ = image_content; +#line 158 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp146_ = self->priv->original_time_label; +#line 158 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_box_pack_start (_tmp145_, G_TYPE_CHECK_INSTANCE_CAST (_tmp146_, gtk_widget_get_type (), GtkWidget), TRUE, FALSE, (guint) 0); +#line 160 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp147_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10); +#line 160 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + g_object_ref_sink (_tmp147_); +#line 160 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + hbox = _tmp147_; +#line 161 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp148_ = hbox; +#line 161 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_container_set_border_width (G_TYPE_CHECK_INSTANCE_CAST (_tmp148_, gtk_container_get_type (), GtkContainer), (guint) 3); +#line 162 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp149_ = hbox; +#line 162 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp150_ = image_content; +#line 162 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_box_pack_start (_tmp149_, G_TYPE_CHECK_INSTANCE_CAST (_tmp150_, gtk_widget_get_type (), GtkWidget), TRUE, FALSE, (guint) 0); +#line 163 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp151_ = hbox; +#line 163 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp152_ = time_content; +#line 163 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_box_pack_start (_tmp151_, G_TYPE_CHECK_INSTANCE_CAST (_tmp152_, gtk_widget_get_type (), GtkWidget), TRUE, FALSE, (guint) 0); +#line 164 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp153_ = hbox; +#line 164 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_widget_set_halign (G_TYPE_CHECK_INSTANCE_CAST (_tmp153_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_CENTER); +#line 165 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp154_ = hbox; +#line 165 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_widget_set_valign (G_TYPE_CHECK_INSTANCE_CAST (_tmp154_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_CENTER); +#line 166 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp155_ = hbox; +#line 166 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_widget_set_hexpand (G_TYPE_CHECK_INSTANCE_CAST (_tmp155_, gtk_widget_get_type (), GtkWidget), FALSE); +#line 167 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp156_ = hbox; +#line 167 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_widget_set_vexpand (G_TYPE_CHECK_INSTANCE_CAST (_tmp156_, gtk_widget_get_type (), GtkWidget), FALSE); +#line 169 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp157_ = (GtkBox*) 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" + _tmp158_ = hbox; +#line 169 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_box_pack_start (G_TYPE_CHECK_INSTANCE_CAST (_tmp157_, gtk_box_get_type (), GtkBox), G_TYPE_CHECK_INSTANCE_CAST (_tmp158_, gtk_widget_get_type (), GtkWidget), TRUE, FALSE, (guint) 0); +#line 171 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp159_ = (GtkLabel*) gtk_label_new (""); +#line 171 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + g_object_ref_sink (_tmp159_); +#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 = _tmp159_; +#line 172 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp160_ = self->priv->notification; +#line 172 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_label_set_line_wrap (_tmp160_, TRUE); +#line 173 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp161_ = self->priv->notification; +#line 173 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_label_set_justify (_tmp161_, GTK_JUSTIFY_CENTER); +#line 175 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp162_ = (GtkBox*) 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" + _tmp163_ = self->priv->notification; +#line 175 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_box_pack_start (G_TYPE_CHECK_INSTANCE_CAST (_tmp162_, gtk_box_get_type (), GtkBox), G_TYPE_CHECK_INSTANCE_CAST (_tmp163_, gtk_widget_get_type (), GtkWidget), TRUE, TRUE, (guint) 0); +#line 177 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp164_ = source; +#line 177 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp165_ = dateable_get_exposure_time (_tmp164_); +#line 177 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + self->priv->original_time = _tmp165_; +#line 179 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp166_ = self->priv->original_time; +#line 179 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + if (_tmp166_ == ((time_t) 0)) { +#line 1328 "AdjustDateTimeDialog.c" + time_t _tmp167_; +#line 180 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp167_ = time (NULL); +#line 180 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + self->priv->original_time = _tmp167_; +#line 181 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + self->priv->no_original_time = TRUE; +#line 1336 "AdjustDateTimeDialog.c" + } +#line 184 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp168_ = self->priv->original_time; +#line 184 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + g_time_local (_tmp168_, &_tmp169_); +#line 184 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + adjust_date_time_dialog_set_time (self, &_tmp169_); +#line 185 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp170_ = config_facade_get_instance (); +#line 185 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp171_ = _tmp170_; +#line 185 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp172_ = configuration_facade_get_use_24_hour_time (G_TYPE_CHECK_INSTANCE_CAST (_tmp171_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)); +#line 185 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + adjust_date_time_dialog_set_original_time_label (self, _tmp172_); +#line 185 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _g_object_unref0 (_tmp171_); +#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 (_tmp136_); +#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 1376 "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 1383 "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_; + gboolean _tmp13_; + GtkSpinButton* _tmp28_; + struct tm _tmp29_; + gint _tmp30_; + GtkSpinButton* _tmp31_; + struct tm _tmp32_; + gint _tmp33_; + GtkComboBoxText* _tmp34_; + gint _tmp35_; +#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" + _tmp13_ = _tmp12_; +#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 (_tmp13_) { +#line 1454 "AdjustDateTimeDialog.c" + GtkComboBoxText* _tmp14_; + GtkSpinButton* _tmp15_; + struct tm _tmp16_; + gint _tmp17_; +#line 195 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp14_ = self->priv->system; +#line 195 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_combo_box_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, gtk_combo_box_get_type (), GtkComboBox), (gint) ADJUST_DATE_TIME_DIALOG_TIME_SYSTEM_24HR); +#line 196 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp15_ = self->priv->hour; +#line 196 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp16_ = *time; +#line 196 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp17_ = _tmp16_.tm_hour; +#line 196 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_spin_button_set_value (_tmp15_, (gdouble) _tmp17_); +#line 1471 "AdjustDateTimeDialog.c" + } else { + gint AMPM_hour = 0; + struct tm _tmp18_; + gint _tmp19_; + gint _tmp20_ = 0; + gint _tmp21_; + GtkSpinButton* _tmp23_; + AdjustDateTimeDialogTimeSystem _tmp24_ = 0; + struct tm _tmp25_; + gint _tmp26_; + GtkComboBoxText* _tmp27_; +#line 198 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp18_ = *time; +#line 198 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp19_ = _tmp18_.tm_hour; +#line 198 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + AMPM_hour = _tmp19_ % 12; +#line 199 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp21_ = AMPM_hour; +#line 199 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + if (_tmp21_ == 0) { +#line 199 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp20_ = 12; +#line 1495 "AdjustDateTimeDialog.c" + } else { + gint _tmp22_; +#line 199 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp22_ = AMPM_hour; +#line 199 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp20_ = _tmp22_; +#line 1502 "AdjustDateTimeDialog.c" + } +#line 199 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp23_ = self->priv->hour; +#line 199 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_spin_button_set_value (_tmp23_, (gdouble) _tmp20_); +#line 200 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp25_ = *time; +#line 200 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp26_ = _tmp25_.tm_hour; +#line 200 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + if (_tmp26_ >= 12) { +#line 200 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp24_ = ADJUST_DATE_TIME_DIALOG_TIME_SYSTEM_PM; +#line 1516 "AdjustDateTimeDialog.c" + } else { +#line 200 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp24_ = ADJUST_DATE_TIME_DIALOG_TIME_SYSTEM_AM; +#line 1520 "AdjustDateTimeDialog.c" + } +#line 200 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp27_ = self->priv->system; +#line 200 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_combo_box_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp27_, gtk_combo_box_get_type (), GtkComboBox), (gint) _tmp24_); +#line 1526 "AdjustDateTimeDialog.c" + } +#line 203 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp28_ = self->priv->minute; +#line 203 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp29_ = *time; +#line 203 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp30_ = _tmp29_.tm_min; +#line 203 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_spin_button_set_value (_tmp28_, (gdouble) _tmp30_); +#line 204 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp31_ = self->priv->second; +#line 204 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp32_ = *time; +#line 204 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp33_ = _tmp32_.tm_sec; +#line 204 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_spin_button_set_value (_tmp31_, (gdouble) _tmp33_); +#line 206 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp34_ = self->priv->system; +#line 206 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp35_ = gtk_combo_box_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp34_, gtk_combo_box_get_type (), GtkComboBox)); +#line 206 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + self->priv->previous_time_system = (AdjustDateTimeDialogTimeSystem) _tmp35_; +#line 1550 "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; + gboolean _tmp2_; + GtkLabel* _tmp3_; + time_t _tmp4_; + struct tm _tmp5_ = {0}; + gchar* _tmp6_; + gchar* _tmp7_; + gchar* _tmp8_; + gchar* _tmp9_; +#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" + _tmp2_ = use_24_hr_format; +#line 214 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + if (_tmp2_) { +#line 214 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp1_ = _ ("%m/%d/%Y, %H:%M:%S"); +#line 1581 "AdjustDateTimeDialog.c" + } else { +#line 215 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp1_ = _ ("%m/%d/%Y, %I:%M:%S %p"); +#line 1585 "AdjustDateTimeDialog.c" + } +#line 213 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp3_ = self->priv->original_time_label; +#line 213 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp4_ = self->priv->original_time; +#line 213 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + g_time_local (_tmp4_, &_tmp5_); +#line 213 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp6_ = g_time_format (&_tmp5_, _tmp1_); +#line 213 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp7_ = _tmp6_; +#line 213 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp8_ = g_strconcat (_ ("Original: "), _tmp7_, NULL); +#line 213 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp9_ = _tmp8_; +#line 213 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_label_set_text (_tmp3_, _tmp9_); +#line 213 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _g_free0 (_tmp9_); +#line 213 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _g_free0 (_tmp7_); +#line 1607 "AdjustDateTimeDialog.c" +} + + +static time_t adjust_date_time_dialog_get_time (AdjustDateTimeDialog* self) { + time_t result = 0; + struct tm time = {0}; + GtkSpinButton* _tmp0_; + gdouble _tmp1_; + GtkSpinButton* _tmp2_; + gdouble _tmp3_; + gint hour = 0; + GtkSpinButton* _tmp4_; + gdouble _tmp5_; + gint _tmp6_ = 0; + gboolean _tmp7_ = FALSE; + gint _tmp8_; + gint _tmp12_ = 0; + GtkComboBoxText* _tmp13_; + gint _tmp14_; + gint _tmp15_; + guint year = 0U; + guint month = 0U; + guint day = 0U; + GtkCalendar* _tmp16_; + guint _tmp17_ = 0U; + guint _tmp18_ = 0U; + guint _tmp19_ = 0U; + time_t _tmp20_; +#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" + _tmp1_ = gtk_spin_button_get_value (_tmp0_); +#line 221 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + time.tm_sec = (gint) _tmp1_; +#line 222 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp2_ = self->priv->minute; +#line 222 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp3_ = gtk_spin_button_get_value (_tmp2_); +#line 222 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + time.tm_min = (gint) _tmp3_; +#line 225 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp4_ = self->priv->hour; +#line 225 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp5_ = gtk_spin_button_get_value (_tmp4_); +#line 225 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + hour = (gint) _tmp5_; +#line 226 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp8_ = hour; +#line 226 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + if (_tmp8_ == 12) { +#line 1662 "AdjustDateTimeDialog.c" + GtkComboBoxText* _tmp9_; + gint _tmp10_; +#line 226 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp9_ = self->priv->system; +#line 226 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp10_ = gtk_combo_box_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, gtk_combo_box_get_type (), GtkComboBox)); +#line 226 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp7_ = _tmp10_ != ((gint) ADJUST_DATE_TIME_DIALOG_TIME_SYSTEM_24HR); +#line 1671 "AdjustDateTimeDialog.c" + } else { +#line 226 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp7_ = FALSE; +#line 1675 "AdjustDateTimeDialog.c" + } +#line 226 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + if (_tmp7_) { +#line 226 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp6_ = 0; +#line 1681 "AdjustDateTimeDialog.c" + } else { + gint _tmp11_; +#line 226 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp11_ = hour; +#line 226 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp6_ = _tmp11_; +#line 1688 "AdjustDateTimeDialog.c" + } +#line 226 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + time.tm_hour = _tmp6_; +#line 227 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp13_ = self->priv->system; +#line 227 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp14_ = gtk_combo_box_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, gtk_combo_box_get_type (), GtkComboBox)); +#line 227 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + if (_tmp14_ == ((gint) ADJUST_DATE_TIME_DIALOG_TIME_SYSTEM_PM)) { +#line 227 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp12_ = 12; +#line 1700 "AdjustDateTimeDialog.c" + } else { +#line 227 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp12_ = 0; +#line 1704 "AdjustDateTimeDialog.c" + } +#line 227 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp15_ = time.tm_hour; +#line 227 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + time.tm_hour = _tmp15_ + _tmp12_; +#line 230 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp16_ = self->priv->calendar; +#line 230 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_calendar_get_date (_tmp16_, &_tmp17_, &_tmp18_, &_tmp19_); +#line 230 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + year = _tmp17_; +#line 230 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + month = _tmp18_; +#line 230 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + day = _tmp19_; +#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" + _tmp20_ = mktime (&time); +#line 237 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + result = _tmp20_; +#line 237 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + return result; +#line 1734 "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; + gint _tmp0_; +#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" + _tmp0_ = gtk_dialog_run (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_dialog_get_type (), GtkDialog)); +#line 246 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + if (_tmp0_ == ((gint) GTK_RESPONSE_OK)) { +#line 1755 "AdjustDateTimeDialog.c" + gboolean _tmp1_; + GtkRadioButton* _tmp5_; + gboolean _tmp6_; + GtkRadioButton* _tmp7_; + gboolean _tmp8_; + gboolean _tmp9_; + GtkCheckButton* _tmp13_; + gboolean _tmp14_; + GtkCheckButton* _tmp15_; + gboolean _tmp16_; + gboolean _tmp17_; +#line 247 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp1_ = self->priv->no_original_time; +#line 247 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + if (_tmp1_) { +#line 1771 "AdjustDateTimeDialog.c" + time_t _tmp2_; +#line 248 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp2_ = adjust_date_time_dialog_get_time (self); +#line 248 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _vala_time_shift = (gint64) _tmp2_; +#line 1777 "AdjustDateTimeDialog.c" + } else { + time_t _tmp3_; + time_t _tmp4_; +#line 250 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp3_ = adjust_date_time_dialog_get_time (self); +#line 250 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp4_ = self->priv->original_time; +#line 250 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _vala_time_shift = (gint64) (_tmp3_ - _tmp4_); +#line 1787 "AdjustDateTimeDialog.c" + } +#line 252 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp5_ = self->priv->relativity_radio_button; +#line 252 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp6_ = gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, gtk_toggle_button_get_type (), GtkToggleButton)); +#line 252 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _vala_keep_relativity = _tmp6_; +#line 254 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp7_ = self->priv->relativity_radio_button; +#line 254 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp8_ = gtk_widget_get_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, gtk_widget_get_type (), GtkWidget)); +#line 254 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp9_ = _tmp8_; +#line 254 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + if (_tmp9_) { +#line 1803 "AdjustDateTimeDialog.c" + ConfigFacade* _tmp10_; + ConfigFacade* _tmp11_; + gboolean _tmp12_; +#line 255 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp10_ = config_facade_get_instance (); +#line 255 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp11_ = _tmp10_; +#line 255 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp12_ = _vala_keep_relativity; +#line 255 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + configuration_facade_set_keep_relativity (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), _tmp12_); +#line 255 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _g_object_unref0 (_tmp11_); +#line 1817 "AdjustDateTimeDialog.c" + } +#line 257 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp13_ = self->priv->modify_originals_check_button; +#line 257 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp14_ = gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, gtk_toggle_button_get_type (), GtkToggleButton)); +#line 257 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _vala_modify_originals = _tmp14_; +#line 259 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp15_ = self->priv->modify_originals_check_button; +#line 259 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp16_ = gtk_widget_get_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, gtk_widget_get_type (), GtkWidget)); +#line 259 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp17_ = _tmp16_; +#line 259 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + if (_tmp17_) { +#line 1833 "AdjustDateTimeDialog.c" + ConfigFacade* _tmp18_; + ConfigFacade* _tmp19_; + gboolean _tmp20_; +#line 260 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp18_ = config_facade_get_instance (); +#line 260 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp19_ = _tmp18_; +#line 260 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp20_ = _vala_modify_originals; +#line 260 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + configuration_facade_set_modify_originals (G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), _tmp20_); +#line 260 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _g_object_unref0 (_tmp19_); +#line 1847 "AdjustDateTimeDialog.c" + } +#line 262 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + response = TRUE; +#line 1851 "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 1859 "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 1869 "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 1875 "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 1881 "AdjustDateTimeDialog.c" + } +#line 271 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + return result; +#line 1885 "AdjustDateTimeDialog.c" +} + + +static gboolean adjust_date_time_dialog_on_spin_button_output (AdjustDateTimeDialog* self, GtkSpinButton* button) { + gboolean result = FALSE; + GtkSpinButton* _tmp0_; + GtkSpinButton* _tmp1_; + gdouble _tmp2_; + gchar* _tmp3_; + gchar* _tmp4_; +#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_ = button; +#line 275 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp1_ = button; +#line 275 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp2_ = gtk_spin_button_get_value (_tmp1_); +#line 275 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp3_ = g_strdup_printf ("%02d", (gint) _tmp2_); +#line 275 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp4_ = _tmp3_; +#line 275 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_entry_set_text (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_entry_get_type (), GtkEntry), _tmp4_); +#line 275 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _g_free0 (_tmp4_); +#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 1920 "AdjustDateTimeDialog.c" +} + + +static void adjust_date_time_dialog_on_time_changed (AdjustDateTimeDialog* self) { + gint64 time_shift = 0LL; + time_t _tmp0_; + time_t _tmp1_; + GtkCalendar* _tmp2_; + GtkCalendar* _tmp3_; + GtkComboBoxText* _tmp4_; + gint _tmp5_; + gboolean _tmp6_ = FALSE; + gboolean _tmp7_ = FALSE; + gint64 _tmp8_; +#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_ = adjust_date_time_dialog_get_time (self); +#line 283 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp1_ = self->priv->original_time; +#line 283 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + time_shift = ((gint64) _tmp0_) - ((gint64) _tmp1_); +#line 284 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp2_ = self->priv->calendar; +#line 284 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + g_object_notify (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, G_TYPE_OBJECT, GObject), "year"); +#line 285 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp3_ = self->priv->calendar; +#line 285 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + g_object_notify (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, G_TYPE_OBJECT, GObject), "month"); +#line 287 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp4_ = self->priv->system; +#line 287 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp5_ = gtk_combo_box_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_combo_box_get_type (), GtkComboBox)); +#line 287 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + self->priv->previous_time_system = (AdjustDateTimeDialogTimeSystem) _tmp5_; +#line 289 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp8_ = time_shift; +#line 289 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + if (_tmp8_ == ((gint64) 0)) { +#line 289 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp7_ = TRUE; +#line 1963 "AdjustDateTimeDialog.c" + } else { + gboolean _tmp9_; +#line 289 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp9_ = self->priv->no_original_time; +#line 289 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp7_ = _tmp9_; +#line 1970 "AdjustDateTimeDialog.c" + } +#line 289 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + if (_tmp7_) { +#line 289 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp6_ = TRUE; +#line 1976 "AdjustDateTimeDialog.c" + } else { + gboolean _tmp10_ = FALSE; + GtkRadioButton* _tmp11_; + gboolean _tmp12_; +#line 289 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp11_ = self->priv->batch_radio_button; +#line 289 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp12_ = gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, gtk_toggle_button_get_type (), GtkToggleButton)); +#line 289 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + if (_tmp12_) { +#line 1987 "AdjustDateTimeDialog.c" + GtkRadioButton* _tmp13_; + gboolean _tmp14_; + gboolean _tmp15_; +#line 290 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp13_ = self->priv->batch_radio_button; +#line 290 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp14_ = gtk_widget_get_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, gtk_widget_get_type (), GtkWidget)); +#line 290 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp15_ = _tmp14_; +#line 290 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp10_ = _tmp15_; +#line 1999 "AdjustDateTimeDialog.c" + } else { +#line 289 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp10_ = FALSE; +#line 2003 "AdjustDateTimeDialog.c" + } +#line 289 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp6_ = _tmp10_; +#line 2007 "AdjustDateTimeDialog.c" + } +#line 289 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + if (_tmp6_) { +#line 2011 "AdjustDateTimeDialog.c" + GtkLabel* _tmp16_; +#line 291 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp16_ = self->priv->notification; +#line 291 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_widget_hide (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, gtk_widget_get_type (), GtkWidget)); +#line 2017 "AdjustDateTimeDialog.c" + } else { + gboolean forward = FALSE; + gint64 _tmp17_; + gint days = 0; + gint hours = 0; + gint minutes = 0; + gint seconds = 0; + gint64 _tmp18_; + gint64 _tmp19_; + gint64 _tmp20_; + gint64 _tmp21_; + gint64 _tmp22_; + gint64 _tmp23_; + gint64 _tmp24_; + gint64 _tmp25_; + const gchar* _tmp26_ = NULL; + gboolean _tmp27_; + gchar* shift_status = NULL; + gchar* _tmp28_; + GtkLabel* _tmp29_; + const gchar* _tmp30_; + gint _tmp31_; + gint _tmp32_; + gint _tmp33_; + gint _tmp34_; + gint _tmp35_; + gint _tmp36_; + gint _tmp37_; + gint _tmp38_; + gchar* _tmp39_; + gchar* _tmp40_; + GtkLabel* _tmp41_; +#line 293 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp17_ = time_shift; +#line 293 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + forward = _tmp17_ > ((gint64) 0); +#line 296 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp18_ = time_shift; +#line 296 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp19_ = llabs (_tmp18_); +#line 296 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + time_shift = _tmp19_; +#line 298 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp20_ = time_shift; +#line 298 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + days = (gint) (_tmp20_ / ADJUST_DATE_TIME_DIALOG_SECONDS_IN_DAY); +#line 299 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp21_ = time_shift; +#line 299 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + time_shift = _tmp21_ % ADJUST_DATE_TIME_DIALOG_SECONDS_IN_DAY; +#line 300 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp22_ = time_shift; +#line 300 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + hours = (gint) (_tmp22_ / ADJUST_DATE_TIME_DIALOG_SECONDS_IN_HOUR); +#line 301 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp23_ = time_shift; +#line 301 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + time_shift = _tmp23_ % ADJUST_DATE_TIME_DIALOG_SECONDS_IN_HOUR; +#line 302 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp24_ = time_shift; +#line 302 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + minutes = (gint) (_tmp24_ / ADJUST_DATE_TIME_DIALOG_SECONDS_IN_MINUTE); +#line 303 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp25_ = time_shift; +#line 303 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + seconds = (gint) (_tmp25_ % ADJUST_DATE_TIME_DIALOG_SECONDS_IN_MINUTE); +#line 305 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp27_ = forward; +#line 305 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + if (_tmp27_) { +#line 306 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp26_ = _ ("Exposure time will be shifted forward by\n" \ +"%d %s, %d %s, %d %s, and %d %s."); +#line 2090 "AdjustDateTimeDialog.c" + } else { +#line 307 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp26_ = _ ("Exposure time will be shifted backward by\n" \ +"%d %s, %d %s, %d %s, and %d %s."); +#line 2094 "AdjustDateTimeDialog.c" + } +#line 305 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp28_ = g_strdup (_tmp26_); +#line 305 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + shift_status = _tmp28_; +#line 309 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp29_ = self->priv->notification; +#line 309 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp30_ = shift_status; +#line 309 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp31_ = days; +#line 309 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp32_ = days; +#line 309 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp33_ = hours; +#line 309 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp34_ = hours; +#line 309 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp35_ = minutes; +#line 309 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp36_ = minutes; +#line 309 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp37_ = seconds; +#line 309 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp38_ = seconds; +#line 309 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp39_ = g_strdup_printf (_tmp30_, _tmp31_, ngettext ("day", "days", (gulong) _tmp32_), _tmp33_, ngettext ("hour", "hours", (gulong) _tmp34_), _tmp35_, ngettext ("minute", "minutes", (gulong) _tmp36_), _tmp37_, ngettext ("second", "seconds", (gulong) _tmp38_)); +#line 309 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp40_ = _tmp39_; +#line 309 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_label_set_text (_tmp29_, _tmp40_); +#line 309 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _g_free0 (_tmp40_); +#line 314 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp41_ = self->priv->notification; +#line 314 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_widget_show (G_TYPE_CHECK_INSTANCE_CAST (_tmp41_, gtk_widget_get_type (), GtkWidget)); +#line 289 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _g_free0 (shift_status); +#line 2134 "AdjustDateTimeDialog.c" + } +} + + +static void adjust_date_time_dialog_on_time_system_changed (AdjustDateTimeDialog* self) { + AdjustDateTimeDialogTimeSystem _tmp0_; + GtkComboBoxText* _tmp1_; + gint _tmp2_; + ConfigFacade* _tmp3_; + ConfigFacade* _tmp4_; + GtkComboBoxText* _tmp5_; + gint _tmp6_; + GtkComboBoxText* _tmp7_; + gint _tmp8_; +#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" + _tmp2_ = gtk_combo_box_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_combo_box_get_type (), GtkComboBox)); +#line 319 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + if (_tmp0_ == _tmp2_) { +#line 320 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + return; +#line 2161 "AdjustDateTimeDialog.c" + } +#line 322 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp3_ = config_facade_get_instance (); +#line 322 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp4_ = _tmp3_; +#line 322 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp5_ = self->priv->system; +#line 322 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp6_ = gtk_combo_box_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, gtk_combo_box_get_type (), GtkComboBox)); +#line 322 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + configuration_facade_set_use_24_hour_time (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), _tmp6_ == ((gint) ADJUST_DATE_TIME_DIALOG_TIME_SYSTEM_24HR)); +#line 322 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _g_object_unref0 (_tmp4_); +#line 324 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp7_ = self->priv->system; +#line 324 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp8_ = gtk_combo_box_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, gtk_combo_box_get_type (), GtkComboBox)); +#line 324 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + if (_tmp8_ == ((gint) ADJUST_DATE_TIME_DIALOG_TIME_SYSTEM_24HR)) { +#line 2181 "AdjustDateTimeDialog.c" + gint _tmp9_ = 0; + GtkSpinButton* _tmp10_; + gdouble _tmp11_; + gint time = 0; + gint _tmp14_ = 0; + AdjustDateTimeDialogTimeSystem _tmp15_; + gint _tmp16_; + GtkSpinButton* _tmp17_; + GtkSpinButton* _tmp18_; + gint _tmp19_; +#line 325 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp10_ = self->priv->hour; +#line 325 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp11_ = gtk_spin_button_get_value (_tmp10_); +#line 325 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + if (_tmp11_ == 12.0) { +#line 325 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp9_ = 0; +#line 2200 "AdjustDateTimeDialog.c" + } else { + GtkSpinButton* _tmp12_; + gdouble _tmp13_; +#line 325 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp12_ = self->priv->hour; +#line 325 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp13_ = gtk_spin_button_get_value (_tmp12_); +#line 325 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp9_ = (gint) _tmp13_; +#line 2210 "AdjustDateTimeDialog.c" + } +#line 325 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + time = _tmp9_; +#line 326 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp15_ = self->priv->previous_time_system; +#line 326 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + if (_tmp15_ == ADJUST_DATE_TIME_DIALOG_TIME_SYSTEM_PM) { +#line 326 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp14_ = 12; +#line 2220 "AdjustDateTimeDialog.c" + } else { +#line 326 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp14_ = 0; +#line 2224 "AdjustDateTimeDialog.c" + } +#line 326 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp16_ = time; +#line 326 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + time = _tmp16_ + _tmp14_; +#line 328 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp17_ = self->priv->hour; +#line 328 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_spin_button_set_range (_tmp17_, (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" + _tmp18_ = self->priv->hour; +#line 331 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp19_ = time; +#line 331 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_spin_button_set_value (_tmp18_, (gdouble) _tmp19_); +#line 2242 "AdjustDateTimeDialog.c" + } else { + gint AMPM_hour = 0; + GtkSpinButton* _tmp20_; + gdouble _tmp21_; + GtkSpinButton* _tmp22_; + gint _tmp23_ = 0; + gint _tmp24_; + GtkSpinButton* _tmp26_; +#line 333 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp20_ = self->priv->hour; +#line 333 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp21_ = gtk_spin_button_get_value (_tmp20_); +#line 333 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + AMPM_hour = ((gint) _tmp21_) % 12; +#line 335 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp22_ = self->priv->hour; +#line 335 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_spin_button_set_range (_tmp22_, (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" + _tmp24_ = AMPM_hour; +#line 338 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + if (_tmp24_ == 0) { +#line 338 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp23_ = 12; +#line 2269 "AdjustDateTimeDialog.c" + } else { + gint _tmp25_; +#line 338 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp25_ = AMPM_hour; +#line 338 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp23_ = _tmp25_; +#line 2276 "AdjustDateTimeDialog.c" + } +#line 338 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + _tmp26_ = self->priv->hour; +#line 338 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + gtk_spin_button_set_value (_tmp26_, (gdouble) _tmp23_); +#line 2282 "AdjustDateTimeDialog.c" + } +#line 341 "/home/jens/Source/shotwell/src/dialogs/AdjustDateTimeDialog.vala" + adjust_date_time_dialog_on_time_changed (self); +#line 2286 "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 2297 "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 2306 "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 2336 "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..9dd3cd1 --- /dev/null +++ b/src/dialogs/EntryMultiCompletion.c @@ -0,0 +1,1124 @@ +/* EntryMultiCompletion.c generated by valac 0.36.6, 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; +#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)) +enum { + ENTRY_MULTI_COMPLETION_DUMMY_PROPERTY +}; +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 78 "EntryMultiCompletion.c" +} + + +EntryMultiCompletion* entry_multi_completion_construct (GType object_type, GeeCollection* completion_list, const gchar* delimiter) { + EntryMultiCompletion * self = NULL; + gboolean _tmp0_ = FALSE; + const gchar* _tmp1_; + const gchar* _tmp5_; + gchar* _tmp6_; + GeeCollection* _tmp7_; + GtkListStore* _tmp8_; + GtkListStore* _tmp9_; +#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" + _tmp1_ = delimiter; +#line 14 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + if (_tmp1_ == NULL) { +#line 14 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp0_ = TRUE; +#line 101 "EntryMultiCompletion.c" + } else { + const gchar* _tmp2_; + gint _tmp3_; + gint _tmp4_; +#line 14 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp2_ = delimiter; +#line 14 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp3_ = strlen (_tmp2_); +#line 14 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp4_ = _tmp3_; +#line 14 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp0_ = _tmp4_ == 1; +#line 114 "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" + _tmp5_ = delimiter; +#line 15 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp6_ = g_strdup (_tmp5_); +#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 = _tmp6_; +#line 17 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp7_ = completion_list; +#line 17 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp8_ = entry_multi_completion_create_completion_store (_tmp7_); +#line 17 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp9_ = _tmp8_; +#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 (_tmp9_, GTK_TYPE_TREE_MODEL, GtkTreeModel)); +#line 17 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _g_object_unref0 (_tmp9_); +#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 142 "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 149 "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; + GeeCollection* _tmp1_; + GeeIterator* _tmp2_; +#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_ = completion_list; +#line 25 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp2_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_ITERABLE, GeeIterable)); +#line 25 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + completion_iter = _tmp2_; +#line 26 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + while (TRUE) { +#line 175 "EntryMultiCompletion.c" + GeeIterator* _tmp3_; + gboolean _tmp4_; + GtkListStore* _tmp5_; + GtkTreeIter _tmp6_ = {0}; + GtkListStore* _tmp7_; + GtkTreeIter _tmp8_; + GeeIterator* _tmp9_; + gpointer _tmp10_; + gchar* _tmp11_; +#line 26 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp3_ = completion_iter; +#line 26 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp4_ = gee_iterator_next (_tmp3_); +#line 26 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + if (!_tmp4_) { +#line 26 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + break; +#line 193 "EntryMultiCompletion.c" + } +#line 27 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp5_ = completion_store; +#line 27 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + gtk_list_store_append (_tmp5_, &_tmp6_); +#line 27 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + store_iter = _tmp6_; +#line 28 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp7_ = completion_store; +#line 28 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp8_ = store_iter; +#line 28 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp9_ = completion_iter; +#line 28 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp10_ = gee_iterator_get (_tmp9_); +#line 28 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp11_ = (gchar*) _tmp10_; +#line 28 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + gtk_list_store_set (_tmp7_, &_tmp8_, 0, _tmp11_, -1, -1); +#line 28 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _g_free0 (_tmp11_); +#line 215 "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 223 "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 230 "EntryMultiCompletion.c" +} + + +static gchar* string_strip (const gchar* self) { + gchar* result = NULL; + gchar* _result_ = NULL; + gchar* _tmp0_; + const gchar* _tmp1_; +#line 1234 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + g_return_val_if_fail (self != NULL, NULL); +#line 1235 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp0_ = g_strdup (self); +#line 1235 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _result_ = _tmp0_; +#line 1236 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp1_ = _result_; +#line 1236 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + g_strstrip (_tmp1_); +#line 1237 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + result = _result_; +#line 1237 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + return result; +#line 253 "EntryMultiCompletion.c" +} + + +static gboolean string_contains (const gchar* self, const gchar* needle) { + gboolean result = FALSE; + const gchar* _tmp0_; + gchar* _tmp1_; +#line 1403 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + g_return_val_if_fail (self != NULL, FALSE); +#line 1403 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + g_return_val_if_fail (needle != NULL, FALSE); +#line 1404 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp0_ = needle; +#line 1404 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp1_ = strstr ((gchar*) self, (gchar*) _tmp0_); +#line 1404 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + result = _tmp1_ != NULL; +#line 1404 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + return result; +#line 273 "EntryMultiCompletion.c" +} + + +static gint string_last_index_of_char (const gchar* self, gunichar c, gint start_index) { + gint result = 0; + gchar* _result_ = NULL; + gint _tmp0_; + gunichar _tmp1_; + gchar* _tmp2_; + gchar* _tmp3_; +#line 1041 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + g_return_val_if_fail (self != NULL, 0); +#line 1042 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp0_ = start_index; +#line 1042 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp1_ = c; +#line 1042 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp2_ = g_utf8_strrchr (((gchar*) self) + _tmp0_, (gssize) -1, _tmp1_); +#line 1042 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _result_ = _tmp2_; +#line 1044 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp3_ = _result_; +#line 1044 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + if (_tmp3_ != NULL) { +#line 298 "EntryMultiCompletion.c" + gchar* _tmp4_; +#line 1045 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp4_ = _result_; +#line 1045 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + result = (gint) (_tmp4_ - ((gchar*) self)); +#line 1045 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + return result; +#line 306 "EntryMultiCompletion.c" + } else { +#line 1047 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + result = -1; +#line 1047 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + return result; +#line 312 "EntryMultiCompletion.c" + } +} + + +static gchar string_get (const gchar* self, glong index) { + gchar result = '\0'; + glong _tmp0_; + gchar _tmp1_; +#line 1110 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + g_return_val_if_fail (self != NULL, '\0'); +#line 1111 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp0_ = index; +#line 1111 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp1_ = ((gchar*) self)[_tmp0_]; +#line 1111 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + result = _tmp1_; +#line 1111 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + return result; +#line 331 "EntryMultiCompletion.c" +} + + +static gboolean entry_multi_completion_match_func (EntryMultiCompletion* self, GtkEntryCompletion* completion, const gchar* key, GtkTreeIter* iter) { + gboolean result = FALSE; + GtkTreeModel* model = NULL; + GtkEntryCompletion* _tmp0_; + GtkTreeModel* _tmp1_; + GtkTreeModel* _tmp2_; + gchar* possible_match = NULL; + GtkTreeModel* _tmp3_; + GtkTreeIter _tmp4_; + const gchar* _tmp5_; + gchar* _tmp6_; + gchar* _tmp7_; + gchar* _tmp8_; + gchar* normed_key = NULL; + const gchar* _tmp9_; + gchar* _tmp10_; + const gchar* _tmp11_; +#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_ = completion; +#line 35 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp1_ = gtk_entry_completion_get_model (_tmp0_); +#line 35 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp2_ = _g_object_ref0 (_tmp1_); +#line 35 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + model = _tmp2_; +#line 37 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp3_ = model; +#line 37 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp4_ = *iter; +#line 37 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + gtk_tree_model_get (_tmp3_, &_tmp4_, 0, &possible_match, -1); +#line 43 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp5_ = possible_match; +#line 43 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp6_ = g_utf8_casefold (_tmp5_, (gssize) -1); +#line 43 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp7_ = _tmp6_; +#line 43 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp8_ = g_utf8_normalize (_tmp7_, (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 = _tmp8_; +#line 43 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _g_free0 (_tmp7_); +#line 44 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp9_ = key; +#line 44 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp10_ = g_utf8_normalize (_tmp9_, (gssize) -1, G_NORMALIZE_ALL_COMPOSE); +#line 44 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + normed_key = _tmp10_; +#line 46 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp11_ = self->priv->delimiter; +#line 46 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + if (_tmp11_ == NULL) { +#line 398 "EntryMultiCompletion.c" + const gchar* _tmp12_; + const gchar* _tmp13_; + gchar* _tmp14_; + gchar* _tmp15_; + gboolean _tmp16_; + gboolean _tmp17_; +#line 47 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp12_ = possible_match; +#line 47 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp13_ = normed_key; +#line 47 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp14_ = string_strip (_tmp13_); +#line 47 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp15_ = _tmp14_; +#line 47 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp16_ = g_str_has_prefix (_tmp12_, _tmp15_); +#line 47 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp17_ = _tmp16_; +#line 47 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _g_free0 (_tmp15_); +#line 47 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + result = _tmp17_; +#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 429 "EntryMultiCompletion.c" + } else { + const gchar* _tmp18_; + const gchar* _tmp19_; + gboolean _tmp20_; + gchar* last_part = NULL; + const gchar* _tmp31_; + gchar* _tmp32_; + gchar* _tmp33_; + const gchar* _tmp34_; + gchar* _tmp35_; + gchar* _tmp36_; + const gchar* _tmp37_; + gint _tmp38_; + gint _tmp39_; + const gchar* _tmp40_; + const gchar* _tmp41_; + gchar* _tmp42_; + gchar* _tmp43_; + gboolean _tmp44_; + gboolean _tmp45_; +#line 49 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp18_ = normed_key; +#line 49 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp19_ = self->priv->delimiter; +#line 49 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp20_ = string_contains (_tmp18_, _tmp19_); +#line 49 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + if (_tmp20_) { +#line 458 "EntryMultiCompletion.c" + gint offset = 0; + const gchar* _tmp21_; + const gchar* _tmp22_; + const gchar* _tmp23_; + gchar _tmp24_; + gint _tmp25_; + gint _tmp26_; + gint position = 0; + GtkWidget* _tmp27_; + gint _tmp28_; + gint _tmp29_; + gint _tmp30_; +#line 51 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp21_ = normed_key; +#line 51 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp22_ = normed_key; +#line 51 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp23_ = self->priv->delimiter; +#line 51 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp24_ = string_get (_tmp23_, (glong) 0); +#line 51 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp25_ = string_last_index_of_char (_tmp22_, (gunichar) _tmp24_, 0); +#line 51 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp26_ = g_utf8_strlen (_tmp21_, (gssize) _tmp25_); +#line 51 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + offset = _tmp26_; +#line 52 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp27_ = 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" + _tmp28_ = gtk_editable_get_position (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (_tmp27_, gtk_entry_get_type (), GtkEntry), GTK_TYPE_EDITABLE, GtkEditable)); +#line 52 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + position = _tmp28_; +#line 53 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp29_ = position; +#line 53 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp30_ = offset; +#line 53 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + if (_tmp29_ <= _tmp30_) { +#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 507 "EntryMultiCompletion.c" + } + } +#line 57 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp31_ = normed_key; +#line 57 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp32_ = string_strip (_tmp31_); +#line 57 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp33_ = _tmp32_; +#line 57 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp34_ = self->priv->delimiter; +#line 57 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp35_ = entry_multi_completion_get_last_part (_tmp33_, _tmp34_); +#line 57 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp36_ = _tmp35_; +#line 57 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _g_free0 (_tmp33_); +#line 57 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + last_part = _tmp36_; +#line 59 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp37_ = last_part; +#line 59 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp38_ = strlen (_tmp37_); +#line 59 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp39_ = _tmp38_; +#line 59 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + if (_tmp39_ == 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 546 "EntryMultiCompletion.c" + } +#line 62 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp40_ = possible_match; +#line 62 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp41_ = last_part; +#line 62 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp42_ = string_strip (_tmp41_); +#line 62 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp43_ = _tmp42_; +#line 62 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp44_ = g_str_has_prefix (_tmp40_, _tmp43_); +#line 62 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp45_ = _tmp44_; +#line 62 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _g_free0 (_tmp43_); +#line 62 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + result = _tmp45_; +#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 574 "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 582 "EntryMultiCompletion.c" +} + + +static glong string_strnlen (gchar* str, glong maxlen) { + glong result = 0L; + gchar* end = NULL; + gchar* _tmp0_; + glong _tmp1_; + gchar* _tmp2_; + gchar* _tmp3_; +#line 1322 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp0_ = str; +#line 1322 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp1_ = maxlen; +#line 1322 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp2_ = memchr (_tmp0_, 0, (gsize) _tmp1_); +#line 1322 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + end = _tmp2_; +#line 1323 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp3_ = end; +#line 1323 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + if (_tmp3_ == NULL) { +#line 605 "EntryMultiCompletion.c" + glong _tmp4_; +#line 1324 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp4_ = maxlen; +#line 1324 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + result = _tmp4_; +#line 1324 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + return result; +#line 613 "EntryMultiCompletion.c" + } else { + gchar* _tmp5_; + gchar* _tmp6_; +#line 1326 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp5_ = end; +#line 1326 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp6_ = str; +#line 1326 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + result = (glong) (_tmp5_ - _tmp6_); +#line 1326 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + return result; +#line 625 "EntryMultiCompletion.c" + } +} + + +static gchar* string_substring (const gchar* self, glong offset, glong len) { + gchar* result = NULL; + glong string_length = 0L; + gboolean _tmp0_ = FALSE; + glong _tmp1_; + glong _tmp8_; + glong _tmp14_; + glong _tmp17_; + glong _tmp18_; + glong _tmp19_; + glong _tmp20_; + glong _tmp21_; + gchar* _tmp22_; +#line 1333 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + g_return_val_if_fail (self != NULL, NULL); +#line 1335 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp1_ = offset; +#line 1335 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + if (_tmp1_ >= ((glong) 0)) { +#line 649 "EntryMultiCompletion.c" + glong _tmp2_; +#line 1335 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp2_ = len; +#line 1335 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp0_ = _tmp2_ >= ((glong) 0); +#line 655 "EntryMultiCompletion.c" + } else { +#line 1335 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp0_ = FALSE; +#line 659 "EntryMultiCompletion.c" + } +#line 1335 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + if (_tmp0_) { +#line 663 "EntryMultiCompletion.c" + glong _tmp3_; + glong _tmp4_; + glong _tmp5_; +#line 1337 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp3_ = offset; +#line 1337 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp4_ = len; +#line 1337 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp5_ = string_strnlen ((gchar*) self, _tmp3_ + _tmp4_); +#line 1337 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + string_length = _tmp5_; +#line 675 "EntryMultiCompletion.c" + } else { + gint _tmp6_; + gint _tmp7_; +#line 1339 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp6_ = strlen (self); +#line 1339 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp7_ = _tmp6_; +#line 1339 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + string_length = (glong) _tmp7_; +#line 685 "EntryMultiCompletion.c" + } +#line 1342 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp8_ = offset; +#line 1342 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + if (_tmp8_ < ((glong) 0)) { +#line 691 "EntryMultiCompletion.c" + glong _tmp9_; + glong _tmp10_; + glong _tmp11_; +#line 1343 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp9_ = string_length; +#line 1343 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp10_ = offset; +#line 1343 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + offset = _tmp9_ + _tmp10_; +#line 1344 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp11_ = offset; +#line 1344 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + g_return_val_if_fail (_tmp11_ >= ((glong) 0), NULL); +#line 705 "EntryMultiCompletion.c" + } else { + glong _tmp12_; + glong _tmp13_; +#line 1346 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp12_ = offset; +#line 1346 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp13_ = string_length; +#line 1346 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + g_return_val_if_fail (_tmp12_ <= _tmp13_, NULL); +#line 715 "EntryMultiCompletion.c" + } +#line 1348 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp14_ = len; +#line 1348 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + if (_tmp14_ < ((glong) 0)) { +#line 721 "EntryMultiCompletion.c" + glong _tmp15_; + glong _tmp16_; +#line 1349 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp15_ = string_length; +#line 1349 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp16_ = offset; +#line 1349 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + len = _tmp15_ - _tmp16_; +#line 730 "EntryMultiCompletion.c" + } +#line 1351 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp17_ = offset; +#line 1351 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp18_ = len; +#line 1351 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp19_ = string_length; +#line 1351 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + g_return_val_if_fail ((_tmp17_ + _tmp18_) <= _tmp19_, NULL); +#line 1352 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp20_ = offset; +#line 1352 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp21_ = len; +#line 1352 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp22_ = g_strndup (((gchar*) self) + _tmp20_, (gsize) _tmp21_); +#line 1352 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + result = _tmp22_; +#line 1352 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + return result; +#line 750 "EntryMultiCompletion.c" +} + + +static gboolean entry_multi_completion_real_match_selected (GtkEntryCompletion* base, GtkTreeModel* model, GtkTreeIter* iter) { + EntryMultiCompletion * self; + gboolean result = FALSE; + gchar* match = NULL; + GtkTreeModel* _tmp0_; + GtkTreeIter _tmp1_; + GtkEntry* entry = NULL; + GtkWidget* _tmp2_; + GtkEntry* _tmp3_; + gchar* old_text = NULL; + GtkEntry* _tmp4_; + const gchar* _tmp5_; + gchar* _tmp6_; + const gchar* _tmp7_; + gint _tmp8_; + gint _tmp9_; + const gchar* _tmp24_ = NULL; + const gchar* _tmp25_; + gchar* new_text = NULL; + const gchar* _tmp26_; + const gchar* _tmp27_; + gchar* _tmp28_; + gchar* _tmp29_; + const gchar* _tmp30_; + gchar* _tmp31_; + gchar* _tmp32_; + gchar* _tmp33_; + gchar* _tmp34_; + GtkEntry* _tmp35_; + GtkEntry* _tmp36_; + gint _tmp37_; + gint _tmp38_; +#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_ = model; +#line 68 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp1_ = *iter; +#line 68 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + gtk_tree_model_get (_tmp0_, &_tmp1_, 0, &match, -1); +#line 70 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp2_ = 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" + _tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_entry_get_type (), GtkEntry)); +#line 70 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + entry = _tmp3_; +#line 72 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp4_ = entry; +#line 72 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp5_ = gtk_entry_get_text (_tmp4_); +#line 72 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp6_ = g_utf8_normalize (_tmp5_, (gssize) -1, G_NORMALIZE_ALL_COMPOSE); +#line 72 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + old_text = _tmp6_; +#line 73 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp7_ = old_text; +#line 73 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp8_ = strlen (_tmp7_); +#line 73 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp9_ = _tmp8_; +#line 73 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + if (_tmp9_ > 0) { +#line 820 "EntryMultiCompletion.c" + const gchar* _tmp10_; + const gchar* _tmp11_; + gboolean _tmp12_; +#line 74 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp10_ = old_text; +#line 74 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp11_ = self->priv->delimiter; +#line 74 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp12_ = string_contains (_tmp10_, _tmp11_); +#line 74 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + if (_tmp12_) { +#line 832 "EntryMultiCompletion.c" + const gchar* _tmp13_ = NULL; + const gchar* _tmp14_; + const gchar* _tmp15_; + const gchar* _tmp16_; + const gchar* _tmp17_; + gchar _tmp18_; + gint _tmp19_; + gchar* _tmp20_; + gchar* _tmp21_; + gchar* _tmp22_; +#line 75 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp14_ = self->priv->delimiter; +#line 75 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + if (g_strcmp0 (_tmp14_, " ") != 0) { +#line 75 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp13_ = " "; +#line 849 "EntryMultiCompletion.c" + } else { +#line 75 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp13_ = ""; +#line 853 "EntryMultiCompletion.c" + } +#line 75 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp15_ = old_text; +#line 75 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp16_ = old_text; +#line 75 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp17_ = self->priv->delimiter; +#line 75 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp18_ = string_get (_tmp17_, (glong) 0); +#line 75 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp19_ = string_last_index_of_char (_tmp16_, (gunichar) _tmp18_, 0); +#line 75 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp20_ = string_substring (_tmp15_, (glong) 0, (glong) (_tmp19_ + 1)); +#line 75 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp21_ = _tmp20_; +#line 75 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp22_ = g_strconcat (_tmp21_, _tmp13_, 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 = _tmp22_; +#line 75 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _g_free0 (_tmp21_); +#line 877 "EntryMultiCompletion.c" + } else { + gchar* _tmp23_; +#line 77 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp23_ = 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 = _tmp23_; +#line 886 "EntryMultiCompletion.c" + } + } +#line 80 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp25_ = self->priv->delimiter; +#line 80 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + if (g_strcmp0 (_tmp25_, " ") != 0) { +#line 80 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp24_ = " "; +#line 895 "EntryMultiCompletion.c" + } else { +#line 80 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp24_ = ""; +#line 899 "EntryMultiCompletion.c" + } +#line 80 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp26_ = old_text; +#line 80 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp27_ = match; +#line 80 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp28_ = g_strconcat (_tmp26_, _tmp27_, NULL); +#line 80 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp29_ = _tmp28_; +#line 80 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp30_ = self->priv->delimiter; +#line 80 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp31_ = g_strconcat (_tmp29_, _tmp30_, NULL); +#line 80 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp32_ = _tmp31_; +#line 80 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp33_ = g_strconcat (_tmp32_, _tmp24_, NULL); +#line 80 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp34_ = _tmp33_; +#line 80 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _g_free0 (_tmp32_); +#line 80 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _g_free0 (_tmp29_); +#line 80 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + new_text = _tmp34_; +#line 81 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp35_ = entry; +#line 81 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + gtk_entry_set_text (_tmp35_, new_text); +#line 82 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp36_ = entry; +#line 82 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp37_ = strlen (new_text); +#line 82 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp38_ = _tmp37_; +#line 82 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + gtk_editable_set_position (G_TYPE_CHECK_INSTANCE_CAST (_tmp36_, GTK_TYPE_EDITABLE, GtkEditable), (gint) _tmp38_); +#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 949 "EntryMultiCompletion.c" +} + + +static gchar* entry_multi_completion_get_last_part (const gchar* s, const gchar* delimiter) { + gchar* result = NULL; + gchar** split = NULL; + const gchar* _tmp0_; + const gchar* _tmp1_; + gchar** _tmp2_; + gchar** _tmp3_; + gint split_length1; + gint _split_size_; + gboolean _tmp4_ = FALSE; + gchar** _tmp5_; + gint _tmp5__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" + _tmp0_ = s; +#line 89 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp1_ = delimiter; +#line 89 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp3_ = _tmp2_ = g_strsplit (_tmp0_, _tmp1_, 0); +#line 89 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + split = _tmp3_; +#line 89 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + split_length1 = _vala_array_length (_tmp2_); +#line 89 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _split_size_ = split_length1; +#line 91 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp5_ = split; +#line 91 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp5__length1 = split_length1; +#line 91 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + if (_tmp5_ != NULL) { +#line 987 "EntryMultiCompletion.c" + gchar** _tmp6_; + gint _tmp6__length1; + const gchar* _tmp7_; +#line 91 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp6_ = split; +#line 91 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp6__length1 = split_length1; +#line 91 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp7_ = _tmp6_[0]; +#line 91 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp4_ = _tmp7_ != NULL; +#line 999 "EntryMultiCompletion.c" + } else { +#line 91 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp4_ = FALSE; +#line 1003 "EntryMultiCompletion.c" + } +#line 91 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + if (_tmp4_) { +#line 1007 "EntryMultiCompletion.c" + gchar** _tmp8_; + gint _tmp8__length1; + gchar** _tmp9_; + gint _tmp9__length1; + const gchar* _tmp10_; + gchar* _tmp11_; +#line 92 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp8_ = split; +#line 92 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp8__length1 = split_length1; +#line 92 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp9_ = split; +#line 92 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp9__length1 = split_length1; +#line 92 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp10_ = _tmp8_[_tmp9__length1 - 1]; +#line 92 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp11_ = g_strdup (_tmp10_); +#line 92 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + result = _tmp11_; +#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 1032 "EntryMultiCompletion.c" + } else { + gchar* _tmp12_; +#line 94 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + _tmp12_ = g_strdup (""); +#line 94 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + result = _tmp12_; +#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 1043 "EntryMultiCompletion.c" + } +#line 88 "/home/jens/Source/shotwell/src/dialogs/EntryMultiCompletion.vala" + split = (_vala_array_free (split, split_length1, (GDestroyNotify) g_free), NULL); +#line 1047 "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 1060 "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 1067 "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 1079 "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..f74f962 --- /dev/null +++ b/src/dialogs/ExportDialog.c @@ -0,0 +1,2107 @@ +/* ExportDialog.c generated by valac 0.36.6, 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; + +#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)) +enum { + EXPORT_DIALOG_DUMMY_PROPERTY +}; +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 224 "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 231 "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 238 "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 245 "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 252 "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 259 "ExportDialog.c" +} + + +ExportDialog* export_dialog_construct (GType object_type, const gchar* title) { + ExportDialog * self = NULL; + gint _tmp0_; + const gchar* _tmp1_; + ConfigFacade* config = NULL; + ConfigFacade* _tmp2_; + ConfigFacade* _tmp3_; + ExportFormatMode _tmp4_; + ConfigFacade* _tmp5_; + PhotoFileFormat _tmp6_; + ConfigFacade* _tmp7_; + JpegQuality _tmp8_; + ConfigFacade* _tmp9_; + gboolean _tmp10_; + ConfigFacade* _tmp11_; + ScaleConstraint _tmp12_; + ConfigFacade* _tmp13_; + gint _tmp14_; + GtkComboBoxText* _tmp15_; + gint ctr = 0; + GtkComboBoxText* _tmp26_; + GtkComboBoxText* _tmp36_; + gint _tmp37_; + PhotoFileFormat* _tmp38_; + GtkEntry* _tmp44_; + GtkEntry* _tmp45_; + GtkEntry* _tmp46_; + gint _tmp47_; + gchar* _tmp48_; + gchar* _tmp49_; + GtkComboBoxText* _tmp50_; + GtkComboBoxText* _tmp51_; + GtkEntry* _tmp52_; + GtkEntry* _tmp53_; + GtkEntry* _tmp54_; + GtkComboBoxText* _tmp55_; + GtkComboBoxText* _tmp56_; + GtkComboBoxText* _tmp57_; + GtkComboBoxText* _tmp58_; + GtkComboBoxText* _tmp59_; + GtkComboBoxText* _tmp60_; + GtkEntry* _tmp61_; + GtkEntry* _tmp62_; + GtkSwitch* _tmp63_; + GtkSwitch* _tmp64_; + GtkSwitch* _tmp65_; + GtkSwitch* _tmp66_; + GtkSwitch* _tmp67_; + GtkGrid* _tmp68_; + GtkGrid* _tmp69_; + GtkGrid* _tmp70_; + GtkBox* _tmp71_; + GtkGrid* _tmp72_; + GtkWidget* _tmp73_; + GtkWidget* _tmp74_; + GtkWidget* _tmp75_; + GtkWidget* _tmp76_; + GtkWidget* _tmp77_; + ScaleConstraint _tmp78_; + GtkWidget* _tmp81_; +#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" + _tmp0_ = resources_use_header_bar (); +#line 39 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + self = (ExportDialog*) g_object_new (object_type, "use-header-bar", _tmp0_, NULL); +#line 41 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp1_ = title; +#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), _tmp1_); +#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" + _tmp2_ = config_facade_get_instance (); +#line 45 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + config = _tmp2_; +#line 46 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp3_ = config; +#line 46 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp4_ = configuration_facade_get_export_export_format_mode (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)); +#line 46 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + export_dialog_current_parameters.mode = _tmp4_; +#line 47 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp5_ = config; +#line 47 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp6_ = configuration_facade_get_export_photo_file_format (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)); +#line 47 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + export_dialog_current_parameters.specified_format = _tmp6_; +#line 48 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp7_ = config; +#line 48 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp8_ = configuration_facade_get_export_quality (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)); +#line 48 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + export_dialog_current_parameters.quality = _tmp8_; +#line 49 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp9_ = config; +#line 49 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp10_ = configuration_facade_get_export_export_metadata (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)); +#line 49 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + export_dialog_current_parameters.export_metadata = _tmp10_; +#line 50 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp11_ = config; +#line 50 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp12_ = configuration_facade_get_export_constraint (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)); +#line 50 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + export_dialog_current_constraint = _tmp12_; +#line 51 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp13_ = config; +#line 51 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp14_ = configuration_facade_get_export_scale (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)); +#line 51 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + export_dialog_current_scale = _tmp14_; +#line 53 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp15_ = (GtkComboBoxText*) gtk_combo_box_text_new (); +#line 53 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + g_object_ref_sink (_tmp15_); +#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 = _tmp15_; +#line 54 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + ctr = 0; +#line 385 "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 397 "ExportDialog.c" + JpegQuality quality = 0; +#line 55 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + quality = quality_collection[quality_it]; +#line 401 "ExportDialog.c" + { + GtkComboBoxText* _tmp16_; + JpegQuality _tmp17_; + gchar* _tmp18_; + gchar* _tmp19_; + JpegQuality _tmp20_; + ExportFormatParameters _tmp21_; + JpegQuality _tmp22_; + gint _tmp25_; +#line 56 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp16_ = self->priv->quality_combo; +#line 56 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp17_ = quality; +#line 56 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp18_ = jpeg_quality_to_string (_tmp17_); +#line 56 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp19_ = _tmp18_; +#line 56 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + gtk_combo_box_text_append_text (_tmp16_, _tmp19_); +#line 56 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _g_free0 (_tmp19_); +#line 57 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp20_ = quality; +#line 57 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp21_ = export_dialog_current_parameters; +#line 57 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp22_ = _tmp21_.quality; +#line 57 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + if (_tmp20_ == _tmp22_) { +#line 431 "ExportDialog.c" + GtkComboBoxText* _tmp23_; + gint _tmp24_; +#line 58 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp23_ = self->priv->quality_combo; +#line 58 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp24_ = ctr; +#line 58 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + gtk_combo_box_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, gtk_combo_box_get_type (), GtkComboBox), _tmp24_); +#line 440 "ExportDialog.c" + } +#line 59 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp25_ = ctr; +#line 59 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + ctr = _tmp25_ + 1; +#line 446 "ExportDialog.c" + } + } + } +#line 62 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp26_ = (GtkComboBoxText*) gtk_combo_box_text_new (); +#line 62 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + g_object_ref_sink (_tmp26_); +#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 = _tmp26_; +#line 63 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + ctr = 0; +#line 460 "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 472 "ExportDialog.c" + ScaleConstraint constraint = 0; +#line 64 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + constraint = constraint_collection[constraint_it]; +#line 476 "ExportDialog.c" + { + GtkComboBoxText* _tmp27_; + ScaleConstraint _tmp28_; + gchar* _tmp29_; + gchar* _tmp30_; + ScaleConstraint _tmp31_; + ScaleConstraint _tmp32_; + gint _tmp35_; +#line 65 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp27_ = self->priv->constraint_combo; +#line 65 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp28_ = constraint; +#line 65 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp29_ = scale_constraint_to_string (_tmp28_); +#line 65 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp30_ = _tmp29_; +#line 65 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + gtk_combo_box_text_append_text (_tmp27_, _tmp30_); +#line 65 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _g_free0 (_tmp30_); +#line 66 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp31_ = constraint; +#line 66 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp32_ = export_dialog_current_constraint; +#line 66 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + if (_tmp31_ == _tmp32_) { +#line 503 "ExportDialog.c" + GtkComboBoxText* _tmp33_; + gint _tmp34_; +#line 67 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp33_ = self->priv->constraint_combo; +#line 67 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp34_ = ctr; +#line 67 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + gtk_combo_box_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp33_, gtk_combo_box_get_type (), GtkComboBox), _tmp34_); +#line 512 "ExportDialog.c" + } +#line 68 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp35_ = ctr; +#line 68 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + ctr = _tmp35_ + 1; +#line 518 "ExportDialog.c" + } + } + } +#line 71 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp36_ = (GtkComboBoxText*) gtk_combo_box_text_new (); +#line 71 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + g_object_ref_sink (_tmp36_); +#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 = _tmp36_; +#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" + _tmp38_ = photo_file_format_get_writeable (&_tmp37_); +#line 536 "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 = _tmp38_; +#line 74 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + format_collection_length1 = _tmp37_; +#line 74 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + for (format_it = 0; format_it < _tmp37_; format_it = format_it + 1) { +#line 548 "ExportDialog.c" + PhotoFileFormat format = 0; +#line 74 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + format = format_collection[format_it]; +#line 552 "ExportDialog.c" + { + PhotoFileFormat _tmp39_; + PhotoFileFormatProperties* _tmp40_; + PhotoFileFormatProperties* _tmp41_; + gchar* _tmp42_; + gchar* _tmp43_; +#line 75 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp39_ = format; +#line 75 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp40_ = photo_file_format_get_properties (_tmp39_); +#line 75 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp41_ = _tmp40_; +#line 75 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp42_ = photo_file_format_properties_get_user_visible_name (_tmp41_); +#line 75 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp43_ = _tmp42_; +#line 75 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + export_dialog_format_add_option (self, _tmp43_); +#line 75 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _g_free0 (_tmp43_); +#line 75 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _photo_file_format_properties_unref0 (_tmp41_); +#line 575 "ExportDialog.c" + } + } +#line 74 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + format_collection = (g_free (format_collection), NULL); +#line 580 "ExportDialog.c" + } +#line 78 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp44_ = (GtkEntry*) gtk_entry_new (); +#line 78 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + g_object_ref_sink (_tmp44_); +#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 = _tmp44_; +#line 79 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp45_ = self->priv->pixels_entry; +#line 79 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + gtk_entry_set_max_length (_tmp45_, 6); +#line 80 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp46_ = self->priv->pixels_entry; +#line 80 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp47_ = export_dialog_current_scale; +#line 80 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp48_ = g_strdup_printf ("%d", _tmp47_); +#line 80 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp49_ = _tmp48_; +#line 80 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + gtk_entry_set_text (_tmp46_, _tmp49_); +#line 80 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _g_free0 (_tmp49_); +#line 83 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp50_ = self->priv->constraint_combo; +#line 83 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp50_, 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" + _tmp51_ = self->priv->format_combo; +#line 84 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp51_, 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" + _tmp52_ = self->priv->pixels_entry; +#line 85 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp52_, GTK_TYPE_EDITABLE, GtkEditable), "changed", (GCallback) _export_dialog_on_pixels_changed_gtk_editable_changed, self, 0); +#line 86 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp53_ = self->priv->pixels_entry; +#line 86 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp53_, GTK_TYPE_EDITABLE, 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" + _tmp54_ = self->priv->pixels_entry; +#line 87 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + g_signal_connect_object (_tmp54_, "activate", (GCallback) _export_dialog_on_activate_gtk_entry_activate, self, 0); +#line 90 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp55_ = 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 (_tmp55_, gtk_widget_get_type (), GtkWidget)); +#line 91 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp56_ = self->priv->format_combo; +#line 91 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + export_dialog_add_control (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp56_, gtk_widget_get_type (), GtkWidget), 1, 0); +#line 93 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp57_ = 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 (_tmp57_, gtk_widget_get_type (), GtkWidget)); +#line 94 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp58_ = self->priv->quality_combo; +#line 94 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + export_dialog_add_control (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp58_, gtk_widget_get_type (), GtkWidget), 1, 1); +#line 96 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp59_ = 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 (_tmp59_, gtk_widget_get_type (), GtkWidget)); +#line 97 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp60_ = self->priv->constraint_combo; +#line 97 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + export_dialog_add_control (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp60_, gtk_widget_get_type (), GtkWidget), 1, 2); +#line 99 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp61_ = 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 (_tmp61_, gtk_widget_get_type (), GtkWidget)); +#line 100 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp62_ = self->priv->pixels_entry; +#line 100 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + export_dialog_add_control (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp62_, gtk_widget_get_type (), GtkWidget), 1, 3); +#line 102 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp63_ = (GtkSwitch*) gtk_switch_new (); +#line 102 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + g_object_ref_sink (_tmp63_); +#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 = _tmp63_; +#line 103 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp64_ = 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 (_tmp64_, gtk_widget_get_type (), GtkWidget)); +#line 104 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp65_ = self->priv->export_metadata; +#line 104 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + export_dialog_add_control (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp65_, gtk_widget_get_type (), GtkWidget), 1, 4); +#line 105 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp66_ = self->priv->export_metadata; +#line 105 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + gtk_switch_set_active (_tmp66_, TRUE); +#line 106 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp67_ = self->priv->export_metadata; +#line 106 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + gtk_widget_set_halign (G_TYPE_CHECK_INSTANCE_CAST (_tmp67_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_START); +#line 108 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp68_ = self->priv->table; +#line 108 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + gtk_grid_set_row_spacing (_tmp68_, (guint) 6); +#line 109 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp69_ = self->priv->table; +#line 109 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + gtk_grid_set_column_spacing (_tmp69_, (guint) 12); +#line 110 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp70_ = self->priv->table; +#line 110 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + gtk_container_set_border_width (G_TYPE_CHECK_INSTANCE_CAST (_tmp70_, gtk_container_get_type (), GtkContainer), (guint) 18); +#line 112 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp71_ = (GtkBox*) 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" + _tmp72_ = 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 (_tmp71_, gtk_box_get_type (), GtkBox), gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp72_, 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" + _tmp73_ = 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" + _tmp74_ = _g_object_ref0 (_tmp73_); +#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 = _tmp74_; +#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" + _tmp75_ = self->priv->ok_button; +#line 119 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + gtk_widget_set_can_default (_tmp75_, TRUE); +#line 120 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp76_ = self->priv->ok_button; +#line 120 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + g_object_set (_tmp76_, "has-default", TRUE, NULL); +#line 121 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp77_ = 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), _tmp77_); +#line 123 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp78_ = export_dialog_current_constraint; +#line 123 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + if (_tmp78_ == SCALE_CONSTRAINT_ORIGINAL) { +#line 728 "ExportDialog.c" + GtkEntry* _tmp79_; + GtkComboBoxText* _tmp80_; +#line 124 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp79_ = self->priv->pixels_entry; +#line 124 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp79_, gtk_widget_get_type (), GtkWidget), FALSE); +#line 125 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp80_ = self->priv->quality_combo; +#line 125 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp80_, gtk_widget_get_type (), GtkWidget), FALSE); +#line 739 "ExportDialog.c" + } +#line 128 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp81_ = self->priv->ok_button; +#line 128 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + gtk_widget_grab_focus (_tmp81_); +#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 749 "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 756 "ExportDialog.c" +} + + +static void export_dialog_format_add_option (ExportDialog* self, const gchar* format_name) { + GeeArrayList* _tmp0_; + const gchar* _tmp1_; + GtkComboBoxText* _tmp2_; + const gchar* _tmp3_; +#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" + _tmp1_ = format_name; +#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), _tmp1_); +#line 133 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp2_ = self->priv->format_combo; +#line 133 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp3_ = format_name; +#line 133 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + gtk_combo_box_text_append_text (_tmp2_, _tmp3_); +#line 781 "ExportDialog.c" +} + + +static void export_dialog_format_set_active_text (ExportDialog* self, const gchar* text) { + gint selection_ticker = 0; + const gchar* _tmp16_; +#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 794 "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 822 "ExportDialog.c" + gint _tmp5_; + gint _tmp6_; + gint _tmp7_; + gchar* current_text = NULL; + GeeArrayList* _tmp8_; + gint _tmp9_; + gpointer _tmp10_; + const gchar* _tmp11_; + const gchar* _tmp12_; + gint _tmp15_; +#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 845 "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" + _tmp12_ = text; +#line 140 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + if (g_strcmp0 (_tmp11_, _tmp12_) == 0) { +#line 861 "ExportDialog.c" + GtkComboBoxText* _tmp13_; + gint _tmp14_; +#line 141 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp13_ = self->priv->format_combo; +#line 141 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp14_ = selection_ticker; +#line 141 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + gtk_combo_box_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, gtk_combo_box_get_type (), GtkComboBox), _tmp14_); +#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 876 "ExportDialog.c" + } +#line 144 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp15_ = selection_ticker; +#line 144 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + selection_ticker = _tmp15_ + 1; +#line 139 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _g_free0 (current_text); +#line 884 "ExportDialog.c" + } +#line 139 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _g_object_unref0 (_current_text_list); +#line 888 "ExportDialog.c" + } +#line 147 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp16_ = text; +#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", _tmp16_); +#line 894 "ExportDialog.c" +} + + +static PhotoFileFormat export_dialog_get_specified_format (ExportDialog* self) { + PhotoFileFormat result = 0; + gint index = 0; + GtkComboBoxText* _tmp0_; + gint _tmp1_; + gint _tmp2_; + gint _tmp3_; + PhotoFileFormat* writeable_formats = NULL; + gint _tmp4_; + PhotoFileFormat* _tmp5_; + gint writeable_formats_length1; + gint _writeable_formats_size_; + gint _tmp6_; + PhotoFileFormat _tmp7_; +#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" + _tmp1_ = gtk_combo_box_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_combo_box_get_type (), GtkComboBox)); +#line 151 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + index = _tmp1_; +#line 152 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp2_ = index; +#line 152 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + if (_tmp2_ < EXPORT_DIALOG_NUM_SPECIAL_FORMATS) { +#line 153 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + index = EXPORT_DIALOG_NUM_SPECIAL_FORMATS; +#line 926 "ExportDialog.c" + } +#line 155 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp3_ = index; +#line 155 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + index = _tmp3_ - EXPORT_DIALOG_NUM_SPECIAL_FORMATS; +#line 156 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp5_ = photo_file_format_get_writeable (&_tmp4_); +#line 156 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + writeable_formats = _tmp5_; +#line 156 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + writeable_formats_length1 = _tmp4_; +#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" + _tmp6_ = index; +#line 157 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp7_ = writeable_formats[_tmp6_]; +#line 157 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + result = _tmp7_; +#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 950 "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 970 "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 979 "ExportDialog.c" + } +#line 161 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + case EXPORT_FORMAT_MODE_CURRENT: +#line 983 "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 992 "ExportDialog.c" + } +#line 161 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + case EXPORT_FORMAT_MODE_SPECIFIED: +#line 996 "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 1022 "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 1028 "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 _tmp14_; + gchar* _tmp15_; + gchar* _tmp16_; + gboolean ok = FALSE; + gint _tmp17_; + gboolean _tmp18_; +#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 1060 "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 1073 "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 1081 "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 1087 "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 1098 "ExportDialog.c" + ExportFormatParameters _tmp10_; + PhotoFileFormat _tmp11_; + gboolean _tmp12_; +#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" + _tmp12_ = photo_file_format_can_write (_tmp11_); +#line 192 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp7_ = !_tmp12_; +#line 1110 "ExportDialog.c" + } else { +#line 192 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp7_ = FALSE; +#line 1114 "ExportDialog.c" + } +#line 192 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + if (_tmp7_) { +#line 1118 "ExportDialog.c" + PhotoFileFormat _tmp13_; +#line 193 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp13_ = photo_file_format_get_system_default_format (); +#line 193 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + (*parameters).specified_format = _tmp13_; +#line 1124 "ExportDialog.c" + } + } +#line 195 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp14_ = *parameters; +#line 195 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp15_ = export_dialog_get_label_for_parameters (self, &_tmp14_); +#line 195 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp16_ = _tmp15_; +#line 195 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + export_dialog_format_set_active_text (self, _tmp16_); +#line 195 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _g_free0 (_tmp16_); +#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" + _tmp17_ = gtk_dialog_run (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_dialog_get_type (), GtkDialog)); +#line 198 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + ok = _tmp17_ == ((gint) GTK_RESPONSE_OK); +#line 199 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp18_ = ok; +#line 199 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + if (_tmp18_) { +#line 1147 "ExportDialog.c" + gint index = 0; + GtkComboBoxText* _tmp19_; + gint _tmp20_; + gint _tmp21_; + gint _tmp22_; + ScaleConstraint _tmp23_; + ScaleConstraint _tmp24_; + GtkEntry* _tmp25_; + const gchar* _tmp26_; + gint _tmp27_; + ScaleConstraint _tmp28_; + gint _tmp30_; + gboolean _tmp31_ = FALSE; + GtkSwitch* _tmp32_; + gboolean _tmp33_; + gboolean _tmp34_; + GtkComboBoxText* _tmp38_; + gchar* _tmp39_; + gchar* _tmp40_; + gboolean _tmp41_; + ConfigFacade* config = NULL; + ConfigFacade* _tmp57_; + ConfigFacade* _tmp58_; + ExportFormatParameters _tmp59_; + ExportFormatMode _tmp60_; + ConfigFacade* _tmp61_; + ExportFormatParameters _tmp62_; + PhotoFileFormat _tmp63_; + ConfigFacade* _tmp64_; + ExportFormatParameters _tmp65_; + JpegQuality _tmp66_; + ConfigFacade* _tmp67_; + ExportFormatParameters _tmp68_; + gboolean _tmp69_; + ConfigFacade* _tmp70_; + ScaleConstraint _tmp71_; + ConfigFacade* _tmp72_; + gint _tmp73_; +#line 200 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp19_ = self->priv->constraint_combo; +#line 200 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp20_ = gtk_combo_box_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, gtk_combo_box_get_type (), GtkComboBox)); +#line 200 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + index = _tmp20_; +#line 201 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp21_ = index; +#line 201 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _vala_assert (_tmp21_ >= 0, "index >= 0"); +#line 202 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp22_ = index; +#line 202 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp23_ = EXPORT_DIALOG_CONSTRAINT_ARRAY[_tmp22_]; +#line 202 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _vala_constraint = _tmp23_; +#line 203 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp24_ = _vala_constraint; +#line 203 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + export_dialog_current_constraint = _tmp24_; +#line 205 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp25_ = self->priv->pixels_entry; +#line 205 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp26_ = gtk_entry_get_text (_tmp25_); +#line 205 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp27_ = atoi (_tmp26_); +#line 205 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _vala_scale = _tmp27_; +#line 206 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp28_ = _vala_constraint; +#line 206 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + if (_tmp28_ != SCALE_CONSTRAINT_ORIGINAL) { +#line 1218 "ExportDialog.c" + gint _tmp29_; +#line 207 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp29_ = _vala_scale; +#line 207 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _vala_assert (_tmp29_ > 0, "scale > 0"); +#line 1224 "ExportDialog.c" + } +#line 208 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp30_ = _vala_scale; +#line 208 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + export_dialog_current_scale = _tmp30_; +#line 210 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp32_ = self->priv->export_metadata; +#line 210 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp33_ = gtk_widget_get_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp32_, gtk_widget_get_type (), GtkWidget)); +#line 210 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp34_ = _tmp33_; +#line 210 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + if (_tmp34_) { +#line 1238 "ExportDialog.c" + GtkSwitch* _tmp35_; + gboolean _tmp36_; + gboolean _tmp37_; +#line 210 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp35_ = self->priv->export_metadata; +#line 210 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp36_ = gtk_switch_get_active (_tmp35_); +#line 210 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp37_ = _tmp36_; +#line 210 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp31_ = _tmp37_; +#line 1250 "ExportDialog.c" + } else { +#line 210 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp31_ = FALSE; +#line 1254 "ExportDialog.c" + } +#line 210 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + (*parameters).export_metadata = _tmp31_; +#line 212 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp38_ = self->priv->format_combo; +#line 212 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp39_ = gtk_combo_box_text_get_active_text (_tmp38_); +#line 212 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp40_ = _tmp39_; +#line 212 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp41_ = g_strcmp0 (_tmp40_, EXPORT_DIALOG_UNMODIFIED_FORMAT_LABEL) == 0; +#line 212 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _g_free0 (_tmp40_); +#line 212 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + if (_tmp41_) { +#line 1270 "ExportDialog.c" + ExportFormatMode _tmp42_; +#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" + _tmp42_ = export_dialog_current_parameters.mode; +#line 213 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + (*parameters).mode = _tmp42_; +#line 1278 "ExportDialog.c" + } else { + GtkComboBoxText* _tmp43_; + gchar* _tmp44_; + gchar* _tmp45_; + gboolean _tmp46_; +#line 214 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp43_ = self->priv->format_combo; +#line 214 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp44_ = gtk_combo_box_text_get_active_text (_tmp43_); +#line 214 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp45_ = _tmp44_; +#line 214 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp46_ = g_strcmp0 (_tmp45_, EXPORT_DIALOG_CURRENT_FORMAT_LABEL) == 0; +#line 214 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _g_free0 (_tmp45_); +#line 214 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + if (_tmp46_) { +#line 1296 "ExportDialog.c" + ExportFormatMode _tmp47_; +#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" + _tmp47_ = export_dialog_current_parameters.mode; +#line 215 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + (*parameters).mode = _tmp47_; +#line 1304 "ExportDialog.c" + } else { + ExportFormatMode _tmp48_; + PhotoFileFormat _tmp49_; + PhotoFileFormat _tmp50_; + ExportFormatParameters _tmp51_; + PhotoFileFormat _tmp52_; +#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" + _tmp48_ = export_dialog_current_parameters.mode; +#line 217 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + (*parameters).mode = _tmp48_; +#line 218 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp49_ = export_dialog_get_specified_format (self); +#line 218 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + export_dialog_current_parameters.specified_format = _tmp49_; +#line 218 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp50_ = export_dialog_current_parameters.specified_format; +#line 218 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + (*parameters).specified_format = _tmp50_; +#line 219 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp51_ = export_dialog_current_parameters; +#line 219 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp52_ = _tmp51_.specified_format; +#line 219 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + if (_tmp52_ == PHOTO_FILE_FORMAT_JFIF) { +#line 1331 "ExportDialog.c" + GtkComboBoxText* _tmp53_; + gint _tmp54_; + JpegQuality _tmp55_; + JpegQuality _tmp56_; +#line 220 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp53_ = self->priv->quality_combo; +#line 220 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp54_ = gtk_combo_box_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp53_, gtk_combo_box_get_type (), GtkComboBox)); +#line 220 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp55_ = EXPORT_DIALOG_QUALITY_ARRAY[_tmp54_]; +#line 220 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + export_dialog_current_parameters.quality = _tmp55_; +#line 220 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp56_ = export_dialog_current_parameters.quality; +#line 220 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + (*parameters).quality = _tmp56_; +#line 1348 "ExportDialog.c" + } + } + } +#line 224 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp57_ = config_facade_get_instance (); +#line 224 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + config = _tmp57_; +#line 225 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp58_ = config; +#line 225 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp59_ = export_dialog_current_parameters; +#line 225 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp60_ = _tmp59_.mode; +#line 225 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + configuration_facade_set_export_export_format_mode (G_TYPE_CHECK_INSTANCE_CAST (_tmp58_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), _tmp60_); +#line 226 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp61_ = config; +#line 226 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp62_ = export_dialog_current_parameters; +#line 226 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp63_ = _tmp62_.specified_format; +#line 226 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + configuration_facade_set_export_photo_file_format (G_TYPE_CHECK_INSTANCE_CAST (_tmp61_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), _tmp63_); +#line 227 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp64_ = config; +#line 227 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp65_ = export_dialog_current_parameters; +#line 227 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp66_ = _tmp65_.quality; +#line 227 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + configuration_facade_set_export_quality (G_TYPE_CHECK_INSTANCE_CAST (_tmp64_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), _tmp66_); +#line 228 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp67_ = config; +#line 228 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp68_ = export_dialog_current_parameters; +#line 228 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp69_ = _tmp68_.export_metadata; +#line 228 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + configuration_facade_set_export_export_metadata (G_TYPE_CHECK_INSTANCE_CAST (_tmp67_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), _tmp69_); +#line 229 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp70_ = config; +#line 229 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp71_ = export_dialog_current_constraint; +#line 229 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + configuration_facade_set_export_constraint (G_TYPE_CHECK_INSTANCE_CAST (_tmp70_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), _tmp71_); +#line 230 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp72_ = config; +#line 230 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp73_ = export_dialog_current_scale; +#line 230 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + configuration_facade_set_export_scale (G_TYPE_CHECK_INSTANCE_CAST (_tmp72_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), _tmp73_); +#line 199 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _g_object_unref0 (config); +#line 1402 "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 1408 "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 1418 "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 1424 "ExportDialog.c" + } +#line 238 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + return result; +#line 1428 "ExportDialog.c" +} + + +static void export_dialog_add_label (ExportDialog* self, const gchar* text, gint x, gint y, GtkWidget* widget) { + GtkLabel* new_label = NULL; + const gchar* _tmp0_; + GtkLabel* _tmp1_; + GtkLabel* _tmp2_; + GtkLabel* _tmp3_; + GtkLabel* _tmp4_; + GtkWidget* _tmp5_; + GtkGrid* _tmp8_; + GtkLabel* _tmp9_; + gint _tmp10_; + gint _tmp11_; +#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_ = text; +#line 242 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp1_ = (GtkLabel*) gtk_label_new_with_mnemonic (_tmp0_); +#line 242 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + g_object_ref_sink (_tmp1_); +#line 242 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + new_label = _tmp1_; +#line 243 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp2_ = new_label; +#line 243 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + gtk_widget_set_halign (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_END); +#line 244 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp3_ = new_label; +#line 244 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + gtk_widget_set_valign (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_CENTER); +#line 245 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp4_ = new_label; +#line 245 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + gtk_label_set_use_underline (_tmp4_, TRUE); +#line 247 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp5_ = widget; +#line 247 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + if (_tmp5_ != NULL) { +#line 1474 "ExportDialog.c" + GtkLabel* _tmp6_; + GtkWidget* _tmp7_; +#line 248 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp6_ = new_label; +#line 248 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp7_ = widget; +#line 248 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + gtk_label_set_mnemonic_widget (_tmp6_, _tmp7_); +#line 1483 "ExportDialog.c" + } +#line 250 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp8_ = self->priv->table; +#line 250 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp9_ = new_label; +#line 250 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp10_ = x; +#line 250 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp11_ = y; +#line 250 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + gtk_grid_attach (_tmp8_, G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, gtk_widget_get_type (), GtkWidget), _tmp10_, _tmp11_, 1, 1); +#line 241 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _g_object_unref0 (new_label); +#line 1497 "ExportDialog.c" +} + + +static void export_dialog_add_control (ExportDialog* self, GtkWidget* widget, gint x, gint y) { + GtkWidget* _tmp0_; + GtkWidget* _tmp1_; + GtkWidget* _tmp2_; + GtkWidget* _tmp3_; + GtkGrid* _tmp4_; + GtkWidget* _tmp5_; + gint _tmp6_; + gint _tmp7_; +#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" + _tmp0_ = widget; +#line 254 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + gtk_widget_set_halign (_tmp0_, GTK_ALIGN_FILL); +#line 255 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp1_ = widget; +#line 255 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + gtk_widget_set_valign (_tmp1_, GTK_ALIGN_CENTER); +#line 256 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp2_ = widget; +#line 256 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + gtk_widget_set_hexpand (_tmp2_, TRUE); +#line 257 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp3_ = widget; +#line 257 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + gtk_widget_set_vexpand (_tmp3_, TRUE); +#line 259 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp4_ = self->priv->table; +#line 259 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp5_ = widget; +#line 259 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp6_ = x; +#line 259 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp7_ = y; +#line 259 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + gtk_grid_attach (_tmp4_, _tmp5_, _tmp6_, _tmp7_, 1, 1); +#line 1540 "ExportDialog.c" +} + + +static void export_dialog_on_constraint_changed (ExportDialog* self) { + gboolean original = FALSE; + GtkComboBoxText* _tmp0_; + gint _tmp1_; + ScaleConstraint _tmp2_; + gboolean jpeg = FALSE; + GtkComboBoxText* _tmp3_; + gchar* _tmp4_; + gchar* _tmp5_; + PhotoFileFormatProperties* _tmp6_; + PhotoFileFormatProperties* _tmp7_; + gchar* _tmp8_; + gchar* _tmp9_; + gboolean _tmp10_; + GtkEntry* _tmp11_; + gboolean _tmp12_; + gboolean _tmp13_ = FALSE; + gboolean _tmp14_; + GtkComboBoxText* _tmp16_; + gboolean _tmp17_; +#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_ = 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" + _tmp2_ = EXPORT_DIALOG_CONSTRAINT_ARRAY[_tmp1_]; +#line 263 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + original = _tmp2_ == SCALE_CONSTRAINT_ORIGINAL; +#line 264 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp3_ = self->priv->format_combo; +#line 264 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp4_ = gtk_combo_box_text_get_active_text (_tmp3_); +#line 264 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp5_ = _tmp4_; +#line 264 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp6_ = photo_file_format_get_properties (PHOTO_FILE_FORMAT_JFIF); +#line 264 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp7_ = _tmp6_; +#line 264 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp8_ = photo_file_format_properties_get_user_visible_name (_tmp7_); +#line 264 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp9_ = _tmp8_; +#line 264 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp10_ = g_strcmp0 (_tmp5_, _tmp9_) == 0; +#line 264 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _g_free0 (_tmp9_); +#line 264 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _photo_file_format_properties_unref0 (_tmp7_); +#line 264 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _g_free0 (_tmp5_); +#line 264 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + jpeg = _tmp10_; +#line 266 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp11_ = self->priv->pixels_entry; +#line 266 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp12_ = original; +#line 266 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, gtk_widget_get_type (), GtkWidget), !_tmp12_); +#line 267 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp14_ = original; +#line 267 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + if (!_tmp14_) { +#line 1608 "ExportDialog.c" + gboolean _tmp15_; +#line 267 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp15_ = jpeg; +#line 267 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp13_ = _tmp15_; +#line 1614 "ExportDialog.c" + } else { +#line 267 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp13_ = FALSE; +#line 1618 "ExportDialog.c" + } +#line 267 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp16_ = self->priv->quality_combo; +#line 267 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, gtk_widget_get_type (), GtkWidget), _tmp13_); +#line 268 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp17_ = original; +#line 268 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + if (_tmp17_) { +#line 1628 "ExportDialog.c" + GtkWidget* _tmp18_; +#line 269 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp18_ = self->priv->ok_button; +#line 269 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + gtk_widget_set_sensitive (_tmp18_, TRUE); +#line 1634 "ExportDialog.c" + } else { +#line 271 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + export_dialog_on_pixels_changed (self); +#line 1638 "ExportDialog.c" + } +} + + +static void export_dialog_on_format_changed (ExportDialog* self) { + gboolean original = FALSE; + GtkComboBoxText* _tmp0_; + gint _tmp1_; + ScaleConstraint _tmp2_; + GtkComboBoxText* _tmp3_; + gchar* _tmp4_; + gchar* _tmp5_; + gboolean _tmp6_; +#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_ = 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" + _tmp2_ = EXPORT_DIALOG_CONSTRAINT_ARRAY[_tmp1_]; +#line 275 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + original = _tmp2_ == SCALE_CONSTRAINT_ORIGINAL; +#line 277 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp3_ = self->priv->format_combo; +#line 277 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp4_ = gtk_combo_box_text_get_active_text (_tmp3_); +#line 277 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp5_ = _tmp4_; +#line 277 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp6_ = g_strcmp0 (_tmp5_, EXPORT_DIALOG_UNMODIFIED_FORMAT_LABEL) == 0; +#line 277 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _g_free0 (_tmp5_); +#line 277 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + if (_tmp6_) { +#line 1674 "ExportDialog.c" + GtkComboBoxText* _tmp7_; + GtkComboBoxText* _tmp8_; + GtkComboBoxText* _tmp9_; + GtkEntry* _tmp10_; + GtkSwitch* _tmp11_; + GtkSwitch* _tmp12_; +#line 282 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp7_ = self->priv->constraint_combo; +#line 282 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + gtk_combo_box_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, gtk_combo_box_get_type (), GtkComboBox), 0); +#line 283 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp8_ = self->priv->constraint_combo; +#line 283 "/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 284 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp9_ = self->priv->quality_combo; +#line 284 "/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 285 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp10_ = self->priv->pixels_entry; +#line 285 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, gtk_widget_get_type (), GtkWidget), FALSE); +#line 286 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp11_ = self->priv->export_metadata; +#line 286 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + gtk_switch_set_active (_tmp11_, FALSE); +#line 287 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp12_ = self->priv->export_metadata; +#line 287 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, gtk_widget_get_type (), GtkWidget), FALSE); +#line 1705 "ExportDialog.c" + } else { + GtkComboBoxText* _tmp13_; + gchar* _tmp14_; + gchar* _tmp15_; + gboolean _tmp16_; +#line 288 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp13_ = self->priv->format_combo; +#line 288 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp14_ = gtk_combo_box_text_get_active_text (_tmp13_); +#line 288 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp15_ = _tmp14_; +#line 288 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp16_ = g_strcmp0 (_tmp15_, EXPORT_DIALOG_CURRENT_FORMAT_LABEL) == 0; +#line 288 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _g_free0 (_tmp15_); +#line 288 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + if (_tmp16_) { +#line 1723 "ExportDialog.c" + GtkComboBoxText* _tmp17_; + GtkComboBoxText* _tmp18_; + GtkEntry* _tmp19_; + gboolean _tmp20_; + GtkSwitch* _tmp21_; +#line 295 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp17_ = self->priv->constraint_combo; +#line 295 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, gtk_widget_get_type (), GtkWidget), TRUE); +#line 296 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp18_ = self->priv->quality_combo; +#line 296 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, gtk_widget_get_type (), GtkWidget), FALSE); +#line 297 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp19_ = self->priv->pixels_entry; +#line 297 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp20_ = original; +#line 297 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, gtk_widget_get_type (), GtkWidget), !_tmp20_); +#line 298 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp21_ = self->priv->export_metadata; +#line 298 "/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 1747 "ExportDialog.c" + } else { + GtkComboBoxText* _tmp22_; + gboolean jpeg = FALSE; + PhotoFileFormat _tmp23_; + gboolean _tmp24_ = FALSE; + gboolean _tmp25_; + GtkComboBoxText* _tmp27_; + GtkSwitch* _tmp28_; +#line 303 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp22_ = self->priv->constraint_combo; +#line 303 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, gtk_widget_get_type (), GtkWidget), TRUE); +#line 304 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp23_ = export_dialog_get_specified_format (self); +#line 304 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + jpeg = _tmp23_ == PHOTO_FILE_FORMAT_JFIF; +#line 305 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp25_ = original; +#line 305 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + if (!_tmp25_) { +#line 1768 "ExportDialog.c" + gboolean _tmp26_; +#line 305 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp26_ = jpeg; +#line 305 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp24_ = _tmp26_; +#line 1774 "ExportDialog.c" + } else { +#line 305 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp24_ = FALSE; +#line 1778 "ExportDialog.c" + } +#line 305 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp27_ = self->priv->quality_combo; +#line 305 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp27_, gtk_widget_get_type (), GtkWidget), _tmp24_); +#line 306 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp28_ = self->priv->export_metadata; +#line 306 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp28_, gtk_widget_get_type (), GtkWidget), TRUE); +#line 1788 "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 1799 "ExportDialog.c" +} + + +static void export_dialog_on_pixels_changed (ExportDialog* self) { + gboolean _tmp0_ = FALSE; + GtkEntry* _tmp1_; + guint16 _tmp2_; + GtkWidget* _tmp6_; +#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" + _tmp2_ = gtk_entry_get_text_length (_tmp1_); +#line 315 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + if (((gint) _tmp2_) > 0) { +#line 1816 "ExportDialog.c" + GtkEntry* _tmp3_; + const gchar* _tmp4_; + gint _tmp5_; +#line 315 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp3_ = self->priv->pixels_entry; +#line 315 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp4_ = gtk_entry_get_text (_tmp3_); +#line 315 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp5_ = atoi (_tmp4_); +#line 315 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp0_ = _tmp5_ > 0; +#line 1828 "ExportDialog.c" + } else { +#line 315 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp0_ = FALSE; +#line 1832 "ExportDialog.c" + } +#line 315 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp6_ = self->priv->ok_button; +#line 315 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + gtk_widget_set_sensitive (_tmp6_, _tmp0_); +#line 1838 "ExportDialog.c" +} + + +static gchar string_get (const gchar* self, glong index) { + gchar result = '\0'; + glong _tmp0_; + gchar _tmp1_; +#line 1110 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + g_return_val_if_fail (self != NULL, '\0'); +#line 1111 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp0_ = index; +#line 1111 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp1_ = ((gchar*) self)[_tmp0_]; +#line 1111 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + result = _tmp1_; +#line 1111 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + return result; +#line 1856 "ExportDialog.c" +} + + +static void export_dialog_on_pixels_insert_text (ExportDialog* self, const gchar* text, gint length, gint* position) { + gboolean _tmp0_; + gint _tmp1_; + gchar* new_text = NULL; + gchar* _tmp5_; + const gchar* _tmp21_; + gint _tmp22_; + gint _tmp23_; + GtkEntry* _tmp29_; +#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 1879 "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" + _tmp1_ = length; +#line 325 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + if (_tmp1_ == -1) { +#line 1887 "ExportDialog.c" + const gchar* _tmp2_; + gint _tmp3_; + gint _tmp4_; +#line 326 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp2_ = text; +#line 326 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp3_ = strlen (_tmp2_); +#line 326 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp4_ = _tmp3_; +#line 326 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + length = (gint) _tmp4_; +#line 1899 "ExportDialog.c" + } +#line 329 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp5_ = g_strdup (""); +#line 329 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + new_text = _tmp5_; +#line 1905 "ExportDialog.c" + { + gint ctr = 0; +#line 330 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + ctr = 0; +#line 1910 "ExportDialog.c" + { + gboolean _tmp6_ = FALSE; +#line 330 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp6_ = TRUE; +#line 330 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + while (TRUE) { +#line 1917 "ExportDialog.c" + gint _tmp8_; + gint _tmp9_; + const gchar* _tmp10_; + gint _tmp11_; + gchar _tmp12_; + gboolean _tmp13_; +#line 330 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + if (!_tmp6_) { +#line 1926 "ExportDialog.c" + gint _tmp7_; +#line 330 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp7_ = ctr; +#line 330 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + ctr = _tmp7_ + 1; +#line 1932 "ExportDialog.c" + } +#line 330 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp6_ = FALSE; +#line 330 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp8_ = ctr; +#line 330 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp9_ = length; +#line 330 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + if (!(_tmp8_ < _tmp9_)) { +#line 330 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + break; +#line 1944 "ExportDialog.c" + } +#line 331 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp10_ = text; +#line 331 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp11_ = ctr; +#line 331 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp12_ = string_get (_tmp10_, (glong) _tmp11_); +#line 331 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp13_ = g_ascii_isdigit (_tmp12_); +#line 331 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + if (_tmp13_) { +#line 1956 "ExportDialog.c" + const gchar* _tmp14_; + const gchar* _tmp15_; + gint _tmp16_; + gchar _tmp17_; + gchar* _tmp18_; + gchar* _tmp19_; + gchar* _tmp20_; +#line 332 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp14_ = new_text; +#line 332 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp15_ = text; +#line 332 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp16_ = ctr; +#line 332 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp17_ = string_get (_tmp15_, (glong) _tmp16_); +#line 332 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp18_ = g_strdup_printf ("%c", (gchar) _tmp17_); +#line 332 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp19_ = _tmp18_; +#line 332 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp20_ = g_strconcat (_tmp14_, _tmp19_, 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 = _tmp20_; +#line 332 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _g_free0 (_tmp19_); +#line 1984 "ExportDialog.c" + } + } + } + } +#line 336 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp21_ = new_text; +#line 336 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp22_ = strlen (_tmp21_); +#line 336 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp23_ = _tmp22_; +#line 336 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + if (_tmp23_ > 0) { +#line 1997 "ExportDialog.c" + GtkEntry* _tmp24_; + const gchar* _tmp25_; + const gchar* _tmp26_; + gint _tmp27_; + gint _tmp28_; +#line 337 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp24_ = self->priv->pixels_entry; +#line 337 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp25_ = new_text; +#line 337 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp26_ = new_text; +#line 337 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp27_ = strlen (_tmp26_); +#line 337 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp28_ = _tmp27_; +#line 337 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + gtk_editable_insert_text (G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, GTK_TYPE_EDITABLE, GtkEditable), _tmp25_, (gint) _tmp28_, position); +#line 2015 "ExportDialog.c" + } +#line 339 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + _tmp29_ = self->priv->pixels_entry; +#line 339 "/home/jens/Source/shotwell/src/dialogs/ExportDialog.vala" + g_signal_stop_emission_by_name (_tmp29_, "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 2025 "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 2043 "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 2064 "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 2090 "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..7e682a6 --- /dev/null +++ b/src/dialogs/MultiTextEntryDialog.c @@ -0,0 +1,286 @@ +/* MultiTextEntryDialog.c generated by valac 0.36.6, 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; +#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)) +enum { + MULTI_TEXT_ENTRY_DIALOG_DUMMY_PROPERTY +}; +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; + gint _tmp0_; +#line 17 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala" + _tmp0_ = resources_use_header_bar (); +#line 17 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala" + self = (MultiTextEntryDialog*) g_object_new (object_type, "use-header-bar", _tmp0_, NULL); +#line 16 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala" + return self; +#line 96 "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 103 "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) { + const gchar* _tmp0_; + AppWindow* _tmp1_; + AppWindow* _tmp2_; + GdkWindow* _tmp3_; + AppWindow* _tmp4_; + AppWindow* _tmp5_; + MultiTextEntryDialogOnModifyValidateType _tmp6_; + void* _tmp6__target; + const gchar* _tmp7_ = NULL; + const gchar* _tmp8_; + GtkTextView* _tmp10_; + GtkTextBuffer* _tmp11_; + GtkTextBuffer* _tmp12_; + GtkTextView* _tmp13_; +#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" + _tmp0_ = title; +#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), _tmp0_); +#line 22 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala" + _tmp1_ = app_window_get_instance (); +#line 22 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala" + _tmp2_ = _tmp1_; +#line 22 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala" + _tmp3_ = gtk_widget_get_parent_window (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, 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), _tmp3_); +#line 22 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala" + _g_object_unref0 (_tmp2_); +#line 23 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala" + _tmp4_ = app_window_get_instance (); +#line 23 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala" + _tmp5_ = _tmp4_; +#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 (_tmp5_, gtk_window_get_type (), GtkWindow)); +#line 23 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala" + _g_object_unref0 (_tmp5_); +#line 24 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala" + _tmp6_ = modify_validate; +#line 24 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala" + _tmp6__target = modify_validate_target; +#line 24 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala" + self->priv->on_modify_validate = _tmp6_; +#line 24 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala" + self->priv->on_modify_validate_target = _tmp6__target; +#line 26 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala" + _tmp8_ = initial_text; +#line 26 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala" + if (_tmp8_ != NULL) { +#line 162 "MultiTextEntryDialog.c" + const gchar* _tmp9_; +#line 26 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala" + _tmp9_ = initial_text; +#line 26 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala" + _tmp7_ = _tmp9_; +#line 168 "MultiTextEntryDialog.c" + } else { +#line 26 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala" + _tmp7_ = ""; +#line 172 "MultiTextEntryDialog.c" + } +#line 26 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala" + _tmp10_ = self->priv->entry; +#line 26 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala" + _tmp11_ = gtk_text_view_get_buffer (_tmp10_); +#line 26 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala" + _tmp12_ = _tmp11_; +#line 26 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala" + g_object_set (_tmp12_, "text", _tmp7_, NULL); +#line 28 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala" + _tmp13_ = self->priv->entry; +#line 28 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala" + gtk_widget_grab_focus (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, gtk_widget_get_type (), GtkWidget)); +#line 186 "MultiTextEntryDialog.c" +} + + +gchar* multi_text_entry_dialog_execute (MultiTextEntryDialog* self) { + gchar* result = NULL; + gchar* text = NULL; + gint _tmp0_; +#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" + _tmp0_ = gtk_dialog_run (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_dialog_get_type (), GtkDialog)); +#line 36 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala" + if (_tmp0_ == ((gint) GTK_RESPONSE_OK)) { +#line 204 "MultiTextEntryDialog.c" + GtkTextView* _tmp1_; + GtkTextBuffer* _tmp2_; + GtkTextBuffer* _tmp3_; + gchar* _tmp4_; + gchar* _tmp5_; +#line 37 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala" + _tmp1_ = self->priv->entry; +#line 37 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala" + _tmp2_ = gtk_text_view_get_buffer (_tmp1_); +#line 37 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala" + _tmp3_ = _tmp2_; +#line 37 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala" + g_object_get (_tmp3_, "text", &_tmp4_, NULL); +#line 37 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala" + _tmp5_ = _tmp4_; +#line 37 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala" + _g_free0 (text); +#line 37 "/home/jens/Source/shotwell/src/dialogs/MultiTextEntryDialog.vala" + text = _tmp5_; +#line 224 "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 232 "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 250 "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 259 "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 271 "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..855b11d --- /dev/null +++ b/src/dialogs/Preferences.c @@ -0,0 +1,3245 @@ +/* Preferences.c generated by valac 0.36.6, 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; +#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)) +enum { + PREFERENCES_DIALOG_DUMMY_PROPERTY +}; +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); +enum { + PREFERENCES_DIALOG_PATH_FORMAT_DUMMY_PROPERTY +}; +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 324 "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 331 "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 338 "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 347 "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 354 "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 361 "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 370 "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 377 "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 384 "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 391 "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 398 "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 405 "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 412 "Preferences.c" +} + + +static PreferencesDialog* preferences_dialog_construct (GType object_type) { + PreferencesDialog * self = NULL; + gint _tmp0_; + AppWindow* _tmp1_; + AppWindow* _tmp2_; + GdkWindow* _tmp3_; + AppWindow* _tmp4_; + AppWindow* _tmp5_; + GtkAdjustment* _tmp6_; + GtkAdjustment* _tmp7_; + gdouble _tmp8_; + ConfigFacade* _tmp9_; + ConfigFacade* _tmp10_; + GdkRGBA _tmp11_ = {0}; + gdouble _tmp12_; + GtkAdjustment* _tmp13_; + GtkScale* _tmp14_; + GtkRadioButton* _tmp15_; + GtkRadioButton* _tmp16_; + GtkRadioButton* _tmp17_; + GtkRadioButton* _tmp18_; + GtkColorButton* _tmp19_; + GdkRGBA color = {0}; + ConfigFacade* _tmp20_; + ConfigFacade* _tmp21_; + gchar* _tmp22_; + gchar* _tmp23_; + GtkColorButton* _tmp24_; + GdkRGBA _tmp25_; + GtkColorButton* _tmp26_; + ConfigFacade* _tmp27_; + ConfigFacade* _tmp28_; + gchar* _tmp29_; + gchar* _tmp30_; + gchar* _tmp31_; + GQuark _tmp33_ = 0U; +#line 94 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + static GQuark _tmp32_label0 = 0; +#line 94 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + static GQuark _tmp32_label1 = 0; +#line 456 "Preferences.c" + gchar* help_path = NULL; + gchar* _tmp37_; + const gchar* _tmp38_; + gchar* _tmp50_; + gchar* _tmp51_; + gchar* _tmp52_; + gchar* _tmp53_; + gchar* _tmp54_; + gchar* _tmp55_; + GtkComboBoxText* _tmp56_; + GtkEntry* _tmp57_; + GtkCheckButton* _tmp58_; + GtkNotebook* _tmp59_; + GtkWidget* _tmp60_; + PluginsManifestWidgetMediator* _tmp61_; + GtkComboBox* _tmp62_; + GtkComboBox* _tmp63_; + GtkCheckButton* _tmp64_; + ConfigFacade* _tmp65_; + ConfigFacade* _tmp66_; + gboolean _tmp67_; + GtkCheckButton* _tmp68_; + ConfigFacade* _tmp69_; + ConfigFacade* _tmp70_; + gboolean _tmp71_; + GtkComboBoxText* _tmp72_; + gchar* _tmp73_; + gchar* _tmp74_; + GtkComboBoxText* _tmp75_; + gchar* _tmp76_; + gchar* _tmp77_; + ConfigFacade* _tmp78_; + ConfigFacade* _tmp79_; + RawDeveloper _tmp80_; + GtkComboBoxText* _tmp81_; +#line 68 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp0_ = resources_use_header_bar (); +#line 68 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + self = (PreferencesDialog*) g_object_new (object_type, "use-header-bar", _tmp0_, NULL); +#line 70 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp1_ = app_window_get_instance (); +#line 70 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp2_ = _tmp1_; +#line 70 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp3_ = gtk_widget_get_parent_window (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, 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), _tmp3_); +#line 70 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_object_unref0 (_tmp2_); +#line 71 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp4_ = app_window_get_instance (); +#line 71 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp5_ = _tmp4_; +#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 (_tmp5_, gtk_window_get_type (), GtkWindow)); +#line 71 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_object_unref0 (_tmp5_); +#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" + _tmp6_ = self->priv->bg_color_adjustment; +#line 75 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp7_ = self->priv->bg_color_adjustment; +#line 75 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp8_ = gtk_adjustment_get_upper (_tmp7_); +#line 75 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp9_ = config_facade_get_instance (); +#line 75 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp10_ = _tmp9_; +#line 75 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + config_facade_get_bg_color (_tmp10_, &_tmp11_); +#line 75 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp12_ = _tmp11_.red; +#line 75 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + gtk_adjustment_set_value (_tmp6_, _tmp8_ - (_tmp12_ * 65535.0)); +#line 75 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_object_unref0 (_tmp10_); +#line 77 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp13_ = self->priv->bg_color_adjustment; +#line 77 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + g_signal_connect_object (_tmp13_, "value-changed", (GCallback) _preferences_dialog_on_value_changed_gtk_adjustment_value_changed, self, 0); +#line 79 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp14_ = self->priv->bg_color_slider; +#line 79 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, 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" + _tmp15_ = self->priv->transparent_checker_radio; +#line 81 "/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 82 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp16_ = self->priv->transparent_solid_radio; +#line 82 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, 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" + _tmp17_ = self->priv->transparent_none_radio; +#line 83 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, 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" + _tmp18_ = self->priv->transparent_solid_radio; +#line 85 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp19_ = 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 (_tmp18_, G_TYPE_OBJECT, GObject), "active", G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, 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" + _tmp20_ = config_facade_get_instance (); +#line 90 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp21_ = _tmp20_; +#line 90 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp22_ = configuration_facade_get_transparent_background_color (G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)); +#line 90 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp23_ = _tmp22_; +#line 90 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + gdk_rgba_parse (&color, _tmp23_); +#line 90 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_free0 (_tmp23_); +#line 90 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_object_unref0 (_tmp21_); +#line 91 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp24_ = self->priv->transparent_solid_color; +#line 91 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp25_ = color; +#line 91 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + gtk_color_chooser_set_rgba (G_TYPE_CHECK_INSTANCE_TYPE (_tmp24_, GTK_TYPE_COLOR_CHOOSER) ? ((GtkColorChooser*) _tmp24_) : NULL, &_tmp25_); +#line 92 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp26_ = self->priv->transparent_solid_color; +#line 92 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + g_signal_connect_object (_tmp26_, "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" + _tmp27_ = config_facade_get_instance (); +#line 94 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp28_ = _tmp27_; +#line 94 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp29_ = configuration_facade_get_transparent_background_type (G_TYPE_CHECK_INSTANCE_CAST (_tmp28_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)); +#line 94 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp30_ = _tmp29_; +#line 94 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_object_unref0 (_tmp28_); +#line 94 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp31_ = _tmp30_; +#line 94 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp33_ = (NULL == _tmp31_) ? 0 : g_quark_from_string (_tmp31_); +#line 94 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + g_free (_tmp31_); +#line 94 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + if (_tmp33_ == ((0 != _tmp32_label0) ? _tmp32_label0 : (_tmp32_label0 = g_quark_from_static_string ("checkered")))) { +#line 94 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + switch (0) { +#line 608 "Preferences.c" + default: + { + GtkRadioButton* _tmp34_; +#line 96 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp34_ = 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 (_tmp34_, gtk_toggle_button_get_type (), GtkToggleButton), TRUE); +#line 97 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + break; +#line 618 "Preferences.c" + } + } + } else if (_tmp33_ == ((0 != _tmp32_label1) ? _tmp32_label1 : (_tmp32_label1 = g_quark_from_static_string ("solid")))) { +#line 94 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + switch (0) { +#line 624 "Preferences.c" + default: + { + GtkRadioButton* _tmp35_; +#line 99 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp35_ = 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 (_tmp35_, gtk_toggle_button_get_type (), GtkToggleButton), TRUE); +#line 100 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + break; +#line 634 "Preferences.c" + } + } + } else { +#line 94 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + switch (0) { +#line 640 "Preferences.c" + default: + { + GtkRadioButton* _tmp36_; +#line 102 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp36_ = 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 (_tmp36_, gtk_toggle_button_get_type (), GtkToggleButton), TRUE); +#line 103 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + break; +#line 650 "Preferences.c" + } + } + } +#line 111 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp37_ = resources_get_help_path (); +#line 111 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + help_path = _tmp37_; +#line 113 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp38_ = help_path; +#line 113 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + if (_tmp38_ == NULL) { +#line 662 "Preferences.c" + GtkLabel* _tmp39_; + gchar* _tmp40_; + gchar* _tmp41_; + gchar* _tmp42_; + gchar* _tmp43_; +#line 115 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp39_ = self->priv->pattern_help; +#line 115 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp40_ = g_strconcat ("<a href=\"" RESOURCES_DIR_PATTERN_URI_SYSWIDE "\">", _ ("(Help)"), NULL); +#line 115 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp41_ = _tmp40_; +#line 115 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp42_ = g_strconcat (_tmp41_, "</a>", NULL); +#line 115 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp43_ = _tmp42_; +#line 115 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + gtk_label_set_markup (_tmp39_, _tmp43_); +#line 115 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_free0 (_tmp43_); +#line 115 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_free0 (_tmp41_); +#line 684 "Preferences.c" + } else { + GtkLabel* _tmp44_; + gchar* _tmp45_; + gchar* _tmp46_; + gchar* _tmp47_; + gchar* _tmp48_; + GtkLabel* _tmp49_; +#line 119 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp44_ = self->priv->pattern_help; +#line 119 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp45_ = g_strconcat ("<a href=\"dummy:\">", _ ("(Help)"), NULL); +#line 119 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp46_ = _tmp45_; +#line 119 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp47_ = g_strconcat (_tmp46_, "</a>", NULL); +#line 119 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp48_ = _tmp47_; +#line 119 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + gtk_label_set_markup (_tmp44_, _tmp48_); +#line 119 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_free0 (_tmp48_); +#line 119 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_free0 (_tmp46_); +#line 120 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp49_ = self->priv->pattern_help; +#line 120 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + g_signal_connect_object (_tmp49_, "activate-link", (GCallback) _preferences_dialog_on_local_pattern_help_gtk_label_activate_link, self, 0); +#line 712 "Preferences.c" + } +#line 123 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp50_ = g_strdup_printf (_ ("Year%sMonth%sDay"), G_DIR_SEPARATOR_S, G_DIR_SEPARATOR_S); +#line 123 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp51_ = _tmp50_; +#line 123 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + preferences_dialog_add_to_dir_formats (self, _tmp51_, "%Y" G_DIR_SEPARATOR_S "%m" G_DIR_SEPARATOR_S "%d"); +#line 123 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_free0 (_tmp51_); +#line 125 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp52_ = g_strdup_printf (_ ("Year%sMonth"), G_DIR_SEPARATOR_S); +#line 125 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp53_ = _tmp52_; +#line 125 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + preferences_dialog_add_to_dir_formats (self, _tmp53_, "%Y" G_DIR_SEPARATOR_S "%m"); +#line 125 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_free0 (_tmp53_); +#line 127 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp54_ = g_strdup_printf (_ ("Year%sMonth-Day"), G_DIR_SEPARATOR_S); +#line 127 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp55_ = _tmp54_; +#line 127 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + preferences_dialog_add_to_dir_formats (self, _tmp55_, "%Y" G_DIR_SEPARATOR_S "%m-%d"); +#line 127 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_free0 (_tmp55_); +#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" + _tmp56_ = self->priv->dir_pattern_combo; +#line 131 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp56_, 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" + _tmp57_ = self->priv->dir_pattern_entry; +#line 132 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp57_, GTK_TYPE_EDITABLE, 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" + _tmp58_ = self->priv->lowercase; +#line 134 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp58_, 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" + _tmp59_ = self->priv->preferences_notebook; +#line 136 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp60_ = gtk_notebook_get_nth_page (_tmp59_, 2); +#line 136 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp61_ = self->priv->plugins_mediator; +#line 136 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + gtk_container_add (G_TYPE_CHECK_INSTANCE_TYPE (_tmp60_, gtk_container_get_type ()) ? ((GtkContainer*) _tmp60_) : NULL, G_TYPE_CHECK_INSTANCE_CAST (_tmp61_, 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" + _tmp62_ = self->priv->photo_editor_combo; +#line 140 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + g_signal_connect_object (_tmp62_, "changed", (GCallback) _preferences_dialog_on_photo_editor_changed_gtk_combo_box_changed, self, 0); +#line 141 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp63_ = self->priv->raw_editor_combo; +#line 141 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + g_signal_connect_object (_tmp63_, "changed", (GCallback) _preferences_dialog_on_raw_editor_changed_gtk_combo_box_changed, self, 0); +#line 143 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp64_ = self->priv->autoimport; +#line 143 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp65_ = config_facade_get_instance (); +#line 143 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp66_ = _tmp65_; +#line 143 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp67_ = configuration_facade_get_auto_import_from_library (G_TYPE_CHECK_INSTANCE_CAST (_tmp66_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)); +#line 143 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + gtk_toggle_button_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp64_, gtk_toggle_button_get_type (), GtkToggleButton), _tmp67_); +#line 143 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_object_unref0 (_tmp66_); +#line 145 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp68_ = self->priv->write_metadata; +#line 145 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp69_ = config_facade_get_instance (); +#line 145 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp70_ = _tmp69_; +#line 145 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp71_ = configuration_facade_get_commit_metadata_to_masters (G_TYPE_CHECK_INSTANCE_CAST (_tmp70_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)); +#line 145 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + gtk_toggle_button_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp68_, gtk_toggle_button_get_type (), GtkToggleButton), _tmp71_); +#line 145 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_object_unref0 (_tmp70_); +#line 147 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp72_ = self->priv->default_raw_developer_combo; +#line 147 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp73_ = raw_developer_get_label (RAW_DEVELOPER_CAMERA); +#line 147 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp74_ = _tmp73_; +#line 147 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + gtk_combo_box_text_append_text (_tmp72_, _tmp74_); +#line 147 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_free0 (_tmp74_); +#line 148 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp75_ = self->priv->default_raw_developer_combo; +#line 148 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp76_ = raw_developer_get_label (RAW_DEVELOPER_SHOTWELL); +#line 148 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp77_ = _tmp76_; +#line 148 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + gtk_combo_box_text_append_text (_tmp75_, _tmp77_); +#line 148 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_free0 (_tmp77_); +#line 149 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp78_ = config_facade_get_instance (); +#line 149 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp79_ = _tmp78_; +#line 149 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp80_ = configuration_facade_get_default_raw_developer (G_TYPE_CHECK_INSTANCE_CAST (_tmp79_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)); +#line 149 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + preferences_dialog_set_raw_developer_combo (self, _tmp80_); +#line 149 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_object_unref0 (_tmp79_); +#line 150 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp81_ = 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 (_tmp81_, 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 834 "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 841 "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_; + gboolean _tmp23_; +#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" + _tmp23_ = 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" + gtk_toggle_button_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, gtk_toggle_button_get_type (), GtkToggleButton), _tmp23_); +#line 162 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_object_unref0 (_tmp22_); +#line 948 "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 972 "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 978 "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 991 "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 997 "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 1004 "Preferences.c" + } + } +#line 165 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_object_unref0 (config); +#line 1009 "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_TYPE_COLOR_CHOOSER) ? ((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 1043 "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 1054 "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 1071 "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 1093 "Preferences.c" + } + __finally22: +#line 185 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 1098 "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 1106 "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 1112 "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 1119 "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; + gchar** _tmp0_; + gint _tmp0__length1; + gchar** _tmp1_; + gint _tmp1__length1; + SortedList* _tmp2_; + SortedList* _tmp3_; + gint _tmp4_; + gint _tmp5_; + GtkCellRendererPixbuf* pixbuf_renderer = NULL; + GtkCellRendererPixbuf* _tmp6_; + GtkCellRendererText* text_renderer = NULL; + GtkCellRendererText* _tmp7_; + GtkComboBox* _tmp8_; + GtkComboBox* _tmp9_; + GtkCellRendererPixbuf* _tmp10_; + GtkComboBox* _tmp11_; + GtkCellRendererText* _tmp12_; + GtkComboBox* _tmp13_; + GtkCellRendererPixbuf* _tmp14_; + GtkComboBox* _tmp15_; + GtkCellRendererText* _tmp16_; + GtkListStore* combo_store = NULL; + GtkListStore* _tmp17_; + GtkTreeIter iter = {0}; + gint current_app = 0; + GtkComboBox* _tmp67_; + GtkListStore* _tmp68_; + gint _tmp69_; + 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" + _tmp0_ = mime_types; +#line 196 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp0__length1 = mime_types_length1; +#line 196 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _vala_assert (_tmp0__length1 != 0, "mime_types.length != 0"); +#line 197 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp1_ = mime_types; +#line 197 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp1__length1 = mime_types_length1; +#line 197 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp2_ = desktop_integration_get_apps_for_mime_types (_tmp1_, _tmp1__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 = _tmp2_; +#line 199 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp3_ = _vala_external_apps; +#line 199 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp4_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_COLLECTION, GeeCollection)); +#line 199 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp5_ = _tmp4_; +#line 199 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + if (_tmp5_ == 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 1188 "Preferences.c" + } else { +#line 200 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_object_unref0 (_vala_external_apps); +#line 1192 "Preferences.c" + } +#line 200 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + return; +#line 1196 "Preferences.c" + } +#line 203 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp6_ = (GtkCellRendererPixbuf*) gtk_cell_renderer_pixbuf_new (); +#line 203 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + g_object_ref_sink (_tmp6_); +#line 203 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + pixbuf_renderer = _tmp6_; +#line 204 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp7_ = (GtkCellRendererText*) gtk_cell_renderer_text_new (); +#line 204 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + g_object_ref_sink (_tmp7_); +#line 204 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + text_renderer = _tmp7_; +#line 205 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp8_ = combo_box; +#line 205 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + gtk_cell_layout_clear (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, GTK_TYPE_CELL_LAYOUT, GtkCellLayout)); +#line 206 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp9_ = combo_box; +#line 206 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp10_ = pixbuf_renderer; +#line 206 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + gtk_cell_layout_pack_start (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, GTK_TYPE_CELL_LAYOUT, GtkCellLayout), G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, gtk_cell_renderer_get_type (), GtkCellRenderer), FALSE); +#line 207 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp11_ = combo_box; +#line 207 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp12_ = text_renderer; +#line 207 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + gtk_cell_layout_pack_start (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, GTK_TYPE_CELL_LAYOUT, GtkCellLayout), G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, gtk_cell_renderer_get_type (), GtkCellRenderer), FALSE); +#line 208 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp13_ = combo_box; +#line 208 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp14_ = pixbuf_renderer; +#line 208 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + gtk_cell_layout_add_attribute (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, GTK_TYPE_CELL_LAYOUT, GtkCellLayout), G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, gtk_cell_renderer_get_type (), GtkCellRenderer), "pixbuf", 0); +#line 209 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp15_ = combo_box; +#line 209 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp16_ = text_renderer; +#line 209 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + gtk_cell_layout_add_attribute (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, GTK_TYPE_CELL_LAYOUT, GtkCellLayout), G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, gtk_cell_renderer_get_type (), GtkCellRenderer), "text", 1); +#line 212 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp17_ = 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 = _tmp17_; +#line 215 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + current_app = -1; +#line 1244 "Preferences.c" + { + GeeIterator* _app_it = NULL; + SortedList* _tmp18_; + GeeIterator* _tmp19_; +#line 217 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp18_ = _vala_external_apps; +#line 217 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp19_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, GEE_TYPE_ITERABLE, GeeIterable)); +#line 217 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _app_it = _tmp19_; +#line 217 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + while (TRUE) { +#line 1257 "Preferences.c" + GeeIterator* _tmp20_; + gboolean _tmp21_; + GAppInfo* app = NULL; + GeeIterator* _tmp22_; + gpointer _tmp23_; + GtkListStore* _tmp24_; + GtkTreeIter _tmp25_ = {0}; + GIcon* app_icon = NULL; + GAppInfo* _tmp26_; + GIcon* _tmp27_; + GIcon* _tmp28_; + GtkListStore* _tmp56_; + GtkTreeIter _tmp57_; + GAppInfo* _tmp58_; + const gchar* _tmp59_; + GValue _tmp60_ = {0}; + GAppInfo* _tmp61_; + const gchar* _tmp62_; + const gchar* _tmp63_; +#line 217 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp20_ = _app_it; +#line 217 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp21_ = gee_iterator_next (_tmp20_); +#line 217 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + if (!_tmp21_) { +#line 217 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + break; +#line 1285 "Preferences.c" + } +#line 217 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp22_ = _app_it; +#line 217 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp23_ = gee_iterator_get (_tmp22_); +#line 217 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + app = (GAppInfo*) _tmp23_; +#line 218 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp24_ = combo_store; +#line 218 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + gtk_list_store_append (_tmp24_, &_tmp25_); +#line 218 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + iter = _tmp25_; +#line 220 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp26_ = app; +#line 220 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp27_ = g_app_info_get_icon (_tmp26_); +#line 220 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp28_ = _g_object_ref0 (_tmp27_); +#line 220 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + app_icon = _tmp28_; +#line 1307 "Preferences.c" + { + GIcon* _tmp29_; +#line 222 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp29_ = app_icon; +#line 222 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp29_, g_file_icon_get_type ())) { +#line 1314 "Preferences.c" + GdkPixbuf* _tmp30_ = NULL; + GIcon* _tmp31_; + GFile* _tmp32_; + gchar* _tmp33_; + gchar* _tmp34_; + GdkPixbuf* _tmp35_; + GdkPixbuf* _tmp36_; + GtkListStore* _tmp37_; + GtkTreeIter _tmp38_; + GdkPixbuf* _tmp39_; + GValue _tmp40_ = {0}; +#line 223 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp31_ = app_icon; +#line 223 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp32_ = g_file_icon_get_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp31_, g_file_icon_get_type (), GFileIcon)); +#line 223 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp33_ = g_file_get_path (_tmp32_); +#line 223 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp34_ = _tmp33_; +#line 223 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp35_ = gdk_pixbuf_new_from_file (_tmp34_, &_inner_error_); +#line 223 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp36_ = _tmp35_; +#line 223 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_free0 (_tmp34_); +#line 223 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp30_ = _tmp36_; +#line 223 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 1344 "Preferences.c" + goto __catch23_g_error; + } +#line 223 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp37_ = combo_store; +#line 223 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp38_ = iter; +#line 223 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp39_ = scale_pixbuf (_tmp30_, RESOURCES_DEFAULT_ICON_SCALE, GDK_INTERP_BILINEAR, FALSE); +#line 223 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + g_value_init (&_tmp40_, gdk_pixbuf_get_type ()); +#line 223 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + g_value_take_object (&_tmp40_, _tmp39_); +#line 223 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + gtk_list_store_set_value (_tmp37_, &_tmp38_, 0, &_tmp40_); +#line 223 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + G_IS_VALUE (&_tmp40_) ? (g_value_unset (&_tmp40_), NULL) : NULL; +#line 222 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_object_unref0 (_tmp30_); +#line 1363 "Preferences.c" + } else { + GIcon* _tmp41_; +#line 226 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp41_ = app_icon; +#line 226 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp41_, g_themed_icon_get_type ())) { +#line 1370 "Preferences.c" + GdkPixbuf* icon_pixbuf = NULL; + GtkIconTheme* _tmp42_; + GIcon* _tmp43_; + gchar** _tmp44_; + gchar** _tmp45_; + const gchar* _tmp46_; + GdkPixbuf* _tmp47_; + GtkListStore* _tmp48_; + GtkTreeIter _tmp49_; + GdkPixbuf* _tmp50_; + GValue _tmp51_ = {0}; +#line 227 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp42_ = gtk_icon_theme_get_default (); +#line 227 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp43_ = app_icon; +#line 227 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp45_ = _tmp44_ = g_themed_icon_get_names (G_TYPE_CHECK_INSTANCE_CAST (_tmp43_, g_themed_icon_get_type (), GThemedIcon)); +#line 227 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp46_ = _tmp45_[0]; +#line 227 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp47_ = gtk_icon_theme_load_icon (_tmp42_, _tmp46_, RESOURCES_DEFAULT_ICON_SCALE, GTK_ICON_LOOKUP_FORCE_SIZE, &_inner_error_); +#line 227 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + icon_pixbuf = _tmp47_; +#line 227 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 1396 "Preferences.c" + goto __catch23_g_error; + } +#line 231 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp48_ = combo_store; +#line 231 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp49_ = iter; +#line 231 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp50_ = icon_pixbuf; +#line 231 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + g_value_init (&_tmp51_, gdk_pixbuf_get_type ()); +#line 231 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + g_value_set_object (&_tmp51_, _tmp50_); +#line 231 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + gtk_list_store_set_value (_tmp48_, &_tmp49_, 0, &_tmp51_); +#line 231 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + G_IS_VALUE (&_tmp51_) ? (g_value_unset (&_tmp51_), NULL) : NULL; +#line 226 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_object_unref0 (icon_pixbuf); +#line 1415 "Preferences.c" + } + } + } + goto __finally23; + __catch23_g_error: + { + GError* _error_ = NULL; + GError* _tmp52_; + const gchar* _tmp53_; + gchar* _tmp54_; + gchar* _tmp55_; +#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" + _tmp52_ = _error_; +#line 234 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp53_ = _tmp52_->message; +#line 234 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp54_ = g_strconcat ("Error loading icon pixbuf: ", _tmp53_, NULL); +#line 234 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp55_ = _tmp54_; +#line 234 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + g_warning ("Preferences.vala:234: %s", _tmp55_); +#line 234 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_free0 (_tmp55_); +#line 221 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_error_free0 (_error_); +#line 1445 "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 1468 "Preferences.c" + } +#line 237 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp56_ = combo_store; +#line 237 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp57_ = iter; +#line 237 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp58_ = app; +#line 237 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp59_ = g_app_info_get_name (_tmp58_); +#line 237 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + g_value_init (&_tmp60_, G_TYPE_STRING); +#line 237 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + g_value_set_string (&_tmp60_, _tmp59_); +#line 237 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + gtk_list_store_set_value (_tmp56_, &_tmp57_, 1, &_tmp60_); +#line 237 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + G_IS_VALUE (&_tmp60_) ? (g_value_unset (&_tmp60_), NULL) : NULL; +#line 239 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp61_ = app; +#line 239 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp62_ = g_app_info_get_commandline (_tmp61_); +#line 239 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp63_ = current_app_executable; +#line 239 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + if (g_strcmp0 (_tmp62_, _tmp63_) == 0) { +#line 1494 "Preferences.c" + SortedList* _tmp64_; + GAppInfo* _tmp65_; + gint _tmp66_; +#line 240 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp64_ = _vala_external_apps; +#line 240 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp65_ = app; +#line 240 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp66_ = sorted_list_index_of (_tmp64_, _tmp65_); +#line 240 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + current_app = _tmp66_; +#line 1506 "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 1512 "Preferences.c" + } +#line 217 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_object_unref0 (_app_it); +#line 1516 "Preferences.c" + } +#line 245 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp67_ = combo_box; +#line 245 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp68_ = combo_store; +#line 245 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + gtk_combo_box_set_model (_tmp67_, G_TYPE_CHECK_INSTANCE_CAST (_tmp68_, GTK_TYPE_TREE_MODEL, GtkTreeModel)); +#line 247 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp69_ = current_app; +#line 247 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + if (_tmp69_ != -1) { +#line 1528 "Preferences.c" + GtkComboBox* _tmp70_; + gint _tmp71_; +#line 248 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp70_ = combo_box; +#line 248 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp71_ = current_app; +#line 248 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + gtk_combo_box_set_active (_tmp70_, _tmp71_); +#line 1537 "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 1549 "Preferences.c" + } else { +#line 193 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_object_unref0 (_vala_external_apps); +#line 1553 "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 _tmp32_; +#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 1591 "Preferences.c" + gint i = 0; +#line 256 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + i = 0; +#line 1595 "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 1623 "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 _tmp21_; +#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 1647 "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 1665 "Preferences.c" + GtkComboBox* _tmp19_; + gint _tmp20_; +#line 259 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp19_ = combo_box; +#line 259 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp20_ = i; +#line 259 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + gtk_combo_box_set_active (_tmp19_, _tmp20_); +#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 1680 "Preferences.c" + } +#line 263 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp21_ = i; +#line 263 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + i = _tmp21_ + 1; +#line 257 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _preferences_dialog_path_format_unref0 (pf); +#line 1688 "Preferences.c" + } +#line 257 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_object_unref0 (_pf_list); +#line 1692 "Preferences.c" + } + } else { + gchar* s = NULL; + ConfigFacade* _tmp22_; + ConfigFacade* _tmp23_; + gchar* _tmp24_; + gchar* _tmp25_; + const gchar* _tmp26_; + gboolean _tmp27_; +#line 267 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp22_ = config_facade_get_instance (); +#line 267 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp23_ = _tmp22_; +#line 267 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp24_ = configuration_facade_get_directory_pattern_custom (G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)); +#line 267 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp25_ = _tmp24_; +#line 267 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_object_unref0 (_tmp23_); +#line 267 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + s = _tmp25_; +#line 268 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp26_ = s; +#line 268 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp27_ = is_string_empty (_tmp26_); +#line 268 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + if (!_tmp27_) { +#line 1720 "Preferences.c" + GtkComboBox* _tmp28_; + GeeArrayList* _tmp29_; + gint _tmp30_; + gint _tmp31_; +#line 269 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp28_ = combo_box; +#line 269 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp29_ = self->priv->path_formats; +#line 269 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp30_ = gee_abstract_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp29_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection)); +#line 269 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp31_ = _tmp30_; +#line 269 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + gtk_combo_box_set_active (_tmp28_, _tmp31_ - 1); +#line 270 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + found = TRUE; +#line 1737 "Preferences.c" + } +#line 254 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_free0 (s); +#line 1741 "Preferences.c" + } +#line 274 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp32_ = found; +#line 274 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + if (!_tmp32_) { +#line 1747 "Preferences.c" + GtkComboBox* _tmp33_; +#line 275 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp33_ = combo_box; +#line 275 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + gtk_combo_box_set_active (_tmp33_, 0); +#line 1753 "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 1759 "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 1778 "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 1788 "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_TYPE_FILE_CHOOSER, 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 1820 "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_; + gint _tmp16_; + gpointer _tmp17_; + PreferencesDialogPathFormat* _tmp18_; + const gchar* _tmp19_; +#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 1887 "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 1893 "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_ = 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" + _tmp17_ = gee_abstract_list_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, GEE_TYPE_ABSTRACT_LIST, GeeAbstractList), _tmp16_); +#line 304 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + pf = (PreferencesDialogPathFormat*) _tmp17_; +#line 305 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp18_ = pf; +#line 305 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp19_ = _tmp18_->pattern; +#line 305 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + if (NULL == _tmp19_) { +#line 1911 "Preferences.c" + ConfigFacade* _tmp20_; + ConfigFacade* _tmp21_; + GtkEntry* _tmp22_; + const gchar* _tmp23_; + const gchar* _tmp24_; + ConfigFacade* _tmp25_; + ConfigFacade* _tmp26_; +#line 306 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp20_ = config_facade_get_instance (); +#line 306 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp21_ = _tmp20_; +#line 306 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp22_ = self->priv->dir_pattern_entry; +#line 306 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp23_ = gtk_entry_get_text (_tmp22_); +#line 306 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp24_ = _tmp23_; +#line 306 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + configuration_facade_set_directory_pattern_custom (G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), _tmp24_); +#line 306 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_object_unref0 (_tmp21_); +#line 307 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp25_ = config_facade_get_instance (); +#line 307 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp26_ = _tmp25_; +#line 307 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + configuration_facade_set_directory_pattern (G_TYPE_CHECK_INSTANCE_CAST (_tmp26_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), NULL); +#line 307 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_object_unref0 (_tmp26_); +#line 1941 "Preferences.c" + } else { + ConfigFacade* _tmp27_; + ConfigFacade* _tmp28_; + PreferencesDialogPathFormat* _tmp29_; + const gchar* _tmp30_; +#line 309 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp27_ = config_facade_get_instance (); +#line 309 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp28_ = _tmp27_; +#line 309 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp29_ = pf; +#line 309 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp30_ = _tmp29_->pattern; +#line 309 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + configuration_facade_set_directory_pattern (G_TYPE_CHECK_INSTANCE_CAST (_tmp28_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), _tmp30_); +#line 309 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_object_unref0 (_tmp28_); +#line 1959 "Preferences.c" + } +#line 296 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _preferences_dialog_path_format_unref0 (pf); +#line 1963 "Preferences.c" +} + + +static gboolean preferences_dialog_on_delete (PreferencesDialog* self) { + gboolean result = FALSE; + gboolean _tmp0_; + gboolean _tmp1_; +#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" + _tmp0_ = preferences_dialog_get_allow_closing (self); +#line 314 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + if (!_tmp0_) { +#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 1981 "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" + _tmp1_ = 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" + result = _tmp1_; +#line 318 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + return result; +#line 1991 "Preferences.c" +} + + +static void preferences_dialog_on_close (PreferencesDialog* self) { + gboolean _tmp0_; +#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" + _tmp0_ = preferences_dialog_get_allow_closing (self); +#line 322 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + if (!_tmp0_) { +#line 323 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + return; +#line 2005 "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 2011 "Preferences.c" +} + + +static void preferences_dialog_on_value_changed (PreferencesDialog* self) { + GtkAdjustment* _tmp0_; + gdouble _tmp1_; + GtkAdjustment* _tmp2_; + gdouble _tmp3_; +#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_ = gtk_adjustment_get_upper (_tmp0_); +#line 330 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp2_ = self->priv->bg_color_adjustment; +#line 330 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp3_ = gtk_adjustment_get_value (_tmp2_); +#line 330 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + preferences_dialog_set_background_color (self, ((gdouble) (_tmp1_ - _tmp3_)) / 65535.0); +#line 2032 "Preferences.c" +} + + +static gboolean preferences_dialog_on_bg_color_reset (PreferencesDialog* self, GdkEventButton* event) { + gboolean result = FALSE; + gboolean _tmp0_ = FALSE; + gboolean _tmp1_ = FALSE; + GdkEventButton* _tmp2_; + guint _tmp3_; +#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; +#line 335 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp3_ = _tmp2_->button; +#line 335 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + if (_tmp3_ == ((guint) 1)) { +#line 2052 "Preferences.c" + GdkEventButton* _tmp4_; + GdkEventType _tmp5_; +#line 335 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp4_ = event; +#line 335 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp5_ = _tmp4_->type; +#line 335 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp1_ = _tmp5_ == GDK_BUTTON_PRESS; +#line 2061 "Preferences.c" + } else { +#line 335 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp1_ = FALSE; +#line 2065 "Preferences.c" + } +#line 335 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + if (_tmp1_) { +#line 2069 "Preferences.c" + GdkEventButton* _tmp6_; + GdkModifierType _tmp7_; + gboolean _tmp8_; +#line 336 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp6_ = event; +#line 336 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp7_ = _tmp6_->state; +#line 336 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp8_ = has_only_key_modifier (_tmp7_, GDK_CONTROL_MASK); +#line 336 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp0_ = _tmp8_; +#line 2081 "Preferences.c" + } else { +#line 335 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp0_ = FALSE; +#line 2085 "Preferences.c" + } +#line 335 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + if (_tmp0_) { +#line 2089 "Preferences.c" + GtkScale* _tmp9_; + GtkAdjustment* _tmp10_; + gdouble _tmp11_; + GdkRGBA _tmp12_ = {0}; + gdouble _tmp13_; +#line 338 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp9_ = self->priv->bg_color_slider; +#line 338 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp10_ = self->priv->bg_color_adjustment; +#line 338 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp11_ = gtk_adjustment_get_upper (_tmp10_); +#line 338 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + parse_color (CONFIG_FACADE_DEFAULT_BG_COLOR, &_tmp12_); +#line 338 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp13_ = _tmp12_.red; +#line 338 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + gtk_range_set_value (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, gtk_range_get_type (), GtkRange), _tmp11_ - (_tmp13_ * 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 2113 "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 2119 "Preferences.c" +} + + +static void preferences_dialog_on_dir_pattern_combo_changed (PreferencesDialog* self) { + PreferencesDialogPathFormat* pf = NULL; + GeeArrayList* _tmp0_; + GtkComboBoxText* _tmp1_; + gint _tmp2_; + gpointer _tmp3_; + PreferencesDialogPathFormat* _tmp4_; + const gchar* _tmp5_; +#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_ = 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" + _tmp3_ = gee_abstract_list_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_ABSTRACT_LIST, GeeAbstractList), _tmp2_); +#line 349 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + pf = (PreferencesDialogPathFormat*) _tmp3_; +#line 350 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp4_ = pf; +#line 350 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp5_ = _tmp4_->pattern; +#line 350 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + if (NULL == _tmp5_) { +#line 2149 "Preferences.c" + gchar* dir_pattern = NULL; + ConfigFacade* _tmp6_; + ConfigFacade* _tmp7_; + gchar* _tmp8_; + gchar* _tmp9_; + const gchar* _tmp10_; + gboolean _tmp11_; + GtkEntry* _tmp13_; + const gchar* _tmp14_; + GtkEntry* _tmp15_; + GtkEntry* _tmp16_; +#line 352 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp6_ = config_facade_get_instance (); +#line 352 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp7_ = _tmp6_; +#line 352 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp8_ = configuration_facade_get_directory_pattern_custom (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)); +#line 352 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp9_ = _tmp8_; +#line 352 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_object_unref0 (_tmp7_); +#line 352 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + dir_pattern = _tmp9_; +#line 353 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp10_ = dir_pattern; +#line 353 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp11_ = is_string_empty (_tmp10_); +#line 353 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + if (_tmp11_) { +#line 2179 "Preferences.c" + gchar* _tmp12_; +#line 354 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp12_ = 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 = _tmp12_; +#line 2187 "Preferences.c" + } +#line 355 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp13_ = self->priv->dir_pattern_entry; +#line 355 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp14_ = dir_pattern; +#line 355 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + gtk_entry_set_text (_tmp13_, _tmp14_); +#line 356 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp15_ = self->priv->dir_pattern_entry; +#line 356 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + g_object_set (_tmp15_, "editable", TRUE, NULL); +#line 357 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp16_ = self->priv->dir_pattern_entry; +#line 357 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, gtk_widget_get_type (), GtkWidget), TRUE); +#line 350 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_free0 (dir_pattern); +#line 2205 "Preferences.c" + } else { + GtkEntry* _tmp17_; + PreferencesDialogPathFormat* _tmp18_; + const gchar* _tmp19_; + GtkEntry* _tmp20_; + GtkEntry* _tmp21_; +#line 359 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp17_ = self->priv->dir_pattern_entry; +#line 359 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp18_ = pf; +#line 359 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp19_ = _tmp18_->pattern; +#line 359 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + gtk_entry_set_text (_tmp17_, _tmp19_); +#line 360 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp20_ = self->priv->dir_pattern_entry; +#line 360 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + g_object_set (_tmp20_, "editable", FALSE, NULL); +#line 361 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp21_ = self->priv->dir_pattern_entry; +#line 361 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, gtk_widget_get_type (), GtkWidget), FALSE); +#line 2228 "Preferences.c" + } +#line 348 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _preferences_dialog_path_format_unref0 (pf); +#line 2232 "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_; + gboolean _tmp7_; +#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" + _tmp7_ = is_string_empty (_tmp6_); +#line 367 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + if (_tmp7_) { +#line 2266 "Preferences.c" + GtkEntry* _tmp8_; + const gchar* _tmp9_; + const gchar* _tmp10_; + gboolean _tmp11_; +#line 367 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp8_ = self->priv->dir_pattern_entry; +#line 367 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp9_ = gtk_entry_get_text (_tmp8_); +#line 367 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp10_ = _tmp9_; +#line 367 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp11_ = is_string_empty (_tmp10_); +#line 367 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp5_ = !_tmp11_; +#line 2281 "Preferences.c" + } else { +#line 367 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp5_ = FALSE; +#line 2285 "Preferences.c" + } +#line 367 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + if (_tmp5_) { +#line 2289 "Preferences.c" + GtkLabel* _tmp12_; + GtkEntry* _tmp13_; + GtkEntry* _tmp14_; +#line 369 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp12_ = self->priv->dir_pattern_example; +#line 369 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + gtk_label_set_text (_tmp12_, _ ("Invalid pattern")); +#line 370 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp13_ = self->priv->dir_pattern_entry; +#line 370 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + gtk_entry_set_icon_from_icon_name (_tmp13_, GTK_ENTRY_ICON_SECONDARY, "dialog-error"); +#line 371 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp14_ = self->priv->dir_pattern_entry; +#line 371 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + gtk_entry_set_icon_activatable (_tmp14_, GTK_ENTRY_ICON_SECONDARY, FALSE); +#line 372 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + preferences_dialog_set_allow_closing (self, FALSE); +#line 2307 "Preferences.c" + } else { + GtkLabel* _tmp15_; + const gchar* _tmp16_; + GtkEntry* _tmp17_; +#line 375 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp15_ = self->priv->dir_pattern_example; +#line 375 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp16_ = example; +#line 375 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + gtk_label_set_text (_tmp15_, _tmp16_); +#line 376 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp17_ = self->priv->dir_pattern_entry; +#line 376 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + gtk_entry_set_icon_from_icon_name (_tmp17_, GTK_ENTRY_ICON_SECONDARY, NULL); +#line 377 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + preferences_dialog_set_allow_closing (self, TRUE); +#line 2324 "Preferences.c" + } +#line 365 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_free0 (example); +#line 2328 "Preferences.c" +} + + +static void preferences_dialog_set_allow_closing (PreferencesDialog* self, gboolean allow) { + gboolean _tmp0_; + gboolean _tmp1_; +#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" + _tmp0_ = allow; +#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), _tmp0_); +#line 383 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp1_ = allow; +#line 383 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + self->priv->allow_closing = _tmp1_; +#line 2345 "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 2360 "Preferences.c" +} + + +static void preferences_dialog_set_background_color (PreferencesDialog* self, gdouble bg_color_value) { + ConfigFacade* _tmp0_; + ConfigFacade* _tmp1_; + gdouble _tmp2_; + GdkRGBA _tmp3_ = {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" + _tmp2_ = bg_color_value; +#line 391 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + preferences_dialog_to_grayscale (self, _tmp2_, &_tmp3_); +#line 391 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + config_facade_set_bg_color (_tmp1_, &_tmp3_); +#line 391 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_object_unref0 (_tmp1_); +#line 2383 "Preferences.c" +} + + +static void preferences_dialog_to_grayscale (PreferencesDialog* self, gdouble color_value, GdkRGBA* result) { + GdkRGBA color = {0}; + gdouble _tmp0_; + gdouble _tmp1_; + gdouble _tmp2_; +#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" + _tmp0_ = color_value; +#line 397 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + color.red = _tmp0_; +#line 398 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp1_ = color_value; +#line 398 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + color.green = _tmp1_; +#line 399 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp2_ = color_value; +#line 399 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + color.blue = _tmp2_; +#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 2414 "Preferences.c" +} + + +static void preferences_dialog_on_photo_editor_changed (PreferencesDialog* self) { + gint _tmp0_ = 0; + GtkComboBox* _tmp1_; + gint _tmp2_; + SortedList* _tmp3_; + gint _tmp4_; + gint _tmp5_; + gint photo_app_choice_index = 0; + GAppInfo* app = NULL; + SortedList* _tmp11_; + gpointer _tmp12_; + ConfigFacade* _tmp13_; + ConfigFacade* _tmp14_; + gchar* _tmp15_; + gchar* _tmp16_; + gchar* _tmp17_; + gchar* _tmp18_; +#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_ = gtk_combo_box_get_active (_tmp1_); +#line 406 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp3_ = self->priv->external_photo_apps; +#line 406 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp4_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_COLLECTION, GeeCollection)); +#line 406 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp5_ = _tmp4_; +#line 406 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + if (_tmp2_ < _tmp5_) { +#line 2449 "Preferences.c" + GtkComboBox* _tmp6_; + gint _tmp7_; +#line 407 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp6_ = self->priv->photo_editor_combo; +#line 407 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp7_ = gtk_combo_box_get_active (_tmp6_); +#line 407 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp0_ = _tmp7_; +#line 2458 "Preferences.c" + } else { + SortedList* _tmp8_; + gint _tmp9_; + gint _tmp10_; +#line 407 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp8_ = self->priv->external_photo_apps; +#line 407 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp9_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, GEE_TYPE_COLLECTION, GeeCollection)); +#line 407 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp10_ = _tmp9_; +#line 407 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp0_ = _tmp10_; +#line 2471 "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" + _tmp11_ = self->priv->external_photo_apps; +#line 409 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp12_ = sorted_list_get_at (_tmp11_, photo_app_choice_index); +#line 409 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + app = (GAppInfo*) _tmp12_; +#line 411 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp13_ = config_facade_get_instance (); +#line 411 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp14_ = _tmp13_; +#line 411 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp15_ = desktop_integration_get_app_open_command (app); +#line 411 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp16_ = _tmp15_; +#line 411 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + configuration_facade_set_external_photo_app (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), _tmp16_); +#line 411 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_free0 (_tmp16_); +#line 411 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_object_unref0 (_tmp14_); +#line 413 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp17_ = desktop_integration_get_app_open_command (app); +#line 413 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp18_ = _tmp17_; +#line 413 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + g_debug ("Preferences.vala:413: setting external photo editor to: %s", _tmp18_); +#line 413 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_free0 (_tmp18_); +#line 405 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_object_unref0 (app); +#line 2505 "Preferences.c" +} + + +static void preferences_dialog_on_raw_editor_changed (PreferencesDialog* self) { + gint _tmp0_ = 0; + GtkComboBox* _tmp1_; + gint _tmp2_; + SortedList* _tmp3_; + gint _tmp4_; + gint _tmp5_; + gint raw_app_choice_index = 0; + GAppInfo* app = NULL; + SortedList* _tmp11_; + gpointer _tmp12_; + ConfigFacade* _tmp13_; + ConfigFacade* _tmp14_; + const gchar* _tmp15_; + const gchar* _tmp16_; +#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_ = gtk_combo_box_get_active (_tmp1_); +#line 417 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp3_ = self->priv->external_raw_apps; +#line 417 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp4_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_COLLECTION, GeeCollection)); +#line 417 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp5_ = _tmp4_; +#line 417 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + if (_tmp2_ < _tmp5_) { +#line 2538 "Preferences.c" + GtkComboBox* _tmp6_; + gint _tmp7_; +#line 418 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp6_ = self->priv->raw_editor_combo; +#line 418 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp7_ = gtk_combo_box_get_active (_tmp6_); +#line 418 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp0_ = _tmp7_; +#line 2547 "Preferences.c" + } else { + SortedList* _tmp8_; + gint _tmp9_; + gint _tmp10_; +#line 418 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp8_ = self->priv->external_raw_apps; +#line 418 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp9_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, GEE_TYPE_COLLECTION, GeeCollection)); +#line 418 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp10_ = _tmp9_; +#line 418 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp0_ = _tmp10_; +#line 2560 "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" + _tmp11_ = self->priv->external_raw_apps; +#line 420 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp12_ = sorted_list_get_at (_tmp11_, raw_app_choice_index); +#line 420 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + app = (GAppInfo*) _tmp12_; +#line 422 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp13_ = config_facade_get_instance (); +#line 422 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp14_ = _tmp13_; +#line 422 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp15_ = 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 (_tmp14_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), _tmp15_); +#line 422 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_object_unref0 (_tmp14_); +#line 424 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp16_ = 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", _tmp16_); +#line 416 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_object_unref0 (app); +#line 2586 "Preferences.c" +} + + +static RawDeveloper preferences_dialog_raw_developer_from_combo (PreferencesDialog* self) { + RawDeveloper result = 0; + GtkComboBoxText* _tmp0_; + gint _tmp1_; +#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" + _tmp1_ = gtk_combo_box_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_combo_box_get_type (), GtkComboBox)); +#line 428 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + if (_tmp1_ == 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 2606 "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 2612 "Preferences.c" +} + + +static void preferences_dialog_set_raw_developer_combo (PreferencesDialog* self, RawDeveloper d) { + RawDeveloper _tmp0_; +#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" + _tmp0_ = d; +#line 434 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + if (_tmp0_ == RAW_DEVELOPER_CAMERA) { +#line 2624 "Preferences.c" + GtkComboBoxText* _tmp1_; +#line 435 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp1_ = 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 (_tmp1_, gtk_combo_box_get_type (), GtkComboBox), 0); +#line 2630 "Preferences.c" + } else { + GtkComboBoxText* _tmp2_; +#line 437 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp2_ = 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 (_tmp2_, gtk_combo_box_get_type (), GtkComboBox), 1); +#line 2637 "Preferences.c" + } +} + + +static void preferences_dialog_on_default_raw_developer_changed (PreferencesDialog* self) { + ConfigFacade* _tmp0_; + ConfigFacade* _tmp1_; + RawDeveloper _tmp2_; +#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" + _tmp2_ = preferences_dialog_raw_developer_from_combo (self); +#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), _tmp2_); +#line 441 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_object_unref0 (_tmp1_); +#line 2658 "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_TYPE_FILE_CHOOSER, 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 2675 "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 2682 "Preferences.c" +} + + +static gboolean preferences_dialog_real_map_event (GtkWidget* base, GdkEventAny* event) { + PreferencesDialog * self; + gboolean result = FALSE; + gboolean _result_ = FALSE; + GdkEventAny* _tmp0_; + gboolean _tmp1_; + GtkFileChooserButton* _tmp2_; +#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" + _tmp0_ = event; +#line 449 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp1_ = 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), _tmp0_); +#line 449 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _result_ = _tmp1_; +#line 454 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp2_ = self->priv->library_dir_button; +#line 454 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GTK_TYPE_FILE_CHOOSER, 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 2711 "Preferences.c" +} + + +static void preferences_dialog_add_to_dir_formats (PreferencesDialog* self, const gchar* name, const gchar* pattern) { + PreferencesDialogPathFormat* pf = NULL; + const gchar* _tmp0_; + const gchar* _tmp1_; + PreferencesDialogPathFormat* _tmp2_; + GeeArrayList* _tmp3_; + GtkComboBoxText* _tmp4_; + const gchar* _tmp5_; +#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_ = name; +#line 460 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp1_ = pattern; +#line 460 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp2_ = preferences_dialog_path_format_new (_tmp0_, _tmp1_); +#line 460 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + pf = _tmp2_; +#line 461 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp3_ = self->priv->path_formats; +#line 461 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), pf); +#line 462 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp4_ = self->priv->dir_pattern_combo; +#line 462 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp5_ = name; +#line 462 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + gtk_combo_box_text_append_text (_tmp4_, _tmp5_); +#line 459 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _preferences_dialog_path_format_unref0 (pf); +#line 2747 "Preferences.c" +} + + +static void preferences_dialog_on_lowercase_toggled (PreferencesDialog* self) { + ConfigFacade* _tmp0_; + ConfigFacade* _tmp1_; + GtkCheckButton* _tmp2_; + gboolean _tmp3_; +#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" + _tmp3_ = 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" + configuration_facade_set_use_lowercase_filenames (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), _tmp3_); +#line 466 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _g_object_unref0 (_tmp1_); +#line 2770 "Preferences.c" +} + + +static PreferencesDialogPathFormat* preferences_dialog_path_format_construct (GType object_type, const gchar* name, const gchar* pattern) { + PreferencesDialogPathFormat* self = NULL; + const gchar* _tmp0_; + gchar* _tmp1_; + const gchar* _tmp2_; + gchar* _tmp3_; +#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_ = name; +#line 12 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp1_ = g_strdup (_tmp0_); +#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 = _tmp1_; +#line 13 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp2_ = pattern; +#line 13 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + _tmp3_ = g_strdup (_tmp2_); +#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 = _tmp3_; +#line 11 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + return self; +#line 2802 "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 2809 "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 2816 "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 2825 "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 2835 "Preferences.c" + } else { +#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + dest_value->data[0].v_pointer = NULL; +#line 2839 "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 2847 "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 2854 "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 2861 "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 2865 "Preferences.c" + } +#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + value->data[0].v_pointer = preferences_dialog_path_format_ref (object); +#line 2869 "Preferences.c" + } else { +#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + value->data[0].v_pointer = NULL; +#line 2873 "Preferences.c" + } +#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + return NULL; +#line 2877 "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 2888 "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 2894 "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 2898 "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 2902 "Preferences.c" + } +#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + return NULL; +#line 2906 "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 2920 "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 2929 "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 2949 "Preferences.c" + } else { +#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + value->data[0].v_pointer = NULL; +#line 2953 "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 2959 "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 2978 "Preferences.c" + } else { +#line 10 "/home/jens/Source/shotwell/src/dialogs/Preferences.vala" + value->data[0].v_pointer = NULL; +#line 2982 "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 2988 "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 2998 "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 3005 "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 3019 "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 3044 "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 3057 "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 3112 "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 3142 "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 3200 "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..5183c12 --- /dev/null +++ b/src/dialogs/ProgressDialog.c @@ -0,0 +1,715 @@ +/* ProgressDialog.c generated by valac 0.36.6, 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; +#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)) +enum { + PROGRESS_DIALOG_DUMMY_PROPERTY +}; +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 92 "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 99 "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 108 "ProgressDialog.c" +} + + +ProgressDialog* progress_dialog_construct (GType object_type, GtkWindow* owner, const gchar* text, GCancellable* cancellable) { + ProgressDialog * self = NULL; + GCancellable* _tmp0_; + GCancellable* _tmp1_; + const gchar* _tmp2_; + GtkWindow* _tmp3_; + GtkProgressBar* _tmp5_; + GtkProgressBar* _tmp6_; + GtkBox* vbox_bar = NULL; + GtkBox* _tmp7_; + GtkBox* _tmp8_; + GtkProgressBar* _tmp9_; + GCancellable* _tmp10_; + GtkBox* hbox = NULL; + GtkBox* _tmp13_; + GtkBox* _tmp14_; + GtkBox* _tmp15_; + GtkButton* _tmp16_; + GtkLabel* primary_text_label = NULL; + GtkLabel* _tmp19_; + const gchar* _tmp20_; + gchar* _tmp21_; + gchar* _tmp22_; + GtkBox* vbox = NULL; + GtkBox* _tmp23_; + GtkBox* _tmp24_; + gulong _tmp25_; +#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_ = cancellable; +#line 21 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp1_ = _g_object_ref0 (_tmp0_); +#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 = _tmp1_; +#line 23 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp2_ = text; +#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), _tmp2_); +#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" + _tmp3_ = owner; +#line 25 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + if (_tmp3_ != NULL) { +#line 165 "ProgressDialog.c" + GtkWindow* _tmp4_; +#line 26 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp4_ = owner; +#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), _tmp4_); +#line 171 "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" + _tmp5_ = self->priv->progress_bar; +#line 30 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + gtk_widget_set_size_request (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, gtk_widget_get_type (), GtkWidget), 300, -1); +#line 31 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp6_ = self->priv->progress_bar; +#line 31 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + gtk_progress_bar_set_show_text (_tmp6_, TRUE); +#line 33 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp7_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); +#line 33 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + g_object_ref_sink (_tmp7_); +#line 33 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + vbox_bar = _tmp7_; +#line 34 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp8_ = vbox_bar; +#line 34 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp9_ = self->priv->progress_bar; +#line 34 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + gtk_box_pack_start (_tmp8_, G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, gtk_widget_get_type (), GtkWidget), TRUE, FALSE, (guint) 0); +#line 36 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp10_ = cancellable; +#line 36 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + if (_tmp10_ != NULL) { +#line 201 "ProgressDialog.c" + GtkButton* _tmp11_; + GtkButton* _tmp12_; +#line 37 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp11_ = (GtkButton*) gtk_button_new_with_mnemonic (RESOURCES_CANCEL_LABEL); +#line 37 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + g_object_ref_sink (_tmp11_); +#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 = _tmp11_; +#line 38 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp12_ = self->priv->cancel_button; +#line 38 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + g_signal_connect_object (_tmp12_, "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 218 "ProgressDialog.c" + } +#line 42 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp13_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8); +#line 42 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + g_object_ref_sink (_tmp13_); +#line 42 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + hbox = _tmp13_; +#line 43 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp14_ = hbox; +#line 43 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp15_ = vbox_bar; +#line 43 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + gtk_box_pack_start (_tmp14_, G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, gtk_widget_get_type (), GtkWidget), TRUE, FALSE, (guint) 0); +#line 44 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp16_ = self->priv->cancel_button; +#line 44 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + if (_tmp16_ != NULL) { +#line 236 "ProgressDialog.c" + GtkBox* _tmp17_; + GtkButton* _tmp18_; +#line 45 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp17_ = hbox; +#line 45 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp18_ = self->priv->cancel_button; +#line 45 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + gtk_box_pack_end (_tmp17_, G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, gtk_widget_get_type (), GtkWidget), FALSE, FALSE, (guint) 0); +#line 245 "ProgressDialog.c" + } +#line 47 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp19_ = (GtkLabel*) gtk_label_new (""); +#line 47 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + g_object_ref_sink (_tmp19_); +#line 47 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + primary_text_label = _tmp19_; +#line 48 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp20_ = text; +#line 48 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp21_ = g_strdup_printf ("<span weight=\"bold\">%s</span>", _tmp20_); +#line 48 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp22_ = _tmp21_; +#line 48 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + gtk_label_set_markup (primary_text_label, _tmp22_); +#line 48 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _g_free0 (_tmp22_); +#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" + _tmp23_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); +#line 52 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + g_object_ref_sink (_tmp23_); +#line 52 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + vbox = _tmp23_; +#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" + _tmp24_ = hbox; +#line 54 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + gtk_box_pack_start (vbox, G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, 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" + _tmp25_ = now_ms (); +#line 66 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + self->priv->time_started = _tmp25_; +#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 311 "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 318 "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 333 "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 339 "ProgressDialog.c" + } +} + + +void progress_dialog_update_display_every (ProgressDialog* self, gint update_every) { + gint _tmp0_; + gint _tmp1_; +#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" + _tmp0_ = update_every; +#line 78 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _vala_assert (_tmp0_ >= 1, "update_every >= 1"); +#line 80 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp1_ = update_every; +#line 80 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + self->priv->update_every = _tmp1_; +#line 357 "ProgressDialog.c" +} + + +void progress_dialog_set_minimum_on_screen_time_msec (ProgressDialog* self, gint minimum_on_screen_time_msec) { + gint _tmp0_; +#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" + _tmp0_ = minimum_on_screen_time_msec; +#line 84 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + self->priv->minimum_on_screen_time_msec = _tmp0_; +#line 369 "ProgressDialog.c" +} + + +void progress_dialog_set_fraction (ProgressDialog* self, gint current, gint total) { + gint _tmp0_; + gint _tmp1_; +#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" + _tmp0_ = current; +#line 88 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp1_ = total; +#line 88 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + progress_dialog_set_percentage (self, ((gdouble) _tmp0_) / ((gdouble) _tmp1_)); +#line 384 "ProgressDialog.c" +} + + +void progress_dialog_set_percentage (ProgressDialog* self, gdouble pct) { + gdouble _tmp0_; + gdouble _tmp1_; + gdouble _tmp2_; + GtkProgressBar* _tmp3_; + gdouble _tmp4_; + GtkProgressBar* _tmp5_; + gdouble _tmp6_; + gchar* _tmp7_; + gchar* _tmp8_; +#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" + _tmp0_ = pct; +#line 92 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp1_ = CLAMP (_tmp0_, 0.0, 1.0); +#line 92 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + pct = _tmp1_; +#line 94 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp2_ = pct; +#line 94 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + progress_dialog_maybe_show_all (self, _tmp2_); +#line 96 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp3_ = self->priv->progress_bar; +#line 96 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp4_ = pct; +#line 96 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + gtk_progress_bar_set_fraction (_tmp3_, _tmp4_); +#line 97 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp5_ = self->priv->progress_bar; +#line 97 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp6_ = pct; +#line 97 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp7_ = g_strdup_printf (_ ("%d%%"), (gint) (_tmp6_ * 100.0)); +#line 97 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp8_ = _tmp7_; +#line 97 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + gtk_progress_bar_set_text (_tmp5_, _tmp8_); +#line 97 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _g_free0 (_tmp8_); +#line 428 "ProgressDialog.c" +} + + +void progress_dialog_set_status (ProgressDialog* self, const gchar* text) { + GtkProgressBar* _tmp0_; + const gchar* _tmp1_; +#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" + _tmp1_ = text; +#line 106 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + gtk_progress_bar_set_text (_tmp0_, _tmp1_); +#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 447 "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 _tmp8_ = FALSE; + GCancellable* _tmp9_; + gboolean keep_going = FALSE; + gboolean _tmp12_; +#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 467 "ProgressDialog.c" + } else { + guint64 _tmp2_; + guint64 _tmp3_; + gint _tmp4_; +#line 117 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp2_ = count; +#line 117 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp3_ = self->priv->last_count; +#line 117 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp4_ = self->priv->update_every; +#line 117 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp0_ = (_tmp2_ - _tmp3_) >= ((guint64) _tmp4_); +#line 480 "ProgressDialog.c" + } +#line 117 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + if (_tmp0_) { +#line 484 "ProgressDialog.c" + guint64 _tmp5_; + guint64 _tmp6_; + guint64 _tmp7_; +#line 118 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp5_ = count; +#line 118 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp6_ = total; +#line 118 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + progress_dialog_set_percentage (self, ((gdouble) _tmp5_) / ((gdouble) _tmp6_)); +#line 119 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp7_ = count; +#line 119 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + self->priv->last_count = _tmp7_; +#line 498 "ProgressDialog.c" + } +#line 122 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp9_ = self->priv->cancellable; +#line 122 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + if (_tmp9_ != NULL) { +#line 504 "ProgressDialog.c" + GCancellable* _tmp10_; + gboolean _tmp11_; +#line 122 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp10_ = self->priv->cancellable; +#line 122 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp11_ = g_cancellable_is_cancelled (_tmp10_); +#line 122 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp8_ = !_tmp11_; +#line 513 "ProgressDialog.c" + } else { +#line 122 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp8_ = TRUE; +#line 517 "ProgressDialog.c" + } +#line 122 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + keep_going = _tmp8_; +#line 130 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp12_ = do_event_loop; +#line 130 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + if (_tmp12_) { +#line 131 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + spin_event_loop (); +#line 527 "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 533 "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 544 "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 558 "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 571 "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 577 "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 583 "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 599 "ProgressDialog.c" + gulong _tmp3_; + gulong _tmp4_; + gint _tmp5_; +#line 161 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp3_ = now_ms (); +#line 161 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp4_ = self->priv->time_started; +#line 161 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp5_ = self->priv->minimum_on_screen_time_msec; +#line 161 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp0_ = (_tmp3_ - _tmp4_) > ((gulong) _tmp5_); +#line 611 "ProgressDialog.c" + } else { +#line 161 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp0_ = FALSE; +#line 615 "ProgressDialog.c" + } +#line 161 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + if (_tmp0_) { +#line 619 "ProgressDialog.c" + gdouble pps = 0.0; + gdouble _tmp6_; + gint _tmp7_; + gdouble ttc = 0.0; + gdouble _tmp8_; + gdouble _tmp9_; + gint _tmp10_; +#line 163 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp6_ = pct; +#line 163 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp7_ = self->priv->minimum_on_screen_time_msec; +#line 163 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + pps = (_tmp6_ * 100.0) / _tmp7_; +#line 165 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp8_ = pps; +#line 165 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + ttc = 100.0 / _tmp8_; +#line 168 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp9_ = ttc; +#line 168 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + _tmp10_ = self->priv->minimum_on_screen_time_msec; +#line 168 "/home/jens/Source/shotwell/src/dialogs/ProgressDialog.vala" + if (_tmp9_ > ((gdouble) _tmp10_)) { +#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 647 "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 662 "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 684 "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 700 "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..3f4d45f --- /dev/null +++ b/src/dialogs/SetBackground.c @@ -0,0 +1,274 @@ +/* SetBackground.c generated by valac 0.36.6, 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; +#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)) +enum { + SET_BACKGROUND_PHOTO_DIALOG_DUMMY_PROPERTY +}; +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; + gint _tmp0_; + AppWindow* _tmp1_; + AppWindow* _tmp2_; +#line 16 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + _tmp0_ = resources_use_header_bar (); +#line 16 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + self = (SetBackgroundPhotoDialog*) g_object_new (object_type, "use-header-bar", _tmp0_, NULL); +#line 17 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + _tmp1_ = app_window_get_instance (); +#line 17 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + _tmp2_ = _tmp1_; +#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 (_tmp2_, gtk_window_get_type (), GtkWindow)); +#line 17 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + _g_object_unref0 (_tmp2_); +#line 15 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + return self; +#line 102 "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 109 "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 130 "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 143 "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 147 "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 154 "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; + gint _tmp0_; + GtkCheckButton* _tmp1_; + gboolean _tmp2_; + gboolean _tmp3_; + GtkCheckButton* _tmp4_; + gboolean _tmp5_; + gboolean _tmp6_; +#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" + _tmp0_ = gtk_dialog_run (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_dialog_get_type (), GtkDialog)); +#line 29 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + _result_ = _tmp0_ == ((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" + _tmp1_ = self->priv->desktop_background_checkbox; +#line 32 "/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 32 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + _tmp3_ = _tmp2_; +#line 32 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + _vala_desktop_background = _tmp3_; +#line 33 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + _tmp4_ = self->priv->screensaver_checkbox; +#line 33 "/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 33 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + _tmp6_ = _tmp5_; +#line 33 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + _vala_screensaver = _tmp6_; +#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 204 "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 210 "SetBackground.c" + } +#line 36 "/home/jens/Source/shotwell/src/dialogs/SetBackground.vala" + return result; +#line 214 "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 236 "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 245 "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 259 "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..6e13d67 --- /dev/null +++ b/src/dialogs/SetBackgroundSlideshow.c @@ -0,0 +1,474 @@ +/* SetBackgroundSlideshow.c generated by valac 0.36.6, 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; +#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)) +enum { + SET_BACKGROUND_SLIDESHOW_DIALOG_DUMMY_PROPERTY +}; +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; + gint _tmp0_; + AppWindow* _tmp1_; + AppWindow* _tmp2_; +#line 22 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + _tmp0_ = resources_use_header_bar (); +#line 22 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + self = (SetBackgroundSlideshowDialog*) g_object_new (object_type, "use-header-bar", _tmp0_, NULL); +#line 23 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + _tmp1_ = app_window_get_instance (); +#line 23 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + _tmp2_ = _tmp1_; +#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 (_tmp2_, gtk_window_get_type (), GtkWindow)); +#line 23 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + _g_object_unref0 (_tmp2_); +#line 21 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + return self; +#line 114 "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 121 "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 131 "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 152 "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 165 "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 169 "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 176 "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_; + gdouble _tmp6_; + gdouble _tmp7_; + gchar* text = NULL; + gint _tmp8_; + GtkLabel* _tmp25_; + const gchar* _tmp26_; +#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" + _tmp6_ = pow (_tmp5_, (gdouble) 5); +#line 44 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + _tmp7_ = pow ((gdouble) 90, (gdouble) 5); +#line 44 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + self->priv->delay_value = (gint) (((((_tmp6_ / _tmp7_) * 60) * 60) * 24) + 5); +#line 48 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + _tmp8_ = self->priv->delay_value; +#line 48 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + if (_tmp8_ < 60) { +#line 220 "SetBackgroundSlideshow.c" + gint _tmp9_; + gint _tmp10_; + gchar* _tmp11_; +#line 49 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + _tmp9_ = self->priv->delay_value; +#line 49 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + _tmp10_ = self->priv->delay_value; +#line 49 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + _tmp11_ = g_strdup_printf (ngettext ("%d second", "%d seconds", (gulong) _tmp9_), _tmp10_); +#line 49 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + _g_free0 (text); +#line 49 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + text = _tmp11_; +#line 234 "SetBackgroundSlideshow.c" + } else { + gint _tmp12_; +#line 50 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + _tmp12_ = self->priv->delay_value; +#line 50 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + if (_tmp12_ < (60 * 60)) { +#line 241 "SetBackgroundSlideshow.c" + gint minutes = 0; + gint _tmp13_; + gint _tmp14_; + gint _tmp15_; + gchar* _tmp16_; + gint _tmp17_; +#line 51 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + _tmp13_ = self->priv->delay_value; +#line 51 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + minutes = _tmp13_ / 60; +#line 52 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + _tmp14_ = minutes; +#line 52 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + _tmp15_ = minutes; +#line 52 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + _tmp16_ = g_strdup_printf (ngettext ("%d minute", "%d minutes", (gulong) _tmp14_), _tmp15_); +#line 52 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + _g_free0 (text); +#line 52 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + text = _tmp16_; +#line 53 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + _tmp17_ = minutes; +#line 53 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + self->priv->delay_value = _tmp17_ * 60; +#line 266 "SetBackgroundSlideshow.c" + } else { + gint _tmp18_; +#line 54 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + _tmp18_ = self->priv->delay_value; +#line 54 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + if (_tmp18_ < ((60 * 60) * 24)) { +#line 273 "SetBackgroundSlideshow.c" + gint hours = 0; + gint _tmp19_; + gint _tmp20_; + gint _tmp21_; + gchar* _tmp22_; + gint _tmp23_; +#line 55 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + _tmp19_ = self->priv->delay_value; +#line 55 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + hours = _tmp19_ / (60 * 60); +#line 56 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + _tmp20_ = hours; +#line 56 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + _tmp21_ = hours; +#line 56 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + _tmp22_ = g_strdup_printf (ngettext ("%d hour", "%d hours", (gulong) _tmp20_), _tmp21_); +#line 56 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + _g_free0 (text); +#line 56 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + text = _tmp22_; +#line 57 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + _tmp23_ = hours; +#line 57 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + self->priv->delay_value = _tmp23_ * (60 * 60); +#line 298 "SetBackgroundSlideshow.c" + } else { + gchar* _tmp24_; +#line 59 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + _tmp24_ = 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 = _tmp24_; +#line 60 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + self->priv->delay_value = (60 * 60) * 24; +#line 309 "SetBackgroundSlideshow.c" + } + } + } +#line 63 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + _tmp25_ = self->priv->delay_value_label; +#line 63 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + _tmp26_ = text; +#line 63 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + gtk_label_set_label (_tmp25_, _tmp26_); +#line 38 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + _g_free0 (text); +#line 321 "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 328 "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_; + gint _tmp1_; + GtkCheckButton* _tmp2_; + gboolean _tmp3_; + gboolean _tmp4_; + GtkCheckButton* _tmp5_; + gboolean _tmp6_; + gboolean _tmp7_; +#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" + _tmp0_ = gtk_dialog_run (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_dialog_get_type (), GtkDialog)); +#line 68 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + _result_ = _tmp0_ == ((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" + _tmp1_ = self->priv->delay_value; +#line 71 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + _vala_delay_value = _tmp1_; +#line 72 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + _tmp2_ = self->priv->desktop_background_checkbox; +#line 72 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + _tmp3_ = gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_toggle_button_get_type (), GtkToggleButton)); +#line 72 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + _tmp4_ = _tmp3_; +#line 72 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + _vala_desktop_background = _tmp4_; +#line 73 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + _tmp5_ = self->priv->screensaver_checkbox; +#line 73 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + _tmp6_ = gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, gtk_toggle_button_get_type (), GtkToggleButton)); +#line 73 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + _tmp7_ = _tmp6_; +#line 73 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + _vala_screensaver = _tmp7_; +#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 384 "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 390 "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 396 "SetBackgroundSlideshow.c" + } +#line 76 "/home/jens/Source/shotwell/src/dialogs/SetBackgroundSlideshow.vala" + return result; +#line 400 "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 430 "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 441 "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 459 "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..6fa478f --- /dev/null +++ b/src/dialogs/TextEntry.c @@ -0,0 +1,398 @@ +/* TextEntry.c generated by valac 0.36.6, 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; +#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)) +enum { + TEXT_ENTRY_DIALOG_DUMMY_PROPERTY +}; +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; + gint _tmp0_; +#line 21 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + _tmp0_ = resources_use_header_bar (); +#line 21 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + self = (TextEntryDialog*) g_object_new (object_type, "use-header-bar", _tmp0_, NULL); +#line 20 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + return self; +#line 113 "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 120 "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 127 "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) { + const gchar* _tmp0_; + AppWindow* _tmp1_; + AppWindow* _tmp2_; + GdkWindow* _tmp3_; + AppWindow* _tmp4_; + AppWindow* _tmp5_; + TextEntryDialogOnModifyValidateType _tmp6_; + void* _tmp6__target; + GtkLabel* _tmp7_; + const gchar* _tmp8_; + const gchar* _tmp9_ = NULL; + const gchar* _tmp10_; + GtkEntry* _tmp12_; + GtkEntry* _tmp13_; + GtkEntry* _tmp14_; + GeeCollection* _tmp15_; +#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" + _tmp0_ = title; +#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), _tmp0_); +#line 27 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + _tmp1_ = app_window_get_instance (); +#line 27 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + _tmp2_ = _tmp1_; +#line 27 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + _tmp3_ = gtk_widget_get_parent_window (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, 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), _tmp3_); +#line 27 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + _g_object_unref0 (_tmp2_); +#line 28 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + _tmp4_ = app_window_get_instance (); +#line 28 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + _tmp5_ = _tmp4_; +#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 (_tmp5_, gtk_window_get_type (), GtkWindow)); +#line 28 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + _g_object_unref0 (_tmp5_); +#line 29 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + _tmp6_ = modify_validate; +#line 29 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + _tmp6__target = modify_validate_target; +#line 29 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + self->priv->on_modify_validate = _tmp6_; +#line 29 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + self->priv->on_modify_validate_target = _tmp6__target; +#line 31 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + _tmp7_ = self->priv->label; +#line 31 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + _tmp8_ = label; +#line 31 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + gtk_label_set_text (_tmp7_, _tmp8_); +#line 33 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + _tmp10_ = initial_text; +#line 33 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + if (_tmp10_ != NULL) { +#line 196 "TextEntry.c" + const gchar* _tmp11_; +#line 33 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + _tmp11_ = initial_text; +#line 33 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + _tmp9_ = _tmp11_; +#line 202 "TextEntry.c" + } else { +#line 33 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + _tmp9_ = ""; +#line 206 "TextEntry.c" + } +#line 33 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + _tmp12_ = self->priv->entry; +#line 33 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + gtk_entry_set_text (_tmp12_, _tmp9_); +#line 34 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + _tmp13_ = self->priv->entry; +#line 34 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + gtk_widget_grab_focus (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, gtk_widget_get_type (), GtkWidget)); +#line 35 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + _tmp14_ = self->priv->entry; +#line 35 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, GTK_TYPE_EDITABLE, GtkEditable), "changed", (GCallback) _text_entry_dialog_on_entry_changed_gtk_editable_changed, self, 0); +#line 37 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + _tmp15_ = completion_list; +#line 37 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + if (_tmp15_ != NULL) { +#line 224 "TextEntry.c" + EntryMultiCompletion* completion = NULL; + GeeCollection* _tmp16_; + const gchar* _tmp17_; + EntryMultiCompletion* _tmp18_; + GtkEntry* _tmp19_; + EntryMultiCompletion* _tmp20_; +#line 38 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + _tmp16_ = completion_list; +#line 38 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + _tmp17_ = completion_delimiter; +#line 38 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + _tmp18_ = entry_multi_completion_new (_tmp16_, _tmp17_); +#line 38 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + completion = _tmp18_; +#line 40 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + _tmp19_ = self->priv->entry; +#line 40 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + _tmp20_ = completion; +#line 40 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + gtk_entry_set_completion (_tmp19_, G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, gtk_entry_completion_get_type (), GtkEntryCompletion)); +#line 37 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + _g_object_unref0 (completion); +#line 247 "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 251 "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_; + gboolean _tmp3_; + gint _tmp4_; + GtkEntry* _tmp8_; + guint _tmp9_; +#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" + _tmp3_ = _tmp0_ (_tmp2_, _tmp0__target); +#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, _tmp3_); +#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" + _tmp4_ = gtk_dialog_run (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_dialog_get_type (), GtkDialog)); +#line 54 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + if (_tmp4_ == ((gint) GTK_RESPONSE_OK)) { +#line 288 "TextEntry.c" + GtkEntry* _tmp5_; + const gchar* _tmp6_; + gchar* _tmp7_; +#line 55 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + _tmp5_ = self->priv->entry; +#line 55 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + _tmp6_ = gtk_entry_get_text (_tmp5_); +#line 55 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + _tmp7_ = g_strdup (_tmp6_); +#line 55 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + _g_free0 (text); +#line 55 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + text = _tmp7_; +#line 302 "TextEntry.c" + } +#line 57 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + _tmp8_ = self->priv->entry; +#line 57 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + g_signal_parse_name ("changed", GTK_TYPE_EDITABLE, &_tmp9_, NULL, FALSE); +#line 57 "/home/jens/Source/shotwell/src/dialogs/TextEntry.vala" + g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, GTK_TYPE_EDITABLE, GtkEditable), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp9_, 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 316 "TextEntry.c" +} + + +void text_entry_dialog_on_entry_changed (TextEntryDialog* self) { + TextEntryDialogOnModifyValidateType _tmp0_; + void* _tmp0__target; + GtkEntry* _tmp1_; + const gchar* _tmp2_; + gboolean _tmp3_; +#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" + _tmp3_ = _tmp0_ (_tmp2_, _tmp0__target); +#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, _tmp3_); +#line 340 "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 360 "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 369 "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..153175b --- /dev/null +++ b/src/dialogs/WelcomeDialog.c @@ -0,0 +1,1377 @@ +/* WelcomeDialog.c generated by valac 0.36.6, 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; +#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)) +enum { + WELCOME_DIALOG_DUMMY_PROPERTY +}; +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 129 "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 138 "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 149 "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 170 "WelcomeDialog.c" +} + + +WelcomeDialog* welcome_dialog_construct (GType object_type, GtkWindow* owner) { + WelcomeDialog * self = NULL; + gint _tmp0_; + SpitDataImportsWelcomeImportMetaHost* _tmp1_; + gboolean show_system_pictures_import = FALSE; + gboolean _tmp2_; + GtkWidget* ok_button = NULL; + GtkWidget* _tmp3_; + GtkWidget* _tmp4_; + GtkWindow* _tmp5_; + GtkLabel* primary_text = NULL; + GtkLabel* _tmp6_; + GtkLabel* _tmp7_; + gchar* _tmp8_; + gchar* _tmp9_; + GtkLabel* _tmp10_; + GtkLabel* _tmp11_; + GtkLabel* _tmp12_; + GtkLabel* _tmp13_; + gchar* _tmp14_; + gchar* _tmp15_; + GtkLabel* _tmp16_; + GtkLabel* _tmp17_; + GtkImage* image = NULL; + GtkImage* _tmp18_; + GtkBox* header_text = NULL; + GtkBox* _tmp19_; + GtkBox* _tmp20_; + GtkLabel* _tmp21_; + GtkBox* _tmp22_; + GtkLabel* _tmp23_; + GtkBox* header_content = NULL; + GtkBox* _tmp24_; + GtkBox* _tmp25_; + GtkImage* _tmp26_; + GtkBox* _tmp27_; + GtkBox* _tmp28_; + GtkLabel* instructions = NULL; + GtkLabel* _tmp29_; + gchar* indent_prefix = NULL; + gchar* _tmp30_; + const gchar* _tmp31_ = NULL; + GtkTextDirection _tmp32_; + gchar* arrow_glyph = NULL; + gchar* _tmp33_; + GtkLabel* _tmp34_; + const gchar* _tmp35_; + gchar* _tmp36_; + gchar* _tmp37_; + const gchar* _tmp38_; + gchar* _tmp39_; + gchar* _tmp40_; + gchar* _tmp41_; + gchar* _tmp42_; + const gchar* _tmp43_; + gchar* _tmp44_; + gchar* _tmp45_; + gchar* _tmp46_; + gchar* _tmp47_; + const gchar* _tmp48_; + gchar* _tmp49_; + gchar* _tmp50_; + gchar* _tmp51_; + gchar* _tmp52_; + GtkLabel* _tmp53_; + GtkLabel* _tmp54_; + GtkBox* _tmp55_; + GtkBox* _tmp56_; + GtkBox* _tmp57_; + GtkBox* _tmp58_; + gboolean _tmp59_; + GtkLabel* _tmp70_; + GtkLabel* _tmp71_; + GtkLabel* _tmp72_; + GtkLabel* _tmp73_; + GtkBox* content = NULL; + GtkBox* _tmp74_; + GtkBox* _tmp75_; + GtkBox* _tmp76_; + GtkBox* _tmp77_; + GtkLabel* _tmp78_; + GtkCheckButton* _tmp79_; + GtkCheckButton* _tmp80_; + GtkCheckButton* _tmp81_; + GtkBox* _tmp82_; + GtkWidget* _tmp83_; + SpitDataImportsWelcomeImportMetaHost* _tmp84_; +#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" + _tmp0_ = resources_use_header_bar (); +#line 29 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + self = (WelcomeDialog*) g_object_new (object_type, "use-header-bar", _tmp0_, NULL); +#line 30 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp1_ = 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 = _tmp1_; +#line 31 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp2_ = welcome_dialog_is_system_pictures_import_possible (); +#line 31 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + show_system_pictures_import = _tmp2_; +#line 32 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp3_ = 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" + _tmp4_ = _g_object_ref0 (_tmp3_); +#line 32 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + ok_button = _tmp4_; +#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" + _tmp5_ = owner; +#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), _tmp5_); +#line 40 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp6_ = (GtkLabel*) gtk_label_new (""); +#line 40 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + g_object_ref_sink (_tmp6_); +#line 40 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + primary_text = _tmp6_; +#line 41 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp7_ = primary_text; +#line 41 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp8_ = g_strdup_printf ("<span size=\"large\" weight=\"bold\">%s</span>", _ ("Welcome to Shotwell!")); +#line 41 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp9_ = _tmp8_; +#line 41 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + gtk_label_set_markup (_tmp7_, _tmp9_); +#line 41 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _g_free0 (_tmp9_); +#line 43 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp10_ = primary_text; +#line 43 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + gtk_label_set_xalign (_tmp10_, 0.0f); +#line 44 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp11_ = primary_text; +#line 44 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + gtk_label_set_yalign (_tmp11_, 0.5f); +#line 45 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp12_ = (GtkLabel*) gtk_label_new (""); +#line 45 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + g_object_ref_sink (_tmp12_); +#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 = _tmp12_; +#line 46 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp13_ = self->priv->secondary_text; +#line 46 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp14_ = 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" + _tmp15_ = _tmp14_; +#line 46 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + gtk_label_set_markup (_tmp13_, _tmp15_); +#line 46 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _g_free0 (_tmp15_); +#line 48 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp16_ = self->priv->secondary_text; +#line 48 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + gtk_label_set_xalign (_tmp16_, 0.0f); +#line 49 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp17_ = self->priv->secondary_text; +#line 49 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + gtk_label_set_yalign (_tmp17_, 0.5f); +#line 50 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp18_ = (GtkImage*) gtk_image_new_from_icon_name ("shotwell", GTK_ICON_SIZE_DIALOG); +#line 50 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + g_object_ref_sink (_tmp18_); +#line 50 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + image = _tmp18_; +#line 52 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp19_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); +#line 52 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + g_object_ref_sink (_tmp19_); +#line 52 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + header_text = _tmp19_; +#line 53 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp20_ = header_text; +#line 53 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp21_ = primary_text; +#line 53 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + gtk_box_pack_start (_tmp20_, G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, gtk_widget_get_type (), GtkWidget), FALSE, FALSE, (guint) 5); +#line 54 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp22_ = header_text; +#line 54 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp23_ = self->priv->secondary_text; +#line 54 "/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 56 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp24_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12); +#line 56 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + g_object_ref_sink (_tmp24_); +#line 56 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + header_content = _tmp24_; +#line 57 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp25_ = header_content; +#line 57 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp26_ = image; +#line 57 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + gtk_box_pack_start (_tmp25_, G_TYPE_CHECK_INSTANCE_CAST (_tmp26_, gtk_widget_get_type (), GtkWidget), FALSE, FALSE, (guint) 0); +#line 58 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp27_ = header_content; +#line 58 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp28_ = header_text; +#line 58 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + gtk_box_pack_start (_tmp27_, G_TYPE_CHECK_INSTANCE_CAST (_tmp28_, gtk_widget_get_type (), GtkWidget), FALSE, FALSE, (guint) 0); +#line 60 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp29_ = (GtkLabel*) gtk_label_new (""); +#line 60 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + g_object_ref_sink (_tmp29_); +#line 60 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + instructions = _tmp29_; +#line 61 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp30_ = g_strdup (" "); +#line 61 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + indent_prefix = _tmp30_; +#line 63 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp32_ = gtk_widget_get_direction (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget)); +#line 63 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + if (_tmp32_ == GTK_TEXT_DIR_RTL) { +#line 63 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp31_ = "◂"; +#line 403 "WelcomeDialog.c" + } else { +#line 63 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp31_ = "▸"; +#line 407 "WelcomeDialog.c" + } +#line 63 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp33_ = g_strdup (_tmp31_); +#line 63 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + arrow_glyph = _tmp33_; +#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp34_ = instructions; +#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp35_ = indent_prefix; +#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp36_ = g_strconcat (_tmp35_, "• %s\n", NULL); +#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp37_ = _tmp36_; +#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp38_ = indent_prefix; +#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp39_ = g_strconcat (_tmp38_, "• %s\n", NULL); +#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp40_ = _tmp39_; +#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp41_ = g_strconcat (_tmp37_, _tmp40_, NULL); +#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp42_ = _tmp41_; +#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp43_ = indent_prefix; +#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp44_ = g_strconcat (_tmp43_, "• %s", NULL); +#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp45_ = _tmp44_; +#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp46_ = g_strconcat (_tmp42_, _tmp45_, NULL); +#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp47_ = _tmp46_; +#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp48_ = arrow_glyph; +#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp49_ = g_strdup_printf (_ ("Choose <span weight=\"bold\">File %s Import From Folder</span>"), _tmp48_); +#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp50_ = _tmp49_; +#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp51_ = g_strdup_printf (_tmp47_, _tmp50_, _ ("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" + _tmp52_ = _tmp51_; +#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + gtk_label_set_markup (_tmp34_, _tmp52_); +#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _g_free0 (_tmp52_); +#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _g_free0 (_tmp50_); +#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _g_free0 (_tmp47_); +#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _g_free0 (_tmp45_); +#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _g_free0 (_tmp42_); +#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _g_free0 (_tmp40_); +#line 65 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _g_free0 (_tmp37_); +#line 70 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp53_ = instructions; +#line 70 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + gtk_label_set_xalign (_tmp53_, 0.0f); +#line 71 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp54_ = instructions; +#line 71 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + gtk_label_set_yalign (_tmp54_, 0.5f); +#line 73 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp55_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 2); +#line 73 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + g_object_ref_sink (_tmp55_); +#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 = _tmp55_; +#line 75 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp56_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 2); +#line 75 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + g_object_ref_sink (_tmp56_); +#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 = _tmp56_; +#line 76 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp57_ = self->priv->import_action_checkbox_packer; +#line 76 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp58_ = 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 (_tmp57_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp58_, gtk_widget_get_type (), GtkWidget)); +#line 78 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp59_ = show_system_pictures_import; +#line 78 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + if (_tmp59_) { +#line 501 "WelcomeDialog.c" + GFile* _tmp60_; + GFile* _tmp61_; + gchar* _tmp62_; + gchar* _tmp63_; + gchar* _tmp64_; + gchar* _tmp65_; + GtkCheckButton* _tmp66_; + GtkBox* _tmp67_; + GtkCheckButton* _tmp68_; + GtkCheckButton* _tmp69_; +#line 79 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp60_ = app_dirs_get_import_dir (); +#line 79 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp61_ = _tmp60_; +#line 79 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp62_ = get_display_pathname (_tmp61_); +#line 79 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp63_ = _tmp62_; +#line 79 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp64_ = g_strdup_printf (_ ("_Import photos from your %s folder"), _tmp63_); +#line 79 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp65_ = _tmp64_; +#line 79 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp66_ = (GtkCheckButton*) gtk_check_button_new_with_mnemonic (_tmp65_); +#line 79 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + g_object_ref_sink (_tmp66_); +#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 = _tmp66_; +#line 79 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _g_free0 (_tmp65_); +#line 79 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _g_free0 (_tmp63_); +#line 79 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _g_object_unref0 (_tmp61_); +#line 82 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp67_ = self->priv->import_action_checkbox_packer; +#line 82 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp68_ = self->priv->system_pictures_import_check; +#line 82 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp67_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp68_, gtk_widget_get_type (), GtkWidget)); +#line 83 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp69_ = 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 (_tmp69_, gtk_toggle_button_get_type (), GtkToggleButton), TRUE); +#line 548 "WelcomeDialog.c" + } +#line 86 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp70_ = (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 (_tmp70_); +#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 = _tmp70_; +#line 88 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp71_ = self->priv->instruction_header; +#line 88 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + gtk_label_set_xalign (_tmp71_, 0.0f); +#line 89 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp72_ = self->priv->instruction_header; +#line 89 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + gtk_label_set_yalign (_tmp72_, 0.5f); +#line 90 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp73_ = self->priv->instruction_header; +#line 90 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + gtk_widget_set_margin_top (G_TYPE_CHECK_INSTANCE_CAST (_tmp73_, gtk_widget_get_type (), GtkWidget), 20); +#line 92 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp74_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 16); +#line 92 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + g_object_ref_sink (_tmp74_); +#line 92 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + content = _tmp74_; +#line 93 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp75_ = header_content; +#line 93 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + gtk_box_pack_start (content, G_TYPE_CHECK_INSTANCE_CAST (_tmp75_, gtk_widget_get_type (), GtkWidget), TRUE, TRUE, (guint) 0); +#line 94 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp76_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 2); +#line 94 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + g_object_ref_sink (_tmp76_); +#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 = _tmp76_; +#line 95 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp77_ = 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 (_tmp77_, gtk_widget_get_type (), GtkWidget)); +#line 96 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp78_ = instructions; +#line 96 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + gtk_box_pack_start (content, G_TYPE_CHECK_INSTANCE_CAST (_tmp78_, gtk_widget_get_type (), GtkWidget), FALSE, FALSE, (guint) 0); +#line 98 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp79_ = (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 (_tmp79_); +#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 = _tmp79_; +#line 99 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp80_ = self->priv->hide_button; +#line 99 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + gtk_toggle_button_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp80_, gtk_toggle_button_get_type (), GtkToggleButton), TRUE); +#line 100 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp81_ = self->priv->hide_button; +#line 100 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + gtk_box_pack_start (content, G_TYPE_CHECK_INSTANCE_CAST (_tmp81_, 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" + _tmp82_ = (GtkBox*) 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 (_tmp82_, 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" + _tmp83_ = ok_button; +#line 112 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + gtk_widget_grab_focus (_tmp83_); +#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" + _tmp84_ = self->priv->import_meta_host; +#line 116 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + spit_data_imports_welcome_import_meta_host_start (_tmp84_); +#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 662 "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 669 "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 688 "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 695 "WelcomeDialog.c" + } +#line 121 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + if (_tmp1_) { +#line 699 "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 705 "WelcomeDialog.c" + } else { +#line 121 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp0_ = FALSE; +#line 709 "WelcomeDialog.c" + } +#line 120 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + if (_tmp0_) { +#line 713 "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 737 "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 749 "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 755 "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 766 "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 772 "WelcomeDialog.c" +} + + +void welcome_dialog_install_service_entry (WelcomeDialog* self, WelcomeServiceEntry* entry) { + WelcomeServiceEntry* _tmp0_; + gchar* _tmp1_; + gchar* _tmp2_; + gchar* _tmp3_; + gchar* _tmp4_; + WelcomeServiceEntry** _tmp5_; + gint _tmp5__length1; + WelcomeServiceEntry* _tmp6_; + WelcomeServiceEntry* _tmp7_; + GtkCheckButton* entry_check = NULL; + WelcomeServiceEntry* _tmp8_; + gchar* _tmp9_; + gchar* _tmp10_; + gchar* _tmp11_; + gchar* _tmp12_; + GtkCheckButton* _tmp13_; + GtkCheckButton* _tmp14_; + GtkCheckButton** _tmp15_; + gint _tmp15__length1; + GtkCheckButton* _tmp16_; + GtkBox* _tmp17_; +#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_ = entry; +#line 132 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp1_ = welcome_service_entry_get_service_name (_tmp0_); +#line 132 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp2_ = _tmp1_; +#line 132 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp3_ = g_strdup_printf ("WelcomeDialog: Installing service entry for %s", _tmp2_); +#line 132 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp4_ = _tmp3_; +#line 132 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + g_debug ("WelcomeDialog.vala:132: %s", _tmp4_); +#line 132 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _g_free0 (_tmp4_); +#line 132 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _g_free0 (_tmp2_); +#line 133 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp5_ = self->priv->external_import_entries; +#line 133 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp5__length1 = self->priv->external_import_entries_length1; +#line 133 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp6_ = entry; +#line 133 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp7_ = _g_object_ref0 (_tmp6_); +#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_, _tmp7_); +#line 134 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp8_ = entry; +#line 134 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp9_ = welcome_service_entry_get_service_name (_tmp8_); +#line 134 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp10_ = _tmp9_; +#line 134 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp11_ = g_strdup_printf (_ ("Import photos from your %s library"), _tmp10_); +#line 134 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp12_ = _tmp11_; +#line 134 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp13_ = (GtkCheckButton*) gtk_check_button_new_with_label (_tmp12_); +#line 134 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + g_object_ref_sink (_tmp13_); +#line 134 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp14_ = _tmp13_; +#line 134 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _g_free0 (_tmp12_); +#line 134 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _g_free0 (_tmp10_); +#line 134 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + entry_check = _tmp14_; +#line 136 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp15_ = self->priv->external_import_checks; +#line 136 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp15__length1 = self->priv->external_import_checks_length1; +#line 136 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp16_ = _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_, _tmp16_); +#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" + _tmp17_ = 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 (_tmp17_, 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 868 "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) { + gint _tmp0_; +#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" + _tmp0_ = resp; +#line 148 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + if (_tmp0_ == ((gint) GTK_RESPONSE_CLOSE)) { +#line 149 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + self->priv->ok_clicked = TRUE; +#line 887 "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 893 "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 900 "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 911 "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 917 "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 928 "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 934 "WelcomeDialog.c" + } +#line 183 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + return result; +#line 938 "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** _tmp5_; + gint _result__length1; + gint __result__size_; + WelcomeServiceEntry** _tmp19_; + gint _tmp19__length1; + WelcomeServiceEntry** _tmp20_; + gint _tmp20__length1; + gboolean _tmp21_ = FALSE; + GtkCheckButton* _tmp22_; +#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 986 "WelcomeDialog.c" + GtkCheckButton* _tmp3_; + gboolean _tmp4_; +#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" + _tmp4_ = gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_toggle_button_get_type (), GtkToggleButton)); +#line 175 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + show_dialog = !_tmp4_; +#line 995 "WelcomeDialog.c" + } +#line 178 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp5_ = g_new0 (WelcomeServiceEntry*, 0 + 1); +#line 178 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _result_ = _tmp5_; +#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 1005 "WelcomeDialog.c" + { + gint i = 0; +#line 179 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + i = 0; +#line 1010 "WelcomeDialog.c" + { + gboolean _tmp6_ = FALSE; +#line 179 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp6_ = TRUE; +#line 179 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + while (TRUE) { +#line 1017 "WelcomeDialog.c" + gint _tmp8_; + WelcomeServiceEntry** _tmp9_; + gint _tmp9__length1; + GtkCheckButton** _tmp10_; + gint _tmp10__length1; + gint _tmp11_; + GtkCheckButton* _tmp12_; + gboolean _tmp13_; +#line 179 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + if (!_tmp6_) { +#line 1028 "WelcomeDialog.c" + gint _tmp7_; +#line 179 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp7_ = i; +#line 179 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + i = _tmp7_ + 1; +#line 1034 "WelcomeDialog.c" + } +#line 179 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp6_ = FALSE; +#line 179 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp8_ = i; +#line 179 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp9_ = self->priv->external_import_entries; +#line 179 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp9__length1 = self->priv->external_import_entries_length1; +#line 179 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + if (!(_tmp8_ < _tmp9__length1)) { +#line 179 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + break; +#line 1048 "WelcomeDialog.c" + } +#line 180 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp10_ = self->priv->external_import_checks; +#line 180 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp10__length1 = self->priv->external_import_checks_length1; +#line 180 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp11_ = i; +#line 180 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp12_ = _tmp10_[_tmp11_]; +#line 180 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp13_ = gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, gtk_toggle_button_get_type (), GtkToggleButton)); +#line 180 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + if (_tmp13_ == TRUE) { +#line 1062 "WelcomeDialog.c" + WelcomeServiceEntry** _tmp14_; + gint _tmp14__length1; + WelcomeServiceEntry** _tmp15_; + gint _tmp15__length1; + gint _tmp16_; + WelcomeServiceEntry* _tmp17_; + WelcomeServiceEntry* _tmp18_; +#line 181 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp14_ = _result_; +#line 181 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp14__length1 = _result__length1; +#line 181 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp15_ = self->priv->external_import_entries; +#line 181 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp15__length1 = self->priv->external_import_entries_length1; +#line 181 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp16_ = i; +#line 181 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp17_ = _tmp15_[_tmp16_]; +#line 181 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp18_ = _g_object_ref0 (_tmp17_); +#line 181 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _vala_array_add6 (&_result_, &_result__length1, &__result__size_, _tmp18_); +#line 1086 "WelcomeDialog.c" + } + } + } + } +#line 183 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp19_ = _result_; +#line 183 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp19__length1 = _result__length1; +#line 183 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp20_ = (_tmp19_ != NULL) ? _vala_array_dup1 (_tmp19_, _tmp19__length1) : ((gpointer) _tmp19_); +#line 183 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp20__length1 = _tmp19__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 = _tmp20_; +#line 183 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _vala_selected_import_entries_length1 = _tmp20__length1; +#line 185 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp22_ = self->priv->system_pictures_import_check; +#line 185 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + if (_tmp22_ != NULL) { +#line 1109 "WelcomeDialog.c" + GtkCheckButton* _tmp23_; + gboolean _tmp24_; +#line 185 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp23_ = self->priv->system_pictures_import_check; +#line 185 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp24_ = gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, gtk_toggle_button_get_type (), GtkToggleButton)); +#line 185 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp21_ = _tmp24_; +#line 1118 "WelcomeDialog.c" + } else { +#line 185 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp21_ = FALSE; +#line 1122 "WelcomeDialog.c" + } +#line 184 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _vala_do_system_pictures_import = _tmp21_; +#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 1136 "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 1140 "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 1146 "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 1152 "WelcomeDialog.c" + } +#line 189 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + return result; +#line 1156 "WelcomeDialog.c" +} + + +static gboolean welcome_dialog_is_system_pictures_import_possible (void) { + gboolean result = FALSE; + GFile* system_pictures = NULL; + GFile* _tmp0_; + GFile* _tmp1_; + gboolean _tmp2_; + GFile* _tmp3_; + GFileType _tmp4_; + gboolean _tmp10_ = 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" + _tmp2_ = g_file_query_exists (_tmp1_, NULL); +#line 194 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + if (!_tmp2_) { +#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 1186 "WelcomeDialog.c" + } +#line 197 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp3_ = system_pictures; +#line 197 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp4_ = g_file_query_file_type (_tmp3_, G_FILE_QUERY_INFO_NONE, NULL); +#line 197 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + if (!(_tmp4_ == 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 1200 "WelcomeDialog.c" + } + { + GFileEnumerator* syspics_child_enum = NULL; + GFile* _tmp5_; + GFileEnumerator* _tmp6_; + GFileInfo* _tmp7_ = NULL; + GFileEnumerator* _tmp8_; + GFileInfo* _tmp9_; +#line 201 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp5_ = system_pictures; +#line 201 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp6_ = g_file_enumerate_children (_tmp5_, "standard::*", G_FILE_QUERY_INFO_NONE, NULL, &_inner_error_); +#line 201 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + syspics_child_enum = _tmp6_; +#line 201 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 1217 "WelcomeDialog.c" + goto __catch24_g_error; + } +#line 203 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp8_ = syspics_child_enum; +#line 203 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp9_ = g_file_enumerator_next_file (_tmp8_, NULL, &_inner_error_); +#line 203 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _tmp7_ = _tmp9_; +#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 1230 "WelcomeDialog.c" + goto __catch24_g_error; + } +#line 203 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + result = _tmp7_ != NULL; +#line 203 "/home/jens/Source/shotwell/src/dialogs/WelcomeDialog.vala" + _g_object_unref0 (_tmp7_); +#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 1243 "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 1261 "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 _tmp10_; +#line 1272 "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 1283 "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 1314 "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 1344 "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 + "• %s\n") + (indent_prefix + "• %s\n") + + (indent_prefix + "• %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; + } + } +} |