diff options
-rw-r--r-- | src/configuration/Appconfig.py | 6 | ||||
-rwxr-xr-x | src/frontEnd/Application.py | 22 | ||||
-rw-r--r-- | src/projManagement/Worker.py | 14 |
3 files changed, 23 insertions, 19 deletions
diff --git a/src/configuration/Appconfig.py b/src/configuration/Appconfig.py index 5735534b..a5dfa546 100644 --- a/src/configuration/Appconfig.py +++ b/src/configuration/Appconfig.py @@ -20,7 +20,8 @@ from PyQt4 import QtGui import os - +global procThread_list # keeps tracking all the processes called +procThread_list = [] class Appconfig(QtGui.QWidget): """ @@ -33,8 +34,7 @@ class Appconfig(QtGui.QWidget): current_project = {"ProjectName":None} #Workspace detail workspace_text = '''ecSim stores your project in a folder called a workspace. You can choose a different workspace folder to use for this session.''' - - + procThread_list = [] def __init__(self): super(Appconfig, self).__init__() diff --git a/src/frontEnd/Application.py b/src/frontEnd/Application.py index 1d6b4f03..2863ed6c 100755 --- a/src/frontEnd/Application.py +++ b/src/frontEnd/Application.py @@ -27,6 +27,7 @@ import ViewManagement import Workspace import sys import time +import subprocess class Application(QtGui.QMainWindow): @@ -57,21 +58,20 @@ class Application(QtGui.QMainWindow): def initActions(self): - - self.newproj = QtGui.QAction(QtGui.QIcon('../images/newProject.png'),'<b>New Project</b>',self) + + self.newproj = QtGui.QAction(QtGui.QIcon('../images/newProject.svg'),'<b>New Project</b>',self) self.newproj.setShortcut('Ctrl+N') self.newproj.triggered.connect(self.new_project) - - self.openproj = QtGui.QAction(QtGui.QIcon('../images/openProject.png'),'<b>Open Project</b>',self) + self.openproj = QtGui.QAction(QtGui.QIcon('../images/openProject.svg'),'<b>Open Project</b>',self) self.openproj.setShortcut('Ctrl+O') self.openproj.triggered.connect(self.open_project) - self.exitproj = QtGui.QAction(QtGui.QIcon('../images/closeProject.png'),'<b>Exit</b>',self) + self.exitproj = QtGui.QAction(QtGui.QIcon('../images/closeProject.svg'),'<b>Exit</b>',self) self.exitproj.setShortcut('Ctrl+X') self.exitproj.triggered.connect(self.exit_project) - self.helpfile = QtGui.QAction(QtGui.QIcon('../images/helpProject.png'),'<b>Help</b>',self) + self.helpfile = QtGui.QAction(QtGui.QIcon('../images/default.png'),'<b>Help</b>',self) self.helpfile.setShortcut('Ctrl+H') self.helpfile.triggered.connect(self.help_project) @@ -106,7 +106,13 @@ class Application(QtGui.QMainWindow): def exit_project(self): print "Exit Project called" - self.destroy() + for proc in self.obj_appconfig.procThread_list: + try: + proc.terminate() + except: + pass + self.project.close() + self.close() def help_project(self): print "Help is called" @@ -125,7 +131,7 @@ def main(args): It is main function of the module.It starts the application """ print "Hello Main" - app = QtGui.QApplication(args) + app = QtGui.QApplication(sys.argv) """ splash_pix = QtGui.QPixmap('../images/FreeEDAlogo.jpg') diff --git a/src/projManagement/Worker.py b/src/projManagement/Worker.py index 58078b86..d31ba7c3 100644 --- a/src/projManagement/Worker.py +++ b/src/projManagement/Worker.py @@ -16,15 +16,15 @@ # REVISION: --- #=============================================================================== from PyQt4 import QtCore -import os +import subprocess +from configuration.Appconfig import Appconfig class WorkerThread(QtCore.QThread): def __init__(self,args): QtCore.QThread.__init__(self) self.args = args - ''' - #Not Required + def __del__(self): self.wait() @@ -35,10 +35,8 @@ class WorkerThread(QtCore.QThread): def call_system(self,command): print "System called" - try: - os.system(command) - print "PID",os.getpid() - except: - print "Unable to run the command" + procThread = Appconfig() + proc = subprocess.Popen(command) + procThread.procThread_list.append(proc)
\ No newline at end of file |