Changeset 1279

Show
Ignore:
Timestamp:
05/20/04 08:10:53 (5 years ago)
Author:
morris
Message:

use boolForKey and intForKey shortcuts

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • WiredClient/trunk/WCAccounts.m

    r1247 r1279  
    1 /* $Id: WCAccounts.m,v 1.12 2004/05/18 22:29:31 morris Exp $ */ 
     1/* $Id: WCAccounts.m,v 1.13 2004/05/20 06:10:53 morris Exp $ */ 
    22 
    33/* 
     
    155155 
    156156        // --- show window 
    157         if([[WCSettings objectForKey:WCShowAccounts] boolValue]) 
     157        if([WCSettings boolForKey:WCShowAccounts]) 
    158158                [self showWindow:self]; 
    159159} 
  • WiredClient/trunk/WCChat.m

    r1244 r1279  
    1 /* $Id: WCChat.m,v 1.39 2004/05/18 22:24:28 morris Exp $ */ 
     1/* $Id: WCChat.m,v 1.40 2004/05/20 06:10:53 morris Exp $ */ 
    22 
    33/* 
     
    395395 
    396396        // --- post chat about it 
    397         if([[WCSettings objectForKey:WCShowJoinLeave] boolValue]) { 
     397        if([WCSettings boolForKey:WCShowJoinLeave]) { 
    398398                [self printEvent:[NSString stringWithFormat: 
    399399                        NSLocalizedString(@"%@ has joined", @"Client has joined message (nick)"), 
    400400                        nick]]; 
    401                  
    402401        } 
    403402 
     
    440439         
    441440        // --- post chat about it 
    442         if([[WCSettings objectForKey:WCShowJoinLeave] boolValue]) { 
     441        if([WCSettings boolForKey:WCShowJoinLeave]) { 
    443442                [self printEvent:[NSString stringWithFormat: 
    444443                        NSLocalizedString(@"%@ has left", @"Client has left message (nick)"), 
     
    503502 
    504503        // --- post chat about nick changes 
    505         if(![nick isEqualToString:[user nick]] && [[WCSettings objectForKey:WCShowJoinLeave] boolValue]) { 
     504        if(![nick isEqualToString:[user nick]] && [WCSettings boolForKey:WCShowJoinLeave]) { 
    506505                [self printEvent:[NSString stringWithFormat: 
    507506                        NSLocalizedString(@"%@ is now known as %@", @"Client rename message (oldnick, newnick)"), 
     
    564563         
    565564        // --- post chat about it 
    566         if([[WCSettings objectForKey:WCShowJoinLeave] boolValue]) { 
     565        if([WCSettings boolForKey:WCShowJoinLeave]) { 
    567566                [self printEvent:[NSString stringWithFormat: 
    568567                        NSLocalizedString(@"%@ was kicked by %@ (%@)", @"Client kicked message (victim, killer, message)"), 
     
    613612         
    614613        // --- post chat about it 
    615         if([[WCSettings objectForKey:WCShowJoinLeave] boolValue]) { 
     614        if([WCSettings boolForKey:WCShowJoinLeave]) { 
    616615                [self printEvent:[NSString stringWithFormat: 
    617616                        NSLocalizedString(@"%@ was banned by %@ (%@)", @"Client banned message (victim, killer, message)"), 
     
    674673         
    675674        // --- insert a timestamp 
    676         if([[WCSettings objectForKey:WCTimestampChat] boolValue]) { 
     675        if([WCSettings boolForKey:WCTimestampChat]) { 
    677676                interval = [[WCSettings objectForKey:WCTimestampChatInterval] doubleValue]; 
    678677                date = [NSDate dateWithTimeIntervalSinceNow:0 - interval]; 
     
    688687         
    689688        // --- lower the prepend offset a bit when using timestamps 
    690         if([[WCSettings objectForKey:WCTimestampEveryLine] boolValue]) 
     689        if([WCSettings boolForKey:WCTimestampEveryLine]) 
    691690                offset= WCChatPrepend - 4; 
    692691        else 
     
    699698         
    700699        // --- add timestamp 
    701         if([[WCSettings objectForKey:WCTimestampEveryLine] boolValue]) { 
     700        if([WCSettings boolForKey:WCTimestampEveryLine]) { 
    702701                format = [[[NSUserDefaults standardUserDefaults] 
    703702                        objectForKey:NSTimeFormatString] mutableCopy]; 
     
    720719        output = [[_chatOutputTextView textStorage] length] > 0 ? @"\n" : @""; 
    721720         
    722         if([[WCSettings objectForKey:WCChatStyle] intValue] == WCChatStyleWired) { 
     721        if([WCSettings intForKey:WCChatStyle] == WCChatStyleWired) { 
    723722           if(length < 0) { 
    724723                   nick = [nick substringToIndex:offset]; 
     
    728727           } 
    729728            
    730            if([[WCSettings objectForKey:WCTimestampEveryLine] boolValue]) { 
     729           if([WCSettings boolForKey:WCTimestampEveryLine]) { 
    731730                        output = [output stringByAppendingFormat: 
    732731                                NSLocalizedString(@"%@ %@%@: %@", @"Chat message, Wired style (time, padding, nick, message)"), 
     
    738737                } 
    739738        } 
    740         else if([[WCSettings objectForKey:WCChatStyle] intValue] == WCChatStyleIRC) { 
    741                 if([[WCSettings objectForKey:WCTimestampEveryLine] boolValue]) { 
     739        else if([WCSettings intForKey:WCChatStyle] == WCChatStyleIRC) { 
     740                if([WCSettings boolForKey:WCTimestampEveryLine]) { 
    742741                        output = [output stringByAppendingFormat: 
    743742                                NSLocalizedString(@"%@ <%@> %@", @"Chat message, IRC style (time, nick, message)"), 
     
    801800         
    802801        // --- insert a timestamp 
    803         if([[WCSettings objectForKey:WCTimestampChat] boolValue]) { 
     802        if([WCSettings boolForKey:WCTimestampChat]) { 
    804803                interval = [[WCSettings objectForKey:WCTimestampChatInterval] doubleValue]; 
    805804                date = [NSDate dateWithTimeIntervalSinceNow:0 - interval]; 
     
    818817         
    819818        // --- add timestamp 
    820         if([[WCSettings objectForKey:WCTimestampEveryLine] boolValue]) { 
     819        if([WCSettings boolForKey:WCTimestampEveryLine]) { 
    821820                format = [[[NSUserDefaults standardUserDefaults] 
    822821                        objectForKey:NSTimeFormatString] mutableCopy]; 
     
    840839         
    841840        if([[WCSettings objectForKey:WCChatStyle] intValue] == WCChatStyleWired) { 
    842                 if([[WCSettings objectForKey:WCTimestampEveryLine] boolValue]) { 
     841                if([WCSettings boolForKey:WCTimestampEveryLine]) { 
    843842                        output = [output stringByAppendingFormat: 
    844843                                NSLocalizedString(@"%@ *** %@ %@", @"Action chat message (time, nick, message)"), 
     
    851850        } 
    852851        else if([[WCSettings objectForKey:WCChatStyle] intValue] == WCChatStyleIRC) { 
    853                 if([[WCSettings objectForKey:WCTimestampEveryLine] boolValue]) { 
     852                if([WCSettings boolForKey:WCTimestampEveryLine]) { 
    854853                        output = [output stringByAppendingFormat: 
    855854                                NSLocalizedString(@"%@ * %@ %@", @"Action chat message (time, nick, message)"), 
     
    10151014        } 
    10161015        // --- user pressed tab key 
    1017         else if(selector == @selector(insertTab:) && 
    1018                         [[WCSettings objectForKey:WCTabCompleteNicks] boolValue]) { 
     1016        else if(selector == @selector(insertTab:) && [WCSettings boolForKey:WCTabCompleteNicks]) { 
    10191017                NSMutableArray  *users; 
    10201018                NSString                *string, *nick, *completed = @""; 
     
    10901088                 
    10911089                // --- get required modifier 
    1092                 history = [[WCSettings objectForKey:WCHistoryScrollback] boolValue]; 
    1093                 modifier = [[WCSettings objectForKey:WCHistoryScrollbackModifier] intValue]; 
     1090                history = [WCSettings boolForKey:WCHistoryScrollback]; 
     1091                modifier = [WCSettings intForKey:WCHistoryScrollbackModifier]; 
    10941092                 
    10951093                // --- user pressed the arrow up key 
     
    12711269        output = [[_chatOutputTextView textStorage] length] > 0 ? @"\n" : @""; 
    12721270         
    1273         if([[WCSettings objectForKey:WCTimestampEveryLine] boolValue]) { 
     1271        if([WCSettings boolForKey:WCTimestampEveryLine]) { 
    12741272                format = [[[NSUserDefaults standardUserDefaults] 
    12751273                        objectForKey:NSTimeFormatString] mutableCopy]; 
  • WiredClient/trunk/WCClient.m

    r1254 r1279  
    1 /* $Id: WCClient.m,v 1.21 2004/05/19 00:31:26 morris Exp $ */ 
     1/* $Id: WCClient.m,v 1.22 2004/05/20 06:10:53 morris Exp $ */ 
    22 
    33/* 
     
    231231        [self sendCommand:WCWhoCommand withArgument:[NSString stringWithFormat:@"%d", 1]]; 
    232232         
    233         if([[WCSettings objectForKey:WCLoadNewsOnLogin] boolValue]) 
     233        if([WCSettings boolForKey:WCLoadNewsOnLogin]) 
    234234                [self sendCommand:WCNewsCommand]; 
    235235         
  • WiredClient/trunk/WCConsole.m

    r1108 r1279  
    1 /* $Id: WCConsole.m,v 1.4 2004/03/28 23:35:07 morris Exp $ */ 
     1/* $Id: WCConsole.m,v 1.5 2004/05/20 06:10:53 morris Exp $ */ 
    22 
    33/* 
     
    9191 
    9292        // --- show window 
    93         if([[WCSettings objectForKey:WCShowConsole] boolValue]) 
     93        if([WCSettings boolForKey:WCShowConsole]) 
    9494                [self showWindow:self]; 
    9595} 
  • WiredClient/trunk/WCFiles.m

    r1278 r1279  
    1 /* $Id: WCFiles.m,v 1.26 2004/05/20 04:03:32 morris Exp $ */ 
     1/* $Id: WCFiles.m,v 1.27 2004/05/20 06:10:53 morris Exp $ */ 
    22 
    33/* 
     
    684684                        // --- determine settings 
    685685                        optionKey       = (([[NSApp currentEvent] modifierFlags] & NSAlternateKeyMask) != 0); 
    686                         newWindows      = [[WCSettings objectForKey:WCOpenFoldersInNewWindows] boolValue]; 
     686                        newWindows      = [WCSettings boolForKey:WCOpenFoldersInNewWindows]; 
    687687         
    688688                        if((newWindows && !optionKey) || (!newWindows && optionKey)) { 
  • WiredClient/trunk/WCMain.m

    r1268 r1279  
    1 /* $Id: WCMain.m,v 1.25 2004/05/19 21:55:48 morris Exp $ */ 
     1/* $Id: WCMain.m,v 1.26 2004/05/20 06:10:53 morris Exp $ */ 
    22 
    33/* 
     
    169169 
    170170        // --- open the connection window 
    171         if([[WCSettings objectForKey:WCShowConnectAtStartup] boolValue] == YES
     171        if([WCSettings boolForKey:WCShowConnectAtStartup]
    172172                [self connect:self]; 
    173173 
    174174        // --- open the tackers window 
    175         if([[WCSettings objectForKey:WCShowTrackersAtStartup] boolValue] == YES
     175        if([WCSettings boolForKey:WCShowTrackersAtStartup]
    176176                [_trackers showWindow:self]; 
    177177} 
     
    233233        //     closing ourselves 
    234234        if([[connection client] connected] && 
    235            [[WCSettings objectForKey:WCConfirmDisconnect] boolValue] == YES) { 
     235           [WCSettings boolForKey:WCConfirmDisconnect]) { 
    236236                if(NSRunAlertPanel(NSLocalizedString(@"Are you sure you want to quit?", @"Quit dialog title"), 
    237237                                                   NSLocalizedString(@"All connections will be terminated.", @"Quit dialog description"), 
     
    306306- (void)preferencesDidChange:(NSNotification *)notification { 
    307307        // --- add/remove ellipsis depending on if a dialog will be shown or not 
    308         if([[WCSettings objectForKey:WCConfirmDisconnect] boolValue]) { 
     308        if([WCSettings boolForKey:WCConfirmDisconnect]) { 
    309309                [_disconnectMenuItem setTitle:[NSString stringWithFormat: 
    310310                        @"%@%C", NSLocalizedString(@"Disconnect", @"Disconnect menu item"), 0x2026]]; 
  • WiredClient/trunk/WCMessages.m

    r1180 r1279  
    1 /* $Id: WCMessages.m,v 1.17 2004/05/16 05:19:30 morris Exp $ */ 
     1/* $Id: WCMessages.m,v 1.18 2004/05/20 06:10:53 morris Exp $ */ 
    22 
    33/* 
     
    144144 
    145145        // --- show window 
    146         if([[WCSettings objectForKey:WCShowMessages] boolValue]) 
     146        if([WCSettings boolForKey:WCShowMessages]) 
    147147                [self showWindow:self]; 
    148148} 
     
    202202        [message setDate:[NSDate date]]; 
    203203         
    204         if([[WCSettings objectForKey:WCShowMessagesInChat] boolValue]) 
    205                 [message setRead:YES]; 
    206         else 
    207                 [message setRead:NO]; 
    208          
    209204        // --- add it to our array of messages 
    210205        [self add:message]; 
     
    219214         
    220215        // --- display an actual receive message window if we should 
    221         if([[WCSettings objectForKey:WCShowMessagesInForeground] boolValue]) 
     216        if([WCSettings boolForKey:WCShowMessagesInForeground]) 
    222217                [(WCReceiveMessage *) [WCReceiveMessage alloc] initWithConnection:_connection message:message]; 
    223218         
  • WiredClient/trunk/WCNews.m

    r1209 r1279  
    1 /* $Id: WCNews.m,v 1.12 2004/05/17 17:13:12 morris Exp $ */ 
     1/* $Id: WCNews.m,v 1.13 2004/05/20 06:10:53 morris Exp $ */ 
    22 
    33/* 
     
    129129 
    130130        // --- show window 
    131         if([[WCSettings objectForKey:WCShowNews] boolValue]) 
     131        if([WCSettings boolForKey:WCShowNews]) 
    132132                [self showWindow:self]; 
    133133} 
  • WiredClient/trunk/WCPreferences.m

    r1274 r1279  
    1 /* $Id: WCPreferences.m,v 1.31 2004/05/20 03:52:42 morris Exp $ */ 
     1/* $Id: WCPreferences.m,v 1.32 2004/05/20 06:10:53 morris Exp $ */ 
    22 
    33/* 
     
    2828 
    2929#import "NSDataAdditions.h" 
     30#import "NSPopUpButtonAdditions.h" 
    3031#import "WCIconMatrix.h" 
    3132#import "WCIcons.h" 
     
    160161        } 
    161162         
    162         icon = [[WCSettings objectForKey:WCIcon] intValue]; 
     163        icon = [WCSettings intForKey:WCIcon]; 
    163164         
    164165        if(icon == 0) 
     
    177178        [_iconSizeMatrix selectCellWithTag:[WCSettings intForKey:WCIconSize]]; 
    178179        [_historyScrollbackButton setState:[WCSettings boolForKey:WCHistoryScrollback]]; 
    179         [_historyScrollbackModifierPopUpButton selectItemAtIndex: 
    180                 [_historyScrollbackModifierPopUpButton indexOfItemWithTag: 
    181                         [[WCSettings objectForKey:WCHistoryScrollbackModifier] intValue]]]; 
     180        [_historyScrollbackModifierPopUpButton selectItemWithTag: 
     181                [WCSettings intForKey:WCHistoryScrollbackModifier]]; 
    182182        [_tabCompleteNicksButton setState:[WCSettings boolForKey:WCTabCompleteNicks]]; 
    183183        [_tabCompleteNicksTextField setStringValue:[WCSettings objectForKey:WCTabCompleteNicksString]]; 
     
    187187        [_timestampChatButton setState:[WCSettings boolForKey:WCTimestampChat]]; 
    188188        [_timestampChatIntervalTextField setStringValue:[NSString stringWithFormat:@"%.0f", 
    189                 (double) [[WCSettings objectForKey:WCTimestampChatInterval] intValue] / (double) 60]]; 
     189                (double) [WCSettings intForKey:WCTimestampChatInterval] / (double) 60]]; 
    190190        [_timestampEveryLineButton setState:[WCSettings boolForKey:WCTimestampEveryLine]]; 
    191191        [_timestampEveryLineColorWell setColor: 
     
    303303        } 
    304304         
    305         if([[_iconMatrix selectedCell] tag] != [[WCSettings objectForKey:WCIcon] intValue]) { 
     305        if([[_iconMatrix selectedCell] tag] != [WCSettings intForKey:WCIcon]) { 
    306306                // --- make sure we only change the icon if it's actually changed 
    307307                [WCSettings setObject:[NSNumber numberWithInt:[[_iconMatrix selectedCell] tag]] 
  • WiredClient/trunk/WCPublicChat.m

    r1236 r1279  
    1 /* $Id: WCPublicChat.m,v 1.26 2004/05/18 18:34:00 morris Exp $ */ 
     1/* $Id: WCPublicChat.m,v 1.27 2004/05/20 06:10:53 morris Exp $ */ 
    22 
    33/* 
     
    112112- (BOOL)windowShouldClose:(id)sender { 
    113113        // --- if we're to confirm, pull down a sheet and handle window closing ourselves 
    114         if([[WCSettings objectForKey:WCConfirmDisconnect] boolValue] == YES && 
     114        if([WCSettings boolForKey:WCConfirmDisconnect] && 
    115115           [[_connection client] connected]) { 
    116116                NSBeginAlertSheet(NSLocalizedString(@"Are you sure you want to disconnect?", @"Disconnect dialog title"), 
     
    289289                return; 
    290290 
    291         if(![[WCSettings objectForKey:WCShowMessagesInChat] boolValue]
     291        if(![WCSettings boolForKey:WCShowMessagesInChat
    292292                return; 
    293293 
  • WiredClient/trunk/WCSecureSocket.m

    r1250 r1279  
    1 /* $Id: WCSecureSocket.m,v 1.6 2004/05/18 23:41:53 morris Exp $ */ 
     1/* $Id: WCSecureSocket.m,v 1.7 2004/05/20 06:10:53 morris Exp $ */ 
    22 
    33/* 
     
    4646                ciphers = [WCSettings objectForKey:WCSSLControlCiphers]; 
    4747        } else { 
    48                 if([[WCSettings objectForKey:WCEncryptTransfers] boolValue]) 
     48                if([WCSettings boolForKey:WCEncryptTransfers]) 
    4949                        ciphers = [WCSettings objectForKey:WCSSLTransferCiphers]; 
    5050                else 
  • WiredClient/trunk/WCToolbar.m

    r1213 r1279  
    1 /* $Id: WCToolbar.m,v 1.13 2004/05/17 18:29:34 morris Exp $ */ 
     1/* $Id: WCToolbar.m,v 1.14 2004/05/20 06:10:53 morris Exp $ */ 
    22 
    33/* 
     
    364364        // --- if clicking disconnect will terminate connection without confirmation 
    365365        if([[item itemIdentifier] isEqualToString:@"Disconnect"] && 
    366            ![[WCSettings objectForKey:WCConfirmDisconnect] boolValue]) 
     366           ![WCSettings boolForKey:WCConfirmDisconnect]) 
    367367                return [NSApp isActive]; 
    368368 
  • WiredClient/trunk/WCTransfers.m

    r1275 r1279  
    1 /* $Id: WCTransfers.m,v 1.15 2004/05/20 03:55:13 morris Exp $ */ 
     1/* $Id: WCTransfers.m,v 1.16 2004/05/20 06:10:53 morris Exp $ */ 
    22 
    33/* 
     
    172172 
    173173        // --- show window 
    174         if([[WCSettings objectForKey:WCShowTransfers] boolValue]) 
     174        if([WCSettings boolForKey:WCShowTransfers]) 
    175175                [self showWindow:self]; 
    176176} 
     
    638638 
    639639        // --- request now or later 
    640         if([[WCSettings objectForKey:WCQueueTransfers] boolValue] && count > 1) 
     640        if([WCSettings boolForKey:WCQueueTransfers] && count > 1) 
    641641                [transfer setState:WCTransferStateLocallyQueued]; 
    642642        else 
     
    679679 
    680680        // --- request now or later 
    681         if([[WCSettings objectForKey:WCQueueTransfers] boolValue] && count > 1) 
     681        if([WCSettings boolForKey:WCQueueTransfers] && count > 1) 
    682682                [transfer setState:WCTransferStateLocallyQueued]; 
    683683        else