Projet

Général

Profil

Révision db5783a6

Voir les différences:

original.cpp
52 52
{
53 53
    ui->setupUi(this);
54 54

  
55
    ui->stackedWidget->setCurrentWidget(ui->page);
56

  
57 55
    m_currentProjectPictureNumber = 0;
58 56

  
57
    //Hop pour que le splitter soit a peu pres a la bonne taille dès le début
58
    QList<int> sizes;
59
    sizes.append(200);
60
    sizes.append(500);
61
    ui->splitter->setSizes(sizes);
62

  
59 63
    m_baseDir = QDir(QDir::homePath() + "/RyXeo-WebPhotoAlbum");
60 64
    m_baseDir.setFilter(QDir::Dirs | QDir::NoSymLinks | QDir::NoDotAndDotDot);
61 65
    QFileInfoList list = m_baseDir  .entryInfoList();
......
65 69
        item->setData(1,0,list.at(i).absoluteFilePath());
66 70
    }
67 71

  
72
    //============== l'étiquette invitant a déposer des images
73
    m_labelDeposez = new QLabel(trUtf8("Glissez-déposez ici les photos que vous voulez ajouter à cet album ..."),ui->lwPictures);
74
    m_labelDeposez->setStyleSheet("color: #aaa;\nfont-size: 24pt;\nfont-weight: bold;\n");
75
    m_labelDeposez->setScaledContents(true);
76
    m_labelDeposez->setWordWrap(true);
77
    m_labelDeposez->setAlignment(Qt::AlignCenter | Qt::AlignHCenter);
78
    m_labelDeposez->hide();
79

  
68 80
    //============== le menu contextuel du treewidget (gauche)
69 81
    m_menu = new QMenu(ui->treeWidget);
70 82
    QList<QAction*> actions;
......
94 106
    delete ui;
