Added saving of assembled pictures and more robust error handling

This commit is contained in:
Balthasar Reuter
2018-03-31 00:02:57 +02:00
parent 1ca0c4d322
commit fb62d2fdb2
4 changed files with 149 additions and 9 deletions

View File

@@ -67,6 +67,8 @@ class PyQt5Gui(Gui.Gui):
# img = QImage(state.picture, state.picture.shape[1], state.picture.shape[0], QImage.Format_RGB888)
img = ImageQt.ImageQt(state.picture)
self._p.setCentralWidget(PyQt5PictureMessage('', img))
elif isinstance(state, Gui.ErrorState):
self.showError(state.title, state.message)
else:
raise ValueError('Unknown state')
@@ -89,6 +91,13 @@ class PyQt5Gui(Gui.Gui):
self._p.setCentralWidget(PyQt5PictureMessage('Hit the button!', 'homer.jpg'))
def showError(self, title, message):
if QMessageBox.warning(self._p, title,message, QMessageBox.Ok,
QMessageBox.Ok) == QMessageBox.Ok:
self.showIdle()
class PyQt5Receiver(QThread):
notify = pyqtSignal(object)