| 18 | #include "../../core/link.h" |
| 19 | |
| 20 | class SendingHandler : public QObject { |
| 21 | Q_OBJECT |
| 22 | |
| 23 | public: |
| 24 | explicit SendingHandler(QObject *p = Q_NULLPTR, QPushButton *cancelBtn = Q_NULLPTR, QProgressBar *bar = Q_NULLPTR, QTableWidget *t = Q_NULLPTR); |
| 25 | ~SendingHandler() = default; |
| 26 | |
| 27 | void sendFiles(const QStringList &fileNames, int location); |
| 28 | bool dragOccured(QDragEnterEvent *e); |
| 29 | void dropOccured(QDropEvent *e, int location); |
| 30 | void resendSelected(); |
| 31 | void addFile(const QString &path, bool select); |
| 32 | void setLoadEquates(bool state); |
| 33 | |
| 34 | public slots: |
| 35 | void linkProgress(int amount, int total); |
| 36 | void resendPressed(); |
| 37 | void removeRow(); |
| 38 | |
| 39 | signals: |
| 40 | void send(const QStringList &names, int location); |
| 41 | void loadEquateFile(const QString &path); |
| 42 | void cancelTransfer(); |
| 43 | void sendFinished(); |
| 44 | |
| 45 | private: |
| 46 | void checkDirForEquateFiles(QString &dirPath); |
| 47 | QStringList getValidFilesFromArchive(const QString &archivePath); |
| 48 | |
| 49 | enum { |
| 50 | RECENT_REMOVE_COL, |
| 51 | RECENT_RESEND_COL, |
| 52 | RECENT_SELECT_COL, |
| 53 | RECENT_PATH_COL |
| 54 | }; |
| 55 | |
| 56 | QTemporaryDir m_tempDir; |
| 57 | QProgressBar *m_progressBar; |
| 58 | QPushButton *m_btnCancelTransfer; |
| 59 | QTableWidget *m_table; |
| 60 | QIcon m_iconSend; |
| 61 | QIcon m_iconCheck, m_iconCheckGray; |
| 62 | QStringList m_dirs; |
| 63 | bool m_sendEquates = false; |
| 64 | }; |
| 65 | |
| 66 | // Used as global |
| 67 | extern SendingHandler *sendingHandler; |
nothing calls this directly
no outgoing calls
no test coverage detected