commit db5783a657c0ad30fd19cfe1d17fbfd471807146
Author: Eric Seigne <eric.seigne@ryxeo.com>
Date:   Wed Jun 6 00:14:49 2012 +0200

    connexion FTP a minima

diff --git a/original.cpp b/original.cpp
index 3ac3b11..0737b3f 100644
--- a/original.cpp
+++ b/original.cpp
@@ -52,10 +52,14 @@ original::original(QWidget *parent) :
 {
     ui->setupUi(this);
 
-    ui->stackedWidget->setCurrentWidget(ui->page);
-
     m_currentProjectPictureNumber = 0;
 
+    //Hop pour que le splitter soit a peu pres a la bonne taille dès le début
+    QList<int> sizes;
+    sizes.append(200);
+    sizes.append(500);
+    ui->splitter->setSizes(sizes);
+
     m_baseDir = QDir(QDir::homePath() + "/RyXeo-WebPhotoAlbum");
     m_baseDir.setFilter(QDir::Dirs | QDir::NoSymLinks | QDir::NoDotAndDotDot);
     QFileInfoList list = m_baseDir  .entryInfoList();
@@ -65,6 +69,14 @@ original::original(QWidget *parent) :
         item->setData(1,0,list.at(i).absoluteFilePath());
     }
 
+    //============== l'étiquette invitant a déposer des images
+    m_labelDeposez = new QLabel(trUtf8("Glissez-déposez ici les photos que vous voulez ajouter à cet album ..."),ui->lwPictures);
+    m_labelDeposez->setStyleSheet("color: #aaa;\nfont-size: 24pt;\nfont-weight: bold;\n");
+    m_labelDeposez->setScaledContents(true);
+    m_labelDeposez->setWordWrap(true);
+    m_labelDeposez->setAlignment(Qt::AlignCenter | Qt::AlignHCenter);
+    m_labelDeposez->hide();
+
     //============== le menu contextuel du treewidget (gauche)
     m_menu = new QMenu(ui->treeWidget);
     QList<QAction*> actions;
@@ -94,135 +106,135 @@ original::~original()
     delete ui;
 }
 
-void original::on_btnExport_clicked()
-{
-    //Creation de la destination
-    QDir rep;
-    QString dest = ui->leDest->text().trimmed() + "/web-gallery";
-    rep.mkpath(dest);
-    rep.mkpath(dest + "/hq");
-    rep.mkpath(dest + "/lq");
-    rep.mkpath(dest + "/mq");
-    rep.mkpath(dest + "/thumbs");
-    rep.mkpath(dest + "/zip");
-    rep.mkpath(dest + "/comments");
-
-    //Creation des images
-    QDir dir(ui->leSource->text().trimmed());
-    dir.setFilter(QDir::Files | QDir::NoSymLinks | QDir::NoDotAndDotDot);
-    QFileInfoList list = dir.entryInfoList();
-    for(int i = 0; i < list.count(); i++) {
-        ui->statusBar->clearMessage();
-        ui->statusBar->showMessage(trUtf8("Fichier en cours: %1").arg(list.at(i).fileName()),3000);
-        qApp->processEvents();
-
-        qDebug() << "Processing : " << list.at(i).absoluteFilePath();
-        QPixmap pixmap(list.at(i).absoluteFilePath());
-        pixmap.save(QString("%1/hq/img-%2.jpg").arg(dest).arg(i));
-
-        ui->statusBar->showMessage(trUtf8("Fichier en cours: %1 [hq]").arg(list.at(i).fileName()),3000);
-        QPixmap pixmapThumbs(pixmap.scaled(QSize(120,120), Qt::KeepAspectRatio, Qt::SmoothTransformation));
-        pixmapThumbs.save(QString("%1/thumbs/img-%2.jpg").arg(dest).arg(i));
-
-        ui->statusBar->showMessage(trUtf8("Fichier en cours: %1 [hq] [mq]").arg(list.at(i).fileName()),3000);
-        QPixmap pixmapMQ(pixmap.scaled(QSize(800,600), Qt::KeepAspectRatio, Qt::SmoothTransformation));
-        pixmapMQ.save(QString("%1/mq/img-%2.jpg").arg(dest).arg(i));
-
-        ui->statusBar->showMessage(trUtf8("Fichier en cours: %1 [hq] [mq] [lq]").arg(list.at(i).fileName()),3000);
-        QPixmap pixmapLQ(pixmap.scaled(QSize(640,480), Qt::KeepAspectRatio, Qt::SmoothTransformation));
-        pixmapLQ.save(QString("%1/lq/img-%2.jpg").arg(dest).arg(i));
-
-
-        QFile file(QString("%1/comments/%2.txt").arg(dest).arg(i));
-        if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
-            return;
-
-        QTextStream out(&file);
-        out << "<span>Photo " + QString::number(i) + "</span>\n";
-        file.close();
-        ui->statusBar->showMessage(trUtf8("Fichier en cours: %1 [hq] [mq] [lq] [meta]").arg(list.at(i).fileName()),3000);
-
-        //================== on copie les metadata
-        Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(list.at(i).absoluteFilePath().toStdString());
-        Exiv2::Image::AutoPtr imageLQ = Exiv2::ImageFactory::open(QString("%1/lq/img-%2.jpg").arg(dest).arg(i).toStdString());
-        Exiv2::Image::AutoPtr imageMQ = Exiv2::ImageFactory::open(QString("%1/mq/img-%2.jpg").arg(dest).arg(i).toStdString());
-        Exiv2::Image::AutoPtr imageHQ = Exiv2::ImageFactory::open(QString("%1/hq/img-%2.jpg").arg(dest).arg(i).toStdString());
-        Exiv2::Image::AutoPtr imageThumb = Exiv2::ImageFactory::open(QString("%1/thumbs/img-%2.jpg").arg(dest).arg(i).toStdString());
-        if (image.get() != 0)
-        {
-            image->readMetadata();
-            Exiv2::ExifData &exifData = image->exifData();
-            if (!exifData.empty())
-            {
-                bool setArtist = false;
-                bool setCopyright = false;
-                bool setSoftware = false;
-                Exiv2::ExifData::const_iterator end = exifData.end();
-                qDebug() << "============================ DEBUT ===============================";
-                for (Exiv2::ExifData::const_iterator i = exifData.begin(); i != end; ++i)
-                {
-                    qDebug() << i->key().c_str() << " = " << i->value().toString().c_str();
-                    if (i->key() == "Exif.Image.Artist") {
-                        exifData["Exif.Image.Artist"]    = ui->leAuthor->text().trimmed().toStdString();
-                        setArtist = true;
-                    }
-                    if (i->key() == "Exif.Image.Copyright") {
-                        exifData["Exif.Image.Copyright"]    = ui->leAuthor->text().trimmed().toStdString();
-                        setCopyright = true;
-                    }
-                    if (i->key() == "Exif.Image.Software") {
-                        exifData["Exif.Image.Software"]  = "RyXeo WebPhotoAlbum - http://www.ryxeo.com/";
-                        setSoftware = true;
-                    }
-                }
-                //Si on n'a pas les meta il faut les ajouter
-
-                //Mise à jour de l'auteur
-                if(!setArtist) {
-                    Exiv2::ExifKey k("Exif.Image.Artist");
-                    Exiv2::Value::AutoPtr v = Exiv2::Value::create(Exiv2::asciiString);
-                    v->read(ui->leAuthor->text().trimmed().toStdString());
-                    exifData.add(k,v.get());
-                }
-
-                if(!setCopyright) {
-                    Exiv2::ExifKey k2("Exif.Image.Copyright");
-                    Exiv2::Value::AutoPtr v2 = Exiv2::Value::create(Exiv2::asciiString);
-                    v2->read(ui->leAuthor->text().trimmed().toStdString());
-                    exifData.add(k2,v2.get());
-                }
-
-                if(!setSoftware) {
-                    Exiv2::ExifKey k3("Exif.Image.Software");
-                    Exiv2::Value::AutoPtr v3 = Exiv2::Value::create(Exiv2::asciiString);
-                    v3->read("RyXéo WebPhotoAlbum - http://www.ryxeo.com/");
-                    exifData.add(k3,v3.get());
-                }
-
-                qDebug() << "============================ APRES ===============================";
-                Exiv2::ExifData::const_iterator end2 = exifData.end();
-                for (Exiv2::ExifData::const_iterator i2 = exifData.begin(); i2 != end2; ++i2)
-                {
-                    qDebug() << i2->key().c_str() << " = " << i2->value().toString().c_str();
-                }
-                qDebug() << "============================ FIN ===============================";
-
-                imageLQ->setExifData(exifData);
-                imageLQ->writeMetadata();
-
-                imageMQ->setExifData(exifData);
-                imageMQ->writeMetadata();
-
-                imageHQ->setExifData(exifData);
-                imageHQ->writeMetadata();
-
-                imageThumb->setExifData(exifData);
-                imageThumb->writeMetadata();
-            }
-        }
-        ui->statusBar->showMessage(trUtf8("Fichier en cours: %1 [hq] [mq] [lq] [meta] ... terminé").arg(list.at(i).fileName()),3000);
-    }
-}
+//void original::on_btnExport_clicked()
+//{
+//    //Creation de la destination
+//    QDir rep;
+//    QString dest = ui->leDest->text().trimmed() + "/web-gallery";
+//    rep.mkpath(dest);
+//    rep.mkpath(dest + "/hq");
+//    rep.mkpath(dest + "/lq");
+//    rep.mkpath(dest + "/mq");
+//    rep.mkpath(dest + "/thumbs");
+//    rep.mkpath(dest + "/zip");
+//    rep.mkpath(dest + "/comments");
+
+//    //Creation des images
+//    QDir dir(ui->leSource->text().trimmed());
+//    dir.setFilter(QDir::Files | QDir::NoSymLinks | QDir::NoDotAndDotDot);
+//    QFileInfoList list = dir.entryInfoList();
+//    for(int i = 0; i < list.count(); i++) {
+//        ui->statusBar->clearMessage();
+//        ui->statusBar->showMessage(trUtf8("Fichier en cours: %1").arg(list.at(i).fileName()),3000);
+//        qApp->processEvents();
+
+//        qDebug() << "Processing : " << list.at(i).absoluteFilePath();
+//        QPixmap pixmap(list.at(i).absoluteFilePath());
+//        pixmap.save(QString("%1/hq/img-%2.jpg").arg(dest).arg(i));
+
+//        ui->statusBar->showMessage(trUtf8("Fichier en cours: %1 [hq]").arg(list.at(i).fileName()),3000);
+//        QPixmap pixmapThumbs(pixmap.scaled(QSize(120,120), Qt::KeepAspectRatio, Qt::SmoothTransformation));
+//        pixmapThumbs.save(QString("%1/thumbs/img-%2.jpg").arg(dest).arg(i));
+
+//        ui->statusBar->showMessage(trUtf8("Fichier en cours: %1 [hq] [mq]").arg(list.at(i).fileName()),3000);
+//        QPixmap pixmapMQ(pixmap.scaled(QSize(800,600), Qt::KeepAspectRatio, Qt::SmoothTransformation));
+//        pixmapMQ.save(QString("%1/mq/img-%2.jpg").arg(dest).arg(i));
+
+//        ui->statusBar->showMessage(trUtf8("Fichier en cours: %1 [hq] [mq] [lq]").arg(list.at(i).fileName()),3000);
+//        QPixmap pixmapLQ(pixmap.scaled(QSize(640,480), Qt::KeepAspectRatio, Qt::SmoothTransformation));
+//        pixmapLQ.save(QString("%1/lq/img-%2.jpg").arg(dest).arg(i));
+
+
+//        QFile file(QString("%1/comments/%2.txt").arg(dest).arg(i));
+//        if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
+//            return;
+
+//        QTextStream out(&file);
+//        out << "<span>Photo " + QString::number(i) + "</span>\n";
+//        file.close();
+//        ui->statusBar->showMessage(trUtf8("Fichier en cours: %1 [hq] [mq] [lq] [meta]").arg(list.at(i).fileName()),3000);
+
+//        //================== on copie les metadata
+//        Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(list.at(i).absoluteFilePath().toStdString());
+//        Exiv2::Image::AutoPtr imageLQ = Exiv2::ImageFactory::open(QString("%1/lq/img-%2.jpg").arg(dest).arg(i).toStdString());
+//        Exiv2::Image::AutoPtr imageMQ = Exiv2::ImageFactory::open(QString("%1/mq/img-%2.jpg").arg(dest).arg(i).toStdString());
+//        Exiv2::Image::AutoPtr imageHQ = Exiv2::ImageFactory::open(QString("%1/hq/img-%2.jpg").arg(dest).arg(i).toStdString());
+//        Exiv2::Image::AutoPtr imageThumb = Exiv2::ImageFactory::open(QString("%1/thumbs/img-%2.jpg").arg(dest).arg(i).toStdString());
+//        if (image.get() != 0)
+//        {
+//            image->readMetadata();
+//            Exiv2::ExifData &exifData = image->exifData();
+//            if (!exifData.empty())
+//            {
+//                bool setArtist = false;
+//                bool setCopyright = false;
+//                bool setSoftware = false;
+//                Exiv2::ExifData::const_iterator end = exifData.end();
+//                qDebug() << "============================ DEBUT ===============================";
+//                for (Exiv2::ExifData::const_iterator i = exifData.begin(); i != end; ++i)
+//                {
+//                    qDebug() << i->key().c_str() << " = " << i->value().toString().c_str();
+//                    if (i->key() == "Exif.Image.Artist") {
+//                        exifData["Exif.Image.Artist"]    = ui->leAuthor->text().trimmed().toStdString();
+//                        setArtist = true;
+//                    }
+//                    if (i->key() == "Exif.Image.Copyright") {
+//                        exifData["Exif.Image.Copyright"]    = ui->leAuthor->text().trimmed().toStdString();
+//                        setCopyright = true;
+//                    }
+//                    if (i->key() == "Exif.Image.Software") {
+//                        exifData["Exif.Image.Software"]  = "RyXeo WebPhotoAlbum - http://www.ryxeo.com/";
+//                        setSoftware = true;
+//                    }
+//                }
+//                //Si on n'a pas les meta il faut les ajouter
+
+//                //Mise à jour de l'auteur
+//                if(!setArtist) {
+//                    Exiv2::ExifKey k("Exif.Image.Artist");
+//                    Exiv2::Value::AutoPtr v = Exiv2::Value::create(Exiv2::asciiString);
+//                    v->read(ui->leAuthor->text().trimmed().toStdString());
+//                    exifData.add(k,v.get());
+//                }
+
+//                if(!setCopyright) {
+//                    Exiv2::ExifKey k2("Exif.Image.Copyright");
+//                    Exiv2::Value::AutoPtr v2 = Exiv2::Value::create(Exiv2::asciiString);
+//                    v2->read(ui->leAuthor->text().trimmed().toStdString());
+//                    exifData.add(k2,v2.get());
+//                }
+
+//                if(!setSoftware) {
+//                    Exiv2::ExifKey k3("Exif.Image.Software");
+//                    Exiv2::Value::AutoPtr v3 = Exiv2::Value::create(Exiv2::asciiString);
+//                    v3->read("RyXéo WebPhotoAlbum - http://www.ryxeo.com/");
+//                    exifData.add(k3,v3.get());
+//                }
+
+//                qDebug() << "============================ APRES ===============================";
+//                Exiv2::ExifData::const_iterator end2 = exifData.end();
+//                for (Exiv2::ExifData::const_iterator i2 = exifData.begin(); i2 != end2; ++i2)
+//                {
+//                    qDebug() << i2->key().c_str() << " = " << i2->value().toString().c_str();
+//                }
+//                qDebug() << "============================ FIN ===============================";
+
+//                imageLQ->setExifData(exifData);
+//                imageLQ->writeMetadata();
+
+//                imageMQ->setExifData(exifData);
+//                imageMQ->writeMetadata();
+
+//                imageHQ->setExifData(exifData);
+//                imageHQ->writeMetadata();
+
+//                imageThumb->setExifData(exifData);
+//                imageThumb->writeMetadata();
+//            }
+//        }
+//        ui->statusBar->showMessage(trUtf8("Fichier en cours: %1 [hq] [mq] [lq] [meta] ... terminé").arg(list.at(i).fileName()),3000);
+//    }
+//}
 
 void original::on_action_Nouvel_album_triggered()
 {
@@ -251,6 +263,51 @@ void original::on_action_Nouvel_album_triggered()
 
 void original::on_treeWidget_itemClicked(QTreeWidgetItem *item, int column)
 {
+    QFileInfo fi(ui->treeWidget->currentItem()->data(1,0).toString()+"/info.txt");
+    qDebug() << "Lecture de " << fi.absoluteFilePath();
+
+    //Remise a zero
+    ui->leTitre->clear();
+    ui->leAuthor->clear();
+    ui->leDesc->clear();
+    ui->dateEdit->clear();
+    ui->leLogin->clear();
+    ui->lePasswd->clear();
+
+    if(fi.exists()) {
+        QFile file(fi.absoluteFilePath());
+        if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
+            return;
+
+        /* Exemple de fichier
+                name|Sortie Plongée SAGC. (Cala Montjoi, Spain) 28.05.2012
+                author|Éric Seigne
+                description|Sortie Plongée SAGC. (Cala Montjoi, Spain)
+                date|28.05.2012
+                restricted_user|sagc
+                restricted_password|motdepasse
+                  */
+        while (!file.atEnd()) {
+            QByteArray line = file.readLine();
+            QStringList tab = QString::fromUtf8(line.constData()).split('|');
+            if(tab.at(0) == "name")
+                ui->leTitre->setText(tab.at(1));
+            if(tab.at(0) == "author")
+                ui->leAuthor->setText(tab.at(1));
+            if(tab.at(0) == "description")
+                ui->leDesc->setText(tab.at(1));
+            if(tab.at(0) == "date")
+                ui->dateEdit->setDate(QDate::fromString(tab.at(1)));
+            if(tab.at(0) == "restricted_user")
+                ui->leLogin->setText(tab.at(1));
+            if(tab.at(0) == "restricted_password")
+                ui->lePasswd->setText(tab.at(1));
+
+        }
+
+    }
+
+
     ui->lwPictures->clear();
     m_currentProjectDir = item->data(1,0).toString();
     m_currentProjectPictureNumber=0;
@@ -268,52 +325,21 @@ void original::on_treeWidget_itemClicked(QTreeWidgetItem *item, int column)
         ui->lwPictures->insertItem(i,newitem);
         m_currentProjectPictureNumber = i;
     }
-    m_currentProjectPictureNumber++;
-    qDebug() << "On continue la numerotation a " << m_currentProjectPictureNumber;
-    qDebug() << "Espace de stockage du projet " << m_currentProjectDir;
-}
 
-void original::on_commandLinkButton_clicked()
-{
-    if(ui->stackedWidget->currentWidget() == ui->page_2)
-        ui->stackedWidget->setCurrentWidget(ui->page);
+    if(m_currentProjectPictureNumber == 0) {
+        qDebug() << "Pas d'image ... message";
+        m_labelDeposez->resize(ui->lwPictures->size());
+        m_labelDeposez->move(ui->lwPictures->pos());
+        m_labelDeposez->show();
+        qDebug() << m_labelDeposez->pos();
+        qDebug() << m_labelDeposez->size();
+    }
     else {
-        QFileInfo fi(ui->treeWidget->currentItem()->data(1,0).toString()+"/info.txt");
-        qDebug() << "Lecture de " << fi.absoluteFilePath();
-        if(fi.exists()) {
-            QFile file(fi.absoluteFilePath());
-            if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
-                return;
-
-            /* Exemple de fichier
-            name|Sortie Plongée SAGC. (Cala Montjoi, Spain) 28.05.2012
-            author|Éric Seigne
-            description|Sortie Plongée SAGC. (Cala Montjoi, Spain)
-            date|28.05.2012
-            restricted_user|sagc
-            restricted_password|motdepasse
-              */
-            while (!file.atEnd()) {
-                QByteArray line = file.readLine();
-                QStringList tab = QString::fromUtf8(line.constData()).split('|');
-                if(tab.at(0) == "name")
-                    ui->leTitre->setText(tab.at(1));
-                if(tab.at(0) == "author")
-                    ui->leAuthor->setText(tab.at(1));
-                if(tab.at(0) == "description")
-                    ui->leDesc->setText(tab.at(1));
-                if(tab.at(0) == "date")
-                    ui->dateEdit->setDate(QDate::fromString(tab.at(1)));
-                if(tab.at(0) == "restricted_user")
-                    ui->leLogin->setText(tab.at(1));
-                if(tab.at(0) == "restricted_password")
-                    ui->lePasswd->setText(tab.at(1));
-
-            }
-
-        }
-        ui->stackedWidget->setCurrentWidget(ui->page_2);
+        m_labelDeposez->hide();
     }
+    m_currentProjectPictureNumber++;
+    qDebug() << "On continue la numerotation a " << m_currentProjectPictureNumber;
+    qDebug() << "Espace de stockage du projet " << m_currentProjectDir;
 }
 
 void original::on_btnSave_clicked()
