summaryrefslogtreecommitdiff
path: root/src/subcircuit
diff options
context:
space:
mode:
Diffstat (limited to 'src/subcircuit')
-rw-r--r--src/subcircuit/convertSub.py12
-rw-r--r--src/subcircuit/newSub.py16
-rw-r--r--src/subcircuit/uploadSub.py16
3 files changed, 32 insertions, 12 deletions
diff --git a/src/subcircuit/convertSub.py b/src/subcircuit/convertSub.py
index 1439f140..efad8603 100644
--- a/src/subcircuit/convertSub.py
+++ b/src/subcircuit/convertSub.py
@@ -40,16 +40,20 @@ class convertSub(QtGui.QWidget):
var2 = "sub"
self.obj_dockarea.kicadToNgspiceEditor(var1, var2)
else:
- self.msg = QtGui.QErrorMessage(None)
+ self.msg = QtGui.QErrorMessage()
+ self.msg.setModal(True)
+ self.msg.setWindowTitle("Error Message")
self.msg.showMessage(
'The subcircuit does not contain any Kicad netlist file' +
' for conversion.'
)
- self.msg.setWindowTitle("Error Message")
+ self.msg.exec_()
else:
- self.msg = QtGui.QErrorMessage(None)
+ self.msg = QtGui.QErrorMessage()
+ self.msg.setModal(True)
+ self.msg.setWindowTitle("Error Message")
self.msg.showMessage(
'Please select the subcircuit first. You can either create ' +
'new subcircuit or open existing subcircuit'
)
- self.msg.setWindowTitle("Error Message")
+ self.msg.exec_()
diff --git a/src/subcircuit/newSub.py b/src/subcircuit/newSub.py
index 90f60319..f4b3100c 100644
--- a/src/subcircuit/newSub.py
+++ b/src/subcircuit/newSub.py
@@ -55,32 +55,40 @@ class NewSub(QtGui.QWidget):
self.close()
except BaseException:
self.msg = QtGui.QErrorMessage(self)
+ self.msg.setModal(True)
+ self.msg.setWindowTitle("Error Message")
self.msg.showMessage(
'Unable to create subcircuit. Please make sure ' +
'you have write permission on ' + self.schematic_path
)
- self.msg.setWindowTitle("Error Message")
+ self.msg.exec_()
self.obj_appconfig.current_subcircuit['SubcircuitName'] \
= self.schematic_path
elif self.reply == "CHECKEXIST":
self.msg = QtGui.QErrorMessage(self)
+ self.msg.setModal(True)
+ self.msg.setWindowTitle("Error Message")
self.msg.showMessage(
'The subcircuit "' + self.create_schematic +
'" already exist.Please select the different name or delete' +
'existing subcircuit'
)
- self.msg.setWindowTitle("Error Message")
+ self.msg.exec_()
elif self.reply == "CHECKNAME":
self.msg = QtGui.QErrorMessage(self)
+ self.msg.setModal(True)
+ self.msg.setWindowTitle("Error Message")
self.msg.showMessage(
'The subcircuit name should not contain space between them'
)
- self.msg.setWindowTitle("Error Message")
+ self.msg.exec_()
elif self.reply == "NONE":
self.msg = QtGui.QErrorMessage(self)
- self.msg.showMessage('The subcircuit name cannot be empty')
+ self.msg.setModal(True)
self.msg.setWindowTitle("Error Message")
+ self.msg.showMessage('The subcircuit name cannot be empty')
+ self.msg.exec_()
diff --git a/src/subcircuit/uploadSub.py b/src/subcircuit/uploadSub.py
index 34ec8c33..4bb8df34 100644
--- a/src/subcircuit/uploadSub.py
+++ b/src/subcircuit/uploadSub.py
@@ -41,21 +41,25 @@ class UploadSub(QtGui.QWidget):
if ext != '.sub':
self.msg = QtGui.QErrorMessage(self)
- self.msg.showMessage("Please ensure that filename ends with .sub")
+ self.msg.setModal(True)
self.msg.setWindowTitle("Error Message")
+ self.msg.showMessage("Please ensure that filename ends with .sub")
+ self.msg.exec_()
print("Invalid filename")
return
valid = self.obj_validation.validateSubcir(editfile, create_subcircuit)
if not valid:
self.msg = QtGui.QErrorMessage(self)
+ self.msg.setModal(True)
+ self.msg.setWindowTitle("Error Message")
self.msg.showMessage(
"Content of file does not meet the required format. " +
"Please ensure that file starts with **.subckt " +
create_subcircuit + " ** and ends with **.ends " +
create_subcircuit + " **"
)
- self.msg.setWindowTitle("Error Message")
+ self.msg.exec_()
print("Invalid file format")
return
@@ -80,15 +84,19 @@ class UploadSub(QtGui.QWidget):
print("Project name already exists.")
print("==========================")
msg = QtGui.QErrorMessage(self)
+ msg.setModal(True)
+ msg.setWindowTitle("Error Message")
msg.showMessage(
"The project already exist. Please select "
"a different name or delete existing project")
- msg.setWindowTitle("Error Message")
+ msg.exec_()
elif reply == "CHECKNAME":
print("Name can not contain space between them")
print("===========================")
msg = QtGui.QErrorMessage(self)
+ msg.setModal(True)
+ msg.setWindowTitle("Error Message")
msg.showMessage(
'The project name should not contain space between them')
- msg.setWindowTitle("Error Message")
+ msg.exec_()