diff options
Diffstat (limited to 'src/gui/clientFileSendDialog.h')
| -rw-r--r-- | src/gui/clientFileSendDialog.h | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/src/gui/clientFileSendDialog.h b/src/gui/clientFileSendDialog.h new file mode 100644 index 0000000..d8afc3a --- /dev/null +++ b/src/gui/clientFileSendDialog.h @@ -0,0 +1,76 @@ +/* + # Copyright (c) 2009, 2010 - OpenSLX Project, Computer Center University of + # Freiburg + # + # This program is free software distributed under the GPL version 2. + # See http://openslx.org/COPYING + # + # If you have any feedback please consult http://openslx.org/feedback and + # send your suggestions, praise, or complaints to feedback@openslx.org + # + # General information about OpenSLX can be found at http://openslx.org/ + */ + +#ifndef CLIENTFILESENDDIALOG_H_ +#define CLIENTFILESENDDIALOG_H_ + +#include <QtGui> +#include <QtNetwork> +#include "pvsinterface.h" +#include "ui_clientFileSendDialog.h" +#include "ui_clientNicklistDialog.h" + +class ClientNicklistDialog: public QDialog, + private Ui::ClientNicklistDialogClass +{ +Q_OBJECT + +public: + ClientNicklistDialog(QWidget *parent = 0); + ~ClientNicklistDialog(); + + QString getNick(); + +private: + OrgOpenslxPvsInterface *_ifaceDBus; + +}; + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +class ClientFileSendDialog: public QDialog, + private Ui::ClientFileSendDialogClass +{ +Q_OBJECT + +public: + ClientFileSendDialog(QWidget *parent = 0); + ~ClientFileSendDialog(); + + void open(); + void open(QString nick); + void open(QString nick, QString filename); + +private Q_SLOTS: + void sendHeader(); + void receiveAck(); + void sendFile(); + void close(); + void error(QAbstractSocket::SocketError error); + +private: + QString formatSize(qint64 size); + + QTcpSocket *_socket; + QFile *_file; + qint64 _bytesToWrite; + int div; + + ClientNicklistDialog *_clientNicklistDialog; + OrgOpenslxPvsInterface *_ifaceDBus; + QString _nickname; + +}; + +#endif /* CLIENTFILESENDDIALOG_H_ */ |