@@ -493,3 +519,58 @@ void original::addPictureToProject(QString fic)
     m_currentProjectPictureNumber++;
     ui->statusBar->showMessage(trUtf8("Fichier en cours: %1 [hq] [mq] [lq] [meta] ... terminé").arg(fic),3000);
 }
+
+void original::on_btnFTPPublish_clicked()
+{
+    m_ftp = new QFtp(this);
+    connect(m_ftp, SIGNAL(commandFinished(int,bool)),
+            this, SLOT(ftpCommandFinished(int,bool)));
+    connect(m_ftp, SIGNAL(listInfo(QUrlInfo)),
+            this, SLOT(addToList(QUrlInfo)));
+    connect(m_ftp, SIGNAL(dataTransferProgress(qint64,qint64)),
+            this, SLOT(updateDataTransferProgress(qint64,qint64)));
+
+    qDebug() << "aaaaaaaaaaaaaa";
+    m_ftp->connectToHost(ui->leFTPServeur->text(), 21);
+    m_ftp->setTransferMode(QFtp::Passive);
+
+    qDebug() << "bbbbbbbbbbbbb";
+
+    m_ftp->login(ui->leFTPLogin->text(), ui->leFTPPass->text());
+
+    qDebug() << "Listing FTP: ";
+    //ftp->cd(url.path());
+    m_ftp->mkdir(ui->leFTPDirectory->text());
+    m_ftp->mkdir(ui->leFTPDirectory->text() + "/galleries");
+
+}
+
+void original::ftpCommandFinished(int commandId, bool error)
+{
+#ifndef QT_NO_CURSOR
+    setCursor(Qt::ArrowCursor);
+#endif
+
+    if (m_ftp->currentCommand() == QFtp::ConnectToHost) {
+        qDebug() << "Logged onto " << ui->leFTPServeur->text() << " error : " << error;
+    }
+
+    if (m_ftp->currentCommand() == QFtp::Login) {
+        qDebug() << "Login ...";
+        m_ftp->list();
+    }
+
+    if (m_ftp->currentCommand() == QFtp::Get) {
+        qDebug() << "Get ...";
+        if (error) {
+        } else {
+        }
+    } else if (m_ftp->currentCommand() == QFtp::List) {
+        qDebug() << "List ...";
+    }
+}
+
+void original::addToList(const QUrlInfo &urlInfo)
+{
+    qDebug() << urlInfo.name();
+}
diff --git a/original.h b/original.h
index 4cd86ad..3dc6442 100644
--- a/original.h
+++ b/original.h
@@ -35,7 +35,9 @@
 #include <QInputDialog>
 #include <QDragEnterEvent>
 #include <QUrl>
