Fixed the Allow Reload checkbox.

This commit is contained in:
Jeremy Mack Wright 2018-12-29 06:25:52 -05:00
parent 70f2f1d8d8
commit 6ac62f23c7
2 changed files with 4 additions and 2 deletions

View File

@ -170,8 +170,10 @@ class CodeEditor(QPlainTextEdit):
@QtCore.Slot("QString")
def slotDirChanged(self, path):
allowReload = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/cadquery-freecad-module").GetBool("allowReload")
# Make sure that the contents of our file actually changed
if self.changedOnDisk():
if self.changedOnDisk() and allowReload:
FreeCAD.Console.PrintMessage("Contents of " + self.file_path + " changed, reloading \r\n")
self.reload()

View File

@ -64,7 +64,7 @@ class SettingsDialog(QtGui.QDialog):
FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/cadquery-freecad-module").SetString("executeKeybinding", self.ui_key_binding.text())
FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/cadquery-freecad-module").SetBool("executeOnSave", self.execute_on_save.checkState())
FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/cadquery-freecad-module").SetBool("showLineNumbers", self.show_line_numbers.checkState())
FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/cadquery-freecad-module").SetBool("allowReload", self.show_line_numbers.checkState())
FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/cadquery-freecad-module").SetBool("allowReload", self.allow_reload.checkState())
self.accept()