From 1ef752288661105c78fda32f34fdf832d5e15563 Mon Sep 17 00:00:00 2001
From: athulappadan
Date: Mon, 29 Jun 2015 15:45:25 +0530
Subject: bug in remove method fixed
---
src/ngspice_ghdl.py | 46 ++++++++++++++++++++++++++++------------------
1 file changed, 28 insertions(+), 18 deletions(-)
(limited to 'src')
diff --git a/src/ngspice_ghdl.py b/src/ngspice_ghdl.py
index 8f79f67..ce381d4 100755
--- a/src/ngspice_ghdl.py
+++ b/src/ngspice_ghdl.py
@@ -72,18 +72,24 @@ class Mainwindow(QtGui.QWidget):
self.filename = QtGui.QFileDialog.getOpenFileName(self, 'Open File', '.')
print "Path file :", self.filename
self.ledit.setText(self.filename)
+ self.file_list[:] = []
+ self.sedit.clear()
def addFiles(self):
print "Add Files button clicked"
title = self.addbtn.text()
for file in QtGui.QFileDialog.getOpenFileNames(self, title):
- print "Supporting file :", file
- self.sedit.append(str(file))
- self.file_list.append(file)
+ print "Supporting file :", file
+ self.sedit.append(str(file))
+ self.file_list.append(file)
def removeFiles(self):
+ if len(self.file_list) > 0:
self.fileRemover = FileRemover(self)
+ else:
+ QtGui.QMessageBox.about(self, 'Message', '''Error
Select supporting files''')
+
#check extensions of all supporting files
@@ -221,20 +227,25 @@ class Mainwindow(QtGui.QWidget):
def uploadModle(self):
print "Upload button clicked"
- self.file_extension = os.path.splitext(str(self.filename))[1]
- print "File extension",self.file_extension
- print "Parser Content:",self.parser.get('NGSPICE', 'NGSPICE_HOME')
- self.cur_dir = os.getcwd()
- print "My Current Working Directory",self.cur_dir
- self.checkSupportFiles()
- if self.file_extension == ".vhdl":
- self.createModelDirectory()
- self.addingModelInModpath()
- self.createModelFiles()
- self.runMake()
- self.runMakeInstall()
- else:
- QtGui.QMessageBox.about(self,'Message','''Important Message.
This accepts only .vhdl file ''')
+ #self.file_list[:] = []
+ try:
+ self.file_extension = os.path.splitext(str(self.filename))[1]
+ print "File extension",self.file_extension
+ print "Parser Content:",self.parser.get('NGSPICE', 'NGSPICE_HOME')
+ self.cur_dir = os.getcwd()
+ print "My Current Working Directory",self.cur_dir
+ self.checkSupportFiles()
+ if self.file_extension == ".vhdl":
+ self.createModelDirectory()
+ self.addingModelInModpath()
+ self.createModelFiles()
+ self.runMake()
+ self.runMakeInstall()
+ else:
+ QtGui.QMessageBox.about(self,'Message','''Important Message.
This accepts only .vhdl file ''')
+
+ except:
+ QtGui.QMessageBox.about(self,'Message','''Error.
Select a .vhdl file''')
class FileRemover(QtGui.QWidget):
@@ -305,7 +316,6 @@ class FileRemover(QtGui.QWidget):
self.sedit.append(path)
self.marked_list[:] = []
- self.files[:] = []
self.close()
--
cgit