95 107
}
96 108

  
97
void original::on_btnExport_clicked()
98
{
99
    //Creation de la destination
100
    QDir rep;
101
    QString dest = ui->leDest->text().trimmed() + "/web-gallery";
102
    rep.mkpath(dest);
103
    rep.mkpath(dest + "/hq");
104
    rep.mkpath(dest + "/lq");
105
    rep.mkpath(dest + "/mq");
106
    rep.mkpath(dest + "/thumbs");
107
    rep.mkpath(dest + "/zip");
108
    rep.mkpath(dest + "/comments");
109

  
110
    //Creation des images
111
    QDir dir(ui->leSource->text().trimmed());
112
    dir.setFilter(QDir::Files | QDir::NoSymLinks | QDir::NoDotAndDotDot);
113
    QFileInfoList list = dir.entryInfoList();
114
    for(int i = 0; i < list.count(); i++) {
115
        ui->statusBar->clearMessage();
116
        ui->statusBar->showMessage(trUtf8("Fichier en cours: %1").arg(list.at(i).fileName()),3000);
117
        qApp->processEvents();
118

  
119
        qDebug() << "Processing : " << list.at(i).absoluteFilePath();
120
        QPixmap pixmap(list.at(i).absoluteFilePath());
121
        pixmap.save(QString("%1/hq/img-%2.jpg").arg(dest).arg(i));
122

  
123
        ui->statusBar->showMessage(trUtf8("Fichier en cours: %1 [hq]").arg(list.at(i).fileName()),3000);
124
        QPixmap pixmapThumbs(pixmap.scaled(QSize(120,120), Qt::KeepAspectRatio, Qt::SmoothTransformation));
125
        pixmapThumbs.save(QString("%1/thumbs/img-%2.jpg").arg(dest).arg(i));
126

  
127
        ui->statusBar->showMessage(trUtf8("Fichier en cours: %1 [hq] [mq]").arg(list.at(i).fileName()),3000);
128
        QPixmap pixmapMQ(pixmap.scaled(QSize(800,600), Qt::KeepAspectRatio, Qt::SmoothTransformation));
129
        pixmapMQ.save(QString("%1/mq/img-%2.jpg").arg(dest).arg(i));
130

  
131
        ui->statusBar->showMessage(trUtf8("Fichier en cours: %1 [hq] [mq] [lq]").arg(list.at(i).fileName()),3000);
132
        QPixmap pixmapLQ(pixmap.scaled(QSize(640,480), Qt::KeepAspectRatio, Qt::SmoothTransformation));
133
        pixmapLQ.save(QString("%1/lq/img-%2.jpg").arg(dest).arg(i));
134

  
135

  
136
        QFile file(QString("%1/comments/%2.txt").arg(dest).arg(i));
137
        if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
138
            return;
139

  
140
        QTextStream out(&file);
141
        out << "<span>Photo " + QString::number(i) + "</span>\n";
142
        file.close();
143
        ui->statusBar->showMessage(trUtf8("Fichier en cours: %1 [hq] [mq] [lq] [meta]").arg(list.at(i).fileName()),3000);
144

  
145
        //================== on copie les metadata
146
        Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(list.at(i).absoluteFilePath().toStdString());
147
        Exiv2::Image::AutoPtr imageLQ = Exiv2::ImageFactory::open(QString("%1/lq/img-%2.jpg").arg(dest).arg(i).toStdString());
148
        Exiv2::Image::AutoPtr imageMQ = Exiv2::ImageFactory::open(QString("%1/mq/img-%2.jpg").arg(dest).arg(i).toStdString());
149
        Exiv2::Image::AutoPtr imageHQ = Exiv2::ImageFactory::open(QString("%1/hq/img-%2.jpg").arg(dest).arg(i).toStdString());
150
        Exiv2::Image::AutoPtr imageThumb = Exiv2::ImageFactory::open(QString("%1/thumbs/img-%2.jpg").arg(dest).arg(i).toStdString());
151
        if (image.get() != 0)
152
        {
153
            image->readMetadata();
154
            Exiv2::ExifData &exifData = image->exifData();
155
            if (!exifData.empty())
156
            {
157
                bool setArtist = false;
158
                bool setCopyright = false;
159
                bool setSoftware = false;
160
                Exiv2::ExifData::const_iterator end = exifData.end();
161
                qDebug() << "============================ DEBUT ===============================";
162
                for (Exiv2::ExifData::const_iterator i = exifData.begin(); i != end; ++i)
163
                {
164
                    qDebug() << i->key().c_str() << " = " << i->value().toString().c_str();
165
                    if (i->key() == "Exif.Image.Artist") {
166
                        exifData["Exif.Image.Artist"]    = ui->leAuthor->text().trimmed().toStdString();
167
                        setArtist = true;
168
                    }
169
                    if (i->key() == "Exif.Image.Copyright") {
170
                        exifData["Exif.Image.Copyright"]    = ui->leAuthor->text().trimmed().toStdString();
171
                        setCopyright = true;
172
                    }
173
                    if (i->key() == "Exif.Image.Software") {
174
                        exifData["Exif.Image.Software"]  = "RyXeo WebPhotoAlbum - http://www.ryxeo.com/";
175
                        setSoftware = true;
176
                    }
177
                }
178
                //Si on n'a pas les meta il faut les ajouter
179

  
180
                //Mise à jour de l'auteur
181
                if(!setArtist) {
182
                    Exiv2::ExifKey k("Exif.Image.Artist");
183
                    Exiv2::Value::AutoPtr v = Exiv2::Value::create(Exiv2::asciiString);
184
                    v->read(ui->leAuthor->text().trimmed().toStdString());
185
                    exifData.add(k,v.get());
186
                }
187

  
188
                if(!setCopyright) {
189
                    Exiv2::ExifKey k2("Exif.Image.Copyright");
190
                    Exiv2::Value::AutoPtr v2 = Exiv2::Value::create(Exiv2::asciiString);
191
                    v2->read(ui->leAuthor->text().trimmed().toStdString());
192
                    exifData.add(k2,v2.get());
193
                }
194

  
195
                if(!setSoftware) {
196
                    Exiv2::ExifKey k3("Exif.Image.Software");
197
                    Exiv2::Value::AutoPtr v3 = Exiv2::Value::create(Exiv2::asciiString);
198
                    v3->read("RyXéo WebPhotoAlbum - http://www.ryxeo.com/");
199
                    exifData.add(k3,v3.get());
200
                }
201

  
202
                qDebug() << "============================ APRES ===============================";
203
                Exiv2::ExifData::const_iterator end2 = exifData.end();
204
                for (Exiv2::ExifData::const_iterator i2 = exifData.begin(); i2 != end2; ++i2)
205
                {
206
                    qDebug() << i2->key().c_str() << " = " << i2->value().toString().c_str();
207
                }
208
                qDebug() << "============================ FIN ===============================";
209

  
210
                imageLQ->setExifData(exifData);
211
                imageLQ->writeMetadata();
212

  
213
                imageMQ->setExifData(exifData);
214
                imageMQ->writeMetadata();
215

  
216
                imageHQ->setExifData(exifData);
217
                imageHQ->writeMetadata();
218

  
219
                imageThumb->setExifData(exifData);
220
                imageThumb->writeMetadata();
221
            }
222
        }
223
        ui->statusBar->showMessage(trUtf8("Fichier en cours: %1 [hq] [mq] [lq] [meta] ... terminé").arg(list.at(i).fileName()),3000);
224
    }
225
}
109
//void original::on_btnExport_clicked()
110
//{
111
//    //Creation de la destination
112
//    QDir rep;
113
//    QString dest = ui->leDest->text().trimmed() + "/web-gallery";
114
//    rep.mkpath(dest);
115
//    rep.mkpath(dest + "/hq");
116
//    rep.mkpath(dest + "/lq");
117
//    rep.mkpath(dest + "/mq");
118
//    rep.mkpath(dest + "/thumbs");
119
//    rep.mkpath(dest + "/zip");
120
//    rep.mkpath(dest + "/comments");
121

  
122
//    //Creation des images
123
//    QDir dir(ui->leSource->text().trimmed());
124
//    dir.setFilter(QDir::Files | QDir::NoSymLinks | QDir::NoDotAndDotDot);
125
//    QFileInfoList list = dir.entryInfoList();
126
//    for(int i = 0; i < list.count(); i++) {
127
//        ui->statusBar->clearMessage();
128
//        ui->statusBar->showMessage(trUtf8("Fichier en cours: %1").arg(list.at(i).fileName()),3000);
129
//        qApp->processEvents();
130

  
131
//        qDebug() << "Processing : " << list.at(i).absoluteFilePath();
132
//        QPixmap pixmap(list.at(i).absoluteFilePath());
133
//        pixmap.save(QString("%1/hq/img-%2.jpg").arg(dest).arg(i));
134

  
135
//        ui->statusBar->showMessage(trUtf8("Fichier en cours: %1 [hq]").arg(list.at(i).fileName()),3000);
136
//        QPixmap pixmapThumbs(pixmap.scaled(QSize(120,120), Qt::KeepAspectRatio, Qt::SmoothTransformation));
137
//        pixmapThumbs.save(QString("%1/thumbs/img-%2.jpg").arg(dest).arg(i));
138

  
139
//        ui->statusBar->showMessage(trUtf8("Fichier en cours: %1 [hq] [mq]").arg(list.at(i).fileName()),3000);
140
//        QPixmap pixmapMQ(pixmap.scaled(QSize(800,600), Qt::KeepAspectRatio, Qt::SmoothTransformation));
141
//        pixmapMQ.save(QString("%1/mq/img-%2.jpg").arg(dest).arg(i));
142

  
143
//        ui->statusBar->showMessage(trUtf8("Fichier en cours: %1 [hq] [mq] [lq]").arg(list.at(i).fileName()),3000);
144
//        QPixmap pixmapLQ(pixmap.scaled(QSize(640,480), Qt::KeepAspectRatio, Qt::SmoothTransformation));
145
//        pixmapLQ.save(QString("%1/lq/img-%2.jpg").arg(dest).arg(i));
146

  
147

  
148
//        QFile file(QString("%1/comments/%2.txt").arg(dest).arg(i));
149
//        if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
150
//            return;
151

  
152
//        QTextStream out(&file);
153
//        out << "<span>Photo " + QString::number(i) + "</span>\n";
154
//        file.close();
155
//        ui->statusBar->showMessage(trUtf8("Fichier en cours: %1 [hq] [mq] [lq] [meta]").arg(list.at(i).fileName()),3000);
156

  
157
//        //================== on copie les metadata
158
//        Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(list.at(i).absoluteFilePath().toStdString());
159
//        Exiv2::Image::AutoPtr imageLQ = Exiv2::ImageFactory::open(QString("%1/lq/img-%2.jpg").arg(dest).arg(i).toStdString());
160
//        Exiv2::Image::AutoPtr imageMQ = Exiv2::ImageFactory::open(QString("%1/mq/img-%2.jpg").arg(dest).arg(i).toStdString());
161
//        Exiv2::Image::AutoPtr imageHQ = Exiv2::ImageFactory::open(QString("%1/hq/img-%2.jpg").arg(dest).arg(i).toStdString());
162
//        Exiv2::Image::AutoPtr imageThumb = Exiv2::ImageFactory::open(QString("%1/thumbs/img-%2.jpg").arg(dest).arg(i).toStdString());
163
//        if (image.get() != 0)
164
//        {
165
//            image->readMetadata();
166
//            Exiv2::ExifData &exifData = image->exifData();
167
//            if (!exifData.empty())
168
//            {
169
//                bool setArtist = false;
170
//                bool setCopyright = false;
171
//                bool setSoftware = false;
172
//                Exiv2::ExifData::const_iterator end = exifData.end();
173
//                qDebug() << "============================ DEBUT ===============================";
174
//                for (Exiv2::ExifData::const_iterator i = exifData.begin(); i != end; ++i)
175
//                {
176
//                    qDebug() << i->key().c_str() << " = " << i->value().toString().c_str();
177
//                    if (i->key() == "Exif.Image.Artist") {
178
//                        exifData["Exif.Image.Artist"]    = ui->leAuthor->text().trimmed().toStdString();
179
//                        setArtist = true;
180
//                    }
181
//                    if (i->key() == "Exif.Image.Copyright") {
182
//                        exifData["Exif.Image.Copyright"]    = ui->leAuthor->text().trimmed().toStdString();
183
//                        setCopyright = true;
184
//                    }
185
//                    if (i->key() == "Exif.Image.Software") {
186
//                        exifData["Exif.Image.Software"]  = "RyXeo WebPhotoAlbum - http://www.ryxeo.com/";
187
//                        setSoftware = true;
188
//                    }
189
//                }
190
//                //Si on n'a pas les meta il faut les ajouter
191

  
192
//                //Mise à jour de l'auteur
193
//                if(!setArtist) {
194
//                    Exiv2::ExifKey k("Exif.Image.Artist");
195
//                    Exiv2::Value::AutoPtr v = Exiv2::Value::create(Exiv2::asciiString);
196
//                    v->read(ui->leAuthor->text().trimmed().toStdString());
197
//                    exifData.add(k,v.get());
198
//                }
199

  
200
//                if(!setCopyright) {
201
//                    Exiv2::ExifKey k2("Exif.Image.Copyright");
202
//                    Exiv2::Value::AutoPtr v2 = Exiv2::Value::create(Exiv2::asciiString);
203
//                    v2->read(ui->leAuthor->text().trimmed().toStdString());
204
//                    exifData.add(k2,v2.get());
205
//                }
206

  
207
//                if(!setSoftware) {
208
//                    Exiv2::ExifKey k3("Exif.Image.Software");
209
//                    Exiv2::Value::AutoPtr v3 = Exiv2::Value::create(Exiv2::asciiString);
210
//                    v3->read("RyXéo WebPhotoAlbum - http://www.ryxeo.com/");
211
//                    exifData.add(k3,v3.get());
212
//                }
213

  
214
//                qDebug() << "============================ APRES ===============================";
215
//                Exiv2::ExifData::const_iterator end2 = exifData.end();
216
//                for (Exiv2::ExifData::const_iterator i2 = exifData.begin(); i2 != end2; ++i2)
217
//                {
218
//                    qDebug() << i2->key().c_str() << " = " << i2->value().toString().c_str();
219
//                }
220
//                qDebug() << "============================ FIN ===============================";
221

  
222
//                imageLQ->setExifData(exifData);
223
//                imageLQ->writeMetadata();
224

  
225
//                imageMQ->setExifData(exifData);
226
//                imageMQ->writeMetadata();
227

  
228
//                imageHQ->setExifData(exifData);
229
//                imageHQ->writeMetadata();
230

  
231
//                imageThumb->setExifData(exifData);
232
//                imageThumb->writeMetadata();
233
//            }
234
//        }
235
//        ui->statusBar->showMessage(trUtf8("Fichier en cours: %1 [hq] [mq] [lq] [meta] ... terminé").arg(list.at(i).fileName()),3000);
236
//    }
237
//}
226 238

  
227 239
void original::on_action_Nouvel_album_triggered()
228 240
{
......
251 263

  
252 264
void original::on_treeWidget_itemClicked(QTreeWidgetItem *item, int column)
253 265
{
266
    QFileInfo fi(ui->treeWidget->currentItem()->data(1,0).toString()+"/info.txt");
267
    qDebug() << "Lecture de " << fi.absoluteFilePath();
268

  
269
    //Remise a zero
270
    ui->leTitre->clear();
271
    ui->leAuthor->clear();
272
    ui->leDesc->clear();
273
    ui->dateEdit->clear();
274
    ui->leLogin->clear();
275
    ui->lePasswd->clear();
276

  
277
    if(fi.exists()) {
278
        QFile file(fi.absoluteFilePath());
279
        if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
280
            return;
281

  
282
        /* Exemple de fichier
283
                name|Sortie Plongée SAGC. (Cala Montjoi, Spain) 28.05.2012
284
                author|Éric Seigne
285
                description|Sortie Plongée SAGC. (Cala Montjoi, Spain)
286
                date|28.05.2012
287
                restricted_user|sagc
288
                restricted_password|motdepasse
289
                  */
290
        while (!file.atEnd()) {
291
            QByteArray line = file.readLine();
292
            QStringList tab = QString::fromUtf8(line.constData()).split('|');
293
            if(tab.at(0) == "name")
294
                ui->leTitre->setText(tab.at(1));
295
            if(tab.at(0) == "author")
296
                ui->leAuthor->setText(tab.at(1));
297
            if(tab.at(0) == "description")
298
                ui->leDesc->setText(tab.at(1));
299
            if(tab.at(0) == "date")
300
                ui->dateEdit->setDate(QDate::fromString(tab.at(1)));
301
            if(tab.at(0) == "restricted_user")
302
                ui->leLogin->setText(tab.at(1));
303
            if(tab.at(0) == "restricted_password")
304
                ui->lePasswd->setText(tab.at(1));
305

  
306
        }
307

  
308
    }
309

  
310

  
254 311
    ui->lwPictures->clear();
255 312
    m_currentProjectDir = item->data(1,0).toString();
256 313
    m_currentProjectPictureNumber=0;
......
268 325
        ui->lwPictures->insertItem(i,newitem);
269 326
        m_currentProjectPictureNumber = i;
270 327
    }
271
    m_currentProjectPictureNumber++;
272
    qDebug() << "On continue la numerotation a " << m_currentProjectPictureNumber;
273
    qDebug() << "Espace de stockage du projet " << m_currentProjectDir;
274
}
275 328

  
276
void original::on_commandLinkButton_clicked()
277
{
278
    if(ui->stackedWidget->currentWidget() == ui->page_2)
279
        ui->stackedWidget->setCurrentWidget(ui->page);
329
    if(m_currentProjectPictureNumber == 0) {
330
        qDebug() << "Pas d'image ... message";
331
        m_labelDeposez->resize(ui->lwPictures->size());
332
        m_labelDeposez->move(ui->lwPictures->pos());
333
        m_labelDeposez->show();
334
        qDebug() << m_labelDeposez->pos();
335
        qDebug() << m_labelDeposez->size();
336
    }
280 337
    else {
281
        QFileInfo fi(ui->treeWidget->currentItem()->data(1,0).toString()+"/info.txt");
282
        qDebug() << "Lecture de " << fi.absoluteFilePath();
283
        if(fi.exists()) {
284
            QFile file(fi.absoluteFilePath());
285
            if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
286
                return;
287

  
288
            /* Exemple de fichier
289
            name|Sortie Plongée SAGC. (Cala Montjoi, Spain) 28.05.2012
290
            author|Éric Seigne
291
            description|Sortie Plongée SAGC. (Cala Montjoi, Spain)
292
            date|28.05.2012
293
            restricted_user|sagc
294
            restricted_password|motdepasse
295
              */
296
            while (!file.atEnd()) {
297
                QByteArray line = file.readLine();
298
                QStringList tab = QString::fromUtf8(line.constData()).split('|');
299
                if(tab.at(0) == "name")
300
                    ui->leTitre->setText(tab.at(1));
301
                if(tab.at(0) == "author")
302
                    ui->leAuthor->setText(tab.at(1));
303
                if(tab.at(0) == "description")
304
                    ui->leDesc->setText(tab.at(1));
305
                if(tab.at(0) == "date")
306
                    ui->dateEdit->setDate(QDate::fromString(tab.at(1)));
307
                if(tab.at(0) == "restricted_user")
308
                    ui->leLogin->setText(tab.at(1));
309
                if(tab.at(0) == "restricted_password")
310
                    ui->lePasswd->setText(tab.at(1));
311

  
312
            }
313

  
314
        }
315
        ui->stackedWidget->setCurrentWidget(ui->page_2);
338
        m_labelDeposez->hide();
316 339
    }
340
    m_currentProjectPictureNumber++;
341
    qDebug() << "On continue la numerotation a " << m_currentProjectPictureNumber;
342
    qDebug() << "Espace de stockage du projet " << m_currentProjectDir;
317 343
}
318 344

  
319 345
void original::on_btnSave_clicked()
......
493 519
    m_currentProjectPictureNumber++;
