summaryrefslogtreecommitdiff
path: root/src/ngspicetoModelica
diff options
context:
space:
mode:
authorrahulp132020-12-14 21:08:43 +0530
committerrahulp132020-12-14 21:08:43 +0530
commit779eac4d604c082442ba9ca72a7c23509a78e5f5 (patch)
tree43831dac148767334754754988a6abc5c4352f9e /src/ngspicetoModelica
parentb3b25b6f1b6c5202620548cce59985d8b79a495f (diff)
downloadeSim-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.py12
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):