]> granicus.if.org Git - transmission/commitdiff
mac changes for #377, number one (it doesn't compile yet)
authorMitchell Livingston <livings124@transmissionbt.com>
Thu, 24 Apr 2008 01:55:33 +0000 (01:55 +0000)
committerMitchell Livingston <livings124@transmissionbt.com>
Thu, 24 Apr 2008 01:55:33 +0000 (01:55 +0000)
Transmission.xcodeproj/project.pbxproj
macosx/Badger.m
macosx/Controller.m
macosx/CreatorWindowController.m
macosx/Torrent.m

index 874597c0defada9fb7e9790c9e9782841a0c0f23..998fe3f7c06b6d441a31deb98c4ca412685049f9 100644 (file)
                A29DF8BD0DB2545A00D04E5A /* ggets.h in Headers */ = {isa = PBXBuildFile; fileRef = A2D307920D9EC4800051FD27 /* ggets.h */; };
                A29DF8BE0DB2545F00D04E5A /* verify.h in Headers */ = {isa = PBXBuildFile; fileRef = A2D22A110D65EED100007D5F /* verify.h */; };
                A29E04B50DA8764100705643 /* Network.png in Resources */ = {isa = PBXBuildFile; fileRef = A29E04B40DA8764100705643 /* Network.png */; };
+               A29EBE540DC01FC9006CEE80 /* web.c in Sources */ = {isa = PBXBuildFile; fileRef = A29EBE520DC01FC9006CEE80 /* web.c */; };
+               A29EBE550DC01FC9006CEE80 /* web.h in Headers */ = {isa = PBXBuildFile; fileRef = A29EBE530DC01FC9006CEE80 /* web.h */; };
                A2A1CB7A0BF29D5500AE959F /* PeerProgressIndicatorCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A2A1CB780BF29D5500AE959F /* PeerProgressIndicatorCell.m */; };
                A2A3065C0AAD24A80049E2AC /* UKFileWatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = A2A306540AAD24A80049E2AC /* UKFileWatcher.m */; };
                A2A3065E0AAD24A80049E2AC /* UKFNSubscribeFileWatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = A2A306560AAD24A80049E2AC /* UKFNSubscribeFileWatcher.m */; };
                A29DF8B70DB2544C00D04E5A /* resume.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = resume.h; path = libtransmission/resume.h; sourceTree = "<group>"; };
                A29DF8B80DB2544C00D04E5A /* torrent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = torrent.h; path = libtransmission/torrent.h; sourceTree = "<group>"; };
                A29E04B40DA8764100705643 /* Network.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Network.png; path = macosx/Images/Network.png; sourceTree = "<group>"; };
+               A29EBE520DC01FC9006CEE80 /* web.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = web.c; path = libtransmission/web.c; sourceTree = "<group>"; };
+               A29EBE530DC01FC9006CEE80 /* web.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = web.h; path = libtransmission/web.h; sourceTree = "<group>"; };
                A2A1CB770BF29D5500AE959F /* PeerProgressIndicatorCell.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PeerProgressIndicatorCell.h; path = macosx/PeerProgressIndicatorCell.h; sourceTree = "<group>"; };
                A2A1CB780BF29D5500AE959F /* PeerProgressIndicatorCell.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = PeerProgressIndicatorCell.m; path = macosx/PeerProgressIndicatorCell.m; sourceTree = "<group>"; };
                A2A306530AAD24A80049E2AC /* UKFileWatcher.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = UKFileWatcher.h; path = macosx/UKKQueue/UKFileWatcher.h; sourceTree = "<group>"; };
                BE75C3570C72A0D600DBEFE0 /* libevent */ = {
                        isa = PBXGroup;
                        children = (
+                               A29EBE520DC01FC9006CEE80 /* web.c */,
+                               A29EBE530DC01FC9006CEE80 /* web.h */,
                                A2BC19DF0CA9D82300DD302A /* evutil.h */,
                                4D36BBC80CA309AA00A63CA5 /* evutil.c */,
                                BE75C3810C72A1C100DBEFE0 /* evhttp.h */,
                                A29DF8BB0DB2544C00D04E5A /* torrent.h in Headers */,
                                A29DF8BD0DB2545A00D04E5A /* ggets.h in Headers */,
                                A29DF8BE0DB2545F00D04E5A /* verify.h in Headers */,
+                               A29EBE550DC01FC9006CEE80 /* web.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                4D4ADFC70DA1631500A68297 /* blocklist.c in Sources */,
                                A29DF8B90DB2544C00D04E5A /* resume.c in Sources */,
                                A29DF8BC0DB2545900D04E5A /* ggets.c in Sources */,
+                               A29EBE540DC01FC9006CEE80 /* web.c in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index 833a7460a597183908ae2a2e0f72bf25811a0d09..76e4517d1ba685479b159aa88225e5b945872a71 100644 (file)
@@ -85,6 +85,7 @@
 {
     if ([NSApp isOnLeopardOrBetter])
     {
+        #warning only update if change to values
         [[NSApp dockTile] display];
         return;
     }
index 4fb633f4975bbf5e307cd50d7b8b0079c4f7dadc..446315385f6eb3478724d98cfbd691cdbd9af7cb 100644 (file)
@@ -635,11 +635,11 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
     {
         [download cancel];
         
-        NSRunAlertPanel(NSLocalizedString(@"Torrent download failed", @"Download not a torrent -> title"),
+        NSRunAlertPanel(NSLocalizedString(@"Torrent download failed", "Download not a torrent -> title"),
             [NSString stringWithFormat: NSLocalizedString(@"It appears that the file \"%@\" from %@ is not a torrent file.",
-            @"Download not a torrent -> message"), suggestedName,
+            "Download not a torrent -> message"), suggestedName,
             [[[[download request] URL] absoluteString] stringByReplacingPercentEscapesUsingEncoding: NSUTF8StringEncoding]],
-            NSLocalizedString(@"OK", @"Download not a torrent -> button"), nil, nil);
+            NSLocalizedString(@"OK", "Download not a torrent -> button"), nil, nil);
         
         [download release];
     }
@@ -659,11 +659,11 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
 
 - (void) download: (NSURLDownload *) download didFailWithError: (NSError *) error
 {
-    NSRunAlertPanel(NSLocalizedString(@"Torrent download failed", @"Torrent download error -> title"),
-        [NSString stringWithFormat: NSLocalizedString(@"The torrent could not be downloaded from %@ because an error occurred (%@).",
-        @"Torrent download failed -> message"),
+    NSRunAlertPanel(NSLocalizedString(@"Torrent download failed", "Torrent download error -> title"),
+        [NSString stringWithFormat: NSLocalizedString(@"The torrent could not be downloaded from %@: %@.",
+        "Torrent download failed -> message"),
         [[[[download request] URL] absoluteString] stringByReplacingPercentEscapesUsingEncoding: NSUTF8StringEncoding],
-        [error localizedDescription]], NSLocalizedString(@"OK", @"Torrent download failed -> button"), nil, nil);
+        [error localizedDescription]], NSLocalizedString(@"OK", "Torrent download failed -> button"), nil, nil);
     
     [fPendingTorrentDownloads removeObjectForKey: [[download request] URL]];
     [download release];
@@ -958,6 +958,7 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
     if (returnCode != 1)
         return;
     
+    #warning disable OK button when blank
     NSString * urlString = [fURLSheetTextField stringValue];
     if (![urlString isEqualToString: @""])
     {
@@ -971,7 +972,7 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
                                     [urlString substringToIndex: beforeCom],
                                     [urlString substringFromIndex: beforeCom + 1]];
                 else
-                    urlString = [NSString stringWithFormat: @"http://www.%@.com", urlString];
+                    urlString = [NSString stringWithFormat: @"http://www.%@.com/", urlString];
             }
             else
                 urlString = [@"http://" stringByAppendingString: urlString];
@@ -3354,9 +3355,6 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
                 break;
             case SORT_ACTIVITY_TAG:
                 sortType = SORT_ACTIVITY;
-                break;
-            default:
-                sortType = @"";
         }
         
         [menuItem setState: [sortType isEqualToString: [fDefaults stringForKey: @"Sort"]] ? NSOnState : NSOffState];
@@ -3380,9 +3378,6 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
                 break;
             case STATUS_TRANSFER_SESSION_TAG:
                 statusLabel = STATUS_TRANSFER_SESSION;
-                break;
-            default:
-                statusLabel = @"";;
         }
         
         [menuItem setState: [statusLabel isEqualToString: [fDefaults stringForKey: @"StatusLabel"]] ? NSOnState : NSOffState];
index 214d8117ac3de2b972336d58c36be9f993ff9249..125f90ab2d593ef6e767ab5cec5e8985126ac629 100644 (file)
         trackerString = [@"http://" stringByAppendingString: trackerString];
     
     //parse tracker string
+    #warning check if it works with https
     if (tr_httpParseURL([trackerString UTF8String], -1, NULL, NULL, NULL))
     {
         NSAlert * alert = [[[NSAlert alloc] init] autorelease];
         //check common reasons for failure
         NSRange prefixRange = [trackerString rangeOfString: @"://"];
         NSString * prefix = [trackerString substringToIndex: prefixRange.location];
-        if ([prefix caseInsensitiveCompare: @"http"] != NSOrderedSame)
-            [alert setMessageText: NSLocalizedString(@"The tracker address must begin with \"http://\".",
+        if ([prefix caseInsensitiveCompare: @"http"] != NSOrderedSame && [prefix caseInsensitiveCompare: @"https"] != NSOrderedSame)
+            [alert setMessageText: NSLocalizedString(@"The tracker address must begin with \"http://\" or \"https://\".",
                                                     "Create torrent -> warning -> message")];
         else if ([trackerString length] == NSMaxRange(prefixRange)) //don't allow blank addresses
             [alert setMessageText: NSLocalizedString(@"The tracker address cannot be blank.", "Create torrent -> warning -> message")];
index 54d723e10abc0b6312b6fda31b6d79c45cb9aeb8..ef3fe052ca453f35303b52ed4e39ec4355d43b36 100644 (file)
@@ -720,9 +720,10 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
 
 - (NSString *) trackerAddress
 {
-    return [NSString stringWithFormat: @"http://%s:%d", fStat->tracker->address, fStat->tracker->port];
+    return [NSString stringWithUTF8String: fStat->tracker->announce];
 }
 
+#warning now redundant
 - (NSString *) trackerAddressAnnounce
 {
     return [NSString stringWithUTF8String: fStat->tracker->announce];
@@ -779,16 +780,13 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
 {
     NSMutableArray * allTrackers = [NSMutableArray array];
     
-    int i;
-    for (i = 0; i < fInfo->trackerTiers; i++)
+    int i, tier = -1;
+    for (i = 0; i < fInfo->trackerCount; i++)
     {
-        if (separators)
+        if (tier != fInfo->trackers[i].tier)
             [allTrackers addObject: [NSNumber numberWithInt: i]];
         
-        int j;
-        for (j = 0; j < fInfo->trackerList[i].count; j++)
-            [allTrackers addObject: [NSString stringWithFormat: @"http://%s:%d",
-                fInfo->trackerList[i].list[j].address, fInfo->trackerList[i].list[j].port]];
+        [allTrackers addObject: [NSString stringWithUTF8String: fInfo->trackers[i].announce]];
     }
     
     return allTrackers;