diff --git a/AppKit/CPApplication.j b/AppKit/CPApplication.j index c33fad3e7..15ad65916 100644 --- a/AppKit/CPApplication.j +++ b/AppKit/CPApplication.j @@ -234,9 +234,7 @@ CPRunContinuesResponse = -1002; var delegateClass = objj_getClass(delegateClassName); if (delegateClass) - { [self setDelegate:[[delegateClass alloc] init]]; - } } var defaultCenter = [CPNotificationCenter defaultCenter]; diff --git a/Tests/Manual/CPDocumentControllerTest/withNib/AppController.j b/Tests/Manual/CPDocumentControllerTest/withNib/AppController.j index 7b5998837..0300cac6e 100644 --- a/Tests/Manual/CPDocumentControllerTest/withNib/AppController.j +++ b/Tests/Manual/CPDocumentControllerTest/withNib/AppController.j @@ -17,10 +17,6 @@ - (void)applicationDidFinishLaunching:(CPNotification)aNotification { // This is called when the application is done loading. - var sharedDocController = [CPDocumentController sharedDocumentController]; - var docController = [[DocumentController alloc] init]; - var cpAlert = [CPAlert alertWithMessageText:@"Is this the shared instance? " + (sharedDocController == docController) defaultButton:@"OK" alternateButton:nil otherButton:nil informativeTextWithFormat:nil]; - [cpAlert beginSheetModalForWindow:[[CPApplication sharedApplication] mainWindow]]; } - (void)applicationWillFinishLaunching:(CPNotification)aNotification diff --git a/Tests/Manual/CPDocumentControllerTest/withNib/DocumentController.j b/Tests/Manual/CPDocumentControllerTest/withNib/DocumentController.j index 4f37b6aad..c8474ab74 100644 --- a/Tests/Manual/CPDocumentControllerTest/withNib/DocumentController.j +++ b/Tests/Manual/CPDocumentControllerTest/withNib/DocumentController.j @@ -12,4 +12,12 @@ return [CPDocumentController sharedDocumentController]; } +/* Instead of throwing error in browser environment, show an alert + */ +- (void)openDocument:(id)aSender +{ + var anAlert = [CPAlert alertWithError:@"Opening a document is not available!"]; + [anAlert beginSheetModalForWindow:[[CPApplication sharedApplication] mainWindow]]; +} + @end diff --git a/Tests/Manual/CPDocumentControllerTest/withoutNib/AppController.j b/Tests/Manual/CPDocumentControllerTest/withoutNib/AppController.j index c66a0b5ba..a74d59a9d 100644 --- a/Tests/Manual/CPDocumentControllerTest/withoutNib/AppController.j +++ b/Tests/Manual/CPDocumentControllerTest/withoutNib/AppController.j @@ -12,20 +12,17 @@ @implementation AppController : CPObject { - CPDocumentController subclassedCPDocumentController; } - (void)applicationDidFinishLaunching:(CPNotification)aNotification { // This is called when the application is done loading. - var cpAlert = [CPAlert alertWithMessageText:@"Is this the shared instance? " + ([CPDocumentController sharedDocumentController] == subclassedCPDocumentController) defaultButton:@"OK" alternateButton:nil otherButton:nil informativeTextWithFormat:nil]; - [cpAlert beginSheetModalForWindow:[[CPApplication sharedApplication] mainWindow]]; } - (void)applicationWillFinishLaunching:(CPNotification)aNotification { // instantiate a subclass of DocumentController - subclassedCPDocumentController = [[DocumentController alloc] init]; + [[DocumentController alloc] init]; } - (void)awakeFromCib diff --git a/Tests/Manual/CPDocumentControllerTest/withoutNib/DocumentController.j b/Tests/Manual/CPDocumentControllerTest/withoutNib/DocumentController.j index 0066d795b..11d16c2eb 100644 --- a/Tests/Manual/CPDocumentControllerTest/withoutNib/DocumentController.j +++ b/Tests/Manual/CPDocumentControllerTest/withoutNib/DocumentController.j @@ -12,4 +12,12 @@ return self; } +/* Instead of throwing error in browser environment, show an alert + */ +- (void)openDocument:(id)aSender +{ + var anAlert = [CPAlert alertWithError:@"Opening a document is not available!"]; + [anAlert beginSheetModalForWindow:[[CPApplication sharedApplication] mainWindow]]; +} + @end