--- a/src/eric7/QScintilla/Editor.py Wed Feb 22 07:43:56 2023 +0100 +++ b/src/eric7/QScintilla/Editor.py Thu Feb 23 12:04:28 2023 +0100 @@ -636,6 +636,24 @@ """ return not self.fileName.startswith(("device:", "remote:")) + def isDeviceFile(self): + """ + Public method to check, if the editor contains a MCU device file. + + @return flag indicating a MCU device file + @rtype bool + """ + return self.fileName.startswith("device:") + + def isRemoteFile(self): + """ + Public method to check, if the editor contains a remote file. + + @return flag indicating a remote file + @rtype bool + """ + return self.fileName.startswith("remote:") + def __registerImages(self): """ Private method to register images for autocompletion lists. @@ -3090,9 +3108,9 @@ self.changeMarkersUpdated.emit(self) self.__markerMap.update() - def __resetOnlineChangeTraceInfo(self): - """ - Private slot to reset the online change trace info. + def resetOnlineChangeTraceInfo(self): + """ + Public slot to reset the online change trace info. """ self.__lastSavedText = self.text() self.__deleteAllChangeMarkers() @@ -3512,6 +3530,7 @@ """ if not saveas and (not self.isModified() or not self.isLocalFile()): # do nothing if text wasn't changed or is not a local file + # TODO: write the file back to the MCU if isDeviceFile() return False newName = None @@ -3569,7 +3588,7 @@ self.editorSaved.emit(self.fileName) self.checkSyntax() self.extractTasks() - self.__resetOnlineChangeTraceInfo() + self.resetOnlineChangeTraceInfo() self.__checkEncoding() return True else: