Index: /extensions/pLoader/trunk/locale/fr_FR/pLoader.po
===================================================================
--- /extensions/pLoader/trunk/locale/fr_FR/pLoader.po	(revision 6706)
+++ /extensions/pLoader/trunk/locale/fr_FR/pLoader.po	(revision 6707)
@@ -721,2 +721,53 @@
 msgid "Square"
 msgstr "Carrée"
+
+msgid "cancelled"
+msgstr "annulé"
+
+msgid "sending files"
+msgstr "envoi de fichiers"
+
+msgid "checking files"
+msgstr "validation de fichiers"
+
+msgid "files checked"
+msgstr "fichiers validés"
+
+msgid "transfered"
+msgstr "transféré"
+
+msgid "updating"
+msgstr "mise à jour"
+
+msgid "updating files"
+msgstr "mise à jour de fichiers"
+
+msgid "files updated"
+msgstr "fichiers mis à jour"
+
+msgid "updating properties"
+msgstr "mise à jour de propriétés"
+
+msgid "properties updated"
+msgstr "propriétés mises à jour"
+
+msgid "prepared, waiting for transfer"
+msgstr "préparée, transfert en attente"
+
+msgid "preparing web size"
+msgstr "préparation taille web"
+
+msgid "web size prepared"
+msgstr "taille web préparée"
+
+msgid "preparing high"
+msgstr "préparation haute définition"
+
+msgid "high prepared"
+msgstr "haute définition préparée"
+
+msgid "start sending"
+msgstr "Début d'envoi"
+
+msgid "sending"
+msgstr "envoie"
Index: /extensions/pLoader/trunk/src/Uploader/GUI/App.pm
===================================================================
--- /extensions/pLoader/trunk/src/Uploader/GUI/App.pm	(revision 6706)
+++ /extensions/pLoader/trunk/src/Uploader/GUI/App.pm	(revision 6707)
@@ -73,4 +73,5 @@
 
 my @app_properties = qw/
+    localized_msg
     version
     frame
@@ -140,4 +141,5 @@
     batch_end_event
     image_progress_event
+    image_done_event
 /;
 
@@ -469,4 +471,5 @@
         $self->current_language
     );
+
     $locale->AddCatalogLookupPathPrefix(
         File::Spec->catfile($self->root_dir, $self->locale_dir)
@@ -582,4 +585,32 @@
         ]
     );
+
+
+    $self->localized_msg(
+        {
+             map { $_ => gettext($_) } (
+                 'cancelled',
+                 'sending files',
+                 'checking files',
+                 'files checked',
+                 'transfered',
+                 'updating',
+                 'updating files',
+                 'files updated',
+                 'updating properties',
+                 'properties updated',
+                 'prepared, waiting for transfer',
+                 'preparing web size',
+                 'web size prepared',
+                 'preparing high',
+                 'high prepared',
+                 'start sending',
+                 'sending',
+                 
+             )
+        }
+    );
+
+    print Dumper $self->localized_msg;
 
 }
@@ -727,4 +758,5 @@
             batch_end_event => $resize_batch_end_event,
             event_handler   => $self,
+            localized_msg   => $self->localized_msg,
         })
     );
@@ -817,4 +849,17 @@
 }
 
+
+sub on_image_done {
+    my ( $self, $image ) = @_;
+
+    Wx::PostEvent(
+        $self->frame,
+        Wx::PlThreadEvent->new(
+            -1,
+            $self->image_done_event,
+            $image
+        )
+    );
+}
 
 sub init_images {
@@ -1108,4 +1153,5 @@
                 use_offline    => $self->use_offline,
                 version        => $self->version,
+                localized_msg  => $self->localized_msg,
             }
         )
@@ -1229,8 +1275,13 @@
             event_handler   => $self,
             batch_end_event => $transfer_batch_end_event,
+            localized_msg   => $self->localized_msg,
         })
     );
 
     $self->image_progress_event(
+        Wx::NewEventType
+    );
+
+    $self->image_done_event(
         Wx::NewEventType
     );
@@ -1289,5 +1340,5 @@
             my ( $handler, $event ) = @_;
             my $data = $event->GetData;
-            $handler->on_image_progress($data);
+            $handler->on_image_done($data);
         } 
     );