494 520
    ui->statusBar->showMessage(trUtf8("Fichier en cours: %1 [hq] [mq] [lq] [meta] ... terminé").arg(fic),3000);
495 521
}
522

  
523
void original::on_btnFTPPublish_clicked()
524
{
525
    m_ftp = new QFtp(this);
526
    connect(m_ftp, SIGNAL(commandFinished(int,bool)),
527
            this, SLOT(ftpCommandFinished(int,bool)));
528
    connect(m_ftp, SIGNAL(listInfo(QUrlInfo)),
529
            this, SLOT(addToList(QUrlInfo)));
530
    connect(m_ftp, SIGNAL(dataTransferProgress(qint64,qint64)),
531
            this, SLOT(updateDataTransferProgress(qint64,qint64)));
532

  
533
    qDebug() << "aaaaaaaaaaaaaa";
534
    m_ftp->connectToHost(ui->leFTPServeur->text(), 21);
535
    m_ftp->setTransferMode(QFtp::Passive);
536

  
537
    qDebug() << "bbbbbbbbbbbbb";
538

  
539
    m_ftp->login(ui->leFTPLogin->text(), ui->leFTPPass->text());
540

  
541
    qDebug() << "Listing FTP: ";
542
    //ftp->cd(url.path());
543
    m_ftp->mkdir(ui->leFTPDirectory->text());
544
    m_ftp->mkdir(ui->leFTPDirectory->text() + "/galleries");
545

  
546
}
547

  
548
void original::ftpCommandFinished(int commandId, bool error)
549
{
550
#ifndef QT_NO_CURSOR
551
    setCursor(Qt::ArrowCursor);
552
#endif
553

  
554
    if (m_ftp->currentCommand() == QFtp::ConnectToHost) {
555
        qDebug() << "Logged onto " << ui->leFTPServeur->text() << " error : " << error;
556
    }
557

  
558
    if (m_ftp->currentCommand() == QFtp::Login) {
559
        qDebug() << "Login ...";
560
        m_ftp->list();
561
    }
562

  
563
    if (m_ftp->currentCommand() == QFtp::Get) {
564
        qDebug() << "Get ...";
565
        if (error) {
566
        } else {
567
        }
568
    } else if (m_ftp->currentCommand() == QFtp::List) {
569
        qDebug() << "List ...";
570
    }
571
}
572

  
573
void original::addToList(const QUrlInfo &urlInfo)
574
{
575
    qDebug() << urlInfo.name();
576
}
original.h
35 35
#include <QInputDialog>
36 36
#include <QDragEnterEvent>
37 37
#include <QUrl>
38

  
38
#include <QLabel>
39
#include <QFtp>
40
#include <QMessageBox>
39 41

  
40 42
namespace Ui {
41 43
class original;
......
50 52
    ~original();
51 53
    
52 54
private slots:
53
    void on_btnExport_clicked();
54 55
    void on_action_Nouvel_album_triggered();
55
    void on_treeWidget_itemClicked(QTreeWidgetItem *item, int column);
56
    void on_commandLinkButton_clicked();
57 56
    void on_btnSave_clicked();
57
    void on_treeWidget_itemClicked(QTreeWidgetItem *item, int column);
58 58
    void on_treeWidget_customContextMenuRequested(const QPoint &pos);
59 59
    //Gestion du drop d'image venant de l'extérieur
60 60
    void dragEnterEvent(QDragEnterEvent *event);
61 61
    void dropEvent(QDropEvent *event);
62 62
    void addPictureToProject(QString fic);
63
    void on_btnFTPPublish_clicked();
64

  
65
//    void connectOrDisconnect();
66
//    void uploadFile();
67
//    void cancelUpload();
68

  
69
    void ftpCommandFinished(int commandId, bool error);
70
    void addToList(const QUrlInfo &urlInfo);
71
//    void processItem(QTreeWidgetItem *item, int column);
72
//    void updateDataTransferProgress(qint64 readBytes,
73
//                                    qint64 totalBytes);
63 74

  
64 75
private:
65 76
    Ui::original *ui;
66 77
    QDir m_baseDir;
67 78
    QMenu *m_menu;
79
    QLabel *m_labelDeposez;
68 80
    QString m_currentProjectDir;
69 81
    int m_currentProjectPictureNumber;
82
    QFtp *m_ftp;
83

  
70 84
};
71 85

  
72 86
#endif // ORIGINAL_H
original.pro
4 4
#
5 5
#-------------------------------------------------
6 6

  
7
QT       += core gui
7
QT       += core gui network
8 8

  
9 9
TARGET = original
10 10
TEMPLATE = app
original.ui
21 21
    <bool>true</bool>
