Fix jumpy resolve while typing
This commit is contained in:
parent
433daf1ee8
commit
adf7c3f20b
2 changed files with 9 additions and 11 deletions
|
@ -1858,12 +1858,8 @@ void HostnameSelectScreen::CreatePopupContents(UI::ViewGroup *parent) {
|
|||
parent->Add(ipRows_);
|
||||
listIP.clear(); listIP.shrink_to_fit();
|
||||
|
||||
errorView_ = parent->Add(new TextView(n->T("Invalid IP or hostname"), ALIGN_HCENTER, false, new LinearLayoutParams(Margins(0, 10, 0, 0))));
|
||||
errorView_->SetTextColor(0xFF3030FF);
|
||||
errorView_->SetVisibility(V_GONE);
|
||||
|
||||
progressView_ = parent->Add(new TextView(n->T("Validating address..."), ALIGN_HCENTER, false, new LinearLayoutParams(Margins(0, 10, 0, 0))));
|
||||
progressView_->SetVisibility(V_GONE);
|
||||
progressView_->SetVisibility(V_INVISIBLE);
|
||||
}
|
||||
|
||||
void HostnameSelectScreen::SendEditKey(int keyCode, int flags) {
|
||||
|
@ -1950,6 +1946,8 @@ void HostnameSelectScreen::ResolverThread() {
|
|||
}
|
||||
|
||||
bool HostnameSelectScreen::CanComplete(DialogResult result) {
|
||||
auto n = GetI18NCategory("Networking");
|
||||
|
||||
if (result != DR_OK)
|
||||
return true;
|
||||
|
||||
|
@ -1981,12 +1979,12 @@ bool HostnameSelectScreen::CanComplete(DialogResult result) {
|
|||
lastResolvedResult_ = toResolveResult_;
|
||||
|
||||
if (lastResolvedResult_) {
|
||||
errorView_->SetVisibility(UI::V_GONE);
|
||||
progressView_->SetVisibility(UI::V_INVISIBLE);
|
||||
} else {
|
||||
errorView_->SetVisibility(UI::V_VISIBLE);
|
||||
progressView_->SetText(n->T("Invalid IP or hostname"));
|
||||
progressView_->SetTextColor(0xFF3030FF);
|
||||
progressView_->SetVisibility(UI::V_VISIBLE);
|
||||
}
|
||||
progressView_->SetVisibility(UI::V_GONE);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1998,8 +1996,9 @@ bool HostnameSelectScreen::CanComplete(DialogResult result) {
|
|||
toResolve_ = value;
|
||||
resolverCond_.notify_one();
|
||||
|
||||
progressView_->SetText(n->T("Validating address..."));
|
||||
progressView_->SetTextColor(0xFFFFFFFF);
|
||||
progressView_->SetVisibility(UI::V_VISIBLE);
|
||||
errorView_->SetVisibility(UI::V_GONE);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue