mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 21:59:17 +00:00
GUI: Add error callback in Options' Cloud tab
Shows OSD message.
This commit is contained in:
parent
1d78d20fcf
commit
63311bac26
@ -1624,10 +1624,17 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
|
||||
}
|
||||
case kRefreshStorageCmd:
|
||||
{
|
||||
CloudMan.info(new Common::Callback<GlobalOptionsDialog, Cloud::Storage::StorageInfoResponse>(this, &GlobalOptionsDialog::storageInfoCallback), nullptr);
|
||||
CloudMan.info(
|
||||
new Common::Callback<GlobalOptionsDialog, Cloud::Storage::StorageInfoResponse>(this, &GlobalOptionsDialog::storageInfoCallback),
|
||||
new Common::Callback<GlobalOptionsDialog, Networking::ErrorResponse>(this, &GlobalOptionsDialog::storageErrorCallback)
|
||||
);
|
||||
Common::String dir = CloudMan.savesDirectoryPath();
|
||||
if (dir.lastChar() == '/') dir.deleteLastChar();
|
||||
CloudMan.listDirectory(dir, new Common::Callback<GlobalOptionsDialog, Cloud::Storage::ListDirectoryResponse>(this, &GlobalOptionsDialog::storageListDirectoryCallback), nullptr);
|
||||
CloudMan.listDirectory(
|
||||
dir,
|
||||
new Common::Callback<GlobalOptionsDialog, Cloud::Storage::ListDirectoryResponse>(this, &GlobalOptionsDialog::storageListDirectoryCallback),
|
||||
new Common::Callback<GlobalOptionsDialog, Networking::ErrorResponse>(this, &GlobalOptionsDialog::storageErrorCallback)
|
||||
);
|
||||
break;
|
||||
}
|
||||
case kDownloadStorageCmd:
|
||||
@ -1825,6 +1832,14 @@ void GlobalOptionsDialog::storageListDirectoryCallback(Cloud::Storage::ListDirec
|
||||
CloudMan.setStorageUsedSpace(CloudMan.getStorageIndex(), totalSize);
|
||||
_redrawCloudTab = true;
|
||||
}
|
||||
|
||||
void GlobalOptionsDialog::storageErrorCallback(Networking::ErrorResponse response) {
|
||||
debug("error response (%s, %ld):", (response.failed ? "failed" : "interrupted"), response.httpResponseCode);
|
||||
debug("%s", response.response.c_str());
|
||||
|
||||
if (!response.interrupted)
|
||||
g_system->displayMessageOnOSD(_("Request failed.\nCheck your Internet connection."));
|
||||
}
|
||||
#endif
|
||||
|
||||
} // End of namespace GUI
|
||||
|
@ -277,6 +277,7 @@ protected:
|
||||
#ifdef USE_LIBCURL
|
||||
void storageInfoCallback(Cloud::Storage::StorageInfoResponse response);
|
||||
void storageListDirectoryCallback(Cloud::Storage::ListDirectoryResponse response);
|
||||
void storageErrorCallback(Networking::ErrorResponse response);
|
||||
#endif
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user