mirror of
https://github.com/transmission/transmission.git
synced 2025-12-25 04:45:56 +00:00
eliminate all warnings by switching NSOpenPanel/NSSavePanels to use completion handler blocks
This commit is contained in:
@@ -34,7 +34,6 @@
|
||||
@interface CreatorWindowController (Private)
|
||||
|
||||
+ (NSString *) chooseFile;
|
||||
- (void) locationSheetClosed: (NSSavePanel *) openPanel returnCode: (NSInteger) code contextInfo: (void *) info;
|
||||
|
||||
- (void) createBlankAddressAlertDidEnd: (NSAlert *) alert returnCode: (NSInteger) returnCode contextInfo: (void *) contextInfo;
|
||||
- (void) createReal;
|
||||
@@ -209,9 +208,19 @@
|
||||
[panel setAllowedFileTypes: [NSArray arrayWithObjects: @"org.bittorrent.torrent", @"torrent", nil]];
|
||||
[panel setCanSelectHiddenExtension: YES];
|
||||
|
||||
[panel beginSheetForDirectory: [fLocation stringByDeletingLastPathComponent] file: [fLocation lastPathComponent]
|
||||
modalForWindow: [self window] modalDelegate: self didEndSelector: @selector(locationSheetClosed:returnCode:contextInfo:)
|
||||
contextInfo: nil];
|
||||
[panel setDirectoryURL: [NSURL fileURLWithPath: [fLocation stringByDeletingLastPathComponent]]];
|
||||
[panel setNameFieldStringValue: [fLocation lastPathComponent]];
|
||||
|
||||
[panel beginSheetModalForWindow: [self window] completionHandler: ^(NSInteger result) {
|
||||
if (result == NSFileHandlingPanelOKButton)
|
||||
{
|
||||
[fLocation release];
|
||||
fLocation = [[[panel URL] path] retain];
|
||||
|
||||
[fLocationField setStringValue: [fLocation stringByAbbreviatingWithTildeInPath]];
|
||||
[fLocationField setToolTip: fLocation];
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
- (void) create: (id) sender
|
||||
@@ -407,18 +416,6 @@
|
||||
return success ? [[[panel URLs] objectAtIndex: 0] path] : nil;
|
||||
}
|
||||
|
||||
- (void) locationSheetClosed: (NSSavePanel *) panel returnCode: (NSInteger) code contextInfo: (void *) info
|
||||
{
|
||||
if (code == NSOKButton)
|
||||
{
|
||||
[fLocation release];
|
||||
fLocation = [[[panel URL] path] retain];
|
||||
|
||||
[fLocationField setStringValue: [fLocation stringByAbbreviatingWithTildeInPath]];
|
||||
[fLocationField setToolTip: fLocation];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) createBlankAddressAlertDidEnd: (NSAlert *) alert returnCode: (NSInteger) returnCode contextInfo: (void *) contextInfo
|
||||
{
|
||||
if ([[alert suppressionButton] state] == NSOnState)
|
||||
|
||||
Reference in New Issue
Block a user