diff options
author | Rahul P | 2020-08-08 19:16:28 +0530 |
---|---|---|
committer | GitHub | 2020-08-08 19:16:28 +0530 |
commit | 8255c72075ab3541e8b6cfa7facb4e016157a905 (patch) | |
tree | e86226cc6a609e54133b527ad71912996360722b /src/projManagement | |
parent | 175208c2553bde875968a9bc53176b6039ba9360 (diff) | |
parent | 7871e58975d75eb2b02928f7a48d29113bebeb2b (diff) | |
download | eSim-8255c72075ab3541e8b6cfa7facb4e016157a905.tar.gz eSim-8255c72075ab3541e8b6cfa7facb4e016157a905.tar.bz2 eSim-8255c72075ab3541e8b6cfa7facb4e016157a905.zip |
Merge pull request #156 from rahulp13/master
ported GUI to PyQt5; platform independent paths; launch ngspice through mintty on Win OS
Diffstat (limited to 'src/projManagement')
-rw-r--r-- | src/projManagement/Kicad.py | 16 | ||||
-rw-r--r-- | src/projManagement/Worker.py | 10 | ||||
-rw-r--r-- | src/projManagement/newProject.py | 16 | ||||
-rw-r--r-- | src/projManagement/openProject.py | 18 |
4 files changed, 31 insertions, 29 deletions
diff --git a/src/projManagement/Kicad.py b/src/projManagement/Kicad.py index b2fcb87a..8f25b732 100644 --- a/src/projManagement/Kicad.py +++ b/src/projManagement/Kicad.py @@ -11,16 +11,16 @@ # NOTES: --- # AUTHOR: Fahim Khan, fahim.elex@gmail.com # MODIFIED: Rahul Paknikar, rahulp@iitb.ac.in -# ORGANIZATION: eSim team at FOSSEE, IIT Bombay. +# ORGANIZATION: eSim Team at FOSSEE, IIT Bombay # CREATED: Tuesday 17 February 2015 -# REVISION: Friday 14 February 2020 +# REVISION: Sunday 26 July 2020 # ========================================================================= import os from . import Validation from configuration.Appconfig import Appconfig from . import Worker -from PyQt4 import QtGui +from PyQt5 import QtWidgets class Kicad: @@ -91,7 +91,7 @@ class Kicad: self.obj_workThread.start() else: - self.msg = QtGui.QErrorMessage() + self.msg = QtWidgets.QErrorMessage() self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage( @@ -129,7 +129,7 @@ class Kicad: self.obj_workThread.start() else: - self.msg = QtGui.QErrorMessage() + self.msg = QtWidgets.QErrorMessage() self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage('Please select the project first. You can' @@ -162,7 +162,7 @@ class Kicad: self.obj_workThread.start() else: - self.msg = QtGui.QErrorMessage() + self.msg = QtWidgets.QErrorMessage() self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage('Please select the project first. You can' @@ -209,7 +209,7 @@ class Kicad: self.obj_dockarea.kicadToNgspiceEditor(var) else: - self.msg = QtGui.QErrorMessage() + self.msg = QtWidgets.QErrorMessage() self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage( @@ -221,7 +221,7 @@ class Kicad: self.msg.exec_() else: - self.msg = QtGui.QErrorMessage() + self.msg = QtWidgets.QErrorMessage() self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage( diff --git a/src/projManagement/Worker.py b/src/projManagement/Worker.py index 8ce605f0..cdad4170 100644 --- a/src/projManagement/Worker.py +++ b/src/projManagement/Worker.py @@ -11,14 +11,15 @@ # NOTES: --- # AUTHOR: Fahim Khan, fahim.elex@gmail.com # MODIFIED: Rahul Paknikar, rahulp@iitb.ac.in -# ORGANIZATION: eSim team at FOSSEE, IIT Bombay. +# ORGANIZATION: eSim Team at FOSSEE, IIT Bombay # CREATED: Tuesday 24 February 2015 -# REVISION: Friday 14 February 2020 +# REVISION: Sunday 02 August 2020 # ========================================================================= -from PyQt4 import QtCore +from PyQt5 import QtCore import subprocess from configuration.Appconfig import Appconfig +import threading class WorkerThread(QtCore.QThread): @@ -52,7 +53,8 @@ class WorkerThread(QtCore.QThread): @return None """ - self.wait() + if threading.active_count() > 1: + self.wait() def get_proc_threads(self): """ diff --git a/src/projManagement/newProject.py b/src/projManagement/newProject.py index 8382883d..ad29dc76 100644 --- a/src/projManagement/newProject.py +++ b/src/projManagement/newProject.py @@ -11,19 +11,19 @@ # NOTES: --- # AUTHOR: Fahim Khan, fahim.elex@gmail.com # MODIFIED: Rahul Paknikar, rahulp@iitb.ac.in -# ORGANIZATION: eSim team at FOSSEE, IIT Bombay. +# ORGANIZATION: eSim Team at FOSSEE, IIT Bombay # CREATED: Wednesday 12 February 2015 -# REVISION: Friday 14 February 2020 +# REVISION: Sunday 26 July 2020 # ========================================================================= -from PyQt4 import QtGui +from PyQt5 import QtWidgets from .Validation import Validation from configuration.Appconfig import Appconfig import os import json -class NewProjectInfo(QtGui.QWidget): +class NewProjectInfo(QtWidgets.QWidget): """ This class is called when User create new Project. """ @@ -85,7 +85,7 @@ class NewProjectInfo(QtGui.QWidget): f = open(self.projFile, "w") except BaseException: - self.msg = QtGui.QErrorMessage(self) + self.msg = QtWidgets.QErrorMessage(self) self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage( @@ -115,7 +115,7 @@ class NewProjectInfo(QtGui.QWidget): return self.projDir, newprojlist elif self.reply == "CHECKEXIST": - self.msg = QtGui.QErrorMessage(self) + self.msg = QtWidgets.QErrorMessage(self) self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage( @@ -126,7 +126,7 @@ class NewProjectInfo(QtGui.QWidget): self.msg.exec_() elif self.reply == "CHECKNAME": - self.msg = QtGui.QErrorMessage(self) + self.msg = QtWidgets.QErrorMessage(self) self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage( @@ -134,7 +134,7 @@ class NewProjectInfo(QtGui.QWidget): self.msg.exec_() elif self.reply == "NONE": - self.msg = QtGui.QErrorMessage(self) + self.msg = QtWidgets.QErrorMessage(self) self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage('The project name cannot be empty') diff --git a/src/projManagement/openProject.py b/src/projManagement/openProject.py index 507105ab..04944d29 100644 --- a/src/projManagement/openProject.py +++ b/src/projManagement/openProject.py @@ -11,19 +11,19 @@ # NOTES: --- # AUTHOR: Fahim Khan, fahim.elex@gmail.com # MODIFIED: Rahul Paknikar, rahulp@iitb.ac.in -# ORGANIZATION: eSim team at FOSSEE, IIT Bombay. +# ORGANIZATION: eSim Team at FOSSEE, IIT Bombay # CREATED: Wednesday 12 February 2015 -# REVISION: Friday 14 February 2020 +# REVISION: Sunday 26 July 2020 # ========================================================================= -from PyQt4 import QtGui +from PyQt5 import QtWidgets from .Validation import Validation from configuration.Appconfig import Appconfig import os import json -class OpenProjectInfo(QtGui.QWidget): +class OpenProjectInfo(QtWidgets.QWidget): """ This class is called when User click on Open Project Button """ @@ -45,7 +45,7 @@ class OpenProjectInfo(QtGui.QWidget): """ self.obj_Appconfig = Appconfig() self.openDir = self.obj_Appconfig.default_workspace["workspace"] - self.projDir = QtGui.QFileDialog.getExistingDirectory( + self.projDir = QtWidgets.QFileDialog.getExistingDirectory( self, "open", self.openDir) if self.obj_validation.validateOpenproj(self.projDir): @@ -74,18 +74,18 @@ class OpenProjectInfo(QtGui.QWidget): "proper directory else you won't be able to perform any " + "operation" ) - reply = QtGui.QMessageBox.critical( + reply = QtWidgets.QMessageBox.critical( None, "Error Message", "<b>Error: The project doesn't contain .proj file.</b><br/>" "<b>Please select the proper project directory else you won't" " be able to perform any operation</b>", - QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel + QtWidgets.QMessageBox.Ok | QtWidgets.QMessageBox.Cancel ) - if reply == QtGui.QMessageBox.Ok: + if reply == QtWidgets.QMessageBox.Ok: self.body() self.obj_Appconfig.print_info('Open Project called') self.obj_Appconfig.print_info( 'Current Project is ' + self.projDir) - elif reply == QtGui.QMessageBox.Cancel: + elif reply == QtWidgets.QMessageBox.Cancel: self.obj_Appconfig.print_info('No Project opened') |