Ignore:
Timestamp:
Sep 28, 2008, 11:35:44 AM (16 years ago)
Author:
ronosman
Message:

Bugs fixed :

  • Crash when uploading or deleting without selection. Add selection test and catch exceptions.
  • Piwigo login errors are not logged. Add a message box for login return status + "Not connected" message in title bar.
  • Global settings view and Photo properties view : Update buttons are not always visible. Change label to "Save" and left align
  • Missing resource for notebook cause "can't load file errors". Now catch these exceptions.
  • Missing libraries for Image Magick ( not detected by dependency scan ). Add them in build script.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • extras/pLoader/trunk/src/Uploader/GUI/wxApp.pm

    r2597 r2618  
    3535             wxFRAME_NO_TASKBAR wxSTAY_ON_TOP
    3636             wxWHITE
     37             wxICON_EXCLAMATION
     38             wxOK
    3739         /;
    3840use Uploader::GUI::wxFrameAUI;
     
    4547use Uploader::ImageList;
    4648use Uploader::GUI::wxLoginDlg;
     49
    4750$|=1;
    4851
     
    114117
    115118    my $ok = $self->Login();
     119    # user pressed OK
    116120    if($ok){
    117 
    118 
    119     $self->pwg(
    120         # get these parameters from dialog or from file
    121         Uploader::PWG->new(
    122             {
    123                 site_url       => $self->site_url,
    124                 site_username  => $self->site_username,
    125                 site_password  => $self->site_password,
    126             }
    127         )
    128     );
    129    
    130 
    131     $self->_init_imagelist;
    132     $self->_init_thumbimagelist;
    133    
    134     $self->_init_frame;
     121        $self->pwg(
     122            # get these parameters from dialog or from file
     123            Uploader::PWG->new(
     124                {
     125                    site_url       => $self->site_url,
     126                    site_username  => $self->site_username,
     127                    site_password  => $self->site_password,
     128                }
     129            )
     130        );
     131     
     132   
     133        $self->_init_imagelist;
     134        $self->_init_thumbimagelist;
     135       
     136        $self->_init_frame;
    135137    }
    136138
     
    326328
    327329sub _init_frame {
    328         my ( $self ) = @_ ;     
    329 
    330         my $config = Wx::ConfigBase::Get;
    331 
    332         my $x = $config->ReadInt( "X", 50 );
    333         my $y = $config->ReadInt( "Y", 50 );
    334         my $w = $config->ReadInt( "Width", 800 );
    335         my $h = $config->ReadInt( "height", 600 );
    336         my $sv = $config->ReadInt( "splitVertical", 150 );
    337         my $sh = $config->ReadInt( "splitHorizontal", 300 );
    338        
    339 
    340         my $url = $self->site_url || "Not attached to a Piwigo site";
    341 
    342         my ( $frame ) = Uploader::GUI::wxFrameAUI->new(
    343             {
    344                 x              => $x,
    345                 y              => $y,
    346                 width          => $w,
    347                 height         => $h,
    348                 title          => "pLoader - Piwigo uploader - [$url]" ,
    349                 pwg            => $self->pwg,
    350                 imagelist      => $self->imagelist,
    351             }
    352         );
     330    my ( $self ) = @_ ;
     331
     332    my $config = Wx::ConfigBase::Get;
     333
     334    my $x = $config->ReadInt( "X", 50 );
     335    my $y = $config->ReadInt( "Y", 50 );
     336    my $w = $config->ReadInt( "Width", 1024 );
     337    my $h = $config->ReadInt( "height", 768 );
     338    my $sv = $config->ReadInt( "splitVertical", 150 );
     339    my $sh = $config->ReadInt( "splitHorizontal", 300 );
     340       
     341    my $url;
     342    if($self->pwg->login_result->{stat} eq 'ok'){
     343        $url = $self->site_url;   
     344    }
     345    else{
     346        $url = "Not connected";
     347        Wx::MessageBox(
     348            sprintf(
     349                "%s\n\nConnection to %s failed",
     350                $self->pwg->login_result->{message},
     351                $self->site_url,
     352            ),
     353            "Piwigo login error",
     354            wxOK | wxICON_EXCLAMATION,
     355        );
     356    }   
     357       
     358
     359    my ( $frame ) = Uploader::GUI::wxFrameAUI->new(
     360        {
     361            x         => $x,
     362            y         => $y,
     363            width     => $w,
     364            height    => $h,
     365            title     => "pLoader - Piwigo uploader - [$url]" ,
     366            pwg       => $self->pwg,
     367            imagelist => $self->imagelist,
     368        }
     369    );
    353370       
    354371        #printf("Config x %s, y %s, w %s, h %s\n", $x, $y, $w, $h);
    355372        #$frame->SetSize( $x, $y, $w, $h );
    356         $frame->Show( 1 );
    357         $self->SetTopWindow( $frame );
    358 
    359         my $icon = Wx::Icon->new();
    360         $icon->LoadFile('../res/favicon.ico', wxBITMAP_TYPE_ICO);
    361         $frame->SetIcon($icon);
    362 
    363 
    364         return 1;
     373    $frame->Show( 1 );
     374    $self->SetTopWindow( $frame );
     375
     376    my $icon = Wx::Icon->new();
     377    $icon->LoadFile('../res/favicon.ico', wxBITMAP_TYPE_ICO);
     378    $frame->SetIcon($icon);     
     379
     380
     381    return 1;
    365382}
    366383
Note: See TracChangeset for help on using the changeset viewer.