Changeset 5472 for extensions/pLoader
- Timestamp:
- Mar 30, 2010, 2:29:37 PM (15 years ago)
- Location:
- extensions/pLoader/trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/pLoader/trunk/locale/fr_FR/pLoader.po
r5133 r5472 673 673 msgid "Remove selected photos" 674 674 msgstr "Enlever les photos sélectionnées" 675 676 msgid "Default caption pattern" 677 msgstr "Format de titre par défaut" 678 679 msgid "Default caption" 680 msgstr "Titre par défaut" 681 682 msgid "Caption + rank number" 683 msgstr "Titre + N° d'ordre" 684 685 msgid "Rank number + caption" 686 msgstr "N° d'ordre + titre" 687 688 msgid "Caption + create date chrono" 689 msgstr "Titre + chrono date de création" 690 691 msgid "Create date chrono + caption" 692 msgstr "Chrono date de création + titre" 693 694 msgid "Create date chrono + rank" 695 msgstr "Chrono date de création + N° d'ordre" 696 697 msgid "Rank + create date chrono" 698 msgstr "N° d'ordre + chrono date de création" 699 700 msgid "Preferences" 701 msgstr "Préférences" 702 703 msgid "Selection" 704 msgstr "Sélection" -
extensions/pLoader/trunk/src/Uploader/GUI/Frame.pm
r5447 r5472 305 305 $self->imagelist->current_image->site_name; 306 306 }, 307 pre_process => sub { sub { $self->imagelist->GetCurrentImage DefaultName(@_); } },307 pre_process => sub { sub { $self->imagelist->GetCurrentImageCaption(@_); } }, 308 308 choices => 309 309 [ 310 map { gettext $_ } @{wxTheApp-> default_photo_names}310 map { gettext $_ } @{wxTheApp->caption_patterns} 311 311 ], 312 312 frame_callback => sub { $self->imageviewer_item_refresh(1); }, … … 361 361 $self->global_settings( 362 362 { 363 $main::DEFAULT_PHOTO_CAPTION => { label => gettext("Default photo caption") },363 $main::DEFAULT_PHOTO_CAPTION => { label => gettext("Default caption pattern") }, 364 364 $main::CPANE_RESIZE_ADVANCED => { label => gettext("Advanced") }, 365 365 $main::CPANE_HD_ADVANCED => { label => gettext("Advanced") }, … … 370 370 $main::GS_CLOSE => { label => gettext("Close")}, 371 371 $main::GS_DEFAULT_PHOTO_CAPTION => { 372 string_selection => sub { $self->imagelist->default_ photo_name(@_) },372 string_selection => sub { $self->imagelist->default_caption_pattern(@_) }, 373 373 choices => 374 374 [ 375 map { gettext $_ } @{wxTheApp-> default_photo_names}375 map { gettext $_ } @{wxTheApp->caption_patterns} 376 376 ], 377 pre_process => sub { my ( $value ) = @_; wxTheApp->eng_ default_photo_names->{$value} },377 pre_process => sub { my ( $value ) = @_; wxTheApp->eng_caption_patterns->{$value} }, 378 378 frame_callback => sub { 379 379 my( $self, $ctrl, $event ) = @_; … … 381 381 }, 382 382 }, 383 $main::PHOTO_CAPTION_PREFIX => { label => gettext(" Photo caption prefix") },383 $main::PHOTO_CAPTION_PREFIX => { label => gettext("Default caption") }, 384 384 $main::GS_PHOTO_CAPTION_PREFIX => { 385 value => sub { $self->imagelist->default_ name_prefix(@_) },385 value => sub { $self->imagelist->default_caption(@_) }, 386 386 }, 387 387 $main::GS_AUTO_ROTATE => { … … 895 895 896 896 897 sub OnDefaultPhotoNameChanged {898 my ( $self ) = @_;899 900 Wx::LogMessage("New default_photo_name %s", $self->imagelist->default_photo_name);901 }902 903 904 897 sub OnGeneralSettingsClose { 905 898 my ( $self, $event ) = @_; … … 1073 1066 Wx::Event::EVT_BUTTON( $self, $main::PHOTO_PROPERTIES_UPLOAD, \&OnUploadImages ); 1074 1067 Wx::Event::EVT_BUTTON( $self, $self->imageviewer->add_button->GetId, \&OnAddImages ); 1075 1068 Wx::Event::EVT_KEY_DOWN($self, \&OnKeyDown ); 1076 1069 1077 1070 # only refresh when calling event is finished … … 1513 1506 1514 1507 } 1508 1515 1509 1516 1510 sub OnUploadImages { -
extensions/pLoader/trunk/src/Uploader/GUI/wxApp.pm
r5041 r5472 105 105 positions 106 106 eng_positions 107 default_photo_names108 eng_ default_photo_names107 caption_patterns 108 eng_caption_patterns 109 109 upload_hd 110 110 eng_upload_hd … … 173 173 # to check if we can use stored cache 174 174 $self->imagelist_version( 175 '1 3'175 '15' 176 176 ); 177 177 $self->argv( … … 364 364 ); 365 365 366 $self-> default_photo_names(366 $self->caption_patterns( 367 367 [ 368 368 'None', 369 369 'File name', 370 370 'File path and name', 371 'Prefix', 372 'Prefix + rank number', 373 'Rank number + prefix', 374 'Prefix + create date chrono', 375 'Create date chrono + prefix', 371 'Caption', 372 'Caption + rank number', 373 'Rank number + caption', 374 'Caption + create date chrono', 375 'Create date chrono + caption', 376 'Create date chrono + rank', 377 'Rank + create date chrono', 376 378 ] 377 379 ); 378 $self->eng_ default_photo_names(380 $self->eng_caption_patterns( 379 381 { 380 map { gettext($_) => $_ } @{$self-> default_photo_names}382 map { gettext($_) => $_ } @{$self->caption_patterns} 381 383 } 382 384 ); … … 619 621 storable_file => $self->storable_file, 620 622 userdata_dir => $self->userdata_dir, 621 default_ photo_name => $self->user_defined_properties->{default_photo_name}||'File name',622 default_ name_prefix => $self->user_defined_properties->{default_name_prefix}||gettext('Photo '),623 default_caption_pattern => $self->user_defined_properties->{default_caption_pattern}||'File name', 624 default_caption => $self->user_defined_properties->{default_caption}||gettext('Photo '), 623 625 upload_rejects => [], 624 626 image_sums => {}, -
extensions/pLoader/trunk/src/Uploader/GUI/wxGlobalSettings.pm
r5133 r5472 169 169 if('CODE' eq ref $self->properties->{$id}->{string_selection}){ 170 170 if ( $self->properties->{$id} 171 ->{string_selection}->() =~ / refix/){171 ->{string_selection}->() =~ /caption/i ){ 172 172 $b=1; 173 173 } -
extensions/pLoader/trunk/src/Uploader/Image.pm
r5020 r5472 41 41 height 42 42 privacy_level 43 caption 43 44 / 44 45 ); -
extensions/pLoader/trunk/src/Uploader/ImageList.pm
r5457 r5472 68 68 progress_msg 69 69 last_error_msg 70 default_photo_name 71 default_photo_name_method 72 default_name_prefix 70 default_caption 71 default_caption_pattern 73 72 SetNewFilesViewerRefreshCallback 74 73 SetNewFilesProgressCallback … … 320 319 file => $file->{ANSIPathName}, 321 320 file_sum => $sum, 322 site_name => $self->_default_photo_name($file->{PathName}, $info, $i), 321 site_name => $self->init_default_caption($file->{PathName}, $info, $i), 322 caption => $self->default_caption, 323 323 site_author => $self->author, 324 324 exif_metadata => $self->_select_exif_data($info), … … 342 342 } 343 343 344 sub GetCurrentImageDefaultName { 345 my ( $self, $index, $pattern ) = @_; 346 347 $pattern = wxTheApp->eng_default_photo_names->{$pattern}; 348 349 $self->SetCurrentImage($index); 350 351 my $img = $self->current_image; 352 353 $self->_photo_name_from_pattern( 354 $img->file, 355 $img->create_date, 356 $index, 357 $pattern 358 ); 359 } 360 361 sub _default_photo_name { 344 345 sub init_default_caption { 362 346 my ( $self, $file, $info, $i ) = @_; 363 347 364 348 my $create_date = $info->{CreateDate}; 365 366 367 $self->_photo_name_from_pattern($file, $create_date, $i, $self->default_photo_name); 368 } 369 370 371 sub _photo_name_from_pattern { 372 my ( $self, $file, $create_date, $i, $pattern ) = @_; 349 350 $self->init_caption_from_pattern( 351 $file, 352 $create_date, 353 $i, 354 $self->default_caption, 355 $self->default_caption_pattern 356 ); 357 } 358 359 360 sub init_caption_from_pattern { 361 my ( $self, $file, $create_date, $i, $caption, $pattern ) = @_; 373 362 374 363 my ( $yyyy, $mm, $dd, $hh, $mi, $ss ) = split /[:\s]/, $create_date ; … … 376 365 my $chrono = join('', $yyyy, $mm, $dd); 377 366 378 my $ name;367 my $caption_from_pattern; 379 368 my $ext; 380 369 my ( $vol, $path, $filename ) = File::Spec->splitpath($file); … … 382 371 383 372 384 if(' Prefix' eq $pattern){385 $ name = $self->default_name_prefix373 if('Caption' eq $pattern){ 374 $caption_from_pattern = $caption 386 375 } 387 376 elsif('File name' eq $pattern){ 388 $ name= $filename377 $caption_from_pattern = $filename 389 378 } 390 379 elsif('File path and name' eq $pattern){ 391 $ name= sprintf(380 $caption_from_pattern = sprintf( 392 381 "%s", 393 382 File::Spec->catfile($path, $filename), 394 383 ) 395 384 } 396 elsif(' Prefix+ rank number' eq $pattern){397 $ name= sprintf(398 "%s %s",399 $ self->default_name_prefix,385 elsif('Caption + rank number' eq $pattern){ 386 $caption_from_pattern = sprintf( 387 "%s %s", 388 $caption, 400 389 1+$i, 401 390 ) 402 391 } 403 elsif('Rank number + prefix' eq $pattern){404 $ name= sprintf(405 "%s %s",392 elsif('Rank number + caption' eq $pattern){ 393 $caption_from_pattern = sprintf( 394 "%s %s", 406 395 1+$i, 407 $ self->default_name_prefix,396 $caption, 408 397 ) 409 398 } 410 elsif(' Prefix+ create date chrono' eq $pattern){411 $ name= sprintf(412 "%s %s",413 $ self->default_name_prefix,399 elsif('Caption + create date chrono' eq $pattern){ 400 $caption_from_pattern = sprintf( 401 "%s %s", 402 $caption, 414 403 $chrono, 415 404 ) 416 405 } 417 elsif('Create date chrono + prefix' eq $pattern){418 $ name= sprintf(419 "%s %s",406 elsif('Create date chrono + caption' eq $pattern){ 407 $caption_from_pattern = sprintf( 408 "%s %s", 420 409 $chrono, 421 $ self->default_name_prefix,410 $caption, 422 411 ) 423 412 } 424 425 $name; 413 elsif('Create date chrono + rank' eq $pattern){ 414 $caption_from_pattern = sprintf( 415 "%s %s", 416 $chrono, 417 1+$i, 418 ) 419 } 420 elsif('Rank + create date chrono' eq $pattern){ 421 $caption_from_pattern = sprintf( 422 "%s %s", 423 1+$i, 424 $chrono, 425 ) 426 } 427 428 $caption_from_pattern; 429 } 430 431 432 sub GetCurrentImageCaption { 433 my ( $self, $index, $pattern ) = @_; 434 435 $pattern = wxTheApp->eng_caption_patterns->{$pattern}; 436 437 $self->SetCurrentImage($index); 438 439 my $img = $self->current_image; 440 441 $self->init_caption_from_pattern( 442 $img->file, 443 $img->create_date, 444 $index, 445 $self->current_image->caption, 446 $pattern 447 ); 426 448 } 427 449 … … 742 764 userdata_dir 743 765 progress_msg 744 default_ photo_name745 default_ name_prefix766 default_caption 767 default_caption_pattern 746 768 upload_high 747 769 upload_hd … … 1504 1526 else{ 1505 1527 $_name = $name; 1506 $self->default_name_prefix($name); 1528 $self->GetImage($_)->caption( 1529 $_name 1530 ) ; 1507 1531 } 1532 1508 1533 $self->image_selection_name($_name); 1509 1510 1534 $self->GetImage($_)->site_name( 1511 1535 $_name
Note: See TracChangeset
for help on using the changeset viewer.