Implement bookmarks for comic view, Update TODO

This commit is contained in:
BasioMeusPuga
2018-03-01 12:36:40 +05:30
parent db28d25767
commit e00f461c5e
2 changed files with 19 additions and 10 deletions

11
TODO
View File

@@ -1,9 +1,8 @@
TODO TODO
Options: Options:
Automatic library management Automatic library management
✓ Recursive file addition ✓ Recursive file addition
✓ Auto deletion ✓ Auto deletion
Add only one file type if multiple are present
✓ Remember files ✓ Remember files
✓ Check files (hashes) upon restart ✓ Check files (hashes) upon restart
✓ Draw shadows ✓ Draw shadows
@@ -21,7 +20,6 @@ TODO
✓ Memory management ✓ Memory management
✓ Mass tagging ✓ Mass tagging
✓ Add capability to sort by new ✓ Add capability to sort by new
? Create emblem per filetype
Table view Table view
Ignore a / the / numbers for sorting purposes Ignore a / the / numbers for sorting purposes
Information dialog widget Information dialog widget
@@ -64,19 +62,24 @@ TODO
mobi, azw support mobi, azw support
Other: Other:
✓ Define every widget in code ✓ Define every widget in code
Include icons for filetype emblems
Bugs: Bugs:
If there are files open and the database is deleted, TypeErrors result If there are files open and the database is deleted, TypeErrors result
Closing a fullscreened contentView does not save settings Closing a fullscreened contentView does not save settings
Secondary: Secondary:
Annotations
Graphical themes Graphical themes
Goodreads API: Ratings, Read, Recommendations Goodreads API: Ratings, Read, Recommendations
Get ISBN using python-isbnlib Get ISBN using python-isbnlib
Pagination Pagination
Use embedded fonts Use embedded fonts
Scrolling: Smooth / By Line Scrolling: Smooth / By Line
? Add only one file type if multiple are present
Shift to logging instead of print statements Shift to logging instead of print statements
? Plugin system for parsers ? Plugin system for parsers
? pdf support ? pdf support
? Create emblem per filetype
txt, doc, chm, djvu, fb2 support 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

View File

@@ -295,10 +295,15 @@ class Tab(QtWidgets.QWidget):
self.dockWidget.show() self.dockWidget.show()
def add_bookmark(self): 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] 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] = { self.metadata['bookmarks'][identifier] = {
'chapter': chapter, 'chapter': chapter,
@@ -328,11 +333,12 @@ class Tab(QtWidgets.QWidget):
search_data = self.proxy_model.data(index, QtCore.Qt.UserRole + 1) search_data = self.proxy_model.data(index, QtCore.Qt.UserRole + 1)
self.window().bookToolBar.tocBox.setCurrentIndex(chapter - 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): def generate_bookmark_model(self):
# TODO # TODO
# Get the proxy model to sort this # Sorting is not working correctly
for i in self.metadata['bookmarks'].items(): for i in self.metadata['bookmarks'].items():
self.add_bookmark_to_model( self.add_bookmark_to_model(