Changeset 318


Ignore:
Timestamp:
Jun 10, 2006, 4:12:40 AM (16 years ago)
Author:
livings124
Message:

Having two booleans was redundant.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r313 r318  
    11411141    SEL action = [menuItem action];
    11421142
    1143     //only enable some items if the window is useable or it is in a context menu
    1144     BOOL canUseWindow = [fWindow isKeyWindow] && ![fToolbar customizationPaletteIsRunning];
    1145     BOOL fromContext = [[[menuItem menu] title] isEqualToString: @"Context"];
     1143    //only enable some items if it is in a context menu or the window is useable
     1144    BOOL canUseMenu = [[[menuItem menu] title] isEqualToString: @"Context"]
     1145                        || ([fWindow isKeyWindow] && ![fToolbar customizationPaletteIsRunning]);
    11461146
    11471147    //enable show info
     
    11651165                [menuItem setTitle: title];
    11661166
    1167         return canUseWindow;
     1167        return canUseMenu;
    11681168    }
    11691169
     
    11921192    if (action == @selector(revealFile:))
    11931193    {
    1194         return (canUseWindow || fromContext) && [fTableView numberOfSelectedRows] > 0;
     1194        return canUseMenu && [fTableView numberOfSelectedRows] > 0;
    11951195    }
    11961196
     
    12261226                            [title rangeOfString: NS_ELLIPSIS].location]];
    12271227        }
    1228         return (canUseWindow || fromContext) && [fTableView numberOfSelectedRows] > 0;
     1228        return canUseMenu && [fTableView numberOfSelectedRows] > 0;
    12291229    }
    12301230
     
    12321232    if( action == @selector(stopTorrent:) )
    12331233    {
    1234         if (!canUseWindow && !fromContext)
     1234        if (!canUseMenu)
    12351235            return NO;
    12361236   
     
    12511251    if( action == @selector(resumeTorrent:) )
    12521252    {
    1253         if (!canUseWindow && !fromContext)
     1253        if (!canUseMenu)
    12541254            return NO;
    12551255   
     
    12691269    //enable resume item
    12701270    if (action == @selector(setSort:) || (action == @selector(advancedChanged:)))
    1271         return canUseWindow;
     1271        return canUseMenu;
    12721272
    12731273    return YES;
Note: See TracChangeset for help on using the changeset viewer.