Ignore:
Timestamp:
Dec 11, 2011, 10:31:01 PM (10 years ago)
Author:
livings124
Message:

eliminate all warnings by switching NSOpenPanel/NSSavePanels to use completion handler blocks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/AddMagnetWindowController.m

    r12943 r13108  
    4040- (void) setDestinationPath: (NSString *) destination;
    4141
    42 - (void) folderChoiceClosed: (NSOpenPanel *) openPanel returnCode: (NSInteger) code contextInfo: (void *) contextInfo;
    43 
    4442- (void) setGroupsMenu;
    4543- (void) changeGroupValue: (id) sender;
     
    133131                        "Add -> select destination folder"), [fTorrent name]]];
    134132   
    135     [panel beginSheetForDirectory: nil file: nil types: nil modalForWindow: [self window] modalDelegate: self
    136             didEndSelector: @selector(folderChoiceClosed:returnCode:contextInfo:) contextInfo: nil];
     133    [panel beginSheetModalForWindow: [self window] completionHandler: ^(NSInteger result) {
     134        if (result == NSFileHandlingPanelOKButton)
     135            [self setDestinationPath: [[[panel URLs] objectAtIndex: 0] path]];
     136        else
     137        {
     138            if (!fDestination)
     139                [self performSelectorOnMainThread: @selector(cancelAdd:) withObject: nil waitUntilDone: NO];
     140        }
     141    }];
    137142}
    138143
     
    228233}
    229234
    230 - (void) folderChoiceClosed: (NSOpenPanel *) openPanel returnCode: (NSInteger) code contextInfo: (void *) contextInfo
    231 {
    232     if (code == NSOKButton)
    233         [self setDestinationPath: [[[openPanel URLs] objectAtIndex: 0] path]];
    234     else
    235     {
    236         if (!fDestination)
    237             [self performSelectorOnMainThread: @selector(cancelAdd:) withObject: nil waitUntilDone: NO];
    238     }
    239 }
    240 
    241235- (void) setGroupsMenu
    242236{
Note: See TracChangeset for help on using the changeset viewer.