beremiz

IDE: fix exception when re-opening previously closed tab
wxPython4
2023-03-12, Edouard Tisserant
1db10e9df882
Parents 41be039fbb8c
Children a811e1ff718a
IDE: fix exception when re-opening previously closed tab

Same as commit with same message, this time for tabs that are not POUs editors.
--- a/ProjectController.py Sun Mar 12 00:51:53 2023 +0100
+++ b/ProjectController.py Sun Mar 12 00:55:19 2023 +0100
@@ -1329,7 +1329,7 @@
def _OpenView(self, name=None, onlyopened=False):
if name == "IEC code":
- if self._IECCodeView is None:
+ if not self._IECCodeView:
plc_file = self._getIECcodepath()
self._IECCodeView = IECCodeViewer(
@@ -1351,7 +1351,7 @@
return self._IECCodeView
elif name == "IEC raw code":
- if self._IECRawCodeView is None:
+ if not self._IECRawCodeView:
controler = MiniTextControler(self._getIECrawcodepath(), self)
self._IECRawCodeView = IECCodeViewer(
@@ -1368,7 +1368,7 @@
return self._IECRawCodeView
elif name == "Project Files":
- if self._ProjectFilesView is None:
+ if not self._ProjectFilesView:
self._ProjectFilesView = FileManagementPanel(
self.AppFrame.TabsOpened, self, name, self._getProjectFilesPath(), True)