Commit 79ed43dd authored by mbriand's avatar mbriand

gestion photographe et licence + trad

parent 5320e828
......@@ -2,7 +2,22 @@
UBPT Transfert 2
Copyright (C) 2005 Julien Etelain. Tous droits réservés.. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Copyright (C) 2005 Julien Etelain. Tous droits réservés..
Copyright (C) 2011 Mathieu Briand.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef ADDDIALOG_H
......@@ -28,6 +43,8 @@ public slots:
void selectDirName();
void currentItemChange ( QTreeWidgetItem * current, QTreeWidgetItem * previous );
void enqueueRequested();
void enableClubComboBox(int state);
void enableUserLineEdit(int state);
private:
......
......@@ -2,7 +2,22 @@
UBPT Transfert 2
Copyright (C) 2005 Julien Etelain. Tous droits réservés.. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Copyright (C) 2005 Julien Etelain. Tous droits réservés..
Copyright (C) 2011 Mathieu Briand.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef MAINWINDOW_H
......@@ -26,6 +41,10 @@ typedef struct transfertItem
int contextId;
int rights;
QString group;
int photographerUserId;
QString club;
QString licence;
QString comment;
enum itemType { Photo, Video };
......@@ -36,7 +55,7 @@ typedef struct transfertItem
class transfertTreeItem : public QTreeWidgetItem
{
public:
transfertTreeItem( QString Name, QString FileName, QString ContextName, int ContextId,int Rights, QString Group, QTreeWidget *parent, transfertItem::itemType t = transfertItem::Photo );
transfertTreeItem( QString Name, QString FileName, QString ContextName, int ContextId,int Rights, QString Group, int photographerUserId, QString Club, QString Licence, QString comment, QTreeWidget *parent, transfertItem::itemType t = transfertItem::Photo );
transfertTreeItem( transfertItem transfert, QTreeWidget *parent );
transfertItem transfert;
......@@ -58,8 +77,8 @@ public:
UbptSession session;
void switchMode ( int Mode );
void addFileToQueue ( const QString & name, const QString & fileName, const QString & contextName, int contextId, int rights, const QString & group );
void addVideoFileToQueue ( const QString & name, const QString & fileName, const QString & contextName, int contextId, int rights, const QString & group );
void addFileToQueue ( const QString & name, const QString & fileName, const QString & contextName, int contextId, int rights, const QString & group, int photographerUserId, QString club, QString licence, QString comment );
void addVideoFileToQueue ( const QString & name, const QString & fileName, const QString & contextName, int contextId, int rights, const QString & group, int photographerUserId, QString club, QString licence, QString comment );
Ui::MainWindow ui;
protected:
......
......@@ -3,6 +3,7 @@
UBPT Transfert 2
Copyright (C) 2005,2006 Julien Etelain. Tous droits réservés..
Copyright (C) 2011 Mathieu Briand.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
......@@ -31,6 +32,7 @@
#define PROTOCOL_H
#include<QStringList>
#include<QMap>
#include <curl/curl.h>
/* In recent version of libcurl, this include doesn't exist anymore, uncomment if it breaks build for you
......@@ -67,19 +69,24 @@ public:
QString Name;
QString Message;
QString Url;
int userId;
QStringList Domains;
QList<UbptContext*> Contexts;
QStringList UserGroups;
QMap<QString, int> Clubs;
QMap<QString, int> Licences;
int ConnectToServer ( QString url );
int OpenSession ( QString userName, QString passWord, int domain );
int FetchUserGroups();
int FetchClubs();
int FetchLicences();
int FetchContexts();
int UploadImage ( int contextId, QString description, QString photograph, int rights, QString group, QString file );
int UploadVideoFlv ( int contextId, QString description, QString photograph, int rights, QString group, QString fileImage, QString fileVideo );
int UploadImage ( int contextId, int rights, QString group, int photographerUserId, int clubId, int licenceId, QString comment, QString file );
int UploadVideoFlv ( int contextId, int rights, QString group, int photographerUserId, int clubId, int licenceId, QString comment, QString fileImage, QString fileVideo );
int SetProgress( curl_progress_callback func, void *clientp );
......
No preview for this file type
This diff is collapsed.
......@@ -3,6 +3,7 @@
UBPT Transfert 2
Copyright (C) 2005-2007 Julien Etelain. Tous droits réservés..
Copyright (C) 2011 Mathieu Briand.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
......@@ -26,6 +27,7 @@
#include <QtCore>
#include <QtXml>
#include <QDebug>
#include <iostream>
/** @defgroup ubptprococol
@{
......@@ -232,6 +234,7 @@ int UbptSession::OpenSession ( QString userName, QString passWord, int domain )
} else {
sessionId = root.firstChildElement("sessionid").text();
userId = root.firstChildElement("userid").text().toInt();
}
......@@ -306,6 +309,129 @@ int UbptSession::FetchUserGroups ( )
return result;
}
/**
Fetch clubs from server.
Session must be open.
@return error code (ERR_UBPT_xxxx)
*/
int UbptSession::FetchClubs ( )
{
int result = ERR_UBPT_NONE,res;
struct curl_httppost *formpost=NULL;
struct curl_httppost *lastptr=NULL;
MemoryCollect chunk;
if ( !connected ) return ERR_UBPT_NOTCONNECTED;
if ( sessionId.isEmpty() ) return ERR_UBPT_SESSIONREQUIRED;
InitMemoryCollect(&chunk);
curl_formadd(&formpost,&lastptr,
CURLFORM_COPYNAME, "act",
CURLFORM_COPYCONTENTS, "FetchClubs",
CURLFORM_END);
curl_formadd(&formpost,&lastptr,
CURLFORM_COPYNAME, "SessionId",
CURLFORM_COPYCONTENTS, sessionId.toLatin1().data(),
CURLFORM_END);
curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&chunk);
Clubs.clear();
res = curl_easy_perform(curl);
if ( res || !chunk.memory )
result = ERR_UBPT_NOCONNECTION;
else {
QDomDocument doc("UBPTExchange");
if (doc.setContent(QString::fromUtf8(chunk.memory))) {
QDomElement root = doc.documentElement();
QDomElement child = root.firstChildElement("club");
while (!child.isNull()) {
Clubs.insert(child.text(), child.attribute("gid").toInt());
child = child.nextSiblingElement("club");
}
} else
result = ERR_SYSTEMERROR;
}
if ( chunk.memory ) free(chunk.memory);
curl_formfree(formpost);
return result;
}
/**
Fetch licences from server.
Session must be open.
@return error code (ERR_UBPT_xxxx)
*/
int UbptSession::FetchLicences ( )
{
int result = ERR_UBPT_NONE,res;
struct curl_httppost *formpost=NULL;
struct curl_httppost *lastptr=NULL;
MemoryCollect chunk;
if ( !connected ) return ERR_UBPT_NOTCONNECTED;
if ( sessionId.isEmpty() ) return ERR_UBPT_SESSIONREQUIRED;
InitMemoryCollect(&chunk);
curl_formadd(&formpost,&lastptr,
CURLFORM_COPYNAME, "act",
CURLFORM_COPYCONTENTS, "FetchLicences",
CURLFORM_END);
curl_formadd(&formpost,&lastptr,
CURLFORM_COPYNAME, "SessionId",
CURLFORM_COPYCONTENTS, sessionId.toLatin1().data(),
CURLFORM_END);
curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&chunk);
Licences.clear();
res = curl_easy_perform(curl);
if ( res || !chunk.memory )
result = ERR_UBPT_NOCONNECTION;
else {
QDomDocument doc("UBPTExchange");
std::cout << qPrintable(QString::fromUtf8(chunk.memory)) << std::endl;
if (doc.setContent(QString::fromUtf8(chunk.memory))) {
QDomElement root = doc.documentElement();
QDomElement child = root.firstChildElement("licence");
while (!child.isNull()) {
Licences.insert(child.text(), child.attribute("gid").toInt());
child = child.nextSiblingElement("licence");
}
} else
result = ERR_SYSTEMERROR;
}
if ( chunk.memory ) free(chunk.memory);
curl_formfree(formpost);
return result;
}
/**
Fetch contexts from server
Session must be open.
......@@ -382,14 +508,16 @@ int UbptSession::FetchContexts ( )
Upload an image to current server
Session must be open.
@param contextId if of the context
@param description description of the photo
@param photograph name of the person who took the photo
@param rights acess rights to the photo
@param group group linked with acess rights
@param photographerUserId id of photographer
@param club club designed as photographer
@param licence image licence
@param comment comment on photo
@param file local path to file to upload
@return error code (ERR_UBPT_xxxx)
*/
int UbptSession::UploadImage ( int contextId, QString description, QString photograph, int rights, QString group, QString file )
int UbptSession::UploadImage ( int contextId, int rights, QString group, int photographerUserId, int clubId, int licenceId, QString comment, QString file )
{
int result = ERR_UBPT_NONE,res;
struct curl_httppost *formpost=NULL;
......@@ -432,13 +560,23 @@ int UbptSession::UploadImage ( int contextId, QString description, QString photo
CURLFORM_END);
curl_formadd(&formpost, &lastptr,
CURLFORM_COPYNAME, "Description",
CURLFORM_COPYCONTENTS, description.toLatin1().data(),
CURLFORM_COPYNAME, "PhotographerUserId",
CURLFORM_COPYCONTENTS, QString::number(photographerUserId).toLatin1().data(),
CURLFORM_END);
curl_formadd(&formpost, &lastptr,
CURLFORM_COPYNAME, "AssoId",
CURLFORM_COPYCONTENTS, QString::number(clubId).toLatin1().data(),
CURLFORM_END);
curl_formadd(&formpost, &lastptr,
CURLFORM_COPYNAME, "Photograph",
CURLFORM_COPYCONTENTS, photograph.toLatin1().data(),
CURLFORM_COPYNAME, "id_licence",
CURLFORM_COPYCONTENTS, QString::number(licenceId).toLatin1().data(),
CURLFORM_END);
curl_formadd(&formpost, &lastptr,
CURLFORM_COPYNAME, "Comment",
CURLFORM_COPYCONTENTS, comment.toLatin1().data(),
CURLFORM_END);
curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost);
......@@ -476,15 +614,17 @@ int UbptSession::UploadImage ( int contextId, QString description, QString photo
Upload an image to current server
Session must be open.
@param contextId if of the context
@param description description of the photo
@param photograph name of the person who took the photo
@param rights acess rights to the photo
@param group group linked with acess rights
@param photographerUserId id of photographer
@param club club designed as photographer
@param licence image licence
@param comment comment on photo
@param fileImage local path to an image of video to upload
@param fileVideo local path to video to upload
@return error code (ERR_UBPT_xxxx)
*/
int UbptSession::UploadVideoFlv ( int contextId, QString description, QString photograph, int rights, QString group, QString fileImage, QString fileVideo )
int UbptSession::UploadVideoFlv ( int contextId, int rights, QString group, int photographerUserId, int clubId, int licenceId, QString comment, QString fileImage, QString fileVideo )
{
int result = ERR_UBPT_NONE,res;
struct curl_httppost *formpost=NULL;
......@@ -532,13 +672,23 @@ int UbptSession::UploadVideoFlv ( int contextId, QString description, QString ph
CURLFORM_END);
curl_formadd(&formpost, &lastptr,
CURLFORM_COPYNAME, "Description",
CURLFORM_COPYCONTENTS, description.toLatin1().data(),
CURLFORM_COPYNAME, "PhotographerUserId",
CURLFORM_COPYCONTENTS, QString::number(photographerUserId).toLatin1().data(),
CURLFORM_END);
curl_formadd(&formpost, &lastptr,
CURLFORM_COPYNAME, "AssoId",
CURLFORM_COPYCONTENTS, QString::number(clubId).toLatin1().data(),
CURLFORM_END);
curl_formadd(&formpost, &lastptr,
CURLFORM_COPYNAME, "id_licence",
CURLFORM_COPYCONTENTS, QString::number(licenceId).toLatin1().data(),
CURLFORM_END);
curl_formadd(&formpost, &lastptr,
CURLFORM_COPYNAME, "Photograph",
CURLFORM_COPYCONTENTS, photograph.toLatin1().data(),
CURLFORM_COPYNAME, "Comment",
CURLFORM_COPYCONTENTS, comment.toLatin1().data(),
CURLFORM_END);
curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost);
......
......@@ -3,6 +3,7 @@
UBPT Transfert 2
Copyright (C) 2005 Julien Etelain. Tous droits réservés..
Copyright (C) 2011 Mathieu Briand.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
......@@ -78,8 +79,11 @@ addDialog::addDialog(MainWindow *win ,QWidget *parent)
session = &(mainwin->session);
ui.setupUi(this);
initLists();
ui.userLineEdit->setText(QString::number(session->userId));
ui.okButton->setEnabled(false);
ui.clubComboBox->setEnabled(false);
ui.userLineEdit->setEnabled(false);
connect(ui.fileToolButton, SIGNAL(clicked()), this, SLOT(selectFileName()));
connect(ui.dirToolButton, SIGNAL(clicked()), this, SLOT(selectDirName()));
......@@ -87,7 +91,8 @@ addDialog::addDialog(MainWindow *win ,QWidget *parent)
connect(ui.treeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem *,QTreeWidgetItem *)), this, SLOT(currentItemChange(QTreeWidgetItem *,QTreeWidgetItem *)));
connect(ui.okButton, SIGNAL(clicked()), this, SLOT(enqueueRequested()));
connect(ui.clubCheckBox, SIGNAL(stateChanged(int)), this, SLOT(enableClubComboBox(int)));
connect(ui.userCheckBox, SIGNAL(stateChanged(int)), this, SLOT(enableUserLineEdit(int)));
}
void addDialog::initLists()
......@@ -111,6 +116,18 @@ void addDialog::initLists()
ui.groupComboBox->addItem(session->UserGroups.at(i));
}
QMap<QString, int>::iterator mapIter = session->Clubs.begin();
while (mapIter != session->Clubs.end())
{
ui.clubComboBox->addItem(mapIter.key());
++mapIter;
}
mapIter = session->Licences.begin();
while (mapIter != session->Licences.end())
{
ui.licenceComboBox->addItem(mapIter.key());
++mapIter;
}
}
void addDialog::processCtx ( contextTreeItem *item, UbptContext *ctx )
......@@ -158,8 +175,17 @@ void addDialog::enqueueRequested()
int rights = 0xF10;
int contextId = 0;
QString group = ui.groupComboBox->currentText();
QString club = "";
int user = 0;
QString licence = ui.licenceComboBox->currentText();
QString comment = ui.commentTextEdit->toPlainText();
QString contextName;
if (ui.userCheckBox->isChecked())
user = ui.userLineEdit->text().toInt();
if (ui.clubCheckBox->isChecked())
club = ui.clubComboBox->currentText();
if ( ui.allConnectedRadioButton->isChecked() )
rights |= 1;
......@@ -180,9 +206,9 @@ void addDialog::enqueueRequested()
QString ext = fileInfo.suffix();
if ( ext.toLower() == "jpg" || ext.toLower() == "png" )
mainwin->addFileToQueue(fileInfo.fileName(),fileInfo.filePath(),contextName,contextId,rights,group);
mainwin->addFileToQueue(fileInfo.fileName(),fileInfo.filePath(),contextName,contextId,rights,group,user,club,licence,comment);
else if ( ext.toLower() == "avi" || ext.toLower() == "mpg" || ext.toLower() == "mov" || ext.toLower() == "flv" )
mainwin->addVideoFileToQueue(fileInfo.fileName(),fileInfo.filePath(),contextName,contextId,rights,group);
mainwin->addVideoFileToQueue(fileInfo.fileName(),fileInfo.filePath(),contextName,contextId,rights,group,user,club,licence,comment);
......@@ -202,15 +228,24 @@ void addDialog::enqueueRequested()
QFileInfo fileInfo = list.at(i);
QString ext = fileInfo.suffix();
if ( ext.toLower() == "jpg" || ext.toLower() == "png" )
mainwin->addFileToQueue(fileInfo.fileName(),fileInfo.filePath(),contextName,contextId,rights,group);
mainwin->addFileToQueue(fileInfo.fileName(),fileInfo.filePath(),contextName,contextId,rights,group,user,club,licence,comment);
else if ( ext.toLower() == "avi" || ext.toLower() == "mpg" || ext.toLower() == "mov" )
mainwin->addVideoFileToQueue(fileInfo.fileName(),fileInfo.filePath(),contextName,contextId,rights,group);
mainwin->addVideoFileToQueue(fileInfo.fileName(),fileInfo.filePath(),contextName,contextId,rights,group,user,club,licence,comment);
}
}
done(1);
}
void addDialog::enableClubComboBox(int state)
{
ui.clubComboBox->setEnabled(state);
}
void addDialog::enableUserLineEdit(int state)
{
ui.userLineEdit->setEnabled(state);
}
void addDialog::on_cancelButton_clicked()
{
......
......@@ -3,6 +3,7 @@
UBPT Transfert 2
Copyright (C) 2005 Julien Etelain. Tous droits réservés..
Copyright (C) 2011 Mathieu Briand.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
......@@ -129,7 +130,7 @@ int connectDialog::connectToUBPT()
}
ui.connectProgress->setValue(50);
ui.connectInfo->setText(tr("Loading groups..."));
ui.connectInfo->setText(tr("Loading groups, clubs and licences..."));
repaint();
QCoreApplication::processEvents();
......@@ -138,6 +139,16 @@ int connectDialog::connectToUBPT()
enableMode(2);
return 0;
}
if ( (err = session->FetchClubs()) ) {
ui.connectInfo->setText(tr("Error %1").arg(err));
enableMode(2);
return 0;
}
if ( (err = session->FetchLicences()) ) {
ui.connectInfo->setText(tr("Error %1").arg(err));
enableMode(2);
return 0;
}
ui.connectProgress->setValue(75);
ui.connectInfo->setText(tr("Loading categories..."));
repaint();
......
......@@ -3,6 +3,7 @@
UBPT Transfert 2
Copyright (C) 2005 Julien Etelain. Tous droits réservés..
Copyright (C) 2011 Mathieu Briand.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
......@@ -48,7 +49,7 @@ transfertTreeItem::transfertTreeItem( transfertItem transfert, QTreeWidget *pare
}
transfertTreeItem::transfertTreeItem( QString Name, QString FileName, QString ContextName, int ContextId,int Rights, QString Group, QTreeWidget *parent, transfertItem::itemType t )
transfertTreeItem::transfertTreeItem( QString Name, QString FileName, QString ContextName, int ContextId,int Rights, QString Group, int photographerUserId, QString Club, QString Licence, QString comment, QTreeWidget *parent, transfertItem::itemType t )
: QTreeWidgetItem(parent)
{
......@@ -58,6 +59,10 @@ transfertTreeItem::transfertTreeItem( QString Name, QString FileName, QString Co
transfert.contextId = ContextId;
transfert.rights = Rights;
transfert.group = Group;
transfert.photographerUserId = photographerUserId;
transfert.club = Club;
transfert.licence = Licence;
transfert.comment = comment;
transfert.type = t;
state = ToDo;
......@@ -123,6 +128,26 @@ void MainWindow::writeList()
t = doc.createTextNode(Item->transfert.group);
stag.appendChild(t);
stag = doc.createElement("photographerUserId");
tag.appendChild(stag);
t = doc.createTextNode(QString::number(Item->transfert.photographerUserId));
stag.appendChild(t);
stag = doc.createElement("club");
tag.appendChild(stag);
t = doc.createTextNode(Item->transfert.club);
stag.appendChild(t);
stag = doc.createElement("licence");
tag.appendChild(stag);
t = doc.createTextNode(Item->transfert.licence);
stag.appendChild(t);
stag = doc.createElement("comment");
tag.appendChild(stag);
t = doc.createTextNode(Item->transfert.comment);
stag.appendChild(t);
stag = doc.createElement("contextId");
tag.appendChild(stag);
str.setNum(Item->transfert.contextId);
......@@ -195,12 +220,20 @@ void MainWindow::readElement( const QDomElement &element )
transfert.contextId = 0;
transfert.rights = 0;
transfert.group = "";
transfert.photographerUserId = 0;
transfert.club = "";
transfert.licence = "";
transfert.comment = "";
transfert.type = transfertItem::Photo;
transfert.name = element.firstChildElement("name").text();
transfert.fileName = element.firstChildElement("fileName").text();
transfert.contextName = element.firstChildElement("contextName").text();
transfert.group = element.firstChildElement("group").text();
transfert.photographerUserId = element.firstChildElement("photographerUserId").text().toInt();
transfert.club = element.firstChildElement("club").text();
transfert.licence = element.firstChildElement("licence").text();
transfert.comment = element.firstChildElement("comment").text();
QString contextId = element.firstChildElement("contextId").text();
QString rights = element.firstChildElement("rights").text();
......@@ -216,6 +249,7 @@ void MainWindow::readElement( const QDomElement &element )
!transfert.fileName.isEmpty() &&
!transfert.contextName.isEmpty() &&
!transfert.group.isEmpty() &&
!transfert.licence.isEmpty() &&
transfert.contextId &&
transfert.rights )
......@@ -310,16 +344,16 @@ void MainWindow::about()
"<i>Powered by libcurl, Qt4, ffmpeg</i>"));
}
void MainWindow::addFileToQueue ( const QString & name, const QString & fileName, const QString & contextName, int contextId, int rights, const QString & group )
void MainWindow::addFileToQueue ( const QString & name, const QString & fileName, const QString & contextName, int contextId, int rights, const QString & group, int photographerUserId, QString club, QString licence, QString comment )
{
new transfertTreeItem(name,fileName,contextName,contextId,rights,group,ui.treeWidget,transfertItem::Photo);
new transfertTreeItem(name,fileName,contextName,contextId,rights,group,photographerUserId,club,licence,comment,ui.treeWidget,transfertItem::Photo);
}
void MainWindow::addVideoFileToQueue ( const QString & name, const QString & fileName, const QString & contextName, int contextId, int rights, const QString & group )
void MainWindow::addVideoFileToQueue ( const QString & name, const QString & fileName, const QString & contextName, int contextId, int rights, const QString & group, int photographerUserId, QString club, QString licence, QString comment )
{
new transfertTreeItem(name,fileName,contextName,contextId,rights,group,ui.treeWidget,transfertItem::Video);
new transfertTreeItem(name,fileName,contextName,contextId,rights,group,photographerUserId,club,licence,comment,ui.treeWidget,transfertItem::Video);
}
void MainWindow::createActions()
......
......@@ -47,6 +47,9 @@ void UploadThread::run()
current->UBPTError = 0;
int licenceId = session->Licences[current->transfert.licence];
int clubId = session->Clubs[current->transfert.club];
if ( current->transfert.type == transfertItem::Video )
{
qDebug("video");
......@@ -118,7 +121,7 @@ void UploadThread::run()
if ( current->UBPTError == ERR_UBPT_NONE )
{
current->state = transfertTreeItem::Transfert;
current->UBPTError = session->UploadVideoFlv ( current->transfert.contextId, "", "", current->transfert.rights, current->transfert.group, tempImg, tempFlv );
current->UBPTError = session->UploadVideoFlv ( current->transfert.contextId, current->transfert.rights, current->transfert.group, current->transfert.photographerUserId, clubId, licenceId, current->transfert.comment, tempImg, tempFlv );
QFile::remove(tempImg);
if ( delTempFlv )
......@@ -130,7 +133,7 @@ void UploadThread::run()
qDebug("photo");
current->state = transfertTreeItem::Transfert;
current->UBPTError = session->UploadImage ( current->transfert.contextId, "", "", current->transfert.rights, current->transfert.group, current->transfert.fileName );
current->UBPTError = session->UploadImage ( current->transfert.contextId, current->transfert.rights, current->transfert.group, current->transfert.photographerUserId, clubId, licenceId, current->transfert.comment, current->transfert.fileName );
}
if ( !current->UBPTError )
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment