Index: /extensions/pLoader/trunk/src/Uploader/GUI/DlgCommon.pm
===================================================================
--- /extensions/pLoader/trunk/src/Uploader/GUI/DlgCommon.pm	(revision 4568)
+++ /extensions/pLoader/trunk/src/Uploader/GUI/DlgCommon.pm	(revision 4569)
@@ -2,4 +2,5 @@
 use strict;
 use Wx::Calendar;
+use Wx::Locale qw/:default/;
 
 use base qw/
@@ -16,81 +17,136 @@
     my ( $self ) = @_;
 
-	# to connect the right event handler to each control
-	my $ctrl_handlers = {
-	    'Wx::TextCtrl' => sub { my ( $ctrl ) = @_; Wx::Event::EVT_TEXT( $ctrl, $ctrl, sub { $self->OnTextCtrl(@_) } ); },
-	    'Wx::Choice' => sub { my ( $ctrl ) = @_; Wx::Event::EVT_CHOICE( $ctrl, $ctrl, sub { $self->OnChoice(@_) } ); },
-	    'Wx::DatePickerCtrl' => sub { my ( $ctrl ) = @_; Wx::Event::EVT_DATE_CHANGED( $ctrl, $ctrl, sub { $self->OnDatePicker(@_) } ); },
-	};
-	
-	map {
-        my $ctrl =$self->FindWindow($_);
-        if(defined $ctrl){
-		    $ctrl_handlers->{ ref $ctrl}->($ctrl) if exists $ctrl_handlers->{ ref $ctrl};
-		}
-    }
-	keys %{$self->properties};
-	
-
-}
+    # to connect the right event handler to each control
+    my $ctrl_handlers = {
+        'Wx::SpinCtrl' => sub { my ( $ctrl ) = @_; Wx::Event::EVT_SPINCTRL( $ctrl, $ctrl, sub { $self->OnSpinCtrl(@_) } ); },
+        'Wx::TextCtrl' => sub { my ( $ctrl ) = @_; Wx::Event::EVT_TEXT( $ctrl, $ctrl, sub { $self->OnTextCtrl(@_) } ); },
+        'Wx::Choice' => sub { my ( $ctrl ) = @_; Wx::Event::EVT_CHOICE( $ctrl, $ctrl, sub { $self->OnChoice(@_) } ); },
+        'Wx::CheckBox' => sub { my ( $ctrl ) = @_; Wx::Event::EVT_CHECKBOX( $ctrl, $ctrl, sub { $self->OnCheckBox(@_) } ); },
+        'Wx::DatePickerCtrl' => sub { my ( $ctrl ) = @_; Wx::Event::EVT_DATE_CHANGED( $ctrl, $ctrl, sub { $self->OnDatePicker(@_) } ); },
+    };
+    
+    map {
+        my $ctrl =$self->FindWindow($_);
+        if(defined $ctrl){
+            $ctrl_handlers->{ ref $ctrl}->($ctrl) if exists $ctrl_handlers->{ ref $ctrl};
+
+            $ctrl->SetValidator(
+                $self->properties->{$_}->{validator}
+            ) if exists $self->properties->{$_}->{validator};
+        }
+    }
+    keys %{$self->properties};
+    
+
+}
+
+# what does happen when the text changes
+sub OnCheckBox {
+    my ( $self, $ctrl, $event ) = @_;
+    
+    my $id = $ctrl->GetId;
+    # change the property value
+    $self->properties->{$id}->{value}->(
+        $event->IsChecked
+    ) if exists $self->properties->{$id}->{value};
+
+    # exec the callback
+    $self->properties->{$id}->{frame_callback}->($self, $ctrl, $event) if exists
+        $self->properties->{$id}->{frame_callback};    
+
+    $event->Skip;
+}
+
 
 # what does happen when the text changes
 sub OnTextCtrl {
     my ( $self, $ctrl, $event ) = @_;
-	
-    my $id = $ctrl->GetId;
-    # change the property value
-	$self->properties->{$id}->{value}->(
+    
+    my $id = $ctrl->GetId;
+    # change the property value
+    $self->properties->{$id}->{value}->(
         $event->GetString
     ) if exists $self->properties->{$id}->{value};
 
     # exec the callback
-    $self->properties->{$id}->{frame_callback}->() if exists
-        $self->properties->{$id}->{frame_callback};	
-	
-}
+    $self->properties->{$id}->{frame_callback}->($self, $ctrl, $event) if exists
+        $self->properties->{$id}->{frame_callback};    
+    
+    $event->Skip;
+}
+
+sub OnSpinCtrl {
+    my ( $self, $ctrl, $event ) = @_;
+    
+    my $id = $ctrl->GetId;
+    # change the property value
+    $self->properties->{$id}->{value}->(
+        $event->GetInt
+    ) if exists $self->properties->{$id}->{value};
+
+    # exec the callback
+    $self->properties->{$id}->{frame_callback}->($self, $ctrl, $event) if exists
+        $self->properties->{$id}->{frame_callback};    
+    
+    $event->Skip;
+}
+
 
 sub OnChoice {
     my ( $self, $ctrl, $event ) = @_;
-	
-    my $id = $ctrl->GetId;
-    # change the property value
-	$self->properties->{$id}->{selection}->(
-        $event->GetSelection
+    
+    my $id = $ctrl->GetId;
+
+    # if a preprocess value is required
+    my $value = exists $self->properties->{$id}->{string_selection} ? $event->GetString : $event->GetSelection;
+    $value = $self->properties->{$id}->{pre_process}->( $value ) if exists
+        $self->properties->{$id}->{pre_process};    
+    # change the property value. use the index selection
+    $self->properties->{$id}->{selection}->(
+        $value
     ) if exists $self->properties->{$id}->{selection};
 
-    # exec the callback
-    $self->properties->{$id}->{frame_callback}->() if exists
-        $self->properties->{$id}->{frame_callback};	
-	
+    # change the property value. use the string
+    $self->properties->{$id}->{string_selection}->(
+        $value
+    ) if exists $self->properties->{$id}->{string_selection};
+
+    # exec the callback
+    $self->properties->{$id}->{frame_callback}->($self, $ctrl, $event) if exists
+        $self->properties->{$id}->{frame_callback};    
+    
+    $event->Skip;
 }
 
 sub OnDatePicker {
     my ( $self, $ctrl, $event ) = @_;
-	
-    my $id = $ctrl->GetId;
-
-    # change the property value
-	$self->properties->{$id}->{value}->(
+    
+    my $id = $ctrl->GetId;
+
+    # change the property value
+    $self->properties->{$id}->{value}->(
         $event->GetDate->FormatISODate
     ) if exists $self->properties->{$id}->{value};
     # exec the callback
-    $self->properties->{$id}->{frame_callback}->() if exists
-        $self->properties->{$id}->{frame_callback};	
-	
+    $self->properties->{$id}->{frame_callback}->($self, $ctrl, $event) if exists
+        $self->properties->{$id}->{frame_callback};    
+    
+    $event->Skip;
 }
 
 
 my $change_value = {
+    'Wx::SpinCtrl' => sub { my ($ctrl, $value ) = @_; $ctrl->SetValue($value)},
     'Wx::TextCtrl' => sub { my ($ctrl, $value ) = @_; $ctrl->ChangeValue($value)},
     'Wx::CheckBox' => sub { my ($ctrl, $value ) = @_; $ctrl->SetValue($value)},
     'Wx::DatePickerCtrl' => sub { my ($ctrl, $value ) = @_;
-                                  my $date = Wx::DateTime->new;	
+                                  my $date = Wx::DateTime->new;    
                                   my ($yyyy, $mm, $dd, $hh, $mi, $ss ) = split(/[:\/\\\-\.\s]/, $value);
-								  $date->ParseDate(
-								      sprintf("%s/%s/%s", $yyyy, $mm, $dd)
-								  );
-	                              $ctrl->SetValue($date);
-	                            },
-};	
+                                  $date->ParseDate(
+                                    sprintf("%s/%s/%s", $yyyy, $mm, $dd)
+                                  );
+                                  $ctrl->SetValue($date);
+                                },
+};
 
 my $clear_value = {
@@ -98,47 +154,57 @@
     'Wx::CheckBox' => sub { my ($ctrl) = @_; $ctrl->SetValue(0)},
     'Wx::DatePickerCtrl' => sub { my ($ctrl) = @_; $ctrl->SetValue(Wx::DateTime->new->SetToCurrent)},
-};	
+};    
 
 sub SetProperties {
     my ( $self ) = @_;
-	
-	map {
-        my $ctrl =$self->FindWindow($_);
-        if(defined $ctrl){
- 	        # checkbox, static text
+    
+    map {
+        my $ctrl =$self->FindWindow($_);
+        if(defined $ctrl){
+            # checkbox, static text
             $change_value->{ref $ctrl}->(
-		        $ctrl,
+                $ctrl,
                 $self->properties->{$_}->{value}->()
-		    ) if exists $self->properties->{$_}->{value};
-		    # only works for control with items
-		    $ctrl->SetSelection(
-		        $self->properties->{$_}->{selection}->()			
-		    ) if exists $self->properties->{$_}->{selection};
-		}
-    }
-	keys %{$self->properties};
+            ) if exists $self->properties->{$_}->{value};
+            # only works for control with items
+            $ctrl->SetSelection(
+                $self->properties->{$_}->{selection}->()
+            ) if exists $self->properties->{$_}->{selection};
+
+            $ctrl->SetStringSelection(
+                gettext(
+                    $self->properties->{$_}->{string_selection}->()
+                )
+            ) if exists $self->properties->{$_}->{string_selection};
+        }
+    }
+    keys %{$self->properties};
 }
 
 sub InitLabels {
     my ( $self ) = @_;
-	
-	map {
-        my $ctrl =$self->FindWindow($_);
-        #printf("ctrl %s : %s\n", $_, $ctrl);		
-        if(defined $ctrl){
-  	        # checkbox, static text
-		    $ctrl->SetLabel(
+    
+    map {
+        my $ctrl =$self->FindWindow($_)||$self->{$_};
+        #printf("ctrl %s : %s\n", $_, $ctrl);        
+        if(defined $ctrl){
+            # checkbox, static text
+            $ctrl->SetLabel(
                $self->properties->{$_}->{label}
-		    ) if exists $self->properties->{$_}->{label};
-		
+            ) if exists $self->properties->{$_}->{label};
+
+            $ctrl->GetStaticBox->SetLabel(
+                $self->properties->{$_}->{staticbox_label}
+            ) if exists $self->properties->{$_}->{staticbox_label};
+        
             # radiobox
             my $labels =$self->properties->{$_}->{labels};
-		    $labels||=[];
-		    for(my $i=0; $i < scalar @$labels ; $i++){
-		        $ctrl->SetItemLabel($i, $labels->[$i]);
-		    }
-		}
-    }
-	keys %{$self->properties};
+            $labels||=[];
+            for(my $i=0; $i < scalar @$labels ; $i++){
+                $ctrl->SetItemLabel($i, $labels->[$i]);
+            }
+        }
+    }
+    keys %{$self->properties};
 
 }
