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/subcircuit/openSub.py | |
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/subcircuit/openSub.py')
-rw-r--r-- | src/subcircuit/openSub.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/subcircuit/openSub.py b/src/subcircuit/openSub.py index 63597661..f98fe69f 100644 --- a/src/subcircuit/openSub.py +++ b/src/subcircuit/openSub.py @@ -1,7 +1,7 @@ -from PyQt5 import QtWidgets +import os +from PyQt5 import QtWidgets, QtCore from configuration.Appconfig import Appconfig from projManagement.Worker import WorkerThread -import os # This class is called when User clicks on Edit Subcircuit Button. @@ -21,8 +21,12 @@ class openSub(QtWidgets.QWidget): if os.name == 'nt': init_path = '' - self.editfile = QtWidgets.QFileDialog.getExistingDirectory( - None, "Open File", init_path + "library/SubcircuitLibrary") + self.editfile = QtCore.QDir.toNativeSeparators( + QtWidgets.QFileDialog.getExistingDirectory( + None, "Open File", init_path + "library/SubcircuitLibrary" + ) + ) + if self.editfile: self.obj_Appconfig = Appconfig() self.obj_Appconfig.current_subcircuit['SubcircuitName'] \ |