1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-25 17:17:31 +00:00

#1295 Sync "Start when added" with libtransmission

This commit is contained in:
Mitchell Livingston 2010-03-26 02:28:41 +00:00
parent 638485c5b6
commit 72a7337266
4 changed files with 29 additions and 27 deletions

View file

@ -281,6 +281,8 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
[fDefaults objectForKey: @"SpeedLimitAutoOffDate"]]);
tr_bencDictAddInt(&settings, TR_PREFS_KEY_ALT_SPEED_TIME_DAY, [fDefaults integerForKey: @"SpeedLimitAutoDay"]);
tr_bencDictAddBool(&settings, TR_PREFS_KEY_START, [fDefaults boolForKey: @"AutoStartDownload"]);
tr_bencDictAddInt(&settings, TR_PREFS_KEY_DSPEED, [fDefaults integerForKey: @"DownloadLimit"]);
tr_bencDictAddBool(&settings, TR_PREFS_KEY_DSPEED_ENABLED, [fDefaults boolForKey: @"CheckDownload"]);
tr_bencDictAddInt(&settings, TR_PREFS_KEY_USPEED, [fDefaults integerForKey: @"UploadLimit"]);

View file

@ -92,6 +92,8 @@
- (void) setBlocklistAutoUpdate: (id) sender;
- (void) updateBlocklistFields;
- (void) setAutoStartDownloads: (id) sender;
- (void) setBadge: (id) sender;
- (void) resetWarnings: (id) sender;

View file

