aboutsummaryrefslogtreecommitdiff
path: root/src/mainwindow.py
diff options
context:
space:
mode:
authortassaron2017-07-23 17:14:21 -0400
committertassaron2017-07-23 17:14:21 -0400
commitd38109453cea17a31c335837c0029ad51fa3dda1 (patch)
tree57611d2a48795d824972c92756283bf16d44e3fe /src/mainwindow.py
parentbf0890e7c87c730b8970c1a20c5b6a9a1a55d203 (diff)
better component error messages
fatal errors cancel the export instead of crashing
Diffstat (limited to 'src/mainwindow.py')
-rw-r--r--src/mainwindow.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/mainwindow.py b/src/mainwindow.py
index f333513..a32c1b4 100644
--- a/src/mainwindow.py
+++ b/src/mainwindow.py
@@ -571,6 +571,15 @@ class MainWindow(QtWidgets.QMainWindow):
self.videoWorker.encoding.connect(self.changeEncodingStatus)
self.createVideo.emit()
+ @QtCore.pyqtSlot(str, str)
+ def videoThreadError(self, msg, detail):
+ self.showMessage(
+ msg=msg,
+ detail=detail,
+ icon='Warning',
+ )
+ self.stopVideo()
+
def changeEncodingStatus(self, status):
self.encoding = status
if status:
@@ -675,6 +684,8 @@ class MainWindow(QtWidgets.QMainWindow):
# connect to signal that adds an asterisk when modified
self.core.selectedComponents[index].modified.connect(
self.updateComponentTitle)
+ self.core.selectedComponents[index]._error.connect(
+ self.videoThreadError)
self.pages.insert(index, self.core.selectedComponents[index].page)
stackedWidget.insertWidget(index, self.pages[index])
@@ -751,7 +762,7 @@ class MainWindow(QtWidgets.QMainWindow):
if mousePos > -1:
change = (componentList.currentRow() - mousePos) * -1
else:
- change = (componentList.count() - componentList.currentRow() -1)
+ change = (componentList.count() - componentList.currentRow() - 1)
self.moveComponent(change)
def changeComponentWidget(self):
@@ -936,7 +947,7 @@ class MainWindow(QtWidgets.QMainWindow):
if event.type() == QtCore.QEvent.WindowActivate \
or event.type() == QtCore.QEvent.FocusIn:
Core.windowHasFocus = True
- elif event.type()== QtCore.QEvent.WindowDeactivate \
+ elif event.type() == QtCore.QEvent.WindowDeactivate \
or event.type() == QtCore.QEvent.FocusOut:
Core.windowHasFocus = False
return False