From: Mitchell Livingston Date: Sat, 19 Dec 2009 20:15:16 +0000 (+0000) Subject: #2594 Make all inspector fields selectable X-Git-Tag: 1.80b5~105 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=64696d57146bad1feaa545a3719cfe2fd1de2147;p=transmission #2594 Make all inspector fields selectable --- diff --git a/Transmission.xcodeproj/project.pbxproj b/Transmission.xcodeproj/project.pbxproj index 8b25d98ad..5f4174ec4 100644 --- a/Transmission.xcodeproj/project.pbxproj +++ b/Transmission.xcodeproj/project.pbxproj @@ -153,6 +153,7 @@ A2623B410D3DC5930045D19A /* ResumeHover.png in Resources */ = {isa = PBXBuildFile; fileRef = A2623B3D0D3DC5930045D19A /* ResumeHover.png */; }; A2623B420D3DC5930045D19A /* PauseHover.png in Resources */ = {isa = PBXBuildFile; fileRef = A2623B3E0D3DC5930045D19A /* PauseHover.png */; }; A2623B4E0D3DC6DF0045D19A /* ActionHover.png in Resources */ = {isa = PBXBuildFile; fileRef = A2623B4D0D3DC6DF0045D19A /* ActionHover.png */; }; + A263CFC010DD67670038DE27 /* InfoTextField.m in Sources */ = {isa = PBXBuildFile; fileRef = A263CFBF10DD67670038DE27 /* InfoTextField.m */; }; A26AF21A0D2DA35A00FF7140 /* FileOutlineController.m in Sources */ = {isa = PBXBuildFile; fileRef = A26AF2190D2DA35A00FF7140 /* FileOutlineController.m */; }; A26AF27E0D2DBDDF00FF7140 /* AddWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = A26AF27C0D2DBDDF00FF7140 /* AddWindow.xib */; }; A26AF2840D2DC27C00FF7140 /* AddWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = A26AF2830D2DC27C00FF7140 /* AddWindowController.m */; }; @@ -585,6 +586,8 @@ A2623B3D0D3DC5930045D19A /* ResumeHover.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ResumeHover.png; path = macosx/Images/ResumeHover.png; sourceTree = ""; }; A2623B3E0D3DC5930045D19A /* PauseHover.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PauseHover.png; path = macosx/Images/PauseHover.png; sourceTree = ""; }; A2623B4D0D3DC6DF0045D19A /* ActionHover.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ActionHover.png; path = macosx/Images/ActionHover.png; sourceTree = ""; }; + A263CFBE10DD67670038DE27 /* InfoTextField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InfoTextField.h; path = macosx/InfoTextField.h; sourceTree = ""; }; + A263CFBF10DD67670038DE27 /* InfoTextField.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = InfoTextField.m; path = macosx/InfoTextField.m; sourceTree = ""; }; A265A32E0D25767700198AC8 /* fr */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = fr; path = macosx/fr.lproj/Creator.xib; sourceTree = ""; }; A265A32F0D25767700198AC8 /* fr */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = fr; path = macosx/fr.lproj/InfoWindow.xib; sourceTree = ""; }; A265A3300D25767700198AC8 /* fr */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = fr; path = macosx/fr.lproj/MainMenu.xib; sourceTree = ""; }; @@ -1394,6 +1397,8 @@ A2725D5C0DE7507C003445E7 /* TrackerTableView.m */, A21A9D3F106EC2E800F1C3C1 /* TrackerCell.h */, A21A9D40106EC2E800F1C3C1 /* TrackerCell.m */, + A263CFBE10DD67670038DE27 /* InfoTextField.h */, + A263CFBF10DD67670038DE27 /* InfoTextField.m */, ); name = "Info Window"; sourceTree = ""; @@ -2011,6 +2016,7 @@ A29D84041049C25600D1987A /* NSApplicationAdditions.m in Sources */, A21A9BE2106D86A800F1C3C1 /* TrackerNode.m in Sources */, A21A9D41106EC2E800F1C3C1 /* TrackerCell.m in Sources */, + A263CFC010DD67670038DE27 /* InfoTextField.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/macosx/InfoTextField.h b/macosx/InfoTextField.h new file mode 100644 index 000000000..4c219ab5c --- /dev/null +++ b/macosx/InfoTextField.h @@ -0,0 +1,29 @@ +/****************************************************************************** + * $Id$ + * + * Copyright (c) 2009 Transmission authors and contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + *****************************************************************************/ + +#import + +@interface InfoTextField : NSTextField + +@end diff --git a/macosx/InfoTextField.m b/macosx/InfoTextField.m new file mode 100644 index 000000000..e98a3e038 --- /dev/null +++ b/macosx/InfoTextField.m @@ -0,0 +1,43 @@ +/****************************************************************************** + * $Id$ + * + * Copyright (c) 2009 Transmission authors and contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + *****************************************************************************/ + +#import "InfoTextField.h" + +@implementation InfoTextField + +- (void) setStringValue: (NSString *) string +{ + [super setStringValue: string]; + + [self setSelectable: ![[self stringValue] isEqualToString: @""]]; +} + +- (void)setObjectValue: (id < NSCopying >) object +{ + [super setObjectValue: object]; + + [self setSelectable: ![[self stringValue] isEqualToString: @""]]; +} + +@end diff --git a/macosx/InfoWindowController.m b/macosx/InfoWindowController.m index 5d8a5c44d..632811d90 100644 --- a/macosx/InfoWindowController.m +++ b/macosx/InfoWindowController.m @@ -1260,23 +1260,16 @@ typedef enum [fCreatorField setStringValue: @""]; [fDateCreatedField setStringValue: @""]; - [fCommentView setSelectable: NO]; [fDataLocationField setStringValue: @""]; [fDataLocationField setToolTip: nil]; [fRevealDataButton setHidden: YES]; - //don't allow empty fields to be selected - [fHashField setSelectable: NO]; - [fCreatorField setSelectable: NO]; - [fDataLocationField setSelectable: NO]; - [fStateField setStringValue: @""]; [fProgressField setStringValue: @""]; [fErrorMessageView setString: @""]; - [fErrorMessageView setSelectable: NO]; [fConnectedPeersField setStringValue: @""]; @@ -1373,11 +1366,6 @@ typedef enum [fDateAddedField setObjectValue: [torrent dateAdded]]; - //allow these fields to be selected - [fHashField setSelectable: YES]; - [fCommentView setSelectable: ![commentString isEqualToString: @""]]; - [fCreatorField setSelectable: ![creatorString isEqualToString: @""]]; - //set pieces view BOOL piecesAvailableSegment = [[NSUserDefaults standardUserDefaults] boolForKey: @"PiecesViewShowAvailability"]; [fPiecesControl setSelected: piecesAvailableSegment forSegment: PIECES_CONTROL_AVAILABLE]; @@ -1426,7 +1414,6 @@ typedef enum NSString * location = [torrent dataLocation]; [fDataLocationField setStringValue: location ? [location stringByAbbreviatingWithTildeInPath] : @""]; [fDataLocationField setToolTip: location ? location : @""]; - [fDataLocationField setSelectable: location != nil]; [fRevealDataButton setHidden: !location]; } @@ -1486,10 +1473,7 @@ typedef enum NSString * errorMessage = [torrent errorMessage]; if (![errorMessage isEqualToString: [fErrorMessageView string]]) - { [fErrorMessageView setString: errorMessage]; - [fErrorMessageView setSelectable: ![errorMessage isEqualToString: @""]]; - } [fDateCompletedField setObjectValue: [torrent dateCompleted]]; diff --git a/macosx/Makefile.am b/macosx/Makefile.am index 4f741e79c..d31a61006 100644 --- a/macosx/Makefile.am +++ b/macosx/Makefile.am @@ -73,6 +73,8 @@ EXTRA_DIST = \ GroupToolbarItem.m \ InfoTabButtonCell.h \ InfoTabButtonCell.m \ + InfoTextField.h \ + InfoTextField.m \ InfoWindowController.h \ InfoWindowController.m \ main.m \ diff --git a/macosx/en.lproj/InfoWindow.xib b/macosx/en.lproj/InfoWindow.xib index 79c4f104d..97f140395 100644 --- a/macosx/en.lproj/InfoWindow.xib +++ b/macosx/en.lproj/InfoWindow.xib @@ -12,9 +12,8 @@ YES - - + @@ -54,7 +53,7 @@ {1.79769e+308, 1.79769e+308} {350, 73} - + 256 YES @@ -63,6 +62,7 @@ 266 {{47, 47}, {296, 17}} + YES 67239488 @@ -111,6 +111,7 @@ {{10, 32}, {32, 32}} + YES 130560 @@ -131,6 +132,7 @@ 266 {{47, 33}, {296, 14}} + YES 67239424 @@ -151,6 +153,7 @@ 264 {330, 25} + YES 1 6 @@ -402,6 +405,7 @@ AAB0ZXh0AAAAAENvcHlyaWdodCBBcHBsZSBDb21wdXRlciwgSW5jLiwgMjAwNQAAAAA {{330, 0}, {20, 25}} + YES 130560 @@ -419,6 +423,8 @@ AAB0ZXh0AAAAAENvcHlyaWdodCBBcHBsZSBDb21wdXRlciwgSW5jLiwgMjAwNQAAAAA {350, 75} + + {{0, 0}, {1680, 1028}} {350, 89} @@ -1545,7 +1551,7 @@ AAB0ZXh0AAAAAENvcHlyaWdodCBBcHBsZSBDb21wdXRlciwgSW5jLiwgMjAwNQAAAAA NSResponder - + 274 YES @@ -1642,7 +1648,6 @@ AAB0ZXh0AAAAAENvcHlyaWdodCBBcHBsZSBDb21wdXRlciwgSW5jLiwgMjAwNQAAAAA {{1, 1}, {360, 315}} - 2 @@ -1671,7 +1676,6 @@ AAB0ZXh0AAAAAENvcHlyaWdodCBBcHBsZSBDb21wdXRlciwgSW5jLiwgMjAwNQAAAAA {{10, 30}, {362, 317}} - 530 @@ -1717,7 +1721,6 @@ AAB0ZXh0AAAAAENvcHlyaWdodCBBcHBsZSBDb21wdXRlciwgSW5jLiwgMjAwNQAAAAA {382, 352} - NSView @@ -2556,7 +2559,6 @@ AAAAAAAAAAAAAAAAAAB0ZXh0AAAAAENvcHlyaWdodCBBcHBsZSwgSW5jLiwgMjAwOQA {{1, 1}, {307, 324}} - 4 @@ -2584,7 +2586,6 @@ AAAAAAAAAAAAAAAAAAB0ZXh0AAAAAENvcHlyaWdodCBBcHBsZSwgSW5jLiwgMjAwOQA {{10, 34}, {320, 326}} - 18 @@ -4096,7 +4097,6 @@ AAAAAAAAAAAAAAAAAAB0ZXh0AAAAAENvcHlyaWdodCBBcHBsZSwgSW5jLiwgMjAwOQA - @@ -4111,6 +4111,7 @@ AAAAAAAAAAAAAAAAAAB0ZXh0AAAAAENvcHlyaWdodCBBcHBsZSwgSW5jLiwgMjAwOQA + Info @@ -5671,14 +5672,17 @@ AAAAAAAAAAAAAAAAAAB0ZXh0AAAAAENvcHlyaWdodCBBcHBsZSwgSW5jLiwgMjAwOQA -3.ImportedFromIB2 1000.IBPluginDependency 1000.ImportedFromIB2 + 1001.CustomClassName 1001.IBPluginDependency 1001.ImportedFromIB2 1002.IBPluginDependency 1002.ImportedFromIB2 + 1003.CustomClassName 1003.IBPluginDependency 1003.ImportedFromIB2 1004.IBPluginDependency 1004.ImportedFromIB2 + 1005.CustomClassName 1005.IBPluginDependency 1005.ImportedFromIB2 1008.CustomClassName @@ -5694,12 +5698,14 @@ AAAAAAAAAAAAAAAAAAB0ZXh0AAAAAENvcHlyaWdodCBBcHBsZSwgSW5jLiwgMjAwOQA 1012.ImportedFromIB2 1013.IBPluginDependency 1013.ImportedFromIB2 + 1014.CustomClassName 1014.IBPluginDependency 1014.ImportedFromIB2 1015.IBPluginDependency 1015.ImportedFromIB2 1016.IBPluginDependency 1016.ImportedFromIB2 + 1017.CustomClassName 1017.IBPluginDependency 1017.ImportedFromIB2 1018.IBPluginDependency @@ -5712,6 +5718,7 @@ AAAAAAAAAAAAAAAAAAB0ZXh0AAAAAENvcHlyaWdodCBBcHBsZSwgSW5jLiwgMjAwOQA 1021.ImportedFromIB2 1022.IBPluginDependency 1022.ImportedFromIB2 + 1023.CustomClassName 1023.IBPluginDependency 1023.ImportedFromIB2 1024.IBPluginDependency @@ -5720,10 +5727,12 @@ AAAAAAAAAAAAAAAAAAB0ZXh0AAAAAENvcHlyaWdodCBBcHBsZSwgSW5jLiwgMjAwOQA 1025.ImportedFromIB2 1026.IBPluginDependency 1026.ImportedFromIB2 + 1027.CustomClassName 1027.IBPluginDependency 1027.ImportedFromIB2 1028.IBPluginDependency 1028.ImportedFromIB2 + 1029.CustomClassName 1029.IBPluginDependency 1029.ImportedFromIB2 1030.IBEditorWindowLastContentRect @@ -6008,6 +6017,7 @@ AAAAAAAAAAAAAAAAAAB0ZXh0AAAAAENvcHlyaWdodCBBcHBsZSwgSW5jLiwgMjAwOQA 965.editorWindowContentRectSynchronizationRect 967.IBPluginDependency 967.ImportedFromIB2 + 969.CustomClassName 969.IBPluginDependency 969.ImportedFromIB2 970.IBPluginDependency @@ -6018,10 +6028,12 @@ AAAAAAAAAAAAAAAAAAB0ZXh0AAAAAENvcHlyaWdodCBBcHBsZSwgSW5jLiwgMjAwOQA 972.ImportedFromIB2 973.IBPluginDependency 973.ImportedFromIB2 + 974.CustomClassName 974.IBPluginDependency 974.ImportedFromIB2 976.IBPluginDependency 976.ImportedFromIB2 + 977.CustomClassName 977.IBPluginDependency 977.ImportedFromIB2 979.IBPluginDependency @@ -6030,10 +6042,12 @@ AAAAAAAAAAAAAAAAAAB0ZXh0AAAAAENvcHlyaWdodCBBcHBsZSwgSW5jLiwgMjAwOQA 981.ImportedFromIB2 982.IBPluginDependency 982.ImportedFromIB2 + 983.CustomClassName 983.IBPluginDependency 983.ImportedFromIB2 984.IBPluginDependency 984.ImportedFromIB2 + 985.CustomClassName 985.IBPluginDependency 985.ImportedFromIB2 986.IBDateFormatterBehaviorMetadataKey @@ -6043,6 +6057,7 @@ AAAAAAAAAAAAAAAAAAB0ZXh0AAAAAENvcHlyaWdodCBBcHBsZSwgSW5jLiwgMjAwOQA 990.ImportedFromIB2 993.IBPluginDependency 993.ImportedFromIB2 + 994.CustomClassName 994.IBPluginDependency 994.ImportedFromIB2 995.IBEditorWindowLastContentRect @@ -6051,10 +6066,12 @@ AAAAAAAAAAAAAAAAAAB0ZXh0AAAAAENvcHlyaWdodCBBcHBsZSwgSW5jLiwgMjAwOQA 995.editorWindowContentRectSynchronizationRect 996.IBPluginDependency 996.ImportedFromIB2 + 997.CustomClassName 997.IBPluginDependency 997.ImportedFromIB2 998.IBPluginDependency 998.ImportedFromIB2 + 999.CustomClassName 999.IBPluginDependency 999.ImportedFromIB2 @@ -6064,14 +6081,17 @@ AAAAAAAAAAAAAAAAAAB0ZXh0AAAAAENvcHlyaWdodCBBcHBsZSwgSW5jLiwgMjAwOQA com.apple.InterfaceBuilder.CocoaPlugin + InfoTextField com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + InfoTextField com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + InfoTextField com.apple.InterfaceBuilder.CocoaPlugin PiecesView @@ -6087,12 +6107,14 @@ AAAAAAAAAAAAAAAAAAB0ZXh0AAAAAENvcHlyaWdodCBBcHBsZSwgSW5jLiwgMjAwOQA com.apple.InterfaceBuilder.CocoaPlugin + InfoTextField com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + InfoTextField com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -6105,6 +6127,7 @@ AAAAAAAAAAAAAAAAAAB0ZXh0AAAAAENvcHlyaWdodCBBcHBsZSwgSW5jLiwgMjAwOQA com.apple.InterfaceBuilder.CocoaPlugin + InfoTextField com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -6113,10 +6136,12 @@ AAAAAAAAAAAAAAAAAAB0ZXh0AAAAAENvcHlyaWdodCBBcHBsZSwgSW5jLiwgMjAwOQA com.apple.InterfaceBuilder.CocoaPlugin + InfoTextField com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + InfoTextField com.apple.InterfaceBuilder.CocoaPlugin {{460, 509}, {358, 346}} @@ -6401,6 +6426,7 @@ AAAAAAAAAAAAAAAAAAB0ZXh0AAAAAENvcHlyaWdodCBBcHBsZSwgSW5jLiwgMjAwOQA {{519, 533}, {350, 268}} com.apple.InterfaceBuilder.CocoaPlugin + InfoTextField com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -6411,10 +6437,12 @@ AAAAAAAAAAAAAAAAAAB0ZXh0AAAAAENvcHlyaWdodCBBcHBsZSwgSW5jLiwgMjAwOQA com.apple.InterfaceBuilder.CocoaPlugin + InfoTextField com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + InfoTextField com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -6423,10 +6451,12 @@ AAAAAAAAAAAAAAAAAAB0ZXh0AAAAAENvcHlyaWdodCBBcHBsZSwgSW5jLiwgMjAwOQA com.apple.InterfaceBuilder.CocoaPlugin + InfoTextField com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + InfoTextField com.apple.InterfaceBuilder.CocoaPlugin @@ -6436,6 +6466,7 @@ AAAAAAAAAAAAAAAAAAB0ZXh0AAAAAENvcHlyaWdodCBBcHBsZSwgSW5jLiwgMjAwOQA com.apple.InterfaceBuilder.CocoaPlugin + InfoTextField com.apple.InterfaceBuilder.CocoaPlugin {{409, 647}, {360, 275}} @@ -6444,10 +6475,12 @@ AAAAAAAAAAAAAAAAAAB0ZXh0AAAAAENvcHlyaWdodCBBcHBsZSwgSW5jLiwgMjAwOQA {{274, 636}, {360, 290}} com.apple.InterfaceBuilder.CocoaPlugin + InfoTextField com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + InfoTextField com.apple.InterfaceBuilder.CocoaPlugin @@ -6558,6 +6591,14 @@ AAAAAAAAAAAAAAAAAAB0ZXh0AAAAAENvcHlyaWdodCBBcHBsZSwgSW5jLiwgMjAwOQA + + InfoTextField + NSTextField + + IBProjectSource + macosx/InfoTextField.h + + InfoWindowController NSWindowController