-
+#include <QLabel>
+#include <QFtp>
+#include <QMessageBox>
 
 namespace Ui {
 class original;
@@ -50,23 +52,35 @@ public:
     ~original();
     
 private slots:
-    void on_btnExport_clicked();
     void on_action_Nouvel_album_triggered();
-    void on_treeWidget_itemClicked(QTreeWidgetItem *item, int column);
-    void on_commandLinkButton_clicked();
     void on_btnSave_clicked();
+    void on_treeWidget_itemClicked(QTreeWidgetItem *item, int column);
     void on_treeWidget_customContextMenuRequested(const QPoint &pos);
     //Gestion du drop d'image venant de l'extérieur
     void dragEnterEvent(QDragEnterEvent *event);
     void dropEvent(QDropEvent *event);
     void addPictureToProject(QString fic);
+    void on_btnFTPPublish_clicked();
+
+//    void connectOrDisconnect();
+//    void uploadFile();
+//    void cancelUpload();
+
+    void ftpCommandFinished(int commandId, bool error);
+    void addToList(const QUrlInfo &urlInfo);
+//    void processItem(QTreeWidgetItem *item, int column);
+//    void updateDataTransferProgress(qint64 readBytes,
+//                                    qint64 totalBytes);
 
 private:
     Ui::original *ui;
     QDir m_baseDir;
     QMenu *m_menu;
+    QLabel *m_labelDeposez;
     QString m_currentProjectDir;
     int m_currentProjectPictureNumber;
+    QFtp *m_ftp;
+
 };
 
 #endif // ORIGINAL_H
