summaryrefslogtreecommitdiff
path: root/src/subcircuit/Subcircuit.py
diff options
context:
space:
mode:
authorRahul Paknikar2021-01-08 13:10:30 +0530
committerGitHub2021-01-08 13:10:30 +0530
commit840090d0eedac3c60026269f50f9bb8365e4801b (patch)
treed518be49a0aacfdba9d18f99da73fc9d9fa7271f /src/subcircuit/Subcircuit.py
parenta61c3edf10706ca0231b4441f84f801f0c9d4773 (diff)
parent1b5e07107e5fcf0269de20885a371b54049823e3 (diff)
downloadeSim-2.1.tar.gz
eSim-2.1.tar.bz2
eSim-2.1.zip
Merge pull request #162 from rahulp13/masterv2.1
fixed crash issues
Diffstat (limited to 'src/subcircuit/Subcircuit.py')
-rw-r--r--src/subcircuit/Subcircuit.py13
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)