@@ -147,17 +213,17 @@
     my ( $self ) = @_;
 
-		map {
-        my $ctrl =$self->FindWindow($_);
-        #printf("ctrl %s : %s\n", $_, $ctrl);		
+        map {
+        my $ctrl =$self->FindWindow($_);
+        #printf("ctrl %s : %s\n", $_, $ctrl);        
         if(defined $ctrl){
             # choice
             my $choices =$self->properties->{$_}->{choices};
-		    $choices||=[];
-		    map{
-		        $ctrl->Append($_);
-		    }@$choices;
-		}
-    }
-	keys %{$self->properties};
+            $choices||=[];
+            map{
+                $ctrl->Append($_);
+            }@$choices;
+        }
+    }
+    keys %{$self->properties};
 
 }
@@ -166,38 +232,46 @@
     my ( $self ) = @_;
 
-	map {
+    map {
         my $ctrl = $self->FindWindow($_);
-        #printf("ctrl %s : %s\n", $_, $ctrl);		
-        if(defined $ctrl){
-		# checkbox, static text
+        #printf("ctrl %s : %s\n", $_, $ctrl);        
+        if(defined $ctrl){
+        # checkbox, static text
             $self->properties->{$_}->{value}->(
                 $ctrl->GetValue()
-		    ) if exists $self->properties->{$_}->{value};
+            ) if exists $self->properties->{$_}->{value};
 
             $self->properties->{$_}->{selection}->(
-		        $ctrl->GetSelection()			
-		    ) if exists $self->properties->{$_}->{selection};
-		}
-    }
-	keys %{$self->properties};
+                $ctrl->GetSelection()            
+            ) if exists $self->properties->{$_}->{selection};
+
+            $self->properties->{$_}->{string_selection}->(
+                $ctrl->GetStringSelection()            
+            ) if exists $self->properties->{$_}->{string_selection};
+        }
+    }
+    keys %{$self->properties};
 }
 
 sub ClearProperties {
     my ( $self ) = @_;
-	
-	map {
-        my $ctrl =$self->FindWindow($_);
-        if(defined $ctrl){
- 	        # checkbox, static text
+    
+    map {
+        my $ctrl =$self->FindWindow($_);
+        if(defined $ctrl){
+             # checkbox, static text
             $clear_value->{ref $ctrl}->(
-		        $ctrl
-		    ) if exists  $clear_value->{ref $ctrl};
-		    # only works for control with items
-		    $ctrl->SetSelection(
-		        -1			
-		    ) if exists $self->properties->{$_}->{selection};
-		}
-    }
-	keys %{$self->properties};
+                $ctrl
+            ) if exists  $clear_value->{ref $ctrl};
+            # only works for control with items
+            $ctrl->SetSelection(
+                -1            
+            ) if exists $self->properties->{$_}->{selection};
+        }
+
+            $ctrl->SetStringSelection(
+                -1            
+            ) if exists $self->properties->{$_}->{string_selection};
+    }
+    keys %{$self->properties};
 
 }
Index: /extensions/pLoader/trunk/src/Uploader/GUI/wxApp.pm
===================================================================
--- /extensions/pLoader/trunk/src/Uploader/GUI/wxApp.pm	(revision 4568)
+++ /extensions/pLoader/trunk/src/Uploader/GUI/wxApp.pm	(revision 4569)
@@ -109,8 +109,8 @@
           default_photo_names
           eng_default_photo_names
-		  upload_hd
-		  eng_upload_hd
-		  privacy_level
-		  user_defined_properties
+          upload_hd
+          eng_upload_hd
+          privacy_level
+          user_defined_properties
       / 
 );
@@ -129,5 +129,5 @@
     
     $self->version(
-        '2.0.5C'
+        '2.0.7a'
     );
     
@@ -495,4 +495,6 @@
     );
 
+    $self->imagelist->SetCurrentImage(-1);
+
     $self->imagelist->RescaleCallback(
         sub { $self->RescaleImage(@_) }
@@ -513,5 +515,5 @@
 
     my $params = {
-    	new_files        => [],
+        new_files        => [],
         hd_filter        => $self->user_defined_properties->{hd_filter}||'Lanczos',
         hd_blur          => $self->user_defined_properties->{hd_blur}||0.9,
@@ -520,24 +522,24 @@
         hd_h             => $self->user_defined_properties->{hd_h}||1200,
         hd_interlace     => $self->user_defined_properties->{hd_interlace}||'Line',
-       	thumb_size       => $self->user_defined_properties->{thumbnail_size}||120,
+        thumb_size       => $self->user_defined_properties->{thumbnail_size}||120,
         site_thumb_dir   => $self->thumb_dir,
-       	wx_thumb_size    => $self->user_defined_properties->{wx_thumbnail_size}||100,
+        wx_thumb_size    => $self->user_defined_properties->{wx_thumbnail_size}||100,
         wx_thumb_dir     => $self->wx_thumb_dir,
         resize_w         => $self->user_defined_properties->{resize_w}||800,
         resize_h         => $self->user_defined_properties->{resize_h}||600,
         site_resized_dir => $self->resized_dir,
-      	type             => 'jpg',
-      	filter           => $self->user_defined_properties->{resize_filter}||'Lanczos',
-      	blur             => $self->user_defined_properties->{resize_blur}||0.9,
-      	quality          => $self->user_defined_properties->{resize_quality}||95,
-      	wx_quality       => $self->user_defined_properties->{wx_thumbnail_quality}||90,
-      	th_quality       => $self->user_defined_properties->{thumbnail_quality}||90,
+        type             => 'jpg',
+        filter           => $self->user_defined_properties->{resize_filter}||'Lanczos',
+        blur             => $self->user_defined_properties->{resize_blur}||0.9,
+        quality          => $self->user_defined_properties->{resize_quality}||95,
+        wx_quality       => $self->user_defined_properties->{wx_thumbnail_quality}||90,
+        th_quality       => $self->user_defined_properties->{thumbnail_quality}||90,
         auto_rotate      => $self->user_defined_properties->{auto_rotate}||1,
-		upload_hd        => $self->user_defined_properties->{upload_hd}||'No',
+        upload_hd        => $self->user_defined_properties->{upload_hd}||'No',
         remove_uploaded_from_selection => $self->user_defined_properties->{remove_uploaded_from_selection}||1,
         interlace        => $self->user_defined_properties->{resize_interlace}||'Line',
         create_resized   => $self->user_defined_properties->{create_resized}||1,
-      	prefix           => 'TN',
-      	count            => 0,
+        prefix           => 'TN',
+        count            => 0,
         storable_file    => $self->storable_file,
         userdata_dir     => $self->userdata_dir,
@@ -557,8 +559,8 @@
         watermark_x => $self->user_defined_properties->{watermark_x}||10,
         watermark_color => $self->user_defined_properties->{watermark_color}||'White',
-		reupload_action_files => 1,
-		reupload_action_properties => 2,
-		reupload_action_properties_m => 1,
-		display_mode => $self->user_defined_properties->{display_mode}||'Thumbnail and caption'
+        reupload_action_files => 1,
+        reupload_action_properties => 2,
+        reupload_action_properties_m => 1,
+        display_mode => $self->user_defined_properties->{display_mode}||'Thumbnail and caption',
     };
 
Index: /extensions/pLoader/trunk/src/Uploader/GUI/wxFrameAUI.pm
===================================================================
--- /extensions/pLoader/trunk/src/Uploader/GUI/wxFrameAUI.pm	(revision 4568)
+++ /extensions/pLoader/trunk/src/Uploader/GUI/wxFrameAUI.pm	(revision 4569)
@@ -1,3 +1,3 @@
-﻿# +-----------------------------------------------------------------------+
+# +-----------------------------------------------------------------------+
 # | pLoader - a Perl photo uploader for Piwigo                            |
 # +-----------------------------------------------------------------------+
@@ -36,5 +36,5 @@
              wxBITMAP_TYPE_GIF
              wxBITMAP_TYPE_PNG
-			 wxBITMAP_TYPE_ANY
+             wxBITMAP_TYPE_ANY
              wxTB_FLAT
              wxSIZE
@@ -70,4 +70,6 @@
              wxICON_INFORMATION
              WXK_DELETE
+             wxHORIZONTAL
+             wxVERTICAL
          /;
 use base qw/Wx::Frame Class::Accessor::Fast/;
@@ -84,5 +86,5 @@
           upload_progressdlg
           imageviewer
-		  imageviewer_img
+          imageviewer_img
           tree
           tree_root
@@ -104,18 +106,8 @@
           notebook_image_properties
           notebook_global_settings
-          general_settings_panel
-          resized_settings_panel
-          thumbnail_settings_panel
-		  hd_settings_panel
-          advanced_settings_panel
-          watermark_settings_panel
-          piwigo_properties
+          global_settings_panel
+          piwigo_property_list
           exif_properties
-          general_settings
-          resized_settings
-          thumbnail_settings
-		  hd_settings
-          advanced_settings
-          watermark_settings
+          global_settings
           toolbar
           branding
@@ -128,10 +120,10 @@
           piwigo_tags
           image_tags
-		  piwigo_photo_properties
-		  dlg_piwigo_photo_properties
-		  piwigo_photo_properties_tags
-		  image_preview_refresh
-		  imageviewer_refresh
-		  imageviewer_item_refresh
+          piwigo_photo_properties
+          dlg_piwigo_photo_properties
+          piwigo_photo_properties_tags
+          image_preview_refresh
+          imageviewer_refresh
+          imageviewer_item_refresh
       /;
 __PACKAGE__->mk_accessors( @properties );
@@ -140,4 +132,5 @@
     qw/
           EVT_MENU
+          EVT_BUTTON
           EVT_TREE_SEL_CHANGED
           EVT_TREE_END_LABEL_EDIT
@@ -149,7 +142,7 @@
           EVT_TREE_ITEM_RIGHT_CLICK
           EVT_LIST_KEY_DOWN
-          EVT_UPDATE_UI       
       /;
       
+use Wx::Perl::TextValidator;
 use Uploader::GUI::wxImageListCtrl;
 use Uploader::GUI::wxImageProcessingProgressDlg;
@@ -164,4 +157,5 @@
 use Uploader::GUI::wxPropertyGridPanel;
 use Uploader::GUI::wxPhotoProperties;
+use Uploader::GUI::wxGlobalSettings;
 use utf8;
 $|=1;
@@ -171,13 +165,13 @@
 
 sub new {
-  my( $class, $params ) = @_;
-  my( $self ) = $class->SUPER::new( 
-                                      undef, 
-                                      -1, 
-                                      $params->{title},
-                                      wxDefaultPosition,
-                                      wxDefaultSize, 
-                                      wxDEFAULT_FRAME_STYLE
-                                   );
+    my( $class, $params ) = @_;
+    my( $self ) = $class->SUPER::new( 
+        undef, 
+        -1, 
+        $params->{title},
+        wxDefaultPosition,
+        wxDefaultSize, 
+        wxDEFAULT_FRAME_STYLE
+    );
 
     $self->perspective(
@@ -211,54 +205,58 @@
     );
 
-
     # callback for GUI refresh : remove thumbnail images from imageviewer control
     $self->imagelist->UploadImagesViewerCallback(
         sub { $self->UploadImagesViewerRefresh(@_) }
     );
-	
-	$self->imagelist->ReuploadCallback(
-	    sub {
-		    Uploader::GUI::wxImageReuploadDlg->new(
-            { 
-				title      => gettext("Photo update management"),
-                properties => {
-                    		        $main::ID_REUPLOAD_ACTION_FILES        => { 
-									                                            selection=>sub {$self->imagelist->reupload_action_files(@_)},
-																				label=>gettext("What shall we do with files? (thumbnail, resized, high resolution)"),
-                                                                                labels=>[
-																				           gettext("nothing"),
-																				           gettext("replace"),
-																				       ],																				
-								                                            },
-								    $main::ID_REUPLOAD_ACTION_PROPERTIES   => { 
-									                                            selection=>sub{$self->imagelist->reupload_action_properties(@_)},
-																				label=>gettext("What shall we do with single value properties?(caption, comment, author, create date)"),
-                                                                                labels=>[
-																				           gettext("nothing"),
-																				           gettext("fill if empty (only replace properties currently empty in Piwigo)"),
-																				           gettext("replace"),
-																				       ],																				
-									                                          },
-									$main::ID_REUPLOAD_ACTION_PROPERTIES_M => { 
-									                                            selection=>sub{$self->imagelist->reupload_action_properties_m(@_)},
-																				label=>gettext("What shall we do with multiple values properties? (categories, tags)"),
-                                                                                labels=>[
-																				           gettext("nothing"),
-																				           gettext("append (keep existing and add new)"),
-																				           gettext("replace"),
-																				       ],																				
-									                                          },
-									$main::ID_REUPLOAD_NOT_ASK             => { 
-									                                            value=>sub{$self->imagelist->reupload_not_ask(@_)}, 
-                                                                                label=>gettext("Do not ask me again"),																				
-									                                          },
-									$main::ID_REUPLOAD_TEXT                => { 
-                                                                                label=>gettext("A least one photo has already been added in the past."),																				
-									                                          },
-				                },
-            }
-			)->ShowModal();
-		}
-	);
+    
+    $self->imagelist->ReuploadCallback(
+    sub 
+    {
+        Uploader::GUI::wxImageReuploadDlg->new(
+        { 
+            title => gettext("Photo update management"),
+            properties => 
+            {
+                $main::ID_REUPLOAD_ACTION_FILES => 
+                {
+                    selection=>sub {$self->imagelist->reupload_action_files(@_)},
+                    label=>gettext("What shall we do with files? (thumbnail, resized, high resolution)"),
+                    labels=>[
+                        gettext("nothing"),
+                        gettext("replace"),
+                    ],
+                },
+                $main::ID_REUPLOAD_ACTION_PROPERTIES => 
+                { 
+                    selection=>sub{$self->imagelist->reupload_action_properties(@_)},
+                    label=>gettext("What shall we do with single value properties?(caption, comment, author, create date)"),
+                    labels=>[
+                        gettext("nothing"),
+                        gettext("fill if empty (only replace properties currently empty in Piwigo)"),
+                        gettext("replace"),
+                    ],
+                },
+                $main::ID_REUPLOAD_ACTION_PROPERTIES_M =>
+                { 
+                    selection=>sub{$self->imagelist->reupload_action_properties_m(@_)},
+                    label=>gettext("What shall we do with multiple values properties? (categories, tags)"),
+                    labels=>[
+                        gettext("nothing"),
+                        gettext("append (keep existing and add new)"),
+                        gettext("replace"),
+                    ],
+                },
+                $main::ID_REUPLOAD_NOT_ASK => 
+                { 
+                    value=>sub{$self->imagelist->reupload_not_ask(@_)}, 
+                    label=>gettext("Do not ask me again"),
+                },
+                $main::ID_REUPLOAD_TEXT => 
+                { 
+                    label=>gettext("A least one photo has already been added in the past."),
+                },
+            },
+        } )->ShowModal();}
+    );
 
 
@@ -302,29 +300,30 @@
     $self->_initImgTypes;   
 
-	# only refresh when calling event is finished
-	Wx::Event::EVT_UPDATE_UI(
-	    $self,
-	    $self,
-		sub {
+    # only refresh when calling event is finished
+    Wx::Event::EVT_IDLE(
+        $self,
+        sub {
             my ( $self, $event ) = @_;
-    		if ( $self->image_preview_refresh and $self->image_preview->IsShown ){
-                $self->_image_preview_refresh; 
+            if ( $self->image_preview_refresh and $self->image_preview->IsShown ){
+                $self->set_preview_image; 
                 $self->image_preview->Refresh;
-				$self->image_preview_refresh(0);
-		    }
-			
-			if($self->imageviewer_refresh){
-			    $self->imageviewer->Refresh;
-				$self->imageviewer_refresh(0);
-			}
-
-			if($self->imageviewer_item_refresh){
-			    $self->imageviewer->ItemRefresh(
-				    $self->current_imageviewer_index
-				);
-				$self->imageviewer_item_refresh(0);
-			}
-		},
-	);
+                $self->image_preview_refresh(0);
+            }
+
+            if($self->imageviewer_refresh){
+                $self->imageviewer->Refresh;
+                $self->imageviewer_refresh(0);
+            }
+
+            if($self->imageviewer_item_refresh){
+                $self->imageviewer->ItemRefresh(
+                    $self->current_imageviewer_index
+                );
+                $self->imageviewer_item_refresh(0);
+            }
+            $self->OnUpdateToolbar;
+            $event->Skip;
+        }
+    );
 
     $self->imageviewer->SelectItem(
@@ -340,7 +339,7 @@
 
     $self->{IMGTYPE} = {
-             'jpg' => wxBITMAP_TYPE_JPEG,
-             'gif' => wxBITMAP_TYPE_GIF,
-             'png' => wxBITMAP_TYPE_PNG,
+        'jpg' => wxBITMAP_TYPE_JPEG,
+        'gif' => wxBITMAP_TYPE_GIF,
+        'png' => wxBITMAP_TYPE_PNG,
     };
 }
@@ -360,58 +359,239 @@
     $self->piwigo_photo_properties(
         {
-		    $main::CAPTION => { label=>gettext("Photo caption :")},
-			$main::PHOTO_PROPERTIES_CAPTION => { 
-			                                       value => sub { $self->imagelist->current_image->site_name(@_) },
-												   frame_callback => sub { $self->imageviewer_item_refresh(1); },
-			                                   },
-		    $main::COMMENT => { label=>gettext("Comment :")},
-			$main::PHOTO_PROPERTIES_COMMENT => { 
-			                                       value => sub { $self->imagelist->current_image->site_comment(@_) },
-												   frame_callback => sub { $self->imageviewer_item_refresh(1); },
-			                                   },
-		    $main::AUTHOR => { label=>gettext("Author :")},
-			$main::PHOTO_PROPERTIES_AUTHOR => { 
-			                                       value => sub { $self->imagelist->current_image->site_author(@_) },
-												   frame_callback => sub { $self->imageviewer_item_refresh(1); },
-			                                   },
-		    $main::TAGS => { label=>gettext("Tags :")},
-		    $main::CREATE_DATE => { label=>gettext("Create date :")},
-			$main::PHOTO_PROPERTIES_CREATE_DATE => { 
-			                                       value => sub { $self->imagelist->current_image->create_date(@_) },
-												   frame_callback => sub { $self->imageviewer_item_refresh(1); },
-			                                   },
-		    $main::PRIVACY_LEVEL => { label=>gettext("Who can see the photo?")},
-			$main::PHOTO_PROPERTIES_PRIVACY_LEVEL => {
-                                                         selection => sub { $self->imagelist->current_image->privacy_level(@_)},
-                                                         choices => wxTheApp->privacy_level_choices,														           ,														 
-			                                         },
-		}
-    );	
-
-    $self->piwigo_properties(
+            $main::CAPTION => { label=>gettext("Photo caption")},
+            $main::PHOTO_PROPERTIES_CAPTION => { 
+                value => sub { $self->imagelist->current_image->site_name(@_) },
+                frame_callback => sub { $self->imageviewer_item_refresh(1); },
+            },
+            $main::COMMENT => { label=>gettext("Comment")},
+            $main::PHOTO_PROPERTIES_COMMENT => { 
+                value => sub { $self->imagelist->current_image->site_comment(@_) },
+                frame_callback => sub { $self->imageviewer_item_refresh(1); },
+            },
+            $main::AUTHOR => { label=>gettext("Author")},
+            $main::PHOTO_PROPERTIES_AUTHOR => { 
+                value => sub { $self->imagelist->current_image->site_author(@_) },
+                frame_callback => sub { $self->imageviewer_item_refresh(1); },
+            },
+            $main::TAGS => { label=>gettext("Tags")},
+            $main::CREATE_DATE => { label=>gettext("Create date")},
+            $main::PHOTO_PROPERTIES_CREATE_DATE => { 
+                value => sub { $self->imagelist->current_image->create_date(@_) },
+                frame_callback => sub { $self->imageviewer_item_refresh(1); },
+            },
+            $main::PRIVACY_LEVEL => { label=>gettext("Who can see the photo?")},
+            $main::PHOTO_PROPERTIES_PRIVACY_LEVEL => {
+                selection => sub { $self->imagelist->current_image->privacy_level(@_)},
+                choices => wxTheApp->privacy_level_choices,
+            }
+        }
+    );    
+
+    $self->global_settings(
+        {
+            $main::DEFAULT_PHOTO_CAPTION => { label => gettext("Default photo caption") },
+            $main::CPANE_RESIZE_ADVANCED => { label => gettext("Advanced") },
+            $main::CPANE_HD_ADVANCED => { label => gettext("Advanced") },
+            $main::CPANE_TRANSFERT_ADVANCED => { label => gettext("Advanced") },
+            sb_photo_properties => { staticbox_label => gettext("Photo properties") },
+            sb_web_sized_photo => { staticbox_label => gettext("Web sized") },
+            sb_high_definition_photo => { staticbox_label => gettext("High definition") },
+            sb_watermark => { staticbox_label => gettext("Watermark") },
+            sb_transfert => { staticbox_label => gettext("Transfert") },
+            $main::GS_CLOSE => { label => gettext("Close")},
+            $main::GS_DEFAULT_PHOTO_CAPTION => {
+                string_selection => sub { $self->imagelist->default_photo_name(@_) },
+                choices =>
+                [
+                    map { gettext $_ } @{wxTheApp->default_photo_names}
+                ],
+                pre_process => sub { my ( $value ) = @_; wxTheApp->eng_default_photo_names->{$value} },
+                frame_callback => sub { 
+                    my( $self, $ctrl, $event ) = @_; 
+                    $self->OnDefaultPhotoCaption($event);
+                },
+            },
+            $main::PHOTO_CAPTION_PREFIX => { label => gettext("Photo caption  prefix") },
+            $main::GS_PHOTO_CAPTION_PREFIX => {
+                value => sub { $self->imagelist->default_name_prefix(@_) },
+            },
+            $main::GS_AUTO_ROTATE => {
+                label => gettext("Auto rotate image"),
+                value => sub { $self->imagelist->auto_rotate(@_) }
+           },
+            $main::DEFAULT_AUTHOR => { label => gettext("Default author")},
+            $main::GS_DEFAULT_AUTHOR => { value => sub { $self->imagelist->author(@_) } },
+            $main::GS_CREATE_RESIZED => {
+                selection => sub { $self->imagelist->create_resized(@_) },
+                choices =>
+                [
+                    map { gettext $_ } ( "Use resized original", "Use original" ) 
+                ],
+                frame_callback => sub { 
+                    my( $dlg, $ctrl, $event ) = @_;
+                    $dlg->OnCreateResized($event);
+                },
+            },
+            $main::SITE_IMG_WIDTH => { label => gettext("Site image width") },
+            $main::GS_SITE_IMG_WIDTH => {
+                value => sub { $self->imagelist->resize_w(@_) },
+                validator => Wx::Perl::TextValidator->new( '\d' ) 
+            },
+            $main::SITE_IMG_HEIGHT => { label => gettext("Site image height") },
+            $main::GS_SITE_IMG_HEIGHT => {
+                value => sub { $self->imagelist->resize_h(@_) },
+                validator => Wx::Perl::TextValidator->new( '\d' ) 
+            },
+            $main::SITE_IMG_JPEG_QUALITY => { label => gettext("Site image jpeg quality") },
+            $main::GS_SITE_IMG_JPEG_QUALITY => {
+                value => sub { $self->imagelist->quality(@_) },
+                validator => Wx::Perl::TextValidator->new( '\d' ) 
+            },
+            $main::SITE_IMG_FILTER => { label => gettext("Site image filter") },
+            $main::GS_SITE_IMG_FILTER => {
+                selection =>  sub { $self->imagelist->filter(@_) },
+                choices =>
+                [
+                    qw/Point Box Triangle Hermite Hanning Hamming Blackman Gaussian Quadratic Cubic Catrom Mitchell Lanczos Bessel Sinc/  
+                ],
+            },
+            $main::SITE_IMG_BLUR => { label => gettext("Site image blur") },
+            $main::GS_SITE_IMG_BLUR => {
+                value => sub { $self->imagelist->blur(@_) },
+                validator => Wx::Perl::TextValidator->new( '\d' ) 
+            },
+            $main::SITE_IMG_INTERLACE => { label => gettext("Site image interlace") },
+            $main::GS_SITE_IMG_INTERLACE => {
+                selection => sub { $self->imagelist->interlace(@_) },
+                choices =>
+                [
+                    qw/None Line Plane Partition JPEG GIF PNG/  
+                ],
+            },
+            $main::GS_REMOVE_UPLOADED_FROM_SELECTION => {
+                label => gettext("Remove uploaded photo from selection"),
+                value => sub { $self->imagelist->remove_uploaded_from_selection(@_) },
+            },
+            $main::GS_HD_UPLOAD => {
+                choices  =>
+                [
+                    map { gettext $_ } @{wxTheApp->upload_hd}
+                ],
+                pre_process => sub { my ( $value ) = @_; wxTheApp->eng_upload_hd->{$value} },
+                string_selection => sub { $self->imagelist->upload_hd(@_) },
+                frame_callback => sub { 
+                    my( $self, $ctrl, $event ) = @_; 
+                    $self->OnHDUpload($event);
+                },
+            },
+            $main::HD_IMG_WIDTH => { label => gettext("HD image width") },
+            $main::GS_HD_IMG_WIDTH => {
+                label => gettext("HD image width"),
+                value => sub { $self->imagelist->hd_w(@_) },
+                validator => Wx::Perl::TextValidator->new( '\d' ) 
+            },
+            $main::HD_IMG_HEIGHT => { label => gettext("HD image height") },
+            $main::GS_HD_IMG_HEIGHT => {
+                label => gettext("HD image height"),
+                value => sub { $self->imagelist->hd_h(@_) },
+                validator => Wx::Perl::TextValidator->new( '\d' ) 
+            },
+            $main::HD_IMG_JPEG_QUALITY => { label => gettext("HD image jpeg quality") },
+            $main::GS_HD_IMG_JPEG_QUALITY => {
+                value => sub { $self->imagelist->hd_quality(@_) },
+                validator => Wx::Perl::TextValidator->new( '\d' ) 
+            },
+            $main::HD_IMG_FILTER => { label => gettext("HD image filter") },
+            $main::GS_HD_IMG_FILTER => {
+                selection =>  sub { $self->imagelist->hd_filter(@_) },
+                choices =>
+                [
+                    qw/Point Box Triangle Hermite Hanning Hamming Blackman Gaussian Quadratic Cubic Catrom Mitchell Lanczos Bessel Sinc/  
+                ],
+            },
+            $main::HD_IMG_BLUR => { label => gettext("HD image blur") },
+            $main::GS_HD_IMG_BLUR => {
+                value => sub { $self->imagelist->hd_blur(@_) },
+                validator => Wx::Perl::TextValidator->new( '\d' ) 
+            },
+            $main::HD_IMG_INTERLACE => { label => gettext("HD image interlace") },
+            $main::GS_HD_IMG_INTERLACE => {
+                selection => sub { $self->imagelist->hd_interlace(@_) },
+                choices =>
+                [
+                    qw/None Line Plane Partition JPEG GIF PNG/  
+                ],
+            },
+            $main::GS_WMARK_ACTIVATE => {
+              label  => gettext("Activate watermark"),
+              value  => sub { $self->imagelist->watermark_activate(@_) },
+              frame_callback => sub { 
+                  my( $self, $ctrl, $event ) = @_; 
+                  $self->OnWatermark($event);
+              },
+            },
+            $main::GS_WMARK_ACTIVATE_HD => {
+              label => gettext("Activate watermark on high definition"),
+              value => sub { $self->imagelist->watermark_activate_pwg_high(@_) },
+              frame_callback => sub { 
+                  my( $self, $ctrl, $event ) = @_; 
+                  $self->OnWatermark($event);
+              },
+            },
+            $main::WMARK_TEXT => { label  => gettext("Text") },
+            $main::GS_WMARK_TEXT => { 
+              value  => sub { $self->imagelist->watermark_text(@_) },
+            },
+            $main::WMARK_TEXT_SIZE => { label     => gettext("Text size") },
+            $main::GS_WMARK_TEXT_SIZE => {
+                value   => sub { $self->imagelist->watermark_text_size(@_) },
+            },
+            $main::WMARK_COLOR => { label     => gettext("Color") },
+            $main::GS_WMARK_COLOR => {
+                selection => sub { $self->imagelist->watermark_color(@_) },
+                choices   => [
+                               map { gettext $_ } @{wxTheApp->colors}
+                             ],
+                pre_process => sub { my ( $value ) = @_; wxTheApp->eng_colors->{$value} },
+            },
+            $main::WMARK_POSITION => { label     => gettext("Position") },
+            $main::GS_WMARK_POSITION => {
+                selection => sub { $self->imagelist->watermark_position(@_) },
+                choices  => [
+                               map { gettext $_ } @{wxTheApp->positions}
+                           ],
+                pre_process => sub { my ( $value ) = @_; wxTheApp->eng_positions->{$value} },
+            },
+            $main::WMARK_MARGIN_TOP => { label => gettext("Top margin") },
+            $main::GS_WMARK_MARGIN_TOP => {
+                value   => sub { $self->imagelist->watermark_y(@_) },
+            },
+            $main::WMARK_MARGIN_LEFT => { label => gettext("Left margin") },
+            $main::GS_WMARK_MARGIN_LEFT => {
+                value   => sub { $self->imagelist->watermark_x(@_) },
+            },
+            $main::CHUNK_SIZE => { label => gettext("Transfert chunk size") },
+            $main::GS_CHUNK_SIZE => {
+                value	=> sub { wxTheApp->chunk_size(@_) },
+            },
+        }    
+    );
+
+    $self->piwigo_property_list(
         [
             {
-                label          => gettext("Photo caption :"),
-                value          => sub { $self->imagelist->current_image->site_name(@_) },
-                frame_callback => sub { $self->imageviewer_item_refresh(1) },
+                label => gettext("Photo caption"),
             },
             {
-                label => gettext("Comment :"),
-                value => sub { $self->imagelist->current_image->site_comment(@_) },
-                type  => "LongText",
+                label => gettext("Comment"),
             },
             {
-                label => gettext("Author :"),
-                value => sub { $self->imagelist->current_image->site_author(@_) },
+                label => gettext("Author"),
             },
             {
-                label    => gettext("File name :"),
-                value    => sub { $self->imagelist->current_image->file(@_) },
-                readonly => 1,
+                label => gettext("File name"),
             },
             {
-                label    => gettext("Create date :"),
-                value    => sub { $self->imagelist->current_image->create_date(@_) },
-                readonly => 1,
+                label => gettext("Create date"),
             },
         ]    
@@ -421,265 +601,56 @@
         [
             {
-                label    => gettext("Create date :"),
+                label    => gettext("Create date"),
                 value    => sub { $self->imagelist->current_image->create_date }, 
                 readonly => 1,
-            },	
+            },    
             {
-                label    => gettext("Model :"),
+                label    => gettext("Model"),
                 value    => sub { $self->imagelist->current_image->exif_tag('Model') }, 
                 readonly => 1,
-            },	
+            },    
             {
-                label    => gettext("Width :"),
+                label    => gettext("Width"),
                 value    => sub { $self->imagelist->current_image->exif_tag('ImageWidth') }, 
                 readonly => 1,
-            },	
+            },    
             {
-                label    => gettext("Height :"),
+                label    => gettext("Height"),
                 value    => sub { $self->imagelist->current_image->exif_tag('ImageHeight') }, 
                 readonly => 1,
-            },	
+            },    
             {
-                label    => gettext("Orientation :"),
+                label    => gettext("Orientation"),
                 value    => sub { $self->imagelist->current_image->exif_tag('Orientation') }, 
                 readonly => 1,
-            },	
+            },    
             {
-                label    => "ISO :",
+                label    => "ISO",
                 value    => sub { $self->imagelist->current_image->exif_tag('ISO') }, 
                 readonly => 1,
-            },	
+            },    
             {
-                label    => gettext("Shutter speed :"),
+                label    => gettext("Shutter speed"),
                 value    => sub { $self->imagelist->current_image->exif_tag('ExposureTime') }, 
                 readonly => 1,
-            },	
+            },    
             {
-                label    => gettext("Aperture :"),
+                label    => gettext("Aperture"),
                 value    => sub { $self->imagelist->current_image->exif_tag('ApertureValue') }, 
                 readonly => 1,
-            },	
+            },    
             {
-                label    => gettext("Focal length :"),
+                label    => gettext("Focal length"),
                 value    => sub { $self->imagelist->current_image->exif_tag('FocalLength') }, 
                 readonly => 1,
-            },	
+            },    
             {
-                label    => gettext("Lens :"),
+                label    => gettext("Lens"),
                 value    => sub { $self->imagelist->current_image->exif_tag('Lens') }, 
                 readonly => 1,
-            },	
+            },    
         ]
     );   
 
-
-    $self->general_settings(
-        [
-            {
-                label     => gettext("Default author :"),
-                value	=> sub { $self->imagelist->author(@_) },
-            },
-            {
-                label     => gettext("Default photo caption :"),
-                type      => 'Choice',
-                value	=> sub { $self->imagelist->default_photo_name(@_) },
-                choice  => [
-                               map { gettext $_ } @{wxTheApp->default_photo_names}
-                           ],
-                pre_process => sub { my ( $value ) = @_; wxTheApp->eng_default_photo_names->{$value} },
-            },
-            {
-                label     => gettext("Photo caption  prefix :"),
-                value	=> sub { $self->imagelist->default_name_prefix(@_) },
-            },
-            {
-                label     => gettext("Resize site image :"),
-                type      => 'Bool',
-                value	=> sub { $self->imagelist->create_resized(@_) },
-            },
-            {
-                label     => gettext("Auto rotate image :"),
-                type      => 'Bool',
-                value	=> sub { $self->imagelist->auto_rotate(@_) },
-            },
-            {
-                label     => gettext("Upload high definition  :"),
-                type      => 'Choice',
-                choice  => [
-                               map { gettext $_ } @{wxTheApp->upload_hd}
-                           ],
-                pre_process => sub { my ( $value ) = @_; wxTheApp->eng_upload_hd->{$value} },
-                value	=> sub { $self->imagelist->upload_hd(@_) },
-            },
-            {
-                label     => gettext("Remove uploaded photo from selection :"),
-                type      => 'Bool',
-                value	=> sub { $self->imagelist->remove_uploaded_from_selection(@_) },
-            },
-        ]    
-    );
-    
-    $self->resized_settings(
-        [
-            {
-                label     => gettext("Site image width :"),
-                type      => 'Number',
-                value	=> sub { $self->imagelist->resize_w(@_) },
-            },
-            {
-                label     => gettext("Site image height :"),
-                type      => 'Number',
-                value	=> sub { $self->imagelist->resize_h(@_) },
-            },
-            {
-                label     => gettext("Site image jpeg quality :"),
-                type      => 'Number',
-                value	=> sub { $self->imagelist->quality(@_) },
-            },
-            {
-                label     => gettext("Site image filter :"),
-                type      => 'Choice',
-                value	=> sub { $self->imagelist->filter(@_) },
-                choice    => [ qw/Point Box Triangle Hermite Hanning Hamming Blackman Gaussian Quadratic Cubic Catrom Mitchell Lanczos Bessel Sinc/ ],
-            },
-            {
-                label     => gettext("Site image blur :"),
-                type      => 'Float',
-                value	=> sub { $self->imagelist->blur(@_) },
-            },
-            {
-                label     => gettext("Site image interlace :"),
-                type      => 'Choice',
-                value	=> sub { $self->imagelist->interlace(@_) },
-                choice    => [ qw/None Line Plane Partition JPEG GIF PNG/ ],
-            },
-        ]    
-    );
-
-    $self->hd_settings(
-        [
-            {
-                label     => gettext("HD image width :"),
-                type      => 'Number',
-                value	=> sub { $self->imagelist->hd_w(@_) },
-            },
-            {
-                label     => gettext("HD image height :"),
-                type      => 'Number',
-                value	=> sub { $self->imagelist->hd_h(@_) },
-            },
-            {
-                label     => gettext("HD image jpeg quality :"),
-                type      => 'Number',
-                value	=> sub { $self->imagelist->hd_quality(@_) },
-            },
-            {
-                label     => gettext("HD image filter :"),
-                type      => 'Choice',
-                value	=> sub { $self->imagelist->hd_filter(@_) },
-                choice    => [ qw/Point Box Triangle Hermite Hanning Hamming Blackman Gaussian Quadratic Cubic Catrom Mitchell Lanczos Bessel Sinc/ ],
-            },
-            {
-                label     => gettext("HD image blur :"),
-                type      => 'Float',
-                value	=> sub { $self->imagelist->hd_blur(@_) },
-            },
-            {
-                label     => gettext("HD image interlace :"),
-                type      => 'Choice',
-                value	=> sub { $self->imagelist->hd_interlace(@_) },
-                choice    => [ qw/None Line Plane Partition JPEG GIF PNG/ ],
-            },
-        ]    
-    );
-	
-    $self->thumbnail_settings(
-        [
-            {
-                label     => gettext("Site thumbnail size :"),
-                type      => 'Number',
-                value	=> sub { $self->imagelist->thumb_size(@_) },
-            },
-            {
-                label     => gettext("Site thumbnail jpeg quality :"),
-                type      => 'Number',
-                value	=> sub { $self->imagelist->th_quality(@_) },
-            },
-            {
-                label     => gettext("Photo selection thumbnail size :"),
-                type      => 'Number',
-                value	=> sub { $self->imagelist->wx_thumb_size(@_) },
-            },
-            {
-                label     => gettext("Photo selection thumbnail jpeg quality :"),
-                type      => 'Number',
-                value	=> sub { $self->imagelist->wx_quality(@_) },
-            },
-        ]    
-    );
-    
-
-    $self->advanced_settings(
-        [
-            {
-                label     => gettext("Transfert chunk size :"),
-                type      => 'Number',
-                value	=> sub { wxTheApp->chunk_size(@_) },
-            },
-        ]    
-    );
-
-    $self->watermark_settings(
-        [
-            {
-              label  => gettext("Activate watermark :"),
-              type   => 'Bool',
-              value  => sub { $self->imagelist->watermark_activate(@_) },
-            },
-            {
-              label => gettext("Activate watermark on high definition :"),
-              type  => 'Bool',
-              value => sub { $self->imagelist->watermark_activate_pwg_high(@_) },
-            },
-            {
-              label  => gettext("Text :"),
-              value  => sub { $self->imagelist->watermark_text(@_) },
-            },
-            {
-                label     => gettext("Text size :"),
-                type      => 'Number',
-                value   => sub { $self->imagelist->watermark_text_size(@_) },
-            },
-            {
-                label     => gettext("Color :"),
-                type      => 'Choice',
-                value     => sub { $self->imagelist->watermark_color(@_) },
-                choice    => [
-                               map { gettext $_ } @{wxTheApp->colors}
-                             ],
-                pre_process => sub { my ( $value ) = @_; wxTheApp->eng_colors->{$value} },
-            },            
-            {
-                label     => gettext("Position :"),
-                type      => 'Choice',
-                value   => sub { $self->imagelist->watermark_position(@_) },
-                choice  => [
-                               map { gettext $_ } @{wxTheApp->positions}
-                           ],
-                pre_process => sub { my ( $value ) = @_; wxTheApp->eng_positions->{$value} },
-            },
-            {
-                label     => gettext("Top margin :"),
-                type      => 'Number',
-                value   => sub { $self->imagelist->watermark_y(@_) },
-            },
-            {
-                label     => gettext("Left margin :"),
-                type      => 'Number',
-                value   => sub { $self->imagelist->watermark_x(@_) },
-            },            
-        ]
-    );
-
     $self->image_tags(
         sub { eval { $self->imagelist->current_image->site_tags(@_) } }
@@ -688,5 +659,5 @@
     $self->piwigo_tags(
         sub { wxTheApp->pwg->tags }
-    );	
+    );    
 }
 
@@ -697,5 +668,6 @@
         Wx::MessageBox( 
             sprintf(
-                gettext("Do you want to create \"%s\" ?"), 
+                "%s \"%s\" ?",
+                gettext("Do you want to create"), 
                 $name,
             ),
@@ -704,5 +676,5 @@
         ) == wxYES 
     ){    
-    	$self->pwg->AddTags($name);
+        $self->pwg->AddTags($name);
         $self->pwg->RefreshTags;
     }
@@ -712,20 +684,13 @@
     my ( $self ) = @_;
     
-    $self->_set_setting_properties;
+    eval { $self->_set_setting_properties; };
     $self->_refresh_settings_panels_properties;
     map {
-        $_->Refresh;	
+        $_->Refresh;    
     }
     (
-    	$self->image_prop_piwigo,
         $self->image_prop_exif,
-        $self->image_prop_tags,
-        $self->general_settings_panel,
-        $self->resized_settings_panel,
-        $self->thumbnail_settings_panel,
-        $self->hd_settings_panel,
-        $self->advanced_settings_panel,
-        $self->watermark_settings_panel,
-		$self->piwigo_photo_properties_tags
+        $self->global_settings_panel,
+        $self->piwigo_photo_properties_tags
     );
     
@@ -745,5 +710,5 @@
     if( $self->imagelist->wx_thumb_imglist->GetImageCount){
         printf("%s images\n", $self->imagelist->wx_thumb_imglist->GetImageCount); 
-    	$self->ShowImageViewer;
+        $self->ShowImageViewer;
         
         $self->imageviewer->Refresh(
@@ -756,13 +721,10 @@
 
 sub _refresh_settings_panels_properties {
-    my ( $self ) = @_;	
-
-	$self->dlg_piwigo_photo_properties->properties(
+    my ( $self ) = @_;    
+
+    $self->dlg_piwigo_photo_properties->properties(
         $self->piwigo_photo_properties
-	);
-	
-    $self->image_prop_piwigo->properties(
-        $self->piwigo_properties
-    );
+    );
+
     
     $self->image_prop_exif->properties(
@@ -770,42 +732,13 @@
     );
 
-
-    $self->general_settings_panel->properties(
-        $self->general_settings
+    $self->global_settings_panel->properties(
+        $self->global_settings
     );    
 
-    $self->resized_settings_panel->properties(
-        $self->resized_settings
-    );    
-
-    $self->thumbnail_settings_panel->properties(
-        $self->thumbnail_settings,
-    );    
-
-    $self->hd_settings_panel->properties(
-        $self->hd_settings,
-    );    
-
-    $self->advanced_settings_panel->properties(
-        $self->advanced_settings,
-    );    
-
-    $self->watermark_settings_panel->properties(
-        $self->watermark_settings,
-    );	
-	
 }
 
 sub _init_settings_panels {
-    my ( $self ) = @_;	
-
-    $self->image_prop_piwigo(
-        Uploader::GUI::wxPropertyGridPanel->new( 
-            { 
-                parentwnd       => $self,
-                properties      => $self->piwigo_properties,
-            }
-        )
-    );
+    my ( $self ) = @_;    
+
 
     $self->image_prop_exif(
@@ -818,91 +751,34 @@
     );
 
-
-    $self->general_settings_panel(
-        Uploader::GUI::wxPropertyGridPanel->new( 
+    $self->global_settings_panel(
+        Uploader::GUI::wxGlobalSettings->new( 
             { 
                 parentwnd       => $self,
-                properties      => $self->general_settings,
+                properties      => $self->global_settings,
             }
         )
-    );    
-
-    $self->resized_settings_panel(
-        Uploader::GUI::wxPropertyGridPanel->new( 
-            { 
+    );
+
+
+    $self->dlg_piwigo_photo_properties (
+        Uploader::GUI::wxPhotoProperties->new(
+            {
                 parentwnd       => $self,
-                properties      => $self->resized_settings,
-
-            }
-        )    
-    );    
-
-    $self->thumbnail_settings_panel(
-        Uploader::GUI::wxPropertyGridPanel->new( 
-            { 
-                parentwnd       => $self,
-                properties      => $self->thumbnail_settings,
-            }
-        )    
-    );    
-    $self->hd_settings_panel(
-        Uploader::GUI::wxPropertyGridPanel->new( 
-            { 
-                parentwnd       => $self,
-                properties      => $self->hd_settings,
-            }
-        )    
-    );    
-
-    $self->watermark_settings_panel(
-        Uploader::GUI::wxPropertyGridPanel->new(
-            {
-                parentwnd   => $self,
-                properties  => $self->watermark_settings,
+                properties      => $self->piwigo_photo_properties,
+                tags            =>
+                {
+                    id => $main::PHOTO_PROPERTIES_TAG,
+                    choices => $self->piwigo_tags,
+                    selection => $self->image_tags,
+                    creation_callback => sub { $self->_create_piwigo_tag(@_) },
+               },
             }
         )
     );
-	
-    $self->advanced_settings_panel(
-        Uploader::GUI::wxPropertyGridPanel->new( 
-            { 
-                parentwnd       => $self,
-                properties      => $self->advanced_settings,
-            }
-        )    
-    );    
-
-    $self->image_prop_tags(
-        Uploader::GUI::wxChoiceFilteredPanel->new( 
-            { 
-                parentwnd    => $self,
-                choices      => $self->piwigo_tags,
-                selection    => $self->image_tags,
-                creation_callback => sub { $self->_create_piwigo_tag(@_) }, 
-            }
-        )    
-    );    
-
-    $self->dlg_piwigo_photo_properties(
-        Uploader::GUI::wxPhotoProperties->new(
-		    {
-                parentwnd       => $self,
-                properties      => $self->piwigo_photo_properties,
-				tags            => {
-				                        id => $main::PHOTO_PROPERTIES_TAG,
-                                        choices => $self->piwigo_tags,
-                                        selection => $self->image_tags,
-                                        creation_callback => sub { $self->_create_piwigo_tag(@_) },
-								   }, 
-			}
-		)
-    );	
-
-	$self->piwigo_photo_properties_tags(
-	    $self->dlg_piwigo_photo_properties->FindWindow($main::PHOTO_PROPERTIES_TAG)
-	);
-
-    
-    $self->general_settings_panel->Show(0);
+
+    $self->piwigo_photo_properties_tags(
+        $self->dlg_piwigo_photo_properties->FindWindow($main::PHOTO_PROPERTIES_TAG)
+    );
+
 
     $self->image_preview(
@@ -914,12 +790,8 @@
     );
 
-    $self->image_preview->Show(0);
-    $self->image_prop_piwigo->Show(0);
-    $self->image_prop_exif->Show(0);
-	
 }
 
 sub init_panels {
-    my ( $self ) = @_;	
+    my ( $self ) = @_;    
 
     my $file = sprintf(
@@ -940,5 +812,5 @@
             new_album => sub {$self->OnAddCategories(@_) },
             add_photos => sub { $self->OnAddImages(@_) },
-            upload_photos => sub { $self->ProcessImageSelection(@_)},	
+            upload_photos => sub { $self->ProcessImageSelection(@_)},    
         }
     );
@@ -949,15 +821,15 @@
                 parentwnd => $self,
                 imagelist => $self->imagelist,
-				image_size => $self->imagelist->wx_thumb_size,
-				columns => $self->piwigo_properties,
+                image_size => $self->imagelist->wx_thumb_size,
+                columns => $self->piwigo_property_list,
             }
         )
     );
     
-    $self->_init_settings_panels;	
+    $self->_init_settings_panels;    
 }
 
 sub init_dnd_targets {
-    my ( $self ) = @_;	
+    my ( $self ) = @_;    
 
     $self->imageviewer->SetDropTarget( 
@@ -972,5 +844,5 @@
         )
     );
-	
+    
 }
 
@@ -983,20 +855,21 @@
 
     $self->manager->AddPane
-      ( $self->create_notebook_imagelist, Wx::AuiPaneInfo->new->Name( "ImageViewer" )
-        ->CenterPane->Resizable->CloseButton(0) );
-
-	$self->manager->AddPane( 
+      ( $self->imageviewer, Wx::AuiPaneInfo->new->Name( "ImageViewer" )
+        ->Left->Position(1)->DefaultPane->Caption(gettext("Photo selection"))->CaptionVisible->CloseButton(0)  );
+
+    $self->manager->AddPane( 
         $self->dlg_piwigo_photo_properties, 
         Wx::AuiPaneInfo->new->Name( "piwigo_photo_properties" )
-        ->Right->Position( 0 )->Resizable->CloseButton(0) 
-    );
-		
+        ->CenterPane->Position(0)->BestSize([600, 400])
+        ->Caption(gettext("Photo properties"))->CaptionVisible
+        ->CloseButton(0)
+        ->MinSize([300, 200]) 
+    );
+
     $self->manager->AddPane( 
         $self->create_tree, 
         Wx::AuiPaneInfo->new->Name( "categories" )
-        ->Right->Position( 1 )->Resizable->CloseButton(0), 
-    );
-
-
+        ->CenterPane->Position( 1 )->MinSize([300, 200]) 
+    );
 
     $self->_init_aui_settings_panels;
@@ -1018,20 +891,17 @@
 
 
-    if($self->perspective){
+    if(0 and $self->perspective){
         $self->manager->LoadPerspective($self->perspective);
     }
     else {
-        $self->manager->GetPane("piwigo_photo_properties")->MinSize(600,350);
-        $self->manager->GetPane("categories")->MinSize(600,100);
-
         $self->manager->GetPane("tb1")->Caption( gettext("Tools") );
-        $self->manager->GetPane("image_preview")->Caption(gettext("Preview"))->Show(0);
-        $self->manager->GetPane("getting_started")->Caption(gettext("Getting started"))->Float->Show(1);
-        $self->manager->GetPane("photo_properties")->Caption(gettext("Photo properties"))->Float->Show(0);
-        $self->manager->GetPane("global_settings")->Caption(gettext("Global settings"))->Float->Show(0);
+        $self->manager->GetPane("image_preview")->Caption(gettext("Preview"));
+        $self->manager->GetPane("getting_started")->Caption(gettext("Getting started"));
+        $self->manager->GetPane("photo_properties")->Caption(gettext("Photo exif properties"));
+        $self->manager->GetPane("global_settings")->Caption(gettext("Global settings"));
     }
 
     $self->manager->GetPane("categories")->Caption(
-          sprintf("%s - %s", sprintf("Piwigo %s", wxTheApp->branding->{categories}), $url )
+          sprintf("%s", sprintf("Piwigo %s", wxTheApp->branding->{categories}))
     );
     
@@ -1042,21 +912,23 @@
 
 sub _init_aui_settings_panels {
-    my ( $self ) = @_;	
+    my ( $self ) = @_;    
 
     $self->manager->AddPane
       ( $self->image_preview, Wx::AuiPaneInfo->new->Name( "image_preview" )
-        ->Floatable(1)->Resizable->CloseButton(1));
+        ->DefaultPane->MaximizeButton(1)->MinSize([200,150])->Float->Hide);
 
     $self->manager->AddPane
       ( $self->htmlhome, Wx::AuiPaneInfo->new->Name( "getting_started" )
-       ->Floatable(1)->Resizable->CloseButton(1) );
+       ->Left->Position(0)->DefaultPane->CloseButton(1) );
 
     $self->manager->AddPane
-      ( $self->create_notebook_image_properties, Wx::AuiPaneInfo->new->Name( "photo_properties" )
-        ->Floatable(1)->Resizable->CloseButton(1) );
+      ( $self->image_prop_exif, Wx::AuiPaneInfo->new->Name( "photo_properties" )
+        ->DefaultPane->CloseButton(1)->MinSize([200,150])->Float->Hide );
 
     $self->manager->AddPane
-      ( $self->create_notebook_global_settings, Wx::AuiPaneInfo->new->Name( "global_settings" )
-        ->Floatable(1)->Resizable->CloseButton(1) );
+      ( 
+        $self->global_settings_panel,
+        Wx::AuiPaneInfo->new->Name( "global_settings" )
+        ->DefaultPane->CloseButton(1)->MinSize([720, 620])->Float->Hide );
 
 }
@@ -1066,6 +938,6 @@
 
     $self->manager->GetPane("photo_properties")->Show(1);
-    $self->manager->Update();    
-	
+    $self->manager->Update();
+    
 }
 
@@ -1073,13 +945,13 @@
     my ( $self ) = @_;
 
-	my $preview_pane = $self->manager->GetPane("image_preview");
+    my $preview_pane = $self->manager->GetPane("image_preview");
     if (! $preview_pane->IsShown){
-	    $preview_pane->MinSize(100,75)->Float->Show(1);
-        $self->manager->Update();    
-
-        $self->_image_preview_refresh; 
-        $self->image_preview->Refresh;		
-	};
-	
+        $preview_pane->Show(1);
+        $self->manager->Update();
+
+        $self->set_preview_image; 
+        $self->image_preview->Refresh;
+    };
+
 }
 
@@ -1087,8 +959,7 @@
     my ( $self ) = @_;
 
-    $self->toolbar->EnableTool(100, 0 );
-    $self->manager->GetPane("getting_started")->Float->Show(1);
-    $self->manager->Update();    
-	
+    $self->manager->GetPane("getting_started")->Show(1);
+    $self->manager->Update();
+    
 }
 
@@ -1096,11 +967,10 @@
     my ( $self ) = @_;
 
