Changeset 3284 for extras/pLoader/trunk/src/Uploader
- Timestamp:
- May 15, 2009, 8:41:14 AM (15 years ago)
- Location:
- extras/pLoader/trunk/src/Uploader/GUI
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extras/pLoader/trunk/src/Uploader/GUI/wxApp.pm
r3267 r3284 306 306 use_offline 307 307 login_dlg 308 branding 308 309 / 309 310 ); … … 357 358 $self->{site_url} 358 359 ); 360 359 361 360 362 $self->site_username( … … 527 529 th_quality => 90, 528 530 auto_rotate => 1, 531 remove_uploaded_from_selection => 1, 529 532 interlace => 'Line', 530 533 create_resized => 1, … … 535 538 userdata_dir => $self->userdata_dir, 536 539 default_photo_name => gettext('File name'), 537 default_name_prefix => 'Photo',540 default_name_prefix => gettext('Photo'), 538 541 upload_rejects => [], 539 542 image_sums => {}, … … 571 574 $self->login_dlg->Show(0); 572 575 576 $self->_init_branding; 577 578 573 579 $self->pwg( 574 580 # get these parameters from dialog or from file … … 578 584 site_username => $self->site_username, 579 585 site_password => $self->site_password, 586 branding => $self->branding, 580 587 } 581 588 ) … … 818 825 } 819 826 820 827 # some labels differ with branding ( piwigo.com or piwigo.org ) 828 sub _init_branding { 829 my ( $self ) =@_; 830 831 if( $self->site_url =~ /\.piwigo\.com/ ){ 832 $self->branding( 833 { 834 category => gettext("album"), 835 Category => gettext("Album"), 836 categories => gettext("albums"), 837 Categories => gettext("Albums"), 838 'Add new category' => gettext("Add new album"), 839 } 840 ); 841 } 842 else{ 843 $self->branding( 844 { 845 categorie => gettext("categorie"), 846 Categorie => gettext("Categorie"), 847 categories => gettext("categories"), 848 Categories => gettext("Categories"), 849 'Add new category' => gettext("Add new category"), 850 } 851 ); 852 } 853 } 854 855 sub SaveConfig { 856 my ( $self, $params ) = @_; 857 858 my $config = Wx::ConfigBase::Get; 859 860 map { 861 $config->WriteInt( $_, $params->{$_} ) 862 } keys %$params; 863 864 $config->Write( 'Perspective', $params->{Perspective} ) 865 866 } 821 867 822 868 … … 830 876 my $w = $config->ReadInt( "Width", 1024 ); 831 877 my $h = $config->ReadInt( "height", 768 ); 832 my $sv = $config->ReadInt( "splitVertical", 150 ); 833 my $sh = $config->ReadInt( "splitHorizontal", 300 ); 878 my $prev_w = $config->ReadInt( "PreviewWidth", 400 ); 879 my $prev_h = $config->ReadInt( "PreviewHeight", 300 ); 880 my $perspective = $config->Read( "Perspective" ); 881 882 #printf("Config x %s, y %s, w %s, h %s, prev_w %s, prev_h %s\n", $x, $y, $w, $h, $prev_w, $prev_h); 834 883 835 884 my $url = $self->site_url; … … 848 897 pwg => $self->pwg, 849 898 imagelist => $self->imagelist, 899 preview_w => $prev_w, 900 preview_h => $prev_h, 901 perspective => $perspective, 850 902 } 851 903 ); 852 904 853 #printf("Config x %s, y %s, w %s, h %s\n", $x, $y, $w, $h); 854 #$frame->SetSize( $x, $y, $w, $h ); 905 $frame->SetSize( $x, $y, $w, $h ); 855 906 $frame->Show( 1 ); 856 907 $self->SetTopWindow( $frame ); -
extras/pLoader/trunk/src/Uploader/GUI/wxFrameAUI.pm
r3269 r3284 335 335 preview_settings 336 336 toolbar 337 branding 338 preview_w 339 preview_h 340 perspective 337 341 /; 338 342 __PACKAGE__->mk_accessors( @properties ); … … 345 349 EVT_LIST_END_LABEL_EDIT 346 350 EVT_LIST_ITEM_SELECTED 351 EVT_LIST_ITEM_ACTIVATED 347 352 EVT_TREE_ITEM_RIGHT_CLICK 348 353 EVT_LIST_KEY_DOWN … … 374 379 wxDEFAULT_FRAME_STYLE|wxMAXIMIZE 375 380 ); 381 $self->preview_w( 382 $params->{preview_w}||400 383 ); 384 385 $self->preview_h( 386 $params->{preview_h}||300 387 ); 388 389 $self->perspective( 390 $params->{perspective} 391 ); 392 376 393 $self->pwg( $params->{pwg} ); 377 394 $self->imagelist( $params->{imagelist} ); … … 426 443 ); 427 444 445 428 446 $self->manager( Wx::AuiManager->new ); 447 $self->manager->SetDockSizeConstraint(1, 1); 429 448 $self->manager->SetManagedWindow( $self ); 430 449 $self->_set_setting_properties; … … 436 455 } 437 456 457 438 458 sub _initImgTypes { 439 459 my ( $self ) = @_; … … 461 481 [ 462 482 { 463 label => "Photo name :",483 label => gettext("Photo caption :"), 464 484 value => sub { $self->imagelist->current_image->site_name(@_) }, 465 485 }, … … 548 568 }, 549 569 { 550 label => gettext("Default photo name:"),570 label => gettext("Default photo caption :"), 551 571 type => 'Choice', 552 572 value => sub { $self->imagelist->default_photo_name(@_) }, … … 563 583 }, 564 584 { 565 label => gettext("Photo nameprefix :"),585 label => gettext("Photo caption prefix :"), 566 586 value => sub { $self->imagelist->default_name_prefix(@_) }, 567 587 }, … … 581 601 value => sub { $self->imagelist->upload_high(@_) }, 582 602 }, 603 # { 604 # label => gettext("Remove uploaded photo from selection :"), 605 # type => 'Bool', 606 # value => sub { $self->imagelist->remove_uploaded_from_selection(@_) }, 607 # }, 583 608 ] 584 609 ); … … 822 847 ) 823 848 ); 824 825 849 826 850 $self->general_settings_panel->Show(0); … … 830 854 $self, 831 855 -1, 832 wxNullBitmap 856 wxNullBitmap, 857 wxDefaultPosition, 858 [$self->preview_w, $self->preview_h] 833 859 ) 834 860 ); 835 861 836 837 838 862 $self->image_prop_piwigo->Show(0); 839 840 841 863 842 864 $self->image_prop_exif->Show(0); … … 890 912 sub init_aui { 891 913 my ( $self ) = @_; 892 914 893 915 my $url = wxTheApp->site_url; 894 916 … … 901 923 $self->manager->AddPane 902 924 ( $self->create_tree, Wx::AuiPaneInfo->new->Name( "categories" )->Caption( 903 sprintf("%s - %s", gettext("Piwigo categories"), $url )925 sprintf("%s - %s", sprintf("Piwigo %s", wxTheApp->branding->{categories}), $url ) 904 926 ) 905 927 ->Right->Position( 0 )->Resizable->CloseButton(0) ); … … 920 942 ->ToolbarPane->Top->Row( 1 )->LeftDockable( 0 )->RightDockable( 0 ) ) if defined $self->toolbar; 921 943 944 if( $self->perspective){ 945 $self->manager->LoadPerspective($self->perspective); 946 } 947 922 948 $self->manager->Update; 923 949 … … 929 955 $self->manager->AddPane 930 956 ( $self->create_notebook_image_properties, Wx::AuiPaneInfo->new->Name( "photo_properties" )->Caption(gettext("Photo properties")) 931 -> Right->Position( 1 )->Resizable->CloseButton(0) );957 ->Floatable(1)->Resizable->CloseButton(1) ); 932 958 933 959 $self->manager->AddPane 934 960 ( $self->create_notebook_global_settings, Wx::AuiPaneInfo->new->Name( "global_settings" )->Caption(gettext("Global settings")) 935 ->Right->Position( 2 )->Resizable->CloseButton(1) ); 936 961 ->Floatable(1)->Resizable->CloseButton(1) ); 962 963 $self->manager->GetPane("photo_properties")->Show(0); 937 964 $self->manager->GetPane("global_settings")->Show(0); 938 965 939 966 } 940 967 968 sub OnPhotoProperties { 969 my ( $self ) = @_; 970 971 $self->manager->GetPane("photo_properties")->Float; 972 $self->manager->GetPane("photo_properties")->Show(1); 973 $self->manager->Update(); 974 975 } 976 941 977 sub OnGlobalSettings { 942 978 my ( $self ) = @_; 943 979 944 980 $self->toolbar->EnableTool(104, 0 ); 981 $self->manager->GetPane("global_settings")->Float; 945 982 $self->manager->GetPane("global_settings")->Show(1); 946 983 $self->manager->Update(); … … 1115 1152 } 1116 1153 1117 #$tree_items is a list of anonymous arrays1118 # [ itemLabel, undef, rootInfo, ImageIndex, SelImageIndex ] for the root1119 1120 # [ itemLabel,1121 # [ childItemLabel,1122 # [...],1123 # childItemdata,1124 # childImageIndex,1125 # childSelImageIndex1126 # ],1127 # Itemdata,1128 # ImageIndex,1129 # SelImageIndex1130 # ]1131 1154 1132 1155 # returns a valid itemData … … 1217 1240 EVT_TREE_ITEM_RIGHT_CLICK( $self->tree, $self->tree, \&OnTreeItemRightClick ); 1218 1241 EVT_LIST_END_LABEL_EDIT( $self, $self->imageviewer, \&OnImageViewerEndLabelEdit ); 1242 EVT_LIST_ITEM_ACTIVATED( $self, $self->imageviewer, \&OnImageViewerItemActivated ); 1219 1243 EVT_LIST_ITEM_SELECTED($self, $self->imageviewer, \&OnImageViewerItemSelected) ; 1220 1244 EVT_LIST_KEY_DOWN($self, $self->imageviewer, \&OnImageViewerKeyDown) ; … … 1234 1258 my( $self, $event ) = @_; 1235 1259 my $dialog = Wx::FileDialog->new 1236 ( $self, "Select photos to send", $prevfile, $prevdir,1237 "JPEG files (*.jpg)|*.jpg|All(*.*)|*.*",1260 ( $self, gettext("Select photos for upload"), $prevfile, $prevdir, 1261 sprintf("%s (*.jpg)|*.jpg|All(*.*)|*.*", gettext("JPEG files")), 1238 1262 wxFD_OPEN|wxFD_MULTIPLE ); 1239 1263 … … 1332 1356 } 1333 1357 ( 1334 [1+$ID_TREE_CTX_MENU, "Add new category","Add a new category to the current selected category."], 1335 [2+$ID_TREE_CTX_MENU, "Refresh","Refresh category list."], 1358 [ 1359 1+$ID_TREE_CTX_MENU, 1360 wxTheApp->branding->{'Add new category'}, 1361 sprintf( 1362 "%s %s %s %s", 1363 gettext("Add a new"), 1364 wxTheApp->branding->{category}, 1365 gettext("to the currently selected"), 1366 wxTheApp->branding->{category}, 1367 ) 1368 ], 1369 [ 1370 2+$ID_TREE_CTX_MENU, 1371 "Refresh", 1372 sprintf( 1373 "Refresh %s list.", 1374 wxTheApp->branding->{category}, 1375 ) 1376 ], 1336 1377 ); 1337 1378 $self->PopupMenu($ctx_mnu, $point); … … 1351 1392 my $dialog = Wx::TextEntryDialog->new( 1352 1393 $self, 1353 gettext("Category name :"),1354 gettext("Add new category"),1355 gettext("New category"),1394 sprintf("Category name :", wxTheApp->branding->{Category}), 1395 sprintf("Add new %s", wxTheApp->branding->{category}), 1396 sprintf("New %s", wxTheApp->branding->{category}), 1356 1397 ); 1357 1398 … … 1390 1431 1391 1432 $self->image_prop_piwigo->Refresh; 1433 } 1434 1435 sub OnImageViewerItemActivated { 1436 my( $self, $event ) = @_; 1437 1438 $self->OnPhotoProperties; 1392 1439 } 1393 1440 … … 1591 1638 Wx::MessageBox( 1592 1639 sprintf( 1593 gettext("Please select a valid target category"), 1640 "%s %s", 1641 gettext("Please select a valid target"), 1642 wxTheApp->branding->{category} 1594 1643 ), 1595 1644 gettext("Piwigo upload error"), … … 1632 1681 my $self = shift; 1633 1682 1683 1634 1684 # Restaure previous log wnd 1635 1685 Wx::Log::SetActiveTarget( $self->oldlogwnd ); … … 1641 1691 $self->imagelist->Store; 1642 1692 wxTheApp->login_dlg->Destroy; 1693 1694 my $params = {}; 1695 1696 ( $params->{'X'}, $params->{'Y'} ) = $self->GetPositionXY ; 1697 ( $params->{'Width'}, $params->{'Height'} ) = $self->GetSizeWH ; 1698 ( $params->{'PreviewWidth'}, $params->{'PreviewHeight'} ) = $self->image_preview->GetSizeWH ; 1699 $params->{Perspective} = $self->manager->SavePerspective; 1700 1701 1702 wxTheApp->SaveConfig( $params ); 1703 1643 1704 $self->Destroy; 1644 1705 }
Note: See TracChangeset
for help on using the changeset viewer.