Commit 2cadd49d authored by Nils Cedric Holle's avatar Nils Cedric Holle

Fix showing Python files that don't belong to modules

parent 722b98e8
......@@ -11,6 +11,7 @@ from PyQt5.QtWidgets import *
translate = QCoreApplication.translate
class PSEditorWidget(QWidget):
def __init__(self, parent: QObject = None):
......@@ -37,7 +38,7 @@ class PSEditorWidget(QWidget):
self.editor = PSCodeEdit(server.__file__)
self.__layout.addWidget(self.editor, 1, 1)
self.currentIndexChangedConnected = False
self.currentModule = None
self.__currentModule = None
self.__modules = []
@property
......@@ -53,7 +54,7 @@ class PSEditorWidget(QWidget):
def __openArbitraryFile(self, path: str):
self.editor.file.open(path)
self.currentModule = None
self.__currentModule = None
for m in self.__modules:
if os.path.normpath(path) == os.path.normpath(m.filePath):
self.__currentModule = m
......@@ -63,10 +64,16 @@ class PSEditorWidget(QWidget):
m.filePath + " - " +
translate("Status", self.__currentModule.status))
self.moduleFileOpened.emit(m)
if self.editorHeaderLayout.count() > 2:
for i in range(2):
self.editorHeaderLayout.itemAt(i).widget().setEnabled(True)
else:
self.editorFilePathLabel.setText("")
self.__disableEditorControlElements()
self.editorFilePathLabel.setText(path)
if self.editorHeaderLayout.count() > 2:
for i in range(2):
self.editorHeaderLayout.itemAt(
i).widget().setEnabled(False)
def openModule(self, module: PSModule):
self.editor.file.open(module.filePath)
self.__fileExplorer.selectFile(module.filePath)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment