Skip to content

Commit

Permalink
add cancel button to task output window
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswayoub committed Nov 2, 2014
1 parent 5a3b007 commit 55da9ed
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
2 changes: 2 additions & 0 deletions Vagrant Manager/TaskOutputWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
@property (weak) IBOutlet NSTextField *taskCommandLabel;
@property (weak) IBOutlet NSTextField *taskStatusLabel;
@property (weak) IBOutlet NSButton *closeWindowButton;
@property (weak) IBOutlet NSButton *cancelButton;

- (IBAction)closeButtonClicked:(id)sender;
- (IBAction)cancelButtonClicked:(id)sender;

@end
5 changes: 5 additions & 0 deletions Vagrant Manager/TaskOutputWindow.m
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ - (void)taskCompletion:(NSNotification*)notif {
[closeButton setEnabled:YES];

[self.closeWindowButton setEnabled:YES];
[self.cancelButton setHidden:YES];

if(task.terminationStatus != 0) {
self.taskStatusLabel.stringValue = @"Completed with errors";
Expand Down Expand Up @@ -107,4 +108,8 @@ - (IBAction)closeButtonClicked:(id)sender {
[self close];
}

- (IBAction)cancelButtonClicked:(id)sender {
[self.task interrupt];
}

@end
25 changes: 20 additions & 5 deletions Vagrant Manager/TaskOutputWindow.xib
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="4514" systemVersion="13B42" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6245" systemVersion="14A389" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="4514"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6245"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="TaskOutputWindow">
<connections>
<outlet property="cancelButton" destination="hbl-VT-EZm" id="y4i-uN-2MO"/>
<outlet property="closeWindowButton" destination="L35-tt-XDn" id="1CK-wL-Pub"/>
<outlet property="outputTextView" destination="yGv-xC-aVr" id="Jmj-YV-czD"/>
<outlet property="progressBar" destination="Hgf-UO-j1p" id="jUn-8I-xti"/>
Expand All @@ -15,8 +16,8 @@
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application"/>
<window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" wantsToBeColor="NO" animationBehavior="default" id="1">
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" animationBehavior="default" id="1">
<windowStyleMask key="styleMask" titled="YES" miniaturizable="YES" resizable="YES"/>
<rect key="contentRect" x="196" y="240" width="480" height="311"/>
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1178"/>
Expand Down Expand Up @@ -87,11 +88,25 @@
<action selector="closeButtonClicked:" target="-2" id="RNy-tG-2tU"/>
</connections>
</button>
<button verticalHuggingPriority="750" id="hbl-VT-EZm">
<rect key="frame" x="256" y="13" width="83" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="push" title="Cancel" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="bii-yL-w9F">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
<string key="keyEquivalent" base64-UTF8="YES">
Gw
</string>
</buttonCell>
<connections>
<action selector="cancelButtonClicked:" target="-2" id="NCT-Pb-GS5"/>
</connections>
</button>
</subviews>
</view>
<connections>
<outlet property="delegate" destination="-2" id="4"/>
</connections>
</window>
</objects>
</document>
</document>

0 comments on commit 55da9ed

Please sign in to comment.