Index: extensions/pLoader/trunk/src/Uploader/GUI/Frame.pm
===================================================================
--- extensions/pLoader/trunk/src/Uploader/GUI/Frame.pm	(revision 5260)
+++ extensions/pLoader/trunk/src/Uploader/GUI/Frame.pm	(revision 5261)
@@ -20,11 +20,9 @@
 package Uploader::GUI::Frame;
 use strict;
+use Data::Dumper;
 use Carp;
 use Wx;
 use Wx::DND;
 use Wx qw/
-             wxSP_3DBORDER
-             wxSP_3D
-             wxNO_FULL_REPAINT_ON_RESIZE
              wxCLIP_CHILDREN
              wxYES_NO
@@ -32,5 +30,4 @@
              wxICON_QUESTION
              wxITEM_NORMAL
-             wxNullBitmap
              wxID_OK
              wxDEFAULT_FRAME_STYLE
@@ -50,7 +47,4 @@
              wxFD_OPEN
              wxFD_MULTIPLE
-             wxLI_HORIZONTAL
-             wxALIGN_CENTER_VERTICAL
-             wxALIGN_CENTER_HORIZONTAL
              wxALL
              wxGROW
@@ -59,11 +53,8 @@
              wxTheApp
              wxIMAGE_LIST_NORMAL
-             wxAUI_NB_TAB_MOVE
-             wxAUI_NB_TAB_SPLIT
              wxNO_BORDER
              wxTE_MULTILINE
              wxTE_READONLY
              wxITEM_NORMAL 
-             wxCLIP_CHILDREN
              wxBORDER_NONE
              wxNullBitmap 
@@ -81,4 +72,8 @@
              wxVERTICAL
              wxEXPAND
+             wxSWISS
+             wxNORMAL
+             wxBOLD
+             wxALIGN_CENTER
          /;
 use base qw/Wx::Frame Class::Accessor::Fast/;
@@ -755,4 +750,7 @@
     );
 
+    $self->init_empty_category_msg;
+    $self->set_empty_tree_panel_evt_paint;
+    $self->show_pwg_categories_empty_msg;
 
     $self->init_dnd_targets;
@@ -960,6 +958,83 @@
 
     $self->tree->SetImageList( $self->treeimglist );
-    $self->populate_tree_categories if !wxTheApp->use_offline;
+    if(wxTheApp->use_offline){
+        $self->tree->Enable(0);
+    }
+    else{
+        $self->populate_tree_categories ;
+    }
+
     $self->tree ;
+}
+
+
+sub set_empty_tree_panel_evt_paint{
+    my ( $self ) = @_;
+    Wx::Event::EVT_PAINT( $self->tree, sub {
+            my ( $tree, $event ) = @_;
+            if(exists $tree->{_empty_panel} and ! exists $tree->{_empty_panel}{_paint}){
+                my ($w, $h) = $tree->GetSizeWH;
+                my ($x, $y) = $tree->{_empty_panel}->GetPositionXY;
+
+                $tree->{_empty_panel}{x} = $x if !exists $tree->{_empty_panel}{x} ;
+                $tree->{_empty_panel}{y} = $y if !exists $tree->{_empty_panel}{y};
+                my ($wp, $hp) = $tree->{_empty_panel}->GetSizeWH;
+                my $x_off = ($w-$wp)/2 > 0 ? ($w-$wp)/2 : 0;
+                my $y_off = ($h-$hp)/2 > 0 ? ($h-$hp)/2 : 0;
+                $tree->{_empty_panel}->Move(
+                    [
+                        $tree->{_empty_panel}{x}+$x_off,
+                        $tree->{_empty_panel}{y}+$y_off
+                    ]
+                );
+                $tree->{_empty_panel}{_paint} = 1;
+            }
+            $event->Skip;
+        }
+    ) if 1;
+
+}
+
+
+sub init_empty_category_msg {
+
+    my ( $self ) = @_;
+    # add a panel
+    my $empty_panel = Wx::Panel->new($self->tree, -1, wxDefaultPosition, wxDefaultSize);
+    my( $item0 ) = Wx::BoxSizer->new( wxVERTICAL );
+    
+    my $fb = Wx::Font->new( 12, wxSWISS, wxNORMAL, wxBOLD );
+
+
+    my( $item1 ) = Wx::Button->new(
+        $empty_panel,
+        $main::CATEGORIES_ADD,
+        wxTheApp->branding->{'Add new category'},
+        wxDefaultPosition,
+        [-1,40],
+        0
+    );
+    my $btfont = Wx::Font->new(12, wxSWISS, wxNORMAL, wxNORMAL );
+    $item1->SetFont($btfont);
+    $item0->AddWindow( $item1, 0, wxALIGN_CENTER|wxALL, 5 );
+
+
+    $empty_panel->SetSizer( $item0 );
+    $item0->SetSizeHints( $empty_panel );
+
+    $self->tree->{_empty_panel} = $empty_panel;
+    $self->tree->{_empty_panel}->SetBackgroundColour(wxWHITE);
+
+    my ($wp, $hp) = $self->tree->{_empty_panel}->GetSizeWH;
+
+    $self->tree->SetMinSize( [20+$wp, -1 ]);
+
+}
+
+
+sub pwg_categories_are_empty {
+    my ( $self ) = @_;
+
+    scalar @{wxTheApp->pwg->categories} < 1 ? 1 : 0 ;
 }
 
@@ -972,7 +1047,18 @@
         wxTheApp->pwg->categories,
     ) if defined wxTheApp->pwg ;
-    
-
-}
+}
+
+
+sub show_pwg_categories_empty_msg {
+    my ( $self ) = @_;
+
+    if($self->pwg_categories_are_empty){
+        $self->tree->{_empty_panel}->Show(1);
+    }
+    else{
+        $self->tree->{_empty_panel}->Show(0);
+    }
+}
+
 
 
@@ -1168,4 +1254,6 @@
     Wx::Event::EVT_BUTTON( $self, $self->imageviewer->add_button->GetId, \&OnAddImages );
 
+    Wx::Event::EVT_BUTTON( $self, $main::CATEGORIES_ADD, \&OnAddCategories );
+
     # only refresh when calling event is finished
     Wx::Event::EVT_IDLE(
@@ -1440,7 +1528,10 @@
 
         if($success){
+            $self->tree->{_empty_panel}->Show(0);
             $self->_append_category($parent_item, $name, $content->{result}{id});
         }
     }
+
+
     $dialog->Destroy;
 }
@@ -1462,4 +1553,5 @@
     $self->pwg->RefreshCategories();
     $self->populate_tree_categories;
+    $self->show_pwg_categories_empty_msg;
 }
 
@@ -1798,5 +1890,16 @@
     return if !scalar @{$self->imagelist->sums};
 
-    if( scalar @{$self->imagelist->categories} ){
+    if( $self->destination_categories_are_empty ){
+        Wx::MessageBox( 
+            sprintf(
+                "%s", 
+                wxTheApp->branding->{'What is the destination category?'}
+            ),
+            gettext("Piwigo upload error"),
+            wxOK | wxICON_EXCLAMATION, 
+        );
+
+    }
+    else {
         # all selected is implicit
         if(!scalar @{$self->imageviewer->GetSelectedItems}){
@@ -1837,14 +1940,11 @@
         }
     }
-    else {
-        Wx::MessageBox( 
-            sprintf(
-                "%s", 
-                wxTheApp->branding->{'What is the destination category?'}
-            ),
-            gettext("Piwigo upload error"),
-            wxOK | wxICON_EXCLAMATION, 
-        );
-    }
+}
+
+
+sub destination_categories_are_empty {
+    my ( $self ) = @_;
+
+    !scalar @{$self->imagelist->categories};
 }
 
Index: extensions/pLoader/trunk/src/Uploader/GUI/Layout/PhotoPropertiesCategoriesTags.pm
===================================================================
--- extensions/pLoader/trunk/src/Uploader/GUI/Layout/PhotoPropertiesCategoriesTags.pm	(revision 5260)
+++ extensions/pLoader/trunk/src/Uploader/GUI/Layout/PhotoPropertiesCategoriesTags.pm	(revision 5261)
@@ -111,4 +111,5 @@
 use vars qw($PRIVACY_LEVEL); $PRIVACY_LEVEL = 10014;
 use vars qw($PHOTO_PROPERTIES_PRIVACY_LEVEL); $PHOTO_PROPERTIES_PRIVACY_LEVEL = 10015;
+
 
 sub photo_properties_caption_comments {
@@ -399,4 +400,8 @@
 }
 
+
+use vars qw($CATEGORIES_ADD); $CATEGORIES_ADD = 10020;
+
+
 1;
 