22 22
   </property>
23 23
   <layout class="QGridLayout" name="gridLayout">
24
    <item row="0" column="1">
25
     <widget class="QFrame" name="frmPrincipale">
26
      <property name="sizePolicy">
27
       <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
28
        <horstretch>0</horstretch>
29
        <verstretch>0</verstretch>
30
       </sizepolicy>
31
      </property>
32
      <property name="frameShape">
33
       <enum>QFrame::StyledPanel</enum>
34
      </property>
35
      <property name="frameShadow">
36
       <enum>QFrame::Raised</enum>
37
      </property>
38
      <layout class="QGridLayout" name="gridLayout_3">
39
       <item row="0" column="0">
40
        <widget class="QLineEdit" name="leSource">
41
         <property name="text">
42
          <string>/tmp/t</string>
43
         </property>
44
        </widget>
45
       </item>
46
       <item row="0" column="1">
47
        <widget class="QLineEdit" name="leDest">
48
         <property name="text">
49
          <string>/tmp/w</string>
50
         </property>
51
        </widget>
52
       </item>
53
       <item row="0" column="2">
54
        <widget class="QPushButton" name="btnExport">
55
         <property name="text">
56
          <string>PushButton</string>
57
         </property>
58
        </widget>
59
       </item>
60
       <item row="0" column="3">
61
        <widget class="QCommandLinkButton" name="commandLinkButton">
62
         <property name="text">
63
          <string>Propriétés</string>
64
         </property>
65
        </widget>
66
       </item>
67
       <item row="1" column="0" colspan="4">
68
        <widget class="QStackedWidget" name="stackedWidget">
69
         <property name="currentIndex">
70
          <number>0</number>
71
         </property>
72
         <widget class="QWidget" name="page">
73
          <layout class="QGridLayout" name="gridLayout_4">
74
           <item row="0" column="0">
75
            <widget class="QListWidget" name="lwPictures">
76
             <property name="acceptDrops">
77
              <bool>true</bool>
78
             </property>
79
             <property name="iconSize">
80
              <size>
81
               <width>120</width>
82
               <height>120</height>
83
              </size>
84
             </property>
85
             <property name="gridSize">
86
              <size>
87
               <width>128</width>
88
               <height>128</height>
89
              </size>
90
             </property>
91
             <property name="viewMode">
92
              <enum>QListView::IconMode</enum>
93
             </property>
94
            </widget>
95
           </item>
96
          </layout>
97
         </widget>
98
         <widget class="QWidget" name="page_2">
99
          <layout class="QGridLayout" name="gridLayout_2">
100
           <item row="0" column="0">
101
            <widget class="QLabel" name="label_5">
102
             <property name="text">
103
              <string>Titre</string>
104
             </property>
105
            </widget>
106
           </item>
107
           <item row="0" column="1">
108
            <widget class="QLineEdit" name="leTitre"/>
109
           </item>
110
           <item row="1" column="0">
111
            <widget class="QLabel" name="label_3">
112
             <property name="text">
113
              <string>Description</string>
114
             </property>
115
            </widget>
116
           </item>
117
           <item row="1" column="1">
118
            <widget class="QLineEdit" name="leDesc"/>
119
           </item>
120
           <item row="2" column="0">
121
            <widget class="QLabel" name="label_6">
122
             <property name="text">
123
              <string>Auteur</string>
124
             </property>
125
            </widget>
126
           </item>
127
           <item row="2" column="1">
128
            <widget class="QLineEdit" name="leAuthor"/>
129
           </item>
130
           <item row="2" column="2">
131
            <widget class="QLabel" name="label">
132
             <property name="text">
133
              <string>Date</string>
134
             </property>
135
            </widget>
136
           </item>
137
           <item row="2" column="3">
138
            <widget class="QDateEdit" name="dateEdit">
139
             <property name="calendarPopup">
140
              <bool>true</bool>
141
             </property>
142
            </widget>
143
           </item>
144
           <item row="3" column="0" colspan="4">
145
            <widget class="QGroupBox" name="groupBox">
146
             <property name="title">
147
              <string>Album photo protégé par mot de passe </string>
148
             </property>
149
             <layout class="QFormLayout" name="formLayout">
150
              <item row="1" column="0">
151
               <widget class="QLabel" name="label_4">
152
                <property name="text">
153
                 <string>Identifiant</string>
154
                </property>
155
               </widget>
156
              </item>
157
              <item row="1" column="1">
158
               <widget class="QLineEdit" name="leLogin"/>
159
              </item>
160
              <item row="2" column="0">
161
               <widget class="QLabel" name="label_2">
162
                <property name="text">
163
                 <string>Mot de passe</string>
164
                </property>
165
               </widget>
166
              </item>
167
              <item row="2" column="1">
168
               <widget class="QLineEdit" name="lePasswd"/>
169
              </item>
170
              <item row="0" column="0" colspan="2">
171
               <widget class="QLabel" name="label_7">
172
                <property name="text">
173
                 <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>
174
                </property>
175
                <property name="wordWrap">
176
                 <bool>true</bool>
177
                </property>
178
               </widget>
179
              </item>
180
             </layout>
181
            </widget>
182
           </item>
183
          </layout>
184
         </widget>
185
        </widget>
186
       </item>
187
       <item row="2" column="3">
188
        <widget class="QPushButton" name="btnSave">
189
         <property name="text">
