source: extensions/pLoader/trunk/src/Uploader/GUI/wxImageReuploadDlg.pm @ 4475

Last change on this file since 4475 was 4475, checked in by ronosman, 14 years ago

Feature 1318 added : new photo properties panel with Piwigo metadata and tags.

File size: 2.8 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::wxImageReuploadDlg;
21use strict;
22use Wx qw/
23             wxDefaultSize
24             wxDefaultPosition
25             wxID_CANCEL
26             wxID_OK
27             wxGREEN
28         /;
29#use base qw/Wx::Dialog Class::Accessor::Fast Uploader::GUI::DlgCommon/;
30use base qw/Wx::Dialog Uploader::GUI::DlgCommon/;
31use Wx::Event qw/
32                    EVT_UPDATE_UI
33                    EVT_BUTTON
34                                        EVT_CLOSE
35                /;
36
37use Carp;
38
39sub new {
40    my ($this, $params) = @_;
41    #on recupere le nom de la classe en fonction du type d'appel de la méthode.
42    my $class = ref($this) || $this;
43
44
45    my $self = $class->SUPER::new( undef, -1, $params->{title}, wxDefaultPosition, wxDefaultSize);
46    # load controls
47    eval {
48      &main::Reupload($self, 1);
49
50            $self->properties(
51            $params->{properties}
52        );
53        $self->InitLabels();
54        $self->SetProperties();
55        $self->_initEventHandlers();
56
57                if($@){
58                        Wx::LogMessage("Error during dialogbox initialization");
59                }
60        };
61
62    $self;   
63}
64
65
66
67sub _initEventHandlers {
68    my ( $self ) = @_;
69   
70    EVT_BUTTON( $self, $main::ID_REUPLOAD_OK, \&OnOK );
71    EVT_CLOSE( $self, \&OnClose );
72}
73
74
75sub OnOK {
76    my ( $self, $event ) = @_;
77   
78    $self->_close;
79}
80
81sub OnClose {
82    my ( $self, $event ) = @_;
83       
84        $self->_close;
85}
86
87sub _close {
88    my ( $self ) = @_;
89
90    $self->GetProperties();
91               
92    $self->Destroy;
93}
94
951;
Note: See TracBrowser for help on using the repository browser.