show dialog if paste crashes

This commit is contained in:
iLLiCiTiT 2021-06-25 15:08:29 +02:00
parent 8eeeda11e7
commit 2e8df3e2d0

View file

@ -199,12 +199,14 @@ class BaseWidget(QtWidgets.QWidget):
try:
self.entity.set(value)
except Exception:
# TODO show dialog
print("Failed")
import sys
import traceback
traceback.print_exception(*sys.exc_info())
dialog = QtWidgets.QMessageBox(self)
dialog.setWindowTitle("Value does not match settings schema")
dialog.setIcon(QtWidgets.QMessageBox.Warning)
dialog.setText((
"Pasted value does not seem to match schema of destination"
" settings entity."
))
dialog.exec_()
def paste_value_to_path():
entity = self.entity.get_entity_from_path(path)