Index: /extensions/pLoader/trunk/res/photo_properties_wdr.pl
===================================================================
--- /extensions/pLoader/trunk/res/photo_properties_wdr.pl	(revision 4475)
+++ /extensions/pLoader/trunk/res/photo_properties_wdr.pl	(revision 4475)
@@ -0,0 +1,131 @@
+#-----------------------------------------------------------------------------
+# Perl source generated by wxDesigner from file: photo_properties.wdr
+# Do not modify this file, all changes will be lost!
+#-----------------------------------------------------------------------------
+
+use Wx;
+use Wx::Calendar;
+use Wx::DateTime;
+use Wx::Grid;
+use strict;
+
+# Custom source
+use Uploader::GUI::wxChoiceFilteredPanel;
+
+use Wx qw( wxDefaultSize wxDefaultPosition wxNullAnimation wxNullFont wxBLACK );
+use Wx qw( wxID_OK wxID_APPLY wxID_SAVE wxID_SAVEAS wxID_CANCEL wxID_YES wxID_NO wxID_EXIT wxID_ABOUT wxID_HELP );
+use Wx qw( wxVERTICAL wxHORIZONTAL wxALL wxLEFT wxRIGHT wxTOP wxBOTTOM wxCENTRE wxGROW );
+use Wx qw( wxALIGN_RIGHT wxALIGN_BOTTOM wxALIGN_CENTER wxALIGN_CENTER_VERTICAL wxALIGN_CENTER_HORIZONTAL );
+use Wx qw( wxTE_MULTILINE );
+
+# Bitmap functions
+
+use Wx qw( wxNullBitmap wxBITMAP_TYPE_PNG );
+
+# Window functions
+
+use vars qw($CAPTION); $CAPTION = 10000;
+use vars qw($PHOTO_PROPERTIES_CAPTION); $PHOTO_PROPERTIES_CAPTION = 10001;
+use vars qw($COMMENT); $COMMENT = 10002;
+use vars qw($PHOTO_PROPERTIES_COMMENT); $PHOTO_PROPERTIES_COMMENT = 10003;
+use vars qw($AUTHOR); $AUTHOR = 10004;
+use vars qw($PHOTO_PROPERTIES_AUTHOR); $PHOTO_PROPERTIES_AUTHOR = 10005;
+use vars qw($CREATE_DATE); $CREATE_DATE = 10006;
+use vars qw($PHOTO_PROPERTIES_CREATE_DATE); $PHOTO_PROPERTIES_CREATE_DATE = 10007;
+use vars qw($TAGS); $TAGS = 10008;
+use vars qw($PHOTO_PROPERTIES_TAG); $PHOTO_PROPERTIES_TAG = 10009;
+
+sub PhotoProperties {
+    my( $parent ) = $_[0];
+    my( $item0 ) = Wx::BoxSizer->new( wxHORIZONTAL );
+    
+    my( $item1 ) = Wx::BoxSizer->new( wxVERTICAL );
+    
+    my( $item2 ) = Wx::BoxSizer->new( wxVERTICAL );
+    
+    my( $item3 ) = Wx::BoxSizer->new( wxVERTICAL );
+    
+    my( $item4 ) = Wx::StaticText->new( $parent, $main::CAPTION, "text", wxDefaultPosition, wxDefaultSize, 0 );
+    $item3->AddWindow( $item4, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
+
+    my( $item5 ) = Wx::TextCtrl->new( $parent, $main::PHOTO_PROPERTIES_CAPTION, "", wxDefaultPosition, [200,-1], 0 );
+    $item3->AddWindow( $item5, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxTOP, 5 );
+
+    $item2->Add( $item3, 0, wxALIGN_CENTER|wxALL, 5 );
+
+    my( $item6 ) = Wx::BoxSizer->new( wxVERTICAL );
+    
+    my( $item7 ) = Wx::StaticText->new( $parent, $main::COMMENT, "text", wxDefaultPosition, wxDefaultSize, 0 );
+    $item6->AddWindow( $item7, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
+
+    my( $item8 ) = Wx::TextCtrl->new( $parent, $main::PHOTO_PROPERTIES_COMMENT, "", wxDefaultPosition, [200,100], wxTE_MULTILINE );
+    $item6->AddWindow( $item8, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 );
+
+    $item2->Add( $item6, 0, wxALIGN_CENTER_VERTICAL, 5 );
+
+    my( $item9 ) = Wx::BoxSizer->new( wxVERTICAL );
+    
+    my( $item10 ) = Wx::StaticText->new( $parent, $main::AUTHOR, "text", wxDefaultPosition, wxDefaultSize, 0 );
+    $item9->AddWindow( $item10, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
+
+    my( $item11 ) = Wx::TextCtrl->new( $parent, $main::PHOTO_PROPERTIES_AUTHOR, "", wxDefaultPosition, [200,-1], 0 );
+    $item9->AddWindow( $item11, 0, wxALIGN_CENTER|wxRIGHT|wxTOP, 5 );
+
+    $item2->Add( $item9, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
+
+    my( $item12 ) = Wx::BoxSizer->new( wxVERTICAL );
+    
+    my( $item13 ) = Wx::StaticText->new( $parent, $main::CREATE_DATE, "text", wxDefaultPosition, wxDefaultSize, 0 );
+    $item12->AddWindow( $item13, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
+
+    my( $item14 ) = Wx::TextCtrl->new( $parent, $main::PHOTO_PROPERTIES_CREATE_DATE, "", wxDefaultPosition, [200,-1], 0 );
+    $item12->AddWindow( $item14, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxTOP|wxBOTTOM, 5 );
+
+    $item2->Add( $item12, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
+
+    $item1->Add( $item2, 0, wxALIGN_CENTER|wxALL, 5 );
+
+    my( $item15 ) = Wx::BoxSizer->new( wxVERTICAL );
+    
+    $item1->Add( $item15, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
+
+    my( $item16 ) = Wx::BoxSizer->new( wxVERTICAL );
+    
+    $item1->Add( $item16, 0, wxALIGN_CENTER|wxALL, 5 );
+
+    $item0->Add( $item1, 0, wxALL, 5 );
+
+    my( $item17 ) = Wx::BoxSizer->new( wxVERTICAL );
+    
+    my( $item18 ) = Wx::StaticText->new( $parent, $main::TAGS, "text", wxDefaultPosition, wxDefaultSize, 0 );
+    $item17->AddWindow( $item18, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
+
+    my $tags = $_[1];
+$tags->{parentwnd}=$parent;
+my( $item19 ) = Uploader::GUI::wxChoiceFilteredPanel->new($tags);
+    $item17->AddWindow( $item19, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
+
+    $item0->Add( $item17, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 );
+
+    my( $set_size ) = @_ >= 3 ? $_[2] : 1;
+    my( $call_fit ) = @_ >= 2 ? $_[1] : 1;
+    if( $set_size == 1 ) {
+         $_[0]->SetSizer( $item0 );
+         
+         if( $call_fit == 1 ) {
+             $item0->SetSizeHints( $_[0] );
+         }
+    }
+    
+    $item0;
+}
+
+# Menu bar functions
+
+
+# Toolbar functions
+
+use Wx qw( wxITEM_NORMAL wxITEM_RADIO wxITEM_CHECK );
+
+
+# End of generated file
Index: /extensions/pLoader/trunk/src/Uploader/GUI/DlgCommon.pm
===================================================================
--- /extensions/pLoader/trunk/src/Uploader/GUI/DlgCommon.pm	(revision 4474)
+++ /extensions/pLoader/trunk/src/Uploader/GUI/DlgCommon.pm	(revision 4475)
@@ -12,4 +12,44 @@
 );
 
+sub InitHandler {
+    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(@_) } ); },
+	};
+	
+	map {
+        my $ctrl =$self->FindWindow($_);
+        if(defined $ctrl){
+		    $ctrl_handlers->{ ref $ctrl}->($ctrl) if exists $ctrl_handlers->{ ref $ctrl};
+		}
+    }
+	keys %{$self->properties};
+	
+
+}
+
+# what does happen when the text changes
+sub OnTextCtrl {
+    my ( $self, $ctrl, $event ) = @_;
+	
+	printf("OnTextCtrl %s, %s\n", $ctrl->GetId, $event->GetString);
+    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};	
+	
+}
+
+my $change_value = {
+    'Wx::TextCtrl' => sub { my ($ctrl, $value ) = @_; $ctrl->ChangeValue($value)},
+    'Wx::CheckBox' => sub { my ($ctrl, $value ) = @_; $ctrl->SetValue($value)},
+};	
 
 sub SetProperties {
@@ -20,27 +60,40 @@
         #printf("ctrl %s : %s\n", $_, $ctrl);		
         if(defined $ctrl){
-		# checkbox, static text
-		$ctrl->SetLabel(
-           $self->properties->{$_}->{label}
-		) if exists$self->properties->{$_}->{label};
-
-        $ctrl->SetValue(
-           $self->properties->{$_}->{value}->()
-		) if exists$self->properties->{$_}->{value};
-
-        # radiobox
-        my $labels =$self->properties->{$_}->{labels};
-		$labels||=[];
-		for(my $i=0; $i < scalar @$labels ; $i++){
-		    $ctrl->SetItemLabel($i, $labels->[$i]);
-		}
-		# only works for control with items
-		$ctrl->SetSelection(
-		    $self->properties->{$_}->{selection}->()			
-		) if exists $self->properties->{$_}->{selection};
-		
+ 	        # checkbox, static text
+            $change_value->{ref $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};
+}
+
+sub InitLabels {
+    my ( $self ) = @_;
+	
+	map {
+        my $ctrl =$self->FindWindow($_);
+        #printf("ctrl %s : %s\n", $_, $ctrl);		
+        if(defined $ctrl){
+  	        # checkbox, static text
+		    $ctrl->SetLabel(
+               $self->properties->{$_}->{label}
+		    ) if exists $self->properties->{$_}->{label};
+		
+            # radiobox
+            my $labels =$self->properties->{$_}->{labels};
+		    $labels||=[];
+		    for(my $i=0; $i < scalar @$labels ; $i++){
+		        $ctrl->SetItemLabel($i, $labels->[$i]);
+		    }
+		}
+    }
+	keys %{$self->properties};
+
 }
 
@@ -66,3 +119,4 @@
 	keys %{$self->properties};
 }
+
 1;
Index: /extensions/pLoader/trunk/src/Uploader/GUI/wxChoiceFilteredPanel.pm
===================================================================
--- /extensions/pLoader/trunk/src/Uploader/GUI/wxChoiceFilteredPanel.pm	(revision 4474)
+++ /extensions/pLoader/trunk/src/Uploader/GUI/wxChoiceFilteredPanel.pm	(revision 4475)
@@ -65,8 +65,8 @@
 
 
-    my $self = $class->SUPER::new( $params->{parentwnd}, -1, wxDefaultPosition, wxDefaultSize );
+    my $self = $class->SUPER::new( $params->{parentwnd}, $params->{id}||-1, wxDefaultPosition, wxDefaultSize );
     $self->_init_panel;
     $self->_init_properties($params);
-
+printf("%s, %s\n", $self, $self->GetId);
     $self->Refresh;
 
@@ -86,12 +86,12 @@
 	
     $self->choices(
-        $params->{choices}
+        $params->{choices}|| sub { [] }
     );
 
     $self->selection(
-        $params->{selection}
-    );
-
-    my $choices = $self->choices->() ||[];
+        $params->{selection}|| sub{ [] }
+    );
+
+    my $choices = $self->choices->();
     $self->search_result(
         []
@@ -136,5 +136,5 @@
 
     $self->listchoices(
-        Wx::CheckListBox->new( $self, -1, wxDefaultPosition, [320,300], [], 0 )
+        Wx::CheckListBox->new( $self, -1, wxDefaultPosition, [320,200], [], 0 )
     );
     $vsizer->AddWindow( $self->listchoices, 0, wxALIGN_CENTER_VERTICAL|wxALL, 2 );
Index: /extensions/pLoader/trunk/src/Uploader/GUI/wxFrameAUI.pm
===================================================================
--- /extensions/pLoader/trunk/src/Uploader/GUI/wxFrameAUI.pm	(revision 4474)
+++ /extensions/pLoader/trunk/src/Uploader/GUI/wxFrameAUI.pm	(revision 4475)
@@ -127,4 +127,7 @@
           piwigo_tags
           image_tags
+		  piwigo_photo_properties
+		  dlg_piwigo_photo_properties
+		  piwigo_photo_properties_tags
       /;
 __PACKAGE__->mk_accessors( @properties );
@@ -156,4 +159,5 @@
 use Storable;
 use Uploader::GUI::wxPropertyGridPanel;
+use Uploader::GUI::wxPhotoProperties;
 use utf8;
 $|=1;
@@ -323,5 +327,28 @@
 sub _set_setting_properties {
     my ( $self ) = @_;
-	
+
+    $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->Refresh() },
+			                                   },
+		    $main::COMMENT => { label=>gettext("Comment :")},
+			$main::PHOTO_PROPERTIES_COMMENT => { 
+			                                       value => sub { $self->imagelist->current_image->site_comment(@_) },
+			                                   },
+		    $main::AUTHOR => { label=>gettext("Author :")},
+			$main::PHOTO_PROPERTIES_AUTHOR => { 
+			                                       value => sub { $self->imagelist->current_image->site_author(@_) },
+			                                   },
+		    $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(@_) },
+			                                   },
+		    $main::PRIVACY_LEVEL => { label=>gettext("Privacy level :")},
+		}
+    );	
 
     $self->piwigo_properties(
@@ -663,4 +690,5 @@
         $self->advanced_settings_panel,
         $self->watermark_settings_panel,
+		$self->piwigo_photo_properties_tags
     );
     
@@ -710,4 +738,8 @@
 sub _refresh_settings_panels_properties {
     my ( $self ) = @_;	
+
+	$self->dlg_piwigo_photo_properties->properties(
+        $self->piwigo_photo_properties
+	);
 	
     $self->image_prop_piwigo->properties(
@@ -748,5 +780,4 @@
 sub _init_settings_panels {
     my ( $self ) = @_;	
-
 
     $self->image_prop_piwigo(
@@ -834,4 +865,23 @@
     );    
 
+    $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);
@@ -845,7 +895,6 @@
     );
 
-
+    $self->image_preview->Show(0);
     $self->image_prop_piwigo->Show(0);
-    
     $self->image_prop_exif->Show(0);
 	
@@ -916,9 +965,14 @@
         ->CenterPane->Resizable->CloseButton(0) );
 
+	$self->manager->AddPane( 
+        $self->dlg_piwigo_photo_properties, 
+        Wx::AuiPaneInfo->new->Name( "piwigo_photo_properties" )
+        ->Right->Position( 0 )->Resizable->CloseButton(0) 
+    );
 		
     $self->manager->AddPane( 
         $self->create_tree, 
         Wx::AuiPaneInfo->new->Name( "categories" )
-        ->Right->Position( 0 )->Resizable->CloseButton(0), 
+        ->Right->Position( 1 )->Resizable->CloseButton(0), 
     );
 
@@ -947,5 +1001,6 @@
     }
     else {
-        $self->manager->GetPane("categories")->MinSize(300,100);
+        $self->manager->GetPane("piwigo_photo_properties")->MinSize(600,350);
+        $self->manager->GetPane("categories")->MinSize(600,100);
 
         $self->manager->GetPane("tb1")->Caption( gettext("Tools") );
@@ -1169,6 +1224,5 @@
     }
     @$images;
-
-    
+   
     $self->tree( 
         Wx::TreeCtrl->new( 
@@ -1185,5 +1239,5 @@
 
     $self->tree->SetImageList( $self->treeimglist );
-    $self->populate_tree_categories if !wxTheApp->use_offline;
+    $self->populate_tree_categories($self->tree) if !wxTheApp->use_offline;
     $self->tree ;
 }
@@ -1191,12 +1245,11 @@
 
 sub populate_tree_categories {
-    my ( $self ) = @_;
+    my ( $self, $tree ) = @_;
 
     $self->populate_tree(
-        $self->tree,
+        $tree,
         wxTheApp->pwg->categories,
     ) if defined wxTheApp->pwg ;
     
-    #$self->tree->ExpandAll;
 
 }
@@ -1709,4 +1762,5 @@
 
     $event->Skip;
+
 }
 
