mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 05:19:56 +00:00
Store: Display the error code in case of error downloading the json.
See #14572
This commit is contained in:
parent
08561a2391
commit
821a6a60aa
@ -144,6 +144,7 @@ private:
|
||||
int PerformGET(const std::string &url);
|
||||
std::string RedirectLocation(const std::string &baseUrl);
|
||||
void SetFailed(int code);
|
||||
|
||||
RequestProgress progress_;
|
||||
Buffer buffer_;
|
||||
std::vector<std::string> responseHeaders_;
|
||||
|
@ -381,6 +381,7 @@ void StoreScreen::update() {
|
||||
g_DownloadManager.Update();
|
||||
|
||||
if (listing_.get() != 0 && listing_->Done()) {
|
||||
resultCode_ = listing_->ResultCode();
|
||||
if (listing_->ResultCode() == 200) {
|
||||
std::string listingJson;
|
||||
listing_->buffer().TakeAll(&listingJson);
|
||||
@ -392,7 +393,7 @@ void StoreScreen::update() {
|
||||
RecreateViews();
|
||||
} else {
|
||||
// Failed to contact store. Don't do anything.
|
||||
ERROR_LOG(IO, "Download failed : error code %d", listing_->ResultCode());
|
||||
ERROR_LOG(IO, "Download failed : error code %d", resultCode_);
|
||||
connectionError_ = true;
|
||||
loading_ = false;
|
||||
RecreateViews();
|
||||
@ -468,7 +469,7 @@ void StoreScreen::CreateViews() {
|
||||
LinearLayout *content;
|
||||
if (connectionError_ || loading_) {
|
||||
content = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, FILL_PARENT, 1.0f));
|
||||
content->Add(new TextView(loading_ ? st->T("Loading...") : st->T("Connection Error")));
|
||||
content->Add(new TextView(loading_ ? std::string(st->T("Loading...")) : StringFromFormat("%s: %d", st->T("Connection Error"), resultCode_)));
|
||||
content->Add(new Button(di->T("Retry")))->OnClick.Handle(this, &StoreScreen::OnRetry);
|
||||
content->Add(new Button(di->T("Back")))->OnClick.Handle<UIScreen>(this, &UIScreen::OnBack);
|
||||
|
||||
|
@ -92,6 +92,7 @@ private:
|
||||
|
||||
bool loading_ = true;
|
||||
bool connectionError_ = false;
|
||||
int resultCode_ = 0;
|
||||
|
||||
std::map<std::string, StoreCategory> categories_;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user