summaryrefslogtreecommitdiff
path: root/src/frontEnd/ProjectExplorer.py
diff options
context:
space:
mode:
authorRahul P2022-09-17 23:32:00 +0530
committerGitHub2022-09-17 23:32:00 +0530
commit7c1f5eacbc233bd365d1fc42c11aa3163f7947e1 (patch)
tree9ed3cd0765e85524e820590096bd7431b78db528 /src/frontEnd/ProjectExplorer.py
parent2e399ea70b1aee563ed7be944d78d8501fcd0f8e (diff)
parent73b784851e40ab6b607a70bf151fe2fa4443e218 (diff)
downloadeSim-7c1f5eacbc233bd365d1fc42c11aa3163f7947e1.tar.gz
eSim-7c1f5eacbc233bd365d1fc42c11aa3163f7947e1.tar.bz2
eSim-7c1f5eacbc233bd365d1fc42c11aa3163f7947e1.zip
Merge pull request #222 from rahulp13/master
Fix explorer file open and circuit element crash
Diffstat (limited to 'src/frontEnd/ProjectExplorer.py')
-rwxr-xr-xsrc/frontEnd/ProjectExplorer.py30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/frontEnd/ProjectExplorer.py b/src/frontEnd/ProjectExplorer.py
index bacb569c..77c9352e 100755
--- a/src/frontEnd/ProjectExplorer.py
+++ b/src/frontEnd/ProjectExplorer.py
@@ -132,25 +132,21 @@ class ProjectExplorer(QtWidgets.QWidget):
self.filePath = str(
self.indexItem.sibling(self.indexItem.row(), 1).data()
)
- self.obj_appconfig.print_info(
- 'The current project is ' + self.filePath)
-
- self.textwindow = QtWidgets.QWidget()
- self.textwindow.setMinimumSize(600, 500)
- self.textwindow.setGeometry(QtCore.QRect(400, 150, 400, 400))
- self.textwindow.setWindowTitle(filename)
-
- self.text = QtWidgets.QTextEdit()
- self.save = QtWidgets.QPushButton('Save and Exit')
- self.save.setDisabled(True)
- self.windowgrid = QtWidgets.QGridLayout()
- self.refreshProject(self.filePath)
if (os.path.isfile(str(self.filePath))):
self.fopen = open(str(self.filePath), 'r')
lines = self.fopen.read()
- self.text.setText(lines)
+ self.textwindow = QtWidgets.QWidget()
+ self.textwindow.setMinimumSize(600, 500)
+ self.textwindow.setGeometry(QtCore.QRect(400, 150, 400, 400))
+ self.textwindow.setWindowTitle(filename)
+
+ self.text = QtWidgets.QTextEdit()
+ self.save = QtWidgets.QPushButton('Save and Exit')
+ self.save.setDisabled(True)
+
+ self.text.setText(lines)
self.text.textChanged.connect(self.enable_save)
vbox_main = QtWidgets.QVBoxLayout(self.textwindow)
@@ -160,6 +156,12 @@ class ProjectExplorer(QtWidgets.QWidget):
self.textwindow.show()
else:
+ self.refreshProject(self.filePath)
+
+ self.obj_appconfig.print_info(
+ 'The current project is: ' + self.filePath
+ )
+
self.obj_appconfig.current_project["ProjectName"] = str(
self.filePath)
(