Changeset 13323
- Timestamp:
- May 28, 2012, 7:43:53 PM (9 years ago)
- Location:
- trunk/macosx
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/CreatorWindowController.h
r13319 r13323 44 44 45 45 NSTimer * fTimer; 46 BOOL fStarted ;46 BOOL fStarted, fOpenWhenCreated; 47 47 48 48 NSUserDefaults * fDefaults; -
trunk/macosx/CreatorWindowController.m
r13319 r13323 37 37 + (NSURL *) chooseFile; 38 38 39 - (void) updateLocationField; 39 40 - (void) createBlankAddressAlertDidEnd: (NSAlert *) alert returnCode: (NSInteger) returnCode contextInfo: (void *) contextInfo; 40 41 - (void) createReal; … … 184 185 fLocation = [[NSURL alloc] initFileURLWithPath: [[location stringByExpandingTildeInPath] stringByAppendingPathComponent: [name stringByAppendingPathExtension: @"torrent"]]]; 185 186 } 186 NSString * pathString = [fLocation path]; 187 [fLocationField setStringValue: [pathString stringByAbbreviatingWithTildeInPath]]; 188 [fLocationField setToolTip: pathString]; 187 [self updateLocationField]; 189 188 190 189 //set previously saved values … … 235 234 - (void) window: (NSWindow *) window didDecodeRestorableState: (NSCoder *) coder 236 235 { 237 #warning done in 3 places - make a separate method238 236 [fLocation release]; 239 237 fLocation = [[coder decodeObjectForKey: @"TRCreatorLocation"] retain]; 240 NSString * pathString = [fLocation path]; 241 [fLocationField setStringValue: [pathString stringByAbbreviatingWithTildeInPath]]; 242 [fLocationField setToolTip: pathString]; 238 [self updateLocationField]; 243 239 244 240 [fTrackers release]; … … 270 266 [fLocation release]; 271 267 fLocation = [[panel URL] retain]; 272 273 NSString * pathString = [fLocation path]; 274 [fLocationField setStringValue: [pathString stringByAbbreviatingWithTildeInPath]]; 275 [fLocationField setToolTip: pathString]; 268 [self updateLocationField]; 276 269 } 277 270 }]; … … 453 446 454 447 @implementation CreatorWindowController (Private) 448 449 - (void) updateLocationField 450 { 451 NSString * pathString = [fLocation path]; 452 [fLocationField setStringValue: [pathString stringByAbbreviatingWithTildeInPath]]; 453 [fLocationField setToolTip: pathString]; 454 } 455 455 456 456 + (NSURL *) chooseFile … … 540 540 [fDefaults setBool: [fPrivateCheck state] == NSOnState forKey: @"CreatorPrivate"]; 541 541 [fDefaults setBool: [fOpenCheck state] == NSOnState forKey: @"CreatorOpen"]; 542 fOpenWhenCreated = [fOpenCheck state] == NSOnState; //need this since the check box might not exist, and value in prefs might have changed from another creator window 542 543 [fDefaults setURL: [fLocation URLByDeletingLastPathComponent] forKey: @"CreatorLocationURL"]; 543 544 544 545 [[NSNotificationCenter defaultCenter] postNotificationName: @"BeginCreateTorrentFile" object: fLocation userInfo: nil]; 545 tr_makeMetaInfo(fInfo, [[fLocation path] UTF8String], trackerInfo, [fTrackers count], [[fCommentView string] UTF8String], 546 [fPrivateCheck state] == NSOnState); 546 tr_makeMetaInfo(fInfo, [[fLocation path] UTF8String], trackerInfo, [fTrackers count], [[fCommentView string] UTF8String], [fPrivateCheck state] == NSOnState); 547 547 tr_free(trackerInfo); 548 548 … … 562 562 { 563 563 case TR_MAKEMETA_OK: 564 #warning this isn't safe - what if another window changes it after hitting the create button on this window? 565 if ([fDefaults boolForKey: @"CreatorOpen"]) 564 if (fOpenWhenCreated) 566 565 { 567 566 NSDictionary * dict = [[NSDictionary alloc] initWithObjectsAndKeys: [fLocation path], @"File",
Note: See TracChangeset
for help on using the changeset viewer.