Changeset 1377
- Timestamp:
- 07/27/04 20:28:26 (4 years ago)
- Files:
-
- WiredClient/trunk/WCAccount.h (modified) (4 diffs)
- WiredClient/trunk/WCAccount.m (modified) (3 diffs)
- WiredClient/trunk/WCAccountEditor.h (modified) (2 diffs)
- WiredClient/trunk/WCAccountEditor.m (modified) (17 diffs)
- WiredClient/trunk/WCFileInfo.m (modified) (6 diffs)
- WiredClient/trunk/WCPublicChat.m (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
WiredClient/trunk/WCAccount.h
r1267 r1377 1 /* $Id: WCAccount.h,v 1. 3 2004/05/19 21:34:28morris Exp $ */1 /* $Id: WCAccount.h,v 1.4 2004/07/27 18:28:26 morris Exp $ */ 2 2 3 3 /* … … 34 34 35 35 36 #define WCAccountTypeUser 0 37 #define WCAccountTypeGroup 1 36 enum WCAccountType { 37 WCAccountTypeUser = 0, 38 WCAccountTypeGroup 39 }; 38 40 39 41 … … 57 59 - (BOOL) uploadAnywhere; 58 60 - (BOOL) createFolders; 59 - (BOOL) changeFiles;61 - (BOOL) alterFiles; 60 62 - (BOOL) deleteFiles; 61 63 - (BOOL) viewDropBoxes; … … 67 69 - (BOOL) banUsers; 68 70 - (BOOL) cannotBeKicked; 71 - (BOOL) setTopic; 69 72 70 73 - (NSComparisonResult) nameSort:(WCAccount *)other; WiredClient/trunk/WCAccount.m
r1269 r1377 1 /* $Id: WCAccount.m,v 1. 3 2004/05/19 21:57:29morris Exp $ */1 /* $Id: WCAccount.m,v 1.4 2004/07/27 18:28:26 morris Exp $ */ 2 2 3 3 /* … … 174 174 175 175 176 - (BOOL) changeFiles {176 - (BOOL)alterFiles { 177 177 return [[_privileges objectAtIndex:8] isEqualToString:@"1"]; 178 178 } … … 230 230 - (BOOL)cannotBeKicked { 231 231 return [[_privileges objectAtIndex:17] isEqualToString:@"1"]; 232 } 233 234 235 236 - (BOOL)setTopic { 237 return [[_privileges objectAtIndex:20] isEqualToString:@"1"]; 232 238 } 233 239 WiredClient/trunk/WCAccountEditor.h
r944 r1377 1 /* $Id: WCAccountEditor.h,v 1. 1 2004/03/08 19:23:42morris Exp $ */1 /* $Id: WCAccountEditor.h,v 1.2 2004/07/27 18:28:26 morris Exp $ */ 2 2 3 3 /* … … 42 42 IBOutlet NSMenuItem *_noneMenuItem; 43 43 44 IBOutlet NSButton *_getUserInfoButton; 45 IBOutlet NSButton *_broadcastButton; 46 IBOutlet NSButton *_setTopicButton; 44 47 IBOutlet NSButton *_postNewsButton; 45 48 IBOutlet NSButton *_clearNewsButton; 46 IBOutlet NSButton *_getUserInfoButton;47 IBOutlet NSButton *_broadcastButton;48 49 49 50 IBOutlet NSButton *_downloadButton; WiredClient/trunk/WCAccountEditor.m
r1371 r1377 1 /* $Id: WCAccountEditor.m,v 1.1 1 2004/07/23 11:29:12morris Exp $ */1 /* $Id: WCAccountEditor.m,v 1.12 2004/07/27 18:28:26 morris Exp $ */ 2 2 3 3 /* … … 159 159 160 160 - (void)windowDidLoad { 161 NSRect rect; 162 NSSize size; 163 164 // --- we're only interested in the window position, so save size 165 size = [[self window] frame].size; 166 161 167 // --- window position 162 168 [self setShouldCascadeWindows:NO]; 163 169 [self setWindowFrameAutosaveName:@"AccountEditor"]; 170 171 // --- reset size 172 rect = [[self window] frame]; 173 rect.size = size; 174 [[self window] setFrame:rect display:NO]; 164 175 165 176 // --- window title … … 239 250 [_postNewsButton setState:[[fields objectAtIndex:5] intValue]]; 240 251 [_clearNewsButton setState:[[fields objectAtIndex:6] intValue]]; 252 253 if([_connection protocol] >= 1.1) 254 [_setTopicButton setState:[[fields objectAtIndex:23] intValue]]; 241 255 242 256 [_downloadButton setState:[[fields objectAtIndex:7] intValue]]; … … 315 329 [_clearNewsButton setState:[[fields objectAtIndex:4] intValue]]; 316 330 331 if([_connection protocol] >= 1.1) 332 [_setTopicButton setState:[[fields objectAtIndex:21] intValue]]; 333 317 334 [_downloadButton setState:[[fields objectAtIndex:5] intValue]]; 318 335 [_uploadButton setState:[[fields objectAtIndex:6] intValue]]; … … 420 437 [_connection sendCommand:WCCreateUserCommand 421 438 withArgument:[NSString stringWithFormat: 422 @"%@%@%@%@%@%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u ",439 @"%@%@%@%@%@%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u", 423 440 [_nameTextField stringValue], 424 441 WCFieldSeparator, … … 465 482 [_downloadSpeedTextField intValue] * 1024, 466 483 WCFieldSeparator, 467 [_uploadSpeedTextField intValue] * 1024] 484 [_uploadSpeedTextField intValue] * 1024, 485 WCFieldSeparator, 486 [_setTopicButton intValue]] 468 487 withSender:self]; 469 488 } … … 471 490 [_connection sendCommand:WCCreateGroupCommand 472 491 withArgument:[NSString stringWithFormat: 473 @"%@%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u ",492 @"%@%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u", 474 493 [_nameTextField stringValue], 475 494 WCFieldSeparator, … … 512 531 [_downloadSpeedTextField intValue] * 1024, 513 532 WCFieldSeparator, 514 [_uploadSpeedTextField intValue] * 1024] 533 [_uploadSpeedTextField intValue] * 1024, 534 WCFieldSeparator, 535 [_setTopicButton intValue]] 515 536 withSender:self]; 516 537 } … … 557 578 [_connection sendCommand:WCEditUserCommand 558 579 withArgument:[NSString stringWithFormat: 559 @"%@%@%@%@%@%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u ",580 @"%@%@%@%@%@%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u", 560 581 [_nameTextField stringValue], 561 582 WCFieldSeparator, … … 602 623 [_downloadSpeedTextField intValue] * 1024, 603 624 WCFieldSeparator, 604 [_uploadSpeedTextField intValue] * 1024] 625 [_uploadSpeedTextField intValue] * 1024, 626 WCFieldSeparator, 627 [_setTopicButton intValue]] 605 628 withSender:self]; 606 629 } else { 607 630 [_connection sendCommand:WCEditGroupCommand 608 631 withArgument:[NSString stringWithFormat: 609 @"%@%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u ",632 @"%@%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u%@%u", 610 633 [_nameTextField stringValue], 611 634 WCFieldSeparator, … … 648 671 [_downloadSpeedTextField intValue] * 1024, 649 672 WCFieldSeparator, 650 [_uploadSpeedTextField intValue] * 1024] 673 [_uploadSpeedTextField intValue] * 1024, 674 WCFieldSeparator, 675 [_setTopicButton intValue]] 651 676 withSender:self]; 652 677 } … … 660 685 - (IBAction)selectAll:(id)sender { 661 686 // --- check all the buttons we can access 687 if([_getUserInfoButton isEnabled]) 688 [_getUserInfoButton setState:NSOnState]; 689 690 if([_broadcastButton isEnabled]) 691 [_broadcastButton setState:NSOnState]; 692 693 if([_setTopicButton isEnabled]) 694 [_setTopicButton setState:NSOnState]; 695 662 696 if([_postNewsButton isEnabled]) 663 697 [_postNewsButton setState:NSOnState]; … … 665 699 if([_clearNewsButton isEnabled]) 666 700 [_clearNewsButton setState:NSOnState]; 667 668 if([_getUserInfoButton isEnabled])669 [_getUserInfoButton setState:NSOnState];670 671 if([_broadcastButton isEnabled])672 [_broadcastButton setState:NSOnState];673 701 674 702 if([_downloadButton isEnabled]) … … 742 770 if([[_connection account] elevatePrivileges]) { 743 771 // --- enable all buttons 772 [_getUserInfoButton setEnabled:YES]; 773 [_broadcastButton setEnabled:YES]; 774 [_setTopicButton setEnabled:YES]; 744 775 [_postNewsButton setEnabled:YES]; 745 776 [_clearNewsButton setEnabled:YES]; 746 [_getUserInfoButton setEnabled:YES];747 [_broadcastButton setEnabled:YES];748 777 749 778 [_downloadButton setEnabled:YES]; … … 769 798 [_getUserInfoButton setEnabled:[[_connection account] getUserInfo]]; 770 799 [_broadcastButton setEnabled:[[_connection account] broadcast]]; 800 [_setTopicButton setEnabled:[[_connection account] setTopic]]; 771 801 [_postNewsButton setEnabled:[[_connection account] postNews]]; 772 802 [_clearNewsButton setEnabled:[[_connection account] clearNews]]; … … 776 806 [_uploadAnywhereButton setEnabled:[[_connection account] uploadAnywhere]]; 777 807 [_createFoldersButton setEnabled:[[_connection account] createFolders]]; 778 [_moveButton setEnabled:[[_connection account] changeFiles]];808 [_moveButton setEnabled:[[_connection account] alterFiles]]; 779 809 [_deleteButton setEnabled:[[_connection account] deleteFiles]]; 780 810 [_viewDropBoxButton setEnabled:[[_connection account] viewDropBoxes]]; … … 797 827 798 828 // --- disable buttons 829 [_getUserInfoButton setEnabled:NO]; 830 [_broadcastButton setEnabled:NO]; 831 [_setTopicButton setEnabled:YES]; 799 832 [_postNewsButton setEnabled:NO]; 800 833 [_clearNewsButton setEnabled:NO]; 801 [_getUserInfoButton setEnabled:NO];802 [_broadcastButton setEnabled:NO];803 834 804 835 [_downloadButton setEnabled:NO]; WiredClient/trunk/WCFileInfo.m
r1361 r1377 1 /* $Id: WCFileInfo.m,v 1.1 5 2004/06/10 13:21:21morris Exp $ */1 /* $Id: WCFileInfo.m,v 1.16 2004/07/27 18:28:26 morris Exp $ */ 2 2 3 3 /* … … 108 108 // --- compare the existing file name with the one in the text field 109 109 if([[self window] isVisible] && 110 [[_connection account] changeFiles] &&110 [[_connection account] alterFiles] && 111 111 ![[[_file path] lastPathComponent] isEqualToString:[_fileTextField stringValue]]) { 112 112 // --- send the move command … … 121 121 // --- compare the existing comment with the one in the text field 122 122 if([[self window] isVisible] && 123 [[_connection account] changeFiles] &&123 [[_connection account] alterFiles] && 124 124 [_connection protocol] >= 1.1 && 125 125 ![[_file comment] isEqualToString:[_commentTextField stringValue]]) { … … 133 133 // --- compare the existing type with the one in the menu 134 134 if([[self window] isVisible] && 135 [[_connection account] changeFiles] &&135 [[_connection account] alterFiles] && 136 136 [_connection protocol] >= 1.1 && 137 137 [_file type] != WCFileTypeFile && … … 302 302 303 303 [_kindPopUpButton selectItemWithTag:[_file type]]; 304 [_kindPopUpButton setEnabled:[[_connection account] changeFiles]];304 [_kindPopUpButton setEnabled:[[_connection account] alterFiles]]; 305 305 } 306 306 … … 319 319 320 320 // --- set editable 321 [_fileTextField setEditable:[[_connection account] changeFiles]];321 [_fileTextField setEditable:[[_connection account] alterFiles]]; 322 322 [_commentTextField setEditable: 323 [_connection protocol] >= 1.1 && [[_connection account] changeFiles]];323 [_connection protocol] >= 1.1 && [[_connection account] alterFiles]]; 324 324 325 325 // --- resize and show window WiredClient/trunk/WCPublicChat.m
r1376 r1377 1 /* $Id: WCPublicChat.m,v 1.3 1 2004/07/27 17:37:44morris Exp $ */1 /* $Id: WCPublicChat.m,v 1.32 2004/07/27 18:28:26 morris Exp $ */ 2 2 3 3 /* … … 350 350 351 351 352 353 352 - (void)banSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo { 354 353 WCUser *user = (WCUser *) contextInfo;
