[[[URLSheetWindowController alloc] initWithController: self] beginSheetForWindow: fWindow];
}
-#warning need to remember sheet text between runs
- (void) urlSheetDidEnd: (URLSheetWindowController *) controller url: (NSString *) urlString returnCode: (NSInteger) returnCode
{
if (returnCode != 1)
@implementation URLSheetWindowController
+NSString * urlString = @"";
+
- (id) initWithController: (Controller *) controller
{
if ((self = [self initWithWindowNibName: @"URLSheetWindow"]))
- (void) awakeFromNib
{
[fLabelField setStringValue: NSLocalizedString(@"Internet address of torrent file:", "URL sheet label")];
+
+ [fTextField setStringValue: urlString];
+ [fTextField selectText: self];
}
- (IBAction) beginSheetForWindow: (NSWindow *) window
- (void) sheetDidEnd: (NSWindow *) sheet returnCode: (NSInteger) returnCode contextInfo: (void *) contextInfo
{
- [fController urlSheetDidEnd: self url: [fTextField stringValue] returnCode: returnCode];
+ urlString = [fTextField stringValue];
+ [fController urlSheetDidEnd: self url: urlString returnCode: returnCode];
}
- (void) controlTextDidChange: (NSNotification *) notification