| 1 | /* |
|---|
| 2 | * This file is part of Licq, an instant messaging client for UNIX. |
|---|
| 3 | * Copyright (C) 1999-2006 Licq developers |
|---|
| 4 | * |
|---|
| 5 | * Licq is free software; you can redistribute it and/or modify |
|---|
| 6 | * it under the terms of the GNU General Public License as published by |
|---|
| 7 | * the Free Software Foundation; either version 2 of the License, or |
|---|
| 8 | * (at your option) any later version. |
|---|
| 9 | * |
|---|
| 10 | * Licq is distributed in the hope that it will be useful, |
|---|
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 13 | * GNU General Public License for more details. |
|---|
| 14 | * |
|---|
| 15 | * You should have received a copy of the GNU General Public License |
|---|
| 16 | * along with Licq; if not, write to the Free Software |
|---|
| 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
|---|
| 18 | */ |
|---|
| 19 | |
|---|
| 20 | #ifndef FILEDLG_H |
|---|
| 21 | #define FILEDLG_H |
|---|
| 22 | |
|---|
| 23 | #include <QTimer> |
|---|
| 24 | #include <QWidget> |
|---|
| 25 | |
|---|
| 26 | #include <licq_filetransfer.h> |
|---|
| 27 | |
|---|
| 28 | class CFileTransferManager; |
|---|
| 29 | class QLabel; |
|---|
| 30 | class QProgressBar; |
|---|
| 31 | class QPushButton; |
|---|
| 32 | class QSocketNotifier; |
|---|
| 33 | |
|---|
| 34 | namespace LicqQtGui |
|---|
| 35 | { |
|---|
| 36 | class InfoField; |
|---|
| 37 | class MLEdit; |
|---|
| 38 | |
|---|
| 39 | class FileDlg : public QWidget |
|---|
| 40 | { |
|---|
| 41 | Q_OBJECT |
|---|
| 42 | public: |
|---|
| 43 | FileDlg(const char* szId, unsigned long nPPID, QWidget* parent = 0); |
|---|
| 44 | virtual ~FileDlg(); |
|---|
| 45 | |
|---|
| 46 | bool SendFiles(ConstFileList filelist, unsigned short nPort); |
|---|
| 47 | bool ReceiveFiles(); |
|---|
| 48 | |
|---|
| 49 | unsigned short LocalPort(); |
|---|
| 50 | QString Id() { return myId; } |
|---|
| 51 | unsigned long PPID() { return m_nPPID; } |
|---|
| 52 | |
|---|
| 53 | private: |
|---|
| 54 | QLabel* lblTransferFileName; |
|---|
| 55 | QLabel* lblLocalFileName; |
|---|
| 56 | QLabel* lblFileSize; |
|---|
| 57 | QLabel* lblTrans; |
|---|
| 58 | QLabel* lblBatch; |
|---|
| 59 | QLabel* lblTime; |
|---|
| 60 | QLabel* lblBPS; |
|---|
| 61 | QLabel* lblETA; |
|---|
| 62 | InfoField* nfoFileSize; |
|---|
| 63 | InfoField* nfoTransferFileName; |
|---|
| 64 | InfoField* nfoTotalFiles; |
|---|
| 65 | InfoField* nfoBatchSize; |
|---|
| 66 | InfoField* nfoLocalFileName; |
|---|
| 67 | InfoField* nfoBPS; |
|---|
| 68 | InfoField* nfoETA; |
|---|
| 69 | InfoField* nfoTime; |
|---|
| 70 | QPushButton* btnCancel; |
|---|
| 71 | QPushButton* btnOpen; |
|---|
| 72 | QPushButton* btnOpenDir; |
|---|
| 73 | MLEdit* mleStatus; |
|---|
| 74 | QProgressBar* barTransfer; |
|---|
| 75 | QProgressBar* barBatchTransfer; |
|---|
| 76 | |
|---|
| 77 | CFileTransferManager* ftman; |
|---|
| 78 | |
|---|
| 79 | QString myId; |
|---|
| 80 | unsigned long m_nPPID; |
|---|
| 81 | QSocketNotifier* sn; |
|---|
| 82 | |
|---|
| 83 | QTimer m_tUpdate; |
|---|
| 84 | |
|---|
| 85 | QString encodeFSize(unsigned long size); |
|---|
| 86 | |
|---|
| 87 | private slots: |
|---|
| 88 | void slot_ft(); |
|---|
| 89 | void slot_update(); |
|---|
| 90 | void slot_cancel(); |
|---|
| 91 | void slot_open(); |
|---|
| 92 | void slot_opendir(); |
|---|
| 93 | }; |
|---|
| 94 | |
|---|
| 95 | } // namespace LicqQtGui |
|---|
| 96 | |
|---|
| 97 | #endif |
|---|