Miscellaneous fixes

This commit is contained in:
BasioMeusPuga
2018-03-07 09:35:56 +05:30
parent ceb9e93e4a
commit 3919fe530e
4 changed files with 31 additions and 16 deletions

14
TODO
View File

@@ -23,7 +23,7 @@ TODO
✓ Table view
✓ Context menu: Cache, Read, Edit database, delete, Mark read/unread
✓ Information dialog widget
Allow editing of database data through the UI + for Bookmarks
Allow editing of database data through the UI + for Bookmarks
Set focus to newly added file
Change focus rectangle dimensions
Reading:
@@ -69,18 +69,20 @@ TODO
Secondary:
Annotations
Graphical themes
Tab reordering
Allow tabs to detach and form their own windows
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
? 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
Ignore a / the / numbers for sorting purposes
Ignore a / the / numbers for sorting purposes
? Add only one file type if multiple are present
? Plugin system for parsers
? pdf support
? Create emblem per filetype

View File

@@ -227,6 +227,14 @@ class MainUI(QtWidgets.QMainWindow, mainwindow.Ui_MainWindow):
"QListView {{background-color: {0}}}".format(
self.settings['listview_background'].name()))
# TODO
# Maybe use this for readjusting the border of the focus rectangle
# in the listView
# self.listView.setStyleSheet(
# "QListView::item:selected { border-color:blue; border-style:outset;"
# "border-width:2px; color:black; }")
# TableView
self.tableView.doubleClicked.connect(self.library_doubleclick)
self.tableView.horizontalHeader().setSectionResizeMode(
@@ -650,8 +658,8 @@ class MainUI(QtWidgets.QMainWindow, mainwindow.Ui_MainWindow):
if model_index:
self.lib_ref.view_model.setData(
model_index, current_tab.metadata, QtCore.Qt.UserRole + 3)
self.lib_ref.view_model.setData(
model_index, position_perc, QtCore.Qt.UserRole + 7)
# self.lib_ref.view_model.setData(
# model_index, position_perc, QtCore.Qt.UserRole + 7)
# Go on to change the value of the Table of Contents box
current_tab.change_chapter_tocBox()

View File

@@ -122,6 +122,8 @@ class TableProxyModel(QtCore.QSortFilterProxyModel):
current_chapter = position['current_chapter']
total_chapters = position['total_chapters']
# TODO
# See if there's any rationale for this
if current_chapter == 1:
raise KeyError
except KeyError:

View File

@@ -168,16 +168,19 @@ class Tab(QtWidgets.QWidget):
scroll_position = scroll_value * self.contentView.verticalScrollBar().maximum()
self.contentView.verticalScrollBar().setValue(scroll_position * 1.1)
search_text = self.metadata['position']['last_visible_text']
if search_data:
search_text = search_data[1]
try:
search_text = self.metadata['position']['last_visible_text']
if search_data:
search_text = search_data[1]
if search_text:
self.contentView.find(search_text)
if search_text:
self.contentView.find(search_text)
text_cursor = self.contentView.textCursor()
text_cursor.clearSelection()
self.contentView.setTextCursor(text_cursor)
text_cursor = self.contentView.textCursor()
text_cursor.clearSelection()
self.contentView.setTextCursor(text_cursor)
except KeyError:
pass
if switch_widgets:
self.window().tabWidget.setCurrentWidget(previous_widget)