From 7977bde4109a133b4368ac0416b1aa8b7ad87320 Mon Sep 17 00:00:00 2001 From: BasioMeusPuga Date: Sun, 29 Apr 2018 08:11:46 -0400 Subject: [PATCH] Multiple fixes --- TODO | 1 + lector/__main__.py | 6 ++++++ lector/delegates.py | 2 +- lector/sorter.py | 3 ++- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/TODO b/TODO index 9f60426..c5948c6 100644 --- a/TODO +++ b/TODO @@ -104,3 +104,4 @@ TODO Ignore a / the / numbers for sorting purposes ? Add only one file type if multiple are present ? Create emblem per filetype + In application notifications diff --git a/lector/__main__.py b/lector/__main__.py index 9113047..ec90b01 100755 --- a/lector/__main__.py +++ b/lector/__main__.py @@ -670,6 +670,12 @@ class MainUI(QtWidgets.QMainWindow, mainwindow.Ui_MainWindow): True, self.temp_dir.path()).initiate_threads() + # TODO + # Notification feedback in case all books return nothing + + if not contents: + return + for i in contents: # New tabs are created here # Initial position adjustment is carried out by the tab itself diff --git a/lector/delegates.py b/lector/delegates.py index 2370adf..b649aeb 100644 --- a/lector/delegates.py +++ b/lector/delegates.py @@ -49,12 +49,12 @@ class LibraryDelegate(QtWidgets.QStyledItemDelegate): if not file_exists: painter.setOpacity(.7) QtWidgets.QStyledItemDelegate.paint(self, painter, option, index) + painter.setOpacity(1) read_icon = pie_chart.pixmapper( -1, None, self.parent.settings['consider_read_at'], 36) x_draw = option.rect.bottomRight().x() - 30 y_draw = option.rect.bottomRight().y() - 35 painter.drawPixmap(x_draw, y_draw, read_icon) - painter.setOpacity(1) return QtWidgets.QStyledItemDelegate.paint(self, painter, option, index) diff --git a/lector/sorter.py b/lector/sorter.py index 936891c..e4fd72d 100644 --- a/lector/sorter.py +++ b/lector/sorter.py @@ -33,13 +33,14 @@ import io import os +import sys import time import pickle import hashlib import threading # The multiprocessing module does not work correctly on Windows -if os.uname().sysname == 'Windows': +if sys.platform.startswith('win'): from multiprocessing.dummy import Pool, Manager else: from multiprocessing import Pool, Manager