summaryrefslogtreecommitdiff
path: root/plugins-alternative/Themes/Windows/TransferModel.h
diff options
context:
space:
mode:
authorThomas Preud'homme <robotux@celest.fr>2017-11-24 23:24:09 +0000
committerThomas Preud'homme <robotux@celest.fr>2017-11-24 23:24:09 +0000
commitb3c8bdcc0d1e4b2ab298847a7902b6d60410a5bc (patch)
tree8fce8a51adfb245db8ab2a76831661780c0c713e /plugins-alternative/Themes/Windows/TransferModel.h
parente297dbd8052ef4e66f069e2dd1865ae7fa8af28e (diff)
New upstream version 1.2.3.6
Diffstat (limited to 'plugins-alternative/Themes/Windows/TransferModel.h')
-rw-r--r--plugins-alternative/Themes/Windows/TransferModel.h90
1 files changed, 90 insertions, 0 deletions
diff --git a/plugins-alternative/Themes/Windows/TransferModel.h b/plugins-alternative/Themes/Windows/TransferModel.h
new file mode 100644
index 0000000..c2d89aa
--- /dev/null
+++ b/plugins-alternative/Themes/Windows/TransferModel.h
@@ -0,0 +1,90 @@
+#ifndef TRANSFERMODEL_H
+#define TRANSFERMODEL_H
+
+#include <QAbstractTableModel>
+#include <QModelIndex>
+#include <QVariant>
+#include <QList>
+#include <QSet>
+#include <QIcon>
+#include <QString>
+
+#include "StructEnumDefinition.h"
+#include "Environment.h"
+
+#include "../../../interface/FacilityInterface.h"
+
+/// \brief model to store the transfer list
+class TransferModel : public QAbstractTableModel
+{
+ Q_OBJECT
+public:
+ /// \brief the transfer item displayed
+ struct transfertItem
+ {
+ quint64 id;
+ QString source;
+ QString size;
+ QString destination;
+ };
+ /// \brief the transfer item with progression
+ struct ItemOfCopyListWithMoreInformations
+ {
+ quint64 currentProgression;
+ Ultracopier::ItemOfCopyList generalData;
+ Ultracopier::ActionTypeCopyList actionType;
+ bool custom_with_progression;
+ };
+ /// \brief returned first transfer item
+ struct currentTransfertItem
+ {
+ quint64 id;
+ bool haveItem;
+ QString from;
+ QString to;
+ QString current_file;
+ QString size;
+ int progressBar_file;
+ };
+
+ TransferModel();
+
+ virtual int columnCount(const QModelIndex& parent = QModelIndex()) const;
+ virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
+ virtual int rowCount(const QModelIndex& parent = QModelIndex()) const;
+ virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
+ virtual bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole);
+
+ QList<quint64> synchronizeItems(const QList<Ultracopier::ReturnActionOnCopyList>& returnActions);
+ void setFacilityEngine(FacilityInterface * facilityEngine);
+
+ void setFileProgression(QList<Ultracopier::ProgressionItem> &progressionList);
+
+ currentTransfertItem getCurrentTransfertItem();
+
+ quint64 currentFile;
+ quint64 totalFile;
+ quint64 currentSize;
+ quint64 totalSize;
+protected:
+ QSet<quint64> startId,stopId;///< To show what is started, what is stopped
+ QHash<quint64,ItemOfCopyListWithMoreInformations> internalRunningOperation;///< to have progression and stat
+ QIcon iconStart,iconPause,iconStop;
+private:
+ int loop_size,index_for_loop;
+ int sub_loop_size,sub_index_for_loop;
+ int row,column;
+ FacilityInterface * facilityEngine;
+ QString search_text;
+ /// \brief index from start the search, decresed by remove before it
+ int currentIndexSearch;
+ bool haveSearchItem;
+ quint64 searchId;
+signals:
+ #ifdef ULTRACOPIER_PLUGIN_DEBUG
+ /// \brief To debug source
+ void debugInformation(const Ultracopier::DebugLevel &level,const QString &fonction,const QString &text,const QString &file,const int &ligne);
+ #endif
+};
+
+#endif // TRANSFERMODEL_H