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:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user