Commit a4d062af authored by Nicolas Jager's avatar Nicolas Jager Committed by Andreas Traczyk

fix : loading page

Change-Id: I0fd3ade4815a389d3a10ba95ce414eac940d0c99
Tuleap: #790
parent 6f2a5c3b
......@@ -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(
......
......@@ -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;
}
......
......@@ -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);
......
Markdown is supported
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