def _save_callback(self, event=None):
    if (len(self.animation.key_frames) < 2):
        error_dialog = QErrorMessage()
        error_dialog.showMessage(f'You need at least two key frames to generate                 an animation. Your only have {len(self.animation.key_frames)}')
        error_dialog.exec_()
    else:
        filters = 'Video files (*.mp4 *.gif *.mov *.avi *.mpg *.mpeg *.mkv *.wmv);;Folder of PNGs (*)'
        (filename, _filter) = QFileDialog.getSaveFileName(self, 'Save animation', str(Path.home()), filters)
        if filename:
            self.animation.animate(filename)
def _save_callback(self, event=None):
    if (len(self.animation.key_frames) < 2):
        error_dialog = QErrorMessage()
        error_dialog.showMessage(f'You need at least two key frames to generate                 an animation. Your only have {len(self.animation.key_frames)}')
        error_dialog.exec_()
    else:
        filters = 'Video files (*.mp4 *.gif *.mov *.avi *.mpg *.mpeg *.mkv *.wmv);;Folder of PNGs (*)'
        (filename, _filter) = QFileDialog.getSaveFileName(self, 'Save animation', str(Path.home()), filters)
        if filename:
            self.animation.animate(filename)