remember the text in the URL sheet

This commit is contained in:
Mitchell Livingston
2011-02-10 00:58:05 +00:00
parent 9c1281c43c
commit 7fabe85b96
2 changed files with 7 additions and 2 deletions

View File

@@ -27,6 +27,8 @@
@implementation URLSheetWindowController
NSString * urlString = @"";
- (id) initWithController: (Controller *) controller
{
if ((self = [self initWithWindowNibName: @"URLSheetWindow"]))
@@ -39,6 +41,9 @@
- (void) awakeFromNib
{
[fLabelField setStringValue: NSLocalizedString(@"Internet address of torrent file:", "URL sheet label")];
[fTextField setStringValue: urlString];
[fTextField selectText: self];
}
- (IBAction) beginSheetForWindow: (NSWindow *) window
@@ -61,7 +66,8 @@
- (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