commit 925ac0caf27fcefa56a8a98313e72ccf8bf26ba3
Author: Eric Seigne <eric.seigne@ryxeo.com>
Date:   Sun Jun 10 15:19:38 2012 +0200

    ajout des messages dans la boite de logs

diff --git a/assistant.cpp b/assistant.cpp
index 00075f8..5c684f3 100644
--- a/assistant.cpp
+++ b/assistant.cpp
@@ -28,6 +28,7 @@ Assistant::Assistant(QWidget *parent) :
 {
     ui->setupUi(this);
     m_tools = new tools(QDir("."),this);
+    connect(m_tools, SIGNAL(signalUploadEnd()), this, SLOT(uploadEnd()));
 }
 
 Assistant::~Assistant()
@@ -38,6 +39,20 @@ Assistant::~Assistant()
 void Assistant::on_btnUploadPHP_clicked()
 {
     qDebug() << "Assistant::on_btnUploadPHP_clicked";
+    ui->btnUploadPHP->setEnabled(false);
+
+    if(ui->leFTPServeur->text().trimmed() == "") {
+        ui->leFTPServeur->setFocus();
+        return;
+    }
+    if(ui->leFTPLogin->text().trimmed() == "") {
+        ui->leFTPLogin->setFocus();
+        return;
+    }
+    if(ui->leFTPPass->text().trimmed() == "") {
+        ui->leFTPPass->setFocus();
+        return;
+    }
 
     m_tools->ftpConnect(ui->leFTPServeur->text(),
                         ui->leFTPLogin->text(),
@@ -53,11 +68,11 @@ void Assistant::on_btnUploadPHP_clicked()
     m_tools->parcoursRecursif(dir.absolutePath(),"");
     //qDebug() << m_fileListToUpload;
     m_tools->uploadRecursifPHP(ui->leFTPDirectory->text());
-    connect(m_tools, SIGNAL(signalUpload(int,int)), this, SLOT(updateProgressFichier(int,int)));
+    connect(m_tools, SIGNAL(signalUpload(int,int,QString)), this, SLOT(updateProgressFichier(int,int,QString)));
     connect(m_tools, SIGNAL(signalUploadData(int,int)), this, SLOT(updateProgressData(int,int)));
 }
 
-void Assistant::updateProgressFichier(int total, int current)
+void Assistant::updateProgressFichier(int total, int current, QString fileName)
 {
     ui->pbFTPFichier->setMaximum(total);
     ui->pbFTPFichier->setValue(current);
@@ -68,3 +83,8 @@ void Assistant::updateProgressData(int total, int current)
     ui->pbFTPProgress->setMaximum(total);
     ui->pbFTPProgress->setValue(current);
 }
+
+void Assistant::uploadEnd()
+{
+    ui->btnUploadPHP->setText(trUtf8("Téléchargement terminé !"));
+}
diff --git a/assistant.h b/assistant.h
index f7b1927..ba70f7b 100644
--- a/assistant.h
+++ b/assistant.h
@@ -1,5 +1,5 @@
 /**
-  * Classe 
+  * Classe
   * @see https://redmine.ryxeo.com/projects/
   * @author 2012 Eric Seigne <eric.seigne@ryxeo.com>
   * @see The GNU Public License (GNU/GPL) v3
@@ -28,7 +28,9 @@
 #include <QFtp>
 #include <QDebug>
 #include <QDir>
+#include <QTimer>
 #include "tools.h"
+#include "abuleduapplicationv1.h"
 
 namespace Ui {
 class Assistant;
@@ -37,15 +39,16 @@ class Assistant;
 class Assistant : public QWizard
 {
     Q_OBJECT
-    
+
 public:
     explicit Assistant(QWidget *parent = 0);
     ~Assistant();
-    
+
 private slots:
     void on_btnUploadPHP_clicked();
-    void updateProgressFichier(int total, int current);
+    void updateProgressFichier(int total, int current, QString fileName);
     void updateProgressData(int total, int current);
+    void uploadEnd();
 
 private:
     Ui::Assistant *ui;
diff --git a/assistant.ui b/assistant.ui
index 03ff2d4..c494644 100644
--- a/assistant.ui
+++ b/assistant.ui
@@ -53,8 +53,11 @@ Si vous voulez relancer cet assistant vous pourrez le faire depuis le menu Optio
     </item>
     <item row="0" column="1">
      <widget class="QLineEdit" name="leFTPLogin">
+      <property name="toolTip">
+       <string>Indiquez ici votre identifiant de connexion FTP</string>
+      </property>
       <property name="text">
-       <string>webopenphoto</string>
+       <string/>
       </property>
      </widget>
     </item>
@@ -67,8 +70,11 @@ Si vous voulez relancer cet assistant vous pourrez le faire depuis le menu Optio
     </item>
     <item row="1" column="1">
      <widget class="QLineEdit" name="leFTPPass">
+      <property name="toolTip">
+       <string>Indiquez ici le mot de passe de votre compte FTP</string>
+      </property>
       <property name="text">
-       <string>MowlUcDyach6</string>
+       <string/>
       </property>
       <property name="echoMode">
        <enum>QLineEdit::PasswordEchoOnEdit</enum>
@@ -84,6 +90,9 @@ Si vous voulez relancer cet assistant vous pourrez le faire depuis le menu Optio
     </item>
     <item row="2" column="1">
      <widget class="QLineEdit" name="leFTPServeur">
+      <property name="toolTip">
+       <string>Indiquez ici le nom du serveur FTP</string>
+      </property>
       <property name="text">
        <string>ftpperso.free.fr</string>
       </property>
@@ -144,6 +153,13 @@ Si vous voulez relancer cet assistant vous pourrez le faire depuis le menu Optio
    </layout>
   </widget>
  </widget>
+ <tabstops>
+  <tabstop>leFTPLogin</tabstop>
+  <tabstop>leFTPPass</tabstop>
+  <tabstop>leFTPServeur</tabstop>
+  <tabstop>leFTPDirectory</tabstop>
+  <tabstop>btnUploadPHP</tabstop>
+ </tabstops>
  <resources/>
  <connections/>
 </ui>
diff --git a/main.cpp b/main.cpp
index 40dd34c..b2ef6f6 100644
--- a/main.cpp
+++ b/main.cpp
@@ -24,8 +24,32 @@
 #include "version.h"
 #include "original.h"
 
+void debugOutput(QtMsgType type, const char *msg)
+ {
+     switch (type) {
+     case QtDebugMsg:
+#ifndef QT_NO_DEBUG
+         fprintf(stderr, "Debug: %s\n", msg);
+#endif
+         break;
+     case QtWarningMsg:
+#ifndef QT_NO_DEBUG
+         fprintf(stderr, "Warning: %s\n", msg);
+#endif
+         break;
+     case QtCriticalMsg:
+         fprintf(stderr, "Critical: %s\n", msg);
+         break;
+     case QtFatalMsg:
+         fprintf(stderr, "Fatal: %s\n", msg);
+         abort();
+     }
+ }
+
 int main(int argc, char *argv[])
 {
+//    qInstallMsgHandler(debugOutput);
+
     AbulEduApplicationV1 a(argc, argv,VER_INTERNALNAME_STR, VER_PRODUCTVERSION_STR, VER_COMPANYDOMAIN_STR, VER_COMPANYNAME_STR);
     a.setAbeApplicationLongName(QObject::trUtf8(VER_FILEDESCRIPTION_STR));
     original w;
diff --git a/original.cpp b/original.cpp
index 4349a19..0546da4 100644
--- a/original.cpp
+++ b/original.cpp
@@ -1,4 +1,4 @@
-/** Classe original: nom du projet prototype :)
+/** Classe RyXeo WebPhotoAlbum: fichier principal de l'application
   * @see https://redmine.ryxeo.com/projects/
   * @author 2012 Eric Seigne <eric.seigne@ryxeo.com>
   * @see The GNU Public License (GNU/GPL) v3
@@ -77,6 +77,7 @@ original::original(QWidget *parent) :
 
     ui->dateEdit->setDate(QDate::currentDate());
     m_tools = new tools(m_baseDir, this);
+    connect(m_tools, SIGNAL(signalUploadEnd()), this, SLOT(uploadEnd()));
 
     //============== 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);
@@ -447,7 +448,7 @@ void original::on_btnUpload_clicked()
     m_tools->parcoursRecursif(dir.absolutePath(),ui->treeWidget->currentItem()->text(0));
     //qDebug() << m_fileListToUpload;
     m_tools->uploadRecursifGallery(ui->leFTPDirectory->text());
-    connect(m_tools, SIGNAL(signalUpload(int,int)), this, SLOT(updateProgressFichier(int,int)));
+    connect(m_tools, SIGNAL(signalUpload(int,int,QString)), this, SLOT(updateProgressFichier(int,int,QString)));
     connect(m_tools, SIGNAL(signalUploadData(int,int)), this, SLOT(updateProgressData(int,int)));
 }
 
@@ -457,10 +458,11 @@ void original::on_action_Assistant_d_installation_triggered()
     a->show();
 }
 
-void original::updateProgressFichier(int total, int current)
+void original::updateProgressFichier(int total, int current, QString fileName)
 {
     ui->pbFTPFichier->setMaximum(total);
     ui->pbFTPFichier->setValue(current);
+    ui->textBrowser->append(fileName + "\n");
 }
 
 void original::updateProgressData(int total, int current)
@@ -506,3 +508,8 @@ void original::makeZip(QString repSource, QString destFileName)
     }
     QApplication::restoreOverrideCursor();
 }
+
+void original::uploadEnd()
+{
+    ui->textBrowser->append(trUtf8("Téléchargement terminé\n"));
+}
diff --git a/original.h b/original.h
index 7c6c667..52ad47f 100644
--- a/original.h
+++ b/original.h
@@ -1,5 +1,4 @@
-/**
-  * Classe
+/** Classe RyXeo WebPhotoAlbum: fichier principal de l'application
   * @see https://redmine.ryxeo.com/projects/
   * @author 2012 Eric Seigne <eric.seigne@ryxeo.com>
   * @see The GNU Public License (GNU/GPL) v3
@@ -73,9 +72,10 @@ private slots:
 //    void processItem(QTreeWidgetItem *item, int column);
     void on_btnUpload_clicked();
     void on_action_Assistant_d_installation_triggered();
-    void updateProgressFichier(int total, int current);
+    void updateProgressFichier(int total, int current, QString fileName);
     void updateProgressData(int total, int current);
     void makeZip(QString repSource, QString destFileName);
+    void uploadEnd();
 
 private:
     Ui::original *ui;
diff --git a/original.ui b/original.ui
index 9c350c3..e71243c 100644
--- a/original.ui
+++ b/original.ui
@@ -74,7 +74,7 @@
       </widget>
       <widget class="QTabWidget" name="tabWidget">
        <property name="currentIndex">
-        <number>0</number>
+        <number>2</number>
        </property>
        <widget class="QWidget" name="tabProprietes">
         <attribute name="title">
@@ -217,7 +217,7 @@
          <item row="0" column="1">
           <widget class="QLineEdit" name="leFTPLogin">
            <property name="text">
-            <string>webopenphoto</string>
+            <string/>
            </property>
           </widget>
          </item>
@@ -231,7 +231,7 @@
          <item row="1" column="1">
           <widget class="QLineEdit" name="leFTPPass">
            <property name="text">
-            <string>MowlUcDyach6</string>
+            <string/>
            </property>
            <property name="echoMode">
             <enum>QLineEdit::PasswordEchoOnEdit</enum>
@@ -269,7 +269,7 @@
          <item row="6" column="1">
           <widget class="QPushButton" name="btnUpload">
            <property name="text">
-            <string>Upload gallerie en cours</string>
+            <string>&amp;Télécharger la gallerie en cours</string>
            </property>
           </widget>
          </item>
@@ -320,7 +320,7 @@
      <x>0</x>
      <y>0</y>
      <width>843</width>
-     <height>23</height>
+     <height>25</height>
     </rect>
    </property>
    <widget class="QMenu" name="menu_Fichier">
diff --git a/tools.cpp b/tools.cpp
index ffdfacc..47d5b59 100644
--- a/tools.cpp
+++ b/tools.cpp
@@ -145,7 +145,7 @@ void tools::clear()
 
 int tools::nbTotalUpload()
 {
-    return m_fileListToUpload.count();
+    return m_fileListToUpload.count()+2;
 }
 
 int tools::nbResteUpload()
@@ -178,7 +178,10 @@ void tools::ftpNextCommand()
             }
         }
         m_currentFTPFileUpload++;
-        emit signalUpload(nbTotalUpload(), m_currentFTPFileUpload);
+        emit signalUpload(nbTotalUpload(), m_currentFTPFileUpload, cmd.at(1));
+    }
+    else {
+        emit signalUploadEnd();
     }
 }
 
diff --git a/tools.h b/tools.h
index 2a0025e..88f2c25 100644
--- a/tools.h
+++ b/tools.h
@@ -1,5 +1,4 @@
-/**
-  * Classe 
+/** Classe tools: regroupe ce qui est mutualisable entre assistant et appli
   * @see https://redmine.ryxeo.com/projects/
   * @author 2012 Eric Seigne <eric.seigne@ryxeo.com>
   * @see The GNU Public License (GNU/GPL) v3
@@ -41,8 +40,9 @@ public:
     explicit tools(QDir basedir, QObject *parent = 0);
 
 signals:
-    void signalUpload(int,int);
+    void signalUpload(int total, int current, QString fileName);
     void signalUploadData(int,int);
+    void signalUploadEnd();
 
 public slots:
     void ftpConnect(QString serveur, QString login, QString passwd);
