diff --git a/lib/python/qtvcp/widgets/gcode_editor.py b/lib/python/qtvcp/widgets/gcode_editor.py index 78d8a6e0d..5dc3c70c4 100644 --- a/lib/python/qtvcp/widgets/gcode_editor.py +++ b/lib/python/qtvcp/widgets/gcode_editor.py @@ -285,6 +285,7 @@ class EditorBase(QsciScintilla): return self.ensureCursorVisible() self.SendScintilla(QsciScintilla.SCI_VERTICALCENTRECARET) + self.setModified(False) def save_text(self): with open(self.filepath + 'text', "w") as text_file: @@ -337,6 +338,7 @@ class GcodeDisplay(EditorBase, _HalWidgetBase): self.load_text(filename) #self.zoomTo(6) self.setCursorPosition(0, 0) + self.setModified(False) # when switching from MDI to AUTO we need to reload the # last (linuxcnc loaded) program. @@ -666,6 +668,7 @@ class GcodeEditor(QWidget, _HalWidgetBase): self.topMenu.show() self.bottomMenu.show() self.editor.setReadOnly(False) + self.editor.setModified(False) def readOnlyMode(self): self.topMenu.hide() @@ -693,10 +696,21 @@ class GcodeEditor(QWidget, _HalWidgetBase): file = open(name[0],'w') file.write(self.editor.text()) file.close() + self.editor.setModified(False) def emit_percent(self, percent): self.percentDone.emit(percent) + # designer recognized getter/setters + # auto_show_mdi status + def set_auto_show_mdi(self, data): + self.editor.auto_show_mdi = data + def get_auto_show_mdi(self): + return self.editor.auto_show_mdi + def reset_auto_show_mdi(self): + self.editor.auto_show_mdi = True + auto_show_mdi_status = pyqtProperty(bool, get_auto_show_mdi, set_auto_show_mdi, reset_auto_show_mdi) + # for direct testing if __name__ == "__main__": from PyQt5.QtWidgets import *