Add caller decision controls and colored phone presence on desktop
This commit is contained in:
1 parent
77af45649c
commit
4ccd919ef8
3 files changed
+52
-5
No files matched your search
@@ -257,6 +257,15 @@ CallWindow::CallWindow(QWidget* parent)
|
||||
lay->addWidget(m_avatarLabel, 0, Qt::AlignHCenter);
|
||||
lay->addWidget(m_peerLabel);
|
||||
lay->addWidget(m_statusLabel);
|
||||
m_continueBtn = new QPushButton(callText("Call anyway"), this);
|
||||
lay->addWidget(m_continueBtn);
|
||||
connect(m_continueBtn, &QPushButton::clicked, this, [this] {
|
||||
if (m_state != WaitDecision) return;
|
||||
DEBUG_INFO(DEBUG_CATEGORY_CALL, "desktop caller overrides phone busy id=%016llx", (unsigned long long)m_callId);
|
||||
postCallFn(call_continue_trampoline, m_callId);
|
||||
setState(Outgoing);
|
||||
SoundManager::instance()->playLoop("call_connecting");
|
||||
});
|
||||
lay->addWidget(m_durationLabel);
|
||||
lay->addWidget(m_connectionLabel);
|
||||
lay->addWidget(m_bgpPathLabel);
|
||||
@@ -389,6 +398,10 @@ void CallWindow::setConnectionType(uint8_t type, quint64 nextHop) {
|
||||
void CallWindow::setState(State s) {
|
||||
m_state = s;
|
||||
switch (s) {
|
||||
case WaitDecision:
|
||||
m_statusLabel->setText(callText("Subscriber is on a phone call"));
|
||||
m_durationLabel->hide();
|
||||
break;
|
||||
case Outgoing:
|
||||
m_statusLabel->setText(QCoreApplication::translate("ChatGui", "Connecting…"));
|
||||
m_durationLabel->hide();
|
||||
@@ -439,9 +452,10 @@ void CallWindow::populateDeviceCombo() {
|
||||
}
|
||||
|
||||
void CallWindow::updateButtons() {
|
||||
m_continueBtn->setVisible(m_state == WaitDecision);
|
||||
m_acceptCell->setVisible(m_state == Incoming);
|
||||
m_declineCell->setVisible(m_state == Incoming);
|
||||
m_hangupCell->setVisible(m_state == Outgoing || m_state == Ringing || m_state == Active);
|
||||
m_hangupCell->setVisible(m_state == Outgoing || m_state == Ringing || m_state == Active || m_state == WaitDecision);
|
||||
m_muteCell->setVisible(m_state == Active);
|
||||
updateVideoPresentation();
|
||||
}
|
||||
@@ -509,7 +523,7 @@ void CallWindow::onDeviceChanged(int index) {
|
||||
|
||||
void CallWindow::closeEvent(QCloseEvent* event) {
|
||||
m_video->stop(); m_videoCall = 0;
|
||||
if (m_state == Outgoing || m_state == Ringing || m_state == Active)
|
||||
if (m_state == Outgoing || m_state == Ringing || m_state == Active || m_state == WaitDecision)
|
||||
postCallFn(call_hangup_trampoline, m_callId);
|
||||
emit closed(m_callId);
|
||||
event->accept();
|
||||
|
||||
Reference in new issue
Block a user