Changeset 5133 for extensions/pLoader


Ignore:
Timestamp:
Mar 13, 2010, 9:14:59 PM (14 years ago)
Author:
ronosman
Message:

Feature 1504 : move language switch in Preferences.

Location:
extensions/pLoader/trunk
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • extensions/pLoader/trunk/locale/fr_FR/pLoader.po

    r5104 r5133  
    667667msgid "to choose files on your computer"
    668668msgstr "pour choisir des fichiers de votre ordinateur"
     669
     670msgid "Add photos"
     671msgstr "Ajouter des photos"
     672
     673msgid "Remove selected photos"
     674msgstr "Enlever les photos sélectionnées"
  • extensions/pLoader/trunk/src/Uploader/GUI/Frame.pm

    r5120 r5133  
    9090
    9191
     92
    9293my @properties =
    9394    qw/
     
    146147my $ID_TREE_CTX_MENU = 20000 ;
    147148my $ID_IMAGEVIEWER_CTX_MENU = 20100 ;
     149
    148150
    149151sub new {
     
    269271    $self->_initImgTypes;   
    270272
    271     # only refresh when calling event is finished
    272     Wx::Event::EVT_IDLE(
    273         $self,
    274         sub {
    275             my ( $self, $event ) = @_;
    276             if ( $self->image_preview_refresh and $self->image_preview->IsShown ){
    277                 $self->set_preview_image;
    278                 $self->image_preview->Refresh;
    279                 $self->image_preview_refresh(0);
    280             }
    281 
    282             if($self->imageviewer_refresh){
    283                 $self->imageviewer->Refresh;
    284                 $self->imageviewer_refresh(0);
    285             }
    286             # have to support batch mode
    287             if($self->imageviewer_item_refresh){
    288                 map {
    289                     $self->imageviewer->ItemRefresh(
    290                         $_
    291                     )
    292                 } @{$self->imageviewer->GetSelectedItems};
    293                 $self->imageviewer_item_refresh(0);
    294             }
    295 
    296             if(!scalar @{$self->imageviewer->GetSelectedItems} and $self->dlg_piwigo_photo_properties->{_properties_notebook}->IsEnabled){
    297                 $self->dlg_piwigo_photo_properties->{_properties_notebook}->Enable(0);
    298             }
    299 
    300 
    301             $self->OnUpdateToolbar;
    302             $event->Skip;
    303         }
    304     );
    305 
    306273    $self->imageviewer->SelectItem(
    307274        $self->current_imageviewer_index
     
    591558            $main::GS_CHUNK_SIZE => {
    592559                value   => sub { wxTheApp->chunk_size(@_) },
     560            },
     561            $main::LANGUAGE => { label => gettext("Choose a language") },
     562            $main::GS_LANGUAGE => {
     563                selection => sub { wxTheApp->current_language(@_) },
     564                choices => [ map { sprintf($_->[0], gettext($_->[2])) } @{wxTheApp->available_languages} ],
     565                pre_process => sub { my ( $value ) = @_; wxTheApp->available_languages->[$value][1] },
     566                frame_callback => sub { my ( $self, $ctrl, $event ) = @_;
     567                    Wx::LogMessage(
     568                        sprintf(
     569                            "%s : %s", 
     570                            gettext("pLoader needs to be restarted to display the new selected language"),
     571                            gettext(wxTheApp->available_languages->[$event->GetSelection][2])
     572                        )
     573                    );
     574                    wxTheApp->layout_clean(1);
     575                },
    593576            },
    594577        }   
     
    917900}
    918901
    919 sub OnChooseLanguage {
    920     my ( $self ) = @_;   
    921 
    922   my $languages = wxTheApp->available_languages;
    923 
    924 
    925   my $dialog = new Wx::SingleChoiceDialog(
    926     undef,
    927     gettext( "Choose a language" ),
    928     gettext( "Choose a language" ),
    929     [ map { sprintf($_->[0], gettext($_->[2])) } @$languages ]
    930   );
    931 
    932   if( $dialog->ShowModal() == wxID_OK ) {
    933     wxTheApp->current_language(
    934         $languages->[$dialog->GetSelection][1]
    935     );
    936 
    937     Wx::LogMessage(
    938         sprintf(
    939             "%s : %s", 
    940             gettext("pLoader needs to be restarted to display the new selected language"),
    941             gettext($languages->[$dialog->GetSelection][2])
    942         )
    943     );
    944     wxTheApp->layout_clean(1);
    945   }
    946 
    947   $dialog->Destroy;
    948 
    949 }
    950902
    951903sub OnDefaultPhotoNameChanged {
     
    11821134    Wx::Event::EVT_MENU( $self, 103, \&OnUploadImages );
    11831135    Wx::Event::EVT_MENU( $self, 104, \&OnGlobalSettings );
    1184     #Wx::Event::EVT_MENU( $self, 105, \&OnChooseLanguage );
    11851136    Wx::Event::EVT_CHOICE( $self, 106, \&OnPhotoSelMode );
    11861137    Wx::Event::EVT_TREE_SEL_CHANGED( $self, $self->tree, \&OnTreeSelChanged );
     
    12081159    Wx::Event::EVT_BUTTON( $self, $main::PHOTO_PROPERTIES_UPLOAD, \&OnUploadImages );
    12091160    Wx::Event::EVT_BUTTON( $self, $self->imageviewer->add_button->GetId, \&OnAddImages );
     1161
     1162    # only refresh when calling event is finished
     1163    Wx::Event::EVT_IDLE(
     1164        $self,
     1165        sub {
     1166            my ( $self, $event ) = @_;
     1167
     1168            if ( $self->image_preview_refresh and $self->image_preview->IsShown ){
     1169                $self->set_preview_image;
     1170                $self->image_preview->Refresh;
     1171                $self->image_preview_refresh(0);
     1172            }
     1173
     1174            if($self->imageviewer_refresh){
     1175                $self->imageviewer->Refresh;
     1176                $self->imageviewer_refresh(0);
     1177            }
     1178
     1179            if($self->imageviewer_item_refresh){
     1180                # for batch mode
     1181                map {
     1182                    $self->imageviewer->ItemRefresh(
     1183                        $_
     1184                    )
     1185                } @{$self->imageviewer->GetSelectedItems};
     1186                $self->imageviewer_item_refresh(0);
     1187            }
     1188
     1189            if(!scalar @{$self->imageviewer->GetSelectedItems} and $self->dlg_piwigo_photo_properties->{_properties_notebook}->IsEnabled){
     1190                $self->dlg_piwigo_photo_properties->{_properties_notebook}->Enable(0);
     1191            }
     1192
     1193            $self->OnUpdateToolbar;
     1194            $event->Skip;
     1195        }
     1196    );
    12101197
    12111198}
     
    19391926
    19401927
    1941         $tb->AddTool( $_->[0], $_->[1], $tb_icon1, $tb_icon2, wxITEM_NORMAL, $_->[1] );
     1928        $tb->AddTool( $_->[0], $_->[1], $tb_icon1, $tb_icon2, wxITEM_NORMAL, $_->[6] );
    19421929        $tb->EnableTool( $_->[0], $_->[4]);
    19431930    }
     
    19451932        [
    19461933            101,
    1947             gettext("Add photo"),
     1934            gettext("Add photos"),
    19481935            wxTheApp->resource_path('tb_add.png'),
    19491936            wxBITMAP_TYPE_PNG,
    19501937            1,
    19511938            wxTheApp->resource_path('tb_add.png'),
    1952             gettext("Add photo for resizing and uploading")
     1939            gettext("Add photos for resizing and uploading")
    19531940        ],
    19541941        [
     
    19591946            1,
    19601947            wxTheApp->resource_path('tb_remove.png'),
    1961             gettext("Remove photo from selection. Files are not deleted ")
     1948            gettext("Remove selected photos. Original files are not deleted ")
    19621949        ],
    1963 #        [
    1964 #            103,
    1965 #            gettext("Upload to Piwigo"),
    1966 #            wxTheApp->resource_path('tb_upload.png'),
    1967 #            wxBITMAP_TYPE_PNG,
    1968 #            wxTheApp->use_offline ? 0 : 1,
    1969 #            wxTheApp->resource_path('tb_upload.png'),
    1970 #            gettext("Upload photos to Piwigo.")
    1971 #        ],
    19721950        [
    19731951            104,
     
    19791957            gettext("Change global settings.")
    19801958        ],
    1981 #        [
    1982 #            105,
    1983 #            gettext("Language choice"),
    1984 #            wxTheApp->resource_path('tb_i18n.png'),
    1985 #            wxBITMAP_TYPE_PNG,
    1986 #            1,
    1987 #            wxTheApp->resource_path('tb_i18n.png'),
    1988 #            gettext("Language choice")
    1989 #        ],
    19901959   
    19911960    );
  • extensions/pLoader/trunk/src/Uploader/GUI/Layout/GlobalSettings.pm

    r5120 r5133  
    135135    $item1->AddWindow( $item3, 0, wxALL, 5 );
    136136
    137     my( $item4 ) = Wx::CollapsiblePane->new( $parent, $main::CPANE_THUMBNAIL, "", wxDefaultPosition, [300,-1], 0|wxCP_DEFAULT_STYLE );
     137    my( $item4 ) = Wx::CollapsiblePane->new( $parent, $main::CPANE_THUMBNAIL, "Options", wxDefaultPosition, [300,-1], 0|wxCP_DEFAULT_STYLE );
    138138    my( $oldparent ) = $parent;
    139139    $parent = $item4->GetPane();
     
    172172    $item13->AddWindow( $item14, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 );
    173173
    174     my( $item15 ) = Wx::CollapsiblePane->new( $parent, $main::CPANE_RESIZE, "", wxDefaultPosition, wxDefaultSize, 0|wxCP_DEFAULT_STYLE );
     174    my( $item15 ) = Wx::CollapsiblePane->new( $parent, $main::CPANE_RESIZE, "Options", wxDefaultPosition, wxDefaultSize, 0|wxCP_DEFAULT_STYLE );
    175175    my( $oldparent ) = $parent;
    176176    $parent = $item15->GetPane();
     
    246246    $item34->AddWindow( $item35, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 );
    247247
    248     my( $item36 ) = Wx::CollapsiblePane->new( $parent, $main::CPANE_HD, "", wxDefaultPosition, wxDefaultSize, 0|wxCP_DEFAULT_STYLE );
     248    my( $item36 ) = Wx::CollapsiblePane->new( $parent, $main::CPANE_HD, "Options", wxDefaultPosition, wxDefaultSize, 0|wxCP_DEFAULT_STYLE );
    249249    my( $oldparent ) = $parent;
    250250    $parent = $item36->GetPane();
     
    355355    $item1->Add( $item3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 );
    356356
    357     my( $item6 ) = Wx::CollapsiblePane->new( $parent, $main::CPANE_WATERMARK, "", wxDefaultPosition, wxDefaultSize, 0|wxCP_DEFAULT_STYLE );
     357    my( $item6 ) = Wx::CollapsiblePane->new( $parent, $main::CPANE_WATERMARK, "Options", wxDefaultPosition, wxDefaultSize, 0|wxCP_DEFAULT_STYLE );
    358358    my( $oldparent ) = $parent;
    359359    $parent = $item6->GetPane();
     
    433433    $item1->AddWindow( $item3, 0, wxALIGN_CENTER|wxALL, 5 );
    434434
    435     my( $item4 ) = Wx::CollapsiblePane->new( $parent, $main::CPANE_TRANSFERT_ADVANCED, "", wxDefaultPosition, wxDefaultSize, 0|wxCP_DEFAULT_STYLE );
     435    my( $item4 ) = Wx::CollapsiblePane->new( $parent, $main::CPANE_TRANSFERT_ADVANCED, "Options", wxDefaultPosition, wxDefaultSize, 0|wxCP_DEFAULT_STYLE );
    436436    my( $oldparent ) = $parent;
    437437    $parent = $item4->GetPane();
     
    465465}
    466466
     467
     468use vars qw($LANGUAGE); $LANGUAGE = 10064;
     469use vars qw($GS_LANGUAGE); $GS_LANGUAGE = 10065;
     470
     471sub GS_language {
     472    my( $parent ) = $_[0];
     473    my( $item0 ) = Wx::BoxSizer->new( wxVERTICAL );
     474   
     475    my( $item2 ) = Wx::StaticBox->new( $parent, -1, "" );
     476    my( $item1 ) = Wx::StaticBoxSizer->new( $item2, wxVERTICAL );
     477    $parent->{sb_language} = $item1;
     478   
     479    my( $item5 ) = Wx::StaticText->new( $parent, $main::LANGUAGE, "", wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE );
     480    $item1->AddWindow( $item5, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 );
     481
     482    my( $item6 ) = Wx::Choice->new( $parent, $main::GS_LANGUAGE, wxDefaultPosition, [200,-1], [], 0 );
     483    $item1->AddWindow( $item6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
     484
     485    $item0->Add( $item1, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
     486
     487    $_[0]->SetSizer( $item0 );
     488    $item0->SetSizeHints( $_[0] );
     489   
     490    $item0;
     491}
  • extensions/pLoader/trunk/src/Uploader/GUI/wxGlobalSettings.pm

    r4779 r5133  
    249249            Wx::Bitmap->new( wxTheApp->resource_path($_), wxBITMAP_TYPE_PNG )
    250250        )
    251     } qw/picture_edit.png pictures.png picture_key.png picture_go.png/;
     251    } qw/picture_edit.png pictures.png picture_key.png picture_go.png world.png/;
    252252
    253253    $tbook->AssignImageList($imgl);
     
    269269    $tbook->AddPage( $item6, gettext("Transfer"), 0, 3 );
    270270
     271    my( $item7 ) = Wx::Panel->new( $tbook, -1 );
     272    &main::GS_language( $item7, 0 );
     273    $tbook->AddPage( $item7, gettext("Language choice"), 0, 4 );
     274
    271275
    272276    $topsizer->Add( $tbook, 0, wxALIGN_CENTER|wxALL, 5 );
Note: See TracChangeset for help on using the changeset viewer.