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

File send error message

This commit is contained in:
apprb 2014-09-23 23:52:06 +07:00
parent 1551614070
commit 06178f00d9
4 changed files with 13 additions and 0 deletions

View File

@ -517,6 +517,7 @@ void Core::sendFile(int32_t friendId, QString Filename, QString FilePath, long l
if (fileNum == -1)
{
qWarning() << "Core::sendFile: Can't create the Tox file sender";
emit fileSendFailed(friendId, Filename);
return;
}
qDebug() << QString("Core::sendFile: Created file sender %1 with friend %2").arg(fileNum).arg(friendId);

2
core.h
View File

@ -150,6 +150,8 @@ signals:
void fileTransferInfo(int FriendId, int FileNum, int64_t Filesize, int64_t BytesSent, ToxFile::FileDirection direction);
void fileTransferRemotePausedUnpaused(ToxFile file, bool paused);
void fileSendFailed(int FriendId, const QString& fname);
void avInvite(int friendId, int callIndex, bool video);
void avStart(int friendId, int callIndex, bool video);
void avCancel(int friendId, int callIndex);

View File

@ -51,6 +51,7 @@ ChatForm::ChatForm(Friend* chatFriend)
connect(msgEdit, &ChatTextEdit::enterPressed, this, &ChatForm::onSendTriggered);
connect(micButton, SIGNAL(clicked()), this, SLOT(onMicMuteToggle()));
connect(chatWidget, &ChatAreaWidget::onFileTranfertInterract, this, &ChatForm::onFileTansBtnClicked);
connect(Core::getInstance(), &Core::fileSendFailed, this, &ChatForm::onFileSendFailed);
}
ChatForm::~ChatForm()
@ -455,3 +456,11 @@ void ChatForm::onFileTansBtnClicked(QString widgetName, QString buttonName)
else
qDebug() << "no filetransferwidget: " << id;
}
void ChatForm::onFileSendFailed(int FriendId, const QString &fname)
{
if (FriendId != f->friendId)
return;
addSystemInfoMessage("File: \"" + fname + "\" failed to send.", "red");
}

View File

@ -65,6 +65,7 @@ private slots:
void onHangupCallTriggered();
void onCancelCallTriggered();
void onFileTansBtnClicked(QString widgetName, QString buttonName);
void onFileSendFailed(int FriendId, const QString &fname);
private:
Friend* f;