Changeset 3458 for extensions
- Timestamp:
- Jun 25, 2009, 5:52:30 PM (15 years ago)
- Location:
- extensions/pLoader/trunk/src/Uploader/GUI
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/pLoader/trunk/src/Uploader/GUI/wxApp.pm
r3456 r3458 302 302 thumb_dir 303 303 conf_file 304 layout_file 304 305 locale 305 306 current_language … … 310 311 branding 311 312 frame 313 perspective 314 imageviewerIndex 315 frameLayout 312 316 / 313 317 ); … … 331 335 # to check if we can use stored cache 332 336 $self->imagelist_version( 333 ' 3'337 '4' 334 338 ); 335 339 … … 349 353 350 354 my $conf = retrieve $self->conf_file if -e $self->conf_file; 355 my $layout = retrieve $self->layout_file if -e $self->layout_file; 351 356 352 357 if(defined $conf ){ … … 355 360 else { 356 361 $self->_readParams( 'pLoader.ini' ) unless defined $conf ; 362 } 363 364 if(defined $layout ){ 365 $self->SetKeyValues($layout); 357 366 } 358 367 … … 467 476 }, 468 477 $self->conf_file 478 ); 479 }; 480 } 481 482 sub StoreLayoutProperties { 483 my ( $self ) = @_; 484 485 eval { 486 store( 487 { 488 map{ 489 $_ => $self->{$_}, 490 } 491 qw/ 492 perspective 493 imageviewerIndex 494 frameLayout 495 / 496 }, 497 $self->layout_file 469 498 ); 470 499 }; … … 540 569 filter => 'Lanczos', 541 570 blur => 0.9, 542 quality => 100,571 quality => 95, 543 572 wx_quality => 80, 544 573 th_quality => 90, … … 658 687 ); 659 688 660 689 $self->layout_file( 690 File::Spec->catfile( 691 $self->userdata_dir, 692 ".$applicationName.layout" 693 ) 694 ); 661 695 662 696 $self->storable_file( … … 895 929 my ( $self ) = @_; 896 930 897 my $config = Wx::ConfigBase::Get;898 899 my $x = $config->ReadInt( "X", 50 );900 my $y = $config->ReadInt( "Y", 50 );901 my $w = $config->ReadInt( "Width", 1024 );902 my $h = $config->ReadInt( "height", 768 );903 my $prev_w = $config->ReadInt( "PreviewWidth", 400 );904 my $prev_h = $config->ReadInt( "PreviewHeight", 300 );905 my $perspective = $config->Read( "Perspective" );906 my $imageviewer_index = $config->ReadInt( "ImageviewerIndex", 0 );907 908 #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);909 910 931 my $url = $self->site_url; 911 932 … … 917 938 Uploader::GUI::wxFrameAUI->new( 918 939 { 919 x => $x,920 y => $y,921 width => $w,922 height => $h,923 940 title => sprintf("pLoader - Piwigo uploader %s - [%s]", $self->version, $url), 924 941 pwg => $self->pwg, 925 942 imagelist => $self->imagelist, 926 preview_w => $prev_w, 927 preview_h => $prev_h, 928 perspective => $perspective, 929 imageviewer_index => $imageviewer_index, 943 perspective => $self->perspective, 944 imageviewer_index => $self->imageviewerIndex, 945 frameLayout => $self->frameLayout, 930 946 } 931 947 ) 932 948 ); 933 934 $self->frame->SetSize( $x, $y, $w, $h ); 949 935 950 $self->frame->Show( 1 ); 936 951 $self->SetTopWindow( $self->frame ); -
extensions/pLoader/trunk/src/Uploader/GUI/wxFrameAUI.pm
r3387 r3458 337 337 toolbar 338 338 branding 339 preview_w340 preview_h341 339 perspective 342 340 current_imageviewer_index … … 344 342 tree_mnu 345 343 imageviewer_select_multi 344 frameLayout 346 345 /; 347 346 __PACKAGE__->mk_accessors( @properties ); … … 382 381 undef, 383 382 -1, 384 $params->{title}, 385 [ $params->{x}, $params->{y} ],386 [ $params->{width}, $params->{height} ],383 $params->{title}, 384 wxDefaultPosition, 385 wxDefaultSize, 387 386 wxDEFAULT_FRAME_STYLE 388 387 ); 389 $self->preview_w( 390 $params->{preview_w}||400 391 ); 392 393 $self->preview_h( 394 $params->{preview_h}||300 395 ); 388 396 389 397 390 $self->perspective( … … 401 394 $self->current_imageviewer_index( 402 395 $params->{imageviewer_index}||0 396 ); 397 398 $self->frameLayout( 399 $params->{frameLayout} || { 'pX' => -1, 'pY' => -1, W => 800, H => 600 } 403 400 ); 404 401 … … 871 868 $self, 872 869 -1, 873 wxNullBitmap, 874 wxDefaultPosition, 875 [$self->preview_w, $self->preview_h] 870 [400,300], 876 871 ) 877 872 ); … … 954 949 ->CenterPane->Position(1)->Resizable->CloseButton(0) ); 955 950 956 $self->manager->AddPane 957 ( $self->create_tree, Wx::AuiPaneInfo->new->Name( "categories" ) 958 ->Right->Position( 0 )->Resizable->CloseButton(0) ); 951 $self->manager->AddPane( 952 $self->create_tree, 953 Wx::AuiPaneInfo->new->Name( "categories" ) 954 ->Right->Position( 0 )->Resizable->CloseButton(0), 955 ); 959 956 960 957 … … 970 967 ->ToolbarPane->Top->Row( 1 )->LeftDockable( 0 )->RightDockable( 0 ) ) if defined $self->toolbar; 971 968 969 $self->SetSize( 970 $self->frameLayout->{pX}, 971 $self->frameLayout->{pY}, 972 $self->frameLayout->{W}, 973 $self->frameLayout->{H}, 974 ); 975 976 972 977 if($self->perspective){ 973 $self->manager->LoadPerspective($self->perspective) if $self->perspective =~ /getting_started/; 978 $self->manager->LoadPerspective($self->perspective); 979 } 980 else { 981 $self->manager->GetPane("categories")->MinSize(300,100); 982 983 $self->manager->GetPane("tb1")->Caption( gettext("Tools") ); 984 $self->manager->GetPane("image_preview")->Caption(gettext("Preview"))->Show(0); 985 $self->manager->GetPane("getting_started")->Caption(gettext("Getting started"))->Float->Show(1); 986 $self->manager->GetPane("photo_properties")->Caption(gettext("Photo properties"))->Float->Show(0); 987 $self->manager->GetPane("global_settings")->Caption(gettext("Global settings"))->Float->Show(0); 974 988 } 975 989 976 990 $self->manager->GetPane("categories")->Caption( 977 991 sprintf("%s - %s", sprintf("Piwigo %s", wxTheApp->branding->{categories}), $url ) 978 ); 979 980 $self->manager->GetPane("preview")->Caption(gettext("Preview")); 981 $self->manager->GetPane("tb1")->Caption( gettext("Tools") ); 982 $self->manager->GetPane("photo_properties")->Caption(gettext("Photo properties")); 983 $self->manager->GetPane("global_settings")->Caption(gettext("Global settings")); 984 $self->manager->GetPane("getting_started")->Caption(gettext("Getting started")); 985 992 ); 986 993 987 994 $self->manager->Update; 988 995 989 996 } 997 990 998 991 999 sub _init_aui_settings_panels { … … 993 1001 994 1002 $self->manager->AddPane 995 ( $self->image_preview, Wx::AuiPaneInfo->new->Name( " preview" )1003 ( $self->image_preview, Wx::AuiPaneInfo->new->Name( "image_preview" ) 996 1004 ->Floatable(1)->Fixed->CloseButton(1)); 997 998 1005 999 1006 $self->manager->AddPane … … 1001 1008 ->Floatable(1)->Resizable->CloseButton(1) ); 1002 1009 1003 1004 1010 $self->manager->AddPane 1005 1011 ( $self->create_notebook_image_properties, Wx::AuiPaneInfo->new->Name( "photo_properties" ) … … 1010 1016 ->Floatable(1)->Resizable->CloseButton(1) ); 1011 1017 1012 $self->manager->GetPane("preview")->Show(0);1013 $self->manager->GetPane("photo_properties")->Show(0);1014 $self->manager->GetPane("global_settings")->Show(0);1015 $self->manager->GetPane("getting_started")->Float;1016 $self->manager->GetPane("getting_started")->Show(1);1017 1018 1018 } 1019 1019 … … 1029 1029 my ( $self ) = @_; 1030 1030 1031 $self->manager->GetPane(" preview")->Float->Show(1);1031 $self->manager->GetPane("image_preview")->Float->Show(1); 1032 1032 $self->manager->Update(); 1033 1033 … … 1701 1701 1702 1702 my $size = [8+$bmp->GetWidth, 26+$bmp->GetHeight]; 1703 $self->manager->GetPane(" preview")->FloatingSize($size);1703 $self->manager->GetPane("image_preview")->FloatingSize($size); 1704 1704 1705 1705 $self->image_preview->Refresh; … … 1942 1942 wxTheApp->login_dlg->Destroy; 1943 1943 1944 my $params = {}; 1945 1946 ( $params->{'X'}, $params->{'Y'} ) = $self->GetPositionXY ; 1947 ( $params->{'Width'}, $params->{'Height'} ) = $self->GetSizeWH ; 1948 ( $params->{'PreviewWidth'}, $params->{'PreviewHeight'} ) = $self->image_preview->GetSizeWH ; 1949 $params->{Perspective} = $self->manager->SavePerspective; 1950 $params->{ImageviewerIndex} = $self->current_imageviewer_index; 1951 1952 1953 wxTheApp->SaveConfig( $params ); 1944 wxTheApp->perspective( 1945 $self->manager->SavePerspective 1946 ); 1947 1948 wxTheApp->imageviewerIndex( 1949 $self->current_imageviewer_index 1950 ); 1951 1952 my $frameLayout = {}; 1953 1954 ( $frameLayout->{pX}, $frameLayout->{pY}, $frameLayout->{W}, $frameLayout->{H} ) = ( $self->GetPositionXY, $self->GetSizeWH ) ; 1955 1956 wxTheApp->frameLayout( 1957 $frameLayout 1958 ); 1959 1960 wxTheApp->StoreLayoutProperties; 1954 1961 1955 1962 $self->Destroy;
Note: See TracChangeset
for help on using the changeset viewer.