Added check for valid destination.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@17641 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2003-09-08 03:34:40 +00:00
parent 9e44d5a26d
commit 3b7d508e7d
2 changed files with 13 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2003-09-07 Gregory John Casamento <greg_casamento@yahoo.com>
* GormInspectorsManager.m: Added check in -[ok:] to determine if
selected destination is valid. If it is nil an alert panel is shown.
This will help prevent the creation of invalid connections.
2003-09-07 Andrew Ruder <aeruder@ksu.edu>
comitted by Gregory Casamento

View file

@ -1051,7 +1051,13 @@ selectCellWithString: (NSString*)title
- (void) ok: (id)sender
{
if ([connectors containsObject: currentConnector] == YES)
if([currentConnector destination] == nil)
{
NSRunAlertPanel(_(@"Problem making connection"),
_(@"You must select a valid destination"),
_(@"OK"), nil, nil, nil);
}
else if ([connectors containsObject: currentConnector] == YES)
{
[[(id<IB>)NSApp activeDocument] removeConnector: currentConnector];
if ([currentConnector isKindOfClass: [NSNibOutletConnector class]])