2022-05-10 10:06:48 +00:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
#ifndef DIALOG_H
|
|
|
|
#define DIALOG_H
|
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
#include <QTcpServer>
|
|
|
|
#include <QTcpSocket>
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
class QDialogButtonBox;
|
|
|
|
class QLabel;
|
|
|
|
class QProgressBar;
|
|
|
|
class QPushButton;
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
|
|
class Dialog : public QDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2018-07-28 21:24:43 +00:00
|
|
|
Dialog(QWidget *parent = nullptr);
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void start();
|
|
|
|
void acceptConnection();
|
|
|
|
void startTransfer();
|
|
|
|
void updateServerProgress();
|
|
|
|
void updateClientProgress(qint64 numBytes);
|
|
|
|
void displayError(QAbstractSocket::SocketError socketError);
|
|
|
|
|
|
|
|
private:
|
2018-07-28 21:24:43 +00:00
|
|
|
QProgressBar *clientProgressBar = nullptr;
|
|
|
|
QProgressBar *serverProgressBar = nullptr;
|
|
|
|
QLabel *clientStatusLabel = nullptr;
|
|
|
|
QLabel *serverStatusLabel = nullptr;
|
2011-04-27 17:16:41 +00:00
|
|
|
|
2018-07-28 21:24:43 +00:00
|
|
|
QPushButton *startButton = nullptr;
|
|
|
|
QPushButton *quitButton = nullptr;
|
|
|
|
QDialogButtonBox *buttonBox = nullptr;
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
QTcpServer tcpServer;
|
|
|
|
QTcpSocket tcpClient;
|
2018-07-28 21:24:43 +00:00
|
|
|
QTcpSocket *tcpServerConnection = nullptr;
|
|
|
|
int bytesToWrite = 0;
|
|
|
|
int bytesWritten = 0;
|
|
|
|
int bytesReceived = 0;
|
2011-04-27 10:05:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|