aboutsummaryrefslogtreecommitdiff
path: root/src/preview_thread.py
diff options
context:
space:
mode:
authortassaron2017-07-06 12:40:03 -0400
committertassaron2017-07-06 12:40:03 -0400
commit9986b1c829caa12bcea120bb37ebb57ab5e0e874 (patch)
tree69de06d5e14d41f06e471bf3716be7d23d116c0c /src/preview_thread.py
parent3de45b3629aa994e986245b6af2ef8016818a8e2 (diff)
image options to mirror & saturate colours
and some friendly docstrings
Diffstat (limited to 'src/preview_thread.py')
-rw-r--r--src/preview_thread.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/preview_thread.py b/src/preview_thread.py
index e58f04e..afb5e50 100644
--- a/src/preview_thread.py
+++ b/src/preview_thread.py
@@ -1,3 +1,7 @@
+'''
+ Thread that runs to create QImages for MainWindow's preview label.
+ Processes a queue of component lists.
+'''
from PyQt5 import QtCore, QtGui, uic
from PyQt5.QtCore import pyqtSignal, pyqtSlot
from PIL import Image
@@ -11,6 +15,7 @@ from copy import copy
class Worker(QtCore.QObject):
imageCreated = pyqtSignal(['QImage'])
+ error = pyqtSignal()
def __init__(self, parent=None, queue=None):
QtCore.QObject.__init__(self)
@@ -59,12 +64,15 @@ class Worker(QtCore.QObject):
"This is a fatal error." %
str(component),
detail=str(e),
- icon='Warning'
+ icon='Warning',
+ parent=None # mainwindow is in a different thread
)
- quit(1)
-
- self._image = ImageQt(frame)
- self.imageCreated.emit(QtGui.QImage(self._image))
+ from frame import BlankFrame
+ self.imageCreated.emit(ImageQt(BlankFrame))
+ self.error.emit()
+ break
+ else:
+ self.imageCreated.emit(ImageQt(frame))
except Empty:
True