@@ -1726,7 +1780,9 @@
 	}
 
+    $self->dlg_piwigo_photo_properties->SetProperties;
     $self->image_prop_piwigo->Refresh;
     $self->image_prop_exif->Refresh;
     $self->image_prop_tags->Refresh;
+	$self->piwigo_photo_properties_tags->Refresh;
 
 }
Index: /extensions/pLoader/trunk/src/Uploader/GUI/wxImageReuploadDlg.pm
===================================================================
--- /extensions/pLoader/trunk/src/Uploader/GUI/wxImageReuploadDlg.pm	(revision 4474)
+++ /extensions/pLoader/trunk/src/Uploader/GUI/wxImageReuploadDlg.pm	(revision 4475)
@@ -51,5 +51,5 @@
     	    $params->{properties}
         );
-
+        $self->InitLabels();
         $self->SetProperties();
         $self->_initEventHandlers();
@@ -70,6 +70,4 @@
     EVT_BUTTON( $self, $main::ID_REUPLOAD_OK, \&OnOK );
     EVT_CLOSE( $self, \&OnClose );
-    
-	
 }
 
Index: /extensions/pLoader/trunk/src/Uploader/GUI/wxPhotoProperties.pm
===================================================================
--- /extensions/pLoader/trunk/src/Uploader/GUI/wxPhotoProperties.pm	(revision 4475)
+++ /extensions/pLoader/trunk/src/Uploader/GUI/wxPhotoProperties.pm	(revision 4475)
@@ -0,0 +1,101 @@
+# +-----------------------------------------------------------------------+
+# | pLoader - a Perl photo uploader for Piwigo                            |
+# +-----------------------------------------------------------------------+
+# | Copyright(C) 2008      Piwigo Team                  http://piwigo.org |
+# +-----------------------------------------------------------------------+
+# | This program is free software; you can redistribute it and/or modify  |
+# | it under the terms of the GNU General Public License as published by  |
+# | the Free Software Foundation                                          |
+# |                                                                       |
+# | This program is distributed in the hope that it will be useful, but   |
+# | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+# | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+# | General Public License for more details.                              |
+# |                                                                       |
+# | You should have received a copy of the GNU General Public License     |
+# | along with this program; if not, write to the Free Software           |
+# | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+# | USA.                                                                  |
+# +-----------------------------------------------------------------------+
+package Uploader::GUI::wxPhotoProperties;
+use strict;
+use Wx qw/
+             wxDefaultSize
+             wxDefaultPosition
+             wxID_CANCEL
+             wxID_OK
+             wxGREEN
+         /;
+use base qw/Wx::Panel Uploader::GUI::DlgCommon/;
+use Wx::Event qw/
+                    EVT_UPDATE_UI
+                    EVT_BUTTON
+					EVT_CLOSE
+                /;
+
+use Carp;
+
+sub new {
+    my ($this, $params) = @_;
+    #on recupere le nom de la classe en fonction du type d'appel de la méthode.
+    my $class = ref($this) || $this;
+
+
+#    my $self = $class->SUPER::new( $params->{parentwnd}, -1, wxDefaultPosition, [600, 350]);
+    my $self = $class->SUPER::new( $params->{parentwnd}, -1, wxDefaultPosition, wxDefaultSize);
+	#$self->SetMinSize([600, 350]);
+    # load controls
+    eval {
+      &main::PhotoProperties($self, $params->{tags});
+
+	    $self->properties(
+    	    $params->{properties}
+        );
+
+        #$self->_init_values;		
+        $self->InitLabels();
+        $self->SetProperties();
+		$self->InitHandler();
+        $self->_initEventHandlers();
+
+		if($@){
+			Wx::LogMessage("Error during dialogbox initialization");
+		}
+	};
+
+    $self;    
+}
+
+
+
+sub _initEventHandlers {
+    my ( $self ) = @_;
+    
+    EVT_BUTTON( $self, $main::ID_REUPLOAD_OK, \&OnOK );
+    EVT_CLOSE( $self, \&OnClose );
+    
+	
+}
+
+
+sub OnOK {
+    my ( $self, $event ) = @_;
+    
+    $self->_close;
+}
+
+sub OnClose {
+    my ( $self, $event ) = @_;
+	
+	$self->_close;
+}
+
+sub _close {
+    my ( $self ) = @_;
+
+    $self->GetProperties();
+
+    $self->Destroy;
+}
+
+1;
