Commit f5161969 authored by Paolo Bacchilega's avatar Paolo Bacchilega
Browse files

[photo_importer] added ability to specify the event name

parent aa6a2345
......@@ -135,6 +135,7 @@
<child>
<object class="GtkTable" id="tags_box">
<property name="visible">True</property>
<property name="n_rows">2</property>
<property name="n_columns">2</property>
<property name="column_spacing">6</property>
<property name="row_spacing">5</property>
......@@ -149,6 +150,8 @@
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</child>
<child>
......@@ -166,9 +169,33 @@
</child>
</object>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label4">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Event:</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="event_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
......@@ -318,8 +345,8 @@
<child>
<object class="GtkFileChooserButton" id="destination_filechooserbutton">
<property name="visible">True</property>
<property name="local_only">False</property>
<property name="action">select-folder</property>
<property name="local_only">False</property>
</object>
<packing>
<property name="position">0</property>
......
......@@ -139,6 +139,7 @@ destroy_dialog (gpointer user_data)
subfolder_type,
subfolder_format,
single_subfolder,
gtk_entry_get_text (GTK_ENTRY (GET_WIDGET ("event_entry"))),
tags,
delete_imported,
overwrite_files,
......
......@@ -36,6 +36,7 @@ struct _GthImportTaskPrivate {
GthSubfolderType subfolder_type;
GthSubfolderFormat subfolder_format;
gboolean single_subfolder;
char *event_name;
char **tags;
gboolean delete_imported;
gboolean overwrite_files;
......@@ -67,6 +68,7 @@ gth_import_task_finalize (GObject *object)
_g_object_list_unref (self->priv->files);
g_object_unref (self->priv->destination);
_g_object_unref (self->priv->destination_file);
g_free (self->priv->event_name);
g_strfreev (self->priv->tags);
g_hash_table_destroy (self->priv->catalogs);
g_object_unref (self->priv->imported_catalog);
......@@ -170,7 +172,10 @@ catalog_imported_file (GthImportTask *self)
gth_catalog_set_file (catalog, self->priv->imported_catalog);
gth_catalog_set_date (catalog, date_time);
display_name = gth_datetime_strftime (date_time, _("Imported %x %X"));
if ((self->priv->event_name != NULL) && ! _g_utf8_all_spaces (self->priv->event_name))
display_name = gth_datetime_strftime (date_time, self->priv->event_name);
else
display_name = gth_datetime_strftime (date_time, _("Imported %x %X"));
gth_catalog_set_name (catalog, display_name);
g_hash_table_insert (self->priv->catalogs, g_strdup (IMPORTED_KEY), catalog);
......@@ -483,6 +488,7 @@ gth_import_task_new (GthBrowser *browser,
GthSubfolderType subfolder_type,
GthSubfolderFormat subfolder_format,
gboolean single_subfolder,
const char *event_name,
char **tags,
gboolean delete_imported,
gboolean overwrite_files,
......@@ -497,6 +503,7 @@ gth_import_task_new (GthBrowser *browser,
self->priv->subfolder_type = subfolder_type;
self->priv->subfolder_format = subfolder_format;
self->priv->single_subfolder = single_subfolder;
self->priv->event_name = g_strdup (event_name);
self->priv->tags = g_strdupv (tags);
self->priv->delete_imported = delete_imported;
self->priv->overwrite_files = overwrite_files;
......
......@@ -56,6 +56,7 @@ GthTask * gth_import_task_new (GthBrowser *browser,
GthSubfolderType subfolder_type,
GthSubfolderFormat subfolder_format,
gboolean single_subfolder,
const char *event_name,
char **tags,
gboolean delete_imported,
gboolean overwrite_files,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment