Commit 3ea4f361 authored by Paolo Bacchilega's avatar Paolo Bacchilega
Browse files

[photo_importer] highlight the auto-subfolder part in the destination

parent 5e094147
......@@ -471,6 +471,13 @@ gth_import_preferences_dialog_set_event (GthImportPreferencesDialog *self,
}
GFile *
gth_import_preferences_dialog_get_destination (GthImportPreferencesDialog *self)
{
return gtk_file_chooser_get_file (GTK_FILE_CHOOSER (GET_WIDGET ("destination_filechooserbutton")));
}
GFile *
gth_import_preferences_dialog_get_destination_example (GthImportPreferencesDialog *self)
{
......
......@@ -57,6 +57,8 @@ GType gth_import_preferences_dialog_get_type (void);
GtkWidget * gth_import_preferences_dialog_new (void);
void gth_import_preferences_dialog_set_event (GthImportPreferencesDialog *self,
const char *event);
GFile * gth_import_preferences_dialog_get_destination
(GthImportPreferencesDialog *self);
GFile * gth_import_preferences_dialog_get_destination_example
(GthImportPreferencesDialog *self);
......
......@@ -231,10 +231,33 @@
</packing>
</child>
<child>
<object class="GtkLabel" id="destination_label">
<object class="GtkHBox" id="hbox3">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="ellipsize">start</property>
<child>
<object class="GtkLabel" id="destination_label">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label">/home/user/Images</property>
</object>
<packing>
<property name="expand">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="destination_example_label">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label">/garden/2010-06-23</property>
<property name="ellipsize">end</property>
<attributes>
<attribute name="foreground" value="#b1eb33440710"/>
</attributes>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
......
......@@ -273,15 +273,28 @@ static void
preferences_dialog_destination_changed_cb (GthImportPreferencesDialog *dialog,
DialogData *data)
{
GFile *destination;
GFile *destination_example;
destination = gth_import_preferences_dialog_get_destination (dialog);
destination_example = gth_import_preferences_dialog_get_destination_example (dialog);
if (destination_example != NULL) {
if ((destination != NULL) && (destination_example != NULL)) {
char *name;
name = g_file_get_parse_name (destination_example);
name = g_file_get_parse_name (destination);
gtk_image_set_from_icon_name(GTK_IMAGE (GET_WIDGET("destination_icon")), "folder", GTK_ICON_SIZE_MENU);
gtk_label_set_text (GTK_LABEL (GET_WIDGET ("destination_label")), name);
g_free (name);
name = g_file_get_relative_path (destination, destination_example);
if ((name != NULL) && (strcmp (name, "") != 0)) {
char *example_path;
example_path = g_strconcat (G_DIR_SEPARATOR_S, name, NULL);
gtk_label_set_text (GTK_LABEL (GET_WIDGET ("destination_example_label")), example_path);
g_free (example_path);
}
g_free (name);
}
......@@ -289,6 +302,9 @@ preferences_dialog_destination_changed_cb (GthImportPreferencesDialog *dialog,
gtk_image_set_from_icon_name(GTK_IMAGE (GET_WIDGET("destination_icon")), "dialog-error", GTK_ICON_SIZE_MENU);
gtk_label_set_text (GTK_LABEL (GET_WIDGET ("destination_label")), _("Invalid Destination"));
}
_g_object_unref (destination_example);
_g_object_unref (destination);
}
......
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