[2597] | 1 | # +-----------------------------------------------------------------------+ |
---|
| 2 | # | pLoader - a Perl photo uploader for Piwigo | |
---|
| 3 | # +-----------------------------------------------------------------------+ |
---|
[4779] | 4 | # | Copyright(C) 2008-2010 Piwigo Team http://piwigo.org | |
---|
[2597] | 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 | |
---|
[3180] | 13 | # | General Public License for more details. | |
---|
[2597] | 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 | # +-----------------------------------------------------------------------+ |
---|
| 20 | |
---|
| 21 | use strict; |
---|
[4974] | 22 | use File::Spec; |
---|
[3180] | 23 | use Wx; |
---|
[4974] | 24 | |
---|
[2597] | 25 | use Class::Accessor::Fast; |
---|
| 26 | use Uploader::GUI::wxApp; |
---|
[4718] | 27 | use Uploader::GUI::Frame; |
---|
[4974] | 28 | use Uploader::GUI::Layout::GlobalSettings; |
---|
| 29 | use Uploader::GUI::Layout::Progress; |
---|
| 30 | use Uploader::GUI::Layout::Login; |
---|
| 31 | use Uploader::GUI::Layout::Reupload; |
---|
| 32 | use Uploader::GUI::Layout::PhotoProperties; |
---|
| 33 | use Uploader::GUI::Layout::PhotoPropertiesCategoriesTags; |
---|
| 34 | use Uploader::GUI::Layout::PhotoPropertiesExif; |
---|
[5390] | 35 | use Uploader::GUI::Layout::DestinationCategory; |
---|
[2597] | 36 | use JSON; |
---|
[3180] | 37 | use Wx::Locale qw/:default/; |
---|
[4322] | 38 | use Data::Dumper; |
---|
[4974] | 39 | use File::HomeDir; |
---|
[2597] | 40 | |
---|
[5390] | 41 | $SIG{__DIE__} = \&OnDieHandler; |
---|
[2597] | 42 | |
---|
[4095] | 43 | eval { |
---|
[4632] | 44 | my $app = Uploader::GUI::wxApp->new( |
---|
| 45 | { |
---|
[4973] | 46 | root_dir => $ENV{PLOADER_ROOT}||'..', |
---|
[4632] | 47 | resource_dir => 'res', |
---|
| 48 | locale_dir => 'locale', |
---|
[4973] | 49 | argv => [ grep { -f $_ } @ARGV ], |
---|
[4632] | 50 | } |
---|
| 51 | ); |
---|
[4718] | 52 | $app->SetFrame( |
---|
| 53 | Uploader::GUI::Frame->new( |
---|
| 54 | { |
---|
| 55 | title => sprintf("pLoader - Piwigo uploader %s - [%s]", $app->version, $app->site_url), |
---|
| 56 | pwg => $app->pwg, |
---|
| 57 | imagelist => $app->imagelist, |
---|
| 58 | imageviewer_index => $app->imageviewerIndex, |
---|
| 59 | frameLayout => $app->frameLayout, |
---|
| 60 | } |
---|
| 61 | ) |
---|
| 62 | ); |
---|
[4095] | 63 | $app->MainLoop(); |
---|
| 64 | }; |
---|
[4279] | 65 | |
---|
| 66 | sub OnDieHandler { |
---|
| 67 | my ( $exception ) = @_; |
---|
| 68 | |
---|
| 69 | # if triggered in eval |
---|
| 70 | # return if $^S; |
---|
| 71 | print $exception; |
---|
| 72 | } |
---|
[2597] | 73 | 1; |
---|
| 74 | |
---|
| 75 | |
---|