From eba6e6ed7860256287a7490b90d2e00fa903cd41 Mon Sep 17 00:00:00 2001 From: athulappadan Date: Thu, 17 Mar 2016 11:41:50 +0530 Subject: Closes all external windows while closing a selected project --- src/frontEnd/Application.py | 2 ++ src/frontEnd/ProjectExplorer.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src/frontEnd') diff --git a/src/frontEnd/Application.py b/src/frontEnd/Application.py index 24e541c3..37fc6942 100755 --- a/src/frontEnd/Application.py +++ b/src/frontEnd/Application.py @@ -187,6 +187,8 @@ class Application(QtGui.QMainWindow): if current_project==None: pass else: + for pid in self.obj_appconfig.proc_dict[self.obj_appconfig.current_project['ProjectName']]: + os.kill(pid, 9) self.obj_appconfig.current_project['ProjectName'] = None self.systemTrayIcon.showMessage('Close', 'Current project '+os.path.basename(current_project)+' is Closed.') diff --git a/src/frontEnd/ProjectExplorer.py b/src/frontEnd/ProjectExplorer.py index 6c96227a..e2091523 100644 --- a/src/frontEnd/ProjectExplorer.py +++ b/src/frontEnd/ProjectExplorer.py @@ -47,6 +47,7 @@ class ProjectExplorer(QtGui.QWidget): parentnode = QtGui.QTreeWidgetItem(self.treewidget, [pathlist[-1], parents]) for files in children: childnode = QtGui.QTreeWidgetItem(parentnode, [files, os.path.join(parents,files)]) + self.obj_appconfig.proc_dict[self.obj_appconfig.current_project['ProjectName']] = [] def openMenu(self, position): @@ -102,6 +103,7 @@ class ProjectExplorer(QtGui.QWidget): self.textwindow.show() else: self.obj_appconfig.current_project["ProjectName"]= str(self.filePath) + self.obj_appconfig.proc_dict[self.obj_appconfig.current_project['ProjectName']] = [] def enable_save(self): self.save.setEnabled(True) @@ -139,4 +141,4 @@ class ProjectExplorer(QtGui.QWidget): childnode= QtGui.QTreeWidgetItem(parentnode, [files, os.path.join(self.filePath,files)]) self.obj_appconfig.project_explorer[self.filePath]= filelistnew - json.dump(self.obj_appconfig.project_explorer, open(self.obj_appconfig.dictPath,'w')) \ No newline at end of file + json.dump(self.obj_appconfig.project_explorer, open(self.obj_appconfig.dictPath,'w')) -- cgit From d41e4a590793a6fb8fbb1b38a552ec413347aa78 Mon Sep 17 00:00:00 2001 From: athulappadan Date: Thu, 17 Mar 2016 14:46:35 +0530 Subject: Standard plotting functions labels changed --- src/frontEnd/Application.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/frontEnd') diff --git a/src/frontEnd/Application.py b/src/frontEnd/Application.py index 37fc6942..a4d93127 100755 --- a/src/frontEnd/Application.py +++ b/src/frontEnd/Application.py @@ -187,6 +187,8 @@ class Application(QtGui.QMainWindow): if current_project==None: pass else: + for pid in self.obj_appconfig.proc_dict[self.obj_appconfig.current_project['ProjectName']]: + print pid for pid in self.obj_appconfig.proc_dict[self.obj_appconfig.current_project['ProjectName']]: os.kill(pid, 9) self.obj_appconfig.current_project['ProjectName'] = None -- cgit From 66770d5e2c94cc299424daa67b8bfafcb4d9b8c1 Mon Sep 17 00:00:00 2001 From: athulappadan Date: Tue, 22 Mar 2016 14:13:43 +0530 Subject: Closes all the dock areas while exiting a project --- src/frontEnd/Application.py | 7 +++---- src/frontEnd/DockArea.py | 23 ++++++++++++++++------- src/frontEnd/ProjectExplorer.py | 7 +++++-- 3 files changed, 24 insertions(+), 13 deletions(-) (limited to 'src/frontEnd') diff --git a/src/frontEnd/Application.py b/src/frontEnd/Application.py index a4d93127..a3438591 100755 --- a/src/frontEnd/Application.py +++ b/src/frontEnd/Application.py @@ -187,10 +187,9 @@ class Application(QtGui.QMainWindow): if current_project==None: pass else: - for pid in self.obj_appconfig.proc_dict[self.obj_appconfig.current_project['ProjectName']]: - print pid - for pid in self.obj_appconfig.proc_dict[self.obj_appconfig.current_project['ProjectName']]: - os.kill(pid, 9) + for pid in self.obj_appconfig.proc_dict[self.obj_appconfig.current_project['ProjectName']]: + os.kill(pid, 9) + self.obj_Mainview.obj_dockarea.closeDock() self.obj_appconfig.current_project['ProjectName'] = None self.systemTrayIcon.showMessage('Close', 'Current project '+os.path.basename(current_project)+' is Closed.') diff --git a/src/frontEnd/DockArea.py b/src/frontEnd/DockArea.py index 65296525..dcb48704 100644 --- a/src/frontEnd/DockArea.py +++ b/src/frontEnd/DockArea.py @@ -90,7 +90,8 @@ class DockArea(QtGui.QMainWindow): ") """ dock['Tips-'+str(count)].raise_() - + + self.obj_appconfig.dock_dict[self.obj_appconfig.current_project['ProjectName']].append(dock['Tips-'+str(count)]) count = count + 1 def plottingEditor(self): @@ -124,7 +125,8 @@ class DockArea(QtGui.QMainWindow): dock['Plotting-'+str(count)].setVisible(True) dock['Plotting-'+str(count)].setFocus() dock['Plotting-'+str(count)].raise_() - + + self.obj_appconfig.dock_dict[self.obj_appconfig.current_project['ProjectName']].append(dock['Plotting-'+str(count)]) count = count + 1 def ngspiceEditor(self,projDir): @@ -160,7 +162,7 @@ class DockArea(QtGui.QMainWindow): dock['NgSpice-'+str(count)].setVisible(True) dock['NgSpice-'+str(count)].setFocus() dock['NgSpice-'+str(count)].raise_() - + self.obj_appconfig.dock_dict[self.obj_appconfig.current_project['ProjectName']].append(dock['NgSpice-'+str(count)]) count = count + 1 def modelEditor(self): @@ -187,7 +189,8 @@ class DockArea(QtGui.QMainWindow): dock['Model Editor-'+str(count)].setVisible(True) dock['Model Editor-'+str(count)].setFocus() dock['Model Editor-'+str(count)].raise_() - + + self.obj_appconfig.dock_dict[self.obj_appconfig.current_project['ProjectName']].append(dock['Model Editor-'+str(count)]) count = count + 1 def kicadToNgspiceEditor(self,clarg1,clarg2=None): @@ -210,7 +213,8 @@ class DockArea(QtGui.QMainWindow): dock['kicadToNgspice-'+str(count)].setVisible(True) dock['kicadToNgspice-'+str(count)].setFocus() dock['kicadToNgspice-'+str(count)].raise_() - + + self.obj_appconfig.dock_dict[self.obj_appconfig.current_project['ProjectName']].append(dock['kicadToNgspice-'+str(count)]) count = count + 1 @@ -238,7 +242,8 @@ class DockArea(QtGui.QMainWindow): dock['Subcircuit-'+str(count)].setVisible(True) dock['Subcircuit-'+str(count)].setFocus() dock['Subcircuit-'+str(count)].raise_() - + + self.obj_appconfig.dock_dict[self.obj_appconfig.current_project['ProjectName']].append(dock['Subcircuit-'+str(count)]) count = count + 1 def usermanual(self): @@ -266,4 +271,8 @@ class DockArea(QtGui.QMainWindow): dock['User Manual-'+str(count)].setFocus() dock['User Manual-'+str(count)].raise_() - count = count + 1 \ No newline at end of file + count = count + 1 + + def closeDock (self): + for dockwidget in self.obj_appconfig.dock_dict[self.obj_appconfig.current_project['ProjectName']]: + dockwidget.close() diff --git a/src/frontEnd/ProjectExplorer.py b/src/frontEnd/ProjectExplorer.py index e2091523..146b6d0f 100644 --- a/src/frontEnd/ProjectExplorer.py +++ b/src/frontEnd/ProjectExplorer.py @@ -47,7 +47,8 @@ class ProjectExplorer(QtGui.QWidget): parentnode = QtGui.QTreeWidgetItem(self.treewidget, [pathlist[-1], parents]) for files in children: childnode = QtGui.QTreeWidgetItem(parentnode, [files, os.path.join(parents,files)]) - self.obj_appconfig.proc_dict[self.obj_appconfig.current_project['ProjectName']] = [] + self.obj_appconfig.proc_dict[self.obj_appconfig.current_project['ProjectName']] = [] + self.oj_appconfig.dock_dict[self.obj_appconfig.current_project['ProjectName']] = [] def openMenu(self, position): @@ -103,7 +104,9 @@ class ProjectExplorer(QtGui.QWidget): self.textwindow.show() else: self.obj_appconfig.current_project["ProjectName"]= str(self.filePath) - self.obj_appconfig.proc_dict[self.obj_appconfig.current_project['ProjectName']] = [] + self.obj_appconfig.proc_dict[self.obj_appconfig.current_project['ProjectName']] = [] + if self.obj_appconfig.current_project['ProjectName'] not in self.obj_appconfig.dock_dict: + self.obj_appconfig.dock_dict[self.obj_appconfig.current_project['ProjectName']] = [] def enable_save(self): self.save.setEnabled(True) -- cgit