diff --git a/CadQuery/Libs/pyqode/core/managers/backend.py b/CadQuery/Libs/pyqode/core/managers/backend.py index a82efec..cabbdf4 100644 --- a/CadQuery/Libs/pyqode/core/managers/backend.py +++ b/CadQuery/Libs/pyqode/core/managers/backend.py @@ -56,6 +56,9 @@ class BackendManager(Manager): The script can be run with a custom interpreter. The default is to use sys.executable. + .. note:: This restart the backend process if it was previously + running. + :param script: Path to the backend script. :param interpreter: The python interpreter to use to run the backend script. If None, sys.executable is used unless we are in a frozen @@ -64,8 +67,7 @@ class BackendManager(Manager): the backend process. """ if self.running: - # already started - return + self.stop() self.server_script = script self.interpreter = interpreter self.args = args diff --git a/CadQuery/Libs/pyqode/core/modes/filewatcher.py b/CadQuery/Libs/pyqode/core/modes/filewatcher.py index 207c445..37eabad 100644 --- a/CadQuery/Libs/pyqode/core/modes/filewatcher.py +++ b/CadQuery/Libs/pyqode/core/modes/filewatcher.py @@ -18,6 +18,9 @@ class FileWatcherMode(Mode, QtCore.QObject): #: the editor. file_deleted = QtCore.Signal(object) + #: Signal emitted when the file has been reloaded in the editor. + file_reloaded = QtCore.Signal() + @property def auto_reload(self): """ @@ -145,6 +148,7 @@ class FileWatcherMode(Mode, QtCore.QObject): def inner_action(*args): """ Inner action: open file """ self.editor.file.open(self.editor.file.path) + self.file_reloaded.emit() args = ("File changed", "The file %s has changed externally.\nDo you want to "