Prevent a call to "stop:" from the test session from killing the app.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@21314 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2005-06-17 03:43:43 +00:00
parent 9ce0b44f38
commit 5a8506b4fb
2 changed files with 34 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2005-06-16 23:49 Gregory John Casamento <greg_casamento@yahoo.com>
* Gorm.m: Override "stop:" to call endTesting: if a test
session is running, instead of killing the app.
2005-06-16 19:49 Gregory John Casamento <greg_casamento@yahoo.com>
* GormLib/IBInspector.m: Added "revert" call in setObject:

31
Gorm.m
View file

@ -153,6 +153,18 @@
[super dealloc];
}
- (void) stop: (id)sender
{
if(isTesting == NO)
{
[super stop: sender];
}
else
{
[self endTesting: sender];
}
}
- (void) applicationDidFinishLaunching: (NSApplication*)sender
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
@ -546,8 +558,10 @@
NSData *data;
NSArchiver *archiver;
NSEnumerator *en;
NSDictionary *substituteClasses = [palettesManager substituteClasses];
NSString *subClassName;
id obj;
// which windows were open when testing started...
testingWindows = [[NSMutableArray alloc] init];
en = [[self windows] objectEnumerator];
@ -565,6 +579,8 @@
[activeDoc beginArchiving];
[archiver encodeClassName: @"GormCustomView"
intoClassName: @"GormTestCustomView"];
/*
[archiver encodeClassName: @"GormNSMenu"
intoClassName: @"NSMenu"];
[archiver encodeClassName: @"GormNSWindow"
@ -575,6 +591,16 @@
intoClassName: @"NSPopUpButton"];
[archiver encodeClassName: @"GormNSPopUpButtonCell"
intoClassName: @"NSPopUpButtonCell"];
*/
en = [substituteClasses keyEnumerator];
while((subClassName = [en nextObject]) != nil)
{
NSString *realClassName = [substituteClasses objectForKey: subClassName];
[archiver encodeClassName: subClassName
intoClassName: realClassName];
}
/*
[archiver encodeClassName: @"GormNSBrowser"
intoClassName: @"NSBrowser"];
@ -583,12 +609,13 @@
[archiver encodeClassName: @"GormNSOutlineView"
intoClassName: @"NSOutlineView"];
*/
[GSClassSwapper setIsInInterfaceBuilder: YES]; // do not allow custom classes during testing.
[archiver encodeRootObject: activeDoc];
data = RETAIN([archiver archiverData]); // Released below...
[activeDoc endArchiving];
RELEASE(archiver);
[GSClassSwapper setIsInInterfaceBuilder: NO]; // beginal allowing custom classes...
[GSClassSwapper setIsInInterfaceBuilder: NO]; // begin allowing custom classes...
[notifCenter postNotificationName: IBWillBeginTestingInterfaceNotification
object: self];