Changeset 3357 for extensions/pLoader/trunk/src/Uploader
- Timestamp:
- May 27, 2009, 10:25:22 PM (15 years ago)
- Location:
- extensions/pLoader/trunk/src/Uploader/GUI
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/pLoader/trunk/src/Uploader/GUI/wxApp.pm
r3285 r3357 325 325 326 326 $self->version( 327 '2.0.2 a'327 '2.0.2c' 328 328 ); 329 329 … … 443 443 Wx::LogMessage gettext("Cannot find translation catalog files. Use default language"); 444 444 } 445 445 $self->locale($locale); 446 446 } 447 447 … … 551 551 userdata_dir => $self->userdata_dir, 552 552 default_photo_name => gettext('File name'), 553 default_name_prefix => gettext('Photo '),553 default_name_prefix => gettext('Photo '), 554 554 upload_rejects => [], 555 555 image_sums => {}, -
extensions/pLoader/trunk/src/Uploader/GUI/wxFrameAUI.pm
r3287 r3357 24 24 use Wx::DND; 25 25 use Wx qw/ 26 wxAUI_DOCKART_PANE_BORDER_SIZE 26 27 wxNullBitmap 27 28 wxID_OK … … 356 357 357 358 use Uploader::GUI::wxImageListCtrl; 359 use Uploader::GUI::wxImagePreview; 358 360 use Uploader::GUI::wxImageProcessingProgressDlg; 359 361 use Wx::Html; … … 445 447 446 448 $self->manager( Wx::AuiManager->new ); 447 $self->manager->SetDockSizeConstraint(1, 1);448 449 $self->manager->SetManagedWindow( $self ); 449 450 $self->_set_setting_properties; … … 733 734 $self->init_panels; 734 735 735 $self->imageviewer->Show(0); 736 #if(!$self->imagelist->wx_thumb_imglist->GetImageCount){ 737 # $self->imageviewer->Show(0); 738 #} 739 740 # my $imglistpage = [ 741 # [ 742 # $self->imageviewer, 743 # gettext("Photo selection"), 744 # '../res/images.png', 745 # wxBITMAP_TYPE_PNG, 746 # ], 747 # ]; 748 749 736 750 737 751 $self->init_aui; 738 752 $self->init_dnd_targets; 753 #$self->_populate_notebook($self->notebook, $imglistpage, 1); 754 739 755 if( $self->imagelist->wx_thumb_imglist->GetImageCount){ 740 756 printf("%s images\n", $self->imagelist->wx_thumb_imglist->GetImageCount); … … 850 866 $self->general_settings_panel->Show(0); 851 867 868 if(0){ 852 869 $self->image_preview( 853 870 Wx::StaticBitmap->new( … … 859 876 ) 860 877 ); 878 } 879 $self->image_preview( 880 Uploader::GUI::wxImagePreview->new( 881 $self, 882 -1, 883 wxNullBitmap, 884 wxDefaultPosition, 885 [$self->preview_w, $self->preview_h] 886 ) 887 ); 888 861 889 862 890 $self->image_prop_piwigo->Show(0); … … 869 897 my ( $self ) = @_; 870 898 899 my $file = sprintf( 900 "../locale/%s/gs.html", 901 wxTheApp->locale->GetCanonicalName 902 ); 903 871 904 $self->htmlhome( 872 905 Uploader::GUI::wxHtmlWindow->new( 873 $self, -1 906 $self, -1, [-1, -1], [450, 450] 874 907 ) 908 ); 909 910 $self->htmlhome->LoadPage($file) if -e $file ; 911 912 $self->htmlhome->InitHrefCallbacks( 913 { 914 new_album => sub {$self->OnAddCategories(@_) }, 915 add_photos => sub { $self->OnAddImages(@_) }, 916 upload_photos => sub { $self->ProcessImageSelection(@_)}, 917 } 875 918 ); 876 919 … … 895 938 ) 896 939 ); 897 $self->htmlhome->SetDropTarget(898 DNDImageListDropTarget->new(899 $self->imageviewer900 )901 );940 #$self->htmlhome->SetDropTarget( 941 # DNDImageListDropTarget->new( 942 # $self->imageviewer 943 # ) 944 #); 902 945 903 946 … … 919 962 $self->manager->AddPane 920 963 ( $self->create_notebook_imagelist, Wx::AuiPaneInfo->new->Name( "ImageViewer" ) 921 ->CenterPane-> Resizable->CloseButton(0) );964 ->CenterPane->Position(1)->Resizable->CloseButton(0) ); 922 965 923 966 $self->manager->AddPane … … 925 968 ->Right->Position( 0 )->Resizable->CloseButton(0) ); 926 969 927 $self->manager->AddPane928 ( $self->image_preview, Wx::AuiPaneInfo->new->Name( "preview" )929 ->Right->Position( 1 )->Resizable->CloseButton(0)->Floatable(0) );930 970 931 971 … … 941 981 942 982 if( $self->perspective){ 943 $self->manager->LoadPerspective($self->perspective) ;983 $self->manager->LoadPerspective($self->perspective) if $self->perspective =~ /getting_started/; 944 984 } 945 985 … … 952 992 $self->manager->GetPane("photo_properties")->Caption(gettext("Photo properties")); 953 993 $self->manager->GetPane("global_settings")->Caption(gettext("Global settings")); 994 $self->manager->GetPane("getting_started")->Caption(gettext("Getting started")); 954 995 955 996 … … 960 1001 sub _init_aui_settings_panels { 961 1002 my ( $self ) = @_; 1003 1004 $self->manager->AddPane 1005 ( $self->image_preview, Wx::AuiPaneInfo->new->Name( "preview" ) 1006 ->Floatable(1)->Resizable->CloseButton(1)); 1007 1008 1009 $self->manager->AddPane 1010 ( $self->htmlhome, Wx::AuiPaneInfo->new->Name( "getting_started" ) 1011 ->Floatable(1)->Resizable->CloseButton(1) ); 1012 962 1013 963 1014 $self->manager->AddPane … … 969 1020 ->Floatable(1)->Resizable->CloseButton(1) ); 970 1021 1022 $self->manager->GetPane("preview")->Show(0); 971 1023 $self->manager->GetPane("photo_properties")->Show(0); 972 1024 $self->manager->GetPane("global_settings")->Show(0); 1025 $self->manager->GetPane("getting_started")->Float; 1026 $self->manager->GetPane("getting_started")->Show(1); 973 1027 974 1028 } … … 977 1031 my ( $self ) = @_; 978 1032 979 $self->manager->GetPane("p hoto_properties")->Float;1033 $self->manager->GetPane("preview")->Float->Show(1); 980 1034 $self->manager->GetPane("photo_properties")->Show(1); 981 1035 $self->manager->Update(); … … 983 1037 } 984 1038 1039 sub OnGettingStarted { 1040 my ( $self ) = @_; 1041 1042 $self->toolbar->EnableTool(100, 0 ); 1043 $self->manager->GetPane("getting_started")->Float->Show(1); 1044 $self->manager->Update(); 1045 1046 } 1047 985 1048 sub OnGlobalSettings { 986 1049 my ( $self ) = @_; 987 1050 988 1051 $self->toolbar->EnableTool(104, 0 ); 989 $self->manager->GetPane("global_settings")->Float; 990 $self->manager->GetPane("global_settings")->Show(1); 1052 $self->manager->GetPane("global_settings")->Float->Show(1); 991 1053 $self->manager->Update(); 992 1054 } … … 1028 1090 my $book = Wx::AuiNotebook->new( $self, -1, [-1, -1], [300, 450], 1029 1091 wxBORDER_NONE|wxAUI_NB_TAB_MOVE|wxAUI_NB_TAB_SPLIT); 1030 my $pages = [ 1031 [ 1032 $self->htmlhome, 1033 gettext("Photo selection"), 1034 '../res/images.png', 1035 wxBITMAP_TYPE_PNG, 1036 ], 1037 #[ 1038 # $self->logwnd( $self->_create_textctrl( $book, undef, [450, 450] )), 1039 # "Log", 1040 # '../res/nb_log.png', 1041 # wxBITMAP_TYPE_PNG, 1042 #] 1043 ]; 1044 1045 $self->_populate_notebook( $book, $pages ); 1046 1047 #$self->logwnd(Wx::LogTextCtrl->new( $self->logwnd )); 1048 #$self->oldlogwnd( Wx::Log::SetActiveTarget( $self->logwnd ) ); 1092 1093 my $imglistpage = [ 1094 [ 1095 $self->imageviewer, 1096 gettext("Photo selection"), 1097 '../res/images.png', 1098 wxBITMAP_TYPE_PNG, 1099 ], 1100 ]; 1101 1049 1102 $self->notebook($book); 1103 $self->_populate_notebook($self->notebook, $imglistpage, 0); 1050 1104 return $book; 1051 1105 } … … 1240 1294 my ( $self ) = @_ ; 1241 1295 1296 Wx::Event::EVT_MENU( $self, 100, \&OnGettingStarted ); 1242 1297 Wx::Event::EVT_MENU( $self, 101, \&OnAddImages ); 1243 1298 Wx::Event::EVT_MENU( $self, 102, \&OnRemoveImages ); … … 1276 1331 } 1277 1332 $dialog->Destroy; 1278 $event->Skip;1333 # $event->Skip; 1279 1334 } 1280 1335 } … … 1289 1344 else{ 1290 1345 $self->toolbar->EnableTool(104, 1); 1346 } 1347 if($self->manager->GetPane("getting_started")->IsShown){ 1348 $self->toolbar->EnableTool(100, 0); 1349 } 1350 else{ 1351 $self->toolbar->EnableTool(100, 1); 1291 1352 } 1292 1353 } … … 1463 1524 wxNullBitmap 1464 1525 ); 1526 1465 1527 $self->image_preview->Refresh; 1466 1528 1467 1468 $self->image_preview->SetBitmap( 1469 Wx::Bitmap->new( 1529 my $bmp = Wx::Bitmap->new( 1470 1530 $self->imagelist->current_image->preview_file, 1471 1531 $self->GetWxBitmapType($self->imagelist->type), 1472 ) 1473 ); 1532 ); 1533 1534 1535 $self->image_preview->SetBitmap( 1536 $bmp 1537 ); 1538 1539 my $size = [8+$bmp->GetWidth, 26+$bmp->GetHeight]; 1540 $self->manager->GetPane("preview")->FloatingSize($size); 1474 1541 1475 1542 $self->image_preview->Refresh; … … 1567 1634 1568 1635 if(!$self->imageviewer->IsShown){ 1569 my $imglistpage = [1570 [1571 $self->imageviewer,1572 gettext("Photo selection"),1573 '../res/images.png',1574 wxBITMAP_TYPE_PNG,1575 ],1576 ];1577 $self->notebook->DeletePage(0);1636 #my $imglistpage = [ 1637 # [ 1638 # $self->imageviewer, 1639 # gettext("Photo selection"), 1640 # '../res/images.png', 1641 # wxBITMAP_TYPE_PNG, 1642 # ], 1643 #]; 1644 #$self->notebook->DeletePage(0); 1578 1645 1579 1646 $self->imageviewer->Show(1); 1580 $self->_populate_notebook($self->notebook, $imglistpage, 0);1647 #$self->_populate_notebook($self->notebook, $imglistpage, 0); 1581 1648 # load imagelist with loading.jpg 1582 1649 } … … 1585 1652 1586 1653 1654 sub ActivateImageViewer { 1655 my ( $self ) = @_; 1656 1657 } 1587 1658 1588 1659 … … 1616 1687 1617 1688 if( scalar @{$self->imagelist->categories} ){ 1689 1618 1690 return if( !defined $self->imagelist->image_selection ); 1619 1691 return if( !scalar @{$self->imagelist->image_selection} ); … … 1737 1809 } 1738 1810 ( 1811 [ 1812 100, 1813 gettext("Getting started"), 1814 '../res/tb_getting_started.png', 1815 wxBITMAP_TYPE_PNG, 1816 1, 1817 '../res/tb_getting_started.png', 1818 gettext("Display getting started panel") 1819 ], 1739 1820 [ 1740 1821 101, -
extensions/pLoader/trunk/src/Uploader/GUI/wxHtmlWindow.pm
r2597 r3357 28 28 my $this = $class->SUPER::new( @_ ); 29 29 30 if( -e '../res/intro.html' ){ 31 $this->LoadPage( 32 '../res/intro.html' 33 ); 34 } 30 return $this; 31 } 35 32 36 return $this; 33 sub InitHrefCallbacks { 34 my ( $self, $callbacks ) = @_; 35 36 $callbacks ||={}; 37 $self->{HrefCallbacks} = $callbacks ; 37 38 } 38 39 … … 40 41 my( $this, $link ) = @_; 41 42 42 Wx::LogMessage( 'Link clicked: href="%s"', $link->GetHref() ); 43 $this->SUPER::OnLinkClicked( $link ); 43 my $href = $link->GetHref(); 44 45 $this->{HrefCallbacks}->{$href}->() if exists $this->{HrefCallbacks}->{$href}; 46 44 47 } 45 48
Note: See TracChangeset
for help on using the changeset viewer.