qTox  Version: nightly | Commit: bc751c8e1cac455f9690654fcfe0f560d2d7dfdd
Public Slots | Public Member Functions | Protected Member Functions | Private Slots | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
FileTransferWidget Class Reference

#include <filetransferwidget.h>

Inheritance diagram for FileTransferWidget:
Inheritance graph
Collaboration diagram for FileTransferWidget:
Collaboration graph

Public Slots

void reloadTheme ()
 

Public Member Functions

 FileTransferWidget (QWidget *parent, CoreFile &_coreFile, ToxFile file)
 
virtual ~FileTransferWidget ()
 
bool isActive () const
 
void onFileTransferUpdate (ToxFile file)
 

Protected Member Functions

void updateWidgetColor (ToxFile const &file)
 
void updateWidgetText (ToxFile const &file)
 
void updateFileProgress (ToxFile const &file)
 
void updateSignals (ToxFile const &file)
 
void updatePreview (ToxFile const &file)
 
void setupButtons (ToxFile const &file)
 
void handleButton (QPushButton *btn)
 
void showPreview (const QString &filename)
 
void acceptTransfer (const QString &filepath)
 
void setBackgroundColor (const QColor &c, bool whiteFont)
 
void setButtonColor (const QColor &c)
 
bool drawButtonAreaNeeded () const
 
void paintEvent (QPaintEvent *) final
 

Private Slots

void onLeftButtonClicked ()
 
void onRightButtonClicked ()
 
void onPreviewButtonClicked ()
 

Private Member Functions

void updateWidget (ToxFile const &file)
 
void updateBackgroundColor (const ToxFile::FileStatus status)
 

Static Private Member Functions

static bool tryRemoveFile (const QString &filepath)
 Dangerous way to find out if a path is writable. More...
 

Private Attributes

CoreFilecoreFile
 
Ui::FileTransferWidget * ui
 
ToxFile fileInfo
 
QVariantAnimation * backgroundColorAnimation = nullptr
 
QVariantAnimation * buttonColorAnimation = nullptr
 
QColor backgroundColor
 
QColor buttonColor
 
QColor buttonBackgroundColor
 
bool active
 
QTime lastTransmissionUpdate
 
ToxFile::FileStatus lastStatus = ToxFile::INITIALIZING
 

Detailed Description

Definition at line 37 of file filetransferwidget.h.

Constructor & Destructor Documentation

◆ FileTransferWidget()

FileTransferWidget::FileTransferWidget ( QWidget *  parent,
CoreFile _coreFile,
ToxFile  file 
)
explicit

Definition at line 51 of file filetransferwidget.cpp.

◆ ~FileTransferWidget()

FileTransferWidget::~FileTransferWidget ( )
virtual

Definition at line 103 of file filetransferwidget.cpp.

Member Function Documentation

◆ acceptTransfer()

void FileTransferWidget::acceptTransfer ( const QString &  filepath)
protected

Definition at line 132 of file filetransferwidget.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ drawButtonAreaNeeded()

bool FileTransferWidget::drawButtonAreaNeeded ( ) const
protected

Definition at line 176 of file filetransferwidget.cpp.

Here is the caller graph for this function:

◆ handleButton()

void FileTransferWidget::handleButton ( QPushButton *  btn)
protected

Definition at line 447 of file filetransferwidget.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isActive()

bool FileTransferWidget::isActive ( ) const

Definition at line 127 of file filetransferwidget.cpp.

Here is the caller graph for this function:

◆ onFileTransferUpdate()

void FileTransferWidget::onFileTransferUpdate ( ToxFile  file)

Definition at line 122 of file filetransferwidget.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ onLeftButtonClicked

void FileTransferWidget::onLeftButtonClicked ( )
privateslot

Definition at line 489 of file filetransferwidget.cpp.

Here is the call graph for this function:

◆ onPreviewButtonClicked

void FileTransferWidget::onPreviewButtonClicked ( )
privateslot

Definition at line 499 of file filetransferwidget.cpp.

Here is the call graph for this function:

◆ onRightButtonClicked

void FileTransferWidget::onRightButtonClicked ( )
privateslot

Definition at line 494 of file filetransferwidget.cpp.

Here is the call graph for this function:

◆ paintEvent()

void FileTransferWidget::paintEvent ( QPaintEvent *  )
finalprotected

Definition at line 182 of file filetransferwidget.cpp.

Here is the call graph for this function:

◆ reloadTheme

void FileTransferWidget::reloadTheme ( )
slot

Definition at line 233 of file filetransferwidget.cpp.

Here is the call graph for this function:

◆ setBackgroundColor()

void FileTransferWidget::setBackgroundColor ( const QColor &  c,
bool  whiteFont 
)
protected

Definition at line 151 of file filetransferwidget.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setButtonColor()

void FileTransferWidget::setButtonColor ( const QColor &  c)
protected

Definition at line 167 of file filetransferwidget.cpp.

Here is the caller graph for this function:

◆ setupButtons()

void FileTransferWidget::setupButtons ( ToxFile const &  file)
protected

Definition at line 372 of file filetransferwidget.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ showPreview()

void FileTransferWidget::showPreview ( const QString &  filename)
protected

Definition at line 483 of file filetransferwidget.cpp.

Here is the caller graph for this function:

◆ tryRemoveFile()

bool FileTransferWidget::tryRemoveFile ( const QString &  filepath)
staticprivate

Dangerous way to find out if a path is writable.

Parameters
filepathPath to file which should be deleted.
Returns
True, if file writeable, false otherwise.

Definition at line 114 of file filetransferwidget.cpp.

Here is the caller graph for this function:

◆ updateBackgroundColor()

void FileTransferWidget::updateBackgroundColor ( const ToxFile::FileStatus  status)
private

Definition at line 529 of file filetransferwidget.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateFileProgress()

void FileTransferWidget::updateFileProgress ( ToxFile const &  file)
protected

Definition at line 309 of file filetransferwidget.cpp.

Here is the caller graph for this function:

◆ updatePreview()

void FileTransferWidget::updatePreview ( ToxFile const &  file)
protected

Definition at line 284 of file filetransferwidget.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateSignals()

void FileTransferWidget::updateSignals ( ToxFile const &  file)
protected

Definition at line 349 of file filetransferwidget.cpp.

Here is the caller graph for this function:

◆ updateWidget()

void FileTransferWidget::updateWidget ( ToxFile const &  file)
private

Definition at line 504 of file filetransferwidget.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateWidgetColor()

void FileTransferWidget::updateWidgetColor ( ToxFile const &  file)
protected

Definition at line 238 of file filetransferwidget.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateWidgetText()

void FileTransferWidget::updateWidgetText ( ToxFile const &  file)
protected

Definition at line 247 of file filetransferwidget.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ active

bool FileTransferWidget::active
private

Definition at line 88 of file filetransferwidget.h.

◆ backgroundColor

QColor FileTransferWidget::backgroundColor
private

Definition at line 84 of file filetransferwidget.h.

◆ backgroundColorAnimation

QVariantAnimation* FileTransferWidget::backgroundColorAnimation = nullptr
private

Definition at line 82 of file filetransferwidget.h.

◆ buttonBackgroundColor

QColor FileTransferWidget::buttonBackgroundColor
private

Definition at line 86 of file filetransferwidget.h.

◆ buttonColor

QColor FileTransferWidget::buttonColor
private

Definition at line 85 of file filetransferwidget.h.

◆ buttonColorAnimation

QVariantAnimation* FileTransferWidget::buttonColorAnimation = nullptr
private

Definition at line 83 of file filetransferwidget.h.

◆ coreFile

CoreFile& FileTransferWidget::coreFile
private

Definition at line 79 of file filetransferwidget.h.

◆ fileInfo

ToxFile FileTransferWidget::fileInfo
private

Definition at line 81 of file filetransferwidget.h.

◆ lastStatus

ToxFile::FileStatus FileTransferWidget::lastStatus = ToxFile::INITIALIZING
private

Definition at line 90 of file filetransferwidget.h.

◆ lastTransmissionUpdate

QTime FileTransferWidget::lastTransmissionUpdate
private

Definition at line 89 of file filetransferwidget.h.

◆ ui

Ui::FileTransferWidget* FileTransferWidget::ui
private

Definition at line 80 of file filetransferwidget.h.


The documentation for this class was generated from the following files: