Changeset 3509 for extensions/pLoader/trunk/src/Uploader/ImageList.pm
- Timestamp:
- Jul 4, 2009, 12:09:47 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/pLoader/trunk/src/Uploader/ImageList.pm
r3472 r3509 31 31 use Encode qw/encode decode is_utf8/; 32 32 use Wx::Locale qw/:default/; 33 use Wx; 33 34 34 35 # this class implements a collection of image files with associated data … … 69 70 SetNewFilesProgressCallback 70 71 SetNewFilesDisplayEndInfoCallback 72 YieldCallback 71 73 UploadImagesViewerCallback 72 74 progress_thumbnail_refresh … … 883 885 884 886 # update upload progress dialog 885 $self->progressbar_refresh->(0. 20);887 $self->progressbar_refresh->(0.05); 886 888 }; 887 889 # user cancelled : dialog box is destroyed … … 929 931 } 930 932 933 # Resized and original are ready 934 $self->progressbar_refresh->(0.10); 935 936 931 937 $msg = sprintf( 932 938 "Preparing thumbnail for %s - %s", … … 960 966 eval { 961 967 $self->progress_msg_refresh->($msg); 962 $self->progressbar_refresh->(0.50); 968 # Thumbnail is ready 969 $self->progressbar_refresh->(0.20); 963 970 }; 964 971 croak "Upload cancelled. ", $@ if $@ ; … … 966 973 # photo metadata 967 974 $self->_prepare_upload_properties(); 968 my ( $status, $status_msg ) = $self->pwg->UploadImage(); 969 975 my ( $status, $status_msg, $content ) = $self->pwg->UploadImage( $self->YieldCallback, $self->progressbar_refresh ); 976 my $ok = 0; 977 # HTTP REQUEST OK 970 978 if ( $status ){ 979 # PIWIGO RESULT ( HTTP may be ok while Piwigo is not ) 980 $ok = 'fail' eq $content->{stat} ? 0 : 1; 981 } 982 else{ 983 Wx::LogMessage( 984 "% %s : %s", 985 gettext("Communication error with"), 986 $self->pwg->site_url, 987 $status_msg, 988 ); 989 } 990 991 if($ok){ 971 992 $msg = sprintf( 972 "%s : %s upload succcessful.",993 "%s : %s - %s.", 973 994 $site_name, 974 $file 995 $file, 996 gettext("upload succcessful"), 975 997 ); 976 998 … … 979 1001 } else { 980 1002 $msg = sprintf( 981 "An error has occured.\n%s : %s upload is cancelled.\n $status_msg",1003 "An error has occured.\n%s : %s upload is cancelled.\n%s", 982 1004 $site_name, 983 $file 1005 $file, 1006 Dumper($content), 984 1007 ); 985 1008 $rejected++; … … 1009 1032 my $duration = $time_end - $time_begin; 1010 1033 $msg = sprintf( 1011 "%s images processed\n\n%s images uploaded\n\n%s images in errors and not uploaded - $last_error\n\nDuration : %s seconds",1034 "%s images processed\n\n%s images uploaded\n\n%s images in errors and not uploaded - \n%s\n\nDuration : %s seconds", 1012 1035 $self->count - 1, 1013 1036 $uploaded, 1014 1037 $rejected, 1038 $last_error, 1015 1039 $duration, 1016 1040 );
Note: See TracChangeset
for help on using the changeset viewer.