Changeset 4568 for extensions/pLoader


Ignore:
Timestamp:
Dec 27, 2009, 9:19:46 AM (14 years ago)
Author:
ronosman
Message:

Just code reindent : replace tabs with spaces.

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

Legend:

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

    r4507 r4568  
    3030             wxLC_EDIT_LABELS
    3131             wxLC_ICON
    32                         wxLC_REPORT
     32            wxLC_REPORT
    3333             wxLC_SMALL_ICON
    3434             wxIMAGE_LIST_NORMAL
     
    3838             wxLC_VIRTUAL
    3939             wxLC_REPORT
    40                         wxLC_AUTOARRANGE
     40            wxLC_AUTOARRANGE
    4141             wxBORDER_THEME
    4242             wxLIST_HITTEST_ONITEM
     
    4545             wxLIST_STATE_DONTCARE
    4646             wxLIST_STATE_FOCUSED
    47                         wxIMAGE_LIST_SMALL
     47            wxIMAGE_LIST_SMALL
    4848         /;
    4949use Wx::Event qw/
    5050                    EVT_LIST_BEGIN_DRAG
    5151                    EVT_LIST_ITEM_SELECTED
    52                                         EVT_SIZE
     52                    EVT_SIZE
    5353                /;
    5454         
     
    6060          imagelist
    6161          wx_imagelist
    62                   image_size
    63                   arrange_items
    64                   styles
    65                   insert_items
    66                   initialize
    67                   columns
    68                   change_display_mode
    69                   wx_img
    70                   item_refresh
     62          image_size
     63          arrange_items
     64          styles
     65          insert_items
     66          initialize
     67          columns
     68          change_display_mode
     69          wx_img
     70          item_refresh
    7171      /
    7272);
     
    8383        wxDefaultPosition,
    8484        wxDefaultSize,
    85                 wxNO_BORDER
    86     );
    87        
    88         $self->wx_img(
     85        wxNO_BORDER
     86    );
     87   
     88    $self->wx_img(
    8989        Wx::ImageList->new( 16, 16, 1 )
    90         );
    91         $self->wx_img->Add(
    92         Wx::Bitmap->new( '../res/image.png', wxBITMAP_TYPE_PNG )       
    93         );
     90    );
     91    $self->wx_img->Add(
     92        Wx::Bitmap->new( '../res/image.png', wxBITMAP_TYPE_PNG )   
     93    );
    9494
    9595    $self->imagelist(
     
    105105    );
    106106
    107         $self->columns(
    108             $params->{columns}
    109         );
    110         print Dumper $self->columns;
     107    $self->columns(
     108        $params->{columns}
     109    );
     110    print Dumper $self->columns;
    111111    $self->prevItemCount(-1);
    112112
     
    116116            my ( $this, $event ) = @_;
    117117   
    118                         $this->arrange_items(1);
     118            $this->arrange_items(1);
    119119            $event->Skip();
    120120        }
    121121    );
    122        
    123         Wx::Event::EVT_IDLE(
    124             $self,
    125                 sub {
    126                     my ($self, $event)=@_;
    127 
    128                         if($self->arrange_items){
    129                             $self->Refresh;
    130                             $self->arrange_items(0);
    131                         }
    132                         if($self->change_display_mode){
    133                             my $dm = $self->imagelist->display_mode;
    134                     $self->initialize->{$dm}->($self) if exists $self->initialize->{$dm};
    135                             $self->Refresh;
     122   
     123    Wx::Event::EVT_IDLE(
     124        $self,
     125        sub {
     126            my ($self, $event)=@_;
     127
     128            if($self->arrange_items){
     129                $self->Refresh;
     130                $self->arrange_items(0);
     131            }
     132            if($self->change_display_mode){
     133                my $dm = $self->imagelist->display_mode;
     134                   $self->initialize->{$dm}->($self) if exists $self->initialize->{$dm};
     135                $self->Refresh;
    136136                $self->change_display_mode(0);
    137                         }
    138                 }
    139         );
    140        
    141         $self->initialize(
    142             {
     137        }
     138        $event->Skip;
     139        }
     140    );
     141   
     142    $self->initialize(
     143        {
    143144
    144145            'Thumbnail' => sub {  my ( $self ) = @_;
    145                                                                 $self->Freeze;
    146                                                                 $self->ClearAll;
    147                                                                 $self->SetSingleStyle(wxLC_ICON);
    148                                                                 $self->SetSingleStyle(wxLC_EDIT_LABELS, 0);
     146                                $self->Freeze;
     147                                $self->ClearAll;
     148                                $self->SetSingleStyle(wxLC_ICON);
     149                                $self->SetSingleStyle(wxLC_EDIT_LABELS, 0);
    149150                                $self->SetImageList( $self->wx_imagelist, wxIMAGE_LIST_NORMAL ) ;
    150                                                                 $self->Thaw;
    151                      },                 
     151                                $self->Thaw;
     152                     },           
    152153            'Thumbnail and caption' => sub {  my ( $self ) = @_;
    153                                                                 $self->Freeze;
    154                                                                 $self->ClearAll;
    155                                                                 $self->SetSingleStyle(wxLC_ICON);
    156                                                                 $self->SetSingleStyle(wxLC_EDIT_LABELS);
     154                                $self->Freeze;
     155                                $self->ClearAll;
     156                                $self->SetSingleStyle(wxLC_ICON);
     157                                $self->SetSingleStyle(wxLC_EDIT_LABELS);
    157158                                $self->SetImageList( $self->wx_imagelist, wxIMAGE_LIST_NORMAL ) ;
    158                                                                 $self->Thaw;
    159                      },                 
    160                 'Property list' => sub { my ( $self ) = @_;
    161                                             my $i=0;
    162                                                                
    163                                                                 $self->Freeze;
    164                                                                 $self->ClearAll;
    165                                                                 $self->SetSingleStyle(wxLC_REPORT);
    166                                                                 $self->SetSingleStyle(wxLC_EDIT_LABELS);
     159                                $self->Thaw;
     160                     },           
     161             'Property list' => sub { my ( $self ) = @_;
     162                                my $i=0;
     163                               
     164                                $self->Freeze;
     165                                $self->ClearAll;
     166                                $self->SetSingleStyle(wxLC_REPORT);
     167                                $self->SetSingleStyle(wxLC_EDIT_LABELS);
    167168                                $self->SetImageList( $self->wx_img, wxIMAGE_LIST_SMALL ) ;
    168                                 map     {
    169                                                                     $self->InsertColumn($i, $_->{label});
    170                                                                         $i++;
    171                                 }@{$self->columns};                                                             
    172                                                                 $self->Thaw;
    173                                         },
    174                 }
    175         );
    176 
    177         $self->item_refresh(
    178             {
    179                     'Thumbnail' => sub {},
    180                     'Thumbnail and caption' => sub { my ( $self, $index ) = @_;
     169                                map    {
     170                                    $self->InsertColumn($i, $_->{label});
     171                                    $i++;
     172                                }@{$self->columns};                               
     173                                $self->Thaw;
     174                            },
     175        }
     176    );
     177
     178    $self->item_refresh(
     179        {
     180            'Thumbnail' => sub {},
     181            'Thumbnail and caption' => sub { my ( $self, $index ) = @_;
    181182                                        my $image = $self->imagelist->GetImage($index);
    182                                         $self->SetItem(
    183                                                     $index,
    184                                                         0,
    185                                                         $image->site_name,
     183                                        $self->SetItem(
     184                                            $index,
     185                                            0,
     186                                            $image->site_name,
    186187                                        ) if defined $image;
    187                                                 },
     188                                    },
    188189            'Property list' => sub { my ( $self, $index ) = @_;
    189190                                my $col = 0;
     
    199200                                qw/site_name site_comment site_author file create_date/;
    200201                            },
    201                 }
    202         );
    203        
    204         $self->insert_items(
    205             {
    206                     'Thumbnail' => sub { my ( $self, $index ) = @_; $self->InsertImageItem($index, $index);},
    207                     'Thumbnail and caption' => sub { my ( $self, $index ) = @_;
    208                                                        $self->InsertImageStringItem(
     202        }
     203    );
     204   
     205    $self->insert_items(
     206        {
     207            'Thumbnail' => sub { my ( $self, $index ) = @_; $self->InsertImageItem($index, $index);},
     208            'Thumbnail and caption' => sub { my ( $self, $index ) = @_;
     209                                           $self->InsertImageStringItem(
    209210                                               $index,
    210211                                               $self->imagelist->GetImage($index)->site_name,
     
    213214                                     },
    214215            'Property list' => sub { my ( $self, $index ) = @_;
    215                                                    
    216                                                             $self->InsertImageStringItem(
     216                                       
     217                                $self->InsertImageStringItem(
    217218                                    $index,
    218219                                    "",
    219                                                                         0
    220                                                                 );
    221                                                                 $self->ItemRefresh($index);
    222 
    223                                         },
    224                 }
    225         );
    226 
    227        
    228         $self->initialize->{$self->imagelist->display_mode}->($self) if exists $self->initialize->{$self->imagelist->display_mode};
     220                                    0
     221                                );
     222                                $self->ItemRefresh($index);
     223
     224                            },
     225        }
     226    );
     227
     228   
     229    $self->initialize->{$self->imagelist->display_mode}->($self) if exists $self->initialize->{$self->imagelist->display_mode};
    229230
    230231    $self;
     
    233234sub ItemRefresh {
    234235    my ( $self, $index ) = @_;
    235        
    236         $self->item_refresh->{$self->imagelist->display_mode}->($self, $index) if exists $self->item_refresh->{$self->imagelist->display_mode};
     236   
     237    $self->item_refresh->{$self->imagelist->display_mode}->($self, $index) if exists $self->item_refresh->{$self->imagelist->display_mode};
    237238}
    238239
     
    252253
    253254sub GetSelectedItems {
    254     my ( $self ) = @_; 
     255    my ( $self ) = @_;   
    255256
    256257  # find selected items
     
    265266      last if(-1 == $item);
    266267     
    267       # item is selected       
     268      # item is selected   
    268269      push @$items, $item
    269270  }
     
    273274
    274275sub GetAllItems {
    275     my ( $self ) = @_; 
     276    my ( $self ) = @_;   
    276277
    277278  # find selected items
     
    286287      last if(-1 == $item);
    287288     
    288       # item is selected       
     289      # item is selected   
    289290      push @$items, $item
    290291  }
    291292 
    292293  $items;
    293        
     294   
    294295}
    295296
    296297
    297298sub Refresh {
    298     my ( $self ) = @_; 
     299    my ( $self ) = @_;   
    299300
    300301   $self->Freeze();
     
    308309       my $ipr = floor(($self->GetClientSize->GetWidth - 0.20*$x_spacing)/$x_spacing)||1;
    309310       for( my $i = 0 ; $i < $self->wx_imagelist->GetImageCount ; $i++){
    310                 # call the method corresponding to the display mode
     311            # call the method corresponding to the display mode
    311312            my $indx = $self->insert_items->{$self->imagelist->display_mode}->($self, $i);
    312                         if( 'Thumbnail' eq $self->imagelist->display_mode){
     313            if( 'Thumbnail' eq $self->imagelist->display_mode){
    313314                my $row = floor($i/$ipr);
    314315                my $col = $i%$ipr;
     
    320321                    ),
    321322                );
    322                         }
     323            }
    323324       }   
    324325   };
     
    328329           $_
    329330       );
    330            
    331            $self->EnsureVisible($_);
     331       
     332       $self->EnsureVisible($_);
    332333   } @{$self->imagelist->image_selection||[]};
    333334
     
    343344        wxLIST_STATE_SELECTED|wxLIST_STATE_FOCUSED,
    344345        wxLIST_STATE_SELECTED|wxLIST_STATE_FOCUSED
    345     ); 
     346    );   
    346347}
    347348
  • extensions/pLoader/trunk/src/Uploader/ImageList.pm

    r4504 r4568  
    3636__PACKAGE__->mk_accessors(
    3737    qw/
    38                 thumb_size
     38                thumb_size
    3939                preview_ratio
    4040                categories
    41                 type
    42                 filter
    43                 blur
    44                 quality
     41                type
     42                filter
     43                blur
     44                quality
    4545                resize_w
    4646                resize_h
    47                 hd_filter
    48                 hd_blur
    49                 hd_quality
     47                hd_filter
     48                hd_blur
     49                hd_quality
    5050                hd_w
    5151                hd_h
    52                                 hd_interlace
    53                 prefix
    54                 author
    55                 count
     52                hd_interlace
     53                prefix
     54                author
     55                count
    5656                new_files
    5757                storable_file
    58                 wx_thumb_size
     58                wx_thumb_size
    5959                current_image
    6060                images
     
    7070                default_photo_name
    7171                default_photo_name_method
    72                 default_name_prefix
     72                default_name_prefix
    7373                SetNewFilesViewerRefreshCallback
    7474                SetNewFilesProgressCallback
     
    8686                pwg
    8787                upload_high
    88                                 upload_hd
     88                upload_hd
    8989                remove_uploaded_from_selection
    9090                wx_quality
     
    9595                use_exif_preview
    9696                image_sums
    97                                 upload_image_sums
     97                upload_image_sums
    9898                sums
    9999                version
     
    121121                upload_file
    122122                upload_name
    123                                 ReuploadCallback
    124                                 reupload_action_files
    125                                 reupload_action_properties
    126                                 reupload_action_properties_m
    127                                 reupload_not_ask
    128                                 display_mode
     123                ReuploadCallback
     124                reupload_action_files
     125                reupload_action_properties
     126                reupload_action_properties_m
     127                reupload_not_ask
     128                display_mode
    129129     /
    130130);
     
    329329    my ( $self, $file, $info, $i ) = @_;
    330330   
     331printf("_default_photo_name %s\n", $self->default_photo_name);
    331332   
    332333    my $name;
     
    378379            $self->default_name_prefix,
    379380        )       
    380     }   
    381 
    382     $name;     
     381    }
     382
     383printf("_default_photo_name %s\n", $name);
     384    $name;
    383385}
    384386
Note: See TracChangeset for help on using the changeset viewer.