190
          <string>&amp;Sauvegarder</string>
191
         </property>
192
        </widget>
193
       </item>
194
      </layout>
195
     </widget>
196
    </item>
24
    <property name="margin">
25
     <number>6</number>
26
    </property>
27
    <property name="spacing">
28
     <number>0</number>
29
    </property>
197 30
    <item row="0" column="0">
198
     <widget class="QTreeWidget" name="treeWidget">
199
      <property name="maximumSize">
200
       <size>
201
        <width>150</width>
202
        <height>16777215</height>
203
       </size>
204
      </property>
205
      <property name="contextMenuPolicy">
206
       <enum>Qt::CustomContextMenu</enum>
207
      </property>
208
      <property name="editTriggers">
209
       <set>QAbstractItemView::AllEditTriggers</set>
31
     <widget class="QSplitter" name="splitter">
32
      <property name="orientation">
33
       <enum>Qt::Horizontal</enum>
210 34
      </property>
211
      <property name="alternatingRowColors">
212
       <bool>true</bool>
213
      </property>
214
      <attribute name="headerVisible">
215
       <bool>false</bool>
216
      </attribute>
217
      <column>
218
       <property name="text">
219
        <string notr="true">1</string>
35
      <widget class="QTreeWidget" name="treeWidget">
36
       <property name="enabled">
37
        <bool>true</bool>
38
       </property>
39
       <property name="sizePolicy">
40
        <sizepolicy hsizetype="Fixed" vsizetype="Expanding">
41
         <horstretch>0</horstretch>
42
         <verstretch>0</verstretch>
43
        </sizepolicy>
220 44
       </property>
221
      </column>
45
       <property name="minimumSize">
46
        <size>
47
         <width>100</width>
48
         <height>0</height>
49
        </size>
50
       </property>
51
       <property name="maximumSize">
52
        <size>
53
         <width>250</width>
54
         <height>16777215</height>
55
        </size>
56
       </property>
57
       <property name="contextMenuPolicy">
58
        <enum>Qt::CustomContextMenu</enum>
59
       </property>
60
       <property name="editTriggers">
61
        <set>QAbstractItemView::AllEditTriggers</set>
62
       </property>
63
       <property name="alternatingRowColors">
64
        <bool>true</bool>
65
       </property>
66
       <attribute name="headerVisible">
67
        <bool>false</bool>
68
       </attribute>
69
       <column>
70
        <property name="text">
71
         <string notr="true">1</string>
72
        </property>
73
       </column>
74
      </widget>
75
      <widget class="QTabWidget" name="tabWidget">
76
       <property name="currentIndex">
77
        <number>2</number>
78
       </property>
79
       <widget class="QWidget" name="tab_2">
80
        <attribute name="title">
81
         <string>1. Propriétés</string>
82
        </attribute>
83
        <layout class="QGridLayout" name="gridLayout_4">
84
         <item row="0" column="0">
85
          <widget class="QLabel" name="label_5">
86
           <property name="text">
87
            <string>Titre</string>
88
           </property>
89
          </widget>
90
         </item>
91
         <item row="0" column="1">
92
          <widget class="QLineEdit" name="leTitre"/>
93
         </item>
94
         <item row="1" column="0">
95
          <widget class="QLabel" name="label_3">
96
           <property name="text">
97
            <string>Description</string>
98
           </property>
99
          </widget>
100
         </item>
101
         <item row="1" column="1">
102
          <widget class="QLineEdit" name="leDesc"/>
103
         </item>
104
         <item row="2" column="0">
105
          <widget class="QLabel" name="label_6">
106
           <property name="text">
107
            <string>Auteur</string>
108
           </property>
109
          </widget>
110
         </item>
111
         <item row="2" column="1">
112
          <widget class="QLineEdit" name="leAuthor"/>
113
         </item>
114
         <item row="2" column="2">
115
          <widget class="QLabel" name="label">
116
           <property name="text">
117
            <string>Date</string>
118
           </property>
119
          </widget>
120
         </item>
121
         <item row="2" column="3">
122
          <widget class="QDateEdit" name="dateEdit">
123
           <property name="calendarPopup">
124
            <bool>true</bool>
125
           </property>
126
          </widget>
127
         </item>
128
         <item row="3" column="0" colspan="4">
129
          <widget class="QGroupBox" name="groupBox">
130
           <property name="title">
131
            <string>Album photo protégé par mot de passe </string>
132
           </property>
133
           <layout class="QFormLayout" name="formLayout">
134
            <item row="1" column="0">
135
             <widget class="QLabel" name="label_4">
136
              <property name="text">
137
               <string>Identifiant</string>
138
              </property>
139
             </widget>
140
            </item>
141
            <item row="1" column="1">
142
             <widget class="QLineEdit" name="leLogin"/>
143
            </item>
144
            <item row="2" column="0">
145
             <widget class="QLabel" name="label_2">
146
              <property name="text">
147
               <string>Mot de passe</string>
148
              </property>
149
             </widget>
150
            </item>
151
            <item row="2" column="1">
152
             <widget class="QLineEdit" name="lePasswd"/>
153
            </item>
154
            <item row="0" column="0" colspan="2">
155
             <widget class="QLabel" name="label_7">
156
              <property name="text">
157
               <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>
158
              </property>
159
              <property name="wordWrap">
160
               <bool>true</bool>
161
              </property>
162
             </widget>
163
            </item>
164
           </layout>
165
          </widget>