Index: /extensions/pLoader/trunk/src/Uploader/GUI/Frame.pm
===================================================================
--- /extensions/pLoader/trunk/src/Uploader/GUI/Frame.pm	(revision 6706)
+++ /extensions/pLoader/trunk/src/Uploader/GUI/Frame.pm	(revision 6707)
@@ -484,5 +484,4 @@
                         )
                     );
-                    wxTheApp->layout_clean(1);
                 },
             },
@@ -1062,4 +1061,23 @@
             my $data = $event->GetData;
             $handler->upload_progressdlg->batch_end($data);
+            wxTheApp->images->remove_processed;
+            $handler->refresh_image_context;
+        } 
+    );
+
+    Wx::Event::EVT_COMMAND(
+        $self,
+        -1,
+        wxTheApp->image_done_event,
+        sub {
+            my ( $handler, $event ) = @_;
+            my $data = $event->GetData;
+printf("image_done_event %s\n", Dumper $data);
+            if($data->{preferences}{remove_uploaded_from_selection}){
+                my $gr = $data->{global_rank};
+                if(defined $gr){
+                    wxTheApp->images->set_to_be_removed($gr) if $data->{transfer_successful};
+                }
+            }
         } 
     );
@@ -1124,7 +1142,13 @@
 
     $self->images->remove_selection;
