void ChatForm::onFileSendFailed(int FriendId, const QString &fname) { if (FriendId != f->friendId) return; addSystemInfoMessage("File: \"" + fname + "\" failed to send.", "red", QDateTime::currentDateTime()); }
void ChatForm::onAvRinging(int FriendId, int CallId, bool video) { if (FriendId != f->friendId) return; callId = CallId; callButton->disconnect(); videoButton->disconnect(); if (video) { callButton->setObjectName("grey"); callButton->style()->polish(callButton); videoButton->setObjectName("yellow"); videoButton->style()->polish(videoButton); connect(videoButton, SIGNAL(clicked()), this, SLOT(onCancelCallTriggered())); } else { callButton->setObjectName("yellow"); callButton->style()->polish(callButton); videoButton->setObjectName("grey"); videoButton->style()->polish(videoButton); connect(callButton, SIGNAL(clicked()), this, SLOT(onCancelCallTriggered())); } addSystemInfoMessage(tr("%1 calling").arg(f->getName()), "white", QDateTime::currentDateTime()); }
void ChatForm::onAvRejected(int FriendId, int) { qDebug() << "onAvRejected"; if (FriendId != f->friendId) return; audioInputFlag = false; audioOutputFlag = false; micButton->setObjectName("green"); micButton->style()->polish(micButton); volButton->setObjectName("green"); volButton->style()->polish(volButton); callButton->disconnect(); videoButton->disconnect(); callButton->setObjectName("green"); callButton->style()->polish(callButton); callButton->disconnect(); videoButton->setObjectName("green"); videoButton->style()->polish(videoButton); 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(); }
void ChatForm::onFileSendFailed(uint32_t FriendId, const QString &fname) { if (FriendId != f->getFriendID()) return; addSystemInfoMessage(tr("Failed to send file \"%1\"").arg(fname), ChatMessage::ERROR, QDateTime::currentDateTime()); }
void ChatForm::onAvInvite(int FriendId, int CallId, bool video) { qDebug() << "onAvInvite"; if (FriendId != f->friendId) return; callId = CallId; callButton->disconnect(); videoButton->disconnect(); if (video) { callButton->setObjectName("grey"); callButton->style()->polish(callButton); videoButton->setObjectName("yellow"); videoButton->style()->polish(videoButton); connect(videoButton, SIGNAL(clicked()), this, SLOT(onAnswerCallTriggered())); } else { callButton->setObjectName("yellow"); callButton->style()->polish(callButton); videoButton->setObjectName("grey"); 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()) { w->newMessageAlert(); f->hasNewEvents=true; f->widget->updateStatusLight(); } }
void ChatForm::onAvRinging(uint32_t FriendId, int CallId, bool video) { if (FriendId != f->getFriendID()) return; qDebug() << "onAvRinging"; callId = CallId; callButton->disconnect(); videoButton->disconnect(); if (video) { callButton->setObjectName("grey"); callButton->style()->polish(callButton); callButton->setToolTip(""); videoButton->setObjectName("yellow"); videoButton->style()->polish(videoButton); videoButton->setToolTip(tr("Cancel video call")); connect(videoButton, SIGNAL(clicked()), this, SLOT(onCancelCallTriggered())); } else { callButton->setObjectName("yellow"); callButton->style()->polish(callButton); callButton->setToolTip(tr("Cancel audio call")); videoButton->setObjectName("grey"); videoButton->style()->polish(videoButton); videoButton->setToolTip(""); connect(callButton, SIGNAL(clicked()), this, SLOT(onCancelCallTriggered())); } addSystemInfoMessage(tr("Calling to %1").arg(f->getDisplayedName()), ChatMessage::INFO, QDateTime::currentDateTime()); }
void ChatForm::showOutgoingCall(bool video) { audioInputFlag = true; audioOutputFlag = true; disableCallButtons(); if (video) { videoButton->setObjectName("yellow"); videoButton->style()->polish(videoButton); videoButton->setToolTip(tr("Cancel video call")); connect(videoButton, &QPushButton::clicked, this, &ChatForm::onCancelCallTriggered); } else { callButton->setObjectName("yellow"); callButton->style()->polish(callButton); callButton->setToolTip(tr("Cancel audio call")); connect(callButton, &QPushButton::clicked, this, &ChatForm::onCancelCallTriggered); } addSystemInfoMessage(tr("Calling %1").arg(f->getDisplayedName()), ChatMessage::INFO, QDateTime::currentDateTime()); Widget::getInstance()->updateFriendActivity(f); }
void ChatForm::onAvCancel(int FriendId, int) { if (FriendId != f->getFriendID()) return; qDebug() << "onAvCancel"; stopCounter(); audioInputFlag = false; audioOutputFlag = false; micButton->setObjectName("green"); micButton->style()->polish(micButton); volButton->setObjectName("green"); volButton->style()->polish(volButton); callButton->disconnect(); videoButton->disconnect(); callButton->setObjectName("green"); callButton->style()->polish(callButton); videoButton->setObjectName("green"); videoButton->style()->polish(videoButton); connect(callButton, SIGNAL(clicked()), this, SLOT(onCallTriggered())); connect(videoButton, SIGNAL(clicked()), this, SLOT(onVideoCallTriggered())); netcam->hide(); addSystemInfoMessage(tr("%1 stopped calling").arg(f->getDisplayedName()), "white", QDateTime::currentDateTime()); }
void ChatForm::stopCounter() { if(timer) { addSystemInfoMessage(tr("Call with %1 ended. %2").arg(f->getName(), secondsToDHMS(timeElapsed.elapsed()/1000)), "white", QDateTime::currentDateTime()); timer->stop(); callDuration->hide(); timer = nullptr; delete timer; } }
void ChatForm::stopCounter() { if (callDurationTimer) { addSystemInfoMessage(tr("Call with %1 ended. %2").arg(f->getDisplayedName(),secondsToDHMS(timeElapsed.elapsed()/1000)), ChatMessage::INFO, QDateTime::currentDateTime()); callDurationTimer->stop(); callDuration->setText(""); callDuration->hide(); delete callDurationTimer; callDurationTimer = nullptr; } }
void ChatForm::onAvCancel(uint32_t FriendId, int) { if (FriendId != f->getFriendID()) return; qDebug() << "onAvCancel"; delete callConfirm; callConfirm = nullptr; enableCallButtons(); stopCounter(); hideNetcam(); addSystemInfoMessage(tr("%1 stopped calling").arg(f->getDisplayedName()), ChatMessage::INFO, QDateTime::currentDateTime()); }