diff --git a/original.pro b/original.pro
index 7894ab0..de3c56a 100644
--- a/original.pro
+++ b/original.pro
@@ -4,7 +4,7 @@
 #
 #-------------------------------------------------
 
-QT       += core gui
+QT       += core gui network
 
 TARGET = original
 TEMPLATE = app
diff --git a/original.ui b/original.ui
index c3faf4f..a3b436f 100644
--- a/original.ui
+++ b/original.ui
@@ -21,204 +21,258 @@
     <bool>true</bool>
    </property>
    <layout class="QGridLayout" name="gridLayout">
-    <item row="0" column="1">
-     <widget class="QFrame" name="frmPrincipale">
-      <property name="sizePolicy">
-       <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
-        <horstretch>0</horstretch>
-        <verstretch>0</verstretch>
-       </sizepolicy>
-      </property>
-      <property name="frameShape">
-       <enum>QFrame::StyledPanel</enum>
-      </property>
-      <property name="frameShadow">
-       <enum>QFrame::Raised</enum>
-      </property>
-      <layout class="QGridLayout" name="gridLayout_3">
-       <item row="0" column="0">
-        <widget class="QLineEdit" name="leSource">
-         <property name="text">
-          <string>/tmp/t</string>
-         </property>
-        </widget>
-       </item>
-       <item row="0" column="1">
-        <widget class="QLineEdit" name="leDest">
-         <property name="text">
-          <string>/tmp/w</string>
-         </property>
-        </widget>
-       </item>
-       <item row="0" column="2">
-        <widget class="QPushButton" name="btnExport">
-         <property name="text">
-          <string>PushButton</string>
-         </property>
-        </widget>
-       </item>
-       <item row="0" column="3">
-        <widget class="QCommandLinkButton" name="commandLinkButton">
-         <property name="text">
-          <string>Propriétés</string>
-         </property>
-        </widget>
-       </item>
-       <item row="1" column="0" colspan="4">
-        <widget class="QStackedWidget" name="stackedWidget">
-         <property name="currentIndex">
-          <number>0</number>
-         </property>
-         <widget class="QWidget" name="page">
-          <layout class="QGridLayout" name="gridLayout_4">
-           <item row="0" column="0">
-            <widget class="QListWidget" name="lwPictures">
-             <property name="acceptDrops">
-              <bool>true</bool>
-             </property>
-             <property name="iconSize">
-              <size>
-               <width>120</width>
-               <height>120</height>
-              </size>
-             </property>
-             <property name="gridSize">
-              <size>
-               <width>128</width>
-               <height>128</height>
-              </size>
-             </property>
-             <property name="viewMode">
-              <enum>QListView::IconMode</enum>
-             </property>
-            </widget>
-           </item>
-          </layout>
-         </widget>
-         <widget class="QWidget" name="page_2">
-          <layout class="QGridLayout" name="gridLayout_2">
-           <item row="0" column="0">
-            <widget class="QLabel" name="label_5">
-             <property name="text">
-              <string>Titre</string>
-             </property>
-            </widget>
-           </item>
-           <item row="0" column="1">
-            <widget class="QLineEdit" name="leTitre"/>
-           </item>
-           <item row="1" column="0">
-            <widget class="QLabel" name="label_3">
-             <property name="text">
-              <string>Description</string>
-             </property>
-            </widget>
-           </item>
-           <item row="1" column="1">
-            <widget class="QLineEdit" name="leDesc"/>
-           </item>
-           <item row="2" column="0">
-            <widget class="QLabel" name="label_6">
-             <property name="text">
-              <string>Auteur</string>
-             </property>
-            </widget>
-           </item>
-           <item row="2" column="1">
-            <widget class="QLineEdit" name="leAuthor"/>
-           </item>
-           <item row="2" column="2">
-            <widget class="QLabel" name="label">
-             <property name="text">
-              <string>Date</string>
-             </property>
-            </widget>
-           </item>
-           <item row="2" column="3">
-            <widget class="QDateEdit" name="dateEdit">
-             <property name="calendarPopup">
-              <bool>true</bool>
-             </property>
-            </widget>
-           </item>
-           <item row="3" column="0" colspan="4">
-            <widget class="QGroupBox" name="groupBox">
-             <property name="title">
-              <string>Album photo protégé par mot de passe </string>
-             </property>
-             <layout class="QFormLayout" name="formLayout">
-              <item row="1" column="0">
-               <widget class="QLabel" name="label_4">
-                <property name="text">
-                 <string>Identifiant</string>
-                </property>
-               </widget>
-              </item>
-              <item row="1" column="1">
-               <widget class="QLineEdit" name="leLogin"/>
-              </item>
-              <item row="2" column="0">
-               <widget class="QLabel" name="label_2">
-                <property name="text">
-                 <string>Mot de passe</string>
-                </property>
-               </widget>
-              </item>
-              <item row="2" column="1">
-               <widget class="QLineEdit" name="lePasswd"/>
-              </item>
-              <item row="0" column="0" colspan="2">
-               <widget class="QLabel" name="label_7">
-                <property name="text">
-                 <string>Complétez les deux champs ci-dessous si vous voulez protéger l'accès (lorsqu'il sera publié sur internet) à cet album photo par un identifiant et un mot de passe.</string>
-                </property>
-                <property name="wordWrap">
-                 <bool>true</bool>
-                </property>
-               </widget>
-              </item>
-             </layout>
-            </widget>
-           </item>
-          </layout>
-         </widget>
-        </widget>
-       </item>
-       <item row="2" column="3">
-        <widget class="QPushButton" name="btnSave">
-         <property name="text">
-          <string>&amp;Sauvegarder</string>
-         </property>
-        </widget>
-       </item>
-      </layout>
-     </widget>
-    </item>
+    <property name="margin">
+     <number>6</number>
+    </property>
+    <property name="spacing">
+     <number>0</number>
+    </property>
     <item row="0" column="0">
-     <widget class="QTreeWidget" name="treeWidget">
-      <property name="maximumSize">
-       <size>
-        <width>150</width>
-        <height>16777215</height>
-       </size>
-      </property>
-      <property name="contextMenuPolicy">
-       <enum>Qt::CustomContextMenu</enum>
-      </property>
-      <property name="editTriggers">
-       <set>QAbstractItemView::AllEditTriggers</set>
+     <widget class="QSplitter" name="splitter">
+      <property name="orientation">
+       <enum>Qt::Horizontal</enum>
       </property>
-      <property name="alternatingRowColors">
-       <bool>true</bool>
-      </property>
-      <attribute name="headerVisible">
-       <bool>false</bool>
-      </attribute>
-      <column>
-       <property name="text">
-        <string notr="true">1</string>
+      <widget class="QTreeWidget" name="treeWidget">
+       <property name="enabled">
+        <bool>true</bool>
+       </property>
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Fixed" vsizetype="Expanding">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
        </property>
-      </column>
+       <property name="minimumSize">
+        <size>
+         <width>100</width>
+         <height>0</height>
+        </size>
+       </property>
+       <property name="maximumSize">
+        <size>
+         <width>250</width>
+         <height>16777215</height>
+        </size>
+       </property>
+       <property name="contextMenuPolicy">
+        <enum>Qt::CustomContextMenu</enum>
+       </property>
+       <property name="editTriggers">
+        <set>QAbstractItemView::AllEditTriggers</set>
+       </property>
+       <property name="alternatingRowColors">
+        <bool>true</bool>
+       </property>
+       <attribute name="headerVisible">
+        <bool>false</bool>
+       </attribute>
+       <column>
+        <property name="text">
+         <string notr="true">1</string>
+        </property>
+       </column>
+      </widget>
+      <widget class="QTabWidget" name="tabWidget">
+       <property name="currentIndex">
+        <number>2</number>
+       </property>
+       <widget class="QWidget" name="tab_2">
+        <attribute name="title">
+         <string>1. Propriétés</string>
+        </attribute>
+        <layout class="QGridLayout" name="gridLayout_4">
+         <item row="0" column="0">
+          <widget class="QLabel" name="label_5">
+           <property name="text">
+            <string>Titre</string>
+           </property>
+          </widget>
+         </item>
+         <item row="0" column="1">
+          <widget class="QLineEdit" name="leTitre"/>
+         </item>
+         <item row="1" column="0">
+          <widget class="QLabel" name="label_3">
+           <property name="text">
+            <string>Description</string>
+           </property>
+          </widget>
+         </item>
+         <item row="1" column="1">
+          <widget class="QLineEdit" name="leDesc"/>
+         </item>
+         <item row="2" column="0">
+          <widget class="QLabel" name="label_6">
+           <property name="text">
+            <string>Auteur</string>
+           </property>
+          </widget>
+         </item>
+         <item row="2" column="1">
+          <widget class="QLineEdit" name="leAuthor"/>
+         </item>
+         <item row="2" column="2">
+          <widget class="QLabel" name="label">
+           <property name="text">
+            <string>Date</string>
+           </property>
+          </widget>
+         </item>
+         <item row="2" column="3">
+          <widget class="QDateEdit" name="dateEdit">
+           <property name="calendarPopup">
+            <bool>true</bool>
+           </property>
+          </widget>
+         </item>
+         <item row="3" column="0" colspan="4">
+          <widget class="QGroupBox" name="groupBox">
+           <property name="title">
+            <string>Album photo protégé par mot de passe </string>
+           </property>
+           <layout class="QFormLayout" name="formLayout">
+            <item row="1" column="0">
+             <widget class="QLabel" name="label_4">
+              <property name="text">
+               <string>Identifiant</string>
+              </property>
+             </widget>
+            </item>
+            <item row="1" column="1">
+             <widget class="QLineEdit" name="leLogin"/>
+            </item>
+            <item row="2" column="0">
+             <widget class="QLabel" name="label_2">
+              <property name="text">
+               <string>Mot de passe</string>
+              </property>
+             </widget>
+            </item>
+            <item row="2" column="1">
+             <widget class="QLineEdit" name="lePasswd"/>
+            </item>
+            <item row="0" column="0" colspan="2">
+             <widget class="QLabel" name="label_7">
+              <property name="text">
+               <string>Complétez les deux champs ci-dessous si vous voulez protéger l'accès (lorsqu'il sera publié sur internet) à cet album photo par un identifiant et un mot de passe.</string>
+              </property>
+              <property name="wordWrap">
+               <bool>true</bool>
+              </property>
+             </widget>
+            </item>
+           </layout>
+          </widget>
+         </item>
+         <item row="4" column="3">
+          <widget class="QPushButton" name="btnSave">
+           <property name="text">
+            <string>&amp;Sauvegarder</string>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </widget>
+       <widget class="QWidget" name="tab_3">
+        <attribute name="title">
+         <string>2. Photos</string>
+        </attribute>
+        <layout class="QGridLayout" name="gridLayout_5">
+         <item row="0" column="0">
+          <widget class="QListWidget" name="lwPictures">
+           <property name="acceptDrops">
+            <bool>true</bool>
+           </property>
+           <property name="iconSize">
+            <size>
+             <width>120</width>
+             <height>120</height>
+            </size>
+           </property>
+           <property name="gridSize">
+            <size>
+             <width>128</width>
+             <height>128</height>
+            </size>
+           </property>
+           <property name="viewMode">
+            <enum>QListView::IconMode</enum>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </widget>
+       <widget class="QWidget" name="tab">
+        <attribute name="title">
+         <string>3. Publier sur internet</string>
+        </attribute>
+        <layout class="QGridLayout" name="gridLayout_2">
+         <item row="0" column="0">
+          <widget class="QLabel" name="label_8">
+           <property name="text">
+            <string>Identifiant</string>
+           </property>
+          </widget>
+         </item>
+         <item row="0" column="1">
+          <widget class="QLineEdit" name="leFTPLogin">
+           <property name="text">
+            <string>rober_10820507</string>
+           </property>
+          </widget>
+         </item>
+         <item row="1" column="0">
+          <widget class="QLabel" name="label_9">
+           <property name="text">
+            <string>Mot de passe</string>
+           </property>
+          </widget>
+         </item>
+         <item row="1" column="1">
+          <widget class="QLineEdit" name="leFTPPass">
+           <property name="text">
+            <string>EedmuOn1</string>
+           </property>
+          </widget>
+         </item>
+         <item row="2" column="0">
+          <widget class="QLabel" name="label_10">
+           <property name="text">
+            <string>Serveur FTP</string>
+           </property>
+          </widget>
+         </item>
+         <item row="2" column="1">
+          <widget class="QLineEdit" name="leFTPServeur">
+           <property name="text">
+            <string>ftp.hebergratuit.com</string>
+           </property>
+          </widget>
+         </item>
+         <item row="3" column="0">
+          <widget class="QLabel" name="label_11">
+           <property name="text">
+            <string>Répertoire d'installation</string>
+           </property>
+          </widget>
+         </item>
+         <item row="3" column="1">
+          <widget class="QLineEdit" name="leFTPDirectory">
+           <property name="text">
+            <string>/htdocs/gallery</string>
+           </property>
+          </widget>
+         </item>
+         <item row="4" column="2">
+          <widget class="QPushButton" name="btnFTPPublish">
+           <property name="text">
+            <string>Envoyer</string>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </widget>
+      </widget>
      </widget>
     </item>
    </layout>
