mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-02 21:43:36 +00:00
added missing methods to CPDocumentController
documentForWindow hasEditedDocuments both are in cocoa
This commit is contained in:
@@ -279,6 +279,33 @@ var CPSharedDocumentController = nil;
|
||||
[_documents removeObjectIdenticalTo:aDocument];
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the document object whose window controller
|
||||
owns a specified window.
|
||||
*/
|
||||
- (CPDocument)documentForWindow:(CPWindow)aWindow
|
||||
{
|
||||
return [[aWindow windowController] document];
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns a Boolean value that indicates whether the receiver
|
||||
has any documents with unsaved changes.
|
||||
*/
|
||||
- (BOOL)hasEditedDocuments
|
||||
{
|
||||
var iter = [_documents objectEnumerator],
|
||||
obj;
|
||||
|
||||
while ((obj = [iter nextObject]) !== nil)
|
||||
{
|
||||
if ([obj isDocumentEdited])
|
||||
return YES;
|
||||
}
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (CPString)defaultType
|
||||
{
|
||||
return [_documentTypes[0] objectForKey:@"CPBundleTypeName"];
|
||||
|
||||
Reference in New Issue
Block a user