Changeset 5536 for extensions


Ignore:
Timestamp:
Apr 1, 2010, 4:18:53 PM (14 years ago)
Author:
ronosman
Message:

Feature 1561 added : upload all photos by default.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/pLoader/trunk/src/Uploader/GUI/Frame.pm

    r5472 r5536  
    15111511    my( $self, $event ) = @_;
    15121512
     1513    my $select_all = 1;
    15131514    eval {
    1514         $self->ProcessImageSelection();   
     1515        $self->ProcessImageSelection( $select_all );   
    15151516    };
    15161517}
     
    16591660# prepare and upload image_selection
    16601661sub ProcessImageSelection {
    1661     my ( $self ) = @_;
     1662    my ( $self, $select_all ) = @_;
    16621663
    16631664    return if !scalar @{$self->imagelist->sums};
     
    16661667        return unless $self->destination_category_dlg->ShowModal != wxID_CANCEL;
    16671668    }
    1668 #    else {
    1669         # all selected is implicit
    1670         if(!scalar @{$self->imageviewer->GetSelectedItems}){
     1669
     1670    $self->imagelist->image_selection(
     1671        $self->imageviewer->GetAllItems
     1672    ) if $select_all;
     1673       
     1674    return if( !defined $self->imagelist->image_selection );
     1675    return if( !scalar @{$self->imagelist->image_selection} );
    16711676       
    1672             $self->imagelist->image_selection(
    1673                 $self->imageviewer->GetAllItems
    1674             );
    1675         }
    1676        
    1677         return if( !defined $self->imagelist->image_selection );
    1678         return if( !scalar @{$self->imagelist->image_selection} );
    1679        
    1680         $self->upload_progressdlg->Destroy if defined $self->upload_progressdlg;
    1681         $self->upload_progressdlg(
    1682             Uploader::GUI::wxImageProcessingProgressDlg->new(
    1683                 {
    1684                     title    => gettext("Image upload progress information"),
    1685                     bt_label => gettext("Cancel upload"),
    1686                     bt_close_label => gettext("Close"),
    1687                     stop_processing => sub { $self->imagelist->stop_processing(1); Wx::Yield(); },
    1688                  }
    1689             )       
     1677    $self->upload_progressdlg->Destroy if defined $self->upload_progressdlg;
     1678    $self->upload_progressdlg(
     1679        Uploader::GUI::wxImageProcessingProgressDlg->new(
     1680            {
     1681                title    => gettext("Image upload progress information"),
     1682                bt_label => gettext("Cancel upload"),
     1683                bt_close_label => gettext("Close"),
     1684                stop_processing => sub { $self->imagelist->stop_processing(1); Wx::Yield(); },
     1685            }
     1686        )
     1687    );
     1688
     1689    # modeless dialog
     1690    $self->upload_progressdlg->Show(1);
     1691    Wx::Yield();
     1692    eval {
     1693        $self->imagelist->UploadSelection;
     1694    };
     1695    if($@){
     1696        Wx::MessageBox(
     1697            sprintf(
     1698                gettext("Upload cancelled"),
     1699            ),
     1700            gettext("Piwigo upload information"),
     1701            wxOK | wxICON_INFORMATION,
    16901702        );
    1691         # modeless dialog
    1692         $self->upload_progressdlg->Show(1);
    1693         Wx::Yield();
    1694         eval {
    1695             $self->imagelist->UploadSelection;
    1696         };
    1697         if($@){
    1698             Wx::MessageBox(
    1699                 sprintf(
    1700                     gettext("Upload cancelled"),
    1701                 ),
    1702                 gettext("Piwigo upload information"),
    1703                 wxOK | wxICON_INFORMATION,
    1704             );
    1705         }
    1706     #}
     1703    }
    17071704}
    17081705
Note: See TracChangeset for help on using the changeset viewer.