2003-09-09 01:28:46 +00:00
|
|
|
// Author: Andrew E. Ruder
|
|
|
|
// Copyright (C) 2003 by Free Software Foundation, Inc
|
|
|
|
|
2019-11-03 01:57:39 +00:00
|
|
|
#include <AppKit/AppKit.h>
|
2003-09-09 01:28:46 +00:00
|
|
|
|
2019-11-03 01:57:39 +00:00
|
|
|
#include "GormSetNameController.h"
|
2003-09-09 01:28:46 +00:00
|
|
|
|
|
|
|
@implementation GormSetNameController : NSObject
|
2013-06-05 13:26:08 +00:00
|
|
|
- (NSInteger)runAsModal
|
2003-09-09 01:28:46 +00:00
|
|
|
{
|
2013-06-05 13:26:08 +00:00
|
|
|
NSInteger result;
|
2003-09-09 01:28:46 +00:00
|
|
|
|
|
|
|
if (!window)
|
|
|
|
{
|
2023-06-14 07:40:51 +00:00
|
|
|
NSBundle *bundle = [NSBundle bundleForClass: [self class]];
|
|
|
|
|
|
|
|
if (![bundle loadNibNamed: @"GormSetName" owner: self topLevelObjects: nil])
|
2003-09-09 01:28:46 +00:00
|
|
|
{
|
|
|
|
return NSAlertAlternateReturn;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
[window makeKeyAndOrderFront: nil];
|
|
|
|
[window makeFirstResponder: textField];
|
|
|
|
|
|
|
|
result = [NSApp runModalForWindow: window];
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
- (NSTextField *) textField
|
|
|
|
{
|
|
|
|
return textField;
|
|
|
|
}
|
|
|
|
- (void) cancelHit: (id)sender
|
|
|
|
{
|
|
|
|
[window close];
|
|
|
|
[NSApp stopModalWithCode: NSAlertAlternateReturn];
|
|
|
|
}
|
|
|
|
- (void) okHit: (id)sender
|
|
|
|
{
|
|
|
|
[window close];
|
|
|
|
[NSApp stopModalWithCode: NSAlertDefaultReturn];
|
|
|
|
}
|
|
|
|
@end
|