20 |
20 |
*/
|
21 |
21 |
|
22 |
22 |
|
23 |
|
#include "original.h"
|
24 |
|
#include "ui_original.h"
|
|
23 |
#include "webalbumphoto.h"
|
|
24 |
#include "ui_webalbumphoto.h"
|
25 |
25 |
|
26 |
26 |
|
27 |
27 |
//---------------------------------------------------------------------------
|
... | ... | |
45 |
45 |
// =========================================================================================================================
|
46 |
46 |
|
47 |
47 |
|
48 |
|
original::original(QWidget *parent) :
|
|
48 |
WebAlbumPhoto::WebAlbumPhoto(QWidget *parent) :
|
49 |
49 |
QMainWindow(parent),
|
50 |
|
ui(new Ui::original)
|
|
50 |
ui(new Ui::WebAlbumPhoto)
|
51 |
51 |
{
|
52 |
52 |
ui->setupUi(this);
|
53 |
53 |
|
... | ... | |
111 |
111 |
ui->lwPictures->setDropIndicatorShown(true);
|
112 |
112 |
}
|
113 |
113 |
|
114 |
|
original::~original()
|
|
114 |
WebAlbumPhoto::~WebAlbumPhoto()
|
115 |
115 |
{
|
116 |
116 |
delete ui;
|
117 |
117 |
}
|
118 |
118 |
|
119 |
|
void original::on_action_Nouvel_album_triggered()
|
|
119 |
void WebAlbumPhoto::on_action_Nouvel_album_triggered()
|
120 |
120 |
{
|
121 |
121 |
m_currentProjectPictureNumber = 0;
|
122 |
122 |
bool ok;
|
... | ... | |
139 |
139 |
|
140 |
140 |
}
|
141 |
141 |
|
142 |
|
void original::on_treeWidget_itemClicked(QTreeWidgetItem *item, int column)
|
|
142 |
void WebAlbumPhoto::on_treeWidget_itemClicked(QTreeWidgetItem *item, int column)
|
143 |
143 |
{
|
144 |
144 |
QFileInfo fi(ui->treeWidget->currentItem()->data(1,0).toString()+"/info.txt");
|
145 |
145 |
qDebug() << "Lecture de " << fi.absoluteFilePath();
|
... | ... | |
192 |
192 |
qDebug() << "Espace de stockage du projet " << m_currentProjectDir;
|
193 |
193 |
}
|
194 |
194 |
|
195 |
|
void original::on_btnSave_clicked()
|
|
195 |
void WebAlbumPhoto::on_btnSave_clicked()
|
196 |
196 |
{
|
197 |
197 |
QByteArray data;
|
198 |
198 |
data.append(QString("name|%1\n").arg(ui->leTitre->text().trimmed()));
|
... | ... | |
215 |
215 |
}
|
216 |
216 |
|
217 |
217 |
|
218 |
|
void original::on_treeWidget_customContextMenuRequested(const QPoint &pos)
|
|
218 |
void WebAlbumPhoto::on_treeWidget_customContextMenuRequested(const QPoint &pos)
|
219 |
219 |
{
|
220 |
220 |
m_menu->exec(ui->treeWidget->mapToGlobal(pos));
|
221 |
221 |
}
|
222 |
222 |
|
223 |
|
void original::dragEnterEvent(QDragEnterEvent *event)
|
|
223 |
void WebAlbumPhoto::dragEnterEvent(QDragEnterEvent *event)
|
224 |
224 |
{
|
225 |
225 |
if (event->mimeData()->hasUrls())
|
226 |
226 |
{
|
... | ... | |
232 |
232 |
}
|
233 |
233 |
}
|
234 |
234 |
|
235 |
|
void original::dropEvent(QDropEvent *event)
|
|
235 |
void WebAlbumPhoto::dropEvent(QDropEvent *event)
|
236 |
236 |
{
|
237 |
237 |
qDebug() << "Accepte le drop d'une image";
|
238 |
238 |
|
... | ... | |
255 |
255 |
}
|
256 |
256 |
}
|
257 |
257 |
|
258 |
|
void original::addPictureToProject(QString fic)
|
|
258 |
void WebAlbumPhoto::addPictureToProject(QString fic)
|
259 |
259 |
{
|
260 |
260 |
ui->statusBar->clearMessage();
|
261 |
261 |
ui->statusBar->showMessage(trUtf8("Fichier en cours: %1").arg(fic),3000);
|
... | ... | |
379 |
379 |
refreshPictureList();
|
380 |
380 |
}
|
381 |
381 |
|
382 |
|
void original::refreshPictureList()
|
|
382 |
void WebAlbumPhoto::refreshPictureList()
|
383 |
383 |
{
|
384 |
384 |
QTreeWidgetItem *item = ui->treeWidget->currentItem();
|
385 |
385 |
ui->lwPictures->clear();
|
... | ... | |
414 |
414 |
m_currentProjectPictureNumber = currentProjectPictureNumber+1;
|
415 |
415 |
}
|
416 |
416 |
|
417 |
|
void original::on_btnUpload_clicked()
|
|
417 |
void WebAlbumPhoto::on_btnUpload_clicked()
|
418 |
418 |
{
|
419 |
419 |
qDebug() << "on_btnUpload_clicked : " << ui->treeWidget->currentItem()->data(1,0).toString();
|
420 |
420 |
|
... | ... | |
452 |
452 |
connect(m_tools, SIGNAL(signalUploadData(int,int)), this, SLOT(updateProgressData(int,int)));
|
453 |
453 |
}
|
454 |
454 |
|
455 |
|
void original::on_action_Assistant_d_installation_triggered()
|
|
455 |
void WebAlbumPhoto::on_action_Assistant_d_installation_triggered()
|
456 |
456 |
{
|
457 |
457 |
Assistant *a = new Assistant(this);
|
458 |
458 |
a->show();
|
459 |
459 |
}
|
460 |
460 |
|
461 |
|
void original::updateProgressFichier(int total, int current, QString fileName)
|
|
461 |
void WebAlbumPhoto::updateProgressFichier(int total, int current, QString fileName)
|
462 |
462 |
{
|
463 |
463 |
ui->pbFTPFichier->setMaximum(total);
|
464 |
464 |
ui->pbFTPFichier->setValue(current);
|
465 |
465 |
ui->textBrowser->append(fileName + "\n");
|
466 |
466 |
}
|
467 |
467 |
|
468 |
|
void original::updateProgressData(int total, int current)
|
|
468 |
void WebAlbumPhoto::updateProgressData(int total, int current)
|
469 |
469 |
{
|
470 |
470 |
ui->pbFTPProgress->setMaximum(total);
|
471 |
471 |
ui->pbFTPProgress->setValue(current);
|
472 |
472 |
}
|
473 |
473 |
|
474 |
|
void original::makeZip(QString repSource, QString destFileName)
|
|
474 |
void WebAlbumPhoto::makeZip(QString repSource, QString destFileName)
|
475 |
475 |
{
|
476 |
476 |
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
|
477 |
477 |
ui->statusBar->showMessage(QString::fromUtf8("Création du fichier ZIP %1 en cours").arg(destFileName), 5000);
|
478 |
478 |
qApp->processEvents();
|
479 |
|
qDebug() << "original::makeZip " << repSource << " :: " << destFileName;
|
|
479 |
qDebug() << "WebAlbumPhoto::makeZip " << repSource << " :: " << destFileName;
|
480 |
480 |
//Creation d'une archive ZIP dans tous les cas
|
481 |
481 |
QuaZip zipDestination(destFileName);
|
482 |
482 |
if(zipDestination.open(QuaZip::mdCreate)) {
|
... | ... | |
509 |
509 |
QApplication::restoreOverrideCursor();
|
510 |
510 |
}
|
511 |
511 |
|
512 |
|
void original::uploadEnd()
|
|
512 |
void WebAlbumPhoto::uploadEnd()
|
513 |
513 |
{
|
514 |
514 |
ui->textBrowser->append(trUtf8("Téléchargement terminé\n"));
|
515 |
515 |
}
|