-    $self->toolbar->EnableTool(104, 0 );
-    $self->manager->GetPane("global_settings")->Float->Show(1);
-    $self->manager->Update();    
+    $self->manager->GetPane("global_settings")->Show(1);
+    $self->manager->Update();
 }
 
 sub OnChooseLanguage {
-    my ( $self ) = @_;	
+    my ( $self ) = @_;    
 
   my $languages = wxTheApp->available_languages;
@@ -1136,93 +1006,13 @@
     my ( $self ) = @_;
     
-    Wx::LogMessage("New default_photo_name %s", $self->imagelist->default_photo_name);	
-}
-
-
-sub create_notebook_imagelist {
-    my( $self ) = @_;
-    my $book = Wx::AuiNotebook->new( $self, -1, [-1, -1], [300, 450],
-                                     wxBORDER_NONE|wxAUI_NB_TAB_MOVE|wxAUI_NB_TAB_SPLIT);
-
-        my $imglistpage = [
-            [
-                $self->imageviewer, 
-                gettext("Photo selection"),
-                '../res/images.png', 
-                wxBITMAP_TYPE_PNG,
-            ],
-        ];
-
-    $self->notebook($book);
-    $self->_populate_notebook($self->notebook, $imglistpage, 0);
-    return $book;
-}
-
-sub create_notebook_image_properties {
-    my( $self ) = @_;
-    my $book = Wx::AuiNotebook->new( $self, -1, [-1, -1], [450, 450],
-                                     wxBORDER_NONE|wxAUI_NB_TAB_MOVE|wxAUI_NB_TAB_SPLIT);
-    my $pages = [    
-        [
-            $self->image_prop_piwigo, 
-            "Piwigo",
-        ],
-        [
-            $self->image_prop_tags, 
-            "Tags",
-        ],
-        [
-            $self->image_prop_exif, 
-            "Exif",
-        ],
-    ];
-    
-    $self->_populate_notebook( $book, $pages );
-
-    $self->notebook_image_properties($book);
-
-    return $book;
-}
-
-sub create_notebook_global_settings {
-    my( $self ) = @_;
-    my $book = Wx::AuiNotebook->new( $self, -1, [-1, -1], [450, 450],
-                                     wxBORDER_NONE|wxAUI_NB_TAB_MOVE|wxAUI_NB_TAB_SPLIT);
-    my $pages = [    
-        [
-            $self->general_settings_panel, 
-            gettext("General"),
-        ],
-        [
-            $self->resized_settings_panel, 
-            gettext("Resized"),
-        ],
-        [
-            $self->thumbnail_settings_panel, 
-            gettext("Thumbnail"),
-        ],
-        [
-            $self->hd_settings_panel, 
-            gettext("High definition"),
-        ],
-        [
-            $self->watermark_settings_panel,
-            gettext("Watermark"),
-        ],    
-        [
-            $self->advanced_settings_panel, 
-            gettext("Advanced"),
-        ],
-    ];
-    
-    $self->_populate_notebook( $book, $pages );
-
-    $self->notebook_global_settings($book);
-
-    return $book;
-}
-
-
-
+    Wx::LogMessage("New default_photo_name %s", $self->imagelist->default_photo_name);    
+}
+
+sub OnGeneralSettingsClose {
+    my ( $self, $event ) = @_;
+
+    $self->manager->GetPane("global_settings")->Hide;
+    $self->manager->Update();
+}
 
 sub create_tree {
@@ -1232,5 +1022,5 @@
         map {
             Wx::Bitmap->new( $_, wxBITMAP_TYPE_PNG )
-        	
+            
         }
         (
@@ -1242,5 +1032,5 @@
     $self->treeimglist( Wx::ImageList->new( 16, 16, 1 ) );
     map {
-    	$self->treeimglist->Add($_);
+        $self->treeimglist->Add($_);
     }
     @$images;
@@ -1328,5 +1118,5 @@
 
 sub _populate_notebook {
-    my ( $self, $book, $pages, $position ) = @_;	
+    my ( $self, $book, $pages, $position ) = @_;    
 
     my $i = 0;
@@ -1353,17 +1143,17 @@
 
     $self->_tree_mnu;
-    $self->_imageviewer_mnu;	
+    $self->_imageviewer_mnu;    
 }
 
 
 sub _tree_mnu {
-    my ( $self ) = @_;	
+    my ( $self ) = @_;    
 
     my $ctx_mnu = Wx::Menu->new;
     
     map {
-    	$ctx_mnu->Append(
-    	    @$_[0..2], wxITEM_NORMAL
-    	)->SetBitmap(Wx::Bitmap->new($_->[3],wxBITMAP_TYPE_PNG));
+        $ctx_mnu->Append(
+            @$_[0..2], wxITEM_NORMAL
+        )->SetBitmap(Wx::Bitmap->new($_->[3],wxBITMAP_TYPE_PNG));
     }
     (
@@ -1419,16 +1209,16 @@
     $self->tree_mnu(
          $ctx_mnu
-    );	
-}	
+    );    
+}    
 
 sub _imageviewer_mnu {
-    my ( $self ) = @_;	
+    my ( $self ) = @_;    
 
     my $ctx_mnu = Wx::Menu->new;
     
     map {
-    	$ctx_mnu->Append(
-    	    @$_[0..2]
-    	)->SetBitmap(Wx::Bitmap->new($_->[3],wxBITMAP_TYPE_PNG));
+        $ctx_mnu->Append(
+            @$_[0..2]
+        )->SetBitmap(Wx::Bitmap->new($_->[3],wxBITMAP_TYPE_PNG));
     }
     (
@@ -1453,14 +1243,14 @@
         ],
     );
-	
+    
     $ctx_mnu->Delete(0);
     $self->imageviewer_mnu(
          $ctx_mnu
-    );	
+    );    
 }
 
 sub _initEventHandlers {
     my ( $self ) = @_ ;
-	
+    
     Wx::Event::EVT_MENU( $self, 100, \&OnGettingStarted );
     Wx::Event::EVT_MENU( $self, 101, \&OnAddImages );
@@ -1482,5 +1272,4 @@
 
     EVT_CLOSE( $self, \&OnClose );
-    Wx::Event::EVT_UPDATE_UI( $self, $self, \&OnUpdateUI );
 
 
@@ -1492,4 +1281,6 @@
     Wx::Event::EVT_MENU( $self, 1+$ID_IMAGEVIEWER_CTX_MENU, \&OnPhotoProperties );
     Wx::Event::EVT_MENU( $self, 2+$ID_IMAGEVIEWER_CTX_MENU, \&OnPreview );
+    EVT_BUTTON( $self, $main::GS_CLOSE, \&OnGeneralSettingsClose );
+
 
 
@@ -1513,24 +1304,24 @@
     }
     $dialog->Destroy;
-#    $event->Skip;
+    $event->Skip;
   }
 }
 
-sub OnUpdateUI {
-    my( $self, $event ) = @_;
+sub OnUpdateToolbar {
+    my( $self ) = @_;
     
     if( $self->manager ){
         if($self->manager->GetPane("global_settings")->IsShown){
-            $self->toolbar->EnableTool(104, 0);         	
+            $self->toolbar->EnableTool(104, 0);
         }
         else{
-            $self->toolbar->EnableTool(104, 1);         	
+            $self->toolbar->EnableTool(104, 1);
         }
 
         if($self->manager->GetPane("getting_started")->IsShown){
-            $self->toolbar->EnableTool(100, 0);         	
+            $self->toolbar->EnableTool(100, 0);
         }
         else{
-            $self->toolbar->EnableTool(100, 1);         	
+            $self->toolbar->EnableTool(100, 1);
         }
     }
@@ -1543,15 +1334,15 @@
     
     $self->imagelist->RemoveImageSelection;
-    $self->imageviewer->Refresh;	
-
-	if (!$self->imageviewer->GetItemCount){
+    $self->imageviewer->Refresh;    
+
+    if (!$self->imageviewer->GetItemCount){
         $self->image_preview->image(
             0
         ); 
-	    # have to reset
-		$self->dlg_piwigo_photo_properties->ClearProperties;
+        # have to reset
+        $self->dlg_piwigo_photo_properties->ClearProperties;
         $self->piwigo_photo_properties_tags->ClearAllSelection;
-		$self->imagelist->SetCurrentImage(-1);
-	}
+        $self->imagelist->SetCurrentImage(-1);
+    }
 
     $self->image_preview->Refresh;
@@ -1615,5 +1406,5 @@
 
     $self->PopupMenu($self->tree_mnu, wxDefaultPosition);
-	
+    
 }
 
@@ -1629,5 +1420,5 @@
     }
     else{
-    	$event->Veto;
+        $event->Veto;
     }
 }
@@ -1635,5 +1426,5 @@
 sub _SetLabel {
     my( $self, $event ) = @_;
-	
+    
     my $category = $self->tree->GetPlData($event->GetItem);
     my $category_id;
@@ -1650,14 +1441,14 @@
     
     if(!$success){
-    	$ok = 0;
+        $ok = 0;
     }
 
     if('fail' eq $content->{stat}){
-    	$ok = 0;
+        $ok = 0;
     }
 
     # method call failed
     if(!$ok){
-    	$event->Veto;
+        $event->Veto;
         Wx::MessageBox( 
             sprintf(
@@ -1678,6 +1469,6 @@
     
     $self->PopupMenu($self->imageviewer_mnu, wxDefaultPosition);
-	
-	
+    
+    
 }
 
@@ -1716,5 +1507,5 @@
 
     if( $dialog->ShowModal != wxID_CANCEL ) {
-    	my $name = $dialog->GetValue;
+        my $name = $dialog->GetValue;
         my ( $success, $status_msg, $content ) = $self->pwg->AddCategories( $name, $category_id);
 
@@ -1734,5 +1525,5 @@
 
 sub _refresh_all_categories_helper {
-    my ( $self ) = @_;	
+    my ( $self ) = @_;    
 
     my $busycursor = Wx::BusyCursor->new();
@@ -1765,7 +1556,6 @@
         $event->GetLabel
     );
-    	
+        
     $self->dlg_piwigo_photo_properties->SetProperties;
-    $self->image_prop_piwigo->Refresh;
 }
 
@@ -1793,5 +1583,5 @@
 
 sub _on_imageviewer_item_selected {
-    my ( $self, $index ) = @_;	
+    my ( $self, $index ) = @_;    
     $self->current_imageviewer_index($index);
     $self->imagelist->SetCurrentImage($index);
@@ -1800,22 +1590,20 @@
         $self->imageviewer->GetSelectedItems
     );
-	
-	# process image_preview in idle time
-	# and when current event is processed
-	# see call to EVT_IDLE
+
+    # process image_preview in idle time
+    # and when current event is processed
+    # see call to EVT_IDLE
     $self->image_preview_refresh(1);
 
-    $self->dlg_piwigo_photo_properties->SetProperties;
-    $self->image_prop_piwigo->Refresh;
+    $self->dlg_piwigo_photo_properties->SetProperties if defined $self->dlg_piwigo_photo_properties;
     $self->image_prop_exif->Refresh;
-    $self->image_prop_tags->Refresh;
-	$self->piwigo_photo_properties_tags->Refresh;
-
-}
-
-sub _image_preview_refresh {
-    my ( $self ) = @_;	
-
-	my $current_image = $self->imagelist->current_image;
+    $self->piwigo_photo_properties_tags->Refresh;
+
+}
+
+sub set_preview_image {
+    my ( $self ) = @_;    
+
+    my $current_image = $self->imagelist->current_image;
     my $image = Wx::Image->new;
     $image->LoadFile(
@@ -1830,18 +1618,17 @@
         # Valid for Rotate 180, Rotate 90 CW, Rotate 270 CW
         if( $orientation =~ m/Rotate (\d+)/ ){
-			for(my $i=0; $i < floor($1/90) ; $i++){
+            for(my $i=0; $i < floor($1/90) ; $i++){
                 $image = $image->Rotate90;
-            }				
+            }                
         }
     }
 
-  $self->image_preview->image_size(
-      [$image->GetWidth, $image->GetHeight, ]
-  );        
-
-  $self->image_preview->image(
-      $image
-  );        
-  
+    $self->image_preview->image_size(
+        [$image->GetWidth, $image->GetHeight, ]
+    );        
+
+    $self->image_preview->image(
+        $image
+    );        
 }
 
@@ -1860,5 +1647,5 @@
             $index
         );
-    }	
+    }    
 
 }
@@ -1874,5 +1661,5 @@
 # remove image from imagelist when uploaded
 sub UploadImagesViewerRefresh {
-    my ( $self ) = @_;	
+    my ( $self ) = @_;    
 
 
@@ -1889,5 +1676,5 @@
 
 sub UploadProgressMessageRefresh {
-    my ( $self, $msg ) = @_;	
+    my ( $self, $msg ) = @_;    
 
     Wx::Yield();
@@ -1895,5 +1682,5 @@
     $self->upload_progressdlg->processing(
         $msg   
-    );	
+    );    
     $self->upload_progressdlg->LogProgress();
 
@@ -1902,5 +1689,5 @@
 
 sub UploadProgressMessageDetailsRefresh {
-    my ( $self, $msg ) = @_;	
+    my ( $self, $msg ) = @_;    
 
     Wx::Yield();
@@ -1908,5 +1695,5 @@
     $self->upload_progressdlg->processing_details(
         $msg   
-    );	
+    );    
     $self->upload_progressdlg->LogProgress();
 
@@ -1916,5 +1703,5 @@
 
 sub UploadProgressThumbnailRefresh {
-    my ( $self ) = @_;	
+    my ( $self ) = @_;    
 
     my $imagelist = $self->imagelist ;
@@ -1933,5 +1720,5 @@
 
 sub UploadProgressBarRefresh {
-    my ( $self, $value ) = @_;	
+    my ( $self, $value ) = @_;    
 
     eval {
@@ -1947,11 +1734,11 @@
 
 sub SetNewFilesDisplayEndInfo {
-    my ( $self, $msg ) = @_;	
-	
+    my ( $self, $msg ) = @_;    
+    
     $self->progressdlg->DisplayEndInfo($msg);
 }
 
 sub UploadDisplayEndInfo {
-    my ( $self, $msg ) = @_;	
+    my ( $self, $msg ) = @_;    
     
     my $imagelist = $self->imagelist ;
@@ -1961,5 +1748,5 @@
 
 sub ShowImageViewer {
-    my ( $self ) = @_;	
+    my ( $self ) = @_;    
 
     if(!$self->imageviewer->IsShown){
@@ -1970,6 +1757,6 @@
 
 sub ActivateImageViewer {
-    my ( $self ) = @_;	
-	
+    my ( $self ) = @_;    
+    
 }
 
@@ -1977,5 +1764,5 @@
 sub SetNewFilesViewerRefresh {
 
-    my ( $self ) = @_;	
+    my ( $self ) = @_;    
 
     my $wximagelist = $self->imagelist->wx_thumb_imglist;
@@ -1988,5 +1775,5 @@
     ) if defined $self->imagelist->current_image->wx_thumb_file;
     print $self->imagelist->current_image->wx_thumb_file, " added with index ", $indx, "\n";    
-	
+    
     $self->imageviewer->Refresh(
         $wximagelist
@@ -2007,10 +1794,10 @@
         # all selected is implicit
         if(!scalar @{$self->imageviewer->GetSelectedItems}){
-    	
+        
             $self->imagelist->image_selection(
                 $self->imageviewer->GetAllItems
             );
-    	}
-   	
+        }
+       
         return if( !defined $self->imagelist->image_selection );
         return if( !scalar @{$self->imagelist->image_selection} );
@@ -2096,5 +1883,5 @@
     
     $self->imagelist->Store;
-    wxTheApp->login_dlg->Destroy;	
+    wxTheApp->login_dlg->Destroy;    
 
     wxTheApp->perspective(
@@ -2200,27 +1987,27 @@
     
     );
-	
-	$tb->AddSeparator;
-	
-	$tb->AddControl(
-	    Wx::Choice->new(
-		    $tb,
-			106,
-			wxDefaultPosition,
-			wxDefaultSize,
-			[],
-		)
-	);
-	my $ch = $tb->FindWindow(106);
+    
+    $tb->AddSeparator;
+    
+    $tb->AddControl(
+        Wx::Choice->new(
+        $tb,
+            106,
+            wxDefaultPosition,
+            [300, -1],
+            [],
+        )
+    );
+    my $ch = $tb->FindWindow(106);
     $ch->SetToolTip(gettext("How photo selection is displayed"));
-	map {
-	    $ch->Append(gettext($_), $_);
-	}(
-	    "Thumbnail and caption",
-		"Thumbnail",
-		"Property list"
-	);
-	
-	$ch->SetStringSelection(gettext($self->imagelist->display_mode));
+    map {
+        $ch->Append(gettext($_), $_);
+    }(
+        "Thumbnail and caption",
+        "Thumbnail",
+        "Property list"
+    );
+    
+    $ch->SetStringSelection(gettext($self->imagelist->display_mode));
     $tb->Realize;
 
@@ -2230,10 +2017,10 @@
 sub OnPhotoSelMode {
     my ( $self, $event )= @_;
-	
-	$self->imagelist->display_mode(
-	    $event->GetClientData
-	);
-
-	$self->imageviewer->change_display_mode(1);
+    
+    $self->imagelist->display_mode(
+        $event->GetClientData
+    );
+
+    $self->imageviewer->change_display_mode(1);
 }
 
@@ -2332,16 +2119,16 @@
   eval {
       if(scalar @$VAR1){
-      	   my @items;
-      	   if(scalar @items < 2) {
+             my @items;
+             if(scalar @items < 2) {
                my ($dropItem, $flag) = $self->tree->HitTest([$x, $y]);
-      	   	push @items, $dropItem;
-      	   }
-      	   else {
-      	   	@items = $self->tree->GetSelections;
-      	   }
-      	   
-      	   # remove root item which is not a valid category
-      	   @items = grep { $self->tree->GetPlData( $_ ) != -1 } @items;
-      	   
+                 push @items, $dropItem;
+             }
+             else {
+                 @items = $self->tree->GetSelections;
+             }
+             
+             # remove root item which is not a valid category
+             @items = grep { $self->tree->GetPlData( $_ ) != -1 } @items;
+             
            $self->frame->imagelist->categories(
                [
@@ -2353,7 +2140,7 @@
            );
            
-      	   $self->frame->imagelist->image_selection($VAR1);
-      	   $self->frame->ProcessImageSelection ;
-      }	
+             $self->frame->imagelist->image_selection($VAR1);
+             $self->frame->ProcessImageSelection ;
+      }    
   };
 }
Index: /extensions/pLoader/trunk/src/ploader.pl
===================================================================
--- /extensions/pLoader/trunk/src/ploader.pl	(revision 4568)
+++ /extensions/pLoader/trunk/src/ploader.pl	(revision 4569)
@@ -29,8 +29,9 @@
 $SIG{__DIE__} = \&OnDieHandler;
 
+require '../res/global_settings_wdr.pl'; 
 require '../res/progress_wdr.pl'; 
 require '../res/login_wdr.pl'; 
 require '../res/reupload_wdr.pl'; 
-require '../res/photo_properties_wdr.pl'; 
+require '../res/photo_properties_wdr.pl';
 print Dumper \@INC;
 eval {
