eric6/ViewManager/ViewManager.py

changeset 8379
ef170cde761b
parent 8317
0703d36de27c
child 8400
b3eefd7e58d1
equal deleted inserted replaced
8362:2b9eaba83d99 8379:ef170cde761b
4418 else: 4418 else:
4419 return True 4419 return True
4420 4420
4421 res = self.checkDirty(editor) 4421 res = self.checkDirty(editor)
4422 return res 4422 return res
4423 4423
4424 def hasDirtyEditor(self):
4425 """
4426 Public method to ask, if any of the open editors contains unsaved
4427 changes.
4428
4429 @return flag indicating at least one editor has unsaved changes
4430 @rtype bool
4431 """
4432 return any(editor.isModified() for editor in self.editors)
4433
4424 def closeEditor(self, editor, ignoreDirty=False): 4434 def closeEditor(self, editor, ignoreDirty=False):
4425 """ 4435 """
4426 Public method to close an editor window. 4436 Public method to close an editor window.
4427 4437
4428 @param editor editor window to be closed 4438 @param editor editor window to be closed
4472 if res and aw == self.currentEditor: 4482 if res and aw == self.currentEditor:
4473 self.currentEditor = None 4483 self.currentEditor = None
4474 4484
4475 return res 4485 return res
4476 4486
4477 def closeAllWindows(self): 4487 def closeAllWindows(self, ignoreDirty=False):
4478 """ 4488 """
4479 Public method to close all editor windows via file menu. 4489 Public method to close all editor windows.
4490
4491 @param ignoreDirty flag indicating to ignore the 'dirty' status
4492 @type bool
4480 """ 4493 """
4481 savedEditors = self.editors[:] 4494 savedEditors = self.editors[:]
4482 for editor in savedEditors: 4495 for editor in savedEditors:
4483 self.closeEditor(editor) 4496 self.closeEditor(editor, ignoreDirty=ignoreDirty)
4484 4497
4485 def closeWindow(self, fn, ignoreDirty=False): 4498 def closeWindow(self, fn, ignoreDirty=False):
4486 """ 4499 """
4487 Public method to close an arbitrary source editor. 4500 Public method to close an arbitrary source editor.
4488 4501

eric ide

mercurial