Changeset 3387 for extensions


Ignore:
Timestamp:
Jun 2, 2009, 3:55:51 PM (15 years ago)
Author:
ronosman
Message:

Feature 989 added : Global settings option to remove uploaded photos from selection.

Location:
extensions/pLoader/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • extensions/pLoader/trunk/locale/fr_FR/pLoader.po

    r3288 r3387  
    144144
    145145msgid "Photo selection"
    146 msgstr "Photo sélectionnées"
     146msgstr "Photos sélectionnées"
    147147
    148148msgid "Language choice"
     
    334334msgid "Cancel image processing"
    335335msgstr "Annuler le traitement d'image"
     336
     337msgid "Add new album"
     338msgstr "Ajouter un nouvel album"
     339
     340msgid "Refresh"
     341msgstr "Actualiser"
     342
     343msgid "Expand all"
     344msgstr "Afficher tout"
     345
     346msgid "Collapse all"
     347msgstr "Réduire tout"
     348
     349msgid "Getting started"
     350msgstr "Démarrer"
     351
     352msgid "Properties"
     353msgstr "Propriétés"
     354
     355msgid "Remove uploaded photo from selection :"
     356msgstr "Vider la sélection photo après transfert :"
  • extensions/pLoader/trunk/src/Uploader/GUI/wxFrameAUI.pm

    r3384 r3387  
    618618                value   => sub { $self->imagelist->upload_high(@_) },
    619619            },
    620 #            {
    621 #                label     => gettext("Remove uploaded photo from selection :"),
    622 #                type      => 'Bool',
    623 #                value  => sub { $self->imagelist->remove_uploaded_from_selection(@_) },
    624 #            },
     620            {
     621                label     => gettext("Remove uploaded photo from selection :"),
     622                type      => 'Bool',
     623                value   => sub { $self->imagelist->remove_uploaded_from_selection(@_) },
     624            },
    625625        ]   
    626626    );
     
    12181218    my ( $self, $tree, $tree_items ) = @_;
    12191219    my $root = shift @{$tree_items};
     1220
    12201221    $self->tree_root(
    12211222        $tree->AddRoot(
     
    12281229
    12291230  $self->populate_tree_helper( $tree, $self->tree_root, $tree_items );
    1230 
     1231 
     1232  $tree->SelectItem( $self->tree_root );
    12311233  $tree->Expand( $self->tree_root );
    12321234}
     
    14641466            $self->toolbar->EnableTool(104, 1);                 
    14651467        }
     1468
    14661469        if($self->manager->GetPane("getting_started")->IsShown){
    14671470            $self->toolbar->EnableTool(100, 0);                 
     
    15561559    my $parent_item = $self->tree->GetSelection;
    15571560    $self->tree->ExpandAllChildren($parent_item);
     1561    $self->tree->EnsureVisible($parent_item);
    15581562}
    15591563
     
    15631567    my $parent_item = $self->tree->GetSelection;
    15641568    $self->tree->CollapseAllChildren($parent_item);
     1569    $self->tree->Expand($parent_item) if -1 == $self->tree->GetPlData($parent_item);
    15651570}
    15661571
     
    15871592
    15881593        if($success){
    1589             $self->_append_category($parent_item, $name, $content->{id});
     1594            $self->_append_category($parent_item, $name, $content->{result}{id});
    15901595        }
    15911596    }
     
    16201625            1,
    16211626            -1,
    1622             itemData($id)
     1627            Wx::TreeItemData->new( { id => $id } )
    16231628        )
    16241629    );
     
    17281733    my ( $self ) = @_; 
    17291734
    1730     my $imagelist= $self->imagelist ;
    1731 
     1735    $self->imageviewer->Refresh;
    17321736    Wx::Yield();
    17331737}
  • extensions/pLoader/trunk/src/Uploader/ImageList.pm

    r3366 r3387  
    9090                version
    9191                imagelist_version
     92                uploaded_images
    9293     /
    9394);
     
    9798    my ( $self ) = @_;
    9899   
     100    $self->uploaded_images([]);
    99101   
    100102}
     
    495497    return if (! defined $self->image_selection );
    496498   
     499    $self->_remove_image_list($self->image_selection);
     500    # clear image selection
     501    $self->image_selection([]);
     502}
     503
     504sub _remove_image_list {
     505    my ( $self, $list ) = @_;
     506
    497507    # higher first, to keep same indexes during remove
    498     my @images = reverse @{$self->image_selection};     
     508    my @images = reverse @$list;     
    499509    map {
    500         #my $image = $self->GetImage($_)->file;
    501510        $self->DeleteImage($_);
    502511        splice @{$self->sums}, $_, 1 ;
     
    505514    }
    506515    @images;
    507    
    508     # clear image selection
    509     $self->image_selection([]);
     516}
     517
     518sub RemoveImage {
     519    my ( $self, $index ) = @_;
     520
     521    return if (! defined $self->image_selection );
     522    return if (! defined $index );
     523       
     524    $self->DeleteImage($index);
     525    splice @{$self->sums}, $index, 1 ;
     526    $self->wx_thumb_imglist->Remove($index);
     527       
    510528}
    511529
     
    10271045        croak "Upload cancelled. ", $@ if $@ ;
    10281046       
     1047        print "image_selection ", Dumper $_;
     1048        push @{$self->uploaded_images}, $_;
    10291049    }
    10301050    @{$self->image_selection} if defined
    10311051        $self->image_selection;
    10321052
     1053    if($self->remove_uploaded_from_selection){
     1054        $self->_remove_image_list($self->uploaded_images);
     1055        $viewer_callback->();
     1056    }
    10331057    my $time_end = time;
    10341058    my $duration = $time_end - $time_begin;
Note: See TracChangeset for help on using the changeset viewer.