3006 QMessageBox.Abort | \ |
3006 QMessageBox.Abort | \ |
3007 QMessageBox.Discard | \ |
3007 QMessageBox.Discard | \ |
3008 QMessageBox.Save), |
3008 QMessageBox.Save), |
3009 QMessageBox.Save) |
3009 QMessageBox.Save) |
3010 if res == QMessageBox.Save: |
3010 if res == QMessageBox.Save: |
3011 ok, newName = editor.saveFile() |
3011 ok = editor.saveFile() |
3012 if ok: |
3012 if ok: |
3013 self.setEditorName(editor, newName) |
3013 self.setEditorName(editor, editor.getFileName()) |
3014 return ok |
3014 return ok |
3015 elif res == QMessageBox.Abort: |
3015 elif res == QMessageBox.Abort: |
3016 return False |
3016 return False |
3017 |
3017 |
3018 return True |
3018 return True |
3494 Public slot to save a list of editors. |
3494 Public slot to save a list of editors. |
3495 |
3495 |
3496 @param editors list of editors to be saved |
3496 @param editors list of editors to be saved |
3497 """ |
3497 """ |
3498 for editor in editors: |
3498 for editor in editors: |
3499 ok, newName = editor.saveFile() |
3499 ok = editor.saveFile() |
3500 if ok: |
3500 if ok: |
3501 self.setEditorName(editor, newName) |
3501 self.setEditorName(editor, editor.getFileName()) |
3502 |
3502 |
3503 def saveAllEditors(self): |
3503 def saveAllEditors(self): |
3504 """ |
3504 """ |
3505 Public slot to save the contents of all editors. |
3505 Public slot to save the contents of all editors. |
3506 """ |
3506 """ |
3507 for editor in self.editors: |
3507 for editor in self.editors: |
3508 ok, newName = editor.saveFile() |
3508 ok = editor.saveFile() |
3509 if ok: |
3509 if ok: |
3510 self.setEditorName(editor, newName) |
3510 self.setEditorName(editor, editor.getFileName()) |
3511 |
3511 |
3512 # restart autosave timer |
3512 # restart autosave timer |
3513 if self.autosaveInterval > 0: |
3513 if self.autosaveInterval > 0: |
3514 self.autosaveTimer.start(self.autosaveInterval * 60000) |
3514 self.autosaveTimer.start(self.autosaveInterval * 60000) |
3515 |
3515 |
4636 |
4636 |
4637 Only named editors will be saved by the autosave timer. |
4637 Only named editors will be saved by the autosave timer. |
4638 """ |
4638 """ |
4639 for editor in self.editors: |
4639 for editor in self.editors: |
4640 if editor.shouldAutosave(): |
4640 if editor.shouldAutosave(): |
4641 ok, newName = editor.saveFile() |
4641 ok = editor.saveFile() |
4642 if ok: |
4642 if ok: |
4643 self.setEditorName(editor, newName) |
4643 self.setEditorName(editor, editor.getFileName()) |
4644 |
4644 |
4645 # restart autosave timer |
4645 # restart autosave timer |
4646 if self.autosaveInterval > 0: |
4646 if self.autosaveInterval > 0: |
4647 self.autosaveTimer.start(self.autosaveInterval * 60000) |
4647 self.autosaveTimer.start(self.autosaveInterval * 60000) |
4648 |
4648 |