1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 09:37:56 +00:00

trivial changes

This commit is contained in:
Mitchell Livingston 2008-09-07 16:08:29 +00:00
parent 389439e552
commit 5b2f63e781
5 changed files with 17 additions and 16 deletions

View file

@ -47,7 +47,7 @@ AboutWindowController * fAboutBoxInstance = nil;
[[NSBundle mainBundle] pathForResource: @"Credits" ofType: @"rtf"] documentAttributes: nil] autorelease]]; [[NSBundle mainBundle] pathForResource: @"Credits" ofType: @"rtf"] documentAttributes: nil] autorelease]];
//size license button //size license button
float oldButtonWidth = [fLicenseButton frame].size.width; CGFloat oldButtonWidth = [fLicenseButton frame].size.width;
[fLicenseButton setTitle: NSLocalizedString(@"License", "About window -> license button")]; [fLicenseButton setTitle: NSLocalizedString(@"License", "About window -> license button")];
[fLicenseButton sizeToFit]; [fLicenseButton sizeToFit];

View file

@ -29,12 +29,12 @@
{ {
tr_handle * fLib; tr_handle * fLib;
int fCompleted; NSInteger fCompleted;
//tiger-only fields //tiger-only fields
NSImage * fDockIcon, * fBadge; NSImage * fDockIcon, * fBadge;
NSDictionary * fAttributes; NSDictionary * fAttributes;
int fCompletedBadged; NSInteger fCompletedBadged;
BOOL fSpeedBadge, fQuittingTiger; BOOL fSpeedBadge, fQuittingTiger;
} }

View file

@ -47,7 +47,7 @@
{ {
[fButton setTitle: NSLocalizedString(@"Cancel", "Blocklist -> cancel button")]; [fButton setTitle: NSLocalizedString(@"Cancel", "Blocklist -> cancel button")];
float oldWidth = [fButton frame].size.width; CGFloat oldWidth = [fButton frame].size.width;
[fButton sizeToFit]; [fButton sizeToFit];
NSRect buttonFrame = [fButton frame]; NSRect buttonFrame = [fButton frame];
buttonFrame.size.width += 12.0; //sizeToFit sizes a bit too small buttonFrame.size.width += 12.0; //sizeToFit sizes a bit too small

View file

@ -36,7 +36,7 @@ typedef enum
{ {
id fDelegate; id fDelegate;
port_status_t fStatus; port_status_t fStatus;
int fPortNumber; NSInteger fPortNumber;
NSURLConnection * fConnection; NSURLConnection * fConnection;
NSMutableData * fPortProbeData; NSMutableData * fPortProbeData;
@ -44,10 +44,9 @@ typedef enum
NSTimer * fTimer; NSTimer * fTimer;
} }
- (id) initForPort: (int) portNumber delay: (BOOL) delay withDelegate: (id) delegate; - (id) initForPort: (NSInteger) portNumber delay: (BOOL) delay withDelegate: (id) delegate;
- (void) cancelProbe; - (void) cancelProbe;
- (void) callBackWithStatus: (port_status_t) status;
- (port_status_t) status; - (port_status_t) status;
@end @end

View file

@ -32,11 +32,13 @@
- (void) startProbe; - (void) startProbe;
- (void) callBackWithStatus: (port_status_t) status;
@end @end
@implementation PortChecker @implementation PortChecker
- (id) initForPort: (int) portNumber delay: (BOOL) delay withDelegate: (id) delegate - (id) initForPort: (NSInteger) portNumber delay: (BOOL) delay withDelegate: (id) delegate
{ {
if ((self = [super init])) if ((self = [super init]))
{ {
@ -77,14 +79,6 @@
[fConnection cancel]; [fConnection cancel];
} }
- (void) callBackWithStatus: (port_status_t) status
{
fStatus = status;
if (fDelegate && [fDelegate respondsToSelector: @selector(portCheckerDidFinishProbing:)])
[fDelegate performSelectorOnMainThread: @selector(portCheckerDidFinishProbing:) withObject: self waitUntilDone: NO];
}
- (void) connection: (NSURLConnection *) connection didReceiveResponse: (NSURLResponse *) response - (void) connection: (NSURLConnection *) connection didReceiveResponse: (NSURLResponse *) response
{ {
[fPortProbeData setLength: 0]; [fPortProbeData setLength: 0];
@ -149,5 +143,13 @@
} }
} }
- (void) callBackWithStatus: (port_status_t) status
{
fStatus = status;
if (fDelegate && [fDelegate respondsToSelector: @selector(portCheckerDidFinishProbing:)])
[fDelegate performSelectorOnMainThread: @selector(portCheckerDidFinishProbing:) withObject: self waitUntilDone: NO];
}
@end @end