diff options
author | Rahul Paknikar | 2021-01-08 13:10:30 +0530 |
---|---|---|
committer | GitHub | 2021-01-08 13:10:30 +0530 |
commit | 840090d0eedac3c60026269f50f9bb8365e4801b (patch) | |
tree | d518be49a0aacfdba9d18f99da73fc9d9fa7271f /src/kicadtoNgspice/DeviceModel.py | |
parent | a61c3edf10706ca0231b4441f84f801f0c9d4773 (diff) | |
parent | 1b5e07107e5fcf0269de20885a371b54049823e3 (diff) | |
download | eSim-87e72d00d0e96133f27f68e46497d194a978b5ae.tar.gz eSim-87e72d00d0e96133f27f68e46497d194a978b5ae.tar.bz2 eSim-87e72d00d0e96133f27f68e46497d194a978b5ae.zip |
Merge pull request #162 from rahulp13/masterv2.1
fixed crash issues
Diffstat (limited to 'src/kicadtoNgspice/DeviceModel.py')
-rw-r--r-- | src/kicadtoNgspice/DeviceModel.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/kicadtoNgspice/DeviceModel.py b/src/kicadtoNgspice/DeviceModel.py index 1c77cabc..5fd4d829 100644 --- a/src/kicadtoNgspice/DeviceModel.py +++ b/src/kicadtoNgspice/DeviceModel.py @@ -1,4 +1,4 @@ -from PyQt5 import QtWidgets +from PyQt5 import QtWidgets, QtCore import os from xml.etree import ElementTree as ET from . import TrackWidget @@ -368,10 +368,15 @@ class DeviceModel(QtWidgets.QWidget): if os.name == 'nt': init_path = '' - self.libfile = QtWidgets.QFileDialog.getOpenFileName( + self.libfile = QtCore.QDir.toNativeSeparators( + QtWidgets.QFileDialog.getOpenFileName( self, "Open Library Directory", init_path + "library/deviceModelLibrary", "*.lib" )[0] + ) + + if not self.libfile: + return # Setting Library to Text Edit Line self.entry_var[self.widgetObjCount].setText(self.libfile) |