Commit de3b02ee authored by atraczyk's avatar atraczyk Committed by Andreas Traczyk
Browse files

fix: use named function for StateChange delegate instead of lambda

Change-Id: I99a2ebd575980523c22646a13390fcb5e3e5a872
Tuleap: #790
parent 61a726d4
...@@ -115,42 +115,7 @@ SmartPanel::SmartPanel() ...@@ -115,42 +115,7 @@ SmartPanel::SmartPanel()
} }
}); });
RingD::instance->stateChange += ref new StateChange([this](String^ callId, CallStatus state, int code) { RingD::instance->stateChange += ref new StateChange(this, &SmartPanel::OnstateChange);
auto item = SmartPanelItemsViewModel::instance->findItem(callId);
if (!item) {
WNG_("item not found");
return;
}
switch (state) {
case CallStatus::NONE:
case CallStatus::ENDED:
{
auto callsList = DRing::getCallList();
if (callsList.empty())
_settingsMenuButton_->Visibility = VIS::Visible;
break;
}
case CallStatus::IN_PROGRESS:
{
SmartPanelItemsViewModel::instance->_selectedItem = item;
summonVideoPage();
break;
}
case CallStatus::PEER_PAUSED:
case CallStatus::PAUSED:
{
SmartPanelItemsViewModel::instance->_selectedItem = item;
summonVideoPage();
break;
}
default:
break;
}
});
RingD::instance->devicesListRefreshed += ref new RingClientUWP::DevicesListRefreshed(this, &RingClientUWP::Views::SmartPanel::OndevicesListRefreshed); RingD::instance->devicesListRefreshed += ref new RingClientUWP::DevicesListRefreshed(this, &RingClientUWP::Views::SmartPanel::OndevicesListRefreshed);
ContactsViewModel::instance->contactAdded += ref new ContactAdded([this](Contact^ contact) { ContactsViewModel::instance->contactAdded += ref new ContactAdded([this](Contact^ contact) {
...@@ -174,6 +139,43 @@ SmartPanel::SmartPanel() ...@@ -174,6 +139,43 @@ SmartPanel::SmartPanel()
selectMenu(MenuOpen::CONTACTS_LIST); selectMenu(MenuOpen::CONTACTS_LIST);
} }
void
SmartPanel::OnstateChange(Platform::String ^callId, RingClientUWP::CallStatus state, int code)
{
auto item = SmartPanelItemsViewModel::instance->findItem(callId);
if (!item) {
WNG_("item not found");
return;
}
switch (state) {
case CallStatus::NONE:
case CallStatus::ENDED:
{
auto callsList = DRing::getCallList();
if (callsList.empty())
_settingsMenuButton_->Visibility = VIS::Visible;
break;
}
case CallStatus::IN_PROGRESS:
{
SmartPanelItemsViewModel::instance->_selectedItem = item;
summonVideoPage();
break;
}
case CallStatus::PEER_PAUSED:
case CallStatus::PAUSED:
{
SmartPanelItemsViewModel::instance->_selectedItem = item;
summonVideoPage();
break;
}
default:
break;
}
}
void void
RingClientUWP::Views::SmartPanel::updatePageContent() RingClientUWP::Views::SmartPanel::updatePageContent()
{ {
......
...@@ -157,6 +157,7 @@ private: ...@@ -157,6 +157,7 @@ private:
void checkStateEditionMenu(); void checkStateEditionMenu();
void ringTxtBxPlaceHolderDelay(String^ placeHolderText, int delayInMilliSeconds); void ringTxtBxPlaceHolderDelay(String^ placeHolderText, int delayInMilliSeconds);
void showLinkThisDeviceStep1(); void showLinkThisDeviceStep1();
void OnstateChange(Platform::String ^callId, RingClientUWP::CallStatus state, int code);
/* members */ /* members */
void _addDevice__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e); void _addDevice__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment