From d83c0123ed3e51ef1e8d6a164e87343dd5335331 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 17 Sep 2020 02:10:10 +0200 Subject: Show error message on failure to load image for same page Show title of manga when viewing pages --- src/ImageViewer.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/ImageViewer.cpp') diff --git a/src/ImageViewer.cpp b/src/ImageViewer.cpp index d2b1a95..fc31274 100644 --- a/src/ImageViewer.cpp +++ b/src/ImageViewer.cpp @@ -7,9 +7,10 @@ #include namespace QuickMedia { - ImageViewer::ImageViewer(Manga *manga, const std::string &images_url, const std::string &chapter_title, int current_page, const Path &chapter_cache_dir, sf::Font *font) : + ImageViewer::ImageViewer(Manga *manga, const std::string &images_url, const std::string &content_title, const std::string &chapter_title, int current_page, const Path &chapter_cache_dir, sf::Font *font) : current_page(current_page), num_pages(0), + content_title(content_title), chapter_title(chapter_title), chapter_cache_dir(chapter_cache_dir), focused_page(current_page), @@ -101,7 +102,7 @@ namespace QuickMedia { // TODO: Make image loading asynchronous if(get_file_type(image_path) == FileType::REGULAR) { - fprintf(stderr, "ImageViewer: Load page %d\n", 1 + page); + fprintf(stderr, "ImageViewer: Loaded page %d\n", 1 + page); page_image_data = std::make_unique(); page_image_data->visible_on_screen = true; std::string image_data; @@ -268,7 +269,7 @@ namespace QuickMedia { if(focused_page != prev_focused_page) { prev_focused_page = focused_page; - page_text.setString(chapter_title + " | Page " + std::to_string(1 + focused_page) + "/" + std::to_string(num_pages)); + page_text.setString(content_title + " | " + chapter_title + " | Page " + std::to_string(1 + focused_page) + "/" + std::to_string(num_pages)); } const float font_height = page_text.getCharacterSize() + 8.0f; @@ -287,7 +288,7 @@ namespace QuickMedia { int i = 0; for(auto &page_data : image_data) { if(page_data && !page_data->visible_on_screen) { - fprintf(stderr, "ImageViewer: Unload page %d\n", 1 + i); + fprintf(stderr, "ImageViewer: Unloaded page %d\n", 1 + i); page_data.reset(); } ++i; -- cgit v1.2.3