Changeset 4478


Ignore:
Timestamp:
Dec 13, 2009, 6:42:29 PM (14 years ago)
Author:
ronosman
Message:

Bug 1322 fixed : clear photo properties panel after the last photo is deleted from photo selection.

Location:
extensions/pLoader/trunk/src/Uploader
Files:
4 edited

Legend:

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

    r4477 r4478  
    9494};     
    9595
     96my $clear_value = {
     97    'Wx::TextCtrl' => sub { my ($ctrl) = @_; $ctrl->Clear},
     98    'Wx::CheckBox' => sub { my ($ctrl) = @_; $ctrl->SetValue(0)},
     99    'Wx::DatePickerCtrl' => sub { my ($ctrl) = @_; $ctrl->SetValue(Wx::DateTime->new->SetToCurrent)},
     100};     
     101
    96102sub SetProperties {
    97103    my ( $self ) = @_;
     
    177183}
    178184
     185sub ClearProperties {
     186    my ( $self ) = @_;
     187       
     188        map {
     189        my $ctrl =$self->FindWindow($_);
     190        if(defined $ctrl){
     191                # checkbox, static text
     192            $clear_value->{ref $ctrl}->(
     193                        $ctrl
     194                    ) if exists  $clear_value->{ref $ctrl};
     195                    # only works for control with items
     196                    $ctrl->SetSelection(
     197                        -1                     
     198                    ) if exists $self->properties->{$_}->{selection};
     199                }
     200    }
     201        keys %{$self->properties};
     202
     203}
    1792041;
  • extensions/pLoader/trunk/src/Uploader/GUI/wxChoiceFilteredPanel.pm

    r4475 r4478  
    183183}
    184184
     185sub ClearAllSelection {
     186    my ( $self ) = @_;
     187
     188    my $row = 0;
     189   
     190    my $choices = $self->choices->();
     191    map {
     192        $self->listchoices->Check($row, 0) ;   
     193        $row++;
     194    }@$choices;
     195
     196       
     197}
    185198
    186199sub SetSelection {
  • extensions/pLoader/trunk/src/Uploader/GUI/wxFrameAUI.pm

    r4476 r4478  
    15271527    $self->imageviewer->Refresh;       
    15281528
    1529     $self->image_preview->image(
    1530         0
    1531     ) if !$self->imageviewer->GetItemCount;
     1529        if (!$self->imageviewer->GetItemCount){
     1530        $self->image_preview->image(
     1531            0
     1532        );
     1533            # have to reset
     1534                $self->dlg_piwigo_photo_properties->ClearProperties;
     1535        $self->piwigo_photo_properties_tags->ClearAllSelection;
     1536                $self->imagelist->SetCurrentImage(-1);
     1537        }
    15321538
    15331539    $self->image_preview->Refresh;
     
    17581764sub OnImageViewerItemSelected {
    17591765    my( $self, $event ) = @_;
    1760  
    17611766    my $bc = Wx::BusyCursor->new;
    17621767
  • extensions/pLoader/trunk/src/Uploader/ImageList.pm

    r4476 r4478  
    230230
    231231    $self->current_image(
    232         $self->GetImage($indx)
     232        $indx != -1 ? $self->GetImage($indx) : Uploader::Image->new()
    233233    );
    234234}
Note: See TracChangeset for help on using the changeset viewer.