From 94326c365e361137412272a46caafe7f97620196 Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Sat, 15 Feb 2020 14:41:09 +0530 Subject: set modality to QErrorMessage --- src/kicadtoNgspice/Convert.py | 5 +++-- src/kicadtoNgspice/KicadtoNgspice.py | 8 ++++++-- src/kicadtoNgspice/SubcircuitTab.py | 20 ++++++++++++-------- 3 files changed, 21 insertions(+), 12 deletions(-) (limited to 'src/kicadtoNgspice') diff --git a/src/kicadtoNgspice/Convert.py b/src/kicadtoNgspice/Convert.py index ae26f3b8..7ab57427 100644 --- a/src/kicadtoNgspice/Convert.py +++ b/src/kicadtoNgspice/Convert.py @@ -585,10 +585,11 @@ class Convert: if len(self.obj_track.subcircuitList) != len( self.obj_track.subcircuitTrack): self.msg = QtGui.QErrorMessage() + self.msg.setModal(True) + self.msg.setWindowTitle("Error Message") self.msg.showMessage( "Conversion failed. Please add all Subcircuits.") - self.msg.setWindowTitle("Error Message") - self.msg.show() + self.msg.exec_() raise Exception('All subcircuit directories need to be specified.') elif not subList: print("No Subcircuit Added in the schematic") diff --git a/src/kicadtoNgspice/KicadtoNgspice.py b/src/kicadtoNgspice/KicadtoNgspice.py index ab2e55e8..cfc4f671 100644 --- a/src/kicadtoNgspice/KicadtoNgspice.py +++ b/src/kicadtoNgspice/KicadtoNgspice.py @@ -121,18 +121,22 @@ class MainWindow(QtGui.QWidget): if unknownModelList: print("Unknown Model List is : ", unknownModelList) self.msg = QtGui.QErrorMessage() + self.msg.setModal(True) + self.msg.setWindowTitle("Unknown Models") self.content = "Your schematic contain unknown model " + \ ', '.join(unknownModelList) self.msg.showMessage(self.content) - self.msg.setWindowTitle("Unknown Models") + self.msg.exec_() elif multipleModelList: self.msg = QtGui.QErrorMessage() + self.msg.setModal(True) + self.msg.setWindowTitle("Multiple Models") self.mcontent = "Look like you have duplicate model in \ modelParamXML directory " + \ ', '.join(multipleModelList[0]) self.msg.showMessage(self.mcontent) - self.msg.setWindowTitle("Multiple Models") + self.msg.exec_() else: self.createMainWindow() diff --git a/src/kicadtoNgspice/SubcircuitTab.py b/src/kicadtoNgspice/SubcircuitTab.py index 116b70b1..08ad7332 100644 --- a/src/kicadtoNgspice/SubcircuitTab.py +++ b/src/kicadtoNgspice/SubcircuitTab.py @@ -156,17 +156,19 @@ class SubcircuitTab(QtGui.QWidget): self.obj_trac.subcircuitTrack[self.subName] = self.subfile elif self.reply == "PORT": self.msg = QtGui.QErrorMessage(self) + self.msg.setModal(True) + self.msg.setWindowTitle("Error Message") self.msg.showMessage( "Please select a Subcircuit with correct number of ports.") - self.msg.setWindowTitle("Error Message") - self.msg.show() + self.msg.exec_() elif self.reply == "DIREC": self.msg = QtGui.QErrorMessage(self) + self.msg.setModal(True) + self.msg.setWindowTitle("Error Message") self.msg.showMessage( "Please select a valid Subcircuit directory " "(Containing '.sub' file).") - self.msg.setWindowTitle("Error Message") - self.msg.show() + self.msg.exec_() def trackSubcircuitWithoutButton(self, iter_value, path_value): """ @@ -189,14 +191,16 @@ class SubcircuitTab(QtGui.QWidget): self.obj_trac.subcircuitTrack[self.subName] = self.subfile elif self.reply == "PORT": self.msg = QtGui.QErrorMessage(self) + self.msg.setModal(True) + self.msg.setWindowTitle("Error Message") self.msg.showMessage( "Please select a Subcircuit with correct number of ports.") - self.msg.setWindowTitle("Error Message") - self.msg.show() + self.msg.exec_() elif self.reply == "DIREC": self.msg = QtGui.QErrorMessage(self) + self.msg.setModal(True) + self.msg.setWindowTitle("Error Message") self.msg.showMessage( "Please select a valid Subcircuit directory " "(Containing '.sub' file).") - self.msg.setWindowTitle("Error Message") - self.msg.show() + self.msg.exec_() -- cgit