From cda725f49a70410df1ecb480ef204616f58b1091 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Mon, 21 Sep 2009 22:45:19 +0000 Subject: [PATCH] add a placeholder favicon for trackers --- Transmission.xcodeproj/project.pbxproj | 4 ++++ macosx/InfoWindowController.m | 6 +++--- macosx/en.lproj/InfoWindow.xib | 15 ++++++++------- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/Transmission.xcodeproj/project.pbxproj b/Transmission.xcodeproj/project.pbxproj index d7e0970ab..b3a1b5012 100644 --- a/Transmission.xcodeproj/project.pbxproj +++ b/Transmission.xcodeproj/project.pbxproj @@ -124,6 +124,7 @@ A257C1820CAD3003004E121C /* PeerTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = A257C1800CAD3003004E121C /* PeerTableView.m */; }; A25892640CF1F7E800CCCDDF /* StatsWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = A25892630CF1F7E800CCCDDF /* StatsWindowController.m */; }; A259317E0A73B2CC002F4FE7 /* TransmissionHelp in Resources */ = {isa = PBXBuildFile; fileRef = A259316A0A73B2CC002F4FE7 /* TransmissionHelp */; }; + A25963E11068376200453B31 /* FavIcon.png in Resources */ = {isa = PBXBuildFile; fileRef = A25963E01068376200453B31 /* FavIcon.png */; }; A25D2CBD0CF4C73E0096A262 /* stats.c in Sources */ = {isa = PBXBuildFile; fileRef = A25D2CBB0CF4C7190096A262 /* stats.c */; }; A25D2CBE0CF4C73E0096A262 /* stats.h in Headers */ = {isa = PBXBuildFile; fileRef = A25D2CBA0CF4C7190096A262 /* stats.h */; }; A25E03D90E4015100086C225 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; @@ -551,6 +552,7 @@ A25892620CF1F7E800CCCDDF /* StatsWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StatsWindowController.h; path = macosx/StatsWindowController.h; sourceTree = ""; }; A25892630CF1F7E800CCCDDF /* StatsWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = StatsWindowController.m; path = macosx/StatsWindowController.m; sourceTree = ""; }; A259316A0A73B2CC002F4FE7 /* TransmissionHelp */ = {isa = PBXFileReference; lastKnownFileType = folder; name = TransmissionHelp; path = macosx/TransmissionHelp; sourceTree = ""; }; + A25963E01068376200453B31 /* FavIcon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = FavIcon.png; path = macosx/Images/FavIcon.png; sourceTree = ""; }; A25D2CBA0CF4C7190096A262 /* stats.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = stats.h; path = libtransmission/stats.h; sourceTree = ""; }; A25D2CBB0CF4C7190096A262 /* stats.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = stats.c; path = libtransmission/stats.c; sourceTree = ""; }; A25E03E00E4015380086C225 /* tr-getopt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "tr-getopt.h"; path = "libtransmission/tr-getopt.h"; sourceTree = ""; }; @@ -1070,6 +1072,7 @@ 4DA6FDC3091141AD00450CB1 /* ResumeOff.png */, 4DA6FDC4091141AD00450CB1 /* ResumeOn.png */, A2623B3D0D3DC5930045D19A /* ResumeHover.png */, + A25963E01068376200453B31 /* FavIcon.png */, 4DDFDD20099A5D8E00189D81 /* DownloadBadge.png */, 4DDFDD21099A5D8E00189D81 /* UploadBadge.png */, A24B655F0D3F30870079EA4D /* QuitBadge.png */, @@ -1811,6 +1814,7 @@ A22F1E550E7DA8030065DB9D /* sparkle_dsa_pub.pem in Resources */, A2E2EA920EE321C200EB6308 /* Groups.png in Resources */, A215BF5C0F02EBB800350CDB /* GroupRules.xib in Resources */, + A25963E11068376200453B31 /* FavIcon.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/macosx/InfoWindowController.m b/macosx/InfoWindowController.m index 14b2476a9..0612132cd 100644 --- a/macosx/InfoWindowController.m +++ b/macosx/InfoWindowController.m @@ -928,7 +928,7 @@ typedef enum NSURL * address = [NSURL URLWithString: item]; NSArray * hostComponents = [[address host] componentsSeparatedByString: @"."]; - //let's try getting the favicon without using any subdomains + //let's try getting the tracker address without using any subdomains NSString * baseAddress; if ([hostComponents count] > 1) baseAddress = [NSString stringWithFormat: @"%@://%@.%@", [address scheme], @@ -943,7 +943,7 @@ typedef enum [NSThread detachNewThreadSelector: @selector(loadTrackerIcon:) toTarget: self withObject: baseAddress]; } - return (icon && icon != [NSNull null]) ? icon : nil; + return (icon && icon != [NSNull null]) ? icon : [NSImage imageNamed: @"FavIcon.png"]; } if ([ident isEqualToString: @"Address"]) return item; @@ -957,7 +957,7 @@ typedef enum { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; - NSURL * favIconUrl = [NSURL URLWithString: [baseAddress stringByAppendingString: @"/favicon.ico"]]; + NSURL * favIconUrl = [NSURL URLWithString: [baseAddress stringByAppendingPathComponent: @"favicon.ico"]]; NSImage * icon = [[NSImage alloc] initWithContentsOfURL: favIconUrl]; if (icon) { diff --git a/macosx/en.lproj/InfoWindow.xib b/macosx/en.lproj/InfoWindow.xib index 0036264b9..e59b5e70d 100644 --- a/macosx/en.lproj/InfoWindow.xib +++ b/macosx/en.lproj/InfoWindow.xib @@ -12,7 +12,7 @@ YES - + YES @@ -2021,7 +2021,7 @@ AAB0ZXh0AAAAAENvcHlyaWdodCBBcHBsZSBDb21wdXRlciwgSW5jLiwgMjAwNQAAAAA 256 - {360, 143} + {363, 143} YES @@ -2033,9 +2033,9 @@ AAB0ZXh0AAAAAENvcHlyaWdodCBBcHBsZSBDb21wdXRlciwgSW5jLiwgMjAwNQAAAAA YES Icon - 14 - 14 - 14 + 17 + 17 + 17 75628096 2048 @@ -2058,7 +2058,7 @@ AAB0ZXh0AAAAAENvcHlyaWdodCBBcHBsZSBDb21wdXRlciwgSW5jLiwgMjAwNQAAAAA 67239424 33554432 - 0 + 8 3 0 NO @@ -2153,6 +2153,7 @@ AAB0ZXh0AAAAAENvcHlyaWdodCBBcHBsZSBDb21wdXRlciwgSW5jLiwgMjAwNQAAAAA -2147483392 {{-100, -100}, {372, 15}} + YES 1 _doScroller: @@ -2163,7 +2164,7 @@ AAB0ZXh0AAAAAENvcHlyaWdodCBBcHBsZSBDb21wdXRlciwgSW5jLiwgMjAwNQAAAAA {{10, 202}, {362, 145}} - 530 + 658