diff --git a/photobooth/Photobooth.py b/photobooth/Photobooth.py index 7975014..a6e51d5 100644 --- a/photobooth/Photobooth.py +++ b/photobooth/Photobooth.py @@ -198,8 +198,7 @@ class Photobooth: def capturePictures(self): - pictures = [ self.captureSinglePicture() for _ in range(self._pic_dims.totalNumPictures) ] - return self.assemblePictures(pictures) + return [ self.captureSinglePicture() for _ in range(self._pic_dims.totalNumPictures) ] def trigger(self): @@ -210,7 +209,10 @@ class Photobooth: sleep(self.greeterTime) - img = self.capturePictures() + pics = self.capturePictures() + self._send.send(gui.AssembleState()) + + img = self.assemblePictures(pics) img.save(self.getNextFilename(), 'JPEG') self._send.send(gui.PictureState(img)) diff --git a/photobooth/gui/PyQt5Gui.py b/photobooth/gui/PyQt5Gui.py index 7923a78..9548f25 100644 --- a/photobooth/gui/PyQt5Gui.py +++ b/photobooth/gui/PyQt5Gui.py @@ -87,6 +87,8 @@ class PyQt5Gui(Gui): self._p.setCentralWidget(PyQt5PictureMessage(state.message, img)) elif isinstance(state, PoseState): self._p.setCentralWidget(PyQt5PictureMessage('Pose!')) + elif isinstance(state, AssembleState): + self._p.setCentralWidget(PyQt5PictureMessage('Please wait!\nAssembling picture...')) elif isinstance(state, PictureState): img = ImageQt.ImageQt(state.picture) self._p.setCentralWidget(PyQt5PictureMessage('', img)) diff --git a/photobooth/gui/__init__.py b/photobooth/gui/__init__.py index 3ef54bc..7ed48b7 100644 --- a/photobooth/gui/__init__.py +++ b/photobooth/gui/__init__.py @@ -129,6 +129,13 @@ class PoseState(GuiState): super().__init__(**kwargs) +class AssembleState(GuiState): + + def __init__(self, **kwargs): + + super().__init__(**kwargs) + + class PreviewState(MessageState, PictureState): def __init__(self, **kwargs):