]> granicus.if.org Git - transmission/commitdiff
remember the text in the URL sheet
authorMitchell Livingston <livings124@transmissionbt.com>
Thu, 10 Feb 2011 00:58:05 +0000 (00:58 +0000)
committerMitchell Livingston <livings124@transmissionbt.com>
Thu, 10 Feb 2011 00:58:05 +0000 (00:58 +0000)
macosx/Controller.m
macosx/URLSheetWindowController.m

index 95d48b2df40cece3ab4b35e12649d2f38a0b8da9..3e1eb7ca5e08dccb1b324fbbeaa220ae91773984 100644 (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)
index edfab8e97c0d59500019e0ff412dd21757c6d3a9..0f14c4b0550375c1db106790a55de2b788b1b6e0 100644 (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