From cb55e59de7ee4383c04edfae7c39ad9ae9552b36 Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Fri, 14 Feb 2020 15:16:35 +0530 Subject: common code for Win and Linux, merged py2 changes --- src/projManagement/newProject.py | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'src/projManagement/newProject.py') diff --git a/src/projManagement/newProject.py b/src/projManagement/newProject.py index 6f8de2b9..b7cce397 100644 --- a/src/projManagement/newProject.py +++ b/src/projManagement/newProject.py @@ -1,5 +1,4 @@ # ========================================================================= -# # FILE: newProject.py # # USAGE: --- @@ -11,10 +10,12 @@ # BUGS: --- # NOTES: --- # AUTHOR: Fahim Khan, fahim.elex@gmail.com +# MODIFIED: Rahul Paknikar, rahulp@iitb.ac.in # ORGANIZATION: eSim team at FOSSEE, IIT Bombay. # CREATED: Wednesday 12 February 2015 -# REVISION: --- +# REVISION: Friday 14 February 2020 # ========================================================================= + from PyQt4 import QtGui from .Validation import Validation from configuration.Appconfig import Appconfig @@ -59,7 +60,6 @@ class NewProjectInfo(QtGui.QWidget): :filelist => The files inside the project folder """ - # print "Create Project Called" self.projName = projName self.workspace = self.obj_appconfig.default_workspace['workspace'] # self.projName = self.projEdit.text() @@ -84,12 +84,11 @@ class NewProjectInfo(QtGui.QWidget): self.projDir, self.projName + ".proj") f = open(self.projFile, "w") except BaseException: - # print "Some Thing Went Wrong" self.msg = QtGui.QErrorMessage(self) self.msg.showMessage( - 'Unable to create project. Please make sure you have' - + ' write permission on ' - + self.workspace) + 'Unable to create project. Please make sure you have ' + + 'write permission on ' + self.workspace + ) self.msg.setWindowTitle("Error Message") f.write("schematicFile " + self.projName + ".sch\n") f.close() @@ -112,24 +111,21 @@ class NewProjectInfo(QtGui.QWidget): return self.projDir, newprojlist elif self.reply == "CHECKEXIST": - # print "Project already exist" self.msg = QtGui.QErrorMessage(self) self.msg.showMessage( - 'The project "' - + self.projName - + '" already exist.Please select the different name or delete' - + ' existing project') + 'The project "' + self.projName + + '" already exist.Please select the different name or delete' + + ' existing project' + ) self.msg.setWindowTitle("Error Message") elif self.reply == "CHECKNAME": - # print "Name is not proper" self.msg = QtGui.QErrorMessage(self) self.msg.showMessage( 'The project name should not contain space between them') self.msg.setWindowTitle("Error Message") elif self.reply == "NONE": - # print "Empty Project Name" self.msg = QtGui.QErrorMessage(self) self.msg.showMessage('The project name cannot be empty') self.msg.setWindowTitle("Error Message") -- cgit 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/projManagement/newProject.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/projManagement/newProject.py') 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() -- cgit From 453c2dab78f81046fcbd42034a86c4e759a0ff68 Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Sun, 16 Feb 2020 22:56:59 +0530 Subject: workspace functionality --- src/projManagement/newProject.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/projManagement/newProject.py') diff --git a/src/projManagement/newProject.py b/src/projManagement/newProject.py index b04dbd10..8382883d 100644 --- a/src/projManagement/newProject.py +++ b/src/projManagement/newProject.py @@ -111,7 +111,7 @@ class NewProjectInfo(QtGui.QWidget): json.dump( self.obj_appconfig.project_explorer, open( - self.obj_appconfig.dictPath, 'w')) + self.obj_appconfig.dictPath["path"], 'w')) return self.projDir, newprojlist elif self.reply == "CHECKEXIST": -- cgit