diff --git a/TODO b/TODO index 5c1f48f..f1cedb5 100644 --- a/TODO +++ b/TODO @@ -7,6 +7,7 @@ TODO ✓ Remember files ✓ Check files (hashes) upon restart ✓ Draw shadows + Perform culling Library: ✓ sqlite3 for cover images cache ✓ sqlite3 for storing metadata @@ -42,6 +43,9 @@ TODO ✓ View and hide toolbar actions in a list Graphical themes Comic view keyboard shortcuts + Comic view modes + Continuous paging + Double pages Record progress Pagination Set context menu for definitions and the like diff --git a/__main__.py b/__main__.py index 1618e3c..1c9fbc9 100755 --- a/__main__.py +++ b/__main__.py @@ -140,7 +140,7 @@ class MainUI(QtWidgets.QMainWindow, mainwindow.Ui_MainWindow): self.bookToolBar.profileBox.setCurrentIndex(self.current_profile_index) self.bookToolBar.fontBox.currentFontChanged.connect(self.modify_font) - self.bookToolBar.fontSizeBox.currentTextChanged.connect(self.modify_font) + self.bookToolBar.fontSizeBox.currentIndexChanged.connect(self.modify_font) self.bookToolBar.lineSpacingUp.triggered.connect(self.modify_font) self.bookToolBar.lineSpacingDown.triggered.connect(self.modify_font) self.bookToolBar.paddingUp.triggered.connect(self.modify_font) @@ -663,9 +663,10 @@ class MainUI(QtWidgets.QMainWindow, mainwindow.Ui_MainWindow): if signal_sender == 'fontSizeBox': old_size = current_profile['font_size'] - new_size = self.bookToolBar.fontSizeBox.currentText() + new_size = self.bookToolBar.fontSizeBox.itemText( + self.bookToolBar.fontSizeBox.currentIndex()) if new_size.isdigit(): - current_profile['font_size'] = int(new_size) + current_profile['font_size'] = new_size else: current_profile['font_size'] = old_size @@ -769,7 +770,9 @@ class MainUI(QtWidgets.QMainWindow, mainwindow.Ui_MainWindow): self.bookToolBar.fontBox.blockSignals(True) self.bookToolBar.fontSizeBox.blockSignals(True) self.bookToolBar.fontBox.setCurrentText(font) - self.bookToolBar.fontSizeBox.setCurrentText(str(font_size)) + current_index = self.bookToolBar.fontSizeBox.findText( + str(font_size), QtCore.Qt.MatchExactly) + self.bookToolBar.fontSizeBox.setCurrentIndex(current_index) self.bookToolBar.fontBox.blockSignals(False) self.bookToolBar.fontSizeBox.blockSignals(False) diff --git a/library.py b/library.py index 0c1562f..1dbf538 100644 --- a/library.py +++ b/library.py @@ -165,7 +165,6 @@ class Library: self.parent.libraryToolBar.searchBar.text()) def create_proxymodel(self): - # self.proxy_model = QtCore.QSortFilterProxyModel() self.proxy_model = ItemProxyModel() self.proxy_model.setSourceModel(self.view_model) self.proxy_model.setSortCaseSensitivity(False) @@ -252,13 +251,6 @@ class Library: this_item.setData(directory_name, QtCore.Qt.UserRole + 10) this_item.setData(directory_tags, QtCore.Qt.UserRole + 11) - # search_workaround_base = this_item.data(QtCore.Qt.UserRole + 10) - - # for j in get_tags(all_metadata): - # if j: - # search_workaround_base += j - # this_item.setData(search_workaround_base, QtCore.Qt.UserRole + 4) - # Table Model for count, i in enumerate(self.table_model.display_data): all_metadata = i[5] diff --git a/models.py b/models.py index c757b9c..de7eac8 100644 --- a/models.py +++ b/models.py @@ -52,7 +52,9 @@ class ItemProxyModel(QtCore.QSortFilterProxyModel): if not self.filter_text: return True else: - valid_data = [i.lower() for i in (title, author, tags, directory_name, directory_tags) if i is not None] + valid_data = [ + i.lower() for i in ( + title, author, tags, directory_name, directory_tags) if i is not None] for i in valid_data: if self.filter_text.lower() in i: return True diff --git a/sorter.py b/sorter.py index 1fa4d9b..5888ce4 100644 --- a/sorter.py +++ b/sorter.py @@ -95,10 +95,6 @@ class BookSorter: progress_object_generator() def database_hashes(self): - # TODO - # Overwrite book if deleted and then re-added - # Also fetch the path of the file here - all_hashes_and_paths = database.DatabaseFunctions( self.database_path).fetch_data( ('Hash', 'Path'),