summaryrefslogtreecommitdiff
path: root/src/kicadtoNgspice/DeviceModel.py
diff options
context:
space:
mode:
authorRahul Paknikar2021-01-08 13:10:30 +0530
committerGitHub2021-01-08 13:10:30 +0530
commit840090d0eedac3c60026269f50f9bb8365e4801b (patch)
treed518be49a0aacfdba9d18f99da73fc9d9fa7271f /src/kicadtoNgspice/DeviceModel.py
parenta61c3edf10706ca0231b4441f84f801f0c9d4773 (diff)
parent1b5e07107e5fcf0269de20885a371b54049823e3 (diff)
downloadeSim-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.py9
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)