Skip to content

Commit

Permalink
Added support for Xcode 6.0, 6.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellallison committed Jan 2, 2015
1 parent b54cc6a commit 974b9ed
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 12 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## 1.2

Features:

- Added support for Xcode 6.0, 6.1.

Note:

- Updated to accommodate for API changes in Yosemite. As a result, WarningLights now requires the OS X 10.10 SDK.

## 1.1

Features:
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
WarningLights
=============

An Xcode plug-in that flashes your Philips Hue light bulbs different colours depending on the result of your build.
An Xcode plug-in that flashes your Philips Hue light bulbs different colours depending on the outcome of your build.

Installation
------------

To install Warning Lights, pull the repository and perform a build. A bundle is then compiled and stored at ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins. On next launch, the plug-in will be active.
To install Warning Lights, pull the repository and perform a build. A bundle is then compiled and stored at ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins. On next launch, the plug-in will be active. Alternatively, use [Alcatraz][alcatraz].

Note: WarningLights requires the OS X 10.10 SDK and Yosemite to build.

Upgrading from 1.0
------------------
Expand Down Expand Up @@ -34,3 +36,5 @@ Once configured, it is simple to select light flashes for varying build results.

<img src="https://raw.github.com/mitchellallison/WarningLights/master/WLMenu.png" alt="Warning Lights menu" height="400px"/>

[Alcatraz]: https://github.com/supermarin/Alcatraz

2 changes: 1 addition & 1 deletion WarningLightsXcodePlugin/WLMenuItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
- (instancetype)initWithTitle:(NSString *)aString action:(SEL)aSelector keyEquivalent:(NSString *)charCode;

/*! Maintains the state of the WLMenuItem. See WLMenuItemToggleType for the different types of state. */
@property (nonatomic) WLMenuItemToggleType state;
@property (nonatomic) WLMenuItemToggleType toggleType;

@end
7 changes: 4 additions & 3 deletions WarningLightsXcodePlugin/WLMenuItem.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(WLMenuItemView *)me
if ([keyPath isEqualToString:@"state"])
{
// Store state locally
_state = [[change objectForKey:NSKeyValueChangeNewKey] integerValue];
_toggleType = [[change objectForKey:NSKeyValueChangeNewKey] integerValue];

// Call the selector
if ([self.target respondsToSelector:selector])
Expand All @@ -53,10 +53,11 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(WLMenuItemView *)me
}

// Delegate state change to the toggle
- (void)setState:(WLMenuItemToggleType)state
- (void)setToggleType:(WLMenuItemToggleType)toggleType
{
WLMenuItemView *view = (WLMenuItemView *)self.view;
[view updateWithState:state];
_toggleType = toggleType;
[view updateWithState:toggleType];
}

@end
1 change: 1 addition & 0 deletions WarningLightsXcodePlugin/WLMenuItemView.m
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ - (instancetype)init
[self.descriptionLabel setTextColor:[NSColor grayColor]];
[self.descriptionLabel setStringValue:@""];
[self.descriptionLabel setAlphaValue:0.0];
[self.descriptionLabel setDrawsBackground:NO];

[self addSubview:self.descriptionLabel];

Expand Down
1 change: 0 additions & 1 deletion WarningLightsXcodePlugin/WLMenuItemViewToggle.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

@property (strong) NSColor *fillColor;
@property (strong) NSColor *strokeColor;
@property BOOL highlighted;

/*! Initialises a toggle with a fill color and stroke color.
*\param fill The fill NSColor for the toggle.
Expand Down
2 changes: 1 addition & 1 deletion WarningLightsXcodePlugin/WLMenuItemViewToggle.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ - (void)drawRect:(NSRect)dirtyRect
CGContextSetLineWidth(graphicsContext, lineWidth);

// If highlighted or in NSOnState
if (self.highlighted || self.state) {
if (self.isHighlighted || self.state) {

// Highlight the button with a grey circular shadow.
CGContextSetFillColorWithColor(graphicsContext, [NSColor opaqueGray].CGColor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<string>1</string>
<key>DVTPlugInCompatibilityUUIDs</key>
<array>
<string>C4A681B0-4A26-480E-93EC-1218098B9AA0</string>
<string>37B30044-3B14-46BA-ABAA-F01000C27B63</string>
<string>A2E4D43F-41F4-4FB9-BB94-7177011C9AED</string>
</array>
Expand Down
8 changes: 4 additions & 4 deletions WarningLightsXcodePlugin/WarningLightsXcodePlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ - (void)lightsFound:(NSArray *)lights
if ([ids containsObject:light.uniqueID])
{
[selectedLights addObject:light];
[lightItem setState:[[lightOptionsMap objectForKey:light.uniqueID] integerValue]];
[lightItem setToggleType:[[lightOptionsMap objectForKey:light.uniqueID] integerValue]];
}

[lightItem.view layoutSubtreeIfNeeded];
Expand Down Expand Up @@ -225,7 +225,7 @@ - (void)setupMenuBarItem
- (void)lightSelectionChangedWithItem:(WLMenuItem *)lightMenuItem
{
HueLight *light = [hueController lightWithName:lightMenuItem.title];
NSInteger state = lightMenuItem.state;
NSInteger state = lightMenuItem.toggleType;
if (light)
{
if ([selectedLights containsObject:light])
Expand Down Expand Up @@ -361,7 +361,7 @@ - (void)buildOperationDidStop:(NSNotification *)notification

[selectedLights enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
HueLight *light = (HueLight *)obj;

// Get the light selections, and only perform the flashes below if the option was turned on.
WLMenuItemToggleType options = [[lightOptionsMap objectForKey:light.uniqueID] integerValue];

Expand Down Expand Up @@ -395,7 +395,7 @@ - (void)buildOperationDidStop:(NSNotification *)notification
[light popStateWithTransitionTime:20];
}];
}

// The build log reported none of the above. Flash the selected light green.
if (errors + warnings + analyzed == 0 && ((options & WLMenuItemToggleTypeSuccess) == WLMenuItemToggleTypeSuccess))
{
Expand Down

0 comments on commit 974b9ed

Please sign in to comment.