From 99c9974171f3bbbba0012a7a94648bfa00147be3 Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Sat, 17 Sep 2022 22:54:48 +0530 Subject: fix file open issue due to #210 --- src/frontEnd/ProjectExplorer.py | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'src/frontEnd/ProjectExplorer.py') 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) ( -- cgit