Changeset 3963
- Timestamp:
- 03/27/06 01:24:29 (3 years ago)
- Files:
-
- WiredClient/trunk/English.lproj/MainMenu.nib/classes.nib (modified) (1 diff)
- WiredClient/trunk/English.lproj/MainMenu.nib/info.nib (modified) (1 diff)
- WiredClient/trunk/English.lproj/MainMenu.nib/keyedobjects.nib (modified) (previous)
- WiredClient/trunk/English.lproj/MainMenu.nib/objects.nib (modified) (previous)
- WiredClient/trunk/WCApplicationController.h (modified) (1 diff)
- WiredClient/trunk/WCApplicationController.m (modified) (2 diffs)
- WiredClient/trunk/WCConnection.h (modified) (1 diff)
- WiredClient/trunk/WCConnectionController.m (modified) (4 diffs)
- WiredClient/trunk/WCDock.h (modified) (1 diff)
- WiredClient/trunk/WCDock.m (modified) (2 diffs)
- WiredClient/trunk/WCPublicChat.m (modified) (3 diffs)
- WiredClient/trunk/WCServerConnection.h (modified) (2 diffs)
- WiredClient/trunk/WCServerConnection.m (modified) (4 diffs)
- WiredClient/trunk/WCTrackerConnection.m (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
WiredClient/trunk/English.lproj/MainMenu.nib/classes.nib
r3957 r3963 44 44 connect = id; 45 45 hideConnection = id; 46 makeLayoutDefault = id; 46 47 manual = id; 47 48 nextConnection = id; 48 49 preferences = id; 49 50 previousConnection = id; 51 restoreLayoutToDefault = id; 50 52 showDock = id; 51 53 showTrackers = id; WiredClient/trunk/English.lproj/MainMenu.nib/info.nib
r3957 r3963 4 4 <dict> 5 5 <key>IBDocumentLocation</key> 6 <string> 440 203412 357 0 0 1280 1002 </string>6 <string>271 132 412 357 0 0 1280 1002 </string> 7 7 <key>IBEditorPositions</key> 8 8 <dict> 9 9 <key>29</key> 10 <string>1 43 873 614 44 0 0 1280 1002 </string>10 <string>128 723 614 44 0 0 1280 1002 </string> 11 11 </dict> 12 12 <key>IBFramework Version</key> WiredClient/trunk/WCApplicationController.h
r3957 r3963 60 60 - (IBAction)nextConnection:(id)sender; 61 61 - (IBAction)previousConnection:(id)sender; 62 - (IBAction)makeLayoutDefault:(id)sender; 63 - (IBAction)restoreLayoutToDefault:(id)sender; 62 64 63 65 - (IBAction)manual:(id)sender; WiredClient/trunk/WCApplicationController.m
r3957 r3963 300 300 if(selector == @selector(hideConnection:) || 301 301 selector == @selector(nextConnection:) || 302 selector == @selector(previousConnection:)) 302 selector == @selector(previousConnection:) || 303 selector == @selector(makeLayoutDefault:) || 304 selector == @selector(restoreLayoutToDefault:)) 303 305 return [[WCDock dock] validateMenuItem:item]; 304 306 … … 498 500 499 501 502 - (IBAction)makeLayoutDefault:(id)sender { 503 [[WCDock dock] makeLayoutDefault:sender]; 504 } 505 506 507 508 - (IBAction)restoreLayoutToDefault:(id)sender { 509 [[WCDock dock] restoreLayoutToDefault:sender]; 510 } 511 512 513 500 514 #pragma mark - 501 515 WiredClient/trunk/WCConnection.h
r3945 r3963 118 118 - (void)removeObserver:(id)target; 119 119 - (void)removeObserver:(id)target name:(NSString *)name; 120 - (void)postNotificationName:(NSString *)name; 120 121 - (void)postNotificationName:(NSString *)name object:(id)object; 121 122 - (void)postNotificationName:(NSString *)name object:(id)object userInfo:(NSDictionary *)userInfo; WiredClient/trunk/WCConnectionController.m
r3961 r3963 48 48 NSDictionary *windowTemplate; 49 49 50 if([[self connection] bookmark]) 51 windowTemplate = [WCSettings windowTemplateForKey:[[[self connection] bookmark] objectForKey:WCBookmarksIdentifier]]; 52 else 53 windowTemplate = [WCSettings windowTemplateForKey:[[[self connection] URL] hostpair]]; 50 windowTemplate = [WCSettings windowTemplateForKey:[[self connection] identifier]]; 54 51 55 52 if(!windowTemplate) … … 160 157 name:WCServerConnectionShouldUnhide]; 161 158 159 [_connection addObserver:self 160 selector:@selector(_serverConnectionShouldLoadWindowTemplate:) 161 name:WCServerConnectionShouldLoadWindowTemplate]; 162 163 [_connection addObserver:self 164 selector:@selector(_serverConnectionShouldSaveWindowTemplate:) 165 name:WCServerConnectionShouldSaveWindowTemplate]; 166 162 167 return self; 163 168 } … … 200 205 if(!_hidden) 201 206 [[self window] orderFront:self]; 207 } 208 209 210 211 - (void)_serverConnectionShouldLoadWindowTemplate:(NSNotification *)notification { 212 [self _loadWindowTemplate]; 213 } 214 215 216 217 - (void)_serverConnectionShouldSaveWindowTemplate:(NSNotification *)notification { 218 [self _saveWindowTemplate]; 202 219 } 203 220 … … 404 421 405 422 [connection setBookmark:bookmark]; 423 [connection postNotificationName:WCServerConnectionShouldSaveWindowTemplate]; 406 424 407 425 [[NSNotificationCenter defaultCenter] postNotificationName:WCBookmarksDidChange]; WiredClient/trunk/WCDock.h
r3574 r3963 63 63 - (IBAction)nextConnection:(id)sender; 64 64 - (IBAction)previousConnection:(id)sender; 65 - (IBAction)makeLayoutDefault:(id)sender; 66 - (IBAction)restoreLayoutToDefault:(id)sender; 65 67 66 68 @end WiredClient/trunk/WCDock.m
r3574 r3963 335 335 else if(selector == @selector(disconnect:)) 336 336 return [[self _selectedConnection] isConnected]; 337 else if(selector == @selector(makeLayoutDefault:)) 338 return [[[NSApp keyWindow] windowController] isKindOfClass:[WCConnectionController class]]; 339 else if(selector == @selector(restoreLayoutToDefault:)) 340 return ([[[NSApp keyWindow] windowController] isKindOfClass:[WCConnectionController class]] && 341 [WCSettings windowTemplateForKey:WCWindowTemplatesDefault] != NULL); 337 342 338 343 return YES; … … 468 473 469 474 475 - (IBAction)makeLayoutDefault:(id)sender { 476 NSAlert *alert; 477 WCServerConnection *connection; 478 479 alert = [NSAlert alertWithMessageText:NSLS(@"Make Current Layout Default?", @"Make layout default dialog title") 480 defaultButton:NSLS(@"OK", @"Make layout default dialog button title") 481 alternateButton:NULL 482 otherButton:NSLS(@"Cancel", @"Make layout default dialog button title") 483 informativeTextWithFormat:NSLS(@"This cannot be undone.", @"Make layout default dialog button description")]; 484 485 if([alert runModal] == NSAlertDefaultReturn) { 486 connection = [(WCConnectionController *) [[NSApp keyWindow] windowController] connection]; 487 [connection postNotificationName:WCServerConnectionShouldSaveWindowTemplate]; 488 489 [WCSettings setWindowTemplate:[WCSettings windowTemplateForKey:[connection identifier]] 490 forKey:WCWindowTemplatesDefault]; 491 } 492 } 493 494 495 496 - (IBAction)restoreLayoutToDefault:(id)sender { 497 NSAlert *alert; 498 WCServerConnection *connection; 499 500 alert = [NSAlert alertWithMessageText:NSLS(@"Restore Layout To Default?", @"Restore layout to default dialog title") 501 defaultButton:NSLS(@"OK", @"Restore layout to default dialog button title") 502 alternateButton:NULL 503 otherButton:NSLS(@"Cancel", @"Restore layout to default dialog button title") 504 informativeTextWithFormat:NSLS(@"This cannot be undone.", @"Restore layout to default dialog button description")]; 505 506 if([alert runModal] == NSAlertDefaultReturn) { 507 connection = [(WCConnectionController *) [[NSApp keyWindow] windowController] connection]; 508 509 [WCSettings setWindowTemplate:[WCSettings windowTemplateForKey:WCWindowTemplatesDefault] 510 forKey:[connection identifier]]; 511 512 [connection postNotificationName:WCServerConnectionShouldLoadWindowTemplate]; 513 } 514 } 515 516 517 470 518 #pragma mark - 471 519 WiredClient/trunk/WCPublicChat.m
r3961 r3963 94 94 NSButton *button; 95 95 96 toolbar = [[NSToolbar alloc] initWithIdentifier:WCChatToolbar];97 96 _toolbarItems = [[NSMutableDictionary alloc] init]; 98 97 … … 166 165 [_toolbarItems setObject:item forKey:[item itemIdentifier]]; 167 166 167 toolbar = [[NSToolbar alloc] initWithIdentifier:[NSString UUIDString]]; 168 168 [toolbar setDelegate:self]; 169 [toolbar setVisible:YES];170 169 [toolbar setAllowsUserCustomization:YES]; 171 [toolbar setAutosavesConfiguration:YES];172 [toolbar setDisplayMode:NSToolbarDisplayModeDefault];173 170 174 171 return [toolbar autorelease]; … … 244 241 - (void)windowWillClose:(NSNotification *)notification { 245 242 [[self connection] terminate]; 243 } 244 245 246 247 - (void)windowTemplateShouldLoad:(NSMutableDictionary *)windowTemplate { 248 [[[self window] toolbar] setPropertyTemplate:[windowTemplate objectForKey:@"Toolbar"]]; 249 } 250 251 252 253 - (void)windowTemplateShouldSave:(NSMutableDictionary *)windowTemplate { 254 [windowTemplate setObject:[[[self window] toolbar] propertyTemplate] forKey:@"Toolbar"]; 246 255 } 247 256 WiredClient/trunk/WCServerConnection.h
r3658 r3963 34 34 35 35 @interface WCServerConnection : WIWindowController <WCConnection> { 36 IBOutlet NSTextField *_addressTextField;37 IBOutlet NSTextField *_loginTextField;38 IBOutlet NSSecureTextField *_passwordTextField;36 IBOutlet NSTextField *_addressTextField; 37 IBOutlet NSTextField *_loginTextField; 38 IBOutlet NSSecureTextField *_passwordTextField; 39 39 40 IBOutlet NSProgressIndicator *_progressIndicator;40 IBOutlet NSProgressIndicator *_progressIndicator; 41 41 42 NSDictionary *_bookmark;42 NSDictionary *_bookmark; 43 43 44 WCServer *_server;45 WCCache *_cache;44 WCServer *_server; 45 WCCache *_cache; 46 46 47 WCLink *_link;48 NSNotificationCenter *_notificationCenter;47 WCLink *_link; 48 NSNotificationCenter *_notificationCenter; 49 49 50 WCAccounts *_accounts;51 WCPublicChat *_chat;52 WCConsole *_console;53 WCMessages *_messages;54 WCNews *_news;55 WCSearch *_search;56 WCServerInfo *_serverInfo;57 WCTransfers *_transfers;50 WCAccounts *_accounts; 51 WCPublicChat *_chat; 52 WCConsole *_console; 53 WCMessages *_messages; 54 WCNews *_news; 55 WCSearch *_search; 56 WCServerInfo *_serverInfo; 57 WCTransfers *_transfers; 58 58 59 BOOL _sentLogin;60 BOOL _loginFailed;61 BOOL _closingWindow;62 BOOL _reconnecting;63 BOOL _hidden;59 BOOL _sentLogin; 60 BOOL _loginFailed; 61 BOOL _closingWindow; 62 BOOL _reconnecting; 63 BOOL _hidden; 64 64 } 65 65 66 66 67 #define WCServerConnectionWillReconnect @"WCServerConnectionWillReconnect"68 #define WCServerConnectionShouldHide @"WCServerConnectionShouldHide"69 #define WCServerConnectionShouldUnhide @"WCServerConnectionShouldUnhide"70 #define WCServerConnectionTriggeredEvent @"WCServerConnectionTriggeredEvent"67 #define WCServerConnectionWillReconnect @"WCServerConnectionWillReconnect" 68 #define WCServerConnectionShouldHide @"WCServerConnectionShouldHide" 69 #define WCServerConnectionShouldUnhide @"WCServerConnectionShouldUnhide" 70 #define WCServerConnectionTriggeredEvent @"WCServerConnectionTriggeredEvent" 71 71 72 #define WCServerConnectionServerInfoDidChange @"WCServerConnectionServerInfoDidChange" 73 #define WCServerConnectionLoggedIn @"WCServerConnectionLoggedIn" 74 #define WCServerConnectionBannerDidChange @"WCServerConnectionBannerDidChange" 75 #define WCServerConnectionPrivilegesDidChange @"WCServerConnectionPrivilegesDidChange" 72 #define WCServerConnectionShouldLoadWindowTemplate @"WCServerConnectionShouldLoadWindowTemplate" 73 #define WCServerConnectionShouldSaveWindowTemplate @"WCServerConnectionShouldSaveWindowTemplate" 76 74 77 #define WCServerConnectionReceivedServerInfo @"WCServerConnectionReceivedServerInfo" 78 #define WCServerConnectionReceivedSelf @"WCServerConnectionReceivedSelf" 79 #define WCServerConnectionReceivedPing @"WCServerConnectionReceivedPing" 80 #define WCServerConnectionReceivedBanner @"WCServerConnectionReceivedBanner" 81 #define WCServerConnectionReceivedPrivileges @"WCServerConnectionReceivedPrivileges" 75 #define WCServerConnectionServerInfoDidChange @"WCServerConnectionServerInfoDidChange" 76 #define WCServerConnectionLoggedIn @"WCServerConnectionLoggedIn" 77 #define WCServerConnectionBannerDidChange @"WCServerConnectionBannerDidChange" 78 #define WCServerConnectionPrivilegesDidChange @"WCServerConnectionPrivilegesDidChange" 82 79 83 #define WCAccountEditorReceivedUser @"WCAccountEditorReceivedUser" 84 #define WCAccountEditorReceivedGroup @"WCAccountEditorReceivedGroup" 80 #define WCServerConnectionReceivedServerInfo @"WCServerConnectionReceivedServerInfo" 81 #define WCServerConnectionReceivedSelf @"WCServerConnectionReceivedSelf" 82 #define WCServerConnectionReceivedPing @"WCServerConnectionReceivedPing" 83 #define WCServerConnectionReceivedBanner @"WCServerConnectionReceivedBanner" 84 #define WCServerConnectionReceivedPrivileges @"WCServerConnectionReceivedPrivileges" 85 85 86 #define WCAccountsReceivedUser @"WCAccountsReceivedUser" 87 #define WCAccountsCompletedUsers @"WCAccountsCompletedUsers" 88 #define WCAccountsReceivedGroup @"WCAccountsReceivedGroup" 89 #define WCAccountsCompletedGroups @"WCAccountsCompletedGroups" 86 #define WCAccountEditorReceivedUser @"WCAccountEditorReceivedUser" 87 #define WCAccountEditorReceivedGroup @"WCAccountEditorReceivedGroup" 90 88 91 #define WCChatReceivedUser @"WCChatShouldAddUser" 92 #define WCChatCompletedUsers @"WCChatShouldCompleteUsers" 93 #define WCChatReceivedUserJoin @"WCChatReceivedUserJoin" 94 #define WCChatReceivedUserLeave @"WCChatReceivedUserLeave" 95 #define WCChatReceivedUserChange @"WCChatReceivedUserChange" 96 #define WCChatReceivedUserIconChange @"WCChatReceivedUserIconChange" 97 #define WCChatReceivedUserKick @"WCChatReceivedUserKick" 98 #define WCChatReceivedUserBan @"WCChatReceivedUserBan" 99 #define WCChatReceivedChat @"WCChatReceivedChat" 100 #define WCChatReceivedActionChat @"WCChatReceivedActionChat" 101 #define WCChatReceivedTopic @"WCChatReceivedTopic" 89 #define WCAccountsReceivedUser @"WCAccountsReceivedUser" 90 #define WCAccountsCompletedUsers @"WCAccountsCompletedUsers" 91 #define WCAccountsReceivedGroup @"WCAccountsReceivedGroup" 92 #define WCAccountsCompletedGroups @"WCAccountsCompletedGroups" 102 93 103 #define WCFileInfoReceivedFileInfo @"WCFileInfoReceivedFileInfo" 94 #define WCChatReceivedUser @"WCChatShouldAddUser" 95 #define WCChatCompletedUsers @"WCChatShouldCompleteUsers" 96 #define WCChatReceivedUserJoin @"WCChatReceivedUserJoin" 97 #define WCChatReceivedUserLeave @"WCChatReceivedUserLeave" 98 #define WCChatReceivedUserChange @"WCChatReceivedUserChange" 99 #define WCChatReceivedUserIconChange @"WCChatReceivedUserIconChange" 100 #define WCChatReceivedUserKick @"WCChatReceivedUserKick" 101 #define WCChatReceivedUserBan @"WCChatReceivedUserBan" 102 #define WCChatReceivedChat @"WCChatReceivedChat" 103 #define WCChatReceivedActionChat @"WCChatReceivedActionChat" 104 #define WCChatReceivedTopic @"WCChatReceivedTopic" 104 105 105 #define WCFilesReceivedFile @"WCFilesReceivedFile" 106 #define WCFilesCompletedFiles @"WCFilesCompletedFiles" 106 #define WCFileInfoReceivedFileInfo @"WCFileInfoReceivedFileInfo" 107 107 108 #define WC MessagesReceivedMessage @"WCMessagesReceivedMessage"109 #define WC MessagesReceivedBroadcast @"WCMessagesReceivedBroadcast"108 #define WCFilesReceivedFile @"WCFilesReceivedFile" 109 #define WCFilesCompletedFiles @"WCFilesCompletedFiles" 110 110 111 #define WCNewsShouldAddNews @"WCNewsShouldAddNews" 112 #define WCNewsShouldCompleteNews @"WCNewsShouldCompleteNews" 113 #define WCNewsShouldAddNewNews @"WCNewsShouldAddNewNews" 111 #define WCMessagesReceivedMessage @"WCMessagesReceivedMessage" 112 #define WCMessagesReceivedBroadcast @"WCMessagesReceivedBroadcast" 114 113 115 #define WC PrivateChatReceivedCreate @"WCPrivateChatReceivedCreate"116 #define WC PrivateChatReceivedInvite @"WCPrivateChatReceivedInvite"117 #define WC PrivateChatReceivedDecline @"WCPrivateChatReceivedDecline"114 #define WCNewsShouldAddNews @"WCNewsShouldAddNews" 115 #define WCNewsShouldCompleteNews @"WCNewsShouldCompleteNews" 116 #define WCNewsShouldAddNewNews @"WCNewsShouldAddNewNews" 118 117 119 #define WCSearchReceivedFile @"WCSearchReceivedFile" 120 #define WCSearchCompletedFiles @"WCSearchCompletedFiles" 118 #define WCPrivateChatReceivedCreate @"WCPrivateChatReceivedCreate" 119 #define WCPrivateChatReceivedInvite @"WCPrivateChatReceivedInvite" 120 #define WCPrivateChatReceivedDecline @"WCPrivateChatReceivedDecline" 121 121 122 #define WC TransfersReceivedTransferStart @"WCTransfersReceivedTransferStart"123 #define WC TransfersReceivedQueueUpdate @"WCTransfersReceivedQueueUpdate"122 #define WCSearchReceivedFile @"WCSearchReceivedFile" 123 #define WCSearchCompletedFiles @"WCSearchCompletedFiles" 124 124 125 #define WCUserInfoReceivedUserInfo @"WCUserInfoReceivedUserInfo" 125 #define WCTransfersReceivedTransferStart @"WCTransfersReceivedTransferStart" 126 #define WCTransfersReceivedQueueUpdate @"WCTransfersReceivedQueueUpdate" 127 128 #define WCUserInfoReceivedUserInfo @"WCUserInfoReceivedUserInfo" 126 129 127 130 … … 143 146 - (NSDictionary *)bookmark; 144 147 - (NSString *)name; 148 - (NSString *)identifier; 145 149 - (WCAccount *)account; 146 150 - (WCServer *)server; WiredClient/trunk/WCServerConnection.m
r3945 r3963 201 201 } 202 202 203 url = [_ linkURL];203 url = [_server URL]; 204 204 user = [[url user] length] > 0 ? [url user] : WCDefaultLogin; 205 205 password = [[url password] length] > 0 ? [[url password] SHA1] : @""; … … 546 546 - (void)removeObserver:(id)target name:(NSString *)name { 547 547 [_notificationCenter removeObserver:target name:name object:NULL]; 548 } 549 550 551 552 - (void)postNotificationName:(NSString *)name { 553 [_notificationCenter mainThreadPostNotificationName:name]; 554 555 [[NSNotificationCenter defaultCenter] mainThreadPostNotificationName:name]; 548 556 } 549 557 … … 887 895 888 896 - (WIURL *)URL { 889 return [_ linkURL];897 return [_server URL]; 890 898 } 891 899 … … 945 953 946 954 955 - (NSString *)identifier { 956 if(_bookmark) 957 return [_bookmark objectForKey:WCBookmarksIdentifier]; 958 959 return [[_server URL] hostpair]; 960 } 961 962 963 947 964 - (WCAccount *)account { 948 965 return [_server account]; WiredClient/trunk/WCTrackerConnection.m
r3945 r3963 176 176 177 177 178 - (void)postNotificationName:(NSString *)name { 179 [_notificationCenter mainThreadPostNotificationName:name]; 180 181 [[NSNotificationCenter defaultCenter] mainThreadPostNotificationName:name]; 182 } 183 184 185 178 186 - (void)postNotificationName:(NSString *)name object:(id)object { 179 187 [_notificationCenter mainThreadPostNotificationName:name object:object];
