source: extras/pLoader/trunk/src/Uploader/GUI/wxExportProgressDlg.pm @ 2728

Last change on this file since 2728 was 2728, checked in by ronosman, 16 years ago

Feature added : auto rotate image using exif metadata
Feature added : upload in high resolution
Improved user feedback in upload progress dialog

  • Property svn:eol-style set to LF
File size: 3.1 KB
Line 
1# +-----------------------------------------------------------------------+
2# | pLoader - a Perl photo uploader for Piwigo                            |
3# +-----------------------------------------------------------------------+
4# | Copyright(C) 2008      Piwigo Team                  http://piwigo.org |
5# +-----------------------------------------------------------------------+
6# | This program is free software; you can redistribute it and/or modify  |
7# | it under the terms of the GNU General Public License as published by  |
8# | the Free Software Foundation                                          |
9# |                                                                       |
10# | This program is distributed in the hope that it will be useful, but   |
11# | WITHOUT ANY WARRANTY; without even the implied warranty of            |
12# | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
13# | General Public License for more details.                              |
14# |                                                                       |
15# | You should have received a copy of the GNU General Public License     |
16# | along with this program; if not, write to the Free Software           |
17# | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
18# | USA.                                                                  |
19# +-----------------------------------------------------------------------+
20package Uploader::GUI::wxExportProgressDlg;
21use strict;
22use Carp;
23use Wx qw/
24             wxDefaultSize
25             wxDefaultPosition
26             wxID_CANCEL
27             wxID_OK
28             wxGREEN
29         /;
30use base qw/Wx::Dialog Class::Accessor::Fast/;
31use Wx::Event qw/
32                    EVT_UPDATE_UI
33                    EVT_BUTTON
34                /;
35
36__PACKAGE__->mk_accessors( 
37    qw/
38           btok
39           gauge
40           progress
41           processing
42           txtprocessing
43           cancelled
44      / 
45);
46
47
48sub new {
49    my ($this, $params) = @_;
50    #on recupere le nom de la classe en fonction du type d'appel de la méthode.
51    my $class = ref($this) || $this;
52
53
54    my $self = $class->SUPER::new( undef, -1, $params->{title}, wxDefaultPosition, wxDefaultSize);
55    # load controls
56    &main::ProcessingProgress($self, 1);
57
58    $self->_initEventHandlers();
59   
60    $self->btok( $self->FindWindow($main::ID_PROGRESS_OK) );
61    $self->gauge( $self->FindWindow($main::ID_PROGRESS_GAUGE) );
62    $self->txtprocessing( $self->FindWindow($main::ID_PROGRESS_TXT) );
63    $self->gauge->SetForegroundColour(wxGREEN);
64     
65    $self;   
66}
67
68
69sub _initEventHandlers {
70    my ( $self ) = @_;
71   
72    EVT_BUTTON( $self, $main::ID_PROGRESS_OK, \&OnExportOK );
73   
74       
75}
76
77# Update progress information
78sub LogProgress {
79    my ( $self ) = @_;
80
81printf("$self cancelled %s \n", $self->cancelled);
82    die if $self->cancelled;   
83    $self->txtprocessing->SetLabel(
84        $text || $self->processing
85    );
86    $self->gauge->SetValue(
87        $value || $self->progress
88    );
89
90}
91
92# Close the dialog. cancel export
93sub OnExportOK {
94    my ( $self, $event ) = @_;
95   
96    $self->cancelled(1);
97    $self->Destroy;
98 
99}
100
101
1021;
Note: See TracBrowser for help on using the repository browser.