mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-02-23 19:51:00 +00:00
Replace connections alert panel and move logic to delegate
This commit is contained in:
parent
2e14ad8951
commit
cc34827230
4 changed files with 27 additions and 27 deletions
|
@ -170,13 +170,23 @@
|
|||
_(@"Cancel"),
|
||||
nil,
|
||||
nil);
|
||||
/*
|
||||
if(retval != NSAlertDefaultReturn)
|
||||
{
|
||||
// close the document, if the user says "NO."
|
||||
[self close];
|
||||
|
||||
return (retval == NSAlertDefaultReturn);
|
||||
}
|
||||
*/
|
||||
|
||||
- (BOOL) shouldBreakConnectionsForClassNamed: (NSString *)className
|
||||
{
|
||||
NSInteger retval = -1;
|
||||
NSString *title = [NSString stringWithFormat: @"%@",_(@"Modifying Class")];
|
||||
NSString *msg;
|
||||
NSString *msgFormat = _(@"This will break all connections to "
|
||||
@"actions/outlets to instances of class '%@' and it's subclasses. Continue?");
|
||||
|
||||
msg = [NSString stringWithFormat: msgFormat, className];
|
||||
|
||||
// ask the user if he/she wants to continue...
|
||||
retval = NSRunAlertPanel(title, msg,_(@"OK"),_(@"Cancel"), nil, nil);
|
||||
|
||||
return (retval == NSAlertDefaultReturn);
|
||||
}
|
||||
|
||||
|
|
|
@ -2728,25 +2728,8 @@ static void _real_close(GormDocument *self,
|
|||
{
|
||||
NSEnumerator *en = nil;
|
||||
id<IBConnectors> c = nil;
|
||||
BOOL removed = YES;
|
||||
NSInteger retval = -1;
|
||||
NSString *title = [NSString stringWithFormat: @"%@",_(@"Modifying Class")];
|
||||
NSString *msg;
|
||||
NSString *msgFormat = _(@"This will break all connections to "
|
||||
@"actions/outlets to instances of class '%@' and it's subclasses. Continue?");
|
||||
|
||||
msg = [NSString stringWithFormat: msgFormat, className];
|
||||
|
||||
// ask the user if he/she wants to continue...
|
||||
retval = NSRunAlertPanel(title, msg,_(@"OK"),_(@"Cancel"), nil, nil);
|
||||
if (retval == NSAlertDefaultReturn)
|
||||
{
|
||||
removed = YES;
|
||||
}
|
||||
else
|
||||
{
|
||||
removed = NO;
|
||||
}
|
||||
id delegate = [NSApp delegate];
|
||||
BOOL removed = [delegate shouldBreakConnectionsForClassNamed: className];
|
||||
|
||||
// remove all.
|
||||
if(removed)
|
||||
|
|
|
@ -56,6 +56,7 @@
|
|||
- (BOOL) isInTool;
|
||||
- (BOOL) shouldUpgradeOlderArchive;
|
||||
- (BOOL) shouldLoadNewerArchive;
|
||||
- (BOOL) shouldBreakConnectionsForClassNamed: (NSString *)className;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -47,6 +47,12 @@
|
|||
return NO;
|
||||
}
|
||||
|
||||
- (BOOL) shouldBreakConnectionsForClassNamed: (NSString *)className
|
||||
{
|
||||
NSLog(@"Breaking connections for instances of class: %@", className);
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (NSDictionary *) parseArguments
|
||||
{
|
||||
GormDocumentController *dc = [GormDocumentController sharedDocumentController];
|
||||
|
|
Loading…
Reference in a new issue