Commit 79ed43dd authored by mbriand's avatar mbriand

gestion photographe et licence + trad

parent 5320e828
/* /*
UBPT Transfert 2 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 #ifndef ADDDIALOG_H
...@@ -21,19 +36,21 @@ class addDialog : public QDialog ...@@ -21,19 +36,21 @@ class addDialog : public QDialog
public: public:
addDialog( MainWindow *win, QWidget *parent = 0); addDialog( MainWindow *win, QWidget *parent = 0);
public slots: public slots:
void on_cancelButton_clicked(); void on_cancelButton_clicked();
void selectFileName(); void selectFileName();
void selectDirName(); void selectDirName();
void currentItemChange ( QTreeWidgetItem * current, QTreeWidgetItem * previous ); void currentItemChange ( QTreeWidgetItem * current, QTreeWidgetItem * previous );
void enqueueRequested(); void enqueueRequested();
void enableClubComboBox(int state);
void enableUserLineEdit(int state);
private: private:
Ui::addDialog ui; Ui::addDialog ui;
UbptSession *session; UbptSession *session;
void initLists(); void initLists();
MainWindow *mainwin; MainWindow *mainwin;
void processCtx ( contextTreeItem *item, UbptContext *ctx ); void processCtx ( contextTreeItem *item, UbptContext *ctx );
}; };
...@@ -43,8 +60,8 @@ class contextTreeItem : public QTreeWidgetItem ...@@ -43,8 +60,8 @@ class contextTreeItem : public QTreeWidgetItem
public: public:
contextTreeItem( QTreeWidgetItem * parent, UbptContext *pCtx ); contextTreeItem( QTreeWidgetItem * parent, UbptContext *pCtx );
contextTreeItem( QTreeWidget * parent, UbptContext *pCtx ); contextTreeItem( QTreeWidget * parent, UbptContext *pCtx );
UbptContext *Ctx; UbptContext *Ctx;
}; };
#endif #endif
\ No newline at end of file
/* /*
UBPT Transfert 2 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 #ifndef MAINWINDOW_H
...@@ -18,35 +33,39 @@ ...@@ -18,35 +33,39 @@
typedef struct transfertItem typedef struct transfertItem
{ {
public: public:
QString name; QString name;
QString fileName; QString fileName;
QString contextName; QString contextName;
int contextId; int contextId;
int rights; int rights;
QString group; QString group;
int photographerUserId;
QString club;
QString licence;
QString comment;
enum itemType { Photo, Video }; enum itemType { Photo, Video };
itemType type; itemType type;
} transfertItem; } transfertItem;
class transfertTreeItem : public QTreeWidgetItem class transfertTreeItem : public QTreeWidgetItem
{ {
public: 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 ); transfertTreeItem( transfertItem transfert, QTreeWidget *parent );
transfertItem transfert; transfertItem transfert;
enum transfertState { ToDo, Encoding, Transfert, Sucess, Error }; enum transfertState { ToDo, Encoding, Transfert, Sucess, Error };
transfertState state; transfertState state;
int UBPTError; int UBPTError;
}; };
class MainWindow : public QMainWindow class MainWindow : public QMainWindow
...@@ -57,14 +76,14 @@ public: ...@@ -57,14 +76,14 @@ public:
MainWindow(QWidget *parent = 0); MainWindow(QWidget *parent = 0);
UbptSession session; UbptSession session;
void switchMode ( int Mode ); void switchMode ( int Mode );
void addFileToQueue ( 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 ); 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; Ui::MainWindow ui;
protected: protected:
void closeEvent(QCloseEvent *event); void closeEvent(QCloseEvent *event);
public slots: public slots:
void about(); void about();
void openAdd(); void openAdd();
...@@ -72,17 +91,17 @@ public slots: ...@@ -72,17 +91,17 @@ public slots:
void processPhotos(); void processPhotos();
void stopPhotos(); void stopPhotos();
void uploaded(transfertTreeItem *Item); void uploaded(transfertTreeItem *Item);
void progress(transfertTreeItem *Item, int precent); void progress(transfertTreeItem *Item, int precent);
void resetStatesAndRemoveDone(); void resetStatesAndRemoveDone();
void removeAll(); void removeAll();
void removeSelection(); void removeSelection();
private: private:
void createActions(); void createActions();
void createMenus(); void createMenus();
void createToolBars(); void createToolBars();
void writeList(); void writeList();
void readList(); void readList();
void readElement( const QDomElement &element ); void readElement( const QDomElement &element );
...@@ -95,26 +114,26 @@ private: ...@@ -95,26 +114,26 @@ private:
QAction *cleanupResetAct; QAction *cleanupResetAct;
QAction *removeAllAct; QAction *removeAllAct;
QAction *removeSelectionAct; QAction *removeSelectionAct;
QMenu *fileMenu; QMenu *fileMenu;
QMenu *photosMenu; QMenu *photosMenu;
QMenu *helpMenu; QMenu *helpMenu;
QToolBar *fileToolBar; QToolBar *fileToolBar;
QToolBar *photosToolBar; QToolBar *photosToolBar;
QTreeWidgetItem *rootItem; QTreeWidgetItem *rootItem;
void uploadItem (transfertTreeItem *Item ); void uploadItem (transfertTreeItem *Item );
void nextItem (); void nextItem ();
bool stop; bool stop;
QTime listTime; QTime listTime;
QTime itemTime; QTime itemTime;
int itemsDone; int itemsDone;
void refreshRemaingInfo (); void refreshRemaingInfo ();
int countRemainingItems (); int countRemainingItems ();
UploadThread upthread; UploadThread upthread;
}; };
......
/* /*
UBPT Transfert 2 UBPT Transfert 2
Copyright (C) 2005,2006 Julien Etelain. Tous droits réservés.. 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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2 as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version. of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/ */
/** /**
@addtogroup ubptprococol @addtogroup ubptprococol
@{ @{
*/ */
...@@ -31,6 +32,7 @@ ...@@ -31,6 +32,7 @@
#define PROTOCOL_H #define PROTOCOL_H
#include<QStringList> #include<QStringList>
#include<QMap>
#include <curl/curl.h> #include <curl/curl.h>
/* In recent version of libcurl, this include doesn't exist anymore, uncomment if it breaks build for you /* In recent version of libcurl, this include doesn't exist anymore, uncomment if it breaks build for you
...@@ -43,7 +45,7 @@ ...@@ -43,7 +45,7 @@
class UbptContext class UbptContext
{ {
public: public:
QString Name; QString Name;
int Id; int Id;
int IdParent; int IdParent;
...@@ -67,19 +69,24 @@ public: ...@@ -67,19 +69,24 @@ public:
QString Name; QString Name;
QString Message; QString Message;
QString Url; QString Url;
int userId;
QStringList Domains; QStringList Domains;
QList<UbptContext*> Contexts; QList<UbptContext*> Contexts;
QStringList UserGroups; QStringList UserGroups;
QMap<QString, int> Clubs;
QMap<QString, int> Licences;
int ConnectToServer ( QString url ); int ConnectToServer ( QString url );
int OpenSession ( QString userName, QString passWord, int domain ); int OpenSession ( QString userName, QString passWord, int domain );
int FetchUserGroups(); int FetchUserGroups();
int FetchClubs();
int FetchLicences();
int FetchContexts(); int FetchContexts();
int UploadImage ( int contextId, QString description, QString photograph, int rights, QString group, QString file ); int UploadImage ( int contextId, int rights, QString group, int photographerUserId, int clubId, int licenceId, QString comment, QString file );
int UploadVideoFlv ( int contextId, QString description, QString photograph, int rights, QString group, QString fileImage, QString fileVideo ); 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 ); int SetProgress( curl_progress_callback func, void *clientp );
...@@ -102,8 +109,8 @@ private: ...@@ -102,8 +109,8 @@ private:
// Error in connectivity // Error in connectivity
#define ERR_UBPT_NOCONNECTION -1 #define ERR_UBPT_NOCONNECTION -1
// Other errors // Other errors
#define ERR_UBPT_USERNAMEORPASSWORD 10 #define ERR_UBPT_USERNAMEORPASSWORD 10
#define ERR_UBPT_NEEDTOUPDATE 11 #define ERR_UBPT_NEEDTOUPDATE 11
#define ERR_UBPT_INVALIDIMAGEFILE 3 #define ERR_UBPT_INVALIDIMAGEFILE 3
......
No preview for this file type
This diff is collapsed.
This diff is collapsed.
/* /*
UBPT Transfert 2 UBPT Transfert 2
Copyright (C) 2005 Julien Etelain. Tous droits réservés.. 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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2 as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version. of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
...@@ -47,28 +48,28 @@ void addDialog::currentItemChange ( QTreeWidgetItem * current, QTreeWidgetItem * ...@@ -47,28 +48,28 @@ void addDialog::currentItemChange ( QTreeWidgetItem * current, QTreeWidgetItem *
if ( item ) { if ( item ) {
int i = 0; int i = 0;
if ( item->Ctx->Rights & 1 ) if ( item->Ctx->Rights & 1 )
ui.allConnectedRadioButton->setChecked(true); ui.allConnectedRadioButton->setChecked(true);
else else
ui.limitGroupRadioButton->setChecked(true); ui.limitGroupRadioButton->setChecked(true);
i = session->UserGroups.lastIndexOf(item->Ctx->Group); i = session->UserGroups.lastIndexOf(item->Ctx->Group);
if ( item->Ctx->Rights & 0x008 ) if ( item->Ctx->Rights & 0x008 )
ui.okButton->setEnabled(true); ui.okButton->setEnabled(true);
else if ( (item->Ctx->Rights & 0x080) && (i != -1) ) else if ( (item->Ctx->Rights & 0x080) && (i != -1) )
ui.okButton->setEnabled(true); ui.okButton->setEnabled(true);
else else
ui.okButton->setEnabled(false); ui.okButton->setEnabled(false);
ui.groupComboBox->setCurrentIndex(i); ui.groupComboBox->setCurrentIndex(i);
} }
else else
ui.okButton->setEnabled(false); ui.okButton->setEnabled(false);
} }
addDialog::addDialog(MainWindow *win ,QWidget *parent) addDialog::addDialog(MainWindow *win ,QWidget *parent)
...@@ -78,16 +79,20 @@ addDialog::addDialog(MainWindow *win ,QWidget *parent) ...@@ -78,16 +79,20 @@ addDialog::addDialog(MainWindow *win ,QWidget *parent)
session = &(mainwin->session); session = &(mainwin->session);
ui.setupUi(this); ui.setupUi(this);
initLists(); initLists();
ui.userLineEdit->setText(QString::number(session->userId));
ui.okButton->setEnabled(false); ui.okButton->setEnabled(false);
ui.clubComboBox->setEnabled(false);
ui.userLineEdit->setEnabled(false);
connect(ui.fileToolButton, SIGNAL(clicked()), this, SLOT(selectFileName())); connect(ui.fileToolButton, SIGNAL(clicked()), this, SLOT(selectFileName()));
connect(ui.dirToolButton, SIGNAL(clicked()), this, SLOT(selectDirName())); connect(ui.dirToolButton, SIGNAL(clicked()), this, SLOT(selectDirName()));
connect(ui.treeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem *,QTreeWidgetItem *)), this, SLOT(currentItemChange(QTreeWidgetItem *,QTreeWidgetItem *))); connect(ui.treeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem *,QTreeWidgetItem *)), this, SLOT(currentItemChange(QTreeWidgetItem *,QTreeWidgetItem *)));
connect(ui.okButton, SIGNAL(clicked()), this, SLOT(enqueueRequested())); 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() void addDialog::initLists()
...@@ -96,21 +101,33 @@ void addDialog::initLists() ...@@ -96,21 +101,33 @@ void addDialog::initLists()
ui.treeWidget->clear(); ui.treeWidget->clear();
ui.treeWidget->setColumnCount(1); ui.treeWidget->setColumnCount(1);
ui.treeWidget->setHeaderLabels(QStringList(tr("Name"))); ui.treeWidget->setHeaderLabels(QStringList(tr("Name")));
for (int i = 0; i < session->Contexts.size(); ++i) { for (int i = 0; i < session->Contexts.size(); ++i) {
UbptContext *sctx = session->Contexts.at(i); UbptContext *sctx = session->Contexts.at(i);
if ( sctx->IdParent == 0 ) if ( sctx->IdParent == 0 )
{ {
contextTreeItem *sitem = new contextTreeItem(ui.treeWidget,sctx); contextTreeItem *sitem = new contextTreeItem(ui.treeWidget,sctx);
processCtx(sitem,sctx); processCtx(sitem,sctx);
} }
} }
for (int i = 0; i < session->UserGroups.size(); ++i) { for (int i = 0; i < session->UserGroups.size(); ++i) {
ui.groupComboBox->addItem(session->UserGroups.at(i)); 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 ) void addDialog::processCtx ( contextTreeItem *item, UbptContext *ctx )
...@@ -123,7 +140,7 @@ void addDialog::processCtx ( contextTreeItem *item, UbptContext *ctx ) ...@@ -123,7 +140,7 @@ void addDialog::processCtx ( contextTreeItem *item, UbptContext *ctx )
contextTreeItem *sitem = new contextTreeItem(item,sctx); contextTreeItem *sitem = new contextTreeItem(item,sctx);
processCtx(sitem,sctx); processCtx(sitem,sctx);
} }
} }
...@@ -143,14 +160,14 @@ void addDialog::selectFileName() ...@@ -143,14 +160,14 @@ void addDialog::selectFileName()
void addDialog::selectDirName() void addDialog::selectDirName()
{ {
QString directory = QFileDialog::getExistingDirectory(this, QString directory = QFileDialog::getExistingDirectory(this,
tr("Select a directory"), tr("Select a directory"),
ui.dirLineEdit->text(), ui.dirLineEdit->text(),
QFileDialog::DontResolveSymlinks QFileDialog::DontResolveSymlinks
| QFileDialog::ShowDirsOnly); | QFileDialog::ShowDirsOnly);
if (!directory.isEmpty()) if (!directory.isEmpty())
ui.dirLineEdit->setText(directory); ui.dirLineEdit->setText(directory);
} }
void addDialog::enqueueRequested() void addDialog::enqueueRequested()
...@@ -158,9 +175,18 @@ void addDialog::enqueueRequested() ...@@ -158,9 +175,18 @@ void addDialog::enqueueRequested()
int rights = 0xF10; int rights = 0xF10;
int contextId = 0; int contextId = 0;
QString group = ui.groupComboBox->currentText(); QString group = ui.groupComboBox->currentText();
QString club = "";
int user = 0;
QString licence = ui.licenceComboBox->currentText();
QString comment = ui.commentTextEdit->toPlainText();
QString contextName; QString contextName;
if ( ui.allConnectedRadioButton->isChecked() ) if (ui.userCheckBox->isChecked())
user = ui.userLineEdit->text().toInt();
if (ui.clubCheckBox->isChecked())
club = ui.clubComboBox->currentText();
if ( ui.allConnectedRadioButton->isChecked() )
rights |= 1; rights |= 1;
contextTreeItem* item = (contextTreeItem*) ui.treeWidget->currentItem(); contextTreeItem* item = (contextTreeItem*) ui.treeWidget->currentItem();
...@@ -171,46 +197,55 @@ void addDialog::enqueueRequested() ...@@ -171,46 +197,55 @@ void addDialog::enqueueRequested()
contextName = item->Ctx->Name; contextName = item->Ctx->Name;
if ( ui.fileRadioButton->isChecked() ) { if ( ui.fileRadioButton->isChecked() ) {
if ( ui.fileLineEdit->text().isEmpty() ) return; if ( ui.fileLineEdit->text().isEmpty() ) return;
QFileInfo fileInfo = QFileInfo(ui.fileLineEdit->text()); QFileInfo fileInfo = QFileInfo(ui.fileLineEdit->text());
if ( !fileInfo.exists() ) return; if ( !fileInfo.exists() ) return;
QString ext = fileInfo.suffix(); QString ext = fileInfo.suffix();
if ( ext.toLower() == "jpg" || ext.toLower() == "png" ) 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" ) 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);
} else { } else {
if ( ui.dirLineEdit->text().isEmpty() ) return; if ( ui.dirLineEdit->text().isEmpty() ) return;
QDir dir(ui.dirLineEdit->text()); QDir dir(ui.dirLineEdit->text());
if (!dir.exists()) return; if (!dir.exists()) return;
dir.setFilter( QDir::Files | QDir::NoSymLinks | QDir::Readable ); dir.setFilter( QDir::Files | QDir::NoSymLinks | QDir::Readable );
QFileInfoList list = dir.entryInfoList(); QFileInfoList list = dir.entryInfoList();
for (int i = 0; i < list.size(); ++i) { for (int i = 0; i < list.size(); ++i) {
QFileInfo fileInfo = list.at(i); QFileInfo fileInfo = list.at(i);
QString ext = fileInfo.suffix(); QString ext = fileInfo.suffix();
if ( ext.toLower() == "jpg" || ext.toLower() == "png" ) 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" ) 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); 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() void addDialog::on_cancelButton_clicked()
{ {
......