From deeeee3d059b294501dd05008ce2845da25c8832 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Tue, 12 May 2009 00:58:22 +0000 Subject: [PATCH] #2045 hold down option key on launch to start with all torrents paused --- NEWS | 5 +++++ Transmission.xcodeproj/project.pbxproj | 4 ++++ macosx/Controller.h | 1 + macosx/Controller.m | 5 ++++- macosx/Torrent.h | 2 +- macosx/Torrent.m | 4 ++-- 6 files changed, 17 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 9f3866a86..a9c13ac2d 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,10 @@ NEWS file for Transmission +1.70 (2009/mm/dd) + +- Mac + + Hold down the option key on launch to pause all transfers + 1.61 (2009/05/11) - All Platforms diff --git a/Transmission.xcodeproj/project.pbxproj b/Transmission.xcodeproj/project.pbxproj index 80338882f..71de20a9d 100644 --- a/Transmission.xcodeproj/project.pbxproj +++ b/Transmission.xcodeproj/project.pbxproj @@ -86,6 +86,7 @@ A2265F420B5EF5F40093DDA5 /* FileNameCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A2265F400B5EF5F40093DDA5 /* FileNameCell.m */; }; A226FDAC0D0CDF20005A7F71 /* libnatpmp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3C7A118D0D0B2EB800B5701F /* libnatpmp.a */; }; A22A8D560AEEAFA5007E9CB9 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = A22A8D540AEEAFA5007E9CB9 /* Localizable.strings */; }; + A22CFB820FB66EF30009BD3E /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A22CFB810FB66EF30009BD3E /* Carbon.framework */; }; A22D3AA60D00D1790079CFED /* TurtleTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = A22D3AA30D00D1790079CFED /* TurtleTemplate.png */; }; A22E59A70DC11A1D00F4BE15 /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A29EBE700DC06068006CEE80 /* libcurl.dylib */; }; A22E59A80DC11A1F00F4BE15 /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A29EBE700DC06068006CEE80 /* libcurl.dylib */; }; @@ -483,6 +484,7 @@ A22CF7CC0FA5E2DB0009BD3E /* nl */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = nl; path = macosx/nl.lproj/GroupRules.xib; sourceTree = ""; }; A22CF7CF0FA6750E0009BD3E /* tr */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = tr; path = macosx/tr.lproj/GroupRules.xib; sourceTree = ""; }; A22CF7D10FA6A19B0009BD3E /* ru */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ru; path = macosx/ru.lproj/GroupRules.xib; sourceTree = ""; }; + A22CFB810FB66EF30009BD3E /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = ""; }; A22D3AA30D00D1790079CFED /* TurtleTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = TurtleTemplate.png; path = macosx/Images/TurtleTemplate.png; sourceTree = ""; }; A22F1E540E7DA8030065DB9D /* sparkle_dsa_pub.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = sparkle_dsa_pub.pem; path = macosx/sparkle_dsa_pub.pem; sourceTree = ""; }; A231274B0D11D0B7003F9AFF /* AboutWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = AboutWindow.xib; path = macosx/AboutWindow.xib; sourceTree = ""; }; @@ -801,6 +803,7 @@ A261F1DC0A69A1610002815A /* Growl.framework in Frameworks */, A29EBE710DC06068006CEE80 /* libcurl.dylib in Frameworks */, A2E669790F5B8E5A00B4251A /* Security.framework in Frameworks */, + A22CFB820FB66EF30009BD3E /* Carbon.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1062,6 +1065,7 @@ 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */, 29B97325FDCFA39411CA2CEA /* Foundation.framework */, A2E669780F5B8E5A00B4251A /* Security.framework */, + A22CFB810FB66EF30009BD3E /* Carbon.framework */, A261F1DB0A69A1610002815A /* Growl.framework */, A24F19070A3A790800C9C145 /* Sparkle.framework */, ); diff --git a/macosx/Controller.h b/macosx/Controller.h index 77e2dad5b..a9f6c5205 100644 --- a/macosx/Controller.h +++ b/macosx/Controller.h @@ -97,6 +97,7 @@ typedef enum IBOutlet NSButton * fURLSheetOpenButton; BOOL fUpdateInProgress; + BOOL fPauseOnLaunch; Badger * fBadger; IBOutlet NSMenu * fDockMenu; diff --git a/macosx/Controller.m b/macosx/Controller.m index b64a4fd71..c17bc04ea 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -24,6 +24,7 @@ #import #import +#import #import "Controller.h" #import "Torrent.h" @@ -306,6 +307,8 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy [[SUUpdater sharedUpdater] setDelegate: self]; fUpdateInProgress = NO; + + fPauseOnLaunch = (GetCurrentKeyModifiers() & (optionKey | rightOptionKey)) != 0; } return self; } @@ -401,7 +404,7 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy for (NSDictionary * historyItem in history) { Torrent * torrent; - if ((torrent = [[Torrent alloc] initWithHistory: historyItem lib: fLib])) + if ((torrent = [[Torrent alloc] initWithHistory: historyItem lib: fLib forcePause: fPauseOnLaunch])) { [fTorrents addObject: torrent]; [torrent release]; diff --git a/macosx/Torrent.h b/macosx/Torrent.h index e6aa4e532..f2f4bc060 100644 --- a/macosx/Torrent.h +++ b/macosx/Torrent.h @@ -75,7 +75,7 @@ typedef enum - (id) initWithPath: (NSString *) path location: (NSString *) location deleteTorrentFile: (torrentFileState) torrentDelete lib: (tr_session *) lib; - (id) initWithTorrentStruct: (tr_torrent *) torrentStruct location: (NSString *) location lib: (tr_session *) lib; -- (id) initWithHistory: (NSDictionary *) history lib: (tr_session *) lib; +- (id) initWithHistory: (NSDictionary *) history lib: (tr_session *) lib forcePause: (BOOL) pause; - (NSDictionary *) history; diff --git a/macosx/Torrent.m b/macosx/Torrent.m index 8d79f2a37..417203b31 100644 --- a/macosx/Torrent.m +++ b/macosx/Torrent.m @@ -116,7 +116,7 @@ int trashDataFile(const char * filename) return self; } -- (id) initWithHistory: (NSDictionary *) history lib: (tr_session *) lib +- (id) initWithHistory: (NSDictionary *) history lib: (tr_session *) lib forcePause: (BOOL) pause { self = [self initWithHash: [history objectForKey: @"TorrentHash"] path: [history objectForKey: @"TorrentPath"] torrentStruct: NULL lib: lib @@ -132,7 +132,7 @@ int trashDataFile(const char * filename) { //start transfer NSNumber * active; - if ((active = [history objectForKey: @"Active"]) && [active boolValue]) + if (!pause && (active = [history objectForKey: @"Active"]) && [active boolValue]) { fStat = tr_torrentStat(fHandle); [self startTransfer];