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,8 +115,33 @@ SmartPanel::SmartPanel()
}
});
RingD::instance->stateChange += ref new StateChange([this](String^ callId, CallStatus state, int code) {
RingD::instance->stateChange += ref new StateChange(this, &SmartPanel::OnstateChange);
RingD::instance->devicesListRefreshed += ref new RingClientUWP::DevicesListRefreshed(this, &RingClientUWP::Views::SmartPanel::OndevicesListRefreshed);
ContactsViewModel::instance->contactAdded += ref new ContactAdded([this](Contact^ contact) {
auto smartPanelItem = ref new SmartPanelItem();
smartPanelItem->_contact = contact;
SmartPanelItemsViewModel::instance->itemsList->Append(smartPanelItem);
});
RingD::instance->exportOnRingEnded += ref new RingClientUWP::ExportOnRingEnded(this, &RingClientUWP::Views::SmartPanel::OnexportOnRingEnded);
RingD::instance->accountUpdated += ref new RingClientUWP::AccountUpdated(this, &RingClientUWP::Views::SmartPanel::OnaccountUpdated);
RingD::instance->registeredNameFound += ref new RingClientUWP::RegisteredNameFound(this, &RingClientUWP::Views::SmartPanel::OnregisteredNameFound);
RingD::instance->finishCaptureDeviceEnumeration += ref new RingClientUWP::FinishCaptureDeviceEnumeration([this]() {
populateVideoDeviceSettingsComboBox();
});
RingD::instance->registrationStateErrorGeneric += ref new RingClientUWP::RegistrationStateErrorGeneric(this, &RingClientUWP::Views::SmartPanel::OnregistrationStateErrorGeneric);
RingD::instance->registrationStateRegistered += ref new RingClientUWP::RegistrationStateRegistered(this, &RingClientUWP::Views::SmartPanel::OnregistrationStateRegistered);
RingD::instance->callPlaced += ref new RingClientUWP::CallPlaced(this, &RingClientUWP::Views::SmartPanel::OncallPlaced);
RingD::instance->incomingAccountMessage += ref new RingClientUWP::IncomingAccountMessage(this, &RingClientUWP::Views::SmartPanel::OnincomingAccountMessage);
selectMenu(MenuOpen::CONTACTS_LIST);
}
void
SmartPanel::OnstateChange(Platform::String ^callId, RingClientUWP::CallStatus state, int code)
{
auto item = SmartPanelItemsViewModel::instance->findItem(callId);
if (!item) {
......@@ -149,29 +174,6 @@ SmartPanel::SmartPanel()
default:
break;
}
});
RingD::instance->devicesListRefreshed += ref new RingClientUWP::DevicesListRefreshed(this, &RingClientUWP::Views::SmartPanel::OndevicesListRefreshed);
ContactsViewModel::instance->contactAdded += ref new ContactAdded([this](Contact^ contact) {
auto smartPanelItem = ref new SmartPanelItem();
smartPanelItem->_contact = contact;
SmartPanelItemsViewModel::instance->itemsList->Append(smartPanelItem);
});
RingD::instance->exportOnRingEnded += ref new RingClientUWP::ExportOnRingEnded(this, &RingClientUWP::Views::SmartPanel::OnexportOnRingEnded);
RingD::instance->accountUpdated += ref new RingClientUWP::AccountUpdated(this, &RingClientUWP::Views::SmartPanel::OnaccountUpdated);
RingD::instance->registeredNameFound += ref new RingClientUWP::RegisteredNameFound(this, &RingClientUWP::Views::SmartPanel::OnregisteredNameFound);
RingD::instance->finishCaptureDeviceEnumeration += ref new RingClientUWP::FinishCaptureDeviceEnumeration([this]() {
populateVideoDeviceSettingsComboBox();
});
RingD::instance->registrationStateErrorGeneric += ref new RingClientUWP::RegistrationStateErrorGeneric(this, &RingClientUWP::Views::SmartPanel::OnregistrationStateErrorGeneric);
RingD::instance->registrationStateRegistered += ref new RingClientUWP::RegistrationStateRegistered(this, &RingClientUWP::Views::SmartPanel::OnregistrationStateRegistered);
RingD::instance->callPlaced += ref new RingClientUWP::CallPlaced(this, &RingClientUWP::Views::SmartPanel::OncallPlaced);
RingD::instance->incomingAccountMessage += ref new RingClientUWP::IncomingAccountMessage(this, &RingClientUWP::Views::SmartPanel::OnincomingAccountMessage);
selectMenu(MenuOpen::CONTACTS_LIST);
}
void
......
......@@ -157,6 +157,7 @@ private:
void checkStateEditionMenu();
void ringTxtBxPlaceHolderDelay(String^ placeHolderText, int delayInMilliSeconds);
void showLinkThisDeviceStep1();
void OnstateChange(Platform::String ^callId, RingClientUWP::CallStatus state, int code);
/* members */
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