From 2ba21aa9aa91b975fe0c8be630dde05d0d9b5366 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 13 Oct 2019 03:32:07 +0200 Subject: Manganelo: Download all images at once, and show page after it has downloaded --- include/QuickMedia.hpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'include/QuickMedia.hpp') diff --git a/include/QuickMedia.hpp b/include/QuickMedia.hpp index 70c7001..8479d58 100644 --- a/include/QuickMedia.hpp +++ b/include/QuickMedia.hpp @@ -14,6 +14,7 @@ namespace QuickMedia { class Plugin; + class Manganelo; class Program { public: @@ -30,6 +31,14 @@ namespace QuickMedia { void content_list_page(); void content_details_page(); + enum class LoadImageResult { + OK, + FAILED, + DOWNLOAD_IN_PROGRESS + }; + + LoadImageResult load_image_by_index(int image_index, sf::Texture &image_texture, sf::String &error_message); + void download_chapter_images_if_needed(Manganelo *image_plugin); void select_episode(BodyItem *item, bool start_from_beginning); private: sf::RenderWindow window; @@ -49,8 +58,13 @@ namespace QuickMedia { std::string chapter_title; int image_index; Path content_storage_file; + Path content_cache_dir; + std::string manga_id_base64; Json::Value content_storage_json; std::unordered_set watched_videos; std::future search_suggestion_future; + std::future image_download_future; + std::string downloading_chapter_url; + bool image_download_cancel; }; } \ No newline at end of file -- cgit v1.2.3