166
         </item>
167
         <item row="4" column="3">
168
          <widget class="QPushButton" name="btnSave">
169
           <property name="text">
170
            <string>&amp;Sauvegarder</string>
171
           </property>
172
          </widget>
173
         </item>
174
        </layout>
175
       </widget>
176
       <widget class="QWidget" name="tab_3">
177
        <attribute name="title">
178
         <string>2. Photos</string>
179
        </attribute>
180
        <layout class="QGridLayout" name="gridLayout_5">
181
         <item row="0" column="0">
182
          <widget class="QListWidget" name="lwPictures">
183
           <property name="acceptDrops">
184
            <bool>true</bool>
185
           </property>
186
           <property name="iconSize">
187
            <size>
188
             <width>120</width>
189
             <height>120</height>
190
            </size>
191
           </property>
192
           <property name="gridSize">
193
            <size>
194
             <width>128</width>
195
             <height>128</height>
196
            </size>
197
           </property>
198
           <property name="viewMode">
199
            <enum>QListView::IconMode</enum>
200
           </property>
201
          </widget>
202
         </item>
203
        </layout>
204
       </widget>
205
       <widget class="QWidget" name="tab">
206
        <attribute name="title">
207
         <string>3. Publier sur internet</string>
208
        </attribute>
209
        <layout class="QGridLayout" name="gridLayout_2">
210
         <item row="0" column="0">
211
          <widget class="QLabel" name="label_8">
212
           <property name="text">
213
            <string>Identifiant</string>
214
           </property>
215
          </widget>
216
         </item>
217
         <item row="0" column="1">
218
          <widget class="QLineEdit" name="leFTPLogin">
219
           <property name="text">
220
            <string>rober_10820507</string>
221
           </property>
222
          </widget>
223
         </item>
224
         <item row="1" column="0">
225
          <widget class="QLabel" name="label_9">
226
           <property name="text">
227
            <string>Mot de passe</string>
228
           </property>
229
          </widget>
230
         </item>
231
         <item row="1" column="1">
232
          <widget class="QLineEdit" name="leFTPPass">
233
           <property name="text">
234
            <string>EedmuOn1</string>
235
           </property>
236
          </widget>
237
         </item>
238
         <item row="2" column="0">
239
          <widget class="QLabel" name="label_10">
240
           <property name="text">
241
            <string>Serveur FTP</string>
242
           </property>
243
          </widget>
244
         </item>
245
         <item row="2" column="1">
246
          <widget class="QLineEdit" name="leFTPServeur">
247
           <property name="text">
248
            <string>ftp.hebergratuit.com</string>
249
           </property>
250
          </widget>
251
         </item>
252
         <item row="3" column="0">
253
          <widget class="QLabel" name="label_11">
254
           <property name="text">
255
            <string>Répertoire d'installation</string>
256
           </property>
257
          </widget>
258
         </item>
259
         <item row="3" column="1">
260
          <widget class="QLineEdit" name="leFTPDirectory">
261
           <property name="text">
262
            <string>/htdocs/gallery</string>
263
           </property>
264
          </widget>
265
         </item>
266
         <item row="4" column="2">
267
          <widget class="QPushButton" name="btnFTPPublish">
268
           <property name="text">
269
            <string>Envoyer</string>
270
           </property>
271
          </widget>
272
         </item>
273
        </layout>
274
       </widget>
275
      </widget>
222 276
     </widget>
223 277
    </item>
224 278
   </layout>
......
244 298
    <property name="title">
245 299
     <string>&amp;Édition</string>
246 300
    </property>
301
    <addaction name="action_Pr_f_rences"/>
247 302
   </widget>
248 303
   <addaction name="menu_Fichier"/>
249 304
   <addaction name="menu_dition"/>
250 305
  </widget>
251
  <widget class="QToolBar" name="mainToolBar">
252
   <attribute name="toolBarArea">
253
    <enum>TopToolBarArea</enum>
254
   </attribute>
255
   <attribute name="toolBarBreak">
256
    <bool>false</bool>
257
   </attribute>
258
  </widget>
259 306
  <widget class="QStatusBar" name="statusBar"/>
260 307
  <action name="action_Quiter">
261 308
   <property name="text">
......
280 327
    <bool>true</bool>
281 328
   </property>
282 329
  </action>
330
  <action name="action_Pr_f_rences">
331
   <property name="text">
332
    <string>&amp;Préférences</string>
333
   </property>
334
  </action>
283 335
 </widget>
284 336
 <layoutdefault spacing="6" margin="11"/>
285 337
 <tabstops>
286
  <tabstop>leSource</tabstop>
287
  <tabstop>leDest</tabstop>
288
  <tabstop>btnExport</tabstop>
289
  <tabstop>commandLinkButton</tabstop>
290
  <tabstop>leTitre</tabstop>
291
  <tabstop>leDesc</tabstop>
292
  <tabstop>leAuthor</tabstop>
293
  <tabstop>dateEdit</tabstop>
294
  <tabstop>leLogin</tabstop>
295
  <tabstop>lePasswd</tabstop>
296
  <tabstop>btnSave</tabstop>
297 338
  <tabstop>treeWidget</tabstop>
298
  <tabstop>lwPictures</tabstop>
299 339
 </tabstops>
300 340
 <resources>
301 341
  <include location="resources.qrc"/>

Formats disponibles : Unified diff

Redmine Appliance - Powered by TurnKey Linux