Changeset 1382

Show
Ignore:
Timestamp:
07/27/04 21:07:08 (4 years ago)
Author:
morris
Message:

add set topic menu command and a panel to edit topic in

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • WiredClient/trunk/English.lproj/MainMenu.nib/classes.nib

    r1307 r1382  
    2121                bookmark = id;  
    2222                broadcast = id;  
    23                 cancel = id;  
    2423                chat = id;  
    2524                connect = id;  
     
    4544                search = id;  
    4645                serverInfo = id;  
     46                setTopic = id;  
    4747                showTrackers = id;  
    4848                smallerText = id;  
     
    8080                "_searchMenuItem" = NSMenuItem;  
    8181                "_serverInfoMenuItem" = NSMenuItem;  
     82                "_setTopicMenuItem" = NSMenuItem;  
    8283                "_transfersMenuItem" = NSMenuItem;  
    8384                "_viewMenu" = NSMenu;  
  • WiredClient/trunk/English.lproj/MainMenu.nib/info.nib

    r1242 r1382  
    1616                <integer>217</integer> 
    1717        </array> 
     18        <key>IBOpenObjects</key> 
     19        <array> 
     20                <integer>29</integer> 
     21        </array> 
    1822        <key>IBSystem Version</key> 
    19         <string>7F44</string> 
     23        <string>7H63</string> 
    2024</dict> 
    2125</plist> 
  • WiredClient/trunk/English.lproj/Messages.nib/info.nib

    r1381 r1382  
    44<dict> 
    55        <key>IBDocumentLocation</key> 
    6         <string>403 111 401 299 0 0 1280 1002 </string> 
     6        <string>608 103 401 299 0 0 1280 1002 </string> 
    77        <key>IBFramework Version</key> 
    88        <string>364.0</string> 
  • WiredClient/trunk/English.lproj/PrivateChat.nib/classes.nib

    r1379 r1382  
    1919                "_privateMessageButton" = NSButton;  
    2020                "_sendPrivateMessageMenuItem" = NSMenuItem;  
     21                "_setTopicPanel" = NSPanel;  
     22                "_setTopicTextView" = NSTextView;  
    2123                "_topicTextField" = NSTextField;  
    2224                "_userListMenu" = NSMenu;  
  • WiredClient/trunk/English.lproj/PrivateChat.nib/info.nib

    r1379 r1382  
    44<dict> 
    55        <key>IBDocumentLocation</key> 
    6         <string>544 209 403 412 0 0 1280 1002 </string> 
     6        <string>458 151 403 412 0 0 1280 1002 </string> 
    77        <key>IBEditorPositions</key> 
    88        <dict> 
     
    2020                <integer>196</integer> 
    2121                <integer>139</integer> 
     22                <integer>250</integer> 
    2223        </array> 
    2324        <key>IBSystem Version</key> 
  • WiredClient/trunk/English.lproj/PublicChat.nib/classes.nib

    r1379 r1382  
    2525                "_privateMessageButton" = NSButton;  
    2626                "_sendPrivateMessageMenuItem" = NSMenuItem;  
     27                "_setTopicPanel" = NSPanel;  
     28                "_setTopicTextView" = NSTextView;  
    2729                "_topicTextField" = NSTextField;  
    2830                "_userListMenu" = NSMenu;  
  • WiredClient/trunk/English.lproj/PublicChat.nib/info.nib

    r1379 r1382  
    44<dict> 
    55        <key>IBDocumentLocation</key> 
    6         <string>503 107 408 436 0 0 1280 1002 </string> 
     6        <string>348 113 408 436 0 0 1280 1002 </string> 
    77        <key>IBEditorPositions</key> 
    88        <dict> 
     
    1919        <array> 
    2020                <integer>10</integer> 
     21                <integer>407</integer> 
    2122        </array> 
    2223        <key>IBSystem Version</key> 
  • WiredClient/trunk/WCChat.h

    r1376 r1382  
    1 /* $Id: WCChat.h,v 1.16 2004/07/27 17:37:44 morris Exp $ */ 
     1/* $Id: WCChat.h,v 1.17 2004/07/27 19:07:00 morris Exp $ */ 
    22 
    33/* 
     
    5959        IBOutlet NSTableColumn                  *_nickTableColumn; 
    6060         
     61        IBOutlet NSPanel                                *_setTopicPanel; 
     62        IBOutlet NSTextView                             *_setTopicTextView; 
     63         
    6164        IBOutlet NSMenu                                 *_userListMenu; 
    6265        IBOutlet NSMenuItem                             *_sendPrivateMessageMenuItem; 
     
    100103- (void)                                                        updateButtons; 
    101104- (void)                                                        updateUserCount; 
     105- (void)                                                        showSetTopic; 
    102106- (void)                                                        saveChatToURL:(NSURL *)url; 
    103107- (void)                                                        printEvent:(NSString *)argument; 
  • WiredClient/trunk/WCChat.m

    r1376 r1382  
    1 /* $Id: WCChat.m,v 1.52 2004/07/27 17:37:44 morris Exp $ */ 
     1/* $Id: WCChat.m,v 1.53 2004/07/27 19:07:00 morris Exp $ */ 
    22 
    33/* 
     
    3131#import "NSMutableAttributedStringAdditions.h" 
    3232#import "NSTextViewAdditions.h" 
     33#import "NSWindowControllerAdditions.h" 
    3334#import "WCAccount.h" 
    3435#import "WCChat.h" 
     
    970971 
    971972 
     973- (void)setTopicSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo { 
     974        if(returnCode == NSRunStoppedResponse) { 
     975                // --- send the topic command 
     976                [_connection sendCommand:WCTopicCommand 
     977                                        withArgument:[NSString stringWithFormat:@"%u", [self cid]] 
     978                                        withArgument:[_setTopicTextView string] 
     979                                          withSender:self]; 
     980        } 
     981         
     982        // --- close sheet 
     983        [_setTopicPanel close]; 
     984         
     985        // --- clear for next round 
     986        [_setTopicTextView setString:@""]; 
     987} 
     988 
     989 
     990 
    972991- (BOOL)textView:(NSTextView *)textView doCommandBySelector:(SEL)selector { 
    973992        BOOL    commandKey, optionKey, controlKey, value = NO; 
    974993         
    975         // --- we only handle the input area 
     994        // --- handle topic text view 
     995        if(textView == _setTopicTextView) { 
     996           if(selector == @selector(insertNewline:)) { 
     997                   if([[[NSApp currentEvent] characters] characterAtIndex:0] == NSEnterCharacter) { 
     998                           [self submitSheet:textView]; 
     999                            
     1000                           value = YES; 
     1001                   } 
     1002           } 
     1003        } 
     1004                    
     1005        // --- below is only handle the input area 
    9761006        if(textView != _chatInputTextView) 
    977                 return NO
     1007                return value
    9781008         
    9791009        // --- get key state 
     
    12931323 
    12941324 
     1325- (void)showSetTopic { 
     1326        // --- set topic 
     1327        [_setTopicTextView setString:[_topicTextField stringValue]]; 
     1328    [_setTopicTextView setSelectedRange:NSMakeRange(0, [[_setTopicTextView string] length])];            
     1329 
     1330        // --- bring up sheet 
     1331        [NSApp beginSheet:_setTopicPanel 
     1332           modalForWindow:[self window] 
     1333                modalDelegate:self 
     1334           didEndSelector:@selector(setTopicSheetDidEnd:returnCode:contextInfo:) 
     1335                  contextInfo:NULL]; 
     1336} 
     1337 
     1338 
     1339 
    12951340- (void)printEvent:(NSString *)argument { 
    12961341        NSString                        *output, *time; 
  • WiredClient/trunk/WCMain.h

    r1356 r1382  
    1 /* $Id: WCMain.h,v 1.8 2004/06/01 20:52:11 morris Exp $ */ 
     1/* $Id: WCMain.h,v 1.9 2004/07/27 19:07:00 morris Exp $ */ 
    22 
    33/* 
     
    5252        IBOutlet NSMenuItem                             *_postNewMenuItem; 
    5353        IBOutlet NSMenuItem                             *_broadcastMenuItem; 
     54        IBOutlet NSMenuItem                             *_setTopicMenuItem; 
    5455        IBOutlet NSMenuItem                             *_disconnectMenuItem; 
    5556 
     
    118119- (IBAction)                                            postNews:(id)sender; 
    119120- (IBAction)                                            broadcast:(id)sender; 
     121- (IBAction)                                            setTopic:(id)sender; 
    120122- (IBAction)                                            disconnect:(id)sender; 
    121123 
  • WiredClient/trunk/WCMain.m

    r1367 r1382  
    1 /* $Id: WCMain.m,v 1.35 2004/07/21 07:45:36 morris Exp $ */ 
     1/* $Id: WCMain.m,v 1.36 2004/07/27 19:07:00 morris Exp $ */ 
    22 
    33/* 
     
    427427        else if(item == _broadcastMenuItem) 
    428428                return [[connection account] broadcast]; 
     429        else if(item == _setTopicMenuItem) 
     430                return [controller isKindOfClass:[WCChat class]] && ([controller cid] != 1 || [[connection account] setTopic]); 
    429431        else if(item == _disconnectMenuItem) 
    430432                return (connection != NULL); 
     
    823825 
    824826 
     827- (IBAction)setTopic:(id)sender { 
     828        [(WCChat *) [[NSApp keyWindow] windowController] showSetTopic]; 
     829} 
     830 
     831 
     832 
    825833- (IBAction)disconnect:(id)sender { 
    826834        [[[[(WCWindowController *) [[NSApp keyWindow] windowController] connection] chat] window] performClose:self]; 
  • WiredClient/trunk/WCPublicChat.m

    r1377 r1382  
    1 /* $Id: WCPublicChat.m,v 1.32 2004/07/27 18:28:26 morris Exp $ */ 
     1/* $Id: WCPublicChat.m,v 1.33 2004/07/27 19:07:00 morris Exp $ */ 
    22 
    33/* 
     
    337337                                        withArgument:[_kickMessageTextField stringValue] 
    338338                                          withSender:self]; 
    339          
    340                 [user release]; 
    341         } 
     339        } 
     340         
     341        // --- release 
     342        [user release]; 
    342343         
    343344        // --- close sheet 
     
    359360                                        withArgument:[_banMessageTextField stringValue] 
    360361                                          withSender:self]; 
    361  
    362                 [user release]; 
    363         } 
     362        } 
     363         
     364        // --- release 
     365        [user release]; 
    364366         
    365367        // --- close sheet 
     
    369371        [_banMessageTextField setStringValue:@""]; 
    370372} 
    371  
    372373 
    373374