diff options
Diffstat (limited to 'src/projManagement')
-rw-r--r-- | src/projManagement/Kicad.py | 31 | ||||
-rw-r--r-- | src/projManagement/newProject.py | 18 |
2 files changed, 34 insertions, 15 deletions
diff --git a/src/projManagement/Kicad.py b/src/projManagement/Kicad.py index c522af56..b2fcb87a 100644 --- a/src/projManagement/Kicad.py +++ b/src/projManagement/Kicad.py @@ -91,14 +91,16 @@ class Kicad: self.obj_workThread.start() 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 project first. You can either ' + 'create new project or open existing project') + self.msg.exec_() self.obj_appconfig.print_warning( 'Please select the project first. You can either ' + 'create new project or open existing project') - self.msg.setWindowTitle("Error Message") ''' # Commenting as it is no longer needed as PCB and Layout will open from @@ -127,13 +129,15 @@ class Kicad: self.obj_workThread.start() 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 project first. You can' + 'either create new project or open existing project') + self.msg.exec_() self.obj_appconfig.print_warning('Please select the project' + 'first. You can either create new project or open existing' + 'project') - self.msg.setWindowTitle("Error Message") def openLayout(self): """ @@ -158,14 +162,15 @@ class Kicad: self.obj_workThread.start() 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 project first. You can' + 'either create new project or open existing project') + self.msg.exec_() self.obj_appconfig.print_warning('Please select the project' + 'first. You can either create new project or open existing' + 'project') - self.msg.setWindowTitle("Error Message") - ''' def openKicadToNgspice(self): @@ -204,21 +209,25 @@ class Kicad: self.obj_dockarea.kicadToNgspiceEditor(var) else: - self.msg = QtGui.QErrorMessage(None) + self.msg = QtGui.QErrorMessage() + self.msg.setModal(True) + self.msg.setWindowTitle("Error Message") self.msg.showMessage( 'The project does not contain any Kicad netlist file ' + 'for conversion.') self.obj_appconfig.print_error( 'The project 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 project first. You can either ' + 'create new project or open existing project') + self.msg.exec_() self.obj_appconfig.print_warning( 'Please select the project first. You can either ' + 'create new project or open existing project') - self.msg.setWindowTitle("Error Message") diff --git a/src/projManagement/newProject.py b/src/projManagement/newProject.py index b7cce397..b04dbd10 100644 --- a/src/projManagement/newProject.py +++ b/src/projManagement/newProject.py @@ -83,13 +83,17 @@ class NewProjectInfo(QtGui.QWidget): self.projFile = os.path.join( self.projDir, self.projName + ".proj") f = open(self.projFile, "w") + except BaseException: self.msg = QtGui.QErrorMessage(self) + self.msg.setModal(True) + self.msg.setWindowTitle("Error Message") self.msg.showMessage( 'Unable to create project. Please make sure you have ' + 'write permission on ' + self.workspace ) - self.msg.setWindowTitle("Error Message") + self.msg.exec_() + f.write("schematicFile " + self.projName + ".sch\n") f.close() @@ -112,23 +116,29 @@ class NewProjectInfo(QtGui.QWidget): elif self.reply == "CHECKEXIST": self.msg = QtGui.QErrorMessage(self) + self.msg.setModal(True) + self.msg.setWindowTitle("Error Message") self.msg.showMessage( 'The project "' + self.projName + '" already exist.Please select the different name or delete' + ' existing project' ) - 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 project 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 project name cannot be empty') + self.msg.setModal(True) self.msg.setWindowTitle("Error Message") + self.msg.showMessage('The project name cannot be empty') + self.msg.exec_() def cancelProject(self): self.close() |