mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 12:28:52 +00:00
eliminate all warnings by switching NSOpenPanel/NSSavePanels to use completion handler blocks
This commit is contained in:
@@ -39,8 +39,6 @@
|
||||
|
||||
- (void) setDestinationPath: (NSString *) destination;
|
||||
|
||||
- (void) folderChoiceClosed: (NSOpenPanel *) openPanel returnCode: (NSInteger) code contextInfo: (void *) contextInfo;
|
||||
|
||||
- (void) setGroupsMenu;
|
||||
- (void) changeGroupValue: (id) sender;
|
||||
|
||||
@@ -132,8 +130,15 @@
|
||||
[panel setMessage: [NSString stringWithFormat: NSLocalizedString(@"Select the download folder for \"%@\"",
|
||||
"Add -> select destination folder"), [fTorrent name]]];
|
||||
|
||||
[panel beginSheetForDirectory: nil file: nil types: nil modalForWindow: [self window] modalDelegate: self
|
||||
didEndSelector: @selector(folderChoiceClosed:returnCode:contextInfo:) contextInfo: nil];
|
||||
[panel beginSheetModalForWindow: [self window] completionHandler: ^(NSInteger result) {
|
||||
if (result == NSFileHandlingPanelOKButton)
|
||||
[self setDestinationPath: [[[panel URLs] objectAtIndex: 0] path]];
|
||||
else
|
||||
{
|
||||
if (!fDestination)
|
||||
[self performSelectorOnMainThread: @selector(cancelAdd:) withObject: nil waitUntilDone: NO];
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
- (void) add: (id) sender
|
||||
@@ -227,17 +232,6 @@
|
||||
[iconTransformer release];
|
||||
}
|
||||
|
||||
- (void) folderChoiceClosed: (NSOpenPanel *) openPanel returnCode: (NSInteger) code contextInfo: (void *) contextInfo
|
||||
{
|
||||
if (code == NSOKButton)
|
||||
[self setDestinationPath: [[[openPanel URLs] objectAtIndex: 0] path]];
|
||||
else
|
||||
{
|
||||
if (!fDestination)
|
||||
[self performSelectorOnMainThread: @selector(cancelAdd:) withObject: nil waitUntilDone: NO];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) setGroupsMenu
|
||||
{
|
||||
NSMenu * groupMenu = [[GroupsController groups] groupMenuWithTarget: self action: @selector(changeGroupValue:) isSmall: NO];
|
||||
|
||||
Reference in New Issue
Block a user