@@ -244,18 +298,11 @@
     <property name="title">
      <string>&amp;Édition</string>
     </property>
+    <addaction name="action_Pr_f_rences"/>
    </widget>
    <addaction name="menu_Fichier"/>
    <addaction name="menu_dition"/>
   </widget>
-  <widget class="QToolBar" name="mainToolBar">
-   <attribute name="toolBarArea">
-    <enum>TopToolBarArea</enum>
-   </attribute>
-   <attribute name="toolBarBreak">
-    <bool>false</bool>
-   </attribute>
-  </widget>
   <widget class="QStatusBar" name="statusBar"/>
   <action name="action_Quiter">
    <property name="text">
@@ -280,22 +327,15 @@
     <bool>true</bool>
    </property>
   </action>
+  <action name="action_Pr_f_rences">
+   <property name="text">
+    <string>&amp;Préférences</string>
+   </property>
+  </action>
  </widget>
  <layoutdefault spacing="6" margin="11"/>
  <tabstops>
-  <tabstop>leSource</tabstop>
-  <tabstop>leDest</tabstop>
-  <tabstop>btnExport</tabstop>
-  <tabstop>commandLinkButton</tabstop>
-  <tabstop>leTitre</tabstop>
-  <tabstop>leDesc</tabstop>
-  <tabstop>leAuthor</tabstop>
-  <tabstop>dateEdit</tabstop>
-  <tabstop>leLogin</tabstop>
-  <tabstop>lePasswd</tabstop>
-  <tabstop>btnSave</tabstop>
   <tabstop>treeWidget</tabstop>
-  <tabstop>lwPictures</tabstop>
  </tabstops>
  <resources>
   <include location="resources.qrc"/>
