Changeset 3276

Show
Ignore:
Timestamp:
06/08/06 23:18:23 (2 years ago)
Author:
rinoa
Message:

Adds "Open console on connect" to the Automatic tab of each server info.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Controllers/MVConnectionsController.h

    r3072 r3276  
    100100- (BOOL) autoConnectForConnection:(MVChatConnection *) connection; 
    101101 
     102- (void) setShowConsoleOnConnect:(BOOL) autoConsole forConnection:(MVChatConnection *) connection; 
     103- (BOOL) showConsoleOnConnectForConnection:(MVChatConnection *) connection; 
     104 
    102105- (void) setJoinRooms:(NSArray *) rooms forConnection:(MVChatConnection *) connection; 
    103106- (NSMutableArray *) joinRoomsForConnection:(MVChatConnection *) connection; 
  • trunk/Controllers/MVConnectionsController.m

    r3259 r3276  
    390390        if( [_joinRooms count] ) [connection joinChatRoomsNamed:_joinRooms]; 
    391391 
    392         if( [[NSUserDefaults standardUserDefaults] boolForKey:@"JVChatOpenConsoleOnConnect"] ) 
     392        if( [self showConsoleOnConnectForConnection:connection] ) 
    393393                [[JVChatController defaultController] chatConsoleForConnection:connection ifExists:NO]; 
    394394 
     
    698698 
    699699                                if( ! [connection isConnected] && connect ) { 
    700                                         if( [[NSUserDefaults standardUserDefaults] boolForKey:@"JVChatOpenConsoleOnConnect"] ) 
     700                                        if( [self showConsoleOnConnectForConnection:connection] ) 
    701701                                                [[JVChatController defaultController] chatConsoleForConnection:connection ifExists:NO]; 
    702702                                        [connection connect]; 
     
    729729 
    730730                        if( connect ) { 
    731                                 if( [[NSUserDefaults standardUserDefaults] boolForKey:@"JVChatOpenConsoleOnConnect"] ) 
     731                                if( [self showConsoleOnConnectForConnection:connection] ) 
    732732                                        [[JVChatController defaultController] chatConsoleForConnection:connection ifExists:NO]; 
    733733                                if( target ) [connection joinChatRoomNamed:target]; 
     
    770770        return NO; 
    771771} 
     772 
     773#pragma mark - 
     774 
     775- (void) setShowConsoleOnConnect:(BOOL) autoConsole forConnection:(MVChatConnection *) connection { 
     776        NSEnumerator *enumerator = [_bookmarks objectEnumerator]; 
     777        NSMutableDictionary *info = nil; 
     778 
     779        while( ( info = [enumerator nextObject] ) ) { 
     780                if( [info objectForKey:@"connection"] == connection ) { 
     781                        [info setObject:[NSNumber numberWithBool:autoConsole] forKey:@"showConsole"]; 
     782                        [self _saveBookmarkList]; 
     783                        break; 
     784                } 
     785        } 
     786} 
     787 
     788- (BOOL) showConsoleOnConnectForConnection:(MVChatConnection *) connection { 
     789        NSEnumerator *enumerator = [_bookmarks objectEnumerator]; 
     790        NSMutableDictionary *info = nil; 
     791 
     792        while( ( info = [enumerator nextObject] ) ) { 
     793                if( [info objectForKey:@"connection"] == connection ) { 
     794                        return [[info objectForKey:@"showConsole"] boolValue]; 
     795                } 
     796        } 
     797 
     798        return NO; 
     799} 
     800 
    772801 
    773802#pragma mark - 
     
    14521481                        NSMutableDictionary *data = [NSMutableDictionary dictionary]; 
    14531482                        [data setObject:[NSNumber numberWithBool:[[info objectForKey:@"automatic"] boolValue]] forKey:@"automatic"]; 
     1483                        [data setObject:[NSNumber numberWithBool:[[info objectForKey:@"showConsole"] boolValue]] forKey:@"showConsole"]; 
    14541484                        [data setObject:[NSNumber numberWithBool:[connection isSecure]] forKey:@"secure"]; 
    14551485                        [data setObject:[NSNumber numberWithLong:[connection proxyType]] forKey:@"proxy"]; 
     
    15391569 
    15401570                if( [[info objectForKey:@"automatic"] boolValue] && ! ( [[[NSApplication sharedApplication] currentEvent] modifierFlags] & NSShiftKeyMask ) ) { 
    1541                         if( [[NSUserDefaults standardUserDefaults] boolForKey:@"JVChatOpenConsoleOnConnect"] ) 
     1571                        if( [[info objectForKey:@"showConsole"] boolValue] ) 
    15421572                                [[JVChatController defaultController] chatConsoleForConnection:connection ifExists:NO]; 
    15431573 
     
    17001730        MVChatConnection *connection = [[_bookmarks objectAtIndex:[connections selectedRow]] objectForKey:@"connection"]; 
    17011731        [connection setPassword:[[MVKeyChain defaultKeyChain] internetPasswordForServer:[connection server] securityDomain:[connection server] account:nil path:nil port:[connection serverPort] protocol:MVKeyChainProtocolIRC authenticationType:MVKeyChainAuthenticationTypeDefault]]; 
    1702         if( [[NSUserDefaults standardUserDefaults] boolForKey:@"JVChatOpenConsoleOnConnect"] ) 
     1732        if( [self showConsoleOnConnectForConnection:connection] ) 
    17031733                [[JVChatController defaultController] chatConsoleForConnection:connection ifExists:NO]; 
    17041734        [connection connect]; 
     
    17071737- (void) _willConnect:(NSNotification *) notification { 
    17081738        MVChatConnection *connection = [notification object]; 
    1709         if( [[NSUserDefaults standardUserDefaults] boolForKey:@"JVChatOpenConsoleOnConnect"] ) 
     1739        if( [self showConsoleOnConnectForConnection:connection] ) 
    17101740                [[JVChatController defaultController] chatConsoleForConnection:connection ifExists:NO]; 
    17111741} 
  • trunk/Inspectors/JVConnectionInspector.h

    r3072 r3276  
    2626        IBOutlet NSTextField *editPort; 
    2727        IBOutlet NSButton *editAutomatic; 
     28        IBOutlet NSButton *editShowConsoleOnConnect; 
    2829        IBOutlet NSTableView *editRooms; 
    2930        IBOutlet NSButton *editRemoveRoom; 
     
    6768- (IBAction) editText:(id) sender; 
    6869- (IBAction) toggleAutoConnect:(id) sender; 
     70- (IBAction) toggleShowConsoleOnConnect:(id) sender; 
    6971- (IBAction) toggleSSLConnection:(id) sender; 
    7072- (IBAction) changeProxy:(id) sender; 
  • trunk/Inspectors/JVConnectionInspector.m

    r3259 r3276  
    6262 
    6363        [editAutomatic setState:[[MVConnectionsController defaultController] autoConnectForConnection:_connection]]; 
     64        [editShowConsoleOnConnect setState:[[MVConnectionsController defaultController] showConsoleOnConnectForConnection:_connection]]; 
    6465        [sslConnection setState:[_connection isSecure]]; 
    6566        [editAddress setObjectValue:[_connection server]]; 
     
    174175} 
    175176 
     177- (IBAction) toggleShowConsoleOnConnect:(id) sender { 
     178        [[MVConnectionsController defaultController] setShowConsoleOnConnect:[sender state] forConnection:_connection]; 
     179} 
     180 
    176181- (IBAction) toggleSSLConnection:(id) sender { 
    177182        [_connection setSecure:[sender state]]; 
  • trunk/Languages/Dutch.lproj/JVConnectionInspector.nib/classes.nib

    r2163 r3276  
    1919                toggleAutoConnect = id;  
    2020                toggleSSLConnection = id;  
     21                toggleShowConsoleOnConnect = id;  
    2122            };  
    2223            CLASS = JVConnectionInspector;  
     
    4546                editRules = NSTableView;  
    4647                editServerPassword = NSTextField;  
     48                editShowConsoleOnConnect = NSButton;  
    4749                editUsername = NSTextField;  
    4850                encoding = NSPopUpButton;  
  • trunk/Languages/Dutch.lproj/JVConnectionInspector.nib/info.nib

    r2163 r3276  
    44<dict> 
    55        <key>IBDocumentLocation</key> 
    6         <string>453 117 356 240 0 0 1280 832 </string> 
     6        <string>327 100 356 240 0 0 1024 746 </string> 
    77        <key>IBEditorPositions</key> 
    88        <dict> 
    99                <key>134</key> 
    10                 <string>463 366 373 380 0 0 1280 832 </string> 
     10                <string>30 321 353 380 0 0 1024 746 </string> 
    1111        </dict> 
    1212        <key>IBFramework Version</key> 
    13         <string>362.0</string> 
     13        <string>443.0</string> 
    1414        <key>IBGroupedObjects</key> 
    1515        <dict> 
     
    2424        <key>IBLockedObjects</key> 
    2525        <array/> 
     26        <key>IBOpenObjects</key> 
     27        <array> 
     28                <integer>134</integer> 
     29        </array> 
    2630        <key>IBSystem Version</key> 
    27         <string>7S215</string> 
     31        <string>8I127</string> 
    2832</dict> 
    2933</plist> 
  • trunk/Languages/English.lproj/JVConnectionInspector.nib/classes.nib

    r1727 r3276  
    1919                toggleAutoConnect = id;  
    2020                toggleSSLConnection = id;  
     21                toggleShowConsoleOnConnect = id;  
    2122            };  
    2223            CLASS = JVConnectionInspector;  
     
    4546                editRules = NSTableView;  
    4647                editServerPassword = NSTextField;  
     48                editShowConsoleOnConnect = NSButton;  
    4749                editUsername = NSTextField;  
    4850                encoding = NSPopUpButton;  
  • trunk/Languages/English.lproj/JVConnectionInspector.nib/info.nib

    r1727 r3276  
    44<dict> 
    55        <key>IBDocumentLocation</key> 
    6         <string>453 117 356 240 0 0 1280 832 </string> 
     6        <string>93 75 356 240 0 0 1024 746 </string> 
    77        <key>IBEditorPositions</key> 
    88        <dict> 
    99                <key>134</key> 
    10                 <string>466 379 348 380 0 0 1280 832 </string> 
     10                <string>338 320 348 380 0 0 1024 746 </string> 
    1111        </dict> 
    1212        <key>IBFramework Version</key> 
    13         <string>364.0</string> 
     13        <string>443.0</string> 
    1414        <key>IBGroupedObjects</key> 
    1515        <dict> 
     
    2929        </array> 
    3030        <key>IBSystem Version</key> 
    31         <string>7H63</string> 
     31        <string>8I127</string> 
    3232</dict> 
    3333</plist> 
  • trunk/Languages/French.lproj/JVConnectionInspector.nib/classes.nib

    r3040 r3276  
    1919                toggleAutoConnect = id;  
    2020                toggleSSLConnection = id;  
     21                toggleShowConsoleOnConnect = id;  
    2122            };  
    2223            CLASS = JVConnectionInspector;  
     
    4546                editRules = NSTableView;  
    4647                editServerPassword = NSTextField;  
     48                editShowConsoleOnConnect = NSButton;  
    4749                editUsername = NSTextField;  
    4850                encoding = NSPopUpButton;  
  • trunk/Languages/French.lproj/JVConnectionInspector.nib/info.nib

    r3040 r3276  
    88        <dict> 
    99                <key>134</key> 
    10                 <string>336 320 388 380 0 0 1024 746 </string> 
     10                <string>51 325 388 380 0 0 1024 746 </string> 
    1111        </dict> 
    1212        <key>IBFramework Version</key> 
    13         <string>439.0</string> 
     13        <string>443.0</string> 
    1414        <key>IBGroupedObjects</key> 
    1515        <dict> 
     
    2828        <key>IBOpenObjects</key> 
    2929        <array> 
    30                 <integer>331</integer> 
    3130                <integer>134</integer> 
    3231        </array> 
    3332        <key>IBSystem Version</key> 
    34         <string>8C46</string> 
     33        <string>8I127</string> 
    3534</dict> 
    3635</plist> 
  • trunk/Languages/German.lproj/JVConnectionInspector.nib/classes.nib

    r2114 r3276  
    1919                toggleAutoConnect = id;  
    2020                toggleSSLConnection = id;  
     21                toggleShowConsoleOnConnect = id;  
    2122            };  
    2223            CLASS = JVConnectionInspector;  
     
    4546                editRules = NSTableView;  
    4647                editServerPassword = NSTextField;  
     48                editShowConsoleOnConnect = NSButton;  
    4749                editUsername = NSTextField;  
    4850                encoding = NSPopUpButton;  
  • trunk/Languages/German.lproj/JVConnectionInspector.nib/info.nib

    r3268 r3276  
    88        <dict> 
    99                <key>134</key> 
    10                 <string>338 320 348 380 0 0 1024 746 </string> 
     10                <string>71 316 348 380 0 0 1024 746 </string> 
    1111        </dict> 
    1212        <key>IBFramework Version</key> 
  • trunk/Languages/Italian.lproj/JVConnectionInspector.nib/classes.nib

    r2997 r3276  
    1919                toggleAutoConnect = id;  
    2020                toggleSSLConnection = id;  
     21                toggleShowConsoleOnConnect = id;  
    2122            };  
    2223            CLASS = JVConnectionInspector;  
     
    4546                editRules = NSTableView;  
    4647                editServerPassword = NSTextField;  
     48                editShowConsoleOnConnect = NSButton;  
    4749                editUsername = NSTextField;  
    4850                encoding = NSPopUpButton;  
  • trunk/Languages/Italian.lproj/JVConnectionInspector.nib/info.nib

    r3225 r3276  
    88        <dict> 
    99                <key>134</key> 
    10                 <string>313 320 398 380 0 0 1024 746 </string> 
     10                <string>58 308 398 380 0 0 1024 746 </string> 
    1111        </dict> 
    1212        <key>IBFramework Version</key> 
     
    2727                <integer>134</integer> 
    2828        </array> 
     29        <key>IBOpenObjects</key> 
     30        <array> 
     31                <integer>134</integer> 
     32        </array> 
    2933        <key>IBSystem Version</key> 
    3034        <string>8I127</string> 
  • trunk/Languages/Spanish.lproj/JVConnectionInspector.nib/classes.nib

    r2997 r3276  
    1919                toggleAutoConnect = id;  
    2020                toggleSSLConnection = id;  
     21                toggleShowConsoleOnConnect = id;  
    2122            };  
    2223            CLASS = JVConnectionInspector;  
     
    4546                editRules = NSTableView;  
    4647                editServerPassword = NSTextField;  
     48                editShowConsoleOnConnect = NSButton;  
    4749                editUsername = NSTextField;  
    4850                encoding = NSPopUpButton;  
  • trunk/Languages/Spanish.lproj/JVConnectionInspector.nib/info.nib

    r2997 r3276  
    44<dict> 
    55        <key>IBDocumentLocation</key> 
    6         <string>658 96 356 240 0 0 1024 746 </string> 
     6        <string>342 77 356 240 0 0 1024 746 </string> 
    77        <key>IBEditorPositions</key> 
    88        <dict> 
    99                <key>134</key> 
    10                 <string>10 363 370 380 0 0 1024 746 </string> 
     10                <string>81 309 355 380 0 0 1024 746 </string> 
    1111        </dict> 
    1212        <key>IBFramework Version</key> 
    13         <string>439.0</string> 
     13        <string>443.0</string> 
    1414        <key>IBGroupedObjects</key> 
    1515        <dict> 
     
    2424        <key>IBLockedObjects</key> 
    2525        <array/> 
     26        <key>IBOpenObjects</key> 
     27        <array> 
     28                <integer>134</integer> 
     29        </array> 
    2630        <key>IBSystem Version</key> 
    27         <string>8C46</string> 
     31        <string>8I127</string> 
    2832</dict> 
    2933</plist> 
  • trunk/Languages/pt_PT.lproj/JVConnectionInspector.nib/classes.nib

    r2997 r3276  
    1919                toggleAutoConnect = id;  
    2020                toggleSSLConnection = id;  
     21                toggleShowConsoleOnConnect = id;  
    2122            };  
    2223            CLASS = JVConnectionInspector;  
     
    4546                editRules = NSTableView;  
    4647                editServerPassword = NSTextField;  
     48                editShowConsoleOnConnect = NSButton;  
    4749                editUsername = NSTextField;  
    4850                encoding = NSPopUpButton;  
  • trunk/Languages/pt_PT.lproj/JVConnectionInspector.nib/info.nib

    r2997 r3276  
    88        <dict> 
    99                <key>134</key> 
    10                 <string>8 309 378 380 0 0 1024 746 </string> 
     10                <string>98 295 378 380 0 0 1024 746 </string> 
    1111        </dict> 
    1212        <key>IBFramework Version</key> 
    13         <string>439.0</string> 
     13        <string>443.0</string> 
    1414        <key>IBGroupedObjects</key> 
    1515        <dict> 
     
    2929        <array> 
    3030                <integer>134</integer> 
    31                 <integer>331</integer> 
    3231        </array> 
    3332        <key>IBSystem Version</key> 
    34         <string>8C46</string> 
     33        <string>8I127</string> 
    3534</dict> 
    3635</plist> 
  • trunk/Languages/zh_TW.lproj/JVConnectionInspector.nib/classes.nib

    r3062 r3276  
    1919                toggleAutoConnect = id;  
    2020                toggleSSLConnection = id;  
     21                toggleShowConsoleOnConnect = id;  
    2122            };  
    2223            CLASS = JVConnectionInspector;  
     
    4546                editRules = NSTableView;  
    4647                editServerPassword = NSTextField;  
     48                editShowConsoleOnConnect = NSButton;  
    4749                editUsername = NSTextField;  
    4850                encoding = NSPopUpButton;  
  • trunk/Languages/zh_TW.lproj/JVConnectionInspector.nib/info.nib

    r3062 r3276  
    44<dict> 
    55        <key>IBDocumentLocation</key> 
    6         <string>453 117 356 240 0 0 1280 832 </string> 
     6        <string>327 100 356 240 0 0 1024 746 </string> 
    77        <key>IBEditorPositions</key> 
    88        <dict> 
    99                <key>134</key> 
    10                 <string>466 379 348 380 0 0 1280 832 </string> 
     10                <string>113 311 348 380 0 0 1024 746 </string> 
    1111        </dict> 
    1212        <key>IBFramework Version</key> 
     
    1414        <key>IBLockedObjects</key> 
    1515        <array/> 
     16        <key>IBOpenObjects</key> 
     17        <array> 
     18                <integer>134</integer> 
     19        </array> 
    1620        <key>IBSystem Version</key> 
    17         <string>8F46</string> 
     21        <string>8I127</string> 
    1822</dict> 
    1923</plist>