Ignore:
Timestamp:
Dec 10, 2009, 3:21:06 PM (14 years ago)
Author:
ronosman
Message:

Feature 1052 added : photo re-upload management. When uploading an already added photo, the user is warned and has a choice on action for files, simple properties and multi-values properties.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/pLoader/trunk/src/Uploader/GUI/wxFrameAUI.pm

    r4422 r4467  
    148148use Uploader::GUI::wxImageProcessingProgressDlg;
    149149use Uploader::GUI::wxChoiceFilteredPanel;
     150use Uploader::GUI::wxImageReuploadDlg;
    150151use Wx::Html;
    151152use Uploader::GUI::wxImagePreview;
     
    155156use Storable;
    156157use Uploader::GUI::wxPropertyGridPanel;
     158use Uploader::GUI::wxPhotoProperties;
    157159use utf8;
    158160$|=1;
     
    206208        sub { $self->UploadImagesViewerRefresh(@_) }
    207209    );
     210       
     211        $self->imagelist->ReuploadCallback(
     212            sub {
     213                    Uploader::GUI::wxImageReuploadDlg->new(
     214            {
     215                                title      => gettext("Photo update management"),
     216                properties => {
     217                                        $main::ID_REUPLOAD_ACTION_FILES        => {
     218                                                                                                                    selection=>sub {$self->imagelist->reupload_action_files(@_)},
     219                                                                                                                                                                label=>gettext("What shall we do with files? (thumbnail, resized, high resolution)"),
     220                                                                                labels=>[
     221                                                                                                                                                                           gettext("nothing"),
     222                                                                                                                                                                           gettext("replace"),
     223                                                                                                                                                                       ],                                                                                                                                                               
     224                                                                                                            },
     225                                                                    $main::ID_REUPLOAD_ACTION_PROPERTIES   => {
     226                                                                                                                    selection=>sub{$self->imagelist->reupload_action_properties(@_)},
     227                                                                                                                                                                label=>gettext("What shall we do with single value properties?(caption, comment, author, create date)"),
     228                                                                                labels=>[
     229                                                                                                                                                                           gettext("nothing"),
     230                                                                                                                                                                           gettext("fill if empty (only replace properties currently empty in Piwigo)"),
     231                                                                                                                                                                           gettext("replace"),
     232                                                                                                                                                                       ],                                                                                                                                                               
     233                                                                                                                  },
     234                                                                        $main::ID_REUPLOAD_ACTION_PROPERTIES_M => {
     235                                                                                                                    selection=>sub{$self->imagelist->reupload_action_properties_m(@_)},
     236                                                                                                                                                                label=>gettext("What shall we do with multiple values properties? (categories, tags)"),
     237                                                                                labels=>[
     238                                                                                                                                                                           gettext("nothing"),
     239                                                                                                                                                                           gettext("append (keep existing and add new)"),
     240                                                                                                                                                                           gettext("replace"),
     241                                                                                                                                                                       ],                                                                                                                                                               
     242                                                                                                                  },
     243                                                                        $main::ID_REUPLOAD_NOT_ASK             => {
     244                                                                                                                    value=>sub{$self->imagelist->reupload_not_ask(@_)},
     245                                                                                label=>gettext("Do not ask me again"),                                                                                                                                                         
     246                                                                                                                  },
     247                                                                        $main::ID_REUPLOAD_TEXT                => {
     248                                                                                label=>gettext("A least one photo has already been added in the past."),                                                                                                                                                               
     249                                                                                                                  },
     250                                                },
     251            }
     252                        )->ShowModal();
     253                }
     254        );
    208255
    209256
     
    277324sub _set_setting_properties {
    278325    my ( $self ) = @_;
     326       
    279327
    280328    $self->piwigo_properties(
     
    607655    }
    608656    (
    609         $self->image_prop_piwigo,
     657        $self->image_prop_piwigo,
    610658        $self->image_prop_exif,
    611659        $self->image_prop_tags,
     
    663711sub _refresh_settings_panels_properties {
    664712    my ( $self ) = @_; 
    665 
     713       
    666714    $self->image_prop_piwigo->properties(
    667715        $self->piwigo_properties
     
    701749sub _init_settings_panels {
    702750    my ( $self ) = @_; 
     751
    703752
    704753    $self->image_prop_piwigo(
     
    868917        ->CenterPane->Resizable->CloseButton(0) );
    869918
     919               
    870920    $self->manager->AddPane(
    871921        $self->create_tree,
     
    10791129        [
    10801130            $self->hd_settings_panel,
    1081             gettext("HD"),
     1131            gettext("High definition"),
    10821132        ],
    10831133        [
     
    17451795    my ( $self ) = @_; 
    17461796
     1797
    17471798    $self->imageviewer->Refresh;
     1799
     1800    $self->image_preview->image(
     1801        0
     1802    ) if !$self->imageviewer->GetItemCount;
     1803
     1804
     1805    $self->image_preview->Refresh;
    17481806    Wx::Yield();
    17491807}
     
    18411899
    18421900    my $wximagelist = $self->imagelist->wx_thumb_imglist;
    1843 print Dumper "SetNewFilesViewerRefresh", $self->imagelist->current_image;
     1901    #print Dumper "SetNewFilesViewerRefresh", $self->imagelist->current_image;
    18441902    my $indx = $wximagelist->Add(
    18451903        Wx::Bitmap->new(
Note: See TracChangeset for help on using the changeset viewer.