fix: several QoL updates for SD font's UI (#1965)
## Summary * **What is the goal of this PR?** Improve the UI based on feedback from someone on discord > Downloading ALL fonts feature. > 1.1 Disable sleep when downloading, in my case went directly to sleep just right after downloading. > 1.2 It would be great to have and overall progress indicator as we only have the indication of each font family > 1.3 Any cancel or pause function might come in handy in case battery is running out and then resume or retry with pending fonts * **What changes are included?** - Now the UI can show overall progress across every file being downloaded in the batch, not just progress inside the current family. - Extended `HttpDownloader::downloadToFile()` to accept a cancel flag and abort the download. - Rendered a cancel button in the font download UI while a download is in progress. - `preventAutoSleep()` in `FontDownloadActivity.h` now returns true for `state_ == COMPLETE` and `state_ == ERROR` in addition to `LOADING_MANIFEST` and `DOWNLOADING` ## Additional Context Not very satisfied with how `HttpDownloader.cpp` is right now, might try to refactor it after v1.3.0 --- ### AI Usage While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it helps set the right context for reviewers. Did you use AI tools to help write this code? _**PARTIALLY**_
This commit is contained in:
@@ -32,6 +32,6 @@ class HttpDownloader {
|
||||
* Download a file to the SD card with optional credentials.
|
||||
*/
|
||||
static DownloadError downloadToFile(const std::string& url, const std::string& destPath,
|
||||
ProgressCallback progress = nullptr, const std::string& username = "",
|
||||
const std::string& password = "");
|
||||
ProgressCallback progress = nullptr, bool* cancelFlag = nullptr,
|
||||
const std::string& username = "", const std::string& password = "");
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user