Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Open build URLs on double-click.

  • Loading branch information...
commit 72e501a6b28fff9c798754ff4e1f6169d38d955c 1 parent f0ea409
@dustin authored
View
11 BuildWatchAppDelegate.py
@@ -37,6 +37,14 @@ def connected(self, remote):
self.remote = remote
remote.callRemote("subscribe", self.events, 5, self)
+ def _getBuildURL(self, buildername, build):
+ def _gotBuildURL(u, buildername):
+ self.queue.put(lambda b: b.gotURL_forBuilder_(u, buildername))
+
+ d = self.remote.callRemote("getURLForThing", build)
+ d.addCallback(_gotBuildURL, buildername)
+ d.addErrback(log.err)
+
def remote_builderAdded(self, buildername, builder):
self.queue.put(lambda b: b.builderAdded_(buildername))
@@ -58,6 +66,8 @@ def _gotBuild(b):
d.addCallback(_gotLastBuildResult)
d.addErrback(log.err)
+ self._getBuildURL(buildername, b)
+
d = builder.callRemote("getLastFinishedBuild")
d.addCallback(_gotBuild)
d.addErrback(log.err)
@@ -71,6 +81,7 @@ def remote_builderChangedState(self, buildername, state, eta):
def remote_buildStarted(self, buildername, build):
self.queue.put(lambda b: b.buildStarted_(buildername))
+ self._getBuildURL(buildername, build)
def remote_buildFinished(self, buildername, build, result):
self.queue.put(lambda b:
View
4 Builder.h
@@ -23,6 +23,7 @@
NSDate *stepeta;
NSDate *eta;
+ NSString *url;
}
- (NSString *)name;
@@ -52,6 +53,9 @@
- (BOOL)isBuilding;
- (BOOL)online;
+- (void)setURL:(NSString *)to;
+- (NSString *)url;
+
- (NSColor *)color;
@end
View
9 Builder.m
@@ -120,6 +120,15 @@ - (BOOL)online
return ! [status isEqualToString:@"offline"];
}
+- (void)setURL:(NSString *)to {
+ [url release];
+ url = [to retain];
+}
+
+- (NSString *)url {
+ return [[url retain] autorelease];
+}
+
- (NSColor *)color {
NSColor *rv;
if([status isEqualToString:@"idle"]) {
View
4 Category.m
@@ -31,6 +31,10 @@ -(NSString *)step {
return nil;
}
+-(NSString *)url {
+ return nil;
+}
+
-(NSString *)eta {
NSDate *rv = nil;
View
51 English.lproj/MainMenu.xib
@@ -8,9 +8,9 @@
<string key="IBDocument.HIToolboxVersion">353.00</string>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="473"/>
- <integer value="506"/>
<integer value="410"/>
+ <integer value="372"/>
+ <integer value="473"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -1849,6 +1849,34 @@
</object>
<int key="connectionID">552</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBBindingConnection" key="connection">
+ <string key="label">doubleClickTarget: self</string>
+ <reference key="source" ref="130650362"/>
+ <reference key="destination" ref="544662920"/>
+ <object class="NSNibBindingConnector" key="connector">
+ <reference key="NSSource" ref="130650362"/>
+ <reference key="NSDestination" ref="544662920"/>
+ <string key="NSLabel">doubleClickTarget: self</string>
+ <string key="NSBinding">doubleClickTarget</string>
+ <string key="NSKeyPath">self</string>
+ <object class="NSDictionary" key="NSOptions">
+ <string key="NS.key.0">NSSelectorName</string>
+ <string key="NS.object.0">onDoubleClick:</string>
+ </object>
+ <int key="NSNibBindingConnectorVersion">2</int>
+ </object>
+ </object>
+ <int key="connectionID">556</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">treeController</string>
+ <reference key="source" ref="544662920"/>
+ <reference key="destination" ref="843485273"/>
+ </object>
+ <int key="connectionID">558</int>
+ </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -3247,7 +3275,7 @@
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">553</int>
+ <int key="maxID">558</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -3283,9 +3311,22 @@
<object class="IBPartialClassDescription">
<string key="className">MainController</string>
<string key="superclassName">NSWindowController</string>
+ <object class="NSMutableDictionary" key="actions">
+ <string key="NS.key.0">onDoubleClick:</string>
+ <string key="NS.object.0">id</string>
+ </object>
<object class="NSMutableDictionary" key="outlets">
- <string key="NS.key.0">clock</string>
- <string key="NS.object.0">NSTextField</string>
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMutableArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>clock</string>
+ <string>treeController</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>NSTextField</string>
+ <string>NSTreeController</string>
+ </object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
View
3  MainController.h
@@ -11,8 +11,11 @@
@interface MainController : NSWindowController {
+ IBOutlet NSTreeController *treeController;
IBOutlet NSTextField *clock;
}
+-(IBAction)onDoubleClick:(id)sender;
+
@end
View
12 MainController.m
@@ -26,4 +26,16 @@ -(void)awakeFromNib {
repeats:YES];
}
+-(IBAction)onDoubleClick:(id)sender {
+ NSArray *selected = [treeController selectedObjects];
+ if (selected != nil && [selected count] > 0) {
+ NSString *urlStr = [[selected objectAtIndex: 0] url];
+ if (urlStr != nil) {
+ NSURL *url=[NSURL URLWithString:urlStr];
+ NSLog(@"Opening %@", url);
+ [[NSWorkspace sharedWorkspace] openURL:url];
+ }
+ }
+}
+
@end
View
6 MessageBridge.m
@@ -100,6 +100,12 @@ -(void)gotBuildResult:(NSString *)buildername result:(int)result {
[b setLastBuildResult:result];
}
+-(void)gotURL:(NSString *)url forBuilder:(NSString *)buildername {
+ NSLog(@"Got URL: %@ for builder: %@", url, buildername);
+ Builder *b=[builderDict valueForKey:buildername];
+ [b setURL: url];
+}
+
-(void)buildFinished:(NSString *)buildername result:(int)result {
NSLog(@"A build finished on %@ -- result: %d", buildername, result);
Builder *b=[builderDict valueForKey:buildername];
Please sign in to comment.
Something went wrong with that request. Please try again.