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

@@ -1229,7 +1229,6 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
[[[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)

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