Changeset 4504
- Timestamp:
- Dec 16, 2009, 9:20:29 PM (14 years ago)
- Location:
- extensions/pLoader/trunk
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/pLoader/trunk/locale/fr_FR/pLoader.po
r4476 r4504 578 578 msgstr "Gestion de la mise à jour des photos" 579 579 580 msgid "Who can see the photo? :"581 msgstr "Qui peut voir la photo ? :"580 msgid "Who can see the photo?" 581 msgstr "Qui peut voir la photo ?" 582 582 583 583 msgid "everybody" … … 598 598 msgid "What shall we do with privacy level?" 599 599 msgstr "Que faire pour le niveau de confidentialité ?" 600 601 msgid "Thumbnail and caption" 602 msgstr "Miniature et titre" 603 604 msgid "Property list" 605 msgstr "Liste de propriétés" 606 607 msgid "How photo selection is displayed" 608 msgstr "Comment la sélection de photos est affichée" 609 -
extensions/pLoader/trunk/src/Uploader/GUI/wxApp.pm
r4479 r4504 134 134 # to check if we can use stored cache 135 135 $self->imagelist_version( 136 '1 0'136 '11' 137 137 ); 138 138 … … 560 560 reupload_action_properties => 2, 561 561 reupload_action_properties_m => 1, 562 display_mode => $self->user_defined_properties->{display_mode}||'Thumbnail and caption' 562 563 }; 563 564 … … 693 694 $self->imagelist->wx_thumb_size, 694 695 $self->imagelist->wx_thumb_size, 695 1,696 0, 696 697 0 697 698 ) -
extensions/pLoader/trunk/src/Uploader/GUI/wxChoiceFilteredPanel.pm
r4490 r4504 71 71 $self->_init_panel; 72 72 $self->_init_properties($params); 73 printf("%s, %s\n", $self, $self->GetId); 73 74 74 $self->Refresh; 75 75 … … 164 164 my ( $self, $choices ) = @_; 165 165 166 $self->listchoices->Freeze; 166 167 $self->listchoices->Clear; 167 168 $self->id_lookup({}); … … 181 182 $row++; 182 183 }@{$choices}; 184 $self->listchoices->Thaw; 183 185 184 186 } … … 205 207 206 208 my $choices = $self->choices->(); 209 $self->listchoices->Freeze; 207 210 map { 208 211 $self->listchoices->Check($row, 0) ; 209 212 $row++; 210 213 }@$choices; 211 212 214 $self->listchoices->Thaw; 213 215 } 214 216 … … 220 222 push @$selection, $self->id_from_name->{$selected} if defined $selected; 221 223 224 $self->listchoices->Freeze; 222 225 map { 223 226 $self->listchoices->Check( … … 228 231 } 229 232 @{$selection}; 233 $self->listchoices->Thaw; 230 234 } 231 235 -
extensions/pLoader/trunk/src/Uploader/GUI/wxFrameAUI.pm
r4478 r4504 84 84 upload_progressdlg 85 85 imageviewer 86 imageviewer_img 86 87 tree 87 88 tree_root … … 130 131 dlg_piwigo_photo_properties 131 132 piwigo_photo_properties_tags 133 image_preview_refresh 134 imageviewer_refresh 135 imageviewer_item_refresh 132 136 /; 133 137 __PACKAGE__->mk_accessors( @properties ); … … 180 184 $params->{perspective} 181 185 ); 186 182 187 183 188 $self->current_imageviewer_index( … … 297 302 $self->_initImgTypes; 298 303 304 # only refresh when calling event is finished 305 Wx::Event::EVT_UPDATE_UI( 306 $self, 307 $self, 308 sub { 309 my ( $self, $event ) = @_; 310 if ( $self->image_preview_refresh and $self->image_preview->IsShown ){ 311 $self->_image_preview_refresh; 312 $self->image_preview->Refresh; 313 $self->image_preview_refresh(0); 314 } 315 316 if($self->imageviewer_refresh){ 317 $self->imageviewer->Refresh; 318 $self->imageviewer_refresh(0); 319 } 320 321 if($self->imageviewer_item_refresh){ 322 $self->imageviewer->ItemRefresh( 323 $self->current_imageviewer_index 324 ); 325 $self->imageviewer_item_refresh(0); 326 } 327 }, 328 ); 299 329 300 330 $self->imageviewer->SelectItem( … … 333 363 $main::PHOTO_PROPERTIES_CAPTION => { 334 364 value => sub { $self->imagelist->current_image->site_name(@_) }, 335 frame_callback => sub { $self->imageviewer ->Refresh()},365 frame_callback => sub { $self->imageviewer_item_refresh(1); }, 336 366 }, 337 367 $main::COMMENT => { label=>gettext("Comment :")}, 338 368 $main::PHOTO_PROPERTIES_COMMENT => { 339 369 value => sub { $self->imagelist->current_image->site_comment(@_) }, 370 frame_callback => sub { $self->imageviewer_item_refresh(1); }, 340 371 }, 341 372 $main::AUTHOR => { label=>gettext("Author :")}, 342 373 $main::PHOTO_PROPERTIES_AUTHOR => { 343 374 value => sub { $self->imagelist->current_image->site_author(@_) }, 375 frame_callback => sub { $self->imageviewer_item_refresh(1); }, 344 376 }, 345 377 $main::TAGS => { label=>gettext("Tags :")}, … … 347 379 $main::PHOTO_PROPERTIES_CREATE_DATE => { 348 380 value => sub { $self->imagelist->current_image->create_date(@_) }, 381 frame_callback => sub { $self->imageviewer_item_refresh(1); }, 349 382 }, 350 $main::PRIVACY_LEVEL => { label=>gettext("Who can see the photo? :")},383 $main::PRIVACY_LEVEL => { label=>gettext("Who can see the photo?")}, 351 384 $main::PHOTO_PROPERTIES_PRIVACY_LEVEL => { 352 385 selection => sub { $self->imagelist->current_image->privacy_level(@_)}, … … 361 394 label => gettext("Photo caption :"), 362 395 value => sub { $self->imagelist->current_image->site_name(@_) }, 363 frame_callback => sub { $self->imageviewer ->Refresh() },396 frame_callback => sub { $self->imageviewer_item_refresh(1) }, 364 397 }, 365 398 { … … 700 733 } 701 734 702 703 sub _destroy_settings_panels {704 my ( $self ) = @_;705 706 707 708 map {709 $self->manager->DetachPane(710 $_711 );712 $_->Show(0);713 $_->Destroy;714 }(715 $self->notebook_global_settings,716 $self->notebook_image_properties,717 );718 }719 720 735 # 721 736 sub _initFrame { … … 934 949 parentwnd => $self, 935 950 imagelist => $self->imagelist, 951 image_size => $self->imagelist->wx_thumb_size, 952 columns => $self->piwigo_properties, 936 953 } 937 954 ) … … 1452 1469 Wx::Event::EVT_MENU( $self, 104, \&OnGlobalSettings ); 1453 1470 Wx::Event::EVT_MENU( $self, 105, \&OnChooseLanguage ); 1471 Wx::Event::EVT_CHOICE( $self, 106, \&OnPhotoSelMode ); 1454 1472 EVT_TREE_SEL_CHANGED( $self, $self->tree, \&OnTreeSelChanged ); 1455 1473 EVT_TREE_ITEM_RIGHT_CLICK( $self, $self->tree, \&OnTreeItemRightClick ); … … 1748 1766 ); 1749 1767 1768 $self->dlg_piwigo_photo_properties->SetProperties; 1750 1769 $self->image_prop_piwigo->Refresh; 1751 1770 } … … 1764 1783 sub OnImageViewerItemSelected { 1765 1784 my( $self, $event ) = @_; 1785 1766 1786 my $bc = Wx::BusyCursor->new; 1767 1768 1787 my $indx = $event->GetIndex; 1769 1770 1788 $self->_on_imageviewer_item_selected($indx); 1771 1789 … … 1783 1801 ); 1784 1802 1785 # image preview has a cost, don't do if useless. 1786 if ( $self->image_preview->IsShown ){ 1787 $self->_image_preview_refresh; 1788 $self->image_preview->Refresh; 1789 } 1803 # process image_preview in idle time 1804 # and when current event is processed 1805 # see call to EVT_IDLE 1806 $self->image_preview_refresh(1); 1790 1807 1791 1808 $self->dlg_piwigo_photo_properties->SetProperties; … … 2107 2124 my( $self ) = @_; 2108 2125 2109 my $tb = Wx::ToolBar->new( $self, -1, wxDefaultPosition, wxDefaultSize, wxTB_FLAT );2126 my $tb = Wx::ToolBar->new( $self, -1, wxDefaultPosition, [600, -1], wxTB_FLAT ); 2110 2127 $tb->SetToolBitmapSize( wxSIZE( 32, 32 ) ); 2111 2128 map { … … 2183 2200 2184 2201 ); 2185 2186 if($@){ 2187 undef $tb; 2188 } 2189 else{ 2190 $tb->Realize; 2191 } 2202 2203 $tb->AddSeparator; 2204 2205 $tb->AddControl( 2206 Wx::Choice->new( 2207 $tb, 2208 106, 2209 wxDefaultPosition, 2210 wxDefaultSize, 2211 [], 2212 ) 2213 ); 2214 my $ch = $tb->FindWindow(106); 2215 $ch->SetToolTip(gettext("How photo selection is displayed")); 2216 map { 2217 $ch->Append(gettext($_), $_); 2218 }( 2219 "Thumbnail and caption", 2220 "Thumbnail", 2221 "Property list" 2222 ); 2223 2224 $ch->SetStringSelection(gettext($self->imagelist->display_mode)); 2225 $tb->Realize; 2192 2226 2193 2227 return $tb; 2194 2228 } 2195 2229 2230 sub OnPhotoSelMode { 2231 my ( $self, $event )= @_; 2232 2233 $self->imagelist->display_mode( 2234 $event->GetClientData 2235 ); 2236 2237 $self->imageviewer->change_display_mode(1); 2238 } 2196 2239 2197 2240 sub _create_textctrl { -
extensions/pLoader/trunk/src/Uploader/GUI/wxImageListCtrl.pm
r4324 r4504 22 22 use Wx; 23 23 use Wx::DND; 24 use POSIX qw(ceil floor); 24 25 use Wx qw/ 25 26 wxDefaultPosition … … 29 30 wxLC_EDIT_LABELS 30 31 wxLC_ICON 32 wxLC_REPORT 31 33 wxLC_SMALL_ICON 32 34 wxIMAGE_LIST_NORMAL … … 36 38 wxLC_VIRTUAL 37 39 wxLC_REPORT 40 wxLC_AUTOARRANGE 38 41 wxBORDER_THEME 39 42 wxLIST_HITTEST_ONITEM … … 42 45 wxLIST_STATE_DONTCARE 43 46 wxLIST_STATE_FOCUSED 47 wxIMAGE_LIST_SMALL 44 48 /; 45 49 use Wx::Event qw/ 46 50 EVT_LIST_BEGIN_DRAG 47 51 EVT_LIST_ITEM_SELECTED 52 EVT_SIZE 48 53 /; 49 54 … … 54 59 imagenames 55 60 imagelist 61 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 56 71 / 57 72 ); 58 73 use Data::Dumper; 74 75 59 76 sub new { 60 my( $class, $params ) = @_; 61 my( $self ) = $class->SUPER::new( 62 $params->{parentwnd}, 63 -1, 64 wxDefaultPosition, 65 wxDefaultSize, 66 wxNO_BORDER| 67 wxLC_ICON| 68 wxLC_EDIT_LABELS 69 ); 70 71 $self->imagelist( 72 $params->{imagelist} 73 ); 74 75 76 $self->prevItemCount(-1); 77 78 EVT_LIST_BEGIN_DRAG( $self, $self, \&OnBeginDrag); 79 80 81 $self; 77 my( $class, $params ) = @_; 78 79 80 my( $self ) = $class->SUPER::new( 81 $params->{parentwnd}, 82 -1, 83 wxDefaultPosition, 84 wxDefaultSize, 85 wxNO_BORDER 86 ); 87 88 $self->wx_img( 89 Wx::ImageList->new( 16, 16, 1 ) 90 ); 91 $self->wx_img->Add( 92 Wx::Bitmap->new( '../res/image.png', wxBITMAP_TYPE_PNG ) 93 ); 94 95 $self->imagelist( 96 $params->{imagelist} 97 ); 98 # bitmap container for photo selection 99 $self->wx_imagelist( 100 $params->{wx_imagelist}||$self->imagelist->wx_thumb_imglist 101 ); 102 103 $self->image_size( 104 $params->{image_size} 105 ); 106 107 $self->columns( 108 $params->{columns} 109 ); 110 print Dumper $self->columns; 111 $self->prevItemCount(-1); 112 113 EVT_LIST_BEGIN_DRAG( $self, $self, \&OnBeginDrag); 114 115 EVT_SIZE($self, sub { 116 my ( $this, $event ) = @_; 117 118 $this->arrange_items(1); 119 $event->Skip(); 120 } 121 ); 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; 136 $self->change_display_mode(0); 137 } 138 } 139 ); 140 141 $self->initialize( 142 { 143 144 'Thumbnail' => sub { my ( $self ) = @_; 145 $self->Freeze; 146 $self->ClearAll; 147 $self->SetSingleStyle(wxLC_ICON); 148 $self->SetSingleStyle(wxLC_EDIT_LABELS, 0); 149 $self->SetImageList( $self->wx_imagelist, wxIMAGE_LIST_NORMAL ) ; 150 $self->Thaw; 151 }, 152 'Thumbnail and caption' => sub { my ( $self ) = @_; 153 $self->Freeze; 154 $self->ClearAll; 155 $self->SetSingleStyle(wxLC_ICON); 156 $self->SetSingleStyle(wxLC_EDIT_LABELS); 157 $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); 167 $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 ) = @_; 181 my $image = $self->imagelist->GetImage($index); 182 $self->SetItem( 183 $index, 184 0, 185 $image->site_name, 186 ) if defined $image; 187 }, 188 'Property list' => sub { my ( $self, $index ) = @_; 189 my $col = 0; 190 my $image = $self->imagelist->GetImage($index); 191 map{ 192 $self->SetItem( 193 $index, 194 $col, 195 $image->$_ 196 ) if defined $image; 197 $col++; 198 } 199 qw/site_name site_comment site_author file create_date/; 200 }, 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( 209 $index, 210 $self->imagelist->GetImage($index)->site_name, 211 $index, 212 ); 213 }, 214 'Property list' => sub { my ( $self, $index ) = @_; 215 216 $self->InsertImageStringItem( 217 $index, 218 "", 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}; 229 230 $self; 231 } 232 233 sub ItemRefresh { 234 my ( $self, $index ) = @_; 235 236 $self->item_refresh->{$self->imagelist->display_mode}->($self, $index) if exists $self->item_refresh->{$self->imagelist->display_mode}; 82 237 } 83 238 … … 141 296 142 297 sub Refresh { 143 my ( $self , $wximagelist) = @_;144 145 $self-> SetImageList( $wximagelist, wxIMAGE_LIST_NORMAL ) if defined $wximagelist;298 my ( $self ) = @_; 299 300 $self->Freeze(); 146 301 $self->DeleteAllItems; 147 302 eval { 148 for( my $i = 0 ; $i < $self->GetImageList(wxIMAGE_LIST_NORMAL)->GetImageCount ; $i++){ 149 my $indx = $self->InsertImageStringItem( 150 $i, 151 $self->imagelist->GetImage($i)->site_name, 152 $i, 153 ); 303 my $y0 = 0; 304 my $x0 = 0; 305 306 my $x_spacing = $self->image_size + 2; 307 my $y_spacing = $self->image_size + 2; 308 my $ipr = floor(($self->GetClientSize->GetWidth - 0.20*$x_spacing)/$x_spacing)||1; 309 for( my $i = 0 ; $i < $self->imagelist->count ; $i++){ 310 # call the method corresponding to the display mode 311 my $indx = $self->insert_items->{$self->imagelist->display_mode}->($self, $i); 312 if( 'Thumbnail' eq $self->imagelist->display_mode){ 313 my $row = floor($i/$ipr); 314 my $col = $i%$ipr; 315 $self->SetItemPosition( 316 $i, 317 Wx::Point->new( 318 $x0 + $x_spacing*$col, 319 $y0 + $y_spacing*$row, 320 ), 321 ); 322 } 154 323 } 155 324 }; 325 326 map{ 327 $self->SelectItem( 328 $_ 329 ); 330 331 $self->EnsureVisible($_); 332 } @{$self->imagelist->image_selection||[]}; 333 334 $self->Thaw(); 335 $self->SetFocus; 156 336 } 157 337 -
extensions/pLoader/trunk/src/Uploader/ImageList.pm
r4478 r4504 126 126 reupload_action_properties_m 127 127 reupload_not_ask 128 display_mode 128 129 / 129 130 ); … … 156 157 157 158 } 158 159 160 161 # save exif preview image if available162 # otherwise create a preview image163 sub _write_preview_image {164 my ( $self, $imagedata ) = @_;165 166 167 # If PreviewImage is available, we use it168 if(defined $imagedata ) {169 print "_write_preview_image, use exif PreviewImage\n";170 eval {171 open PREVIEW_FILE, ">", $self->current_image->preview_file ;172 binmode PREVIEW_FILE;173 print PREVIEW_FILE $$imagedata;174 close PREVIEW_FILE;175 };176 $self->last_error_msg($@) if $@;177 }178 179 }180 181 159 182 160 sub _set_exif_tag { … … 492 470 ); 493 471 494 printf("%sx%s%s\n", $size, $size, '^');495 472 496 473 # maximize size and keep aspect ratio … … 516 493 gravity=>'center', 517 494 ); 518 495 519 496 $image->Set( 520 497 quality=>$self->wx_quality||90 … … 774 751 reupload_action_properties 775 752 reupload_action_properties_m 753 display_mode 776 754 / 777 755 ] -
extensions/pLoader/trunk/src/ploader.pl
r4322 r4504 27 27 use Data::Dumper; 28 28 29 #$SIG{__DIE__} = \&OnDieHandler;29 $SIG{__DIE__} = \&OnDieHandler; 30 30 31 31 require '../res/progress_wdr.pl'; 32 32 require '../res/login_wdr.pl'; 33 require '../res/reupload_wdr.pl'; 34 require '../res/photo_properties_wdr.pl'; 33 35 print Dumper \@INC; 34 36 eval {
Note: See TracChangeset
for help on using the changeset viewer.