diff options
author | rahulp13 | 2020-12-14 21:08:43 +0530 |
---|---|---|
committer | rahulp13 | 2020-12-14 21:08:43 +0530 |
commit | 779eac4d604c082442ba9ca72a7c23509a78e5f5 (patch) | |
tree | 43831dac148767334754754988a6abc5c4352f9e /src/ngspicetoModelica | |
parent | b3b25b6f1b6c5202620548cce59985d8b79a495f (diff) | |
download | eSim-779eac4d604c082442ba9ca72a7c23509a78e5f5.tar.gz eSim-779eac4d604c082442ba9ca72a7c23509a78e5f5.tar.bz2 eSim-779eac4d604c082442ba9ca72a7c23509a78e5f5.zip |
changed QFileDialog separator and handled crash exception for all input fields
Diffstat (limited to 'src/ngspicetoModelica')
-rw-r--r-- | src/ngspicetoModelica/ModelicaUI.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/ngspicetoModelica/ModelicaUI.py b/src/ngspicetoModelica/ModelicaUI.py index 8e2479c9..6cd736b7 100644 --- a/src/ngspicetoModelica/ModelicaUI.py +++ b/src/ngspicetoModelica/ModelicaUI.py @@ -45,9 +45,15 @@ class OpenModelicaEditor(QtWidgets.QWidget): self.show() def browseFile(self): - self.ngspiceNetlist = QtWidgets.QFileDialog.getOpenFileName( - self, 'Open Ngspice Netlist', BROWSE_LOCATION)[0] - self.FileEdit.setText(self.ngspiceNetlist) + temp = QtCore.QDir.toNativeSeparators( + QtWidgets.QFileDialog.getOpenFileName( + self, 'Open Ngspice Netlist', BROWSE_LOCATION + )[0] + ) + + if temp: + self.ngspiceNetlist = temp + self.FileEdit.setText(self.ngspiceNetlist) def callConverter(self): |