From 61a726d4ba756e7d7ce2bb3bb9cb8e4659e19664 Mon Sep 17 00:00:00 2001
From: atraczyk <andreastraczyk@gmail.com>
Date: Tue, 20 Dec 2016 13:26:43 -0500
Subject: [PATCH] fix: removes the video settings button when accepting a call

- When the user clicks the call accept button, the video settings
  button on the smartpanel will be hidden.

Change-Id: I6c023c484f01a0a9b7d78a98189707232b4e8f5c
Tuleap: #790
---
 MainPage.xaml.cpp   |  7 -------
 SmartPanel.xaml.cpp | 13 ++++---------
 2 files changed, 4 insertions(+), 16 deletions(-)

diff --git a/MainPage.xaml.cpp b/MainPage.xaml.cpp
index ef12675..5bb65db 100644
--- a/MainPage.xaml.cpp
+++ b/MainPage.xaml.cpp
@@ -289,8 +289,6 @@ MainPage::Application_VisibilityChanged(Object^ sender, VisibilityChangedEventAr
             }
         }
         if (isInCall) {
-            /*if (RingD::instance->currentCallId)
-                RingD::instance->unPauseCall(RingD::instance->currentCallId);*/
             vcm->InitializeCameraAsync(false);
             vcm->videoFrameCopyInvoker->Start();
         }
@@ -322,11 +320,6 @@ MainPage::Application_VisibilityChanged(Object^ sender, VisibilityChangedEventAr
             }
         }
         if (isInCall) {
-            // TODO
-            /*if (RingD::instance->currentCallId) {
-                MSG_("Pausing call: " + RingD::instance->currentCallId);
-                RingD::instance->pauseCall(RingD::instance->currentCallId);
-            }*/
             if (vcm->isPreviewing) {
                 vcm->StopPreviewAsync();
                 if (vcm->captureTaskTokenSource)
diff --git a/SmartPanel.xaml.cpp b/SmartPanel.xaml.cpp
index 64b7bfa..0157695 100644
--- a/SmartPanel.xaml.cpp
+++ b/SmartPanel.xaml.cpp
@@ -22,6 +22,7 @@
 #include "SmartPanel.xaml.h"
 #include "qrencode.h"
 #include <MemoryBuffer.h>   // IMemoryBufferByteAccess
+#include "callmanager_interface.h"
 
 using namespace Platform;
 
@@ -127,15 +128,8 @@ SmartPanel::SmartPanel()
         case CallStatus::NONE:
         case CallStatus::ENDED:
         {
-            bool isInCall = false;
-            for (auto item : SmartPanelItemsViewModel::instance->itemsList) { // WTF!!! item instead of it!!!! (XXX)
-                if (item->_callId && item->_callStatus == CallStatus::IN_PROGRESS) {
-                    isInCall = true;
-                    RingD::instance->currentCallId = item->_callId;
-                    break;
-                }
-            }
-            if (!isInCall)
+            auto callsList = DRing::getCallList();
+            if (callsList.empty())
                 _settingsMenuButton_->Visibility = VIS::Visible;
             break;
         }
@@ -347,6 +341,7 @@ RingClientUWP::Views::SmartPanel::_acceptIncomingCallBtn__Click(Platform::Object
                 if (it->_callStatus != CallStatus::IN_PROGRESS)
                     RingD::instance->pauseCall(Utils::toString(it->_callId));
 
+            _settingsMenuButton_->Visibility = VIS::Collapsed;
 
             RingD::instance->acceptIncommingCall(callId);
         }
-- 
GitLab