-    $self->imageviewer->Refresh;    
-
-    if (!$self->imageviewer->GetItemCount){
+    $self->refresh_image_context;
+}
+
+sub refresh_image_context {
+    my ( $self ) = @_;
+
+    $self->imageviewer->Refresh;
+
+    if ($self->imageviewer->is_empty){
         $self->image_preview_dlg->image(
             0
Index: /extensions/pLoader/trunk/src/Uploader/GUI/wxChoiceFilteredPanel.pm
===================================================================
--- /extensions/pLoader/trunk/src/Uploader/GUI/wxChoiceFilteredPanel.pm	(revision 6706)
+++ /extensions/pLoader/trunk/src/Uploader/GUI/wxChoiceFilteredPanel.pm	(revision 6707)
@@ -459,5 +459,5 @@
     my( $self, $event ) = @_;
 
-    $self->init_choices_list(
+    $self->refresh_choices_list(
         $self->choices->()
     );
Index: /extensions/pLoader/trunk/src/Uploader/GUI/wxImageListCtrl.pm
===================================================================
--- /extensions/pLoader/trunk/src/Uploader/GUI/wxImageListCtrl.pm	(revision 6706)
+++ /extensions/pLoader/trunk/src/Uploader/GUI/wxImageListCtrl.pm	(revision 6707)
@@ -543,5 +543,9 @@
 
 
-
+sub is_empty {
+    my ( $self ) = @_;
+
+    !$self->GetItemCount;
+}
 1;
 
Index: /extensions/pLoader/trunk/src/Uploader/Images.pm
===================================================================
--- /extensions/pLoader/trunk/src/Uploader/Images.pm	(revision 6706)
+++ /extensions/pLoader/trunk/src/Uploader/Images.pm	(revision 6707)
@@ -31,4 +31,6 @@
     author
     type
+    global_rank
+    global_rank_indx
 /;
 
@@ -37,9 +39,14 @@
 /;
 
+my @tmp_properties = qw/
+    to_be_removed_grank
+/;
+
+
 __PACKAGE__->mk_accessors(@cbk_properties);
 __PACKAGE__->mk_accessors(@storable_properties);
 __PACKAGE__->mk_accessors(@app_properties);
-
-my $_global_rank = -1;
+__PACKAGE__->mk_accessors(@tmp_properties);
+
 
 sub Init {
@@ -49,4 +56,7 @@
     $self->ordered_image_ids([]) if !defined $self->ordered_image_ids;
     $self->selection([]) if !defined $self->selection;
+    $self->global_rank(-1) if !defined $self->global_rank;
+    $self->global_rank_indx({}) if !defined $self->global_rank_indx;
+    $self->to_be_removed_grank([]) if !defined $self->to_be_removed_grank;
 }
 
@@ -90,4 +100,11 @@
     $self->ordered_image_ids->[$i] = $image_id ;
 
+    $self->global_rank(
+        1+$self->global_rank
+    );
+
+    $self->global_rank_indx->{
+        $self->global_rank
+    } = $i;
 
     my $image = $self->_images->{
@@ -104,5 +121,5 @@
                 site_tags         => [],
                 site_high_file    => $file->{ANSIPathName},
-                global_rank       => ++$_global_rank,
+                global_rank       => $self->global_rank,
             }
         );
@@ -176,4 +193,5 @@
     my ( $self, $indx ) = @_;
     
+    return unless defined $indx;
     my $id = $self->ordered_image_ids->[$indx];
 
@@ -222,6 +240,34 @@
 
 
+sub remove_processed {
+    my ( $self ) = @_;
+    
+    return if ( $self->is_empty );
+    return if (! defined $self->to_be_removed_grank );
+
+    my $to_remove_indx = [];
+    # check if the global rank correspond
+    # the image may have changed
+    foreach(@{$self->to_be_removed_grank}) {
+        my $indx = $self->global_rank_indx->{$_};
+        my $img;
+        if(defined $indx){
+            $img = $self->get_image($indx);
+        }
+        if(defined $img){
+            push @$to_remove_indx, $indx if
+                $img->global_rank == $_;
+        }
+    } 
+
+    $self->_remove_selection($to_remove_indx);
+    # clear image selection
+    $self->to_be_removed_grank([]);
+}
+
+
 sub _remove_selection {
     my ( $self, $list ) = @_;
+    printf("_remove_selection %s\n", Dumper $list);
     # the list is sorted, ascendant
     # we reverse it to have
@@ -238,4 +284,13 @@
 }
 
+
+# postpone actual removal.
+sub set_to_be_removed {
+    my ( $self, $global_rank ) = @_;
+
+    push @{$self->to_be_removed_grank}, $global_rank;
+}
+
+
 sub delete_image {
     my ( $self, $indx ) = @_;
@@ -245,4 +300,9 @@
     # have to check if that id is used more than once
     my $count = grep { $id eq $_} @{$self->ordered_image_ids};
+
+    # global rank is unique
+    delete $self->global_rank_indx->{
+        $self->_images->{$id}->global_rank
+    };
 
     delete $self->_images->{$id} unless $count > 1;
@@ -517,4 +577,5 @@
 
 
+# when the progress list is cleared
 sub reset_add_rank {
     my ( $self ) = @_;
Index: /extensions/pLoader/trunk/src/Uploader/Object.pm
===================================================================
--- /extensions/pLoader/trunk/src/Uploader/Object.pm	(revision 6706)
+++ /extensions/pLoader/trunk/src/Uploader/Object.pm	(revision 6707)
@@ -31,4 +31,5 @@
     version
     storable_file
+    localized_msg
 /);
 
Index: /extensions/pLoader/trunk/src/Uploader/PWG/WebServices.pm
===================================================================
--- /extensions/pLoader/trunk/src/Uploader/PWG/WebServices.pm	(revision 6706)
+++ /extensions/pLoader/trunk/src/Uploader/PWG/WebServices.pm	(revision 6707)
@@ -19,5 +19,7 @@
 # +-----------------------------------------------------------------------+
 package Uploader::PWG::WebServices;
- 
+use threads;
+use threads::shared;
+
 use strict;
 use warnings;
@@ -238,5 +240,5 @@
         );    
     }
-    
+
     return ( $result->is_success, $result->status_line );
 }
@@ -514,5 +516,9 @@
     $self->log_image_progress(
         $image,
-        sprintf("sending %s", $image->{file_type_code}),
+        sprintf(
+            "%s : %s",
+            $self->localized_msg->{"start sending"},
+            $image->{file_type_code}
+        ),
         0,
     );
@@ -553,5 +559,9 @@
         $self->log_image_progress(
             $image,
-            sprintf("sending %s", $image->{file_type_code}),
+            sprintf(
+                "%s : %s",
+                $self->localized_msg->{"sending"},
+                $image->{file_type_code}
+            ),
             100*($chunk_pos/$content_length),
         );
@@ -604,4 +614,5 @@
 
 }
