diff --git a/MainPage.xaml.cpp b/MainPage.xaml.cpp index 5c524f7f58e5a864ca69c773fa23ffc60fa5f7b7..1b0195037c005022f6755ecf09882edb592f2217 100644 --- a/MainPage.xaml.cpp +++ b/MainPage.xaml.cpp @@ -187,16 +187,16 @@ RingClientUWP::MainPage::PositionRing() double left; double top; if (bounds.Width < 1200) { - _splashProgressRing_->Width = 118; - _splashProgressRing_->Height = 118; - left = bounds.Width * 0.5 - _loadingImage_->Width * 0.5 - 145; - top = bounds.Height * 0.5 - _loadingImage_->Height * 0.5 - 60; + _splashProgressRing_->Width = 280; + _splashProgressRing_->Height = 280; + left = bounds.Width * 0.5 - _loadingImage_->Width * 0.5 - 300; + top = bounds.Height * 0.5 - _loadingImage_->Height * 0.5 - 100; } else { - _splashProgressRing_->Width = 162; - _splashProgressRing_->Height = 162; - left = bounds.Width * 0.5 - _loadingImage_->Width * 0.5 - 195; - top = bounds.Height * 0.5 - _loadingImage_->Height * 0.5 - 84; + _splashProgressRing_->Width = 384; + _splashProgressRing_->Height = 384; + left = bounds.Width * 0.5 - _loadingImage_->Width * 0.5 - 400; + top = bounds.Height * 0.5 - _loadingImage_->Height * 0.5 - 135; } _splashProgressRing_->SetValue(Canvas::LeftProperty, left + _loadingImage_->Width * 0.5); _splashProgressRing_->SetValue(Canvas::TopProperty, top + _loadingImage_->Height * 0.5); @@ -329,7 +329,7 @@ MainPage::Application_VisibilityChanged(Object^ sender, VisibilityChangedEventAr } else if (vcm->isSettingsPreviewing) { vcm->CleanupCameraAsync() - .then([=](task<void> cleanupCameraTask) { + .then([=](task<void> cleanupCameraTask) { try { cleanupCameraTask.get(); CoreApplication::MainView->CoreWindow->Dispatcher->RunAsync( diff --git a/RingD.cpp b/RingD.cpp index d27e00330649f1e75e6fd407fb7f9a8e631de7c8..6ca978cddb6251b824573784b05bd640c37126d9 100644 --- a/RingD.cpp +++ b/RingD.cpp @@ -221,7 +221,6 @@ RingD::createSIPAccount(String^ alias, String^ sipPassword, String^ sipHostname, editModeOn_ = true; auto frame = dynamic_cast<Frame^>(Window::Current->Content); - dynamic_cast<RingClientUWP::MainPage^>(frame->Content)->showLoadingOverlay(true, true); auto task = ref new RingD::Task(Request::AddSIPAccount); @@ -345,10 +344,9 @@ void RingClientUWP::RingD::updateAccount(String^ accountId) editModeOn_ = true; auto frame = dynamic_cast<Frame^>(Window::Current->Content); - dynamic_cast<RingClientUWP::MainPage^>(frame->Content)->showLoadingOverlay(true, true); auto task = ref new RingD::Task(Request::UpdateAccount); - task->_accountId = accountId; + task->_accountId_new = Utils::toString(accountId); tasksList_.push(task); } @@ -358,7 +356,6 @@ void RingClientUWP::RingD::deleteAccount(String ^ accountId) editModeOn_ = true; auto frame = dynamic_cast<Frame^>(Window::Current->Content); - dynamic_cast<RingClientUWP::MainPage^>(frame->Content)->showLoadingOverlay(true, true); auto task = ref new RingD::Task(Request::DeleteAccount); task->_accountId = accountId; @@ -520,11 +517,11 @@ RingD::registerCallbacks() CoreApplication::MainView->CoreWindow->Dispatcher->RunAsync(CoreDispatcherPriority::High, ref new DispatchedHandler([=]() { reloadAccountList(); - if (editModeOn_) { + /*if (editModeOn_) { auto frame = dynamic_cast<Frame^>(Window::Current->Content); dynamic_cast<RingClientUWP::MainPage^>(frame->Content)->showLoadingOverlay(false, false); editModeOn_ = false; - } + }*/ })); }), DRing::exportable_callback<DRing::Debug::MessageSend>([&](const std::string& toto) @@ -928,13 +925,19 @@ RingD::dequeueTasks() } case Request::UpdateAccount: { - auto accountId = task->_accountId; - auto accountId2 = Utils::toString(accountId); - auto account = AccountListItemsViewModel::instance->findItem(accountId)->_account; - std::map<std::string, std::string> accountDetails = DRing::getAccountDetails(accountId2); + auto account = AccountListItemsViewModel::instance->findItem(Utils::toPlatformString(task->_accountId_new))->_account; + std::map<std::string, std::string> accountDetails = DRing::getAccountDetails(task->_accountId_new); accountDetails[DRing::Account::ConfProperties::UPNP_ENABLED] = (account->_upnpState) ? ring::TRUE_STR : ring::FALSE_STR; accountDetails[DRing::Account::ConfProperties::ALIAS] = Utils::toString(account->name_); + if (accountDetails[DRing::Account::ConfProperties::TYPE] == "RING") + CoreApplication::MainView->CoreWindow->Dispatcher->RunAsync(CoreDispatcherPriority::High, + ref new DispatchedHandler([=]() { + auto frame = dynamic_cast<Frame^>(Window::Current->Content); + dynamic_cast<RingClientUWP::MainPage^>(frame->Content)->showLoadingOverlay(true, true); + })); + + DRing::setAccountDetails(Utils::toString(account->accountID_), accountDetails); break; } @@ -943,6 +946,16 @@ RingD::dequeueTasks() auto accountId = task->_accountId; auto accountId2 = Utils::toString(accountId); + std::map<std::string, std::string> accountDetails = DRing::getAccountDetails(task->_accountId_new); + + if (accountDetails[DRing::Account::ConfProperties::TYPE] == "RING") + CoreApplication::MainView->CoreWindow->Dispatcher->RunAsync(CoreDispatcherPriority::High, + ref new DispatchedHandler([=]() { + auto frame = dynamic_cast<Frame^>(Window::Current->Content); + dynamic_cast<RingClientUWP::MainPage^>(frame->Content)->showLoadingOverlay(true, true); + })); + + DRing::removeAccount(accountId2); break; } diff --git a/SmartPanel.xaml.cpp b/SmartPanel.xaml.cpp index 9ae201704ef8931d189a4afcee6863e9a904c526..6543735cfdaa4df566c544eb220874cf899a14c8 100644 --- a/SmartPanel.xaml.cpp +++ b/SmartPanel.xaml.cpp @@ -1018,7 +1018,8 @@ void RingClientUWP::Views::SmartPanel::_acceptAccountModification__Click(Platfor } else { /* otherwise edit the account */ - account->name_ = _accountAliasTextBox_->Text; + account->name_ = _accountAliasTextBoxEdition_->Text; + account->_upnpState = _upnpState_->IsOn; RingD::instance->updateAccount(accountId);