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

Call notifications

This commit is contained in:
agilob 2014-11-02 21:07:41 +00:00
parent 98f15af670
commit 755a5677a2
No known key found for this signature in database
GPG Key ID: 34568050DBCCB997
2 changed files with 16 additions and 7 deletions

View File

@ -226,6 +226,7 @@ void ChatForm::onAvInvite(int FriendId, int CallId, bool video)
videoButton->style()->polish(videoButton);
connect(callButton, SIGNAL(clicked()), this, SLOT(onAnswerCallTriggered()));
}
addSystemInfoMessage(tr("%1 calling").arg(f->getName()), "white", QDateTime::currentDateTime());
Widget* w = Widget::getInstance();
if (!w->isFriendWidgetCurActiveWidget(f)|| w->isMinimized() || !w->isActiveWindow())
@ -336,6 +337,7 @@ void ChatForm::onAvRinging(int FriendId, int CallId, bool video)
videoButton->style()->polish(videoButton);
connect(callButton, SIGNAL(clicked()), this, SLOT(onCancelCallTriggered()));
}
addSystemInfoMessage(tr("%1 calling").arg(f->getName()), "white", QDateTime::currentDateTime());
}
void ChatForm::onAvStarting(int FriendId, int CallId, bool video)
@ -386,7 +388,9 @@ void ChatForm::onAvEnding(int FriendId, int)
videoButton->disconnect();
connect(callButton, SIGNAL(clicked()), this, SLOT(onCallTriggered()));
connect(videoButton, SIGNAL(clicked()), this, SLOT(onVideoCallTriggered()));
addSystemInfoMessage(tr("Call with %1 ended").arg(f->getName()), "white", QDateTime::currentDateTime());
netcam->hide();
}
@ -461,6 +465,8 @@ void ChatForm::onAvRejected(int FriendId, int)
videoButton->disconnect();
connect(callButton, SIGNAL(clicked()), this, SLOT(onCallTriggered()));
connect(videoButton, SIGNAL(clicked()), this, SLOT(onVideoCallTriggered()));
addSystemInfoMessage(tr("Call rejected").arg(f->getName()), "white", QDateTime::currentDateTime());
netcam->hide();
}

View File

@ -192,8 +192,9 @@ void GenericChatForm::onSaveLogClicked()
file.close();
}
/// THIS FUNCTION IS DEPRECATED
/// The only reason it's still alive is because the groupchat API is a bit limited
/**
* @deprecated The only reason it's still alive is because the groupchat API is a bit limited
*/
void GenericChatForm::addMessage(const QString& author, const QString &message, bool isAction, const QDateTime &datetime)
{
ChatActionPtr ca = genMessageActionAction(author, message, isAction, datetime);
@ -212,8 +213,9 @@ void GenericChatForm::addSelfMessage(const QString &message, bool isAction, cons
chatWidget->insertMessage(ca);
}
/// THIS FUNCTION IS DEPRECATED
/// The only reason it's still alive is because the groupchat API is a bit limited
/**
* @deprecated The only reason it's still alive is because the groupchat API is a bit limited
*/
void GenericChatForm::addAlertMessage(const QString& author, QString message, QDateTime datetime)
{
QString date = datetime.toString(Settings::getInstance().getTimestampFormat());
@ -291,8 +293,9 @@ void GenericChatForm::clearChatArea(bool notinform)
}
}
/// THIS FUNCTION IS DEPRECATED
/// The only reason it's still alive is because the groupchat API is a bit limited
/**
* @deprecated The only reason it's still alive is because the groupchat API is a bit limited
*/
ChatActionPtr GenericChatForm::genMessageActionAction(const QString &author, QString message, bool isAction, const QDateTime &datetime)
{
if (earliestMessage == nullptr)