Changeset 5133 for extensions/pLoader/trunk/src
- Timestamp:
- Mar 13, 2010, 9:14:59 PM (15 years ago)
- Location:
- extensions/pLoader/trunk/src/Uploader/GUI
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/pLoader/trunk/src/Uploader/GUI/Frame.pm
r5120 r5133 90 90 91 91 92 92 93 my @properties = 93 94 qw/ … … 146 147 my $ID_TREE_CTX_MENU = 20000 ; 147 148 my $ID_IMAGEVIEWER_CTX_MENU = 20100 ; 149 148 150 149 151 sub new { … … 269 271 $self->_initImgTypes; 270 272 271 # only refresh when calling event is finished272 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 mode287 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 306 273 $self->imageviewer->SelectItem( 307 274 $self->current_imageviewer_index … … 591 558 $main::GS_CHUNK_SIZE => { 592 559 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 }, 593 576 }, 594 577 } … … 917 900 } 918 901 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 }950 902 951 903 sub OnDefaultPhotoNameChanged { … … 1182 1134 Wx::Event::EVT_MENU( $self, 103, \&OnUploadImages ); 1183 1135 Wx::Event::EVT_MENU( $self, 104, \&OnGlobalSettings ); 1184 #Wx::Event::EVT_MENU( $self, 105, \&OnChooseLanguage );1185 1136 Wx::Event::EVT_CHOICE( $self, 106, \&OnPhotoSelMode ); 1186 1137 Wx::Event::EVT_TREE_SEL_CHANGED( $self, $self->tree, \&OnTreeSelChanged ); … … 1208 1159 Wx::Event::EVT_BUTTON( $self, $main::PHOTO_PROPERTIES_UPLOAD, \&OnUploadImages ); 1209 1160 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 ); 1210 1197 1211 1198 } … … 1939 1926 1940 1927 1941 $tb->AddTool( $_->[0], $_->[1], $tb_icon1, $tb_icon2, wxITEM_NORMAL, $_->[ 1] );1928 $tb->AddTool( $_->[0], $_->[1], $tb_icon1, $tb_icon2, wxITEM_NORMAL, $_->[6] ); 1942 1929 $tb->EnableTool( $_->[0], $_->[4]); 1943 1930 } … … 1945 1932 [ 1946 1933 101, 1947 gettext("Add photo "),1934 gettext("Add photos"), 1948 1935 wxTheApp->resource_path('tb_add.png'), 1949 1936 wxBITMAP_TYPE_PNG, 1950 1937 1, 1951 1938 wxTheApp->resource_path('tb_add.png'), 1952 gettext("Add photo for resizing and uploading")1939 gettext("Add photos for resizing and uploading") 1953 1940 ], 1954 1941 [ … … 1959 1946 1, 1960 1947 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 ") 1962 1949 ], 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 # ],1972 1950 [ 1973 1951 104, … … 1979 1957 gettext("Change global settings.") 1980 1958 ], 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 # ],1990 1959 1991 1960 ); -
extensions/pLoader/trunk/src/Uploader/GUI/Layout/GlobalSettings.pm
r5120 r5133 135 135 $item1->AddWindow( $item3, 0, wxALL, 5 ); 136 136 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 ); 138 138 my( $oldparent ) = $parent; 139 139 $parent = $item4->GetPane(); … … 172 172 $item13->AddWindow( $item14, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); 173 173 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 ); 175 175 my( $oldparent ) = $parent; 176 176 $parent = $item15->GetPane(); … … 246 246 $item34->AddWindow( $item35, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); 247 247 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 ); 249 249 my( $oldparent ) = $parent; 250 250 $parent = $item36->GetPane(); … … 355 355 $item1->Add( $item3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); 356 356 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 ); 358 358 my( $oldparent ) = $parent; 359 359 $parent = $item6->GetPane(); … … 433 433 $item1->AddWindow( $item3, 0, wxALIGN_CENTER|wxALL, 5 ); 434 434 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 ); 436 436 my( $oldparent ) = $parent; 437 437 $parent = $item4->GetPane(); … … 465 465 } 466 466 467 468 use vars qw($LANGUAGE); $LANGUAGE = 10064; 469 use vars qw($GS_LANGUAGE); $GS_LANGUAGE = 10065; 470 471 sub 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 249 249 Wx::Bitmap->new( wxTheApp->resource_path($_), wxBITMAP_TYPE_PNG ) 250 250 ) 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/; 252 252 253 253 $tbook->AssignImageList($imgl); … … 269 269 $tbook->AddPage( $item6, gettext("Transfer"), 0, 3 ); 270 270 271 my( $item7 ) = Wx::Panel->new( $tbook, -1 ); 272 &main::GS_language( $item7, 0 ); 273 $tbook->AddPage( $item7, gettext("Language choice"), 0, 4 ); 274 271 275 272 276 $topsizer->Add( $tbook, 0, wxALIGN_CENTER|wxALL, 5 );
Note: See TracChangeset
for help on using the changeset viewer.