Changeset 3996
- Timestamp:
- 03/28/06 20:01:55 (3 years ago)
- Files:
-
- WiredClient/trunk/English.lproj/Localizable.strings (modified) (6 diffs)
- WiredClient/trunk/English.lproj/MainMenu.nib/classes.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/WCAccounts.m (modified) (1 diff)
- WiredClient/trunk/WCApplicationController.h (modified) (1 diff)
- WiredClient/trunk/WCApplicationController.m (modified) (2 diffs)
- WiredClient/trunk/WCConnectionController.h (modified) (3 diffs)
- WiredClient/trunk/WCConnectionController.m (modified) (4 diffs)
- WiredClient/trunk/WCConsole.m (modified) (1 diff)
- WiredClient/trunk/WCDock.h (modified) (1 diff)
- WiredClient/trunk/WCDock.m (modified) (4 diffs)
- WiredClient/trunk/WCMessages.m (modified) (1 diff)
- WiredClient/trunk/WCNews.m (modified) (1 diff)
- WiredClient/trunk/WCPublicChat.m (modified) (1 diff)
- WiredClient/trunk/WCSearch.m (modified) (1 diff)
- WiredClient/trunk/WCServerInfo.m (modified) (2 diffs)
- WiredClient/trunk/WCTrackers.m (modified) (1 diff)
- WiredClient/trunk/WCTransfers.m (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
WiredClient/trunk/English.lproj/Localizable.strings
r3964 r3996 164 164 Delete ignore dialog button title 165 165 Delete file button title 166 Restore all layouts to default dialog button title 166 167 Disconnect dialog button title 167 168 Delete account dialog button title … … 292 293 "File or Folder Not Found" = "File or Folder Not Found"; 293 294 295 /* File plural */ 296 "files" = "files"; 297 294 298 /* Files toolbar item */ 295 299 "Files" = "Files"; 296 297 /* File plural */298 "files" = "files";299 300 300 301 /* Transfer finished (files, transferred, speed, time) */ … … 365 366 "Message Received" = "Message Received"; 366 367 368 /* Message plural */ 369 "messages" = "messages"; 370 367 371 /* Messages toolbar item 368 372 Messages window title */ 369 373 "Messages" = "Messages"; 370 374 371 /* Message plural */372 "messages" = "messages";373 374 375 /* News toolbar item 375 376 News window title */ … … 382 383 "No" = "No"; 383 384 384 /* Make layout default dialog button title 385 /* Restore all layouts to default dialog button title 386 Make layout default dialog button title 385 387 Restore layout to default dialog button title */ 386 388 "OK" = "OK"; … … 409 411 /* Ping received message (interval) */ 410 412 "Received ping reply after %.2fms" = "Received ping reply after %.2fms"; 413 414 /* Restore all layouts to default dialog title */ 415 "Restore All Layouts To Default?" = "Restore All Layouts To Default?"; 411 416 412 417 /* Restore layout to default dialog title */ … … 500 505 "The transfer of \"%@\" failed." = "The transfer of \"%@\" failed."; 501 506 502 /* Clear news dialog description 503 Delete ignore dialog description 507 /* Delete ignore dialog description 508 Delete tracker bookmark dialog description 509 Clear news dialog description 510 Delete bookmark dialog description 511 Clear messages dialog description 512 Delete file dialog description 504 513 Delete account dialog description 505 Make layout default dialog button description 506 Delete file dialog description 507 Delete highlight dialog description 508 Restore layout to default dialog button description 509 Delete tracker bookmark dialog description 510 Delete bookmark dialog description 511 Clear messages dialog description */ 514 Delete highlight dialog description */ 512 515 "This cannot be undone." = "This cannot be undone."; 513 516 514 517 /* WCWiredClientProtocolMismatch description */ 515 518 "This server uses a newer protocol version than this client supports. Protocol errors may occur during the connection." = "This server uses a newer protocol version than this client supports. Protocol errors may occur during the connection."; 519 520 /* Restore all layouts to default dialog button description */ 521 "This will restore all windows for all connections to the previously saved default layout." = "This will restore all windows for all connections to the previously saved default layout."; 522 523 /* Restore layout to default dialog button description */ 524 "This will restore all windows for the currently shown connection to the previously saved default layout." = "This will restore all windows for the currently shown connection to the previously saved default layout."; 525 526 /* Make layout default dialog button description */ 527 "This will set the windows for the currently shown connection as the default layout." = "This will set the windows for the currently shown connection as the default layout."; 516 528 517 529 /* Message to (nick) */ WiredClient/trunk/English.lproj/MainMenu.nib/classes.nib
r3963 r3996 49 49 preferences = id; 50 50 previousConnection = id; 51 restoreAllLayoutsToDefault = id; 51 52 restoreLayoutToDefault = id; 52 53 showDock = id; WiredClient/trunk/WCAccounts.m
r3977 r3996 251 251 252 252 - (void)windowTemplateShouldLoad:(NSMutableDictionary *)windowTemplate { 253 [[self window] setPropertiesFromDictionary:[windowTemplate objectForKey:@"WCAccountsWindow"] ];253 [[self window] setPropertiesFromDictionary:[windowTemplate objectForKey:@"WCAccountsWindow"] restoreSize:YES visibility:![self isHidden]]; 254 254 [_accountsTableView setPropertiesFromDictionary:[windowTemplate objectForKey:@"WCAccountsTableView"]]; 255 255 } WiredClient/trunk/WCApplicationController.h
r3963 r3996 62 62 - (IBAction)makeLayoutDefault:(id)sender; 63 63 - (IBAction)restoreLayoutToDefault:(id)sender; 64 - (IBAction)restoreAllLayoutsToDefault:(id)sender; 64 65 65 66 - (IBAction)manual:(id)sender; WiredClient/trunk/WCApplicationController.m
r3963 r3996 302 302 selector == @selector(previousConnection:) || 303 303 selector == @selector(makeLayoutDefault:) || 304 selector == @selector(restoreLayoutToDefault:)) 304 selector == @selector(restoreLayoutToDefault:) || 305 selector == @selector(restoreAllLayoutsToDefault:)) 305 306 return [[WCDock dock] validateMenuItem:item]; 306 307 … … 512 513 513 514 515 - (IBAction)restoreAllLayoutsToDefault:(id)sender { 516 [[WCDock dock] restoreAllLayoutsToDefault:sender]; 517 } 518 519 520 514 521 #pragma mark - 515 522 WiredClient/trunk/WCConnectionController.h
r3977 r3996 33 33 34 34 BOOL _hidden; 35 BOOL _wasVisible; 35 36 BOOL _releasedWhenClosed; 36 37 } … … 41 42 42 43 - (NSDictionary *)windowTemplate; 44 - (BOOL)isHidden; 43 45 44 46 - (void)setName:(NSString *)name; … … 46 48 - (void)setConnection:(WCServerConnection *)connection; 47 49 - (WCServerConnection *)connection; 48 - (void)setHidden:(BOOL)value;49 - (BOOL)isHidden;50 50 - (void)setReleasedWhenClosed:(BOOL)value; 51 51 - (BOOL)isReleasedWhenClosed; WiredClient/trunk/WCConnectionController.m
r3977 r3996 220 220 221 221 - (void)_serverConnectionShouldHide:(NSNotification *)notification { 222 _hidden = ![[self window] isOnScreen]; 222 _wasVisible = [[self window] isVisible]; 223 _hidden = YES; 223 224 224 225 [[self window] orderOut:self]; … … 228 229 229 230 - (void)_serverConnectionShouldUnhide:(NSNotification *)notification { 230 if( !_hidden)231 if(_wasVisible) 231 232 [[self window] orderFront:self]; 233 234 _hidden = NO; 232 235 } 233 236 … … 267 270 268 271 272 - (BOOL)isHidden { 273 return _hidden; 274 } 275 276 277 269 278 #pragma mark - 270 279 … … 295 304 - (WCServerConnection *)connection { 296 305 return _connection; 297 }298 299 300 301 - (void)setHidden:(BOOL)value {302 _hidden = value;303 }304 305 306 307 - (BOOL)isHidden {308 return _hidden;309 306 } 310 307 WiredClient/trunk/WCConsole.m
r3977 r3996 136 136 137 137 - (void)windowTemplateShouldLoad:(NSMutableDictionary *)windowTemplate { 138 [[self window] setPropertiesFromDictionary:[windowTemplate objectForKey:@"WCConsoleWindow"] ];138 [[self window] setPropertiesFromDictionary:[windowTemplate objectForKey:@"WCConsoleWindow"] restoreSize:YES visibility:![self isHidden]]; 139 139 } 140 140 WiredClient/trunk/WCDock.h
r3963 r3996 65 65 - (IBAction)makeLayoutDefault:(id)sender; 66 66 - (IBAction)restoreLayoutToDefault:(id)sender; 67 - (IBAction)restoreAllLayoutsToDefault:(id)sender; 67 68 68 69 @end WiredClient/trunk/WCDock.m
r3963 r3996 340 340 return ([[[NSApp keyWindow] windowController] isKindOfClass:[WCConnectionController class]] && 341 341 [WCSettings windowTemplateForKey:WCWindowTemplatesDefault] != NULL); 342 else if(selector == @selector(restoreAllLayoutsToDefault:)) 343 return ([_shownConnections count] > 0 && [WCSettings windowTemplateForKey:WCWindowTemplatesDefault] != NULL); 342 344 343 345 return YES; … … 481 483 alternateButton:NULL 482 484 otherButton:NSLS(@"Cancel", @"Make layout default dialog button title") 483 informativeTextWithFormat:NSLS(@"This cannot be undone.", @"Make layout default dialog button description")];485 informativeTextWithFormat:NSLS(@"This will set the windows for the currently shown connection as the default layout.", @"Make layout default dialog button description")]; 484 486 485 487 if([alert runModal] == NSAlertDefaultReturn) { … … 502 504 alternateButton:NULL 503 505 otherButton:NSLS(@"Cancel", @"Restore layout to default dialog button title") 504 informativeTextWithFormat:NSLS(@"This cannot be undone.", @"Restore layout to default dialog button description")];506 informativeTextWithFormat:NSLS(@"This will restore all windows for the currently shown connection to the previously saved default layout.", @"Restore layout to default dialog button description")]; 505 507 506 508 if([alert runModal] == NSAlertDefaultReturn) { … … 511 513 512 514 [connection postNotificationName:WCServerConnectionShouldLoadWindowTemplate]; 515 } 516 } 517 518 519 520 - (IBAction)restoreAllLayoutsToDefault:(id)sender { 521 NSAlert *alert; 522 WCServerConnection *connection; 523 unsigned int i, count; 524 525 alert = [NSAlert alertWithMessageText:NSLS(@"Restore All Layouts To Default?", @"Restore all layouts to default dialog title") 526 defaultButton:NSLS(@"OK", @"Restore all layouts to default dialog button title") 527 alternateButton:NULL 528 otherButton:NSLS(@"Cancel", @"Restore all layouts to default dialog button title") 529 informativeTextWithFormat:NSLS(@"This will restore all windows for all connections to the previously saved default layout.", @"Restore all layouts to default dialog button description")]; 530 531 if([alert runModal] == NSAlertDefaultReturn) { 532 count = [_shownConnections count]; 533 534 for(i = 0; i < count; i++) { 535 connection = [_shownConnections objectAtIndex:i]; 536 537 [WCSettings setWindowTemplate:[WCSettings windowTemplateForKey:WCWindowTemplatesDefault] 538 forKey:[connection identifier]]; 539 540 [connection postNotificationName:WCServerConnectionShouldLoadWindowTemplate]; 541 } 513 542 } 514 543 } WiredClient/trunk/WCMessages.m
r3977 r3996 495 495 496 496 - (void)windowTemplateShouldLoad:(NSMutableDictionary *)windowTemplate { 497 [[self window] setPropertiesFromDictionary:[windowTemplate objectForKey:@"WCMessagesWindow"] ];497 [[self window] setPropertiesFromDictionary:[windowTemplate objectForKey:@"WCMessagesWindow"] restoreSize:YES visibility:![self isHidden]]; 498 498 [_conversationsSplitView setPropertiesFromDictionary:[windowTemplate objectForKey:@"WCMessagesConversationsSplitView"]]; 499 499 [_messagesSplitView setPropertiesFromDictionary:[windowTemplate objectForKey:@"WCMessagesMessagesSplitView"]]; WiredClient/trunk/WCNews.m
r3977 r3996 181 181 182 182 - (void)windowTemplateShouldLoad:(NSMutableDictionary *)windowTemplate { 183 [[self window] setPropertiesFromDictionary:[windowTemplate objectForKey:@"WCNewsWindow"] ];183 [[self window] setPropertiesFromDictionary:[windowTemplate objectForKey:@"WCNewsWindow"] restoreSize:YES visibility:![self isHidden]]; 184 184 } 185 185 WiredClient/trunk/WCPublicChat.m
r3977 r3996 241 241 242 242 - (void)windowTemplateShouldLoad:(NSMutableDictionary *)windowTemplate { 243 [[self window] setPropertiesFromDictionary:[windowTemplate objectForKey:@"WCChatWindow"] ];243 [[self window] setPropertiesFromDictionary:[windowTemplate objectForKey:@"WCChatWindow"] restoreSize:YES visibility:![self isHidden]]; 244 244 245 245 [super windowTemplateShouldLoad:windowTemplate]; WiredClient/trunk/WCSearch.m
r3986 r3996 269 269 270 270 - (void)windowTemplateShouldLoad:(NSMutableDictionary *)windowTemplate { 271 [[self window] setPropertiesFromDictionary:[windowTemplate objectForKey:@"WCSearchWindow"] ];271 [[self window] setPropertiesFromDictionary:[windowTemplate objectForKey:@"WCSearchWindow"] restoreSize:YES visibility:![self isHidden]]; 272 272 [_searchTableView setPropertiesFromDictionary:[windowTemplate objectForKey:@"WCSearchTableView"]]; 273 273 } WiredClient/trunk/WCServerInfo.m
r3977 r3996 185 185 186 186 - (void)windowTemplateShouldLoad:(NSMutableDictionary *)windowTemplate { 187 [[self window] setPropertiesFromDictionary:[windowTemplate objectForKey:@"WCServerInfoWindow"] ];187 [[self window] setPropertiesFromDictionary:[windowTemplate objectForKey:@"WCServerInfoWindow"] restoreSize:NO visibility:![self isHidden]]; 188 188 } 189 189 … … 191 191 192 192 - (void)windowTemplateShouldSave:(NSMutableDictionary *)windowTemplate { 193 [windowTemplate setObject:[[self window] propertiesDictionary WithoutFrameSize] forKey:@"WCServerInfoWindow"];193 [windowTemplate setObject:[[self window] propertiesDictionary] forKey:@"WCServerInfoWindow"]; 194 194 } 195 195 WiredClient/trunk/WCTrackers.m
r3994 r3996 452 452 453 453 tracker = [self _selectedTracker]; 454 url = [tracker URL]; 455 456 if(!url && [tracker netService]) { 457 address = [WIAddress addressWithNetService:[tracker netService] error:&error]; 454 455 if([tracker type] == WCTrackerServer) { 456 url = [tracker URL]; 458 457 459 if(address) 460 url = [WIURL URLWithScheme:@"wired" host:[address string] port:[address port]]; 461 else 462 [[error alert] beginSheetModalForWindow:[self window] modalDelegate:NULL didEndSelector:NULL contextInfo:NULL]; 463 } 464 465 if(url) { 466 if([[url scheme] isEqualToString:@"wired"]) { 467 connection = [WCServerConnection serverConnectionWithURL:url]; 468 469 [connection showWindow:self]; 470 471 if(([[NSApp currentEvent] modifierFlags] & NSAlternateKeyMask) == 0) 472 [connection connect]; 458 if(!url && [tracker netService]) { 459 address = [WIAddress addressWithNetService:[tracker netService] error:&error]; 460 461 if(address) 462 url = [WIURL URLWithScheme:@"wired" host:[address string] port:[address port]]; 463 else 464 [[error alert] beginSheetModalForWindow:[self window] modalDelegate:NULL didEndSelector:NULL contextInfo:NULL]; 473 465 } 466 467 if(url) { 468 if([[url scheme] isEqualToString:@"wired"]) { 469 connection = [WCServerConnection serverConnectionWithURL:url]; 470 471 [connection showWindow:self]; 472 473 if(([[NSApp currentEvent] modifierFlags] & NSAlternateKeyMask) == 0) 474 [connection connect]; 475 } 476 } 477 } else { 478 NSLog(@"expand %@", tracker); 474 479 } 475 480 } WiredClient/trunk/WCTransfers.m
r3977 r3996 1060 1060 1061 1061 - (void)windowTemplateShouldLoad:(NSMutableDictionary *)windowTemplate { 1062 [[self window] setPropertiesFromDictionary:[windowTemplate objectForKey:@"WCTransfersWindow"] ];1062 [[self window] setPropertiesFromDictionary:[windowTemplate objectForKey:@"WCTransfersWindow"] restoreSize:YES visibility:![self isHidden]]; 1063 1063 } 1064 1064
