mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
refactor: Remove call type from callAccepted signal
This commit is contained in:
parent
7b893346f0
commit
1f8a5619c8
|
@ -170,9 +170,7 @@ void ChatFormHeader::showCallConfirm(bool video)
|
||||||
QWidget* btn = video ? videoButton : callButton;
|
QWidget* btn = video ? videoButton : callButton;
|
||||||
callConfirm = std::unique_ptr<CallConfirmWidget>(new CallConfirmWidget(btn));
|
callConfirm = std::unique_ptr<CallConfirmWidget>(new CallConfirmWidget(btn));
|
||||||
callConfirm->show();
|
callConfirm->show();
|
||||||
connect(callConfirm.get(), &CallConfirmWidget::accepted, this, [this, video]{
|
connect(callConfirm.get(), &CallConfirmWidget::accepted, this, &ChatFormHeader::callAccepted);
|
||||||
emit callAccepted(video);
|
|
||||||
});
|
|
||||||
connect(callConfirm.get(), &CallConfirmWidget::rejected, this, &ChatFormHeader::callRejected);
|
connect(callConfirm.get(), &CallConfirmWidget::rejected, this, &ChatFormHeader::callRejected);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,7 @@ signals:
|
||||||
|
|
||||||
void nameChanged(const QString& name);
|
void nameChanged(const QString& name);
|
||||||
|
|
||||||
void callAccepted(bool video);
|
void callAccepted();
|
||||||
void callRejected();
|
void callRejected();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
|
@ -345,7 +345,9 @@ void ChatForm::onAvInvite(uint32_t friendId, bool video)
|
||||||
onAvStart(friendId, video);
|
onAvStart(friendId, video);
|
||||||
} else {
|
} else {
|
||||||
headWidget->showCallConfirm(video);
|
headWidget->showCallConfirm(video);
|
||||||
connect(headWidget, &ChatFormHeader::callAccepted, this, &ChatForm::onAnswerCallTriggered);
|
connect(headWidget, &ChatFormHeader::callAccepted, this, [this, video] {
|
||||||
|
onAnswerCallTriggered(video);
|
||||||
|
});
|
||||||
connect(headWidget, &ChatFormHeader::callRejected, this, &ChatForm::onRejectCallTriggered);
|
connect(headWidget, &ChatFormHeader::callRejected, this, &ChatForm::onRejectCallTriggered);
|
||||||
auto msg = ChatMessage::createChatInfoMessage(tr("%1 calling").arg(displayedName),
|
auto msg = ChatMessage::createChatInfoMessage(tr("%1 calling").arg(displayedName),
|
||||||
ChatMessage::INFO, QDateTime::currentDateTime());
|
ChatMessage::INFO, QDateTime::currentDateTime());
|
||||||
|
|
Loading…
Reference in New Issue
Block a user