+
 
 sub add_image {
Index: /extensions/pLoader/trunk/src/Uploader/ResizeManager.pm
===================================================================
--- /extensions/pLoader/trunk/src/Uploader/ResizeManager.pm	(revision 6706)
+++ /extensions/pLoader/trunk/src/Uploader/ResizeManager.pm	(revision 6707)
@@ -15,9 +15,10 @@
 
     Uploader::ResizeWorker->new({
-        thumb_dir    => $self->thumb_dir,
-        wx_thumb_dir => $self->wx_thumb_dir,
-        resized_dir  => $self->resized_dir,
-        preferences  => $self->preferences,
-        write_type   => 'jpg',
+        thumb_dir     => $self->thumb_dir,
+        wx_thumb_dir  => $self->wx_thumb_dir,
+        resized_dir   => $self->resized_dir,
+        preferences   => $self->preferences,
+        write_type    => 'jpg',
+        localized_msg => $self->localized_msg,
     });
 }
Index: /extensions/pLoader/trunk/src/Uploader/ResizeWorker.pm
===================================================================
--- /extensions/pLoader/trunk/src/Uploader/ResizeWorker.pm	(revision 6706)
+++ /extensions/pLoader/trunk/src/Uploader/ResizeWorker.pm	(revision 6707)
@@ -37,5 +37,5 @@
     $self->log_image_progress(
         $image,
-        "cancelled",
+        $self->localized_msg->{"cancelled"},
         0,
     );
@@ -80,5 +80,5 @@
     my ( $self, $image ) = @_;
 
-    $image->{status}   = "prepared, waiting for transfer";
+    $image->{status}   = $self->localized_msg->{"prepared, waiting for transfer"};
     $image->{progress} = 25;
 
@@ -114,5 +114,8 @@
     );
 
-    Wx::PostEvent($self->event_handler, $thread_event);
+    eval {
+        Wx::PostEvent($self->event_handler, $thread_event);
+    }
+
 }
 
@@ -123,5 +126,5 @@
     $self->log_image_progress(
         $image,
-        "creating web size",
+        $self->localized_msg->{"preparing web size"},
         5,
     );
@@ -140,5 +143,5 @@
     $self->log_image_progress(
         $image,
-        "web size created",
+        $self->localized_msg->{"web size prepared"},
         10,
     );
@@ -338,5 +341,5 @@
     $self->log_image_progress(
         $image,
-        "preparing high",
+        $self->localized_msg->{"preparing high"},
         15,
     );
@@ -447,5 +450,5 @@
     $self->log_image_progress(
         $image,
-        "high prepared",
+        $self->localized_msg->{"high prepared"},
         25,
     );
Index: /extensions/pLoader/trunk/src/Uploader/TransferManager.pm
===================================================================
--- /extensions/pLoader/trunk/src/Uploader/TransferManager.pm	(revision 6706)
+++ /extensions/pLoader/trunk/src/Uploader/TransferManager.pm	(revision 6707)
@@ -6,5 +6,4 @@
 use base qw/Uploader::ThreadManager/;
 use Uploader::TransferWorker;
-use vars qw/$AUTOLOAD/;
 __PACKAGE__->mk_accessors(qw/
     pwg
@@ -18,5 +17,6 @@
 
     Uploader::TransferWorker->new({
-        pwg => $self->pwg,
+        pwg           => $self->pwg,
+        localized_msg => $self->localized_msg,
     });
 
@@ -27,5 +27,7 @@
     my ( $self ) = @_;
 
-    !scalar @{$self->destination_category};
+    defined $self->destination_category ?
+        !scalar @{$self->destination_category} :
+        1;
 }
 
Index: /extensions/pLoader/trunk/src/Uploader/TransferWorker.pm
===================================================================
--- /extensions/pLoader/trunk/src/Uploader/TransferWorker.pm	(revision 6706)
+++ /extensions/pLoader/trunk/src/Uploader/TransferWorker.pm	(revision 6707)
@@ -34,9 +34,6 @@
     return unless $image->{image_id};
 
-    $self->log_image_progress(
-        $image,
-        "cancelled",
-        0,
-    );
+    ( $image->{status}, $image->{progress} ) = ($self->localized_msg->{"cancelled"}, 0);
+    $self->post_image_progress_event($image);
 }
 
@@ -49,5 +46,4 @@
     );
 
-
     $self->progress_event(
         $progress_event
@@ -57,5 +53,5 @@
         $transfer_done_event
     );
-
+    
 
     if(!$self->exists_image($image)){
@@ -66,4 +62,5 @@
     }
 
+    $self->post_image_done_event($image);
 }
 
@@ -81,17 +78,10 @@
     my ( $self, $image ) = @_;
 
-    $self->log_image_progress($image, "sending files", 0);
+    ( $image->{status}, $image->{progress} ) = ($self->localized_msg->{"sending files"}, 0);
+    $self->post_image_progress_event($image);
+
     $self->add_image_files($image);
     $self->add_image($image);
-    $self->log_image_progress($image, "transfered", 100);
-
-}
-
-
-sub log_image_progress {
-    my ( $self, $image, $status, $value ) = @_;
-
-    $image->{status}   = $status;
-    $image->{progress} = $value;
+
     $self->post_image_progress_event($image);
 }
@@ -110,5 +100,7 @@
 
 
-    $self->log_image_progress($image, "check files", 0);
+    ( $image->{status}, $image->{progress} ) = ($self->localized_msg->{"checking files"}, 0);
+    $self->post_image_progress_event($image);
+
     my @file_types = ('site_resized_file', 'site_thumb_file');
     push @file_types, 'site_high_file' if $image->{upload_high};
@@ -118,5 +110,6 @@
     }@file_types;
 
-    $self->log_image_progress($image, "files checked", 100);
+    ( $image->{status}, $image->{progress} ) = ($self->localized_msg->{"files checked"}, 100);
+    $self->post_image_progress_event($image);
 }
 
@@ -157,5 +150,8 @@
     my ( $self, $image ) = @_;
 
-    $self->pwg->add_image($image);
+    my ( $is_success, $status_line ) = $self->pwg->add_image($image);
+    
+    $image->{transfer_successful} = $is_success;
+    $image->{status} = $is_success ? $self->localized_msg->{"transfered"} : $status_line ;
 }
 
@@ -164,10 +160,13 @@
     my ( $self, $image ) = @_;
 
-    $self->log_image_progress($image, "updating", 0);
+    
+    ( $image->{status}, $image->{progress} ) = ($self->localized_msg->{"updating"}, 0);
+    $self->post_image_progress_event($image);
 
     $self->update_image_files($image);
+    $self->post_image_progress_event($image);
+
     $self->update_image_properties($image);
-
-    $self->log_image_progress($image, "updated", 100);
+    $self->post_image_progress_event($image);
 }
 
@@ -177,8 +176,9 @@
 
     if($image->{preferences}{reupload_action_files}){
-        $self->log_image_progress($image, "updating files", 0);
+        ( $image->{status}, $image->{progress} ) = ($self->localized_msg->{"updating files"}, 0);
+        $self->post_image_progress_event($image);
+
         $self->init_image_files_checksums($image);
         $self->update_image_modified_files($image);
-        $self->log_image_progress($image, "files updated", 100);
     }
 }
@@ -188,5 +188,7 @@
     my ( $self, $image ) = @_;
 
-    $self->pwg->update_image_modified_files($image);
+    my ( $is_success, $status_line ) = $self->pwg->update_image_modified_files($image);
+    $image->{transfer_successful} = $is_success;
+    $image->{status} = $is_success ? $self->localized_msg->{"files updated"} : $status_line ;
 }
 
@@ -195,7 +197,23 @@
     my ( $self, $image ) = @_;
 
-    $self->log_image_progress($image, "updating properties", 0);
-    $self->pwg->update_image_properties($image);
-    $self->log_image_progress($image, "properties updated", 100);
+    ( $image->{status}, $image->{progress} ) = ($self->localized_msg->{"updating properties"}, 0);
+    $self->post_image_progress_event($image);
+
+    my ( $is_success, $status_line ) = $self->pwg->update_image_properties($image);
+
+    $image->{transfer_successful} = $is_success;
+    $image->{status} = $is_success ? $self->localized_msg->{"properties updated"} : $status_line ;
+}
+
+
+sub post_image_done_event {
+    my ( $self, $image ) = @_;
+
+    $image->{progress} = 100;
+
+    $self->post_image_event(
+        $self->done_event,
+        $image
+    );
 }
 
@@ -219,5 +237,8 @@
         shared_clone($image)
     );
-    Wx::PostEvent($self->event_handler, $thread_event);
+
+    eval {
+        Wx::PostEvent($self->event_handler, $thread_event);
+    }
 }
 
