Bläddra i källkod

- made the Rules Check Tool document window Read Only

Marius Stanciu 6 år sedan
förälder
incheckning
ce9c15a2ed
3 ändrade filer med 16 tillägg och 1 borttagningar
  1. 14 1
      FlatCAMObj.py
  2. 1 0
      README.md
  3. 1 0
      flatcamTools/ToolRulesCheck.py

+ 14 - 1
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

+ 1 - 0
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
 

+ 1 - 0
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 )