@ -556,6 +556,11 @@ tr_session * fHandle;
NSLocalizedString(@"Last updated", "Prefs -> blocklist -> message"), updatedDateString]];
}
- (void) setAutoStartDownloads: (id) sender
{
tr_sessionSetPaused(fHandle, ![fDefaults boolForKey: @"AutoStartDownload"]);
}
- (void) applySpeedSettings: (id) sender
{
tr_sessionLimitSpeed(fHandle, TR_UP, [fDefaults boolForKey: @"CheckUpload"]);
@ -1142,6 +1147,10 @@ tr_session * fHandle;
const BOOL dht = tr_sessionIsDHTEnabled(fHandle);
[fDefaults setBool: dht forKey: @"DHTGlobal"];
//auto start
const BOOL autoStart = !tr_sessionGetPaused(fHandle);
[fDefaults setBool: autoStart forKey: @"AutoStartDownload"];
//port
const tr_port port = tr_sessionGetPeerPort(fHandle);
[fDefaults setInteger: port forKey: @"BindPort"];

View file

@ -12,7 +12,7 @@
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="41"/>
<integer value="255"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@ -1944,6 +1944,7 @@ AAC/05GAAAAAAAAAAAAAAAAAAAAAAHRleHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDEwAA</
</object>
<string key="NSFrame">{{1, 1}, {141, 169}}</string>
<reference key="NSSuperview" ref="544077474"/>
<reference key="NSNextKeyView" ref="638525082"/>
<reference key="NSDocView" ref="638525082"/>
<reference key="NSBGColor" ref="729660797"/>
<int key="NScvFlags">4</int>
@ -1971,6 +1972,7 @@ AAC/05GAAAAAAAAAAAAAAAAAAAAAAHRleHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDEwAA</
</object>
<string key="NSFrame">{{20, 49}, {143, 171}}</string>
<reference key="NSSuperview" ref="284666863"/>
<reference key="NSNextKeyView" ref="568562479"/>
<int key="NSsFlags">530</int>
<reference key="NSVScroller" ref="287972127"/>
<reference key="NSHScroller" ref="781866080"/>
@ -2240,7 +2242,7 @@ AAC/05GAAAAAAAAAAAAAAAAAAAAAAHRleHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDEwAA</
<string key="NSClassName">NSView</string>
</object>
<object class="NSCustomView" id="352903881">
<reference key="NSNextResponder"/>
<nil key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@ -2249,7 +2251,6 @@ AAC/05GAAAAAAAAAAAAAAAAAAAAAAHRleHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDEwAA</
<int key="NSvFlags">256</int>
<string key="NSFrame">{{302, 185}, {50, 22}}</string>
<reference key="NSSuperview" ref="352903881"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="671472167">
<int key="NSCellFlags">-1804468671</int>
@ -2312,7 +2313,6 @@ AAC/05GAAAAAAAAAAAAAAAAAAAAAAHRleHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDEwAA</
<int key="NSvFlags">256</int>
<string key="NSFrame">{{178, 160}, {100, 18}}</string>
<reference key="NSSuperview" ref="352903881"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="157187468">
<int key="NSCellFlags">67239424</int>
@ -2335,7 +2335,6 @@ AAC/05GAAAAAAAAAAAAAAAAAAAAAAHRleHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDEwAA</
<int key="NSvFlags">256</int>
<string key="NSFrame">{{302, 159}, {50, 22}}</string>
<reference key="NSSuperview" ref="352903881"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="213372896">
<int key="NSCellFlags">-1804468671</int>
@ -2398,7 +2397,6 @@ AAC/05GAAAAAAAAAAAAAAAAAAAAAAHRleHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDEwAA</
<int key="NSvFlags">256</int>
<string key="NSFrame">{{178, 186}, {118, 18}}</string>
<reference key="NSSuperview" ref="352903881"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="651662374">
<int key="NSCellFlags">67239424</int>
@ -2421,7 +2419,6 @@ AAC/05GAAAAAAAAAAAAAAAAAAAAAAHRleHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDEwAA</
<int key="NSvFlags">256</int>
<string key="NSFrame">{{357, 186}, {34, 17}}</string>
<reference key="NSSuperview" ref="352903881"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="598167921">
<int key="NSCellFlags">67239424</int>
@ -2438,7 +2435,6 @@ AAC/05GAAAAAAAAAAAAAAAAAAAAAAHRleHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDEwAA</
<int key="NSvFlags">256</int>
<string key="NSFrame">{{357, 160}, {34, 17}}</string>
<reference key="NSSuperview" ref="352903881"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="366797017">
<int key="NSCellFlags">67239424</int>
@ -2455,7 +2451,6 @@ AAC/05GAAAAAAAAAAAAAAAAAAAAAAHRleHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDEwAA</
<int key="NSvFlags">256</int>
<string key="NSFrame">{{17, 187}, {158, 17}}</string>
<reference key="NSSuperview" ref="352903881"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="916691300">
<int key="NSCellFlags">67239424</int>
@ -2472,7 +2467,6 @@ AAC/05GAAAAAAAAAAAAAAAAAAAAAAHRleHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDEwAA</
<int key="NSvFlags">256</int>
<string key="NSFrame">{{302, 117}, {50, 22}}</string>
<reference key="NSSuperview" ref="352903881"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="521814699">
<int key="NSCellFlags">-1804468671</int>
@ -2535,7 +2529,6 @@ AAC/05GAAAAAAAAAAAAAAAAAAAAAAHRleHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDEwAA</
<int key="NSvFlags">256</int>
<string key="NSFrame">{{302, 91}, {50, 22}}</string>
<reference key="NSSuperview" ref="352903881"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="783238913">
<int key="NSCellFlags">-1804468671</int>
@ -2598,7 +2591,6 @@ AAC/05GAAAAAAAAAAAAAAAAAAAAAAHRleHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDEwAA</
<int key="NSvFlags">256</int>
<string key="NSFrame">{{357, 118}, {34, 17}}</string>
<reference key="NSSuperview" ref="352903881"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="826580374">
<int key="NSCellFlags">67239424</int>
@ -2615,7 +2607,6 @@ AAC/05GAAAAAAAAAAAAAAAAAAAAAAHRleHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDEwAA</
<int key="NSvFlags">256</int>
<string key="NSFrame">{{357, 92}, {34, 17}}</string>
<reference key="NSSuperview" ref="352903881"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="389698940">
<int key="NSCellFlags">67239424</int>
@ -2632,7 +2623,6 @@ AAC/05GAAAAAAAAAAAAAAAAAAAAAAHRleHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDEwAA</
<int key="NSvFlags">256</int>
<string key="NSFrame">{{53, 119}, {122, 17}}</string>
<reference key="NSSuperview" ref="352903881"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="162938096">
<int key="NSCellFlags">67239424</int>
@ -2649,7 +2639,6 @@ AAC/05GAAAAAAAAAAAAAAAAAAAAAAHRleHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDEwAA</
<int key="NSvFlags">256</int>
<string key="NSFrame">{{177, 93}, {82, 17}}</string>
<reference key="NSSuperview" ref="352903881"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="646507129">
<int key="NSCellFlags">67239424</int>
@ -2666,7 +2655,6 @@ AAC/05GAAAAAAAAAAAAAAAAAAAAAAHRleHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDEwAA</
<int key="NSvFlags">256</int>
<string key="NSFrame">{{177, 119}, {100, 17}}</string>
<reference key="NSSuperview" ref="352903881"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="1023099604">
<int key="NSCellFlags">67239424</int>
@ -2683,7 +2671,6 @@ AAC/05GAAAAAAAAAAAAAAAAAAAAAAHRleHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDEwAA</
<int key="NSvFlags">256</int>
<string key="NSFrame">{{177, 73}, {348, 14}}</string>
<reference key="NSSuperview" ref="352903881"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="229954658">
<int key="NSCellFlags">67239424</int>
@ -2712,7 +2699,6 @@ AAC/05GAAAAAAAAAAAAAAAAAAAAAAHRleHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDEwAA</
</object>
<string key="NSFrame">{{35, 119}, {20, 14}}</string>
<reference key="NSSuperview" ref="352903881"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSImageCell" key="NSCell" id="916608870">
<int key="NSCellFlags">130560</int>
@ -2733,7 +2719,6 @@ AAC/05GAAAAAAAAAAAAAAAAAAAAAAHRleHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDEwAA</
<int key="NSvFlags">256</int>
<string key="NSFrame">{{178, 49}, {160, 18}}</string>
<reference key="NSSuperview" ref="352903881"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="881251804">
<int key="NSCellFlags">67239424</int>
@ -2756,7 +2741,6 @@ AAC/05GAAAAAAAAAAAAAAAAAAAAAAHRleHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDEwAA</
<int key="NSvFlags">256</int>
<string key="NSFrame">{{402, 23}, {17, 17}}</string>
<reference key="NSSuperview" ref="352903881"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="314009658">
<int key="NSCellFlags">67239424</int>
@ -2773,7 +2757,6 @@ AAC/05GAAAAAAAAAAAAAAAAAAAAAAHRleHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDEwAA</
<int key="NSvFlags">256</int>
<string key="NSFrame">{{314, 20}, {86, 27}}</string>
<reference key="NSSuperview" ref="352903881"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSDatePickerCell" key="NSCell" id="1041237499">
<int key="NSCellFlags">71433728</int>
@ -2822,7 +2805,6 @@ AAABAAAAAQ</bytes>
<int key="NSvFlags">256</int>
<string key="NSFrame">{{424, 20}, {86, 27}}</string>
<reference key="NSSuperview" ref="352903881"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSDatePickerCell" key="NSCell" id="283024896">
<int key="NSCellFlags">71433728</int>
@ -2845,7 +2827,6 @@ AAABAAAAAQ</bytes>
<int key="NSvFlags">256</int>
<string key="NSFrame">{{196, 17}, {113, 26}}</string>
<reference key="NSSuperview" ref="352903881"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSPopUpButtonCell" key="NSCell" id="159778332">
<int key="NSCellFlags">-2076049856</int>
@ -3008,8 +2989,6 @@ AAABAAAAAQ</bytes>
</object>
</object>
<string key="NSFrameSize">{542, 227}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<string key="NSClassName">NSView</string>
<string key="NSExtension">NSResponder</string>
</object>
@ -7899,6 +7878,14 @@ AAABAAAAAQ</bytes>
</object>
<int key="connectionID">1944</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">setAutoStartDownloads:</string>
<reference key="source" ref="511492310"/>
<reference key="destination" ref="511956256"/>
</object>
<int key="connectionID">1946</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@ -11796,7 +11783,7 @@ AAABAAAAAQ</bytes>
<real value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<real value="1"/>
<string>{{333, 387}, {542, 307}}</string>
<string>{{333, 401}, {542, 307}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<real value="1"/>
<string>{{429, 310}, {539, 288}}</string>
@ -11914,7 +11901,7 @@ AAABAAAAAQ</bytes>
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">1944</int>
<int key="maxID">1946</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@ -12078,6 +12065,7 @@ AAABAAAAAQ</bytes>
<string>setAutoSpeedLimit:</string>
<string>setAutoSpeedLimitDay:</string>
<string>setAutoSpeedLimitTime:</string>
<string>setAutoStartDownloads:</string>
<string>setAutoUpdateToBeta:</string>
<string>setBadge:</string>
<string>setBlocklistAutoUpdate:</string>
@ -12176,6 +12164,7 @@ AAABAAAAAQ</bytes>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="outlets">