From e5cd2f26811170abf5dcbba5b06bd4a823825d76 Mon Sep 17 00:00:00 2001 From: Nils <> Date: Sat, 25 Apr 2020 00:17:51 +0200 Subject: [PATCH] Prevent escape from closing only the inner widget in new session dialog --- qtgui/projectname.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qtgui/projectname.py b/qtgui/projectname.py index d52ef78..b608462 100644 --- a/qtgui/projectname.py +++ b/qtgui/projectname.py @@ -29,7 +29,7 @@ import os #Third Party from PyQt5 import QtCore, QtWidgets -#Qt +#QtGui from .designer.projectname import Ui_ProjectName from .designer.newsession import Ui_NewSession @@ -37,6 +37,7 @@ from .designer.newsession import Ui_NewSession from engine.config import METADATA #includes METADATA only. No other environmental setup is executed. import engine.api as api + class ProjectNameWidget(QtWidgets.QDialog): """Ask the user for a project name. Either for renaming, new or copy. Will have a live-detection """ @@ -121,6 +122,7 @@ class NewSessionDialog(QtWidgets.QDialog): self.projectName.ui.buttonBox.hide() self.ui.nameGroupBox.layout().addWidget(self.projectName) self.projectName.ui.name.returnPressed.connect(self.ok.click) #We want to accept everything when return is pressed. + self.projectName.reject = self.reject #forward escape to our reject self.result = None @@ -141,7 +143,6 @@ class NewSessionDialog(QtWidgets.QDialog): self.projectName.ui.name.setFocus(True) self.exec_() - def process(self): """Careful! Calling this eats python errors without notice. Make sure your objects exists and your syntax is correct"""