diff options
author | rahulp13 | 2020-12-14 21:08:43 +0530 |
---|---|---|
committer | rahulp13 | 2020-12-14 21:08:43 +0530 |
commit | 779eac4d604c082442ba9ca72a7c23509a78e5f5 (patch) | |
tree | 43831dac148767334754754988a6abc5c4352f9e /src/subcircuit/Subcircuit.py | |
parent | b3b25b6f1b6c5202620548cce59985d8b79a495f (diff) | |
download | eSim-779eac4d604c082442ba9ca72a7c23509a78e5f5.tar.gz eSim-779eac4d604c082442ba9ca72a7c23509a78e5f5.tar.bz2 eSim-779eac4d604c082442ba9ca72a7c23509a78e5f5.zip |
changed QFileDialog separator and handled crash exception for all input fields
Diffstat (limited to 'src/subcircuit/Subcircuit.py')
-rw-r--r-- | src/subcircuit/Subcircuit.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/subcircuit/Subcircuit.py b/src/subcircuit/Subcircuit.py index 298ff96e..eb06e145 100644 --- a/src/subcircuit/Subcircuit.py +++ b/src/subcircuit/Subcircuit.py @@ -64,8 +64,19 @@ class Subcircuit(QtWidgets.QWidget): def newsch(self): text, ok = QtWidgets.QInputDialog.getText( - self, 'New Schematic', 'Enter Schematic Name:') + self, 'New Schematic', 'Enter Schematic Name:' + ) if ok: + if not text: + print("Schematic name cannot be empty") + print("==================") + msg = QtWidgets.QErrorMessage(self) + msg.setModal(True) + msg.setWindowTitle("Error Message") + msg.showMessage('The schematic name cannot be empty') + msg.exec_() + return + self.schematic_name = (str(text)) self.subcircuit = NewSub() self.subcircuit.createSubcircuit(self.schematic_name) |