Ignore:
Timestamp:
Jul 27, 2011, 3:38:01 AM (11 years ago)
Author:
livings124
Message:

Only show a single popover when excessively clicking the global and per-transfer action buttons

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r12597 r12598  
    357357       
    358358        fQuitting = NO;
     359        fGlobalPopoverShown = NO;
    359360        fSoundPlaying = NO;
    360361       
     
    22202221    if ([NSApp isOnLionOrBetter])
    22212222    {
     2223        if (fGlobalPopoverShown)
     2224            return;
     2225       
    22222226        NSPopover * popover = [[NSPopoverLion alloc] init];
    22232227        [popover setBehavior: NSPopoverBehaviorTransient];
    22242228        GlobalOptionsPopoverViewController * viewController = [[GlobalOptionsPopoverViewController alloc] initWithHandle: [PrefsController handle]];
    22252229        [popover setContentViewController: viewController];
     2230        [popover setDelegate: self];
    22262231       
    22272232        [popover showRelativeToRect: [sender frame] ofView: sender preferredEdge: NSMaxYEdge];
     
    22482253        }
    22492254    }
     2255}
     2256
     2257//don't show multiple popovers when clicking the gear button repeatedly
     2258- (void) popoverWillShow: (NSNotification *) notification
     2259{
     2260    fGlobalPopoverShown = YES;
     2261}
     2262
     2263- (void) popoverWillClose: (NSNotification *) notification
     2264{
     2265    fGlobalPopoverShown = NO;
    22502266}
    22512267
Note: See TracChangeset for help on using the changeset viewer.