1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 01:27:28 +00:00

add a field indicating when the blocklist was last updated

This commit is contained in:
Mitchell Livingston 2008-09-01 03:26:04 +00:00
parent a4f6f04811
commit 05d35d6698
4 changed files with 96 additions and 42 deletions

View file

@ -50,6 +50,7 @@
float oldWidth = [fButton frame].size.width;
[fButton sizeToFit];
NSRect buttonFrame = [fButton frame];
buttonFrame.size.width += 12.0; //sizeToFit sizes a bit too small
buttonFrame.origin.x -= buttonFrame.size.width - oldWidth;
[fButton setFrame: buttonFrame];
@ -94,7 +95,6 @@
[fTextField setStringValue: [NSLocalizedString(@"Processing blocklist", "Blocklist -> message") stringByAppendingEllipsis]];
[fButton setEnabled: NO];
[fStatusWindow display]; //force window to be updated
}
- (void) setFinished

View file

@ -41,7 +41,7 @@
IBOutlet NSTextField * fUploadField, * fDownloadField,
* fSpeedLimitUploadField, * fSpeedLimitDownloadField;
IBOutlet NSTextField * fPeersGlobalField, * fPeersTorrentField, * fBlocklistMessageField;
IBOutlet NSTextField * fPeersGlobalField, * fPeersTorrentField, * fBlocklistMessageField, * fBlocklistDateField;
IBOutlet NSButton * fBlocklistEnableCheck;
PortChecker * fPortChecker;

View file

@ -379,7 +379,7 @@ tr_handle * fHandle;
[fPortStatusImage setImage: [NSImage imageNamed: @"RedDot.png"]];
break;
case PORT_STATUS_ERROR:
[fPortStatusField setStringValue: NSLocalizedString(@"Port check website is down", "Preferences -> Network -> port status")];
[fPortStatusField setStringValue: NSLocalizedString(@"Port check site is down", "Preferences -> Network -> port status")];
[fPortStatusImage setImage: [NSImage imageNamed: @"YellowDot.png"]];
break;
}
@ -479,6 +479,23 @@ tr_handle * fHandle;
[fBlocklistEnableCheck setEnabled: exists];
[fBlocklistEnableCheck setState: exists && [fDefaults boolForKey: @"Blocklist"]];
NSDate * updatedDate = [fDefaults objectForKey: @"BlocklistLastUpdate"];
NSString * updatedDateString;
if (updatedDate)
{
NSDateFormatter * dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateStyle: NSDateFormatterFullStyle];
[dateFormatter setTimeStyle: NSDateFormatterShortStyle];
updatedDateString = [dateFormatter stringFromDate: updatedDate];
[dateFormatter release];
}
else
updatedDateString = NSLocalizedString(@"N/A", "Prefs -> blocklist -> message");
[fBlocklistDateField setStringValue: [NSString stringWithFormat: @"%@: %@",
NSLocalizedString(@"Last updated", "Prefs -> blocklist -> message"), updatedDateString]];
}
- (void) applySpeedSettings: (id) sender

View file

@ -8,8 +8,7 @@
<string key="IBDocument.HIToolboxVersion">352.00</string>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="28"/>
<integer value="1481"/>
<integer value="1361"/>
<integer value="66"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
@ -47,7 +46,7 @@
<string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string>
</object>
<object class="NSCustomView" id="249126185">
<reference key="NSNextResponder"/>
<nil key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@ -357,7 +356,6 @@
</object>
</object>
<string key="NSFrameSize">{535, 272}</string>
<reference key="NSSuperview"/>
<string key="NSClassName">NSView</string>
<string key="NSExtension">NSResponder</string>
</object>
@ -2119,14 +2117,14 @@ AAABAAAAAQ</bytes>
<string key="NSExtension">NSResponder</string>
</object>
<object class="NSCustomView" id="538122014">
<nil key="NSNextResponder"/>
<reference key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSButton" id="130041388">
<reference key="NSNextResponder" ref="538122014"/>
<int key="NSvFlags">256</int>
<string key="NSFrame">{{151, 94}, {184, 18}}</string>
<string key="NSFrame">{{151, 114}, {184, 18}}</string>
<reference key="NSSuperview" ref="538122014"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="261591174">
@ -2148,7 +2146,7 @@ AAABAAAAAQ</bytes>
<object class="NSTextField" id="531465471">
<reference key="NSNextResponder" ref="538122014"/>
<int key="NSvFlags">256</int>
<string key="NSFrame">{{54, 115}, {75, 17}}</string>
<string key="NSFrame">{{54, 135}, {75, 17}}</string>
<reference key="NSSuperview" ref="538122014"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="695755489">
@ -2164,7 +2162,7 @@ AAABAAAAAQ</bytes>
<object class="NSButton" id="142580376">
<reference key="NSNextResponder" ref="538122014"/>
<int key="NSvFlags">256</int>
<string key="NSFrame">{{132, 114}, {165, 18}}</string>
<string key="NSFrame">{{132, 134}, {165, 18}}</string>
<reference key="NSSuperview" ref="538122014"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="478851799">
@ -2186,7 +2184,7 @@ AAABAAAAAQ</bytes>
<object class="NSTextField" id="1068385234">
<reference key="NSNextResponder" ref="538122014"/>
<int key="NSvFlags">256</int>
<string key="NSFrame">{{42, 218}, {87, 17}}</string>
<string key="NSFrame">{{42, 238}, {87, 17}}</string>
<reference key="NSSuperview" ref="538122014"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="759095525">
@ -2202,7 +2200,7 @@ AAABAAAAAQ</bytes>
<object class="NSTextField" id="276894958">
<reference key="NSNextResponder" ref="538122014"/>
<int key="NSvFlags">256</int>
<string key="NSFrame">{{131, 218}, {196, 17}}</string>
<string key="NSFrame">{{131, 238}, {196, 17}}</string>
<reference key="NSSuperview" ref="538122014"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="195557530">
@ -2218,7 +2216,7 @@ AAABAAAAAQ</bytes>
<object class="NSTextField" id="391991918">
<reference key="NSNextResponder" ref="538122014"/>
<int key="NSvFlags">256</int>
<string key="NSFrame">{{332, 216}, {50, 22}}</string>
<string key="NSFrame">{{332, 236}, {50, 22}}</string>
<reference key="NSSuperview" ref="538122014"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="425686317">
@ -2284,7 +2282,7 @@ AAABAAAAAQ</bytes>
<object class="NSTextField" id="171936512">
<reference key="NSNextResponder" ref="538122014"/>
<int key="NSvFlags">256</int>
<string key="NSFrame">{{387, 218}, {39, 17}}</string>
<string key="NSFrame">{{387, 238}, {39, 17}}</string>
<reference key="NSSuperview" ref="538122014"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="120526424">
@ -2300,7 +2298,7 @@ AAABAAAAAQ</bytes>
<object class="NSTextField" id="695790301">
<reference key="NSNextResponder" ref="538122014"/>
<int key="NSvFlags">256</int>
<string key="NSFrame">{{454, 192}, {39, 17}}</string>
<string key="NSFrame">{{454, 212}, {39, 17}}</string>
<reference key="NSSuperview" ref="538122014"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="454043587">
@ -2316,7 +2314,7 @@ AAABAAAAAQ</bytes>
<object class="NSTextField" id="439211863">
<reference key="NSNextResponder" ref="538122014"/>
<int key="NSvFlags">256</int>
<string key="NSFrame">{{399, 190}, {50, 22}}</string>
<string key="NSFrame">{{399, 210}, {50, 22}}</string>
<reference key="NSSuperview" ref="538122014"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="963807331">
@ -2382,7 +2380,7 @@ AAABAAAAAQ</bytes>
<object class="NSTextField" id="210126275">
<reference key="NSNextResponder" ref="538122014"/>
<int key="NSvFlags">256</int>
<string key="NSFrame">{{131, 192}, {263, 17}}</string>
<string key="NSFrame">{{131, 212}, {263, 17}}</string>
<reference key="NSSuperview" ref="538122014"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="250566813">
@ -2398,7 +2396,7 @@ AAABAAAAAQ</bytes>
<object class="NSButton" id="895326079">
<reference key="NSNextResponder" ref="538122014"/>
<int key="NSvFlags">256</int>
<string key="NSFrame">{{132, 150}, {280, 18}}</string>
<string key="NSFrame">{{132, 170}, {280, 18}}</string>
<reference key="NSSuperview" ref="538122014"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="985508058">
@ -2420,7 +2418,7 @@ AAABAAAAAQ</bytes>
<object class="NSTextField" id="593278680">
<reference key="NSNextResponder" ref="538122014"/>
<int key="NSvFlags">256</int>
<string key="NSFrame">{{131, 172}, {259, 14}}</string>
<string key="NSFrame">{{131, 192}, {259, 14}}</string>
<reference key="NSSuperview" ref="538122014"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="32643885">
@ -2433,10 +2431,29 @@ AAABAAAAAQ</bytes>
<reference key="NSTextColor" ref="540507142"/>
</object>
</object>
<object class="NSTextField" id="148151843">
<reference key="NSNextResponder" ref="538122014"/>
<int key="NSvFlags">256</int>
<string key="NSFrame">{{131, 34}, {362, 14}}</string>
<reference key="NSSuperview" ref="538122014"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="782718396">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags2">272760832</int>
<string key="NSContents">Last updated: N/A</string>
<reference key="NSSupport" ref="26"/>
<reference key="NSControlView" ref="148151843"/>
<reference key="NSBackgroundColor" ref="977951849"/>
<object class="NSColor" key="NSTextColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MCAwIDAAA</bytes>
</object>
</object>
</object>
<object class="NSButton" id="902371491">
<reference key="NSNextResponder" ref="538122014"/>
<int key="NSvFlags">256</int>
<string key="NSFrame">{{132, 58}, {289, 18}}</string>
<string key="NSFrame">{{132, 78}, {289, 18}}</string>
<reference key="NSSuperview" ref="538122014"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="245208224">
@ -2458,7 +2475,7 @@ AAABAAAAAQ</bytes>
<object class="NSTextField" id="844132556">
<reference key="NSNextResponder" ref="538122014"/>
<int key="NSvFlags">256</int>
<string key="NSFrame">{{68, 59}, {61, 17}}</string>
<string key="NSFrame">{{68, 79}, {61, 17}}</string>
<reference key="NSSuperview" ref="538122014"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="188659193">
@ -2474,7 +2491,7 @@ AAABAAAAAQ</bytes>
<object class="NSTextField" id="326257173">
<reference key="NSNextResponder" ref="538122014"/>
<int key="NSvFlags">256</int>
<string key="NSFrame">{{212, 36}, {306, 17}}</string>
<string key="NSFrame">{{212, 56}, {306, 17}}</string>
<reference key="NSSuperview" ref="538122014"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="234963311">
@ -2490,7 +2507,7 @@ AAABAAAAAQ</bytes>
<object class="NSButton" id="826556979">
<reference key="NSNextResponder" ref="538122014"/>
<int key="NSvFlags">256</int>
<string key="NSFrame">{{128, 26}, {85, 32}}</string>
<string key="NSFrame">{{128, 46}, {85, 32}}</string>
<reference key="NSSuperview" ref="538122014"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="650733440">
@ -2531,7 +2548,8 @@ AAABAAAAAQ</bytes>
</object>
</object>
</object>
<string key="NSFrameSize">{535, 258}</string>
<string key="NSFrameSize">{535, 278}</string>
<reference key="NSSuperview"/>
<string key="NSClassName">NSView</string>
<string key="NSExtension">NSResponder</string>
</object>
@ -2853,7 +2871,7 @@ AAABAAAAAQ</bytes>
<object class="NSTextField" id="992746122">
<reference key="NSNextResponder" ref="204700639"/>
<int key="NSvFlags">256</int>
<string key="NSFrame">{{339, 279}, {154, 17}}</string>
<string key="NSFrame">{{339, 279}, {179, 17}}</string>
<reference key="NSSuperview" ref="204700639"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="931894024">
@ -3127,7 +3145,7 @@ AAABAAAAAQ</bytes>
<string key="NSExtension">NSResponder</string>
</object>
<object class="NSCustomView" id="810116101">
<reference key="NSNextResponder"/>
<nil key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@ -3495,7 +3513,6 @@ AAABAAAAAQ</bytes>
</object>
<string key="NSFrame">{{1, 17}, {331, 95}}</string>
<reference key="NSSuperview" ref="122119447"/>
<reference key="NSNextKeyView" ref="173651346"/>
<reference key="NSDocView" ref="173651346"/>
<reference key="NSBGColor" ref="729660797"/>
<int key="NScvFlags">4</int>
@ -3528,7 +3545,6 @@ AAABAAAAAQ</bytes>
</object>
<string key="NSFrame">{{1, 0}, {331, 17}}</string>
<reference key="NSSuperview" ref="122119447"/>
<reference key="NSNextKeyView" ref="520862816"/>
<reference key="NSDocView" ref="520862816"/>
<reference key="NSBGColor" ref="729660797"/>
<int key="NScvFlags">4</int>
@ -3537,7 +3553,6 @@ AAABAAAAAQ</bytes>
</object>
<string key="NSFrame">{{103, 63}, {348, 113}}</string>
<reference key="NSSuperview" ref="810116101"/>
<reference key="NSNextKeyView" ref="206862330"/>
<int key="NSsFlags">18</int>
<reference key="NSVScroller" ref="220703981"/>
<reference key="NSHScroller" ref="383062716"/>
@ -3660,15 +3675,10 @@ AAABAAAAAQ</bytes>
</object>
</object>
<string key="NSFrameSize">{535, 444}</string>
<reference key="NSSuperview"/>
<string key="NSClassName">NSView</string>
<string key="NSExtension">NSResponder</string>
</object>
<object class="NSUserDefaultsController" id="356871564">
<object class="NSMutableArray" key="NSDeclaredKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>SUEnableAutomaticChecks</string>
</object>
<bool key="NSSharedInstance">YES</bool>
</object>
</object>
@ -6486,6 +6496,14 @@ AAABAAAAAQ</bytes>
</object>
<int key="connectionID">1737</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">fBlocklistDateField</string>
<reference key="source" ref="511492310"/>
<reference key="destination" ref="148151843"/>
</object>
<int key="connectionID">1740</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@ -7865,6 +7883,7 @@ AAABAAAAAQ</bytes>
<reference ref="326257173"/>
<reference ref="826556979"/>
<reference ref="117148406"/>
<reference ref="148151843"/>
</object>
<reference key="parent" ref="37013934"/>
<string key="objectName">Peers</string>
@ -8832,6 +8851,20 @@ AAABAAAAAQ</bytes>
<reference key="object" ref="63707525"/>
<reference key="parent" ref="191075786"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">1738</int>
<reference key="object" ref="148151843"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="782718396"/>
</object>
<reference key="parent" ref="538122014"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">1739</int>
<reference key="object" ref="782718396"/>
<reference key="parent" ref="148151843"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
@ -9032,6 +9065,8 @@ AAABAAAAAQ</bytes>
<string>1733.CustomClassName</string>
<string>1733.IBPluginDependency</string>
<string>1733.ImportedFromIB2</string>
<string>1738.IBPluginDependency</string>
<string>1738.ImportedFromIB2</string>
<string>190.IBPluginDependency</string>
<string>190.ImportedFromIB2</string>
<string>192.IBPluginDependency</string>
@ -9270,7 +9305,7 @@ AAABAAAAAQ</bytes>
<reference ref="761722050"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="761722050"/>
<string>{{469, 604}, {535, 258}}</string>
<string>{{38, 470}, {535, 278}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="761722050"/>
<string>{{281, 577}, {539, 315}}</string>
@ -9318,7 +9353,7 @@ AAABAAAAAQ</bytes>
<reference ref="761722050"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="761722050"/>
<string>{{414, 530}, {535, 444}}</string>
<string>{{414, 376}, {535, 444}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="761722050"/>
<string>{{281, 577}, {539, 315}}</string>
@ -9430,6 +9465,8 @@ AAABAAAAAQ</bytes>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="761722050"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<real value="1.000000e+00"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="761722050"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="761722050"/>
@ -9506,7 +9543,7 @@ AAABAAAAAQ</bytes>
<reference ref="761722050"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="761722050"/>
<string>{{392, 399}, {535, 272}}</string>
<string>{{55, 399}, {535, 272}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="761722050"/>
<string>{{0, 701}, {539, 272}}</string>
@ -9604,7 +9641,7 @@ AAABAAAAAQ</bytes>
<reference ref="761722050"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="761722050"/>
<string>{{290, 369}, {535, 319}}</string>
<string>{{24, 369}, {535, 319}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="761722050"/>
<string>{{281, 577}, {539, 315}}</string>
@ -9658,7 +9695,7 @@ AAABAAAAAQ</bytes>
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">1737</int>
<int key="maxID">1740</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@ -9768,7 +9805,6 @@ AAABAAAAAQ</bytes>
<string>setAutoSpeedLimit:</string>
<string>setBadge:</string>
<string>setBlocklistEnabled:</string>
<string>setCheckForUpdate:</string>
<string>setDownloadLocation:</string>
<string>setEncryptionMode:</string>
<string>setGlobalLimit:</string>
@ -9844,7 +9880,6 @@ AAABAAAAAQ</bytes>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="outlets">
@ -9852,6 +9887,7 @@ AAABAAAAAQ</bytes>
<object class="NSMutableArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>fBandwidthView</string>
<string>fBlocklistDateField</string>
<string>fBlocklistEnableCheck</string>
<string>fBlocklistMessageField</string>
<string>fDownloadField</string>
@ -9889,6 +9925,7 @@ AAABAAAAAQ</bytes>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>NSView</string>
<string>NSTextField</string>
<string>NSButton</string>
<string>NSTextField</string>
<string>NSTextField</string>