Commit 85e75d78 authored by Paolo Bacchilega's avatar Paolo Bacchilega
Browse files

[picasaweb] use the import task to import from picasa web

parent 626f79f5
......@@ -16,7 +16,7 @@ libexiv2_la_SOURCES = \
libexiv2_la_CPPFLAGS = $(GTHUMB_CFLAGS) $(EXIV2_CFLAGS) -I$(top_srcdir) -I$(top_builddir)/gthumb
libexiv2_la_LDFLAGS = $(EXTENSION_LIBTOOL_FLAGS)
libexiv2_la_LIBADD = $(GTHUMB_LIBS)
libexiv2_la_LIBADD = $(GTHUMB_LIBS) $(EXIV2_LIBS)
libexiv2_la_DEPENDENCIES = $(top_builddir)/gthumb/gthumb$(EXEEXT)
extensioninidir = $(extensiondir)
......
......@@ -440,6 +440,12 @@ exiv2_read_metadata_from_file (GFile *file,
char *path;
path = g_file_get_path (file);
if (path == NULL) {
if (error != NULL)
*error = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_FAILED, _("Invalid file format"));
return FALSE;
}
Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(path);
g_free (path);
......@@ -498,6 +504,9 @@ exiv2_read_sidecar (GFile *file,
char *path;
path = g_file_get_path (file);
if (path == NULL)
return FALSE;
Exiv2::DataBuf buf = Exiv2::readFile(path);
g_free (path);
......
......@@ -142,27 +142,65 @@ import_dialog_response_cb (GtkDialog *dialog,
case GTK_RESPONSE_OK:
{
GtkTreeModel *tree_model;
GtkTreeIter iter;
PicasaWebAlbum *album;
/*GList *file_list;*/
GList *file_list;
if (! gtk_tree_selection_get_selected (gtk_tree_view_get_selection (GTK_TREE_VIEW (GET_WIDGET ("albums_treeview"))), &tree_model, &iter)) {
if (! gtk_combo_box_get_active_iter (GTK_COMBO_BOX (GET_WIDGET ("album_combobox")), &iter)) {
gtk_widget_set_sensitive (GET_WIDGET ("download_button"), FALSE);
return;
}
gtk_tree_model_get (tree_model, &iter,
gtk_tree_model_get (GTK_TREE_MODEL (GET_WIDGET ("album_liststore")), &iter,
ALBUM_DATA_COLUMN, &album,
-1);
gth_task_dialog (GTH_TASK (data->conn), FALSE);
/* FIXME
file_list = get_files_to_download (data);
if (file_list != NULL) {
GFile *destination;
gboolean single_subfolder;
GthSubfolderType subfolder_type;
GthSubfolderFormat subfolder_format;
char *custom_format;
gboolean overwrite_files;
gboolean adjust_orientation;
char **tags;
int i;
GthTask *task;
destination = gth_import_preferences_get_destination ();
subfolder_type = eel_gconf_get_enum (PREF_IMPORT_SUBFOLDER_TYPE, GTH_TYPE_SUBFOLDER_TYPE, GTH_SUBFOLDER_TYPE_FILE_DATE);
subfolder_format = eel_gconf_get_enum (PREF_IMPORT_SUBFOLDER_FORMAT, GTH_TYPE_SUBFOLDER_FORMAT, GTH_SUBFOLDER_FORMAT_YYYYMMDD);
single_subfolder = eel_gconf_get_boolean (PREF_IMPORT_SUBFOLDER_SINGLE, FALSE);
custom_format = eel_gconf_get_string (PREF_IMPORT_SUBFOLDER_CUSTOM_FORMAT, "");
overwrite_files = eel_gconf_get_boolean (PREF_IMPORT_OVERWRITE, FALSE);
adjust_orientation = eel_gconf_get_boolean (PREF_IMPORT_ADJUST_ORIENTATION, FALSE);
tags = g_strsplit ((album->keywords != NULL ? album->keywords : ""), ",", -1);
for (i = 0; tags[i] != NULL; i++)
tags[i] = g_strstrip (tags[i]);
task = gth_import_task_new (data->browser,
file_list,
destination,
subfolder_type,
subfolder_format,
single_subfolder,
custom_format,
(album->title != NULL ? album->title : ""),
tags,
FALSE,
overwrite_files,
adjust_orientation);
gth_browser_exec_task (data->browser, task, FALSE);
gtk_widget_destroy (data->dialog);
g_object_unref (task);
g_strfreev (tags);
_g_object_unref (destination);
}
_g_object_list_unref (file_list);
*/
g_object_unref (album);
}
break;
......
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