diff --git a/TODO b/TODO index 81005f4..c2f522c 100644 --- a/TODO +++ b/TODO @@ -18,16 +18,14 @@ TODO ✓ Tie file deletion and tab closing to model updates ✓ Create separate thread for parser - Show progress in main window ✓ Memory management + ✓ Mass tagging + ✓ Add capability to sort by new ? Create emblem per filetype Table view Ignore a / the / numbers for sorting purposes - Put the path in the scope of the search - maybe as a type: switch - Mass tagging Information dialog widget Context menu: Cache, Read, Edit database, delete, Mark read/unread Set focus to newly added file - Add capability to sort by new Reading: ✓ Drop down for TOC ✓ Override the keypress event of the textedit @@ -46,7 +44,6 @@ TODO Record progress Pagination Set context menu for definitions and the like - Hide progressbar Filetypes: ✓ cbz, cbr support ✓ Keep font settings enabled but only for background color diff --git a/__main__.py b/__main__.py index b071c99..17f8df4 100755 --- a/__main__.py +++ b/__main__.py @@ -218,7 +218,10 @@ class MainUI(QtWidgets.QMainWindow, mainwindow.Ui_MainWindow): # Open last... open books. # Then set the value to None for the next run - self.open_files(self.settings['last_open_books']) + if self.settings['last_open_books']: + self.open_files(self.settings['last_open_books']) + else: + self.settings['last_open_tab'] = None # Scan the library @ startup if self.settings['scan_library']: @@ -570,6 +573,10 @@ class MainUI(QtWidgets.QMainWindow, mainwindow.Ui_MainWindow): if not file_paths: return + def finishing_touches(): + self.format_contentView() + self.start_culling_timer() + print('Attempting to open: ' + ', '.join(file_paths)) contents = sorter.BookSorter( @@ -596,10 +603,11 @@ class MainUI(QtWidgets.QMainWindow, mainwindow.Ui_MainWindow): if self.settings['last_open_tab'] == this_path: self.tabWidget.setCurrentIndex(i) self.settings['last_open_tab'] = None + finishing_touches() return self.tabWidget.setCurrentIndex(self.tabWidget.count() - 1) - self.format_contentView() + finishing_touches() def get_color(self): signal_sender = self.sender().objectName() diff --git a/library.py b/library.py index 13d7c47..4b8d72f 100644 --- a/library.py +++ b/library.py @@ -248,6 +248,8 @@ class Library: return directory_name, directory_tags + return None, None + # Both the models will have to be done separately # Item Model for i in range(self.view_model.rowCount()): diff --git a/models.py b/models.py index 8e794d0..493ed1e 100644 --- a/models.py +++ b/models.py @@ -153,8 +153,9 @@ class TableProxyModel(QtCore.QSortFilterProxyModel): pass for i in valid_data: - if self.filter_string in i: - return True + if i: + if self.filter_string in i: + return True return False diff --git a/sorter.py b/sorter.py index 7aacbb9..1fa4d9b 100644 --- a/sorter.py +++ b/sorter.py @@ -117,8 +117,7 @@ class BookSorter: ('DateAdded', 'Position', 'Bookmarks'), 'books', {'Hash': file_hash}, - 'EQUALS', - True) + 'EQUALS')[0] book_data = [] for i in database_return: