From: Mitchell Livingston Date: Thu, 10 Feb 2011 00:58:05 +0000 (+0000) Subject: remember the text in the URL sheet X-Git-Tag: 2.30b1~386 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7fabe85b96ef11e663f8bd1ccc64bf3ff45bb20f;p=transmission remember the text in the URL sheet --- diff --git a/macosx/Controller.m b/macosx/Controller.m index 95d48b2df..3e1eb7ca5 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -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) diff --git a/macosx/URLSheetWindowController.m b/macosx/URLSheetWindowController.m index edfab8e97..0f14c4b05 100644 --- a/macosx/URLSheetWindowController.m +++ b/macosx/URLSheetWindowController.m @@ -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