From e00f461c5ee06dfbf5229b8f85403644187c989a Mon Sep 17 00:00:00 2001 From: BasioMeusPuga Date: Thu, 1 Mar 2018 12:36:40 +0530 Subject: [PATCH] Implement bookmarks for comic view, Update TODO --- TODO | 13 ++++++++----- widgets.py | 16 +++++++++++----- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/TODO b/TODO index 18eca64..0b6c1ce 100644 --- a/TODO +++ b/TODO @@ -1,9 +1,8 @@ TODO Options: - Automatic library management + ✓ Automatic library management ✓ Recursive file addition ✓ Auto deletion - Add only one file type if multiple are present ✓ Remember files ✓ Check files (hashes) upon restart ✓ Draw shadows @@ -21,7 +20,6 @@ TODO ✓ Memory management ✓ Mass tagging ✓ Add capability to sort by new - ? Create emblem per filetype Table view Ignore a / the / numbers for sorting purposes Information dialog widget @@ -64,19 +62,24 @@ TODO mobi, azw support Other: ✓ Define every widget in code - Include icons for filetype emblems Bugs: If there are files open and the database is deleted, TypeErrors result Closing a fullscreened contentView does not save settings Secondary: + Annotations Graphical themes Goodreads API: Ratings, Read, Recommendations Get ISBN using python-isbnlib Pagination Use embedded fonts Scrolling: Smooth / By Line + ? Add only one file type if multiple are present Shift to logging instead of print statements ? Plugin system for parsers ? pdf support - txt, doc, chm, djvu, fb2 support \ No newline at end of file + ? Create emblem per filetype + txt, doc, chm, djvu, fb2 support + Include icons for filetype emblems + Drag and drop support for the library + Leave comic images on disk in case tab isn't closed and files are remembered \ No newline at end of file diff --git a/widgets.py b/widgets.py index 586f986..8a08674 100644 --- a/widgets.py +++ b/widgets.py @@ -295,10 +295,15 @@ class Tab(QtWidgets.QWidget): self.dockWidget.show() def add_bookmark(self): - chapter, scroll_position, visible_text = self.contentView.record_scroll_position(True) - description = 'New bookmark' - search_data = (scroll_position, visible_text) identifier = uuid.uuid4().hex[:10] + description = 'New bookmark' + + if self.are_we_doing_images_only: + chapter = self.metadata['position']['current_chapter'] + search_data = (0, None) + else: + chapter, scroll_position, visible_text = self.contentView.record_scroll_position(True) + search_data = (scroll_position, visible_text) self.metadata['bookmarks'][identifier] = { 'chapter': chapter, @@ -328,11 +333,12 @@ class Tab(QtWidgets.QWidget): search_data = self.proxy_model.data(index, QtCore.Qt.UserRole + 1) self.window().bookToolBar.tocBox.setCurrentIndex(chapter - 1) - self.set_scroll_value(False, search_data) + if not self.are_we_doing_images_only: + self.set_scroll_value(False, search_data) def generate_bookmark_model(self): # TODO - # Get the proxy model to sort this + # Sorting is not working correctly for i in self.metadata['bookmarks'].items(): self.add_bookmark_to_model(