From 02971ce1f0484e4c0d892e4ab20f863df8b1a01a Mon Sep 17 00:00:00 2001
From: Olivier SOLDANO <olivier.soldano@savoirfairelinux.com>
Date: Fri, 4 Nov 2016 15:38:29 -0400
Subject: [PATCH] ui: Patch call state display

when failed to call a peer, the next call showed
"Failed" state before switching, now directly shows
"searching for".

when a call failed it was impossible to make another
call after, because the precedent call wasn't refused
patch fixes that

Change-Id: I0d79b0d9482ef19890f20702c9fe305d3cef68a3
---
 callwidget.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/callwidget.cpp b/callwidget.cpp
index 3183ffe..5b517ed 100644
--- a/callwidget.cpp
+++ b/callwidget.cpp
@@ -420,7 +420,7 @@ CallWidget::callChangedSlot()
                     GlobalInstances::pixmapManipulator()
                     .callPhoto(actualCall_, QSize(130,130)).value<QImage>()));
 
-    if(actualCall_->state() == Call::State::OVER){
+    if(actualCall_->state() == Call::State::OVER || actualCall_->state() == Call::State::FAILURE){
         ui->outboundCallLabel->setText(actualCall_->toHumanStateName(Call::State::INITIALIZATION));
     } else {
         ui->outboundCallLabel->setText(actualCall_->toHumanStateName());
@@ -536,10 +536,11 @@ void CallWidget::callStateToView(Call* value)
         case Call::State::HOLD:
             ui->stackedWidget->setCurrentWidget(ui->videoPage);
             break;
+        case Call::State::OVER:
+            break;
         case Call::State::FAILURE:
         case Call::State::ERROR:
-        case Call::State::OVER:
-            ui->stackedWidget->setCurrentWidget(ui->welcomePage);
+            on_cancelButton_clicked();
             break;
         case Call::State::INITIALIZATION:
         case Call::State::CONNECTED:
@@ -903,4 +904,3 @@ CallWidget::contactLineEdit_registeredNameFound(const Account* account,NameDirec
         }
     }
 }
-
-- 
GitLab