diff --git a/src/chatlog/content/filetransferwidget.cpp b/src/chatlog/content/filetransferwidget.cpp index 702763786..fade6857e 100644 --- a/src/chatlog/content/filetransferwidget.cpp +++ b/src/chatlog/content/filetransferwidget.cpp @@ -47,6 +47,7 @@ FileTransferWidget::FileTransferWidget(QWidget *parent, ToxFile file) , lastTick(QTime::currentTime()) , backgroundColor(Style::getColor(Style::LightGrey)) , buttonColor(Style::getColor(Style::Yellow)) + , active(true) { ui->setupUi(this); @@ -132,6 +133,11 @@ void FileTransferWidget::autoAcceptTransfer(const QString &path) qWarning() << "Cannot write to " << filepath; } +bool FileTransferWidget::isActive() const +{ + return active; +} + void FileTransferWidget::acceptTransfer(const QString &filepath) { if (filepath.isEmpty()) @@ -292,6 +298,7 @@ void FileTransferWidget::onFileTransferCancelled(ToxFile file) return; fileInfo = file; + active = false; setBackgroundColor(Style::getColor(Style::Red), true); @@ -347,6 +354,7 @@ void FileTransferWidget::onFileTransferFinished(ToxFile file) return; fileInfo = file; + active = false; setBackgroundColor(Style::getColor(Style::Green), true); diff --git a/src/chatlog/content/filetransferwidget.h b/src/chatlog/content/filetransferwidget.h index 3f8ba4bbf..26e609cc6 100644 --- a/src/chatlog/content/filetransferwidget.h +++ b/src/chatlog/content/filetransferwidget.h @@ -42,6 +42,7 @@ public: explicit FileTransferWidget(QWidget *parent, ToxFile file); virtual ~FileTransferWidget(); void autoAcceptTransfer(const QString& path); + bool isActive() const; protected slots: void onFileTransferInfo(ToxFile file); @@ -88,6 +89,8 @@ private: static const uint8_t TRANSFER_ROLLING_AVG_COUNT = 4; uint8_t meanIndex = 0; qreal meanData[TRANSFER_ROLLING_AVG_COUNT] = {0.0}; + + bool active; }; #endif // FILETRANSFERWIDGET_H