Changeset 3296
- Timestamp:
- Oct 6, 2007, 10:23:44 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 7 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Transmission.xcodeproj/project.pbxproj
r3283 r3296 83 83 A21F5C040AF26DD5008CE5CE /* ActionMenuSpeedToDisplayLimitTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = A21F5C020AF26DD5008CE5CE /* ActionMenuSpeedToDisplayLimitTransformer.m */; }; 84 84 A2265F420B5EF5F40093DDA5 /* FileNameCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A2265F400B5EF5F40093DDA5 /* FileNameCell.m */; }; 85 A22A067E0CB83507009694FE /* InfoTabBack.tif in Resources */ = {isa = PBXBuildFile; fileRef = A22A067D0CB83507009694FE /* InfoTabBack.tif */; }; 86 A22A06980CB83880009694FE /* InfoTabBorder.tif in Resources */ = {isa = PBXBuildFile; fileRef = A22A06970CB83880009694FE /* InfoTabBorder.tif */; }; 85 87 A22A8D560AEEAFA5007E9CB9 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = A22A8D540AEEAFA5007E9CB9 /* Localizable.strings */; }; 86 88 A22BC9A30C5BBCF100F5FB72 /* BottomBorder.png in Resources */ = {isa = PBXBuildFile; fileRef = A22BC9A20C5BBCF100F5FB72 /* BottomBorder.png */; }; 89 A22D602E0CB67E4A00F67A8B /* InfoTabBackAqua.tif in Resources */ = {isa = PBXBuildFile; fileRef = A22D602C0CB67E4A00F67A8B /* InfoTabBackAqua.tif */; }; 87 90 A232D29E0A70903E00973B12 /* Filter.png in Resources */ = {isa = PBXBuildFile; fileRef = A232D29D0A70903E00973B12 /* Filter.png */; }; 88 91 A234D0D20C79FB3600A82373 /* NSMenuAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = A234D0D00C79FB3600A82373 /* NSMenuAdditions.m */; }; … … 113 116 A261F1DC0A69A1610002815A /* Growl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A261F1DB0A69A1610002815A /* Growl.framework */; }; 114 117 A261F1E40A69A1B10002815A /* Growl.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = A261F1DB0A69A1610002815A /* Growl.framework */; }; 118 A26E75880CB6AA7500226674 /* InfoOptions.png in Resources */ = {isa = PBXBuildFile; fileRef = A26E75870CB6AA7500226674 /* InfoOptions.png */; }; 119 A26E75960CB6AB4800226674 /* InfoGeneral.png in Resources */ = {isa = PBXBuildFile; fileRef = A26E75950CB6AB4800226674 /* InfoGeneral.png */; }; 115 120 A2710E770A86796000CE4F7D /* PrefsWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = A2710E750A86796000CE4F7D /* PrefsWindow.m */; }; 116 121 A277DA0B0C693D9C00DA2CD4 /* ActionOn.png in Resources */ = {isa = PBXBuildFile; fileRef = A277DA090C693D9C00DA2CD4 /* ActionOn.png */; }; … … 141 146 A2D4F0850A915F7200890C32 /* GreenDot.tiff in Resources */ = {isa = PBXBuildFile; fileRef = A2D4F0840A915F7200890C32 /* GreenDot.tiff */; }; 142 147 A2DF37070C220D03006523C1 /* CreatorWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = A2DF37050C220D03006523C1 /* CreatorWindowController.m */; }; 148 A2E23AC60CB5E1930002BB25 /* InfoTabButtonCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A2E23AC40CB5E1930002BB25 /* InfoTabButtonCell.m */; }; 143 149 A2E9AA760C249AF400085DCF /* Create.png in Resources */ = {isa = PBXBuildFile; fileRef = A2E9AA750C249AF400085DCF /* Create.png */; }; 144 150 A2EF7DEC0C96297400FA9811 /* PurpleDot.png in Resources */ = {isa = PBXBuildFile; fileRef = A2EF7DEB0C96297400FA9811 /* PurpleDot.png */; }; … … 389 395 A2265F3F0B5EF5F40093DDA5 /* FileNameCell.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = FileNameCell.h; path = macosx/FileNameCell.h; sourceTree = "<group>"; }; 390 396 A2265F400B5EF5F40093DDA5 /* FileNameCell.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = FileNameCell.m; path = macosx/FileNameCell.m; sourceTree = "<group>"; }; 397 A22A067D0CB83507009694FE /* InfoTabBack.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = InfoTabBack.tif; path = macosx/Images/InfoTabBack.tif; sourceTree = "<group>"; }; 398 A22A06970CB83880009694FE /* InfoTabBorder.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = InfoTabBorder.tif; path = macosx/Images/InfoTabBorder.tif; sourceTree = "<group>"; }; 391 399 A22A7EBC0C627FC200E30364 /* Greek */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = Greek; path = macosx/Greek.lproj/InfoPlist.strings; sourceTree = "<group>"; }; 392 400 A22A7EBD0C627FC200E30364 /* Greek */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Greek; path = macosx/Greek.lproj/InfoWindow.nib; sourceTree = "<group>"; }; … … 408 416 A22BCA320C5D5CDA00F5FB72 /* Italian */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Italian; path = macosx/Italian.lproj/MessageWindow.nib; sourceTree = "<group>"; }; 409 417 A22BCA330C5D5CDA00F5FB72 /* Italian */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Italian; path = macosx/Italian.lproj/PrefsWindow.nib; sourceTree = "<group>"; }; 418 A22D602C0CB67E4A00F67A8B /* InfoTabBackAqua.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = InfoTabBackAqua.tif; path = macosx/Images/InfoTabBackAqua.tif; sourceTree = "<group>"; }; 410 419 A232D29D0A70903E00973B12 /* Filter.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Filter.png; path = macosx/Images/Filter.png; sourceTree = "<group>"; }; 411 420 A234D0CF0C79FB3600A82373 /* NSMenuAdditions.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = NSMenuAdditions.h; path = macosx/NSMenuAdditions.h; sourceTree = "<group>"; }; … … 449 458 A261A8250C6A0D68003BAFDA /* Error.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Error.png; path = macosx/Images/Error.png; sourceTree = "<group>"; }; 450 459 A261F1DB0A69A1610002815A /* Growl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Growl.framework; path = macosx/Growl.framework; sourceTree = "<group>"; }; 460 A26E75870CB6AA7500226674 /* InfoOptions.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = InfoOptions.png; path = macosx/Images/InfoOptions.png; sourceTree = "<group>"; }; 461 A26E75950CB6AB4800226674 /* InfoGeneral.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = InfoGeneral.png; path = macosx/Images/InfoGeneral.png; sourceTree = "<group>"; }; 451 462 A2710E740A86796000CE4F7D /* PrefsWindow.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PrefsWindow.h; path = macosx/PrefsWindow.h; sourceTree = "<group>"; }; 452 463 A2710E750A86796000CE4F7D /* PrefsWindow.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = PrefsWindow.m; path = macosx/PrefsWindow.m; sourceTree = "<group>"; }; … … 507 518 A2DF37040C220D03006523C1 /* CreatorWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CreatorWindowController.h; path = macosx/CreatorWindowController.h; sourceTree = "<group>"; }; 508 519 A2DF37050C220D03006523C1 /* CreatorWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CreatorWindowController.m; path = macosx/CreatorWindowController.m; sourceTree = "<group>"; }; 520 A2E23AC30CB5E1930002BB25 /* InfoTabButtonCell.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = InfoTabButtonCell.h; path = macosx/InfoTabButtonCell.h; sourceTree = "<group>"; }; 521 A2E23AC40CB5E1930002BB25 /* InfoTabButtonCell.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = InfoTabButtonCell.m; path = macosx/InfoTabButtonCell.m; sourceTree = "<group>"; }; 509 522 A2E9AA750C249AF400085DCF /* Create.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Create.png; path = macosx/Images/Create.png; sourceTree = "<group>"; }; 510 523 A2EF7DEB0C96297400FA9811 /* PurpleDot.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PurpleDot.png; path = macosx/Images/PurpleDot.png; sourceTree = "<group>"; }; … … 720 733 A257C17F0CAD3003004E121C /* PeerTableView.h */, 721 734 A257C1800CAD3003004E121C /* PeerTableView.m */, 735 A2E23AC30CB5E1930002BB25 /* InfoTabButtonCell.h */, 736 A2E23AC40CB5E1930002BB25 /* InfoTabButtonCell.m */, 722 737 ); 723 738 name = Sources; … … 821 836 A232D29D0A70903E00973B12 /* Filter.png */, 822 837 A253F6F20A698970008EE24F /* FilterBarBackground.png */, 838 A22D602C0CB67E4A00F67A8B /* InfoTabBackAqua.tif */, 839 A22A067D0CB83507009694FE /* InfoTabBack.tif */, 840 A22A06970CB83880009694FE /* InfoTabBorder.tif */, 841 A26E75950CB6AB4800226674 /* InfoGeneral.png */, 842 A26E75870CB6AA7500226674 /* InfoOptions.png */, 823 843 ); 824 844 name = Resources; … … 1356 1376 A2A6E3A00CA7E4C900F10FEF /* AboutWindow.nib in Resources */, 1357 1377 A2BC19850CA9AF5A00DD302A /* CompleteCheck.png in Resources */, 1378 A22D602E0CB67E4A00F67A8B /* InfoTabBackAqua.tif in Resources */, 1379 A26E75880CB6AA7500226674 /* InfoOptions.png in Resources */, 1380 A26E75960CB6AB4800226674 /* InfoGeneral.png in Resources */, 1381 A22A067E0CB83507009694FE /* InfoTabBack.tif in Resources */, 1382 A22A06980CB83880009694FE /* InfoTabBorder.tif in Resources */, 1358 1383 ); 1359 1384 runOnlyForDeploymentPostprocessing = 0; … … 1492 1517 A21282A80CA6C66800EAEE0F /* StatusBarView.m in Sources */, 1493 1518 A257C1820CAD3003004E121C /* PeerTableView.m in Sources */, 1519 A2E23AC60CB5E1930002BB25 /* InfoTabButtonCell.m in Sources */, 1494 1520 ); 1495 1521 runOnlyForDeploymentPostprocessing = 0; -
trunk/macosx/English.lproj/InfoWindow.nib/classes.nib
r3259 r3296 3 3 {CLASS = FileOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; }, 4 4 {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, 5 {CLASS = ImageBackgroundView; LANGUAGE = ObjC; SUPERCLASS = NSView; }, 6 {CLASS = InfoTabButtonCell; LANGUAGE = ObjC; SUPERCLASS = NSButtonCell; }, 5 7 { 6 8 ACTIONS = { … … 17 19 setSpeedLimit = id; 18 20 setSpeedMode = id; 21 setTab = id; 19 22 }; 20 23 CLASS = InfoWindowController; 21 24 LANGUAGE = ObjC; 22 25 OUTLETS = { 26 fActivityView = NSView; 23 27 fCommentView = NSTextView; 24 28 fCompletedFromTrackerField = NSTextField; … … 44 48 fFileTableStatusField = NSTextField; 45 49 fFileUncheckItem = NSMenuItem; 50 fFilesView = NSView; 46 51 fHashField = NSTextField; 47 52 fHaveField = NSTextField; 48 53 fImageView = NSImageView; 54 fInfoView = NSView; 49 55 fKnownField = NSTextField; 50 56 fLeechersField = NSTextField; 51 57 fNameField = NSTextField; 58 fOptionsView = NSView; 52 59 fPeerTable = NSTableView; 60 fPeersView = NSView; 53 61 fPexCheck = NSButton; 54 62 fPiecesControl = NSSegmentedControl; … … 66 74 fStateField = NSTextField; 67 75 fSwarmSpeedField = NSTextField; 68 fTabView = NSTabView; 76 fTabBackBar = ImageBackgroundView; 77 fTabMatrix = NSMatrix; 69 78 fTorrentLocationField = NSTextField; 70 79 fTrackerField = NSTextField; -
trunk/macosx/English.lproj/InfoWindow.nib/info.nib
r2832 r3296 7 7 <key>IBEditorPositions</key> 8 8 <dict> 9 <key>1030</key> 10 <string>297 229 360 384 0 0 1680 1028 </string> 11 <key>1057</key> 12 <string>505 337 360 389 0 0 1680 1028 </string> 13 <key>1066</key> 14 <string>665 601 349 202 0 0 1680 1028 </string> 9 15 <key>549</key> 10 <string>565 283 174 149 0 0 1152 842 </string> 16 <string>870 359 174 149 0 0 1680 1028 </string> 17 <key>965</key> 18 <string>229 571 370 310 0 0 1680 1028 </string> 19 <key>995</key> 20 <string>301 527 370 332 0 0 1680 1028 </string> 11 21 </dict> 12 22 <key>IBFramework Version</key> 13 23 <string>446.1</string> 14 24 <key>IBLockedObjects</key> 15 <array> 16 <integer>5</integer> 17 </array> 25 <array/> 18 26 <key>IBLockedTabItems</key> 19 27 <array> … … 23 31 <array> 24 32 <integer>5</integer> 33 <integer>1066</integer> 25 34 </array> 26 35 <key>IBSystem Version</key> -
trunk/macosx/InfoWindowController.h
r3259 r3296 26 26 #import "Torrent.h" 27 27 #import "FileOutlineView.h" 28 #import "ImageBackgroundView.h" 28 29 #import "PiecesView.h" 29 30 #import <transmission.h> … … 34 35 NSImage * fAppIcon, * fLockImage; 35 36 37 #warning need? 36 38 BOOL fCanResizeVertical; 37 39 38 IBOutlet NSTabView * fTabView; 40 IBOutlet NSView * fInfoView, * fActivityView, * fPeersView, * fFilesView, * fOptionsView; 41 NSView * fCurrentView; 42 IBOutlet NSMatrix * fTabMatrix; 43 IBOutlet ImageBackgroundView * fTabBackBar; 39 44 40 45 IBOutlet NSImageView * fImageView; … … 72 77 - (void) updateInfoStats; 73 78 79 - (void) setTab: (id) sender; 80 74 81 - (void) setNextTab; 75 82 - (void) setPreviousTab; -
trunk/macosx/InfoWindowController.m
r3264 r3296 34 34 #define TAB_OPTIONS_IDENT @"Options" 35 35 36 //15 spacing at the bottom of each tab 37 #define TAB_INFO_HEIGHT 268.0 38 #define TAB_ACTIVITY_HEIGHT 290.0 39 #define TAB_OPTIONS_HEIGHT 158.0 40 #define TAB_RESIZABLE_MIN_HEIGHT 279.0 36 #define TAB_MIN_HEIGHT 250 41 37 42 38 #define PIECES_CONTROL_PROGRESS 0 … … 48 44 49 45 #define INVALID -99 46 47 typedef enum 48 { 49 TAB_INFO_TAG = 0, 50 TAB_ACTIVITY_TAG, 51 TAB_PEERS_TAG, 52 TAB_FILES_TAG, 53 TAB_OPTIONS_TAG, 54 } tabTag; 50 55 51 56 @interface InfoWindowController (Private) … … 55 60 - (void) updateInfoPeers; 56 61 - (void) updateInfoFiles; 57 - (void) updateInfo Settings;62 - (void) updateInfoOptions; 58 63 59 64 - (void) setWindowForTab: (NSString *) identifier animate: (BOOL) animate; … … 72 77 NSPanel * window = (NSPanel *)[self window]; 73 78 74 [window setFrameAutosaveName: @"InspectorWindowFrame"];75 [window setFrameUsingName: @"InspectorWindowFrame"]; 79 /*[window setFrameAutosaveName: @"InspectorWindowFrame"]; 80 [window setFrameUsingName: @"InspectorWindowFrame"];*/ 76 81 77 82 [window setBecomesKeyOnlyIfNeeded: YES]; 78 83 [window setAcceptsMouseMovedEvents: YES]; 79 84 80 //select tab 85 //set selected tab 86 fCanResizeVertical = NO; 81 87 NSString * identifier = [[NSUserDefaults standardUserDefaults] stringForKey: @"InspectorSelected"]; 82 83 if (!identifier || [fTabView indexOfTabViewItemWithIdentifier: identifier] == NSNotFound) 84 identifier = TAB_INFO_IDENT; 85 86 fCanResizeVertical = [identifier isEqualToString: TAB_PEERS_IDENT] || [identifier isEqualToString: TAB_FILES_IDENT]; 87 88 [fTabView selectTabViewItemWithIdentifier: identifier]; 89 [self setWindowForTab: identifier animate: NO]; 88 int tag; 89 if ([identifier isEqualToString: TAB_INFO_IDENT]) 90 tag = TAB_INFO_TAG; 91 else if ([identifier isEqualToString: TAB_ACTIVITY_IDENT]) 92 tag = TAB_ACTIVITY_TAG; 93 else if ([identifier isEqualToString: TAB_PEERS_IDENT]) 94 tag = TAB_PEERS_TAG; 95 else if ([identifier isEqualToString: TAB_FILES_IDENT]) 96 tag = TAB_FILES_TAG; 97 else if ([identifier isEqualToString: TAB_OPTIONS_IDENT]) 98 tag = TAB_OPTIONS_TAG; 99 else //safety 100 { 101 [[NSUserDefaults standardUserDefaults] setObject: TAB_INFO_IDENT forKey: @"InspectorSelected"]; 102 tag = TAB_INFO_TAG; 103 } 104 [fTabMatrix selectCellWithTag: tag]; 105 [self setTab: nil]; 106 107 //set tab images and tooltips 108 [fTabBackBar setBackgroundImage: [NSImage imageNamed: @"InfoTabBorder.tif"]]; 109 [[fTabMatrix cellWithTag: TAB_INFO_TAG] setImage: [NSImage imageNamed: @"InfoGeneral.png"]]; 110 [[fTabMatrix cellWithTag: TAB_OPTIONS_TAG] setImage: [NSImage imageNamed: @"InfoOptions.png"]]; 111 112 [fTabMatrix setToolTip: NSLocalizedString(@"General Info", "Inspector -> tab tooltip") 113 forCell: [fTabMatrix cellWithTag: TAB_INFO_TAG]]; 114 [fTabMatrix setToolTip: NSLocalizedString(@"Activity", "Inspector -> tab tooltip") 115 forCell: [fTabMatrix cellWithTag: TAB_ACTIVITY_TAG]]; 116 [fTabMatrix setToolTip: NSLocalizedString(@"Peers", "Inspector -> tab tooltip") 117 forCell: [fTabMatrix cellWithTag: TAB_PEERS_TAG]]; 118 [fTabMatrix setToolTip: NSLocalizedString(@"Files", "Inspector -> tab tooltip") 119 forCell: [fTabMatrix cellWithTag: TAB_FILES_TAG]]; 120 [fTabMatrix setToolTip: NSLocalizedString(@"Options", "Inspector -> tab tooltip") 121 forCell: [fTabMatrix cellWithTag: TAB_OPTIONS_TAG]]; 90 122 91 123 //initially sort peer table by IP … … 113 145 { 114 146 if (fCanResizeVertical) 115 [[NSUserDefaults standardUserDefaults] setFloat: [[[fTabView selectedTabViewItem] view] frame].size.height 116 forKey: @"InspectorHeight"]; 147 [[NSUserDefaults standardUserDefaults] setFloat: [fCurrentView frame].size.height forKey: @"InspectorContentHeight"]; 117 148 118 149 [[NSNotificationCenter defaultCenter] removeObserver: self]; … … 340 371 - (void) updateInfoStats 341 372 { 342 NSString * ident = [[fTabView selectedTabViewItem] identifier]; 343 if ([ident isEqualToString: TAB_ACTIVITY_IDENT]) 344 [self updateInfoActivity]; 345 else if ([ident isEqualToString: TAB_PEERS_IDENT]) 346 [self updateInfoPeers]; 347 else if ([ident isEqualToString: TAB_INFO_IDENT]) 348 [self updateInfoGeneral]; 349 else if ([ident isEqualToString: TAB_FILES_IDENT]) 350 [self updateInfoFiles]; 351 else if ([ident isEqualToString: TAB_OPTIONS_IDENT]) 352 [self updateInfoSettings]; 353 else; 373 switch ([fTabMatrix selectedTag]) 374 { 375 case TAB_INFO_TAG: 376 [self updateInfoGeneral]; 377 break; 378 case TAB_ACTIVITY_TAG: 379 [self updateInfoActivity]; 380 break; 381 case TAB_PEERS_TAG: 382 [self updateInfoPeers]; 383 break; 384 case TAB_FILES_TAG: 385 [self updateInfoFiles]; 386 break; 387 case TAB_OPTIONS_TAG: 388 [self updateInfoOptions]; 389 break; 390 } 354 391 } 355 392 … … 493 530 } 494 531 495 - (void) updateInfo Settings532 - (void) updateInfoOptions 496 533 { 497 534 if ([fTorrents count] == 0) … … 625 662 if (action == @selector(revealFile:)) 626 663 { 627 if ( ![[[fTabView selectedTabViewItem] identifier] isEqualToString: TAB_FILES_IDENT])664 if ([fTabMatrix selectedTag] != TAB_FILES_TAG) 628 665 return NO; 629 666 … … 722 759 } 723 760 724 - (void) setWindowForTab: (NSString *) identifier animate: (BOOL) animate761 /*- (void) setWindowForTab: (NSString *) identifier animate: (BOOL) animate 725 762 { 726 763 [self updateInfoStats]; … … 773 810 774 811 fCanResizeVertical = canResizeVertical; 812 }*/ 813 814 - (void) setTab: (id) sender 815 { 816 [self updateInfoStats]; 817 818 BOOL oldCanResizeVertical = fCanResizeVertical; 819 820 NSView * view; 821 NSString * identifier; 822 switch ([fTabMatrix selectedTag]) 823 { 824 case TAB_INFO_TAG: 825 view = fInfoView; 826 identifier = TAB_INFO_IDENT; 827 fCanResizeVertical = NO; 828 break; 829 case TAB_ACTIVITY_TAG: 830 view = fActivityView; 831 identifier = TAB_ACTIVITY_IDENT; 832 fCanResizeVertical = NO; 833 834 [fPiecesView updateView: YES]; 835 break; 836 case TAB_PEERS_TAG: 837 view = fPeersView; 838 identifier = TAB_PEERS_IDENT; 839 fCanResizeVertical = YES; 840 break; 841 case TAB_FILES_TAG: 842 view = fFilesView; 843 identifier = TAB_FILES_IDENT; 844 fCanResizeVertical = YES; 845 break; 846 case TAB_OPTIONS_TAG: 847 view = fOptionsView; 848 identifier = TAB_OPTIONS_IDENT; 849 fCanResizeVertical = NO; 850 break; 851 default: 852 return; 853 } 854 855 [[NSUserDefaults standardUserDefaults] setObject: identifier forKey: @"InspectorSelected"]; 856 857 NSWindow * window = [self window]; 858 859 float oldHeight = 0; 860 if (fCurrentView) 861 { 862 if (fCurrentView == view) 863 return; 864 865 [fCurrentView setHidden: YES]; 866 [fCurrentView removeFromSuperview]; 867 868 oldHeight = [fCurrentView frame].size.height; 869 } 870 871 NSRect windowRect = [window frame], viewRect = [view frame]; 872 873 //save old size 874 if (oldCanResizeVertical) 875 [[NSUserDefaults standardUserDefaults] setFloat: [fCurrentView frame].size.height forKey: @"InspectorContentHeight"]; 876 877 if (fCanResizeVertical) 878 { 879 float height = [[NSUserDefaults standardUserDefaults] floatForKey: @"InspectorContentHeight"]; 880 if (height != 0) 881 viewRect.size.height = MAX(height, TAB_MIN_HEIGHT); 882 } 883 884 float difference = (viewRect.size.height - oldHeight) * [window userSpaceScaleFactor]; 885 windowRect.origin.y -= difference; 886 windowRect.size.height += difference; 887 888 if (fCanResizeVertical) 889 { 890 if (!oldCanResizeVertical) 891 { 892 [window setMinSize: NSMakeSize([window minSize].width, windowRect.size.height - viewRect.size.height + TAB_MIN_HEIGHT)]; 893 [window setMaxSize: NSMakeSize(FLT_MAX, FLT_MAX)]; 894 } 895 } 896 else 897 { 898 [window setMinSize: NSMakeSize([window minSize].width, windowRect.size.height)]; 899 [window setMaxSize: NSMakeSize(FLT_MAX, windowRect.size.height)]; 900 } 901 902 viewRect.size.width = windowRect.size.width; 903 [view setFrame: viewRect]; 904 905 [window setFrame: windowRect display: YES animate: fCurrentView != nil]; 906 [[window contentView] addSubview: view]; 907 [view setHidden: NO]; 908 909 fCurrentView = view; 775 910 } 776 911 777 912 - (void) setNextTab 778 913 { 779 if ([fTabView selectedTabViewItem] == [fTabView tabViewItemAtIndex: [fTabView numberOfTabViewItems] - 1]) 780 [fTabView selectFirstTabViewItem: nil]; 781 else 782 [fTabView selectNextTabViewItem: nil]; 914 int tag = [fTabMatrix selectedTag]+1; 915 if (tag >= [fTabMatrix numberOfColumns]) 916 tag = 0; 917 918 [fTabMatrix selectCellWithTag: tag]; 919 [self setTab: nil]; 783 920 } 784 921 785 922 - (void) setPreviousTab 786 923 { 787 if ([fTabView selectedTabViewItem] == [fTabView tabViewItemAtIndex: 0]) 788 [fTabView selectLastTabViewItem: nil]; 789 else 790 [fTabView selectPreviousTabViewItem: nil]; 924 int tag = [fTabMatrix selectedTag]-1; 925 if (tag < 0) 926 tag = [fTabMatrix numberOfColumns]-1; 927 928 [fTabMatrix selectCellWithTag: tag]; 929 [self setTab: nil]; 791 930 } 792 931 … … 1028 1167 } 1029 1168 1030 - (void) mouseMoved: (NSEvent *) event1169 /*- (void) mouseMoved: (NSEvent *) event 1031 1170 { 1032 1171 [fFileOutline setHoverRowForEvent: [[[fTabView selectedTabViewItem] identifier] isEqualToString: TAB_FILES_IDENT] 1033 1172 ? event : nil]; 1034 } 1173 }*/ 1035 1174 1036 1175 - (void) setPiecesView: (id) sender
Note: See TracChangeset
for help on using the changeset viewer.