diff --git a/TODO b/TODO index 01d2647..9fb97bb 100644 --- a/TODO +++ b/TODO @@ -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 \ No newline at end of file + 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 \ No newline at end of file diff --git a/__main__.py b/__main__.py index aa54b0a..f39cdc8 100755 --- a/__main__.py +++ b/__main__.py @@ -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() diff --git a/models.py b/models.py index e2b0b3e..2554290 100644 --- a/models.py +++ b/models.py @@ -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: diff --git a/widgets.py b/widgets.py index a23361f..2445cc7 100644 --- a/widgets.py +++ b/widgets.py @@ -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)