mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Merge pull request #4886
Pavel Karelin (1): fix: Correct display the call confirm window (CallConfirmWidget)
This commit is contained in:
commit
ea6364ae02
|
@ -199,15 +199,20 @@ void ChatFormHeader::showOutgoingCall(bool video)
|
|||
updateButtonsView();
|
||||
}
|
||||
|
||||
void ChatFormHeader::showCallConfirm(bool video)
|
||||
void ChatFormHeader::createCallConfirm(bool video)
|
||||
{
|
||||
QWidget* btn = video ? videoButton : callButton;
|
||||
callConfirm = std::unique_ptr<CallConfirmWidget>(new CallConfirmWidget(btn));
|
||||
callConfirm->show();
|
||||
connect(callConfirm.get(), &CallConfirmWidget::accepted, this, &ChatFormHeader::callAccepted);
|
||||
connect(callConfirm.get(), &CallConfirmWidget::rejected, this, &ChatFormHeader::callRejected);
|
||||
}
|
||||
|
||||
void ChatFormHeader::showCallConfirm()
|
||||
{
|
||||
if (callConfirm && !callConfirm->isVisible())
|
||||
callConfirm->show();
|
||||
}
|
||||
|
||||
void ChatFormHeader::removeCallConfirm()
|
||||
{
|
||||
callConfirm.reset(nullptr);
|
||||
|
|
|
@ -60,7 +60,8 @@ public:
|
|||
void setMode(Mode mode);
|
||||
|
||||
void showOutgoingCall(bool video);
|
||||
void showCallConfirm(bool video);
|
||||
void createCallConfirm(bool video);
|
||||
void showCallConfirm();
|
||||
void removeCallConfirm();
|
||||
|
||||
void updateCallButtons(bool online, bool audio, bool video = false);
|
||||
|
|
|
@ -346,7 +346,8 @@ void ChatForm::onAvInvite(uint32_t friendId, bool video)
|
|||
Q_ARG(uint32_t, friendId), Q_ARG(bool, video));
|
||||
onAvStart(friendId, video);
|
||||
} else {
|
||||
headWidget->showCallConfirm(video);
|
||||
headWidget->createCallConfirm(video);
|
||||
headWidget->showCallConfirm();
|
||||
lastCallIsVideo = video;
|
||||
auto msg = ChatMessage::createChatInfoMessage(tr("%1 calling").arg(displayedName),
|
||||
ChatMessage::INFO, QDateTime::currentDateTime());
|
||||
|
|
|
@ -285,6 +285,7 @@ void GenericChatForm::show(ContentLayout* contentLayout)
|
|||
void GenericChatForm::showEvent(QShowEvent*)
|
||||
{
|
||||
msgEdit->setFocus();
|
||||
headWidget->showCallConfirm();
|
||||
}
|
||||
|
||||
bool GenericChatForm::event(QEvent* e)
|
||||
|
|
Loading…
Reference in New Issue
Block a user