1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00
qTox/widget/filetransfertwidget.h

72 lines
2.0 KiB
C
Raw Normal View History

2014-07-07 00:19:45 +08:00
/*
Copyright (C) 2014 by Project Tox <https://tox.im>
This file is part of qTox, a Qt-based graphical interface for Tox.
This program is libre software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the COPYING file for more details.
*/
2014-06-26 06:30:24 +08:00
#ifndef FILETRANSFERTWIDGET_H
#define FILETRANSFERTWIDGET_H
#include <QWidget>
#include <QLabel>
#include <QPushButton>
#include <QProgressBar>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QDateTime>
#include "core.h"
2014-07-01 04:52:03 +08:00
struct ToxFile;
2014-06-26 06:30:24 +08:00
class FileTransfertWidget : public QWidget
{
Q_OBJECT
2014-07-05 07:59:11 +08:00
2014-06-26 06:30:24 +08:00
public:
FileTransfertWidget(ToxFile File);
2014-06-26 06:30:24 +08:00
public slots:
2014-07-13 00:40:01 +08:00
void onFileTransferInfo(int FriendId, int FileNum, int64_t Filesize, int64_t BytesSent, ToxFile::FileDirection Direction);
void onFileTransferCancelled(int FriendId, int FileNum, ToxFile::FileDirection Direction);
void onFileTransferFinished(ToxFile File);
2014-06-26 06:30:24 +08:00
2014-06-26 07:48:20 +08:00
private slots:
void cancelTransfer();
void rejectRecvRequest();
void acceptRecvRequest();
void pauseResumeRecv();
void pauseResumeSend();
2014-06-26 07:48:20 +08:00
2014-06-26 06:30:24 +08:00
private:
2014-08-31 18:49:41 +08:00
QString getHumanReadableSize(unsigned long long size);
2014-06-26 06:30:24 +08:00
private:
QLabel *pic, *filename, *size, *speed, *eta;
QPushButton *topright, *bottomright;
QProgressBar *progress;
QHBoxLayout *mainLayout, *textLayout;
QVBoxLayout *infoLayout, *buttonLayout;
QWidget* buttonWidget;
2014-06-26 06:30:24 +08:00
QDateTime lastUpdate;
long long lastBytesSent;
int fileNum;
int friendId;
QString savePath;
ToxFile::FileDirection direction;
QString stopFileButtonStylesheet, pauseFileButtonStylesheet, acceptFileButtonStylesheet;
2014-07-05 07:59:11 +08:00
void paintEvent(QPaintEvent *);
2014-06-26 06:30:24 +08:00
};
#endif // FILETRANSFERTWIDGET_H