From 9453048522d406fc4854a67a2aeeed5e30956340 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Tue, 31 Jul 2007 00:45:39 +0000 Subject: [PATCH] don't allow comment and creator fields to be selected when empty --- Transmission.xcodeproj/project.pbxproj | 2 +- macosx/InfoWindowController.m | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Transmission.xcodeproj/project.pbxproj b/Transmission.xcodeproj/project.pbxproj index 30ebf23af..835a0f7ed 100644 --- a/Transmission.xcodeproj/project.pbxproj +++ b/Transmission.xcodeproj/project.pbxproj @@ -320,7 +320,7 @@ 4DFBC2DD09C0970D00D5C571 /* Torrent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Torrent.h; path = macosx/Torrent.h; sourceTree = ""; }; 4DFBC2DE09C0970D00D5C571 /* Torrent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Torrent.m; path = macosx/Torrent.m; sourceTree = ""; }; 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; name = Info.plist; path = macosx/Info.plist; sourceTree = ""; }; - 8D1107320486CEB800E47090 /* Transmission.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = Transmission.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 8D1107320486CEB800E47090 /* Transmission.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Transmission.app; sourceTree = BUILT_PRODUCTS_DIR; }; A200B8390A2263BA007BBB1E /* InfoWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InfoWindowController.h; path = macosx/InfoWindowController.h; sourceTree = ""; }; A200B83A0A2263BA007BBB1E /* InfoWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = InfoWindowController.m; path = macosx/InfoWindowController.m; sourceTree = ""; }; A200B9630A227FD0007BBB1E /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = macosx/English.lproj/InfoWindow.nib; sourceTree = ""; }; diff --git a/macosx/InfoWindowController.m b/macosx/InfoWindowController.m index e40a7f5db..b187d4940 100644 --- a/macosx/InfoWindowController.m +++ b/macosx/InfoWindowController.m @@ -234,8 +234,7 @@ [fNameField setToolTip: name]; [fSizeField setStringValue: [NSString stringForFileSize: [torrent size]]]; - NSString * hashString = [torrent hashString], - * commentString = [torrent comment]; + NSString * hashString = [torrent hashString]; [fPiecesField setStringValue: [NSString stringWithFormat: @"%d, %@", [torrent pieceCount], [NSString stringForFileSize: [torrent pieceSize]]]]; [fHashField setStringValue: hashString]; @@ -243,9 +242,12 @@ [fSecureField setStringValue: [torrent privateTorrent] ? NSLocalizedString(@"Private Torrent, PEX disabled", "Inspector -> is private torrent") : NSLocalizedString(@"Public Torrent", "Inspector -> is not private torrent")]; + + NSString * commentString = [torrent comment]; [fCommentView setString: commentString]; - [fCreatorField setStringValue: [torrent creator]]; + NSString * creatorString = [torrent creator]; + [fCreatorField setStringValue: creatorString]; [fDateCreatedField setObjectValue: [torrent dateCreated]]; BOOL publicTorrent = [torrent publicTorrent]; @@ -266,8 +268,8 @@ //allow these fields to be selected [fTrackerField setSelectable: YES]; [fHashField setSelectable: YES]; - [fCommentView setSelectable: YES]; - [fCreatorField setSelectable: YES]; + [fCommentView setSelectable: ![commentString isEqualToString: @""]]; + [fCreatorField setSelectable: ![creatorString isEqualToString: @""]]; [fTorrentLocationField setSelectable: YES]; [fDataLocationField setSelectable: YES];