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:
parent
1551614070
commit
06178f00d9
1
core.cpp
1
core.cpp
|
@ -517,6 +517,7 @@ void Core::sendFile(int32_t friendId, QString Filename, QString FilePath, long l
|
||||||
if (fileNum == -1)
|
if (fileNum == -1)
|
||||||
{
|
{
|
||||||
qWarning() << "Core::sendFile: Can't create the Tox file sender";
|
qWarning() << "Core::sendFile: Can't create the Tox file sender";
|
||||||
|
emit fileSendFailed(friendId, Filename);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
qDebug() << QString("Core::sendFile: Created file sender %1 with friend %2").arg(fileNum).arg(friendId);
|
qDebug() << QString("Core::sendFile: Created file sender %1 with friend %2").arg(fileNum).arg(friendId);
|
||||||
|
|
2
core.h
2
core.h
|
@ -150,6 +150,8 @@ signals:
|
||||||
void fileTransferInfo(int FriendId, int FileNum, int64_t Filesize, int64_t BytesSent, ToxFile::FileDirection direction);
|
void fileTransferInfo(int FriendId, int FileNum, int64_t Filesize, int64_t BytesSent, ToxFile::FileDirection direction);
|
||||||
void fileTransferRemotePausedUnpaused(ToxFile file, bool paused);
|
void fileTransferRemotePausedUnpaused(ToxFile file, bool paused);
|
||||||
|
|
||||||
|
void fileSendFailed(int FriendId, const QString& fname);
|
||||||
|
|
||||||
void avInvite(int friendId, int callIndex, bool video);
|
void avInvite(int friendId, int callIndex, bool video);
|
||||||
void avStart(int friendId, int callIndex, bool video);
|
void avStart(int friendId, int callIndex, bool video);
|
||||||
void avCancel(int friendId, int callIndex);
|
void avCancel(int friendId, int callIndex);
|
||||||
|
|
|
@ -51,6 +51,7 @@ ChatForm::ChatForm(Friend* chatFriend)
|
||||||
connect(msgEdit, &ChatTextEdit::enterPressed, this, &ChatForm::onSendTriggered);
|
connect(msgEdit, &ChatTextEdit::enterPressed, this, &ChatForm::onSendTriggered);
|
||||||
connect(micButton, SIGNAL(clicked()), this, SLOT(onMicMuteToggle()));
|
connect(micButton, SIGNAL(clicked()), this, SLOT(onMicMuteToggle()));
|
||||||
connect(chatWidget, &ChatAreaWidget::onFileTranfertInterract, this, &ChatForm::onFileTansBtnClicked);
|
connect(chatWidget, &ChatAreaWidget::onFileTranfertInterract, this, &ChatForm::onFileTansBtnClicked);
|
||||||
|
connect(Core::getInstance(), &Core::fileSendFailed, this, &ChatForm::onFileSendFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
ChatForm::~ChatForm()
|
ChatForm::~ChatForm()
|
||||||
|
@ -455,3 +456,11 @@ void ChatForm::onFileTansBtnClicked(QString widgetName, QString buttonName)
|
||||||
else
|
else
|
||||||
qDebug() << "no filetransferwidget: " << id;
|
qDebug() << "no filetransferwidget: " << id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ChatForm::onFileSendFailed(int FriendId, const QString &fname)
|
||||||
|
{
|
||||||
|
if (FriendId != f->friendId)
|
||||||
|
return;
|
||||||
|
|
||||||
|
addSystemInfoMessage("File: \"" + fname + "\" failed to send.", "red");
|
||||||
|
}
|
||||||
|
|
|
@ -65,6 +65,7 @@ private slots:
|
||||||
void onHangupCallTriggered();
|
void onHangupCallTriggered();
|
||||||
void onCancelCallTriggered();
|
void onCancelCallTriggered();
|
||||||
void onFileTansBtnClicked(QString widgetName, QString buttonName);
|
void onFileTansBtnClicked(QString widgetName, QString buttonName);
|
||||||
|
void onFileSendFailed(int FriendId, const QString &fname);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Friend* f;
|
Friend* f;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user