您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

ctransfermanager.h 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /***************************************************************************
  2. * Copyright (C) 2008 by Oliver Groß *
  3. * z.o.gross@gmx.de *
  4. * *
  5. * This program 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. * This program 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 this program; if not, write to the *
  17. * Free Software Foundation, Inc., *
  18. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
  19. ***************************************************************************/
  20. #ifndef QFTRANS_CTRANSFERMANAGER_H
  21. #define QFTRANS_CTRANSFERMANAGER_H
  22. #include <QMainWindow>
  23. #include "common.h"
  24. #include <QItemSelection>
  25. // #include <QAbstractSocket>
  26. class QListView;
  27. namespace qftrans {
  28. class CTransferThread;
  29. class CWorker;
  30. class CConnectionDialog;
  31. /**
  32. @author Oliver Groß <z.o.gross@gmx.de>
  33. */
  34. class CTransferManager : public QMainWindow {
  35. Q_OBJECT
  36. public:
  37. CTransferManager(QWidget * parent = 0);
  38. ~CTransferManager();
  39. public slots:
  40. void openFile();
  41. void setDestinationDir();
  42. void requestServerThread();
  43. void requestClientThread();
  44. void cleanupThread();
  45. void restartSelected();
  46. void cancelSelected();
  47. signals:
  48. void transferAdded(TransferData * transfer);
  49. void transferRemoved(TransferData * transfer);
  50. void uploadAddRequested(TransferData * transfer);
  51. void uploadRemoveRequested(TransferData * transfer);
  52. void uploadRestartRequested(TransferData * transfer);
  53. void downloadRemoveRequested(TransferData * transfer);
  54. void destinationDirChanged(QString & value);
  55. void setupConnectionRequested(bool server, quint16 port, QString & host);
  56. private:
  57. CConnectionDialog * m_ConnectionDialog;
  58. QAction * m_FileOpen;
  59. QAction * m_ConnectionAsServer;
  60. QAction * m_ConnectionAsClient;
  61. QAction * m_ConnectionDisconnect;
  62. QAction * m_TransferRestartAction;
  63. QAction * m_TransferCancelAction;
  64. bool m_ActAsServer;
  65. bool m_Connected;
  66. QString m_DestinationDir;
  67. QTransferDataList m_Data;
  68. CTransferThread * m_TransferThread;
  69. QListView * m_TransferView;
  70. // TransferData * m_SelectedTransfer;
  71. void setupUi();
  72. void removeFileTransfer(TransferData * transfer);
  73. void cleanup();
  74. inline void createThread();
  75. private slots:
  76. void setupConnection();
  77. void connectToWorker(CWorker * worker);
  78. void updateConnectionState(bool connected);
  79. void handleSelectionChanged(const QItemSelection & selected);
  80. void addTransfer(TransferData * transfer);
  81. void removeTransfer(TransferData * transfer);
  82. void updateStatusBar(const QString & message);
  83. void about();
  84. };
  85. }
  86. #endif