From d979750ea831bae780da20fefd92a93b026702c2 Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Thu, 6 Aug 2020 00:41:48 +0530 Subject: added NGHDL main window as parent to the message windows --- src/createKicadLibrary.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/createKicadLibrary.py') diff --git a/src/createKicadLibrary.py b/src/createKicadLibrary.py index 65d9a9f..e98d0d0 100644 --- a/src/createKicadLibrary.py +++ b/src/createKicadLibrary.py @@ -7,8 +7,9 @@ from PyQt5 import QtWidgets class AutoSchematic(QtWidgets.QWidget): - def __init__(self, modelname): + def __init__(self, parent, modelname): QtWidgets.QWidget.__init__(self) + self.parent = parent self.modelname = modelname.split('.')[0] self.template = Appconfig.kicad_lib_template.copy() self.xml_loc = Appconfig.xml_loc @@ -35,7 +36,7 @@ class AutoSchematic(QtWidgets.QWidget): elif (xmlFound == os.path.join(self.xml_loc, 'Nghdl')): print('Library already exists...') ret = QtWidgets.QMessageBox.warning( - self, "Warning", '''Library files for this model ''' + + self.parent, "Warning", '''Library files for this model ''' + '''already exist. Do you want to overwrite it?
If yes press ok, else cancel it and ''' + '''change the name of your vhdl file.''', @@ -53,7 +54,7 @@ class AutoSchematic(QtWidgets.QWidget): else: print('Pre existing library...') ret = QtWidgets.QMessageBox.critical( - self, "Error", '''A standard library already exists ''' + + self.parent, "Error", '''A standard library already exists ''' + '''with this name.
Please change the name ''' + '''of your vhdl file and upload it again''', QtWidgets.QMessageBox.Ok @@ -231,7 +232,7 @@ class AutoSchematic(QtWidgets.QWidget): os.chdir(cwd) print('Leaving directory, ', self.lib_loc) QtWidgets.QMessageBox.information( - self, "Library added", + self.parent, "Library added", '''Library details for this model is added to the ''' + '''eSim_Nghdl.lib in the KiCad shared directory''', QtWidgets.QMessageBox.Ok -- cgit