Index: /extensions/pLoader/trunk/src/Uploader/GUI/wxApp.pm
===================================================================
--- /extensions/pLoader/trunk/src/Uploader/GUI/wxApp.pm	(revision 3457)
+++ /extensions/pLoader/trunk/src/Uploader/GUI/wxApp.pm	(revision 3458)
@@ -302,4 +302,5 @@
           thumb_dir
           conf_file
+          layout_file
           locale
           current_language
@@ -310,4 +311,7 @@
           branding
           frame
+          perspective
+          imageviewerIndex
+          frameLayout
       / 
 );
@@ -331,5 +335,5 @@
     # to check if we can use stored cache
     $self->imagelist_version(
-        '3'
+        '4'
     );
 
@@ -349,4 +353,5 @@
 
     my $conf = retrieve $self->conf_file if -e $self->conf_file;	
+    my $layout = retrieve $self->layout_file if -e $self->layout_file;	
 
     if(defined $conf ){
@@ -355,4 +360,8 @@
     else {
         $self->_readParams( 'pLoader.ini' ) unless defined $conf ;
+    }
+
+    if(defined $layout ){
+        $self->SetKeyValues($layout);
     }
 
@@ -467,4 +476,24 @@
             },
             $self->conf_file
+        );
+    };
+}
+
+sub StoreLayoutProperties {
+    my ( $self ) = @_;
+
+    eval {    
+        store( 
+            {
+                map{
+                   $_ => $self->{$_},
+                }
+                qw/
+                      perspective
+                      imageviewerIndex
+                      frameLayout
+                /
+            },
+            $self->layout_file
         );
     };
@@ -540,5 +569,5 @@
       	filter           => 'Lanczos',
       	blur             => 0.9,
-      	quality          => 100,
+      	quality          => 95,
       	wx_quality       => 80,
       	th_quality       => 90,
@@ -658,5 +687,10 @@
     );
 
-    
+    $self->layout_file(
+        File::Spec->catfile(
+            $self->userdata_dir, 
+            ".$applicationName.layout"
+        )
+    );
 
     $self->storable_file(
@@ -895,17 +929,4 @@
     my ( $self ) = @_;	
 
-    my $config = Wx::ConfigBase::Get;
-
-    my $x = $config->ReadInt( "X", 50 );
-    my $y = $config->ReadInt( "Y", 50 );
-    my $w = $config->ReadInt( "Width", 1024 );
-    my $h = $config->ReadInt( "height", 768 );
-    my $prev_w = $config->ReadInt( "PreviewWidth", 400 );
-    my $prev_h = $config->ReadInt( "PreviewHeight", 300 );
-    my $perspective = $config->Read( "Perspective" );
-    my $imageviewer_index = $config->ReadInt( "ImageviewerIndex", 0 );
-    
-    #printf("Config x %s, y %s, w %s, h %s, prev_w %s, prev_h %s\n", $x, $y, $w, $h, $prev_w, $prev_h);
-    
     my $url = $self->site_url;
     
@@ -917,20 +938,14 @@
         Uploader::GUI::wxFrameAUI->new( 
             {
-                x         => $x,
-                y         => $y,
-                width     => $w,
-                height    => $h,
                 title     => sprintf("pLoader - Piwigo uploader %s - [%s]", $self->version, $url),
                 pwg       => $self->pwg,
                 imagelist => $self->imagelist,
-                preview_w => $prev_w,
-                preview_h => $prev_h,
-                perspective => $perspective,
-                imageviewer_index => $imageviewer_index,
+                perspective => $self->perspective,
+                imageviewer_index => $self->imageviewerIndex,
+                frameLayout => $self->frameLayout,
             }
         )
     );
-	
-    $self->frame->SetSize( $x, $y, $w, $h );
+ 
     $self->frame->Show( 1 );
     $self->SetTopWindow( $self->frame );
Index: /extensions/pLoader/trunk/src/Uploader/GUI/wxFrameAUI.pm
===================================================================
--- /extensions/pLoader/trunk/src/Uploader/GUI/wxFrameAUI.pm	(revision 3457)
+++ /extensions/pLoader/trunk/src/Uploader/GUI/wxFrameAUI.pm	(revision 3458)
@@ -337,6 +337,4 @@
           toolbar
           branding
-          preview_w
-          preview_h
           perspective
           current_imageviewer_index
@@ -344,4 +342,5 @@
           tree_mnu
           imageviewer_select_multi
+          frameLayout
       /;
 __PACKAGE__->mk_accessors( @properties );
@@ -382,16 +381,10 @@
                                       undef, 
                                       -1, 
-                                      $params->{title}, 
-                                      [ $params->{x}, $params->{y} ],
-                                      [ $params->{width}, $params->{height} ],
+                                      $params->{title},
+                                      wxDefaultPosition,
+                                      wxDefaultSize, 
                                       wxDEFAULT_FRAME_STYLE
                                    );
-    $self->preview_w(
-        $params->{preview_w}||400
-    );
-
-    $self->preview_h(
-        $params->{preview_h}||300
-    );
+
     
     $self->perspective(
@@ -401,4 +394,8 @@
     $self->current_imageviewer_index(
         $params->{imageviewer_index}||0
+    );
+    
+    $self->frameLayout(
+        $params->{frameLayout} || { 'pX' => -1, 'pY' => -1, W => 800, H => 600 }
     );
 
@@ -871,7 +868,5 @@
             $self,
             -1,
-            wxNullBitmap,
-            wxDefaultPosition,
-            [$self->preview_w, $self->preview_h]
+            [400,300],
         )
     );
@@ -954,7 +949,9 @@
         ->CenterPane->Position(1)->Resizable->CloseButton(0) );
 
-    $self->manager->AddPane
-      ( $self->create_tree, Wx::AuiPaneInfo->new->Name( "categories" )
-        ->Right->Position( 0 )->Resizable->CloseButton(0) );
+    $self->manager->AddPane( 
+        $self->create_tree, 
+        Wx::AuiPaneInfo->new->Name( "categories" )
+        ->Right->Position( 0 )->Resizable->CloseButton(0), 
+    );
 
 
@@ -970,22 +967,33 @@
         ->ToolbarPane->Top->Row( 1 )->LeftDockable( 0 )->RightDockable( 0 ) ) if defined $self->toolbar;
 
+    $self->SetSize( 
+            $self->frameLayout->{pX}, 
+            $self->frameLayout->{pY}, 
+            $self->frameLayout->{W}, 
+            $self->frameLayout->{H}, 
+    );
+
+
     if($self->perspective){
-        $self->manager->LoadPerspective($self->perspective) if $self->perspective =~ /getting_started/;
+        $self->manager->LoadPerspective($self->perspective);
+    }
+    else {
+        $self->manager->GetPane("categories")->MinSize(300,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("categories")->Caption(
           sprintf("%s - %s", sprintf("Piwigo %s", wxTheApp->branding->{categories}), $url )
-      );
-
-    $self->manager->GetPane("preview")->Caption(gettext("Preview"));
-    $self->manager->GetPane("tb1")->Caption( gettext("Tools") );
-    $self->manager->GetPane("photo_properties")->Caption(gettext("Photo properties"));
-    $self->manager->GetPane("global_settings")->Caption(gettext("Global settings"));
-    $self->manager->GetPane("getting_started")->Caption(gettext("Getting started"));
-
+    );
     
     $self->manager->Update;
 
 }
+
 
 sub _init_aui_settings_panels {
@@ -993,7 +1001,6 @@
 
     $self->manager->AddPane
-      ( $self->image_preview, Wx::AuiPaneInfo->new->Name( "preview" )
+      ( $self->image_preview, Wx::AuiPaneInfo->new->Name( "image_preview" )
         ->Floatable(1)->Fixed->CloseButton(1));
-
 
     $self->manager->AddPane
@@ -1001,5 +1008,4 @@
        ->Floatable(1)->Resizable->CloseButton(1) );
 
-
     $self->manager->AddPane
       ( $self->create_notebook_image_properties, Wx::AuiPaneInfo->new->Name( "photo_properties" )
@@ -1010,10 +1016,4 @@
         ->Floatable(1)->Resizable->CloseButton(1) );
 
-    $self->manager->GetPane("preview")->Show(0);
-    $self->manager->GetPane("photo_properties")->Show(0);
-    $self->manager->GetPane("global_settings")->Show(0);
-    $self->manager->GetPane("getting_started")->Float;
-    $self->manager->GetPane("getting_started")->Show(1);
-	
 }
 
@@ -1029,5 +1029,5 @@
     my ( $self ) = @_;
 
-    $self->manager->GetPane("preview")->Float->Show(1);
+    $self->manager->GetPane("image_preview")->Float->Show(1);
     $self->manager->Update();    
 	
@@ -1701,5 +1701,5 @@
 
     my $size = [8+$bmp->GetWidth, 26+$bmp->GetHeight];
-    $self->manager->GetPane("preview")->FloatingSize($size);
+    $self->manager->GetPane("image_preview")->FloatingSize($size);
     
     $self->image_preview->Refresh;
@@ -1942,14 +1942,21 @@
     wxTheApp->login_dlg->Destroy;	
 
-    my $params = {};
-
-    ( $params->{'X'}, $params->{'Y'} ) = $self->GetPositionXY ;
-    ( $params->{'Width'}, $params->{'Height'} ) = $self->GetSizeWH ;
-    ( $params->{'PreviewWidth'}, $params->{'PreviewHeight'} ) = $self->image_preview->GetSizeWH ;
-    $params->{Perspective} = $self->manager->SavePerspective;
-    $params->{ImageviewerIndex} = $self->current_imageviewer_index;
-    
-
-    wxTheApp->SaveConfig( $params );
+    wxTheApp->perspective(
+        $self->manager->SavePerspective
+    );
+    
+    wxTheApp->imageviewerIndex(
+        $self->current_imageviewer_index
+    );
+    
+    my $frameLayout = {};
+    
+    ( $frameLayout->{pX}, $frameLayout->{pY}, $frameLayout->{W}, $frameLayout->{H} ) = ( $self->GetPositionXY, $self->GetSizeWH ) ; 
+    
+    wxTheApp->frameLayout(
+        $frameLayout
+    );
+
+    wxTheApp->StoreLayoutProperties;
 
     $self->Destroy;
