Commit 79ed43dd authored by mbriand's avatar mbriand

gestion photographe et licence + trad

parent 5320e828
/*
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
......@@ -21,19 +36,21 @@ class addDialog : public QDialog
public:
addDialog( MainWindow *win, QWidget *parent = 0);
public slots:
void on_cancelButton_clicked();
void selectFileName();
void selectDirName();
void currentItemChange ( QTreeWidgetItem * current, QTreeWidgetItem * previous );
void enqueueRequested();
void enableClubComboBox(int state);
void enableUserLineEdit(int state);
private:
Ui::addDialog ui;
UbptSession *session;
void initLists();
void initLists();
MainWindow *mainwin;
void processCtx ( contextTreeItem *item, UbptContext *ctx );
};
......@@ -43,8 +60,8 @@ class contextTreeItem : public QTreeWidgetItem
public:
contextTreeItem( QTreeWidgetItem * parent, UbptContext *pCtx );
contextTreeItem( QTreeWidget * parent, UbptContext *pCtx );
UbptContext *Ctx;
};
#endif
\ No newline at end of file
#endif
/*
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
......@@ -18,35 +33,39 @@
typedef struct transfertItem
{
public:
public:
QString name;
QString fileName;
QString contextName;
int contextId;
int rights;
QString group;
int photographerUserId;
QString club;
QString licence;
QString comment;
enum itemType { Photo, Video };
itemType type;
} 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;
enum transfertState { ToDo, Encoding, Transfert, Sucess, Error };
transfertState state;
int UBPTError;
};
class MainWindow : public QMainWindow
......@@ -57,14 +76,14 @@ public:
MainWindow(QWidget *parent = 0);
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:
void closeEvent(QCloseEvent *event);
public slots:
void about();
void openAdd();
......@@ -72,17 +91,17 @@ public slots:
void processPhotos();
void stopPhotos();
void uploaded(transfertTreeItem *Item);
void progress(transfertTreeItem *Item, int precent);
void progress(transfertTreeItem *Item, int precent);
void resetStatesAndRemoveDone();
void removeAll();
void removeSelection();
private:
void createActions();
void createMenus();
void createToolBars();
void writeList();
void readList();
void readElement( const QDomElement &element );
......@@ -95,26 +114,26 @@ private:
QAction *cleanupResetAct;
QAction *removeAllAct;
QAction *removeSelectionAct;
QMenu *fileMenu;
QMenu *photosMenu;
QMenu *helpMenu;
QMenu *helpMenu;
QToolBar *fileToolBar;
QToolBar *photosToolBar;
QToolBar *photosToolBar;
QTreeWidgetItem *rootItem;
void uploadItem (transfertTreeItem *Item );
void nextItem ();
bool stop;
QTime listTime;
QTime itemTime;
int itemsDone;
void refreshRemaingInfo ();
int countRemainingItems ();
int countRemainingItems ();
UploadThread upthread;
};
......
/*
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
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.
*/
/**
/**
@addtogroup ubptprococol
@{
*/
......@@ -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
......@@ -43,7 +45,7 @@
class UbptContext
{
public:
QString Name;
int Id;
int IdParent;
......@@ -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 );
......@@ -102,8 +109,8 @@ private:
// Error in connectivity
#define ERR_UBPT_NOCONNECTION -1
// Other errors
// Other errors
#define ERR_UBPT_USERNAMEORPASSWORD 10
#define ERR_UBPT_NEEDTOUPDATE 11
#define ERR_UBPT_INVALIDIMAGEFILE 3
......
No preview for this file type
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS><TS version="1.1" language="fr">
<!DOCTYPE TS>
<TS version="2.0" language="fr">
<context>
<name>MainWindow</name>
<message>
<location filename="" line="7667826"/>
<source>UBPT Transfert 2.0</source>
<translation type="obsolete">UBPT Transfert 2.0</translation>
</message>
<message>
<location filename="" line="7667826"/>
<source>Welcome into UBPT Transfert 2.0</source>
<translation type="obsolete">Bienvenue dans UBPT Transfert 2.0</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="294"/>
<location filename="../src/qt/mainwindow.cpp" line="+330"/>
<source>Connected to UBPT</source>
<translation>Connecté à UBPT</translation>
</message>
<message>
<location filename="" line="7667826"/>
<source>Tool to upload photos on the &lt;b&gt;UBPT&lt;/b&gt;.&lt;br/&gt;&lt;br/&gt;Under the GPL v2 license.&lt;br/&gt;(c) Copyright 2005 Julien Etelain. All rights reserved.&lt;br/&gt;&lt;br/&gt;&lt;i&gt;Powered by libcurl and Qt4&lt;/i&gt;</source>
<translation type="obsolete">Outil pour mettre en ligne des photos sur &lt;b&gt;UBPT&lt;/b&gt;.&lt;br/&gt;&lt;br/&gt;Sous les termes de la license GPL v2.&lt;br/&gt;(c) Copyright 2005 Julien Etelain. Tous droits réservés.&lt;br/&gt;&lt;br/&gt;&lt;i&gt;Powered by libcurl and Qt4&lt;/i&gt;</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="324"/>
<location line="+30"/>
<source>&amp;Connect</source>
<translation>Se &amp;connecter</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="325"/>
<location line="+1"/>
<source>Open the connexion box</source>
<translation>Ouvre la fenêtre de connexion</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="328"/>
<location line="+3"/>
<source>&amp;Add</source>
<translation>&amp;Ajouter</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="329"/>
<location line="+1"/>
<source>Add photos to the list</source>
<translation>Ajoute des photos à la liste</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="332"/>
<location line="+3"/>
<source>&amp;Process</source>
<translation>&amp;Proceder</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="333"/>
<location line="+1"/>
<source>Process to uploads</source>
<translation>Procéde aux transferts</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="336"/>
<location line="+3"/>
<source>&amp;Stop</source>
<translation>&amp;Stop</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="337"/>
<location line="+1"/>
<source>Stop upload</source>
<translation>Arrête le transfert</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="340"/>
<location line="+3"/>
<source>E&amp;xit</source>
<translation>&amp;Quitter</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="341"/>
<location line="+1"/>
<source>Ctrl+Q</source>
<translation>Ctrl+Q</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="342"/>
<location line="+1"/>
<source>Exit the application</source>
<translation>Quitte l&apos;application</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="345"/>
<location line="+3"/>
<source>&amp;About</source>
<translation>&amp;A propos</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="346"/>
<location line="+1"/>
<source>Show the application&apos;s About box</source>
<translation>Affiche la fenêtre à propos</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="370"/>
<location line="+24"/>
<source>&amp;File</source>
<translation>&amp;Fichier</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="375"/>
<location line="+5"/>
<source>&amp;Photos</source>
<translation>&amp;Photos</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="386"/>
<location line="+11"/>
<source>&amp;Help</source>
<translation>A&amp;ide</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="392"/>
<location filename="../src/ui/main.ui" line="+43"/>
<location filename="../src/qt/mainwindow.cpp" line="+6"/>
<source>File</source>
<translation>Fichier</translation>
</message>
<message>
<location filename="" line="7667826"/>
<source>Edit</source>
<translation type="obsolete">Editer</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="240"/>
<location line="+5"/>
<source>Destination</source>
<translation>Destination</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="241"/>
<location line="+5"/>
<source>State</source>
<translation>Etat</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="242"/>
<location line="+5"/>
<source>Access rights</source>
<translation>Droits d&apos;accés</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="452"/>
<location filename="../src/qt/mainwindow.cpp" line="+60"/>
<source>Processing</source>
<translation>En cours</translation>
</message>
<message>
<location filename="" line="7667826"/>
<source>Error %1</source>
<translation type="obsolete">Erreur %1</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="547"/>
<location line="+45"/>
<location line="+56"/>
<source>Finished</source>
<translation>Terminé</translation>
</message>
<message>
<location filename="" line="7667826"/>
<source>%1 % done</source>
<translation type="obsolete">%1 % fait</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="558"/>
<location line="+11"/>
<source>Estimating...</source>
<translation>Estimation...</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="566"/>
<location line="+8"/>
<source>Less than one minute</source>
<translation>Moins d&apos;une minute</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="568"/>
<location line="+2"/>
<source>About one minute</source>
<translation>Environs une minute
</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="570"/>
<location line="+2"/>
<source>About %1 minutes</source>
<translation>Environs %1 minutes
</translation>
</message>
<message>
<location filename="" line="7667826"/>
<source>Done : %1 on %2 (%3 %) - Time left : %4</source>
<translation type="obsolete">Fait : %1 sur %2 (%3 %) - Temps restant : %4</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="467"/>
<location line="-109"/>
<source>Error : session error</source>
<translation>Erreur : erreur de session</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="471"/>
<location line="+4"/>
<source>Error : connection error</source>
<translation>Erreur : erreur de connexion</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="474"/>
<location line="+3"/>
<source>Error : invalid image</source>
<translation>Erreur : image invalide</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="486"/>
<location line="+3"/>
<location line="+9"/>
<source>Error : system error</source>
<translation>Erreur : erreur système</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="480"/>
<location line="-6"/>
<source>Error : invalid category</source>
<translation>Erreur : catégorie invalide</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="483"/>
<location line="+3"/>
<source>Error : forbidden</source>
<translation>Erreur : interdit</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="170"/>
<location line="-326"/>
<source>Parse error at line %1, column %2:
%3</source>
<translation>Erreur de syntaxe à la ligne %1, colone %2:
%3</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="350"/>
<location line="+193"/>
<source>C&amp;leanup and reset</source>
<translation>&amp;Effacer et remettre à zéro</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="351"/>
<location line="+1"/>
<source>Remove done items and reset states of all other items</source>
<translation>Enlève les éléments terminés et remet à zéra l&apos;état des autres éléments</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="395"/>
<location line="+44"/>
<source>Photos</source>
<translation>Photos</translation>
</message>
<message>
<location filename="" line="7667826"/>
<source>Tool to upload photos on the &lt;b&gt;UBPT&lt;/b&gt;.&lt;br/&gt;&lt;br/&gt;Under the terms of the GNU GPL 2 license.&lt;br/&gt;(c) Copyright 2005 Julien Etelain. All rights reserved.&lt;br/&gt;&lt;br/&gt;&lt;i&gt;Powered by libcurl and Qt4&lt;/i&gt;</source>
<translation type="obsolete">Outil pour mettre en ligne des photos sur &lt;b&gt;UBPT&lt;/b&gt;.&lt;br/&gt;&lt;br/&gt;Sous les termes de la license GNU GPL 2.&lt;br/&gt;(c) Copyright 2005 Julien Etelain. Tous droits réservés.&lt;br/&gt;&lt;br/&gt;&lt;i&gt;Powered by libcurl and Qt4&lt;/i&gt;</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="355"/>
<location line="-40"/>
<source>Re&amp;move all</source>
<translation>Supprimer &amp;tous</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="356"/>
<location line="+1"/>
<source>Remove all items</source>
<translation>Supprime tous les éléments</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="359"/>
<location line="+3"/>
<source>&amp;Remove</source>
<translation>&amp;Supprimer</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="360"/>
<location line="+1"/>
<source>Remove selection</source>
<translation>Supprime la selection</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="575"/>
<source>Done : %1 on %2 - Time left : %3</source>
<translation>Fait : %1 sur %2 - Temps restant : %3</translation>
<location line="+129"/>
<source>Error : unable to transocde to flv</source>
<translation>Erreur : impossible de convertir au format flv</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="425"/>
<source>Stopped</source>
<translation>Arrêté</translation>
<location line="+3"/>
<source>Error : unable to take a shot</source>
<translation>Erreur : impossible de créer la miniature</translation>
</message>
<message>
<location filename="" line="7667826"/>
<source>UBPT Transfert 2.1</source>
<translation type="obsolete">UBPT Transfert 2.1</translation>
<location line="+18"/>
<source>Encoding to FLV...</source>
<translation>Conversion en flv</translation>
</message>
<message>
<location filename="" line="7667826"/>
<source>Welcome into UBPT Transfert 2.1</source>
<translation type="obsolete">Bienvenue dans UBPT Transfert 2.1</translation>
<location line="+71"/>
<source>Done : %1 on %2 - Time left : %3</source>
<translation>Fait : %1 sur %2 - Temps restant : %3</translation>
</message>
<message>
<location line="-156"/>
<source>Stopped</source>
<translation>Arrêté</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="303"/>
<location line="-269"/>
<location line="+147"/>
<source>UBPT Transfert %1</source>
<translation>UBPT Transfert %1</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="307"/>
<location line="+1"/>
<source>Tool to upload photos on &lt;b&gt;UBPT compatible&lt;/b&gt; photo libraries.&lt;br/&gt;&lt;br/&gt;Under the terms of the GNU GPL 2 license.&lt;br/&gt;(c) Copyright 2005-2007 Julien Etelain. All rights reserved.&lt;br/&gt;&lt;br/&gt;&lt;i&gt;Powered by libcurl, Qt4, ffmpeg&lt;/i&gt;</source>
<translation>Outil pour charger des photos sur les galleries de photos de type UBPT. &lt;br/&gt;&lt;br/&gt;Sous les termes de la license GNU GPL version 2.&lt;br/&gt;Copyright 2005-2007 Julien Etelain. Tous droits réservés.&lt;br/&gt;&lt;br/&gt;Fonctionne grâce à libcurl, Qt4, ffmpeg</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="504"/>
<source>Encoding to FLV</source>
<translation>Encodage en FLV</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="510"/>
<location line="+212"/>
<source>Upload %1 % done</source>
<translation>Chargement %1 % fait</translation>
</message>
<message>
<location filename="../src/ui/main.ui" line="16"/>
<location filename="../src/ui/main.ui" line="-44"/>
<source>UBPT Transfert</source>
<translation>UBPT Transfert</translation>
</message>
<message>
<location filename="../src/ui/main.ui" line="59"/>
<location line="+60"/>
<source>Welcome into UBPT Transfert</source>
<translation>Bienvenue dans UBPT Transfert</translation>
</message>
......@@ -305,17 +270,21 @@
<context>
<name>QObject</name>
<message>
<location filename="../src/qt/mainwindow.cpp" line="593"/>
<location filename="../src/qt/mainwindow.cpp" line="-511"/>
<location line="+32"/>
<location line="+562"/>
<source>To do</source>
<translation>A faire</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="72"/>
<location line="-591"/>
<location line="+32"/>
<source>Connected persons</source>
<translation>Personnes connectés</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="74"/>