Changeset 4152 for extensions/pLoader/trunk
- Timestamp:
- Oct 29, 2009, 8:23:43 PM (15 years ago)
- Location:
- extensions/pLoader/trunk/src/Uploader
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/pLoader/trunk/src/Uploader/GUI/wxApp.pm
r4138 r4152 104 104 chunk_size 105 105 layout_clean 106 colors 107 eng_colors 108 positions 109 eng_positions 110 default_photo_names 111 eng_default_photo_names 106 112 / 107 113 ); … … 211 217 212 218 $self->init_locale; 219 $self->_init_localized_properties; 213 220 214 221 my $not_exit = $self->Login(); … … 228 235 229 236 $not_exit; 237 } 238 239 # some properties are displayed in choice list, with translated strings 240 # the translation has to be reverted to store a language independant value 241 sub _init_localized_properties { 242 my ( $self ) = @_; 243 244 $self->colors( 245 ['Black', 'White'] 246 ); 247 # We need to translate back to english when we store properties 248 $self->eng_colors( 249 { 250 map { gettext($_) => $_ } @{$self->colors} 251 } 252 ); 253 $self->positions( 254 [ 255 'Top', 256 'Left', 257 'Right', 258 'Bottom', 259 'Top left', 260 'Top right', 261 'Bottom left', 262 'Bottom right', 263 'Center', 264 ] 265 ); 266 267 $self->eng_positions( 268 { 269 map { gettext($_) => $_ } @{$self->positions} 270 } 271 ); 272 273 $self->default_photo_names( 274 [ 275 'None', 276 'File name', 277 'File path and name', 278 'Prefix', 279 'Prefix + rank number', 280 'Rank number + prefix', 281 'Prefix + create date chrono', 282 'Create date chrono + prefix', 283 ] 284 ); 285 $self->eng_default_photo_names( 286 { 287 map { gettext($_) => $_ } @{$self->default_photo_names} 288 } 289 ); 230 290 } 231 291 … … 425 485 storable_file => $self->storable_file, 426 486 userdata_dir => $self->userdata_dir, 427 default_photo_name => gettext('File name'),487 default_photo_name => 'File name', 428 488 default_name_prefix => gettext('Photo '), 429 489 upload_rejects => [], … … 436 496 watermark_text => gettext("my watermark"), 437 497 watermark_text_size => 12, 438 watermark_position => gettext("Center"),498 watermark_position => 'Center', 439 499 watermark_y => 10, 440 500 watermark_x => 10, 441 watermark_color => gettext("White"),501 watermark_color => 'White', 442 502 }; 443 503 -
extensions/pLoader/trunk/src/Uploader/GUI/wxFrameAUI.pm
r4138 r4152 275 275 [ 276 276 { 277 label => gettext("Photo caption :"), 278 value => sub { $self->imagelist->current_image->site_name(@_) }, 277 label => gettext("Photo caption :"), 278 value => sub { $self->imagelist->current_image->site_name(@_) }, 279 frame_callback => sub { $self->imageviewer->Refresh() }, 279 280 }, 280 281 { … … 367 368 value => sub { $self->imagelist->default_photo_name(@_) }, 368 369 choice => [ 369 gettext('None'), 370 gettext('File name'), 371 gettext('File path and name'), 372 gettext('Prefix'), 373 gettext('Prefix + rank number'), 374 gettext('Rank number + prefix'), 375 gettext('Prefix + create date chrono'), 376 gettext('Create date chrono + prefix'), 377 ], 370 map { gettext $_ } @{wxTheApp->default_photo_names} 371 ], 372 pre_process => sub { my ( $value ) = @_; wxTheApp->eng_default_photo_names->{$value} }, 378 373 }, 379 374 { … … 515 510 label => gettext("Color :"), 516 511 type => 'Choice', 517 value => sub { $self->imagelist->watermark_color(@_) },518 choice => [519 gettext("White"),520 gettext("Black"),521 ],512 value => sub { $self->imagelist->watermark_color(@_) }, 513 choice => [ 514 map { gettext $_ } @{wxTheApp->colors} 515 ], 516 pre_process => sub { my ( $value ) = @_; wxTheApp->eng_colors->{$value} }, 522 517 }, 523 518 { … … 526 521 value => sub { $self->imagelist->watermark_position(@_) }, 527 522 choice => [ 528 gettext("Top"), 529 gettext("Top left"), 530 gettext("Top right"), 531 gettext("Bottom"), 532 gettext("Bottom left"), 533 gettext("Bottom right"), 534 gettext("Center"), 535 gettext("Left"), 536 gettext("Right"), 523 map { gettext $_ } @{wxTheApp->positions} 537 524 ], 525 pre_process => sub { my ( $value ) = @_; wxTheApp->eng_positions->{$value} }, 538 526 }, 539 527 { … … 686 674 parentwnd => $self, 687 675 properties => $self->piwigo_properties, 688 frame_callbacks => [689 sub {690 $self->imageviewer->Refresh();691 },692 ],693 676 } 694 677 ) … … 699 682 { 700 683 parentwnd => $self, 701 frame_callbacks => [],702 684 properties => $self->exif_properties, 703 685 } … … 711 693 parentwnd => $self, 712 694 properties => $self->general_settings, 713 frame_callbacks => [],714 695 } 715 696 ) … … 721 702 parentwnd => $self, 722 703 properties => $self->resized_settings, 723 frame_callbacks => [],724 704 725 705 } … … 732 712 parentwnd => $self, 733 713 properties => $self->thumbnail_settings, 734 frame_callbacks => [],735 714 736 715 } … … 742 721 parentwnd => $self, 743 722 properties => $self->preview_settings, 744 frame_callbacks => [],745 723 746 724 } … … 753 731 parentwnd => $self, 754 732 properties => $self->advanced_settings, 755 frame_callbacks => [],756 733 757 734 } … … 764 741 parentwnd => $self, 765 742 properties => $self->watermark_settings, 766 frame_callbacks => [],767 743 } 768 744 ) -
extensions/pLoader/trunk/src/Uploader/GUI/wxImageListCtrl.pm
r3362 r4152 29 29 wxLC_EDIT_LABELS 30 30 wxLC_ICON 31 wxLC_SMALL_ICON 31 32 wxIMAGE_LIST_NORMAL 32 33 wxBITMAP_TYPE_JPEG -
extensions/pLoader/trunk/src/Uploader/GUI/wxPropertyGridPanel.pm
r4134 r4152 24 24 wxDefaultPosition 25 25 /; 26 26 use Wx::Locale qw/:default/; 27 27 use base qw/Wx::Grid Uploader::Object2/; 28 28 … … 31 31 /; 32 32 use Data::Dumper; 33 34 33 __PACKAGE__->mk_accessors( 35 34 qw/ 36 frame_callbacks37 35 renderer 38 36 editor … … 75 73 ); 76 74 77 # a frame callback for each property78 $self->frame_callbacks(79 $params->{frame_callbacks}80 );81 82 75 $self->Initialize; 83 76 … … 121 114 $row, 122 115 1, 123 $_->{value}->(),116 exists $_->{choice} ? gettext($_->{value}->()) : $_->{value}->(), 124 117 ); 125 118 … … 173 166 $row, 174 167 1, 175 $_->{value}->(),168 exists $_->{choice} ? gettext($_->{value}->()) : $_->{value}->(), 176 169 ); 177 170 … … 201 194 ); 202 195 196 # if we need to preprocess the value 197 $value = $self->properties->[$row]->{pre_process}->($value) if exists 198 $self->properties->[$row]->{pre_process}; 199 203 200 # set property 204 201 $self->properties->[$row]->{value}->($value); 205 202 printf("property value %s\n", $self->properties->[$row]->{value}->()); 206 203 207 204 # execute the corresponding frame callback 208 $self->frame_callbacks->[$row]->() if defined $self->frame_callbacks->[$row]; 205 $self->properties->[$row]->{frame_callback}->() if exists 206 $self->properties->[$row]->{frame_callback}; 209 207 } 210 208 -
extensions/pLoader/trunk/src/Uploader/ImageList.pm
r4121 r4152 112 112 $self->gravity( 113 113 { 114 gettext("Top")=> 'North',115 gettext("Left")=> 'West',116 gettext("Right")=> 'East',117 gettext("Bottom")=> 'South',118 gettext("Top left")=> 'NorthWest',119 gettext("Top right")=> 'NorthEast',120 gettext("Bottom left")=> 'SouthWest',121 gettext("Bottom right")=> 'SouthEast',122 gettext("Center")=> 'Center',114 'Top' => 'North', 115 'Left' => 'West', 116 'Right' => 'East', 117 'Bottom' => 'South', 118 'Top left' => 'NorthWest', 119 'Top right' => 'NorthEast', 120 'Bottom left' => 'SouthWest', 121 'Bottom right' => 'SouthEast', 122 'Center' => 'Center', 123 123 } 124 124 ); … … 126 126 $self->rgbcolor( 127 127 { 128 gettext("White")=> '#FFFFFF',129 gettext("Black")=> '#000000',128 "White" => '#FFFFFF', 129 "Black" => '#000000', 130 130 } 131 131 ); … … 344 344 345 345 my $chrono = join('', $yyyy, $mm, $dd); 346 if( gettext('Prefix')eq $self->default_photo_name){346 if('Prefix' eq $self->default_photo_name){ 347 347 $name = $self->default_name_prefix 348 348 } 349 elsif( gettext('File name')eq $self->default_photo_name){349 elsif('File name' eq $self->default_photo_name){ 350 350 $name = $filename 351 351 } 352 elsif( gettext('File path and name')eq $self->default_photo_name){352 elsif('File path and name' eq $self->default_photo_name){ 353 353 $name = sprintf( 354 354 "%s", … … 356 356 ) 357 357 } 358 elsif( gettext('Prefix + rank number')eq $self->default_photo_name){358 elsif('Prefix + rank number' eq $self->default_photo_name){ 359 359 $name = sprintf( 360 360 "%s%s", … … 363 363 ) 364 364 } 365 elsif( gettext('Rank number + prefix')eq $self->default_photo_name){365 elsif('Rank number + prefix' eq $self->default_photo_name){ 366 366 $name = sprintf( 367 367 "%s%s", … … 370 370 ) 371 371 } 372 elsif( gettext('Prefix + create date chrono')eq $self->default_photo_name){372 elsif('Prefix + create date chrono' eq $self->default_photo_name){ 373 373 $name = sprintf( 374 374 "%s%s", … … 377 377 ) 378 378 } 379 elsif( gettext('Create date chrono + prefix')eq $self->default_photo_name){379 elsif('Create date chrono + prefix' eq $self->default_photo_name){ 380 380 $name = sprintf( 381 381 "%s%s",
Note: See TracChangeset
for help on using the changeset viewer.