moved file hashing and download count to new notification system

This commit is contained in:
csoler 2020-01-30 23:02:23 +01:00
parent 10bee9f26b
commit 81c1eb227c
No known key found for this signature in database
GPG key ID: 7BCA522266C0804C
12 changed files with 163 additions and 24 deletions

View file

@ -1091,6 +1091,28 @@ TransfersDialog::TransfersDialog(QWidget *parent)
registerHelpButton(ui.helpButton,help_str,"TransfersDialog") ;
mEventHandlerId=0;
rsEvents->registerEventsHandler(RsEventType::FILE_TRANSFER, [this](std::shared_ptr<const RsEvent> event) { handleEvent(event); }, mEventHandlerId );
}
void TransfersDialog::handleEvent(std::shared_ptr<const RsEvent> event)
{
if(event->mType != RsEventType::FILE_TRANSFER)
return;
const RsFileTransferEvent *fe = dynamic_cast<const RsFileTransferEvent*>(event.get());
if(!fe)
return;
switch (fe->mFileTransferEventCode)
{
case RsFileTransferEventCode::DOWNLOAD_COMPLETE:
case RsFileTransferEventCode::COMPLETED_FILES_REMOVED:
getUserNotify()->updateIcon();
default:
break;
}
}
TransfersDialog::~TransfersDialog()