-
Notifications
You must be signed in to change notification settings - Fork 0
/
EPBidirectionalCheckerController.m
59 lines (44 loc) · 1.67 KB
/
EPBidirectionalCheckerController.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//
// EPBidirectionalCheckerController.m
// Degrees of Tweetdom
//
// Created by Simone Manganelli on 2008-08-22.
// Copyright 2008 __MyCompanyName__. All rights reserved.
//
#import "EPBidirectionalCheckerController.h"
#import "EPBidirectionalChecker.h"
@implementation EPBidirectionalCheckerController
- (id)init;
{
if (self = [super initWithWindowNibName:@"BidirectionalChecker"]) {
bidirectionalCheckerInstance = [[EPBidirectionalChecker alloc] initWithStatusDelegate:self];
}
return self;
}
- (void)dealloc;
{
[bidirectionalCheckerInstance release];
[super dealloc];
}
- (void)addStatusLine:(NSString *)statusLine;
{
NSString *newStatus = [[statsTextView string] stringByAppendingString:[NSString stringWithFormat:@"%@\n",statusLine]];
[statsTextView performSelectorOnMainThread:@selector(setString:) withObject:newStatus waitUntilDone:YES];
[self performSelectorOnMainThread:@selector(scrollErrorConsoleToBottom) withObject:nil waitUntilDone:NO];
}
- (void)scrollErrorConsoleToBottom;
{
[statsTextView scrollRangeToVisible:NSMakeRange([[statsTextView string] length]-1,1)];
}
- (IBAction)startBidirectionalStatsRetrieval:(id)sender;
{
[statsTextView setString:@""];
[NSThread detachNewThreadSelector:@selector(retrieveBidirectionalStats) toTarget:self withObject:nil];
}
- (void)retrieveBidirectionalStats;
{
NSString *bidirectionalStatsString = [bidirectionalCheckerInstance getFriendAndFollowerRelationshipStatsForTwitterer:[twittererHandleTextField stringValue]
passwordSecureTextField:twittererPasswordTextField];
[statsTextView performSelectorOnMainThread:@selector(setString:) withObject:bidirectionalStatsString waitUntilDone:YES];
}
@end