Changeset 3368


Ignore:
Timestamp:
Oct 11, 2007, 12:06:46 PM (15 years ago)
Author:
livings124
Message:

general cleanup

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/MessageWindowController.m

    r3314 r3368  
    9191    int level = tr_getMessageLevel();
    9292    switch (level)
    93         {
    94             case TR_MSG_ERR:
    95                 [fLevelButton selectItemAtIndex: LEVEL_ERROR];
    96                 break;
    97             case TR_MSG_INF:
    98                 [fLevelButton selectItemAtIndex: LEVEL_INFO];
    99                 break;
    100             case TR_MSG_DBG:
    101                 [fLevelButton selectItemAtIndex: LEVEL_DEBUG];
    102         }
     93    {
     94        case TR_MSG_ERR:
     95            [fLevelButton selectItemAtIndex: LEVEL_ERROR];
     96            break;
     97        case TR_MSG_INF:
     98            [fLevelButton selectItemAtIndex: LEVEL_INFO];
     99            break;
     100        case TR_MSG_DBG:
     101            [fLevelButton selectItemAtIndex: LEVEL_DEBUG];
     102    }
    103103   
    104104    [self setDebugWarningHidden: level != TR_MSG_DBG];
  • trunk/macosx/TorrentTableView.m

    r3327 r3368  
    8787    return self;
    8888}
    89    
    90 - (void) awakeFromNib
    91 {
    92     [fContextRow setTitle: @"Context"];
    93     [fContextNoRow setTitle: @"Context"];
    94 }
    9589
    9690- (void) dealloc
     
    158152    NSPoint point = [self convertPoint: [event locationInWindow] fromView: nil];
    159153    int row = [self rowAtPoint: point], oldRow = [self rowAtPoint: fClickPoint];
    160     BOOL sameRow = row == oldRow;
    161    
    162     if (sameRow && [self pointInPauseRect: point] && [self pointInPauseRect: fClickPoint])
     154   
     155    if (row == oldRow && [self pointInPauseRect: point] && [self pointInPauseRect: fClickPoint])
    163156    {
    164157        Torrent * torrent = [fTorrents objectAtIndex: row];
    165 
     158       
    166159        if ([torrent isActive])
    167160            [fController stopTorrents: [NSArray arrayWithObject: torrent]];
     
    177170        else;
    178171    }
    179     else if (sameRow && [self pointInRevealRect: point] && [self pointInRevealRect: fClickPoint])
     172    else if (row == oldRow && [self pointInRevealRect: point] && [self pointInRevealRect: fClickPoint])
    180173        [[fTorrents objectAtIndex: row] revealData];
    181174    else if ([event clickCount] == 2 && !NSEqualPoints(fClickPoint, NSZeroPoint))
     
    238231        if (![self isRowSelected: row])
    239232            [self selectRowIndexes: [NSIndexSet indexSetWithIndex: row] byExtendingSelection: NO];
    240                
    241233        return fContextRow;
    242234    }
     
    389381- (void) setQuickLimitMode: (id) sender
    390382{
    391     int tag = [sender tag];
    392383    int mode;
    393     if (tag == ACTION_MENU_UNLIMITED_TAG)
    394         mode = TR_SPEEDLIMIT_UNLIMITED;
    395     else if (tag == ACTION_MENU_LIMIT_TAG)
    396         mode = TR_SPEEDLIMIT_SINGLE;
    397     else
    398         mode = TR_SPEEDLIMIT_GLOBAL;
     384    switch ([sender tag])
     385    {
     386        case ACTION_MENU_UNLIMITED_TAG:
     387            mode = TR_SPEEDLIMIT_UNLIMITED;
     388            break;
     389        case ACTION_MENU_LIMIT_TAG:
     390            mode = TR_SPEEDLIMIT_SINGLE;
     391            break;
     392        case ACTION_MENU_GLOBAL_TAG:
     393            mode = TR_SPEEDLIMIT_GLOBAL;
     394            break;
     395        default:
     396            return;
     397    }
    399398   
    400399    [fMenuTorrent setSpeedMode: mode upload: [sender menu] == fUploadMenu];
     
    415414
    416415{
    417     int tag = [sender tag];
    418416    int mode;
    419     if (tag == ACTION_MENU_UNLIMITED_TAG)
    420         mode = NSOffState;
    421     else if (tag == ACTION_MENU_LIMIT_TAG)
    422         mode = NSOnState;
    423     else
    424         mode = NSMixedState;
     417    switch ([sender tag])
     418    {
     419        case ACTION_MENU_UNLIMITED_TAG:
     420            mode = NSOffState;
     421            break;
     422        case ACTION_MENU_LIMIT_TAG:
     423            mode = NSOnState;
     424            break;
     425        case ACTION_MENU_GLOBAL_TAG:
     426            mode = NSMixedState;
     427            break;
     428        default:
     429            return;
     430    }
    425431   
    426432    [fMenuTorrent setRatioSetting: mode];
Note: See TracChangeset for help on using the changeset viewer.