public
Description: A buildbot GUI for OS X
Homepage: http://code.google.com/p/buildwatch/
Clone URL: git://github.com/dustin/buildwatch.git
dustin (author)
Fri Apr 18 15:45:27 -0700 2008
commit  032c1633ed5540b35f8e855ba0b5c7ca2bd86daf
tree    45b9b129d37e93b55bd3de554b2021d4072abeb9
parent  8e51f56ee75f8449ef2e84e9f8f71cb9f8c45028
buildwatch / Builder.m
100644 113 lines (92 sloc) 2.138 kb
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
//
// Builder.m
// BuildWatch
//
// Created by Dustin Sallings on 3/5/08.
// Copyright 2008 Dustin Sallings <dustin@spy.net>. All rights reserved.
//
 
#import "Builder.h"
 
 
@implementation Builder
 
-(NSString *)description {
    return [NSString stringWithFormat:@"[Builder: %@]", name];
}
 
- (NSString *)name {
    return [[name retain] autorelease];
}
 
- (void)setName:(NSString *)value {
    if (name != value) {
        [name release];
        name = [value copy];
    }
}
 
- (NSString *)state {
    return [[state retain] autorelease];
}
 
- (void)setState:(NSString *)value {
    if (state != value) {
        [state release];
        state = [value copy];
    }
}
 
- (NSString *)step {
    return [[step retain] autorelease];
}
 
- (void)setStep:(NSString *)value {
    if (step != value) {
        [step release];
        step = [value copy];
    }
}
 
- (NSString *)status {
    return [[status retain] autorelease];
}
 
- (void)setStatus:(NSString *)value {
    if (status != value) {
        [self willChangeValueForKey:@"color"];
        [status release];
        status = [value copy];
            [self didChangeValueForKey:@"color"];
    }
}
 
- (NSDate *)eta {
    return [[eta retain] autorelease];
}
 
- (void)setEta:(NSDate *)value {
    if (eta != value) {
        [eta release];
        eta = [value copy];
    }
}
 
- (NSDate *)stepeta {
    return [[stepeta retain] autorelease];
}
 
- (void)setStepeta:(NSDate *)value {
    if (stepeta != value) {
        [stepeta release];
        stepeta = [value copy];
    }
}
 
- (int)lastBuildResult {
    return lastBuildResult;
}
 
- (void)setLastBuildResult:(int)value {
    if (lastBuildResult != value) {
        [self willChangeValueForKey:@"color"];
        lastBuildResult = value;
        [self didChangeValueForKey:@"color"];
    }
}
 
- (NSColor *)color {
    NSColor *rv;
    if([status isEqualToString:@"idle"]) {
        if(lastBuildResult == 0) {
            rv=[NSColor blackColor];
        } else {
            rv=[NSColor redColor];
        }
    } else {
        rv=[NSColor colorWithCalibratedRed:0.0 green:0.5 blue:0.0 alpha:1.0];
    }
    return rv;
}
 
@end