diff options
Diffstat (limited to 'src/subcircuit/openSub.py')
-rw-r--r-- | src/subcircuit/openSub.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/subcircuit/openSub.py b/src/subcircuit/openSub.py index 6cb4fe3e..63597661 100644 --- a/src/subcircuit/openSub.py +++ b/src/subcircuit/openSub.py @@ -1,11 +1,11 @@ -from PyQt4 import QtGui +from PyQt5 import QtWidgets from configuration.Appconfig import Appconfig from projManagement.Worker import WorkerThread import os # This class is called when User clicks on Edit Subcircuit Button. -class openSub(QtGui.QWidget): +class openSub(QtWidgets.QWidget): """ It opens the existing subcircuit projects that are present in Subcircuit directory. @@ -16,9 +16,13 @@ class openSub(QtGui.QWidget): self.obj_appconfig = Appconfig() def body(self): - self.editfile = str( - QtGui.QFileDialog.getExistingDirectory( - None, "Open File", "library/SubcircuitLibrary")) + + init_path = '../../' + if os.name == 'nt': + init_path = '' + + self.editfile = QtWidgets.QFileDialog.getExistingDirectory( + None, "Open File", init_path + "library/SubcircuitLibrary") if self.editfile: self.obj_Appconfig = Appconfig() self.obj_Appconfig.current_subcircuit['SubcircuitName'] \ |