1968 It emits the signal modificationStatusChanged with parameters |
1968 It emits the signal modificationStatusChanged with parameters |
1969 m and self. |
1969 m and self. |
1970 |
1970 |
1971 @param m modification status |
1971 @param m modification status |
1972 """ |
1972 """ |
1973 if not m and bool(self.fileName): |
1973 if not m and bool(self.fileName) and pathlib.Path(self.fileName).exists(): |
1974 self.lastModified = pathlib.Path(self.fileName).stat().st_mtime |
1974 self.lastModified = pathlib.Path(self.fileName).stat().st_mtime |
1975 self.modificationStatusChanged.emit(m, self) |
1975 self.modificationStatusChanged.emit(m, self) |
1976 self.undoAvailable.emit(self.isUndoAvailable()) |
1976 self.undoAvailable.emit(self.isUndoAvailable()) |
1977 self.redoAvailable.emit(self.isRedoAvailable()) |
1977 self.redoAvailable.emit(self.isRedoAvailable()) |
1978 |
1978 |
3494 self.extractTasks() |
3494 self.extractTasks() |
3495 self.__resetOnlineChangeTraceInfo() |
3495 self.__resetOnlineChangeTraceInfo() |
3496 self.__checkEncoding() |
3496 self.__checkEncoding() |
3497 return True |
3497 return True |
3498 else: |
3498 else: |
3499 self.lastModified = pathlib.Path(fn).stat().st_mtime |
3499 self.lastModified = ( |
|
3500 pathlib.Path(fn).stat().st_mtime |
|
3501 if pathlib.Path(fn).exists() else |
|
3502 0 |
|
3503 ) |
3500 return False |
3504 return False |
3501 |
3505 |
3502 def saveFileAs(self, path=None, toProject=False): |
3506 def saveFileAs(self, path=None, toProject=False): |
3503 """ |
3507 """ |
3504 Public slot to save a file with a new name. |
3508 Public slot to save a file with a new name. |
7084 self.setCaretWidth(self.caretWidth) |
7088 self.setCaretWidth(self.caretWidth) |
7085 self.__updateReadOnly(False) |
7089 self.__updateReadOnly(False) |
7086 if ( |
7090 if ( |
7087 self.vm.editorsCheckFocusInEnabled() and |
7091 self.vm.editorsCheckFocusInEnabled() and |
7088 not self.inReopenPrompt and self.fileName and |
7092 not self.inReopenPrompt and self.fileName and |
|
7093 pathlib.Path(self.fileName).exists() and |
7089 pathlib.Path(self.fileName).stat().st_mtime != self.lastModified |
7094 pathlib.Path(self.fileName).stat().st_mtime != self.lastModified |
7090 ): |
7095 ): |
7091 self.inReopenPrompt = True |
7096 self.inReopenPrompt = True |
7092 if Preferences.getEditor("AutoReopen") and not self.isModified(): |
7097 if Preferences.getEditor("AutoReopen") and not self.isModified(): |
7093 self.refresh() |
7098 self.refresh() |