Changeset 4589


Ignore:
Timestamp:
Dec 30, 2009, 10:52:22 PM (11 years ago)
Author:
ronosman
Message:

Bug fixes for new global settings dialog box.

Location:
extensions/pLoader/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • extensions/pLoader/trunk/res/global_settings_wdr.pl

    r4570 r4589  
    119119    $item10->AddWindow( $item11, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 );
    120120
    121     my( $item12 ) = Wx::TextCtrl->new( $parent, $main::GS_DEFAULT_AUTHOR, "", wxDefaultPosition, [190,-1], 0 );
     121    my( $item12 ) = Wx::TextCtrl->new( $parent, $main::GS_DEFAULT_AUTHOR, "", wxDefaultPosition, [200,-1], 0 );
    122122    $item10->AddWindow( $item12, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
    123123
     
    140140    $item16->AddWindow( $item17, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 );
    141141
    142     my( $item18 ) = Wx::CollapsiblePane->new( $parent, $main::CPANE_RESIZE, "", wxDefaultPosition, [10,10], 0|wxCP_DEFAULT_STYLE );
     142    my( $item18 ) = Wx::CollapsiblePane->new( $parent, $main::CPANE_RESIZE, "", wxDefaultPosition, wxDefaultSize, 0|wxCP_DEFAULT_STYLE );
    143143    my( $oldparent ) = $parent;
    144144    $parent = $item18->GetPane();
     
    167167    $parent = $oldparent;
    168168   
    169     $item16->AddWindow( $item18, 0, 0, 5 );
    170 
    171     my( $item26 ) = Wx::CollapsiblePane->new( $parent, $main::CPANE_RESIZE_ADVANCED, "", wxDefaultPosition, [10,10], 0|wxCP_DEFAULT_STYLE );
     169    $item16->AddWindow( $item18, 0, wxALL, 5 );
     170
     171    my( $item26 ) = Wx::CollapsiblePane->new( $parent, $main::CPANE_RESIZE_ADVANCED, "Advanced", wxDefaultPosition, wxDefaultSize, 0|wxCP_DEFAULT_STYLE );
    172172    my( $oldparent ) = $parent;
    173173    $parent = $item26->GetPane();
     
    196196    $parent = $oldparent;
    197197   
    198     $item16->AddWindow( $item26, 0, 0, 5 );
     198    $item16->AddWindow( $item26, 0, wxALL, 5 );
    199199
    200200    $item14->Add( $item16, 0, wxALIGN_CENTER_VERTICAL, 5 );
     
    209209    $item34->AddWindow( $item36, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 );
    210210
    211     my( $item37 ) = Wx::CollapsiblePane->new( $parent, $main::CPANE_HD, "", wxDefaultPosition, [10,10], 0|wxCP_DEFAULT_STYLE );
     211    my( $item37 ) = Wx::CollapsiblePane->new( $parent, $main::CPANE_HD, "", wxDefaultPosition, wxDefaultSize, 0|wxCP_DEFAULT_STYLE );
    212212    my( $oldparent ) = $parent;
    213213    $parent = $item37->GetPane();
     
    236236    $parent = $oldparent;
    237237   
    238     $item34->AddWindow( $item37, 0, 0, 5 );
    239 
    240     my( $item45 ) = Wx::CollapsiblePane->new( $parent, $main::CPANE_HD_ADVANCED, "", wxDefaultPosition, [10,10], 0|wxCP_DEFAULT_STYLE );
     238    $item34->AddWindow( $item37, 0, wxALL, 5 );
     239
     240    my( $item45 ) = Wx::CollapsiblePane->new( $parent, $main::CPANE_HD_ADVANCED, "Advanced", wxDefaultPosition, wxDefaultSize, 0|wxCP_DEFAULT_STYLE );
    241241    my( $oldparent ) = $parent;
    242242    $parent = $item45->GetPane();
     
    265265    $parent = $oldparent;
    266266   
    267     $item34->AddWindow( $item45, 0, 0, 5 );
     267    $item34->AddWindow( $item45, 0, wxALL, 5 );
    268268
    269269    $item0->Add( $item34, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
     
    283283    $item53->Add( $item55, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 );
    284284
    285     my( $item58 ) = Wx::CollapsiblePane->new( $parent, $main::CPANE_WATERMARK, "", wxDefaultPosition, [10,10], 0|wxCP_DEFAULT_STYLE );
     285    my( $item58 ) = Wx::CollapsiblePane->new( $parent, $main::CPANE_WATERMARK, "", wxDefaultPosition, wxDefaultSize, 0|wxCP_DEFAULT_STYLE );
    286286    my( $oldparent ) = $parent;
    287287    $parent = $item58->GetPane();
     
    328328    $parent = $oldparent;
    329329   
    330     $item53->AddWindow( $item58, 0, 0, 5 );
     330    $item53->AddWindow( $item58, 0, wxALL, 5 );
    331331
    332332    $item0->Add( $item53, 0, wxALIGN_CENTER_VERTICAL, 5 );
     
    339339    $item72->AddWindow( $item74, 0, wxALIGN_CENTER|wxALL, 5 );
    340340
    341     my( $item75 ) = Wx::CollapsiblePane->new( $parent, $main::CPANE_TRANSFERT_ADVANCED, "", wxDefaultPosition, [10,10], 0|wxCP_DEFAULT_STYLE );
     341    my( $item75 ) = Wx::CollapsiblePane->new( $parent, $main::CPANE_TRANSFERT_ADVANCED, "", wxDefaultPosition, wxDefaultSize, 0|wxCP_DEFAULT_STYLE );
    342342    my( $oldparent ) = $parent;
    343343    $parent = $item75->GetPane();
     
    358358    $item0->Add( $item72, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
    359359
    360     my( $item79 ) = Wx::StaticLine->new( $parent, $main::ID_LINE, wxDefaultPosition, [20,-1], wxLI_HORIZONTAL );
    361     $item0->AddWindow( $item79, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
    362 
    363     my( $item80 ) = Wx::BoxSizer->new( wxVERTICAL );
    364    
     360    my( $item79 ) = Wx::BoxSizer->new( wxVERTICAL );
     361   
     362    my( $item80 ) = Wx::StaticLine->new( $parent, $main::ID_LINE, wxDefaultPosition, [20,-1], wxLI_HORIZONTAL );
     363    $item79->AddWindow( $item80, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
     364
    365365    my( $item81 ) = Wx::Button->new( $parent, $main::GS_CLOSE, "OK", wxDefaultPosition, wxDefaultSize, 0 );
    366     $item80->AddWindow( $item81, 0, wxALIGN_BOTTOM|wxALIGN_CENTER_HORIZONTAL, 5 );
    367 
    368     $item0->Add( $item80, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
     366    $item79->AddWindow( $item81, 0, wxALIGN_BOTTOM|wxALIGN_CENTER_HORIZONTAL|wxALL, 5 );
     367
     368    $item0->Add( $item79, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
    369369
    370370    my( $set_size ) = @_ >= 3 ? $_[2] : 1;
  • extensions/pLoader/trunk/src/Uploader/GUI/DlgCommon.pm

    r4569 r4589  
    1111    qw/
    1212        properties
     13        frame_callback
    1314      /
    1415);
  • extensions/pLoader/trunk/src/Uploader/GUI/wxFrameAUI.pm

    r4573 r4589  
    105105          image_prop_tags
    106106          notebook_image_properties
    107           notebook_global_settings
    108107          global_settings_panel
    109108          piwigo_property_list
     
    426425                choices =>
    427426                [
    428                     map { gettext $_ } ( "Use resized original", "Use original" )
     427                    map { gettext $_ } ( "Use original", "Use resized original" )
    429428                ],
    430429                frame_callback => sub {
     
    450449            $main::SITE_IMG_FILTER => { label => gettext("Site image filter") },
    451450            $main::GS_SITE_IMG_FILTER => {
    452                 selection =>  sub { $self->imagelist->filter(@_) },
     451                string_selection =>  sub { $self->imagelist->filter(@_) },
    453452                choices =>
    454453                [
     
    463462            $main::SITE_IMG_INTERLACE => { label => gettext("Site image interlace") },
    464463            $main::GS_SITE_IMG_INTERLACE => {
    465                 selection => sub { $self->imagelist->interlace(@_) },
     464                string_selection => sub { $self->imagelist->interlace(@_) },
    466465                choices =>
    467466                [
     
    504503            $main::HD_IMG_FILTER => { label => gettext("HD image filter") },
    505504            $main::GS_HD_IMG_FILTER => {
    506                 selection =>  sub { $self->imagelist->hd_filter(@_) },
     505                string_selection =>  sub { $self->imagelist->hd_filter(@_) },
    507506                choices =>
    508507                [
     
    517516            $main::HD_IMG_INTERLACE => { label => gettext("HD image interlace") },
    518517            $main::GS_HD_IMG_INTERLACE => {
    519                 selection => sub { $self->imagelist->hd_interlace(@_) },
     518                string_selection => sub { $self->imagelist->hd_interlace(@_) },
    520519                choices =>
    521520                [
     
    709708
    710709    if( $self->imagelist->wx_thumb_imglist->GetImageCount){
    711         printf("%s images\n", $self->imagelist->wx_thumb_imglist->GetImageCount);
     710        #printf("%s images\n", $self->imagelist->wx_thumb_imglist->GetImageCount);
    712711        $self->ShowImageViewer;
    713712       
     
    756755                parentwnd       => $self,
    757756                properties      => $self->global_settings,
     757                frame_callback  => sub { my ($size)=@_;
     758                    $self->manager->GetPane("global_settings")->FloatingSize(
     759                        [
     760                            $size->GetWidth,
     761                            40+ $size->GetHeight
     762                        ]
     763                    );
     764                    $self->manager->Update
     765                },
    758766            }
    759767        )
     
    934942        $self->global_settings_panel,
    935943        Wx::AuiPaneInfo->new->Name( "global_settings" )
    936         ->DefaultPane->CloseButton(1)->MinSize([720, 620])->Float->Hide );
     944        ->Floatable(1)->Dockable(0)->CloseButton(1)->Float->Hide );
    937945
    938946}
  • extensions/pLoader/trunk/src/Uploader/GUI/wxGlobalSettings.pm

    r4571 r4589  
    5555        $params->{properties}
    5656    );
     57
     58    $self->frame_callback(
     59        $params->{frame_callback}
     60    );
     61
    5762    $self->{cpane_resize} = $self->FindWindow($main::CPANE_RESIZE);
    5863    $self->{cpane_resize_advanced} = $self->FindWindow($main::CPANE_RESIZE_ADVANCED);
     
    8691    EVT_CLOSE( $self, \&OnClose );
    8792    Wx::Event::EVT_COLLAPSIBLEPANE_CHANGED( $self, $self->{cpane_resize}, \&OnPaneChanged );
    88     Wx::Event::EVT_COLLAPSIBLEPANE_CHANGED( $self, $self->{cpane_resize_advanced}, \&OnAdvancedPaneChanged );
     93    Wx::Event::EVT_COLLAPSIBLEPANE_CHANGED( $self, $self->{cpane_resize_advanced}, \&OnPaneChanged );
    8994    Wx::Event::EVT_COLLAPSIBLEPANE_CHANGED( $self, $self->{cpane_hd}, \&OnPaneChanged );
    90     Wx::Event::EVT_COLLAPSIBLEPANE_CHANGED( $self, $self->{cpane_hd_advanced}, \&OnAdvancedPaneChanged );
     95    Wx::Event::EVT_COLLAPSIBLEPANE_CHANGED( $self, $self->{cpane_hd_advanced}, \&OnPaneChanged );
    9196    Wx::Event::EVT_COLLAPSIBLEPANE_CHANGED( $self, $self->{cpane_watermark}, \&OnPaneChanged );
    92     Wx::Event::EVT_COLLAPSIBLEPANE_CHANGED( $self, $self->{cpane_transfert_advanced}, \&OnAdvancedPaneChanged );
     97    Wx::Event::EVT_COLLAPSIBLEPANE_CHANGED( $self, $self->{cpane_transfert_advanced}, \&OnPaneChanged );
    9398
    9499}
     
    111116    my( $self, $event ) = @_;
    112117
    113 #    $self->_set_size(
    114 #        $event->GetCollapsed
    115 #    );
    116     $self->Layout;
    117     $event->Skip;
    118 }
    119 
    120 sub OnAdvancedPaneChanged {
    121     my( $self, $event ) = @_;
    122 
    123     $self->Layout;
    124     $event->Skip;
    125 
    126 }
     118    $self->_layout;
     119    $event->Skip;
     120}
     121
     122sub _layout {
     123    my( $self ) = @_;
     124
     125    $self->Layout;
     126    $self->GetSizer->Fit($self);
     127    my $size = $self->GetSize;
     128    $self->frame_callback->($size);
     129
     130}
     131
    127132
    128133sub OnDefaultPhotoCaption {
     
    162167    my $b = 1;
    163168    if('CODE' eq ref $self->properties->{$id}->{selection}){
    164         $b = $self->properties->{$id}->{selection}->()
     169        $b = !$self->properties->{$id}->{selection}->()
    165170    }
    166171
    167172    $self->{cpane_resize}->Collapse($b);
    168     $self->Layout;
    169     $event->Skip;
    170 
    171 }
    172 
    173 
    174 sub _set_size {
    175     my ( $self, $collapsed ) = @_;
    176 
    177     printf("collapsed %s\n", $collapsed);
    178     my $new_size = $collapsed ? Wx::Size->new(200, 200) : Wx::Size->new(800, 800);
    179     printf("collapsed %s, %s\n", $new_size->GetWidth, $new_size->GetHeight);
    180 
    181     $self->SetMinSize($new_size);
    182     $self->Layout;
    183 }
     173    $self->_layout;
     174    $event->Skip;
     175
     176}
     177
    184178
    185179sub OnHDUpload {
     
    196190    }
    197191    $self->{cpane_hd}->Collapse($b);
    198     $self->Layout;
     192    $self->_layout;
    199193    $event->Skip;
    200194}
     
    210204
    211205    $self->{cpane_watermark}->Collapse($b);
    212     $self->Layout;
     206    $self->_layout;
    213207    $event->Skip;
    214208}
Note: See TracChangeset for help on using the changeset viewer.