2001-12-29 Lutz M�ller <urc8@rz.uni-karlsruhe.de>

* frontends/command-line/main.c: Show file-specific progress on
          upload, too.


git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@3607 67ed7778-7388-44ab-90cf-0a291f65f57c
This commit is contained in:
Lutz Mueller
2001-12-29 08:49:02 +00:00
parent eec0a85d20
commit 7006f22f2f
2 changed files with 25 additions and 0 deletions

View File

@@ -1,3 +1,8 @@
2001-12-29 Lutz Müller <urc8@rz.uni-karlsruhe.de>
* frontends/command-line/main.c: Show file-specific progress on
upload, too.
2001-12-29 Lutz Müller <urc8@rz.uni-karlsruhe.de>
* libgphoto2/gphoto2-camera.h: Add a note about

View File

@@ -903,6 +903,24 @@ OPTION_CALLBACK (delete_all_pictures)
return (GP_OK);
}
static int
upload_progress_func (CameraFile *file, float percentage, void *data)
{
const char *name;
if (glob_quiet)
return (GP_OK);
CHECK_RESULT (gp_file_get_name (file, &name));
if (strlen (name))
printf ("Uploading '%s': %02.01f\r", name, percentage * 100.);
else
printf ("Uploading: %02.01f\r", percentage * 100.);
fflush (stdout);
return (GP_OK);
}
OPTION_CALLBACK (upload_picture)
{
CameraFile *file;
@@ -919,7 +937,9 @@ OPTION_CALLBACK (upload_picture)
return (res);
}
gp_file_set_progress_func (file, upload_progress_func, NULL);
res = gp_camera_folder_put_file (glob_camera, glob_folder, file);
gp_file_set_progress_func (file, NULL, NULL);
gp_file_unref (file);
return (res);