From ce9c15a2ed7a90c3c955f388675ec6ff6f52ea9d Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Sun, 6 Oct 2019 04:46:25 +0300 Subject: [PATCH] - made the Rules Check Tool document window Read Only --- FlatCAMObj.py | 15 ++++++++++++++- README.md | 1 + flatcamTools/ToolRulesCheck.py | 1 + 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/FlatCAMObj.py b/FlatCAMObj.py index 7c4fd10b..5a56a3e7 100644 --- a/FlatCAMObj.py +++ b/FlatCAMObj.py @@ -6692,6 +6692,8 @@ class FlatCAMDocument(FlatCAMObj): self.document_editor_tab = None + self._read_only = False + def set_ui(self, ui): FlatCAMObj.set_ui(self, ui) FlatCAMApp.App.log.debug("FlatCAMDocument.set_ui()") @@ -6730,7 +6732,7 @@ class FlatCAMDocument(FlatCAMObj): # first clear previous text in text editor (if any) self.document_editor_tab.code_editor.clear() - self.document_editor_tab.code_editor.setReadOnly(False) + self.document_editor_tab.code_editor.setReadOnly(self._read_only) self.document_editor_tab.buttonRun.hide() @@ -6790,6 +6792,17 @@ class FlatCAMDocument(FlatCAMObj): self.build_ui() + @property + def read_only(self): + return self._read_only + + @read_only.setter + def read_only(self, val): + if val: + self._read_only = True + else: + self._read_only = False + def build_ui(self): FlatCAMObj.build_ui(self) tab_here = False diff --git a/README.md b/README.md index d174719c..10be0f7c 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ CAD program, and create G-Code for Isolation routing. - remade the Mark area Tool in Gerber Editor to be able to clear the markings and also to delete the marked polygons (Gerber apertures) - working in adding to the Optimal Tool the rest of the distances found in the Gerber and the locations associated; added GUI - added display of the results for the Rules Check Tool in a formatted way +- made the Rules Check Tool document window Read Only 5.10.2019 diff --git a/flatcamTools/ToolRulesCheck.py b/flatcamTools/ToolRulesCheck.py index 0b69753b..0ec51875 100644 --- a/flatcamTools/ToolRulesCheck.py +++ b/flatcamTools/ToolRulesCheck.py @@ -1415,6 +1415,7 @@ class RulesCheck(FlatCAMTool): txt += '%s\n' % _("Violations: There are no violations for the current rule.") txt += '\n\n' new_obj.source_file = txt + new_obj.read_only = True self.app.new_object('document', name='Rules Check results', initialize=init, plot=False )